Skip to content

Commit 50b68c3

Browse files
Zie619claude
andcommitted
fix: TypeScript SDK build fixes for npm publish
- Add DOM lib for RequestInfo/Headers types - Fix unused parameter prefix - Fix Headers iteration compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b482bf2 commit 50b68c3

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

.github/workflows/ai-bom-example.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,24 @@ jobs:
8686
format: "table"
8787
fail-on: "high"
8888
scan-level: "deep"
89+
90+
# ──────────────────────────────────────────────
91+
# Job 5: Cedar policy gate
92+
# ──────────────────────────────────────────────
93+
# Uses a Cedar-like policy file to enforce fine-grained rules
94+
# on discovered AI components. Fails the pipeline if any
95+
# component violates a policy rule.
96+
cedar-policy-gate:
97+
name: Cedar policy gate
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v4
101+
102+
- name: Run AI-BOM scan with Cedar policy
103+
uses: trusera/ai-bom@main
104+
with:
105+
path: "."
106+
format: "table"
107+
scan-level: "deep"
108+
policy-gate: "true"
109+
cedar-policy-file: ".cedar/ai-policy.cedar"

trusera-sdk-js/src/interceptor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class TruseraInterceptor {
263263
status: response.status,
264264
status_text: response.statusText,
265265
duration_ms: Date.now() - startTime,
266-
response_headers: Object.fromEntries(response.headers.entries()),
266+
response_headers: (() => { const h: Record<string, string> = {}; response.headers.forEach((v, k) => { h[k] = v; }); return h; })(),
267267
}
268268
);
269269
self.client?.track(responseEvent);
@@ -283,7 +283,7 @@ export class TruseraInterceptor {
283283
* Extracts request data for policy evaluation and tracking.
284284
*/
285285
private async extractRequestData(
286-
input: RequestInfo | URL,
286+
_input: RequestInfo | URL,
287287
init?: RequestInit
288288
): Promise<{ headers: Record<string, string>; body: string | null }> {
289289
const headers: Record<string, string> = {};

trusera-sdk-js/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
/* Language and Environment */
44
"target": "ES2022",
5-
"lib": ["ES2022"],
5+
"lib": ["ES2022", "DOM"],
66
"module": "NodeNext",
77
"moduleResolution": "NodeNext",
88

0 commit comments

Comments
 (0)