@attestry/sdk 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +1269 -0
  3. package/dist/client.d.ts +58 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +74 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/constants.d.ts +7 -0
  8. package/dist/constants.d.ts.map +1 -0
  9. package/dist/constants.js +43 -0
  10. package/dist/constants.js.map +1 -0
  11. package/dist/errors.d.ts +16 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +41 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/index.d.ts +17 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +20 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/lines-parser.d.ts +50 -0
  20. package/dist/lines-parser.d.ts.map +1 -0
  21. package/dist/lines-parser.js +211 -0
  22. package/dist/lines-parser.js.map +1 -0
  23. package/dist/ndjson-parser.d.ts +57 -0
  24. package/dist/ndjson-parser.d.ts.map +1 -0
  25. package/dist/ndjson-parser.js +245 -0
  26. package/dist/ndjson-parser.js.map +1 -0
  27. package/dist/resources/abac-policies.d.ts +1034 -0
  28. package/dist/resources/abac-policies.d.ts.map +1 -0
  29. package/dist/resources/abac-policies.js +1519 -0
  30. package/dist/resources/abac-policies.js.map +1 -0
  31. package/dist/resources/audit-log.d.ts +588 -0
  32. package/dist/resources/audit-log.d.ts.map +1 -0
  33. package/dist/resources/audit-log.js +629 -0
  34. package/dist/resources/audit-log.js.map +1 -0
  35. package/dist/resources/batch.d.ts +845 -0
  36. package/dist/resources/batch.d.ts.map +1 -0
  37. package/dist/resources/batch.js +1074 -0
  38. package/dist/resources/batch.js.map +1 -0
  39. package/dist/resources/chat.d.ts +151 -0
  40. package/dist/resources/chat.d.ts.map +1 -0
  41. package/dist/resources/chat.js +124 -0
  42. package/dist/resources/chat.js.map +1 -0
  43. package/dist/resources/check.d.ts +348 -0
  44. package/dist/resources/check.d.ts.map +1 -0
  45. package/dist/resources/check.js +543 -0
  46. package/dist/resources/check.js.map +1 -0
  47. package/dist/resources/compliance-check.d.ts +330 -0
  48. package/dist/resources/compliance-check.d.ts.map +1 -0
  49. package/dist/resources/compliance-check.js +402 -0
  50. package/dist/resources/compliance-check.js.map +1 -0
  51. package/dist/resources/decisions.d.ts +1208 -0
  52. package/dist/resources/decisions.d.ts.map +1 -0
  53. package/dist/resources/decisions.js +1362 -0
  54. package/dist/resources/decisions.js.map +1 -0
  55. package/dist/resources/evidence-pack.d.ts +1080 -0
  56. package/dist/resources/evidence-pack.d.ts.map +1 -0
  57. package/dist/resources/evidence-pack.js +1789 -0
  58. package/dist/resources/evidence-pack.js.map +1 -0
  59. package/dist/resources/gate.d.ts +613 -0
  60. package/dist/resources/gate.d.ts.map +1 -0
  61. package/dist/resources/gate.js +737 -0
  62. package/dist/resources/gate.js.map +1 -0
  63. package/dist/resources/incidents.d.ts +136 -0
  64. package/dist/resources/incidents.d.ts.map +1 -0
  65. package/dist/resources/incidents.js +229 -0
  66. package/dist/resources/incidents.js.map +1 -0
  67. package/dist/resources/regulatory-changes.d.ts +307 -0
  68. package/dist/resources/regulatory-changes.d.ts.map +1 -0
  69. package/dist/resources/regulatory-changes.js +365 -0
  70. package/dist/resources/regulatory-changes.js.map +1 -0
  71. package/dist/resources/safe-input-read.d.ts +21 -0
  72. package/dist/resources/safe-input-read.d.ts.map +1 -0
  73. package/dist/resources/safe-input-read.js +57 -0
  74. package/dist/resources/safe-input-read.js.map +1 -0
  75. package/dist/resources/ship-gate.d.ts +475 -0
  76. package/dist/resources/ship-gate.d.ts.map +1 -0
  77. package/dist/resources/ship-gate.js +727 -0
  78. package/dist/resources/ship-gate.js.map +1 -0
  79. package/dist/resources/vision.d.ts +540 -0
  80. package/dist/resources/vision.d.ts.map +1 -0
  81. package/dist/resources/vision.js +1036 -0
  82. package/dist/resources/vision.js.map +1 -0
  83. package/dist/retry.d.ts +103 -0
  84. package/dist/retry.d.ts.map +1 -0
  85. package/dist/retry.js +224 -0
  86. package/dist/retry.js.map +1 -0
  87. package/dist/sse-parser.d.ts +64 -0
  88. package/dist/sse-parser.d.ts.map +1 -0
  89. package/dist/sse-parser.js +271 -0
  90. package/dist/sse-parser.js.map +1 -0
  91. package/dist/transport.d.ts +142 -0
  92. package/dist/transport.d.ts.map +1 -0
  93. package/dist/transport.js +455 -0
  94. package/dist/transport.js.map +1 -0
  95. package/dist/types.d.ts +61 -0
  96. package/dist/types.d.ts.map +1 -0
  97. package/dist/types.js +3 -0
  98. package/dist/types.js.map +1 -0
  99. package/package.json +44 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abac-policies.js","sourceRoot":"","sources":["../../src/resources/abac-policies.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,mEAAmE;AACnE,6BAA6B;AAC7B,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,uEAAuE;AACvE,uEAAuE;AACvE,oEAAoE;AACpE,kEAAkE;AAClE,kEAAkE;AAClE,mEAAmE;AACnE,6BAA6B;AAC7B,EAAE;AACF,wDAAwD;AACxD,8DAA8D;AAC9D,oEAAoE;AACpE,kEAAkE;AAClE,kEAAkE;AAClE,iEAAiE;AACjE,oEAAoE;AACpE,oEAAoE;AACpE,kEAAkE;AAClE,EAAE;AACF,6DAA6D;AAC7D,oEAAoE;AACpE,sEAAsE;AACtE,gEAAgE;AAChE,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,sBAAsB;AACtB,oEAAoE;AACpE,iEAAiE;AACjE,uEAAuE;AACvE,qEAAqE;AACrE,aAAa;AACb,uEAAuE;AACvE,sDAAsD;AACtD,qEAAqE;AACrE,gEAAgE;A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ACpE,MAAM,IAAI,aAAa,CACrB,GAAG,UAAU,8CAA8C;YACzD,uBAAuB,YAAY,CAAC,eAAe,CAAC,GAAG,CAC1D,CAAC;IACJ,CAAC;IAED,wDAAwD;IACxD,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,aAAa,CACrB,GAAG,UAAU,+CAA+C;YAC1D,QAAQ,YAAY,CAAC,SAAS,CAAC,GAAG,CACrC,CAAC;IACJ,CAAC;IAED,iCAAiC;IACjC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,aAAa,CACrB,GAAG,UAAU,+CAA+C;YAC1D,QAAQ,YAAY,CAAC,SAAS,CAAC,GAAG,CACrC,CAAC;IACJ,CAAC;IAED,OAAO,MAAoB,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IACzC,OAAO,OAAO,KAAK,CAAC;AACtB,CAAC"}
@@ -0,0 +1,588 @@
1
+ import type { AttestryClient } from "../client.js";
2
+ import type { RequestOptions } from "../types.js";
3
+ /**
4
+ * Public closed-enum of supported wire formats. Mirrors the kernel's
5
+ * `VALID_FORMATS` const at `src/lib/audit-log/export-helpers.ts:15-19`.
6
+ * Drift-pinned in `src/lib/incidents/__tests__/sdk-drift.test.ts`.
7
+ *
8
+ * Forward-compat: when a future format is added (e.g., `csv`), bump the
9
+ * SDK minor version and extend this array. The kernel's parseFormat
10
+ * function returns 400 for any value outside this set; the SDK
11
+ * pre-rejects invalid values synchronously as `TypeError` (build-round
12
+ * D5 — closed-enum input validates at the SDK boundary so the failure
13
+ * is faster + clearer than waiting for the server's 400).
14
+ */
15
+ export declare const AUDIT_LOG_EXPORT_FORMATS: readonly ["jsonl", "ecs", "cef"];
16
+ export type AuditLogExportFormat = (typeof AUDIT_LOG_EXPORT_FORMATS)[number];
17
+ /**
18
+ * Wire shape for `format=jsonl`. Source-of-truth at kernel
19
+ * `src/lib/audit-log/export-helpers.ts:115-150` (`rowToWireJson`).
20
+ *
21
+ * Stable wire format — distinct from the raw Drizzle row, so a column
22
+ * rename in the DB doesn't churn the wire. The SDK mirrors this verbatim;
23
+ * a kernel-side rename surfaces via the drift pin in `sdk-drift.test.ts`.
24
+ *
25
+ * `details` is `unknown` (jsonb) — the kernel emits whatever the row's
26
+ * `details` column contains (any JSON value, OR null when the column
27
+ * was null). Consumers parse based on the row's `action` (e.g.,
28
+ * `"login"` → `{userAgent, ip}` shape; `"settings_updated"` →
29
+ * `{key, oldValue, newValue}`). Forward-compatible with future kernel
30
+ * action additions — the SDK does NOT enforce a per-action shape.
31
+ *
32
+ * `entryHash` / `previousEntryHash` form the audit-log's tamper-evidence
33
+ * chain: `entryHash` is `sha256:<hex64>` over the row's canonical
34
+ * payload; `previousEntryHash` is the prior row's `entryHash` (or null
35
+ * for the very first row OR for rows ingested before chaining was
36
+ * enabled). Consumers verify the chain by replaying — same conceptual
37
+ * shape as decisions.verifyChain, but for audit events.
38
+ */
39
+ export interface AuditLogRecord {
40
+ /** UUID. */
41
+ id: string;
42
+ /** ISO-8601 UTC, microsecond precision (`YYYY-MM-DDTHH:MM:SS.sssZ`). */
43
+ timestamp: string;
44
+ /** UUID — the org that owns the row. Same as the caller's auth org. */
45
+ orgId: string;
46
+ /** UUID; null for cron / system actions where no user is involved. */
47
+ userId: string | null;
48
+ /** E.g. `"login"`, `"decision.created"`, `"webhook_endpoint_created"`. */
49
+ action: string;
50
+ /** E.g. `"session"`, `"decision_record"`, `"webhook_endpoint"`. */
51
+ resourceType: string | null;
52
+ /** ID of the affected resource (UUID for db rows; key for opaque ids). */
53
+ resourceId: string | null;
54
+ /** jsonb — any JSON value OR null. Per-action shape varies. */
55
+ details: unknown;
56
+ /** Source IP (INET → string). Null for non-network actions. */
57
+ ipAddress: string | null;
58
+ /** UA string. Null for non-browser actors. */
59
+ userAgent: string | null;
60
+ /** Session id (opaque). Null for non-session actors (api-key, cron). */
61
+ sessionId: string | null;
62
+ /**
63
+ * `sha256:<hex64>` — hash of canonical row payload. NULL for rows
64
+ * ingested before tamper-evidence chaining was enabled.
65
+ */
66
+ entryHash: string | null;
67
+ /**
68
+ * Previous row's `entryHash`. NULL for the very first row in the
69
+ * chain OR for rows ingested before chaining.
70
+ */
71
+ previousEntryHash: string | null;
72
+ }
73
+ /**
74
+ * Input shape for `auditLog.export(input?)`. All fields optional.
75
+ *
76
+ * Defaults applied server-side AND mirrored in the SDK's input
77
+ * validation:
78
+ * - `format`: defaults to `"jsonl"` (kernel's `parseFormat` default)
79
+ * - `cursor`: defaults to none (start from the most-recent row)
80
+ * - `limit`: defaults to 1000 (kernel's `DEFAULT_LIMIT`)
81
+ * - `autoPaginate`: defaults to `true` (SDK-side; kernel has no opinion)
82
+ *
83
+ * `cursor` flow: the SDK reads `x-attestry-next-cursor` from each
84
+ * page's response headers and passes it as `?cursor=<value>` on the
85
+ * next page. Auto-pagination consumers don't need to manage cursors
86
+ * themselves; explicit-cursor consumers call `export()` with
87
+ * `autoPaginate: false` and inspect... actually, the SDK CANNOT expose
88
+ * the response header through the async-iterator protocol cleanly.
89
+ * For explicit-cursor mode today, consumers call `export()` with
90
+ * `autoPaginate: false`, drain the iterator (one page worth of rows),
91
+ * and call again with the previously-returned next-cursor. (Returning
92
+ * the cursor through the iterator's protocol would require a
93
+ * non-standard hybrid shape; documented as build-round D3.)
94
+ */
95
+ export interface AuditLogExportInput {
96
+ /**
97
+ * Wire format. Defaults to `"jsonl"` if omitted. The SDK pre-validates
98
+ * against `AUDIT_LOG_EXPORT_FORMATS` and throws `TypeError` synchronously
99
+ * for any value outside the closed enum (build-round D5).
100
+ */
101
+ format?: AuditLogExportFormat;
102
+ /**
103
+ * Cursor. Compound `<ISO-8601-UTC>:<UUID>` (preferred — strict tuple
104
+ * ordering across same-timestamp rows) OR bare ISO-8601 UTC (legacy
105
+ * fallback — may skip same-microsecond rows; the kernel emits this
106
+ * shape only on requests-from-old-clients but accepts both forms).
107
+ * The SDK forwards verbatim — kernel's regex is the format authority.
108
+ */
109
+ cursor?: string;
110
+ /**
111
+ * Page size. 1-5000; kernel clamps to 5000 silently. SDK rejects
112
+ * `NaN` / `Infinity` / `<= 0` / non-integer as TypeError (more
113
+ * strict than kernel's silent coerce-to-1000 — fail-loud-and-
114
+ * synchronous; build-round D4).
115
+ */
116
+ limit?: number;
117
+ /**
118
+ * When `true` (the default), the iterator transparently walks all
119
+ * pages until the kernel stops emitting `x-attestry-next-cursor`.
120
+ * When `false`, the iterator yields only the first page's rows and
121
+ * stops; consumers fetch the next page by calling `export()` again
122
+ * with the next cursor. (Caller-managed-cursor mode is documented
123
+ * but cumbersome — see JSDoc on the input field.)
124
+ */
125
+ autoPaginate?: boolean;
126
+ }
127
+ /**
128
+ * Result of `client.auditLog.verifyChain()`. Source-of-truth lives at
129
+ * the kernel route `src/app/api/v1/audit-chain/verify/route.ts:66-73`
130
+ * (the `successResponse({...})` literal) and `src/lib/crypto/audit-chain.ts:50-55`
131
+ * (the `verifyAuditChain` return-type literal that the route uses).
132
+ *
133
+ * **Critical contract**: this shape is returned for BOTH valid and
134
+ * invalid chains. `valid: false` is NOT an error — the kernel answered
135
+ * the customer's question (is this audit log tampered?) and the SDK
136
+ * resolves the Promise with the verdict body. Top-level structural
137
+ * failures (auth, rate limit, internal) throw `AttestryAPIError`.
138
+ * **Mirror of `decisions.verifyChain`'s contract** (carry-forward
139
+ * invariant #12 — chainValid:false / valid:false is a verdict, not
140
+ * an error).
141
+ *
142
+ * **Field semantics**:
143
+ * - `valid`: `true` iff every audit-log entry's `entryHash`
144
+ * matches the recomputed hash AND every entry's
145
+ * `previousEntryHash` matches the prior entry's `entryHash`.
146
+ * Empty audit logs verify as `true` (vacuous truth).
147
+ * - `entriesVerified`: count of entries verified successfully
148
+ * BEFORE the first broken link (or all entries on a valid
149
+ * chain). On a tampered chain, equals the broken entry's index
150
+ * in the ordered list; consumers can show "verified up to N
151
+ * entries". `0` on empty logs AND when the very first entry
152
+ * fails verification.
153
+ * - `totalEntries`: total count of audit-log entries fetched
154
+ * (post-truncation — the kernel caps at 5000 entries via the
155
+ * `.limit(5000)` clause at `route.ts:51`; orgs with more than
156
+ * 5000 entries see only the oldest 5000 verified).
157
+ * - `firstEntry`: ISO-8601 UTC timestamp of the OLDEST entry in
158
+ * the fetched window. `null` if `totalEntries === 0`. Always
159
+ * present in the body (kernel emits it unconditionally with
160
+ * null fallback at `route.ts:63`); ALWAYS-PRESENT field on the
161
+ * wire even though its value may be null.
162
+ * - `lastEntry`: ISO-8601 UTC timestamp of the NEWEST entry in
163
+ * the fetched window. `null` if `totalEntries === 0`. Same
164
+ * emission semantics as `firstEntry`.
165
+ * - `brokenAt`: UUID of the entry where the chain broke, OR
166
+ * **OMITTED ENTIRELY from the wire when the chain is intact**.
167
+ * The kernel uses a conditional spread:
168
+ * `...(result.brokenAtId ? { brokenAt: result.brokenAtId } : {})`
169
+ * so the field is an own-property only on broken chains. The
170
+ * SDK preserves this faithfully — consumers detect "broken
171
+ * chain" via `result.valid === false` (closed-enum boolean),
172
+ * NOT via `result.brokenAt === undefined` (which is
173
+ * prototype-pollution-unsafe — see the JSDoc on `verifyChain()`
174
+ * for the full rationale).
175
+ *
176
+ * **Silent kernel-side truncation** (invariant #50): the kernel's
177
+ * audit-log fetch is capped at 5000 entries (`route.ts:51`). For an
178
+ * org with >5000 audit-log entries, the verifier sees only the
179
+ * oldest 5000; the newest entries are NOT verified by this call.
180
+ * The kernel does NOT emit a "truncated" flag — `totalEntries`
181
+ * equals the number of rows fetched, NOT the org's full audit-log
182
+ * row count. **Documented kernel surface gap**; the SDK does NOT
183
+ * mask. A future kernel raise to a higher limit or pagination would
184
+ * be additive (the SDK forwards `totalEntries` verbatim).
185
+ *
186
+ * **Mirror of `decisions.verifyChain`'s `ChainVerificationResult`
187
+ * but with different field names** — the org-wide audit-log
188
+ * verifier is a separate kernel function with separate vocabulary:
189
+ * - `valid` vs decisions' `chainValid`
190
+ * - `entriesVerified` vs decisions' `lastVerifiedSequence`
191
+ * - `totalEntries` vs decisions' `recordCount`
192
+ * - `brokenAt` (single UUID, optional own-property) vs decisions'
193
+ * `tamperedRecordIds: string[]` + `brokenRecordIds: string[]`
194
+ * (always-present arrays, distinguish security vs ops)
195
+ * Drift-pinned kernel-side in `sdk-drift.test.ts` (build round).
196
+ */
197
+ export interface AuditChainVerificationResult {
198
+ /**
199
+ * `true` iff the org's audit-log hash chain is intact. Empty logs
200
+ * verify as `true` (vacuous truth). On `false`, inspect `brokenAt`
201
+ * for the offending entry's UUID.
202
+ */
203
+ valid: boolean;
204
+ /**
205
+ * Count of entries verified successfully BEFORE the first broken
206
+ * link. Equals `totalEntries` on a valid chain; less than
207
+ * `totalEntries` on a broken chain (consumers show "verified up
208
+ * to N entries").
209
+ */
210
+ entriesVerified: number;
211
+ /**
212
+ * Total entries fetched by the kernel. **Capped at 5000 per call**
213
+ * by the kernel's `.limit(5000)` at `route.ts:51`. For orgs with
214
+ * more than 5000 audit-log entries, this is the number of rows
215
+ * verified, NOT the org's full audit-log row count. Documented
216
+ * kernel surface gap.
217
+ */
218
+ totalEntries: number;
219
+ /**
220
+ * ISO-8601 UTC timestamp of the OLDEST entry in the fetched
221
+ * window. `null` if `totalEntries === 0`. Always present on the
222
+ * wire (kernel emits the field unconditionally with null
223
+ * fallback at `route.ts:63`).
224
+ */
225
+ firstEntry: string | null;
226
+ /**
227
+ * ISO-8601 UTC timestamp of the NEWEST entry in the fetched
228
+ * window. `null` if `totalEntries === 0`. Same emission semantics
229
+ * as `firstEntry`.
230
+ */
231
+ lastEntry: string | null;
232
+ /**
233
+ * UUID of the entry where the chain broke. **OMITTED from the
234
+ * wire when the chain is intact** — the kernel uses a conditional
235
+ * spread `...(result.brokenAtId ? { brokenAt: result.brokenAtId } : {})`
236
+ * at `route.ts:72`. On a valid chain, the field is NOT an
237
+ * own-property of the response. Consumers detect "broken chain"
238
+ * via `result.valid === false` (the closed-enum boolean is the
239
+ * pollution-safe discriminator); reading `result.brokenAt`
240
+ * yields `undefined` on a valid chain.
241
+ */
242
+ brokenAt?: string;
243
+ }
244
+ /**
245
+ * AuditLog resource — sibling to `IncidentsResource`, `DecisionsResource`,
246
+ * `ChatResource`. Today wraps two endpoints (`export` + `verifyChain`);
247
+ * the class is the landing pad for future audit-log methods.
248
+ */
249
+ export declare class AuditLogResource {
250
+ private readonly client;
251
+ constructor(client: AttestryClient);
252
+ /**
253
+ * Stream audit-log rows in the requested format. Returns an
254
+ * async-iterable that yields per-row frames.
255
+ *
256
+ * **Format-discriminated yield types** (TypeScript narrows via the
257
+ * overload signatures):
258
+ * - `format: "jsonl"` (default) → `AsyncIterable<AuditLogRecord>`
259
+ * - `format: "ecs"` → `AsyncIterable<unknown>` (consumer parses ECS event)
260
+ * - `format: "cef"` → `AsyncIterable<string>` (raw CEF lines)
261
+ *
262
+ * **Auto-pagination** (default — `autoPaginate !== false`): the
263
+ * iterator transparently walks back through history, fetching the
264
+ * next page whenever the current page exhausts and the kernel emits
265
+ * `x-attestry-next-cursor`. Stops when the kernel's response omits
266
+ * the header (last page).
267
+ *
268
+ * **Single-page mode** (`autoPaginate: false`): the iterator yields
269
+ * only the first page's rows then stops. The next-cursor IS NOT
270
+ * exposed through the iterator protocol — consumers either pass
271
+ * `autoPaginate` (default) and trust the SDK to walk, OR pass an
272
+ * explicit `cursor` they tracked from a previous response (rare;
273
+ * the response header isn't surfaced through the iterator today —
274
+ * build-round D3).
275
+ *
276
+ * **Dual-auth admin scope**: the kernel route gates on
277
+ * `requireSessionOrApiKey(request, { sessionRoles: ["admin"],
278
+ * apiKeyPermissions: [API_KEY_PERMISSIONS.ADMIN] })` — the identical
279
+ * dual-auth pattern the abacPolicies cluster uses. The SDK's
280
+ * transport always sends `x-api-key`, so the api-key path is the
281
+ * only one reachable from SDK consumers: **HTTP 401** for no /
282
+ * invalid / expired api-key, **HTTP 403** for a valid api-key whose
283
+ * permissions do NOT include `ADMIN`. Pin BOTH branches separately.
284
+ * (Corrected — session-22 hostile review #2: the prior "401 for
285
+ * both" claim mis-read the kernel test, which MOCKS the auth error;
286
+ * the real dual-auth middleware returns 403 for insufficient
287
+ * permission, same as the abacPolicies cluster.)
288
+ *
289
+ * **Order**: rows arrive DESC by `(timestamp, id)` — newest first.
290
+ * Auto-pagination preserves this order across page boundaries.
291
+ *
292
+ * **Errors thrown FROM the iterator** (long-lived stream semantics —
293
+ * symmetric with `decisions.stream` / `decisions.export`):
294
+ * - `AttestryAPIError` (status 400) — invalid `format` (server-side;
295
+ * SDK pre-rejects via TypeError), or invalid `cursor` (malformed
296
+ * ISO/UUID).
297
+ * - `AttestryAPIError` (status 401) — no / invalid / expired
298
+ * api-key.
299
+ * - `AttestryAPIError` (status 403) — a valid api-key whose
300
+ * permissions do NOT include `ADMIN`. Distinct from 401 — pin
301
+ * both branches separately.
302
+ * - `AttestryAPIError` (status 429) — rate limit (auto-retried by
303
+ * default; initial fetch only — invariant #20 — but each page's
304
+ * INITIAL fetch is independent so 429-on-page-2 retries cleanly).
305
+ * - `AttestryAPIError` (status 500) — internal error during streaming;
306
+ * scrubbed message.
307
+ * - `AttestryAPIError` — wrong content-type for the requested format
308
+ * (proxy / LB error page wrapped at 200; the transport's
309
+ * `expectedContentType` guard fails fast).
310
+ * - `AttestryError("auditLog.export: NDJSON line was not a JSON object")` —
311
+ * defensive; the kernel always emits objects in `jsonl` / `ecs`.
312
+ * - `AttestryError("auditLog.export: NDJSON record missing required
313
+ * fields or wrong type")` — defensive; jsonl-mode shape validation
314
+ * fails. Server emits the rowToWireJson shape verbatim.
315
+ * - `AttestryError("network error during stream: ...")` — TCP drop /
316
+ * proxy hang-up mid-stream. Wrapped by the parser primitives.
317
+ * - `AttestryError("request aborted by caller")` — `options.signal`
318
+ * fired (pre-aborted or mid-flight).
319
+ * - `TypeError` (synchronous, no fetch issued) — input failed
320
+ * SDK-side validation.
321
+ *
322
+ * **Notably ABSENT from the error surface**:
323
+ * - **No 402 plan-limit** — admin-only; no per-org quota gate.
324
+ * - **No 422** — the route uses inline string parsing, not Zod, for
325
+ * query params. Format validation returns 400 (not 422 like
326
+ * decisions.list).
327
+ * - **No 404** — orgId is implicit from auth; cross-org access is
328
+ * impossible (rows filtered by `auth.orgId`).
329
+ * - **No 413** — kernel's `MAX_LIMIT = 5000` is enforced by silent
330
+ * clamp, not 413. A request with `limit=10000` succeeds with
331
+ * 5000 rows.
332
+ * - **No "stream ended without trailer" error** — different from
333
+ * `decisions.export`. The audit-log/export route does NOT emit a
334
+ * body trailer; the cursor lives in headers, the empty page is
335
+ * a valid stop signal. (Build-round D8.)
336
+ *
337
+ * **SDK-side validation** (synchronous `TypeError`, no fetch issued):
338
+ * - `input` itself: optional; when provided, must be a non-null,
339
+ * non-array object.
340
+ * - `input.format`: optional; one of `"jsonl"` / `"ecs"` / `"cef"`
341
+ * when provided. Pre-validated against the closed enum
342
+ * (`AUDIT_LOG_EXPORT_FORMATS`).
343
+ * - `input.cursor`: optional; non-empty string when provided.
344
+ * Lone-surrogate guard via `assertEncodableQueryString`
345
+ * (carry-forward invariant #32). Format check (compound
346
+ * `<ISO>:<UUID>` regex) deferred to server's `parseCursor`.
347
+ * - `input.limit`: optional; positive finite integer when provided.
348
+ * `NaN` / `Infinity` / `<= 0` / non-integer rejected. (Kernel's
349
+ * silent coerce-to-1000 is more permissive — SDK rejects loudly;
350
+ * build-round D4.)
351
+ * - `input.autoPaginate`: optional; boolean when provided.
352
+ *
353
+ * **Lazy**: the request is NOT issued until the first iteration.
354
+ * Pass `options.signal` for cancellation — pre-aborted causes the
355
+ * first iteration to throw `AttestryError` with no fetch issued;
356
+ * mid-flight abort surfaces as `AttestryError` from the iterator.
357
+ *
358
+ * @example Walk all admin events, newest first
359
+ * ```ts
360
+ * for await (const row of client.auditLog.export()) {
361
+ * // row: AuditLogRecord
362
+ * if (row.action === "api_key_created") notify(row);
363
+ * }
364
+ * ```
365
+ *
366
+ * @example ECS for SIEM ingest
367
+ * ```ts
368
+ * for await (const event of client.auditLog.export({ format: "ecs" })) {
369
+ * // event: unknown — consumer parses as ECS 8.x
370
+ * await elasticIngest(event);
371
+ * }
372
+ * ```
373
+ *
374
+ * @example CEF for ArcSight
375
+ * ```ts
376
+ * for await (const line of client.auditLog.export({ format: "cef" })) {
377
+ * // line: string starting with "CEF:0|Attestry|..."
378
+ * await arcsightForward(line);
379
+ * }
380
+ * ```
381
+ *
382
+ * @example One page at a time (manual cursor — rare)
383
+ * ```ts
384
+ * const firstPage = client.auditLog.export({ autoPaginate: false, limit: 100 });
385
+ * for await (const row of firstPage) { process(row); }
386
+ * // The next-cursor is NOT exposed through the iterator. To paginate
387
+ * // manually, the caller must track the last-seen `(timestamp, id)`
388
+ * // and supply it as `cursor` on the next call. Most consumers want
389
+ * // auto-paginate (the default) instead.
390
+ * ```
391
+ */
392
+ export(): AsyncIterable<AuditLogRecord>;
393
+ export(input: {
394
+ format: "ecs";
395
+ } & Omit<AuditLogExportInput, "format">, options?: RequestOptions): AsyncIterable<unknown>;
396
+ export(input: {
397
+ format: "cef";
398
+ } & Omit<AuditLogExportInput, "format">, options?: RequestOptions): AsyncIterable<string>;
399
+ export(input?: AuditLogExportInput, options?: RequestOptions): AsyncIterable<AuditLogRecord>;
400
+ /**
401
+ * Verify the integrity of the org's audit-log hash chain. Returns
402
+ * an `AuditChainVerificationResult` describing whether the chain is
403
+ * intact, and (when broken) the UUID of the entry where verification
404
+ * failed.
405
+ *
406
+ * Wraps `GET /api/v1/audit-chain/verify` — no input, no query
407
+ * parameters, no body. The caller's org is implicit from auth; the
408
+ * kernel fetches up to 5000 audit-log entries ordered ascending by
409
+ * timestamp and runs `verifyAuditChain()` on them.
410
+ *
411
+ * **API-key auth scope** (uses `requireApiKey` DIRECT — distinct
412
+ * from BOTH siblings): the kernel route calls `requireApiKey(request)`
413
+ * at `route.ts:31` with NO permission scoping AND NO subsequent
414
+ * role check. Any valid API key for the org can verify the chain.
415
+ * Returns **HTTP 401** for no/invalid API key; the `requireApiKey`
416
+ * branch does NOT distinguish "no key" from "invalid key". **Note**:
417
+ * `auditLog.export` ALSO calls `requireApiKey(request)` directly at
418
+ * its route but then performs a separate role/permission check
419
+ * (ADMIN-only — see audit-log/export route). `verifyChain()` is
420
+ * distinct: NO role check, NO permission filter. The 403 path is
421
+ * unreachable for this route, and ALL valid api-keys in the org
422
+ * succeed (in contrast to `auditLog.export` where only ADMIN keys
423
+ * succeed).
424
+ *
425
+ * **Kernel-side invariant (session-19 review-3 L2 carry-forward)**:
426
+ * the route at `route.ts:32` reads `apiKeyUser.orgId` and passes
427
+ * it directly to the Drizzle `eq(schema.auditLog.orgId, orgId)`
428
+ * filter without a null-guard. The SDK assumes the kernel's
429
+ * `requireApiKey` returns an `ApiKeyUser` with a non-null `orgId`
430
+ * (i.e., the `apiKeys` table's `orgId` column is NOT NULL). If
431
+ * a future schema migration relaxes that constraint, the route
432
+ * could match zero rows on a malformed key and return a vacuous-
433
+ * truth `valid: true` verdict, masking actual chain tampering.
434
+ * This is a kernel-side hardening concern (SDK cannot detect
435
+ * it from the wire); flagged here so a future kernel-hardening
436
+ * audit knows to add a runtime guard in `requireApiKey`.
437
+ *
438
+ * **CRITICAL contract — does NOT throw on `valid: false`** (carry-
439
+ * forward invariant #12). The kernel returns HTTP 200 with
440
+ * `valid: false` on a tampered chain; the SDK MUST resolve the
441
+ * Promise with the verdict body. Top-level structural failures
442
+ * (auth, rate limit, internal) throw `AttestryAPIError`. Mirror of
443
+ * `decisions.verifyChain`'s same contract.
444
+ *
445
+ * **NO `writeAuditLog` side effect** — the verifier is quiet
446
+ * (asymmetric with `gate.evaluate` / `batch.submit` which both write
447
+ * audit-log entries). Writing to the audit log while verifying it
448
+ * would be ironic; the kernel team avoided this. `auditLog.verifyChain`
449
+ * is a pure read.
450
+ *
451
+ * **Silent kernel-side truncation at 5000 entries** (invariant #50).
452
+ * The kernel's audit-log fetch is capped at 5000 entries
453
+ * (`route.ts:51`: `.limit(5000)`). For an org with more than 5000
454
+ * audit-log entries, only the OLDEST 5000 are verified by this call.
455
+ * The kernel does NOT emit a "truncated" flag — `totalEntries`
456
+ * equals the number of rows fetched, NOT the org's full audit-log
457
+ * row count. **Documented kernel surface gap**; the SDK does NOT
458
+ * mask. Consumers with high-volume audit logs should be aware that
459
+ * the kernel's verifier sees a stale window of the chain. A future
460
+ * kernel pagination or higher limit would be additive (the SDK
461
+ * forwards `totalEntries` verbatim).
462
+ *
463
+ * **Kernel-side 30-second timeout** (`maxDuration = 30` at
464
+ * `route.ts:14`). The SDK does NOT enforce a client-side timeout
465
+ * (consumers manage via `options.signal`), but the kernel's
466
+ * function-runtime cap bounds the verification latency on the
467
+ * server side. Cron-job consumers should budget call latency
468
+ * relative to this cap — a near-5000-entry verification can take
469
+ * tens of seconds under high SHA-256 load. A future kernel raise
470
+ * (e.g., 30 → 60s) would relax this cap; downstream cron-job
471
+ * sizing assumptions should be revisited.
472
+ *
473
+ * **Pollution-safe discriminator pattern** — branch on
474
+ * `result.valid` (closed-enum boolean) to detect a broken chain,
475
+ * NOT on `result.brokenAt === undefined`. The kernel emits
476
+ * `brokenAt` as an OWN-PROPERTY of the response only when the
477
+ * chain is broken; on a valid chain it's omitted entirely (kernel
478
+ * uses a conditional spread at `route.ts:72`). Under
479
+ * `Object.prototype.brokenAt = <value>` pollution, the equality
480
+ * check walks the prototype and reads the polluted value —
481
+ * returning false (i.e., "field is present") even when the
482
+ * own-property is genuinely absent. The SDK's response-side
483
+ * validator uses `Object.hasOwn` (snapshotted at module load) to
484
+ * defend against this; consumers should use `result.valid`
485
+ * directly. Carry-forward of session-17 first-hostile-review
486
+ * MEDIUM #3 + session-18 build-round baked-in pattern.
487
+ *
488
+ * **Errors** — ordered by kernel firing precedence (rate-limit →
489
+ * auth-pass-or-401 → DB fetch → verifier → 500-catchall):
490
+ * - `AttestryAPIError` (status 429) — rate limit FIRES FIRST
491
+ * (auto-retried by default — invariant #18; per-IP rate-limit
492
+ * key `audit-chain-verify:${ip}` against the standard
493
+ * `apiLimiter`).
494
+ * - `AttestryAPIError` (status 401) — no API key OR invalid key.
495
+ * Single 401 surface (NO 403 — the route has no permission
496
+ * filter). Surfaces only when `requireApiKey` throws an
497
+ * `AuthError`; the route's catch (route.ts:74-77) propagates
498
+ * `error.statusCode` (401 for `AuthError`).
499
+ * - `AttestryAPIError` (status 500) — internal kernel error
500
+ * (scrubbed message via `internalErrorResponse`). Surfaces
501
+ * when the DB connection drops mid-fetch, the verifier
502
+ * throws, OR `requireApiKey`'s INFRASTRUCTURE fails (e.g., a
503
+ * DB error during the API-key lookup, not an auth-rejection;
504
+ * non-`AuthError` errors fall through to the route's
505
+ * `internalErrorResponse` catchall at route.ts:78).
506
+ * - `AttestryError` ("request aborted by caller") — caller-
507
+ * supplied `options.signal` fired (pre-aborted or mid-flight).
508
+ * - `AttestryError` (P2 hardening) — kernel response failed
509
+ * SDK-side shape validation. See "Response-shape validation"
510
+ * below.
511
+ * - `AttestryAPIError` (P3 hardening) — kernel response had a
512
+ * wrong Content-Type (transport-level guard).
513
+ *
514
+ * **Notably ABSENT from the error surface**:
515
+ * - **No 400** — this method has no input; nothing to reject for
516
+ * malformed input. The route doesn't parse query params or
517
+ * body.
518
+ * - **No 402 plan-limit** — verifyChain is a READ; no quota.
519
+ * - **No 403** — no permission filter on the route (any key with
520
+ * a valid org binding succeeds). Asymmetric with
521
+ * `auditLog.export` (which gates on ADMIN role).
522
+ * - **No 404** — orgId is implicit from auth; no path/query
523
+ * parameters that could mismatch.
524
+ * - **No 413** — the kernel's `.limit(5000)` silently caps the
525
+ * fetch; oversize orgs see a truncated verification (NOT a
526
+ * 413). Documented kernel surface gap.
527
+ * - **No 422** — no Zod schema (no body, no query).
528
+ * - **No TypeError from SDK** — this method has no input to
529
+ * validate.
530
+ *
531
+ * **Response-shape validation** (P2 hardening — symmetric defense
532
+ * on response side via the module-load `objectHasOwn` snapshot;
533
+ * mirror of `batch.ts` / `gate.ts` patterns):
534
+ * - Rejects with `AttestryError` if the response isn't a non-null,
535
+ * non-array object.
536
+ * - Rejects if `valid` isn't a boolean.
537
+ * - Rejects if `entriesVerified` / `totalEntries` aren't numbers.
538
+ * - Rejects if `firstEntry` / `lastEntry` aren't `null` OR a
539
+ * string.
540
+ * - Rejects if `brokenAt` is OWN-PROPERTY present but NOT a
541
+ * string. (When absent, the field is forward-compatibly
542
+ * undefined — kernel omits it on valid chains.)
543
+ * - Each response field read goes through the module-load
544
+ * `objectHasOwn` snapshot — defends against
545
+ * `Object.prototype.<field>` pollution masking a missing field.
546
+ *
547
+ * **Transport-shape validation** (P3 hardening):
548
+ * - Rejects with `AttestryAPIError` if the kernel responds with
549
+ * a non-`application/json` Content-Type. NOTE: `valid: false`
550
+ * is a normal 200 response and resolves the promise (carry-
551
+ * forward invariant #12); only structural failures throw.
552
+ *
553
+ * @example Detect a tampered audit log
554
+ * ```ts
555
+ * const verdict = await client.auditLog.verifyChain();
556
+ * if (!verdict.valid) {
557
+ * // brokenAt is an OWN-PROPERTY only on broken chains.
558
+ * await notifySecurity({
559
+ * entryId: verdict.brokenAt,
560
+ * verifiedUpTo: verdict.entriesVerified,
561
+ * totalEntries: verdict.totalEntries,
562
+ * });
563
+ * }
564
+ * console.log(`Verified ${verdict.entriesVerified}/${verdict.totalEntries} entries`);
565
+ * ```
566
+ *
567
+ * @example Schedule periodic verification (cron job)
568
+ * ```ts
569
+ * // Run hourly from a cron — surfaces tampering within an hour
570
+ * // of occurrence (high-frequency monitoring for compliance-
571
+ * // critical orgs).
572
+ * try {
573
+ * const verdict = await client.auditLog.verifyChain();
574
+ * if (!verdict.valid) {
575
+ * await pageOncall({ brokenAt: verdict.brokenAt });
576
+ * }
577
+ * } catch (err) {
578
+ * if (err instanceof AttestryAPIError && err.status === 429) {
579
+ * // Back off — verifier is rate-limited per IP.
580
+ * return;
581
+ * }
582
+ * throw err;
583
+ * }
584
+ * ```
585
+ */
586
+ verifyChain(options?: RequestOptions): Promise<AuditChainVerificationResult>;
587
+ }
588
+ //# sourceMappingURL=audit-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/resources/audit-log.ts"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAmBlD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,kCAI1B,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+DAA+D;IAC/D,OAAO,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,GAAG,IA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