qati-sdk 1.0.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.
- package/LICENSE +78 -0
- package/README.md +564 -0
- package/dist/index.cjs +1021 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2147 -0
- package/dist/index.d.ts +2147 -0
- package/dist/index.js +996 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2147 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AxiosInstance, Method } from 'axios';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Maps logical API names (used by {@link HttpClient}) to resolved config fields.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const url = baseUrlFor(config, 'query_api');
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
declare const API_REGISTRY: Readonly<Record<string, keyof QatiConfigOutput>>;
|
|
13
|
+
/**
|
|
14
|
+
* Validated SDK configuration shape (camelCase).
|
|
15
|
+
*
|
|
16
|
+
* **Constraints** (Zod): `tenantApiKey` non-empty string; `queryApiBaseUrl` and
|
|
17
|
+
* `ingestionApiBaseUrl` required URLs (no defaults); `timeout` ≥ 1 second;
|
|
18
|
+
* `ingestionBatchSize` integer ≥ 1; `ingestionFlushIntervalSeconds` > 0;
|
|
19
|
+
* `maxRetries` integer 1–10; retry backoff fields non-negative integers.
|
|
20
|
+
*
|
|
21
|
+
* **Defaults** when optional fields are omitted: `timeout` `30`, `ingestionBatchSize` `100`,
|
|
22
|
+
* `ingestionFlushIntervalSeconds` `5`, `retryBackoffInitialSeconds` `1`,
|
|
23
|
+
* `retryBackoffMaxSeconds` `30`, `retryJitterFraction` `0.1`, `maxRetries` `3`.
|
|
24
|
+
*/
|
|
25
|
+
declare const QatiConfigBase: z.ZodObject<{
|
|
26
|
+
tenantApiKey: z.ZodString;
|
|
27
|
+
queryApiBaseUrl: z.ZodString;
|
|
28
|
+
ingestionApiBaseUrl: z.ZodString;
|
|
29
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
30
|
+
ingestionBatchSize: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
31
|
+
ingestionFlushIntervalSeconds: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
+
retryBackoffInitialSeconds: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
+
retryBackoffMaxSeconds: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
34
|
+
retryJitterFraction: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
+
maxRetries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
tenantApiKey: string;
|
|
38
|
+
queryApiBaseUrl: string;
|
|
39
|
+
ingestionApiBaseUrl: string;
|
|
40
|
+
timeout: number;
|
|
41
|
+
ingestionBatchSize: number;
|
|
42
|
+
ingestionFlushIntervalSeconds: number;
|
|
43
|
+
retryBackoffInitialSeconds: number;
|
|
44
|
+
retryBackoffMaxSeconds: number;
|
|
45
|
+
retryJitterFraction: number;
|
|
46
|
+
maxRetries: number;
|
|
47
|
+
}, {
|
|
48
|
+
tenantApiKey: string;
|
|
49
|
+
queryApiBaseUrl: string;
|
|
50
|
+
ingestionApiBaseUrl: string;
|
|
51
|
+
timeout?: number | undefined;
|
|
52
|
+
ingestionBatchSize?: number | undefined;
|
|
53
|
+
ingestionFlushIntervalSeconds?: number | undefined;
|
|
54
|
+
retryBackoffInitialSeconds?: number | undefined;
|
|
55
|
+
retryBackoffMaxSeconds?: number | undefined;
|
|
56
|
+
retryJitterFraction?: number | undefined;
|
|
57
|
+
maxRetries?: number | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
/** Input to {@link resolveQatiConfig} / {@link parseQatiConfig} before defaults and coercion (Zod input type). */
|
|
60
|
+
type QatiConfigInput = z.input<typeof QatiConfigBase>;
|
|
61
|
+
/** Fully resolved, validated configuration returned by {@link resolveQatiConfig} and {@link Session#config}. */
|
|
62
|
+
type QatiConfigOutput = z.output<typeof QatiConfigBase>;
|
|
63
|
+
/**
|
|
64
|
+
* Resolves SDK configuration: loads `.env` from the working directory, merges `QATI_*` env reads
|
|
65
|
+
* (into camelCase), then explicit `input` (explicit fields win). Validates with Zod and applies
|
|
66
|
+
* defaults for optional fields only (not base URLs).
|
|
67
|
+
*
|
|
68
|
+
* @param input - Optional partial overrides (camelCase). Omitted keys fall back to `process.env` then Zod defaults
|
|
69
|
+
* for optional fields only (base URLs must come from env or this object).
|
|
70
|
+
* @returns Validated {@link QatiConfigOutput}.
|
|
71
|
+
* @throws {@link QatiConfigError} When validation fails.
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const config = resolveQatiConfig({
|
|
75
|
+
* tenantApiKey: process.env.QATI_TENANT_API_KEY!,
|
|
76
|
+
* queryApiBaseUrl: 'http://localhost:8001',
|
|
77
|
+
* ingestionApiBaseUrl: 'http://localhost:8000',
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
declare const resolveQatiConfig: (input?: Partial<QatiConfigInput>) => QatiConfigOutput;
|
|
82
|
+
/**
|
|
83
|
+
* Validates a config object only (no `.env` load, no process env merge). Use in unit tests or when
|
|
84
|
+
* configuration is already assembled in memory.
|
|
85
|
+
*
|
|
86
|
+
* @param input - Full or partial config; must include required fields (`tenantApiKey`, both base URLs) or
|
|
87
|
+
* combine with Zod defaults only for optional numeric/batch fields.
|
|
88
|
+
* @returns Validated {@link QatiConfigOutput}.
|
|
89
|
+
* @throws {@link QatiConfigError} When validation fails.
|
|
90
|
+
*/
|
|
91
|
+
declare const parseQatiConfig: (input: z.input<typeof QatiConfigBase>) => QatiConfigOutput;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the normalized base URL (no trailing slash) for a logical API registered in {@link API_REGISTRY}.
|
|
94
|
+
*
|
|
95
|
+
* @param config - Resolved SDK configuration.
|
|
96
|
+
* @param apiName - Logical name: `query_api` or `ingestion_api`.
|
|
97
|
+
* @returns Absolute base URL string without a trailing `/`.
|
|
98
|
+
* @throws {@link QatiConfigError} If `apiName` is unknown or the mapped URL field is missing.
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const base = baseUrlFor(session.config, 'ingestion_api');
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare const baseUrlFor: (config: QatiConfigOutput, apiName: string) => string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Structured error detail parsed from failed QATI HTTP responses (and synthetic transport failures).
|
|
108
|
+
*/
|
|
109
|
+
interface APIErrorDetail {
|
|
110
|
+
readonly status_code: number;
|
|
111
|
+
readonly message: string;
|
|
112
|
+
readonly request_id: string | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Base class for every error raised by this SDK (configuration, transport, and API errors).
|
|
116
|
+
*
|
|
117
|
+
* @param message - Human-readable description.
|
|
118
|
+
* @param options - Optional `cause` and other `Error` options.
|
|
119
|
+
*/
|
|
120
|
+
declare class QatiSDKError extends Error {
|
|
121
|
+
constructor(message: string, options?: ErrorOptions);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Generic API or transport failure with structured {@link APIErrorDetail}.
|
|
125
|
+
* Prefer catching specific subclasses when handling status codes.
|
|
126
|
+
*
|
|
127
|
+
* @param detail - Parsed status, message, and request id.
|
|
128
|
+
*/
|
|
129
|
+
declare class QatiAPIError extends QatiSDKError {
|
|
130
|
+
readonly detail: APIErrorDetail;
|
|
131
|
+
constructor(detail: APIErrorDetail);
|
|
132
|
+
/**
|
|
133
|
+
* @returns Same as `detail.status_code`.
|
|
134
|
+
*/
|
|
135
|
+
get status_code(): number;
|
|
136
|
+
/**
|
|
137
|
+
* @returns Same as `detail.request_id`.
|
|
138
|
+
*/
|
|
139
|
+
get request_id(): string | null;
|
|
140
|
+
}
|
|
141
|
+
/** Thrown for HTTP `401` / `403` — invalid, expired, or missing tenant API key. */
|
|
142
|
+
declare class QatiAuthError extends QatiAPIError {
|
|
143
|
+
constructor(detail: APIErrorDetail);
|
|
144
|
+
}
|
|
145
|
+
/** Thrown for HTTP `404` — entity, explain payload, or route target does not exist. */
|
|
146
|
+
declare class QatiNotFoundError extends QatiAPIError {
|
|
147
|
+
constructor(detail: APIErrorDetail);
|
|
148
|
+
}
|
|
149
|
+
/** Thrown for HTTP `429` — rate limited; safe to retry with backoff. */
|
|
150
|
+
declare class QatiRateLimitError extends QatiAPIError {
|
|
151
|
+
constructor(detail: APIErrorDetail);
|
|
152
|
+
}
|
|
153
|
+
/** Thrown for HTTP `5xx` — server-side failure; retry may succeed after backoff. */
|
|
154
|
+
declare class QatiServerError extends QatiAPIError {
|
|
155
|
+
constructor(detail: APIErrorDetail);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Raised when configuration or client setup is invalid (unknown API name, bad URL, Zod parse failure, …).
|
|
159
|
+
*
|
|
160
|
+
* @param message - Validation or resolution error text.
|
|
161
|
+
*/
|
|
162
|
+
declare class QatiConfigError extends QatiSDKError {
|
|
163
|
+
constructor(message: string, options?: ErrorOptions);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Called once after retries are exhausted for a retried request (`options.retry` was `true`).
|
|
168
|
+
* Use for logging, DLQ, or metrics; must not throw (errors are swallowed and logged).
|
|
169
|
+
*
|
|
170
|
+
* @param payload - The JSON/body that was sent (same as `options.json ?? options.data`).
|
|
171
|
+
* @param error - The SDK error instance thrown to the caller (typically `QatiAPIError`).
|
|
172
|
+
*/
|
|
173
|
+
type DeadLetterCallback = (payload: unknown, error: unknown) => void;
|
|
174
|
+
|
|
175
|
+
type RegisteredApiName = keyof typeof API_REGISTRY;
|
|
176
|
+
type AxiosInstances = Partial<Record<RegisteredApiName, AxiosInstance>>;
|
|
177
|
+
type RequestOptions = {
|
|
178
|
+
api_name: RegisteredApiName;
|
|
179
|
+
deadLetterCallback?: DeadLetterCallback;
|
|
180
|
+
params?: Record<string, string | number | boolean | undefined | null>;
|
|
181
|
+
headers?: Record<string, string>;
|
|
182
|
+
extraHeaders?: Record<string, string>;
|
|
183
|
+
retry?: boolean;
|
|
184
|
+
/** JSON request body (serialized by axios). Separate from response type param {@link HttpClient.request}. */
|
|
185
|
+
data?: unknown;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Low-level HTTP layer: one `axios` instance per registered API, tenant header injection, and optional retries.
|
|
189
|
+
* Prefer the exported `Client` class for application code.
|
|
190
|
+
*/
|
|
191
|
+
declare class HttpClient {
|
|
192
|
+
private readonly _config;
|
|
193
|
+
private readonly _httpClients;
|
|
194
|
+
constructor(config: QatiConfigOutput, axiosInstances?: AxiosInstances);
|
|
195
|
+
private createClient;
|
|
196
|
+
/**
|
|
197
|
+
* @returns The same configuration used to build base URLs, timeouts, and default headers.
|
|
198
|
+
*/
|
|
199
|
+
get config(): QatiConfigOutput;
|
|
200
|
+
/**
|
|
201
|
+
* Returns the underlying `axios` instance for a logical API.
|
|
202
|
+
*
|
|
203
|
+
* @param apiName - `query_api` or `ingestion_api`.
|
|
204
|
+
* @returns Configured `AxiosInstance` for that API.
|
|
205
|
+
* @throws {@link QatiConfigError} If the internal client map has no entry for `apiName`.
|
|
206
|
+
*/
|
|
207
|
+
getClient(apiName: RegisteredApiName): AxiosInstance;
|
|
208
|
+
/**
|
|
209
|
+
* Performs one HTTP request and returns the **unwrapped** `data` field from the QATI `{ data: T }` envelope.
|
|
210
|
+
*
|
|
211
|
+
* @typeParam T - Response payload type inside the API envelope.
|
|
212
|
+
* @param method - HTTP verb (e.g. `GET`, `POST`).
|
|
213
|
+
* @param url - Path relative to the API base URL (may include query string; prefer `options.params` for queries).
|
|
214
|
+
* @param options - `api_name` selects which base URL and client to use. Set `retry: true` to retry transient failures.
|
|
215
|
+
* @returns Parsed `T` from `response.data.data` (not the full `ApiResponse` wrapper).
|
|
216
|
+
* @throws `QatiAPIError` or subclasses (`QatiAuthError`, `QatiNotFoundError`, …) on HTTP failures; on transport exhaustion when `retry` is `true`, after optional dead-letter callback.
|
|
217
|
+
*
|
|
218
|
+
* When `options.retry` is `true`, retries `429`, `5xx`, and transport errors up to `maxRetries` from config;
|
|
219
|
+
* other `4xx` are not retried. When `retry` is `false` or omitted, a single attempt is made.
|
|
220
|
+
*/
|
|
221
|
+
request<T>(method: Method, url: string, options: RequestOptions): Promise<T>;
|
|
222
|
+
private retryRequest;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
declare const ADVISORY_TYPES: readonly ["DRIFT_WARNING", "ANOMALY_CLUSTER", "CONFIDENCE_COLLAPSE", "MODEL_INSTABILITY", "RAPID_ESCALATION_NEW_DEVICE", "RAPID_ESCALATION_EXISTING_ENTITY", "SUSTAINED_DEGRADATION", "SINGLE_EVENT_SPIKE", "CAUSAL_INSTABILITY_PROPAGATION", "DOMINANT_UPSTREAM_DEPENDENCY", "IDENTITY_CONTEXT_MISMATCH", "RECOVERY_IN_PROGRESS"];
|
|
226
|
+
/**
|
|
227
|
+
* Exhaustive set of advisory `type` values accepted by the Query API filters and payloads.
|
|
228
|
+
*/
|
|
229
|
+
type AdvisoryType = (typeof ADVISORY_TYPES)[number];
|
|
230
|
+
|
|
231
|
+
declare const ADVISORY_SEVERITIES: readonly ["LOW", "ELEVATED", "HIGH", "CRITICAL"];
|
|
232
|
+
/**
|
|
233
|
+
* Allowed persisted advisory severity tiers (aligned with Query API enums).
|
|
234
|
+
*/
|
|
235
|
+
type AdvisorySeverity = (typeof ADVISORY_SEVERITIES)[number];
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Structured proof payload attached to a persisted advisory (explainability / audit).
|
|
239
|
+
*/
|
|
240
|
+
type ExplanationTrace = {
|
|
241
|
+
/** Human-readable summary of why the advisory fired. */
|
|
242
|
+
message: string;
|
|
243
|
+
/** Event ids and reason codes ranked by contribution to the advisory (opaque ids, not necessarily UUIDs). */
|
|
244
|
+
top_contributing_events: string[];
|
|
245
|
+
/** Deterministic conditions and signal values that satisfied selection rules (arbitrary JSON shape). */
|
|
246
|
+
triggering_conditions: Record<string, unknown>;
|
|
247
|
+
/** Neighbour `entity_key` values implicated in graph / causal instability. */
|
|
248
|
+
dominant_neighbors: string[];
|
|
249
|
+
/** Numeric engine deltas (e.g. closure score, momentum) at evaluation time. */
|
|
250
|
+
state_deltas: Record<string, number>;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Suggested follow-up for operators or automation (non-blocking).
|
|
254
|
+
*/
|
|
255
|
+
type RecommendedAction = {
|
|
256
|
+
/** Template-rendered diagnostic message for the identified risk pattern. */
|
|
257
|
+
message: string;
|
|
258
|
+
/** Machine-readable tags (routing, ticketing, policy ids, …). */
|
|
259
|
+
machine_readable_tags: string[];
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* One persisted advisory row returned by the Query API.
|
|
263
|
+
*/
|
|
264
|
+
type AdvisoryResponse = {
|
|
265
|
+
/**
|
|
266
|
+
* Stable advisory identifier (opaque string; treat as unique per tenant).
|
|
267
|
+
* **Constraint:** format is server-defined; often a UUID but not guaranteed by this SDK.
|
|
268
|
+
*/
|
|
269
|
+
advisory_id: string;
|
|
270
|
+
/**
|
|
271
|
+
* Scoped entity key (`TYPE:id`, uppercase type prefix).
|
|
272
|
+
*/
|
|
273
|
+
entity_key: string;
|
|
274
|
+
/** Deterministic advisory classification (see {@link AdvisoryType}). */
|
|
275
|
+
type: AdvisoryType;
|
|
276
|
+
/** Severity tier, or `null` when the engine did not assign a tier. */
|
|
277
|
+
severity: AdvisorySeverity | null;
|
|
278
|
+
/** Evidence and graph/context payload for reviewers. */
|
|
279
|
+
explanation_trace: ExplanationTrace;
|
|
280
|
+
/** Ordered remediation hints, or `null` when none were persisted. */
|
|
281
|
+
recommended_actions: RecommendedAction[] | null;
|
|
282
|
+
/** Wall-clock time the advisory conditions were first met (parsed as `Date` by the client if applicable). */
|
|
283
|
+
triggered_at: Date;
|
|
284
|
+
/** Resolution time when inactive; `null` while the advisory is still active. */
|
|
285
|
+
resolved_at: Date | null;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Paginated list payload for `GET /v1/advisories` (Query API).
|
|
289
|
+
*/
|
|
290
|
+
type AdvisoryListResponse = {
|
|
291
|
+
/** Current page of advisories (may be shorter than `limit` on the last page). */
|
|
292
|
+
advisories: AdvisoryResponse[];
|
|
293
|
+
/** Total rows matching the query independent of pagination. */
|
|
294
|
+
total_count: number;
|
|
295
|
+
/** Echo of the requested page size (server may clamp). */
|
|
296
|
+
limit: number;
|
|
297
|
+
/** Echo of the requested offset. */
|
|
298
|
+
offset: number;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Optional filters and pagination for {@link AdvisoryResource#listAdvisories}.
|
|
303
|
+
*
|
|
304
|
+
* **Constraints:** `limit` is forwarded to the API and should not exceed 500 unless the server contract changes.
|
|
305
|
+
*/
|
|
306
|
+
type ListAdvisoriesOptions = {
|
|
307
|
+
/**
|
|
308
|
+
* Maximum rows to return (server may cap). Prefer ≤ 500.
|
|
309
|
+
* @default When omitted, the API default applies.
|
|
310
|
+
*/
|
|
311
|
+
limit?: number;
|
|
312
|
+
/**
|
|
313
|
+
* Zero-based row offset for pagination.
|
|
314
|
+
* @default When omitted, the API default applies.
|
|
315
|
+
*/
|
|
316
|
+
offset?: number;
|
|
317
|
+
/**
|
|
318
|
+
* Inclusive lower bound on `triggered_at` (ISO-8601 string or `Date`).
|
|
319
|
+
*/
|
|
320
|
+
since?: Date | string;
|
|
321
|
+
/**
|
|
322
|
+
* Inclusive upper bound on `triggered_at` (ISO-8601 string or `Date`).
|
|
323
|
+
*/
|
|
324
|
+
until?: Date | string;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* Query API: list persisted advisories for a tenant-scoped entity.
|
|
328
|
+
*/
|
|
329
|
+
declare class AdvisoryResource {
|
|
330
|
+
private readonly _http;
|
|
331
|
+
private readonly apiName;
|
|
332
|
+
constructor(_http: HttpClient);
|
|
333
|
+
/**
|
|
334
|
+
* Lists persisted advisories for the tenant (`GET /v1/advisories`).
|
|
335
|
+
*
|
|
336
|
+
* @param entityKey - Scoped entity key: uppercase type, colon, opaque id (e.g. `USER:20`). Must match server expectations for entity keys.
|
|
337
|
+
* @param advisoryType - Filter by advisory `type` (see {@link AdvisoryType}).
|
|
338
|
+
* @param severity - Filter by `severity` tier (see {@link AdvisorySeverity}).
|
|
339
|
+
* @param options - Optional time range and pagination ({@link ListAdvisoriesOptions}).
|
|
340
|
+
* @returns: {@link AdvisoryListResponse} including `total_count`, `limit`, and `offset` echo from the API.
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
listAdvisories(entityKey: string, advisoryType: AdvisoryType, severity: AdvisorySeverity, options?: ListAdvisoriesOptions): Promise<AdvisoryListResponse>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Zod schemas for v1 ingestion envelopes: strongly typed `BaseEvent` and wire-format `RawEventRequest`.
|
|
348
|
+
*/
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Full typed signal envelope before wrapping as a `RawEventRequest` (`signal_version`, `signal_type`, `principal`, …).
|
|
352
|
+
*
|
|
353
|
+
* **Constraints:** `confidence_hint` in `[0, 1]` when set; `timestamp` ISO-8601 when provided.
|
|
354
|
+
*/
|
|
355
|
+
declare const BaseEventSchema: z.ZodObject<{
|
|
356
|
+
tenant_id: z.ZodString;
|
|
357
|
+
signal_version: z.ZodString;
|
|
358
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
359
|
+
signal_payload: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
360
|
+
principal: z.ZodObject<{
|
|
361
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
362
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
363
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
364
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
365
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
366
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
367
|
+
}, "strip", z.ZodTypeAny, {
|
|
368
|
+
user_id?: string | undefined;
|
|
369
|
+
account_id?: string | undefined;
|
|
370
|
+
device_id?: string | undefined;
|
|
371
|
+
session_id?: string | undefined;
|
|
372
|
+
model_id?: string | undefined;
|
|
373
|
+
service_id?: string | undefined;
|
|
374
|
+
}, {
|
|
375
|
+
user_id?: string | undefined;
|
|
376
|
+
account_id?: string | undefined;
|
|
377
|
+
device_id?: string | undefined;
|
|
378
|
+
session_id?: string | undefined;
|
|
379
|
+
model_id?: string | undefined;
|
|
380
|
+
service_id?: string | undefined;
|
|
381
|
+
}>;
|
|
382
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
383
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
384
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
386
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
387
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
389
|
+
}, "strip", z.ZodTypeAny, {
|
|
390
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
391
|
+
source_id?: string | undefined;
|
|
392
|
+
epoch_counter?: number | undefined;
|
|
393
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
394
|
+
}, {
|
|
395
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
396
|
+
source_id?: string | undefined;
|
|
397
|
+
epoch_counter?: number | undefined;
|
|
398
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
399
|
+
}>>;
|
|
400
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
401
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
402
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
403
|
+
}, "strip", z.ZodTypeAny, {
|
|
404
|
+
hash?: string | undefined;
|
|
405
|
+
signature?: string | undefined;
|
|
406
|
+
}, {
|
|
407
|
+
hash?: string | undefined;
|
|
408
|
+
signature?: string | undefined;
|
|
409
|
+
}>>;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
tenant_id: string;
|
|
412
|
+
signal_version: string;
|
|
413
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
414
|
+
signal_payload: Record<string, any>;
|
|
415
|
+
principal: {
|
|
416
|
+
user_id?: string | undefined;
|
|
417
|
+
account_id?: string | undefined;
|
|
418
|
+
device_id?: string | undefined;
|
|
419
|
+
session_id?: string | undefined;
|
|
420
|
+
model_id?: string | undefined;
|
|
421
|
+
service_id?: string | undefined;
|
|
422
|
+
};
|
|
423
|
+
integrity?: {
|
|
424
|
+
hash?: string | undefined;
|
|
425
|
+
signature?: string | undefined;
|
|
426
|
+
} | undefined;
|
|
427
|
+
timestamp?: string | undefined;
|
|
428
|
+
confidence_hint?: number | undefined;
|
|
429
|
+
provenance?: {
|
|
430
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
431
|
+
source_id?: string | undefined;
|
|
432
|
+
epoch_counter?: number | undefined;
|
|
433
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
434
|
+
} | undefined;
|
|
435
|
+
}, {
|
|
436
|
+
tenant_id: string;
|
|
437
|
+
signal_version: string;
|
|
438
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
439
|
+
signal_payload: Record<string, any>;
|
|
440
|
+
principal: {
|
|
441
|
+
user_id?: string | undefined;
|
|
442
|
+
account_id?: string | undefined;
|
|
443
|
+
device_id?: string | undefined;
|
|
444
|
+
session_id?: string | undefined;
|
|
445
|
+
model_id?: string | undefined;
|
|
446
|
+
service_id?: string | undefined;
|
|
447
|
+
};
|
|
448
|
+
integrity?: {
|
|
449
|
+
hash?: string | undefined;
|
|
450
|
+
signature?: string | undefined;
|
|
451
|
+
} | undefined;
|
|
452
|
+
timestamp?: string | undefined;
|
|
453
|
+
confidence_hint?: number | undefined;
|
|
454
|
+
provenance?: {
|
|
455
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
456
|
+
source_id?: string | undefined;
|
|
457
|
+
epoch_counter?: number | undefined;
|
|
458
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
459
|
+
} | undefined;
|
|
460
|
+
}>;
|
|
461
|
+
/**
|
|
462
|
+
* HTTP / SDK ingestion body: `tenant_id` + JSON `payload` (API assigns persisted raw-event id).
|
|
463
|
+
*/
|
|
464
|
+
declare const RawEventRequestSchema: z.ZodObject<{
|
|
465
|
+
tenant_id: z.ZodString;
|
|
466
|
+
payload: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
467
|
+
}, "strip", z.ZodTypeAny, {
|
|
468
|
+
tenant_id: string;
|
|
469
|
+
payload: Record<string, any>;
|
|
470
|
+
}, {
|
|
471
|
+
tenant_id: string;
|
|
472
|
+
payload: Record<string, any>;
|
|
473
|
+
}>;
|
|
474
|
+
/** Typed HTTP ingestion body. */
|
|
475
|
+
type RawEventRequest = z.infer<typeof RawEventRequestSchema>;
|
|
476
|
+
/** Typed v1 envelope inside `RawEventRequest.payload` when using signal builders. */
|
|
477
|
+
type BaseEvent = z.infer<typeof BaseEventSchema>;
|
|
478
|
+
|
|
479
|
+
type SDKQueueEventStatus = 'queued';
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Overrides for the in-memory ingestion buffer (defaults otherwise come from: {@link HttpClient}'s
|
|
483
|
+
* resolved config: `ingestionBatchSize`, `ingestionFlushIntervalSeconds`).
|
|
484
|
+
*/
|
|
485
|
+
type EventResourceOptions = {
|
|
486
|
+
/**
|
|
487
|
+
* Max events to hold before an automatic flush to `POST /v1/events:batch` (must be integer ≥ 1).
|
|
488
|
+
*/
|
|
489
|
+
batchSize?: number;
|
|
490
|
+
/**
|
|
491
|
+
* Max seconds to wait after the first queued event before flushing a non-empty partial batch (must be ≥ 0 per buffer schema).
|
|
492
|
+
*/
|
|
493
|
+
flushIntervalSeconds?: number;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* **Append-only ingestion path**: queues {@link RawEventRequest} rows locally and ships them in batches to `POST /v1/events:batch`,
|
|
497
|
+
* keeping the hot path non-blocking in your service. The platform persists telemetry for downstream scoring;
|
|
498
|
+
* this client does **not** enforce policies or block traffic.
|
|
499
|
+
*
|
|
500
|
+
* Flushes happen when the buffer hits **N** events or **T** seconds pass since the first queued item (whichever comes first).
|
|
501
|
+
* Failed batches retry with backoff + jitter; after exhaustion an optional dead-letter callback can persist or alert without crashing the producer’s enqueue loop.
|
|
502
|
+
*/
|
|
503
|
+
declare class EventResource {
|
|
504
|
+
private readonly _http;
|
|
505
|
+
private readonly _buffer;
|
|
506
|
+
private readonly apiName;
|
|
507
|
+
private _deadLetterCallback?;
|
|
508
|
+
/**
|
|
509
|
+
* @param http - Shared HTTP client (supplies config defaults and axios instance for `ingestion_api`).
|
|
510
|
+
* @param options - Optional buffer sizing overrides ({@link EventResourceOptions}).
|
|
511
|
+
*/
|
|
512
|
+
constructor(http: HttpClient, options?: EventResourceOptions);
|
|
513
|
+
/**
|
|
514
|
+
* Registers a hook invoked after retries are exhausted for a failed batch POST so you can land failures on a DLQ or metric pipeline. Must stay non-throwing — swallow errors inside your handler.
|
|
515
|
+
*/
|
|
516
|
+
onIngestionFailure(callback: DeadLetterCallback): this;
|
|
517
|
+
/**
|
|
518
|
+
* Accepts one normalized event into the in-memory buffer and returns immediately with **`queued`** — HTTP happens on flush timers or explicit `flush`, not inline with `enqueue`.
|
|
519
|
+
*/
|
|
520
|
+
enqueue(event: RawEventRequest): Promise<SDKQueueEventStatus>;
|
|
521
|
+
/**
|
|
522
|
+
* Sends whatever is buffered **now** as one ingestion batch (or resolves immediately with an empty-shaped result when nothing was pending).
|
|
523
|
+
*/
|
|
524
|
+
flush(): Promise<BatchEventResponse>;
|
|
525
|
+
/**
|
|
526
|
+
* Best-effort final flush then tears down timers — typically reached via `Client.close()` during graceful shutdown so late telemetry is not dropped on SIGTERM.
|
|
527
|
+
*/
|
|
528
|
+
shutdown(): Promise<void>;
|
|
529
|
+
/**
|
|
530
|
+
* Live count of rows waiting in the in-memory buffer (not yet acknowledged by the ingestion API).
|
|
531
|
+
*/
|
|
532
|
+
get pendingCount(): number;
|
|
533
|
+
private postBatch;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Zod schemas and types for `GET /v1/explain/{entity_key}` (Query API composite explain).
|
|
538
|
+
*/
|
|
539
|
+
|
|
540
|
+
declare const ExplainResponseSchema: z.ZodObject<{
|
|
541
|
+
entity_key: z.ZodString;
|
|
542
|
+
timestamp: z.ZodDate;
|
|
543
|
+
closure_score: z.ZodNumber;
|
|
544
|
+
risk_tier: z.ZodEnum<["LOW", "ELEVATED", "HIGH", "CRITICAL"]>;
|
|
545
|
+
cc_delta: z.ZodNumber;
|
|
546
|
+
momentum: z.ZodNumber;
|
|
547
|
+
top_events: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
548
|
+
event_id: z.ZodString;
|
|
549
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
550
|
+
contribution: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
551
|
+
recency_weight: z.ZodNumber;
|
|
552
|
+
reason_code: z.ZodString;
|
|
553
|
+
}, "strip", z.ZodTypeAny, {
|
|
554
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
555
|
+
event_id: string;
|
|
556
|
+
recency_weight: number;
|
|
557
|
+
reason_code: string;
|
|
558
|
+
contribution?: number | null | undefined;
|
|
559
|
+
}, {
|
|
560
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
561
|
+
event_id: string;
|
|
562
|
+
recency_weight: number;
|
|
563
|
+
reason_code: string;
|
|
564
|
+
contribution?: number | null | undefined;
|
|
565
|
+
}>, "many">>;
|
|
566
|
+
dominant_neighbors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
567
|
+
entity_key: z.ZodString;
|
|
568
|
+
edge_weight: z.ZodNumber;
|
|
569
|
+
event_layer_fraction: z.ZodNumber;
|
|
570
|
+
}, "strip", z.ZodTypeAny, {
|
|
571
|
+
entity_key: string;
|
|
572
|
+
edge_weight: number;
|
|
573
|
+
event_layer_fraction: number;
|
|
574
|
+
}, {
|
|
575
|
+
entity_key: string;
|
|
576
|
+
edge_weight: number;
|
|
577
|
+
event_layer_fraction: number;
|
|
578
|
+
}>, "many">>;
|
|
579
|
+
active_advisories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
580
|
+
type: z.ZodEnum<["DRIFT_WARNING", "ANOMALY_CLUSTER", "CONFIDENCE_COLLAPSE", "MODEL_INSTABILITY", "RAPID_ESCALATION_NEW_DEVICE", "RAPID_ESCALATION_EXISTING_ENTITY", "SUSTAINED_DEGRADATION", "SINGLE_EVENT_SPIKE", "CAUSAL_INSTABILITY_PROPAGATION", "DOMINANT_UPSTREAM_DEPENDENCY", "IDENTITY_CONTEXT_MISMATCH", "RECOVERY_IN_PROGRESS"]>;
|
|
581
|
+
entity_key: z.ZodString;
|
|
582
|
+
severity: z.ZodOptional<z.ZodNullable<z.ZodEnum<["LOW", "ELEVATED", "HIGH", "CRITICAL"]>>>;
|
|
583
|
+
triggering_condition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
584
|
+
}, "strip", z.ZodTypeAny, {
|
|
585
|
+
type: "DRIFT_WARNING" | "ANOMALY_CLUSTER" | "CONFIDENCE_COLLAPSE" | "MODEL_INSTABILITY" | "RAPID_ESCALATION_NEW_DEVICE" | "RAPID_ESCALATION_EXISTING_ENTITY" | "SUSTAINED_DEGRADATION" | "SINGLE_EVENT_SPIKE" | "CAUSAL_INSTABILITY_PROPAGATION" | "DOMINANT_UPSTREAM_DEPENDENCY" | "IDENTITY_CONTEXT_MISMATCH" | "RECOVERY_IN_PROGRESS";
|
|
586
|
+
entity_key: string;
|
|
587
|
+
triggering_condition: Record<string, unknown>;
|
|
588
|
+
severity?: "LOW" | "ELEVATED" | "HIGH" | "CRITICAL" | null | undefined;
|
|
589
|
+
}, {
|
|
590
|
+
type: "DRIFT_WARNING" | "ANOMALY_CLUSTER" | "CONFIDENCE_COLLAPSE" | "MODEL_INSTABILITY" | "RAPID_ESCALATION_NEW_DEVICE" | "RAPID_ESCALATION_EXISTING_ENTITY" | "SUSTAINED_DEGRADATION" | "SINGLE_EVENT_SPIKE" | "CAUSAL_INSTABILITY_PROPAGATION" | "DOMINANT_UPSTREAM_DEPENDENCY" | "IDENTITY_CONTEXT_MISMATCH" | "RECOVERY_IN_PROGRESS";
|
|
591
|
+
entity_key: string;
|
|
592
|
+
triggering_condition: Record<string, unknown>;
|
|
593
|
+
severity?: "LOW" | "ELEVATED" | "HIGH" | "CRITICAL" | null | undefined;
|
|
594
|
+
}>, "many">>;
|
|
595
|
+
}, "strip", z.ZodTypeAny, {
|
|
596
|
+
entity_key: string;
|
|
597
|
+
timestamp: Date;
|
|
598
|
+
closure_score: number;
|
|
599
|
+
risk_tier: "LOW" | "ELEVATED" | "HIGH" | "CRITICAL";
|
|
600
|
+
cc_delta: number;
|
|
601
|
+
momentum: number;
|
|
602
|
+
top_events: {
|
|
603
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
604
|
+
event_id: string;
|
|
605
|
+
recency_weight: number;
|
|
606
|
+
reason_code: string;
|
|
607
|
+
contribution?: number | null | undefined;
|
|
608
|
+
}[];
|
|
609
|
+
dominant_neighbors: {
|
|
610
|
+
entity_key: string;
|
|
611
|
+
edge_weight: number;
|
|
612
|
+
event_layer_fraction: number;
|
|
613
|
+
}[];
|
|
614
|
+
active_advisories: {
|
|
615
|
+
type: "DRIFT_WARNING" | "ANOMALY_CLUSTER" | "CONFIDENCE_COLLAPSE" | "MODEL_INSTABILITY" | "RAPID_ESCALATION_NEW_DEVICE" | "RAPID_ESCALATION_EXISTING_ENTITY" | "SUSTAINED_DEGRADATION" | "SINGLE_EVENT_SPIKE" | "CAUSAL_INSTABILITY_PROPAGATION" | "DOMINANT_UPSTREAM_DEPENDENCY" | "IDENTITY_CONTEXT_MISMATCH" | "RECOVERY_IN_PROGRESS";
|
|
616
|
+
entity_key: string;
|
|
617
|
+
triggering_condition: Record<string, unknown>;
|
|
618
|
+
severity?: "LOW" | "ELEVATED" | "HIGH" | "CRITICAL" | null | undefined;
|
|
619
|
+
}[];
|
|
620
|
+
}, {
|
|
621
|
+
entity_key: string;
|
|
622
|
+
timestamp: Date;
|
|
623
|
+
closure_score: number;
|
|
624
|
+
risk_tier: "LOW" | "ELEVATED" | "HIGH" | "CRITICAL";
|
|
625
|
+
cc_delta: number;
|
|
626
|
+
momentum: number;
|
|
627
|
+
top_events?: {
|
|
628
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
629
|
+
event_id: string;
|
|
630
|
+
recency_weight: number;
|
|
631
|
+
reason_code: string;
|
|
632
|
+
contribution?: number | null | undefined;
|
|
633
|
+
}[] | undefined;
|
|
634
|
+
dominant_neighbors?: {
|
|
635
|
+
entity_key: string;
|
|
636
|
+
edge_weight: number;
|
|
637
|
+
event_layer_fraction: number;
|
|
638
|
+
}[] | undefined;
|
|
639
|
+
active_advisories?: {
|
|
640
|
+
type: "DRIFT_WARNING" | "ANOMALY_CLUSTER" | "CONFIDENCE_COLLAPSE" | "MODEL_INSTABILITY" | "RAPID_ESCALATION_NEW_DEVICE" | "RAPID_ESCALATION_EXISTING_ENTITY" | "SUSTAINED_DEGRADATION" | "SINGLE_EVENT_SPIKE" | "CAUSAL_INSTABILITY_PROPAGATION" | "DOMINANT_UPSTREAM_DEPENDENCY" | "IDENTITY_CONTEXT_MISMATCH" | "RECOVERY_IN_PROGRESS";
|
|
641
|
+
entity_key: string;
|
|
642
|
+
triggering_condition: Record<string, unknown>;
|
|
643
|
+
severity?: "LOW" | "ELEVATED" | "HIGH" | "CRITICAL" | null | undefined;
|
|
644
|
+
}[] | undefined;
|
|
645
|
+
}>;
|
|
646
|
+
/**
|
|
647
|
+
* Parsed explain payload: closure score, risk tier, ranked events/neighbours, and active advisories.
|
|
648
|
+
*
|
|
649
|
+
* **Constraints (Zod):** `closure_score` in `[0, 1]`; `top_events[].recency_weight` in `[0, 1]`; `dominant_neighbors[].event_layer_fraction` in `[0, 1]`.
|
|
650
|
+
*/
|
|
651
|
+
type ExplainResponse = z.infer<typeof ExplainResponseSchema>;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Query API: composite explain / attribution snapshot for one entity.
|
|
655
|
+
*/
|
|
656
|
+
declare class ExplainResource {
|
|
657
|
+
private readonly _http;
|
|
658
|
+
private readonly apiName;
|
|
659
|
+
constructor(_http: HttpClient);
|
|
660
|
+
/**
|
|
661
|
+
* Fetches composite explain for one entity (`GET /v1/explain/{entity_key}`).
|
|
662
|
+
*
|
|
663
|
+
* @param entityKey - URL-encoded path segment: uppercase entity type, colon, id (e.g. `USER:user-123`). Must not contain raw `/` (caller passes logical key; SDK encodes for HTTP).
|
|
664
|
+
* @param atTimestamp - Optional “as of” time (`Date` or ISO-8601 string). Omitted means server default (typically “now”).
|
|
665
|
+
* @param topDominantNeighbors - Optional cap on dominant neighbor rows returned.
|
|
666
|
+
* @param topEvents - Optional cap on top contributing events returned.
|
|
667
|
+
* @returns {@link ExplainResponse} (closure score, risk tier, top events, neighbours, active advisories).
|
|
668
|
+
* @example
|
|
669
|
+
* ```ts
|
|
670
|
+
* const x = await client.explain.get('USER:alice', new Date(), 5, 10);
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
673
|
+
get(entityKey: string, atTimestamp?: Date | string, topDominantNeighbors?: number, topEvents?: number): Promise<ExplainResponse>;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Response body for `GET /v1/tenants/verify-credentials` (Query API).
|
|
678
|
+
*/
|
|
679
|
+
type VerifyCredentialsResponse = {
|
|
680
|
+
/**
|
|
681
|
+
* Tenant partition identifier (opaque string; UUID in typical deployments).
|
|
682
|
+
* **Constraint:** treat as opaque; do not parse as a customer-facing id unless your control plane documents otherwise.
|
|
683
|
+
*/
|
|
684
|
+
tenant_id: string;
|
|
685
|
+
/** `true` when the presented `x-tenant-api-key` is accepted for this tenant. */
|
|
686
|
+
is_valid: boolean;
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Validates that the configured API key is valid.
|
|
691
|
+
* Use at process startup so misconfigured keys fail fast before trust-state or ingestion traffic.
|
|
692
|
+
*/
|
|
693
|
+
declare class TenantResource {
|
|
694
|
+
private readonly _http;
|
|
695
|
+
private readonly apiName;
|
|
696
|
+
constructor(_http: HttpClient);
|
|
697
|
+
/**
|
|
698
|
+
* Confirms whether the **`x-tenant-api-key`** presented by this client is accepted by the platform and returns the opaqu
|
|
699
|
+
* e **tenant partition id** bound to that key.
|
|
700
|
+
* Use at process startup so misconfigured keys fail fast before trust-state or explain traffic.
|
|
701
|
+
*
|
|
702
|
+
* @returns: {@link VerifyCredentialsResponse}
|
|
703
|
+
*/
|
|
704
|
+
verifyCredentials(): Promise<VerifyCredentialsResponse>;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
declare const ENTITY_TYPES: readonly ["USER", "DEVICE", "ACCOUNT", "MODEL", "SESSION", "SERVICE"];
|
|
708
|
+
/**
|
|
709
|
+
* Canonical uppercase entity kinds used in `entity_key` prefixes and ingestion principals.
|
|
710
|
+
*/
|
|
711
|
+
type EntityType = (typeof ENTITY_TYPES)[number];
|
|
712
|
+
type EntityTypeLowerCase = Lowercase<EntityType>;
|
|
713
|
+
|
|
714
|
+
declare const RISK_TIERS: readonly ["LOW", "ELEVATED", "HIGH", "CRITICAL"];
|
|
715
|
+
/**
|
|
716
|
+
* Discrete risk tiers used in trust state and explain responses.
|
|
717
|
+
*/
|
|
718
|
+
type RiskTier = (typeof RISK_TIERS)[number];
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* One ranked contributor row inside `TrustState.top_contributors`.
|
|
722
|
+
*/
|
|
723
|
+
type TopContributor = {
|
|
724
|
+
/** Opaque ingestion event id (UUID v7 when produced by this SDK’s builders). */
|
|
725
|
+
event_id: string;
|
|
726
|
+
/** Engine reason code explaining why this event mattered. */
|
|
727
|
+
reason_code: string;
|
|
728
|
+
};
|
|
729
|
+
/**
|
|
730
|
+
* Latest trust snapshot for an entity from the Query API.
|
|
731
|
+
*/
|
|
732
|
+
type TrustState = {
|
|
733
|
+
/** Scoped key (`TYPE:id`) for the subject entity. */
|
|
734
|
+
entity_key: string;
|
|
735
|
+
/**
|
|
736
|
+
* Closure score in `[0, 1]` (higher usually means tighter / more confident closure).
|
|
737
|
+
* **Constraint:** exact semantics are engine-defined; compare across time for the same entity.
|
|
738
|
+
*/
|
|
739
|
+
current_closure_score: number;
|
|
740
|
+
/** Directional change indicator for closure score (engine-defined units). */
|
|
741
|
+
momentum: number;
|
|
742
|
+
/** Discrete risk bucket (see {@link RiskTier}). */
|
|
743
|
+
risk_tier: RiskTier;
|
|
744
|
+
/**
|
|
745
|
+
* Model / engine confidence in `[0, 1]`.
|
|
746
|
+
* **Constraint:** not a calibrated probability unless your deployment says otherwise.
|
|
747
|
+
*/
|
|
748
|
+
confidence: number;
|
|
749
|
+
/** Recent events contributing most to the current trust posture (length ≤ requested contributor limit). */
|
|
750
|
+
top_contributors: TopContributor[];
|
|
751
|
+
/** Server-side freshness timestamp for this snapshot. */
|
|
752
|
+
last_updated: Date;
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Optional tuning for top-contributor lists.
|
|
757
|
+
*/
|
|
758
|
+
type TrustStateOptions = {
|
|
759
|
+
/**
|
|
760
|
+
* How many contributor rows to return per entity. Default: 5.
|
|
761
|
+
*/
|
|
762
|
+
topContributorsLimit?: number;
|
|
763
|
+
/**
|
|
764
|
+
* Rolling window length (minutes) used to rank contributors. Default: 1440 (24 hours).
|
|
765
|
+
*/
|
|
766
|
+
topContributorsWindowMinutes?: number;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* Reads **materialized trust snapshots** from the Query API:
|
|
770
|
+
* Closure Score, momentum, risk tier, and recent contributors for principals (users, devices, sessions, models, etc.).
|
|
771
|
+
* This is how applications poll “what does QATI believe about this entity **now**?”; observability only; no blocking or policy execution occurs here.
|
|
772
|
+
*/
|
|
773
|
+
declare class TrustStateResource {
|
|
774
|
+
private readonly _http;
|
|
775
|
+
private readonly apiName;
|
|
776
|
+
constructor(_http: HttpClient);
|
|
777
|
+
/**
|
|
778
|
+
* Fetches the latest trust state for one entity.
|
|
779
|
+
*
|
|
780
|
+
* @param entityType - Lowercase entity class: `user`, `device`, `account`, `model`, `session`, or `service` (see {@link EntityTypeLowerCase}).
|
|
781
|
+
* @param entityId - Id for the entity(Required)
|
|
782
|
+
* @param options - Optional contributor limits/window.
|
|
783
|
+
* @returns {@link TrustState} including `current_closure_score`, `risk_tier`, and `top_contributors`.
|
|
784
|
+
*/
|
|
785
|
+
getTrustState(entityType: EntityTypeLowerCase, entityId: string, options?: TrustStateOptions): Promise<TrustState>;
|
|
786
|
+
/**
|
|
787
|
+
* Fetches trust states for many entities in one request.
|
|
788
|
+
*
|
|
789
|
+
* @param entityType - Lowercase entity class: `user`, `device`, `account`, `model`, `session`, or `service` (see {@link EntityTypeLowerCase}).
|
|
790
|
+
* @param entityIds - Distinct ids to query. Prefer length ≤ 100 or the server may reject the request.
|
|
791
|
+
* @param options - Optional contributor limits/window.
|
|
792
|
+
* @returns Array of {@link TrustState} in server-defined order; empty array when `entityIds` is empty.
|
|
793
|
+
*/
|
|
794
|
+
getTrustStates(entityType: EntityTypeLowerCase, entityIds: readonly string[], options?: TrustStateOptions): Promise<TrustState[]>;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* High-level QATI API client: namespaces for tenant, trust state, advisories, explain, and batched event ingestion.
|
|
799
|
+
*
|
|
800
|
+
* Construct via {@link Session#createClient}; do not call `new Client(...)` directly unless you already have {@link QatiConfigOutput}.
|
|
801
|
+
*
|
|
802
|
+
* @example
|
|
803
|
+
* ```typescript
|
|
804
|
+
* const session = new Session();
|
|
805
|
+
* const client = session.createClient();
|
|
806
|
+
* const explained = await client.explain.get('USER:user-123');
|
|
807
|
+
* console.log(explained.closure_score);
|
|
808
|
+
* ```
|
|
809
|
+
*/
|
|
810
|
+
declare class Client extends HttpClient {
|
|
811
|
+
private readonly _tenant;
|
|
812
|
+
private readonly _trustState;
|
|
813
|
+
private readonly _advisory;
|
|
814
|
+
private readonly _explain;
|
|
815
|
+
private readonly _events;
|
|
816
|
+
/**
|
|
817
|
+
* @param config - Resolved SDK configuration (typically `session.config`).
|
|
818
|
+
* @param axiosInstances - Optional per-API `axios` instances; see {@link Session#createClient}.
|
|
819
|
+
* @param eventResourceOptions - Optional overrides for buffered ingestion (`onDeadLetter`, batch sizing).
|
|
820
|
+
*/
|
|
821
|
+
constructor(config: QatiConfigOutput, axiosInstances?: AxiosInstances);
|
|
822
|
+
/**
|
|
823
|
+
* Tenant API surface (credentials verification).
|
|
824
|
+
*
|
|
825
|
+
* @returns {@link TenantResource} bound to this client’s Query API base URL and tenant key.
|
|
826
|
+
*/
|
|
827
|
+
get tenant(): TenantResource;
|
|
828
|
+
/**
|
|
829
|
+
* Trust scores and contributors for entities.
|
|
830
|
+
*
|
|
831
|
+
* @returns {@link TrustStateResource} for the Query API.
|
|
832
|
+
*/
|
|
833
|
+
get trustState(): TrustStateResource;
|
|
834
|
+
/**
|
|
835
|
+
* List persisted advisories for an entity.
|
|
836
|
+
*
|
|
837
|
+
* @returns {@link AdvisoryResource} for the Query API.
|
|
838
|
+
*/
|
|
839
|
+
get advisory(): AdvisoryResource;
|
|
840
|
+
/**
|
|
841
|
+
* Composite explain / attribution for an entity key.
|
|
842
|
+
*
|
|
843
|
+
* @returns {@link ExplainResource} for the Query API.
|
|
844
|
+
*/
|
|
845
|
+
get explain(): ExplainResource;
|
|
846
|
+
/**
|
|
847
|
+
* Buffered ingestion of `RawEventRequest` payloads to the ingestion API (`POST /v1/events:batch`).
|
|
848
|
+
*
|
|
849
|
+
* @returns {@link EventResource} for the Query API.
|
|
850
|
+
*/
|
|
851
|
+
get events(): EventResource;
|
|
852
|
+
/**
|
|
853
|
+
* Flushes the event ingestion buffer (best-effort), then shuts down the batch scheduler.
|
|
854
|
+
* Call this on process shutdown so queued events are not lost.
|
|
855
|
+
*
|
|
856
|
+
* @returns Resolves when {@link EventResource#shutdown} completes.
|
|
857
|
+
*/
|
|
858
|
+
close(): Promise<void>;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Entry point for the SDK: holds resolved {@link QatiConfigOutput} and builds {@link Client} instances.
|
|
863
|
+
*
|
|
864
|
+
* If `config` is omitted, calls {@link resolveQatiConfig} (loads `.env`, merges `QATI_*` env vars into camelCase,
|
|
865
|
+
* applies Zod defaults for optional fields only). **Query and Ingestion base URLs are required** — set
|
|
866
|
+
* `QATI_QUERY_API_BASE_URL` and `QATI_INGESTION_API_BASE_URL` (or pass `queryApiBaseUrl` / `ingestionApiBaseUrl`).
|
|
867
|
+
* **Precedence** (highest first): constructor argument → environment → Zod defaults (not applied to base URLs).
|
|
868
|
+
*
|
|
869
|
+
* @example
|
|
870
|
+
* ```ts
|
|
871
|
+
* const session = new Session({
|
|
872
|
+
* tenantApiKey: 'qati-...',
|
|
873
|
+
* queryApiBaseUrl: 'http://localhost:8001',
|
|
874
|
+
* ingestionApiBaseUrl: 'http://localhost:8000',
|
|
875
|
+
* });
|
|
876
|
+
* const client = session.createClient();
|
|
877
|
+
* await client.tenant.verifyCredentials();
|
|
878
|
+
* ```
|
|
879
|
+
*/
|
|
880
|
+
declare class Session {
|
|
881
|
+
private readonly _config;
|
|
882
|
+
constructor(config?: Partial<QatiConfigInput>);
|
|
883
|
+
/**
|
|
884
|
+
* Resolved, validated configuration.
|
|
885
|
+
*/
|
|
886
|
+
get config(): QatiConfigOutput;
|
|
887
|
+
/**
|
|
888
|
+
* Creates an API {@link Client} using this session’s resolved config.
|
|
889
|
+
*
|
|
890
|
+
* @param httpClients - Optional injected `axios` instances keyed by `query_api` / `ingestion_api` (testing, proxies, interceptors).
|
|
891
|
+
* @returns A new {@link Client} (not a singleton).
|
|
892
|
+
* @example
|
|
893
|
+
* ```typescript
|
|
894
|
+
* const session = new Session();
|
|
895
|
+
* const client = session.createClient();
|
|
896
|
+
* const explained = await client.explain.get('USER:user-123');
|
|
897
|
+
* console.log(explained.closure_score);
|
|
898
|
+
* ```
|
|
899
|
+
*/
|
|
900
|
+
createClient(httpClients?: AxiosInstances): Client;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Shapes returned by `POST /v1/events:batch` on the ingestion API (per-event acks and errors).
|
|
905
|
+
*/
|
|
906
|
+
/**
|
|
907
|
+
* Per-event outcome after batch ingestion (API) or after SDK buffering (local).
|
|
908
|
+
*/
|
|
909
|
+
type EventAcknowledgement = {
|
|
910
|
+
/** Persisted raw-event id assigned by the ingestion API. */
|
|
911
|
+
event_id: string;
|
|
912
|
+
/**
|
|
913
|
+
* API: `accepted` when stored; `rejected` when validation or policy blocked the row.
|
|
914
|
+
* SDK only: `queued` when the event was accepted into the client buffer (not yet sent or persisted by the API).
|
|
915
|
+
*/
|
|
916
|
+
status: 'accepted' | 'rejected' | 'queued';
|
|
917
|
+
};
|
|
918
|
+
/**
|
|
919
|
+
* Error row for one failed event (or batch-level failure with optional `event_id`).
|
|
920
|
+
*/
|
|
921
|
+
type EventError = {
|
|
922
|
+
/** Present when the error is tied to a specific event; may be `null` for batch-level issues. */
|
|
923
|
+
event_id?: string | null;
|
|
924
|
+
/** Stable machine-readable reason (align with ingestion API docs). */
|
|
925
|
+
reason_code: string;
|
|
926
|
+
/** Optional human-readable detail from the server. */
|
|
927
|
+
message?: string | null;
|
|
928
|
+
};
|
|
929
|
+
type BatchEventResponse = {
|
|
930
|
+
acknowledgements: EventAcknowledgement[];
|
|
931
|
+
errors: EventError[];
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Zod schemas extending `BaseEventSchema` with per-`signal_type` payloads for v1 ingestion.
|
|
936
|
+
*
|
|
937
|
+
* **Numeric constraints:** several fields use `[0, 1]` ranges, non-negative amounts, or integer counts as annotated on each schema.
|
|
938
|
+
*/
|
|
939
|
+
|
|
940
|
+
declare const TransactionSignalSchema: z.ZodObject<{
|
|
941
|
+
tenant_id: z.ZodString;
|
|
942
|
+
signal_version: z.ZodString;
|
|
943
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
944
|
+
principal: z.ZodObject<{
|
|
945
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
946
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
947
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
948
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
949
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
950
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
951
|
+
}, "strip", z.ZodTypeAny, {
|
|
952
|
+
user_id?: string | undefined;
|
|
953
|
+
account_id?: string | undefined;
|
|
954
|
+
device_id?: string | undefined;
|
|
955
|
+
session_id?: string | undefined;
|
|
956
|
+
model_id?: string | undefined;
|
|
957
|
+
service_id?: string | undefined;
|
|
958
|
+
}, {
|
|
959
|
+
user_id?: string | undefined;
|
|
960
|
+
account_id?: string | undefined;
|
|
961
|
+
device_id?: string | undefined;
|
|
962
|
+
session_id?: string | undefined;
|
|
963
|
+
model_id?: string | undefined;
|
|
964
|
+
service_id?: string | undefined;
|
|
965
|
+
}>;
|
|
966
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
967
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
968
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
969
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
970
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
971
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
972
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
973
|
+
}, "strip", z.ZodTypeAny, {
|
|
974
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
975
|
+
source_id?: string | undefined;
|
|
976
|
+
epoch_counter?: number | undefined;
|
|
977
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
978
|
+
}, {
|
|
979
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
980
|
+
source_id?: string | undefined;
|
|
981
|
+
epoch_counter?: number | undefined;
|
|
982
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
983
|
+
}>>;
|
|
984
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
985
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
986
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
987
|
+
}, "strip", z.ZodTypeAny, {
|
|
988
|
+
hash?: string | undefined;
|
|
989
|
+
signature?: string | undefined;
|
|
990
|
+
}, {
|
|
991
|
+
hash?: string | undefined;
|
|
992
|
+
signature?: string | undefined;
|
|
993
|
+
}>>;
|
|
994
|
+
} & {
|
|
995
|
+
signal_payload: z.ZodObject<{
|
|
996
|
+
amount: z.ZodDefault<z.ZodNumber>;
|
|
997
|
+
amount_minor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
998
|
+
amount_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
999
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1000
|
+
merchant_category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1001
|
+
merchant_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1002
|
+
channel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1003
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1004
|
+
velocity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1005
|
+
external_anomaly_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1006
|
+
geo_distance: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1007
|
+
geo_distance_km: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1008
|
+
records_accessed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1009
|
+
baseline_records_accessed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1010
|
+
sensitivity_level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1011
|
+
export_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1012
|
+
bulk_export: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1013
|
+
contains_phi: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1014
|
+
control_command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1015
|
+
authorized: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1016
|
+
safety_critical: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1017
|
+
}, "strip", z.ZodTypeAny, {
|
|
1018
|
+
amount: number;
|
|
1019
|
+
bulk_export: boolean;
|
|
1020
|
+
contains_phi: boolean;
|
|
1021
|
+
safety_critical: boolean;
|
|
1022
|
+
amount_minor?: number | null | undefined;
|
|
1023
|
+
amount_usd?: number | null | undefined;
|
|
1024
|
+
currency?: string | null | undefined;
|
|
1025
|
+
merchant_category?: string | null | undefined;
|
|
1026
|
+
merchant_id?: string | null | undefined;
|
|
1027
|
+
channel?: string | null | undefined;
|
|
1028
|
+
country?: string | null | undefined;
|
|
1029
|
+
velocity?: number | null | undefined;
|
|
1030
|
+
external_anomaly_score?: number | null | undefined;
|
|
1031
|
+
geo_distance?: number | null | undefined;
|
|
1032
|
+
geo_distance_km?: number | null | undefined;
|
|
1033
|
+
records_accessed?: number | null | undefined;
|
|
1034
|
+
baseline_records_accessed?: number | null | undefined;
|
|
1035
|
+
sensitivity_level?: string | null | undefined;
|
|
1036
|
+
export_count?: number | null | undefined;
|
|
1037
|
+
control_command?: string | null | undefined;
|
|
1038
|
+
authorized?: boolean | null | undefined;
|
|
1039
|
+
}, {
|
|
1040
|
+
amount?: number | undefined;
|
|
1041
|
+
amount_minor?: number | null | undefined;
|
|
1042
|
+
amount_usd?: number | null | undefined;
|
|
1043
|
+
currency?: string | null | undefined;
|
|
1044
|
+
merchant_category?: string | null | undefined;
|
|
1045
|
+
merchant_id?: string | null | undefined;
|
|
1046
|
+
channel?: string | null | undefined;
|
|
1047
|
+
country?: string | null | undefined;
|
|
1048
|
+
velocity?: number | null | undefined;
|
|
1049
|
+
external_anomaly_score?: number | null | undefined;
|
|
1050
|
+
geo_distance?: number | null | undefined;
|
|
1051
|
+
geo_distance_km?: number | null | undefined;
|
|
1052
|
+
records_accessed?: number | null | undefined;
|
|
1053
|
+
baseline_records_accessed?: number | null | undefined;
|
|
1054
|
+
sensitivity_level?: string | null | undefined;
|
|
1055
|
+
export_count?: number | null | undefined;
|
|
1056
|
+
bulk_export?: boolean | undefined;
|
|
1057
|
+
contains_phi?: boolean | undefined;
|
|
1058
|
+
control_command?: string | null | undefined;
|
|
1059
|
+
authorized?: boolean | null | undefined;
|
|
1060
|
+
safety_critical?: boolean | undefined;
|
|
1061
|
+
}>;
|
|
1062
|
+
}, "strip", z.ZodTypeAny, {
|
|
1063
|
+
tenant_id: string;
|
|
1064
|
+
signal_version: string;
|
|
1065
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1066
|
+
signal_payload: {
|
|
1067
|
+
amount: number;
|
|
1068
|
+
bulk_export: boolean;
|
|
1069
|
+
contains_phi: boolean;
|
|
1070
|
+
safety_critical: boolean;
|
|
1071
|
+
amount_minor?: number | null | undefined;
|
|
1072
|
+
amount_usd?: number | null | undefined;
|
|
1073
|
+
currency?: string | null | undefined;
|
|
1074
|
+
merchant_category?: string | null | undefined;
|
|
1075
|
+
merchant_id?: string | null | undefined;
|
|
1076
|
+
channel?: string | null | undefined;
|
|
1077
|
+
country?: string | null | undefined;
|
|
1078
|
+
velocity?: number | null | undefined;
|
|
1079
|
+
external_anomaly_score?: number | null | undefined;
|
|
1080
|
+
geo_distance?: number | null | undefined;
|
|
1081
|
+
geo_distance_km?: number | null | undefined;
|
|
1082
|
+
records_accessed?: number | null | undefined;
|
|
1083
|
+
baseline_records_accessed?: number | null | undefined;
|
|
1084
|
+
sensitivity_level?: string | null | undefined;
|
|
1085
|
+
export_count?: number | null | undefined;
|
|
1086
|
+
control_command?: string | null | undefined;
|
|
1087
|
+
authorized?: boolean | null | undefined;
|
|
1088
|
+
};
|
|
1089
|
+
principal: {
|
|
1090
|
+
user_id?: string | undefined;
|
|
1091
|
+
account_id?: string | undefined;
|
|
1092
|
+
device_id?: string | undefined;
|
|
1093
|
+
session_id?: string | undefined;
|
|
1094
|
+
model_id?: string | undefined;
|
|
1095
|
+
service_id?: string | undefined;
|
|
1096
|
+
};
|
|
1097
|
+
integrity?: {
|
|
1098
|
+
hash?: string | undefined;
|
|
1099
|
+
signature?: string | undefined;
|
|
1100
|
+
} | undefined;
|
|
1101
|
+
timestamp?: string | undefined;
|
|
1102
|
+
confidence_hint?: number | undefined;
|
|
1103
|
+
provenance?: {
|
|
1104
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1105
|
+
source_id?: string | undefined;
|
|
1106
|
+
epoch_counter?: number | undefined;
|
|
1107
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1108
|
+
} | undefined;
|
|
1109
|
+
}, {
|
|
1110
|
+
tenant_id: string;
|
|
1111
|
+
signal_version: string;
|
|
1112
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1113
|
+
signal_payload: {
|
|
1114
|
+
amount?: number | undefined;
|
|
1115
|
+
amount_minor?: number | null | undefined;
|
|
1116
|
+
amount_usd?: number | null | undefined;
|
|
1117
|
+
currency?: string | null | undefined;
|
|
1118
|
+
merchant_category?: string | null | undefined;
|
|
1119
|
+
merchant_id?: string | null | undefined;
|
|
1120
|
+
channel?: string | null | undefined;
|
|
1121
|
+
country?: string | null | undefined;
|
|
1122
|
+
velocity?: number | null | undefined;
|
|
1123
|
+
external_anomaly_score?: number | null | undefined;
|
|
1124
|
+
geo_distance?: number | null | undefined;
|
|
1125
|
+
geo_distance_km?: number | null | undefined;
|
|
1126
|
+
records_accessed?: number | null | undefined;
|
|
1127
|
+
baseline_records_accessed?: number | null | undefined;
|
|
1128
|
+
sensitivity_level?: string | null | undefined;
|
|
1129
|
+
export_count?: number | null | undefined;
|
|
1130
|
+
bulk_export?: boolean | undefined;
|
|
1131
|
+
contains_phi?: boolean | undefined;
|
|
1132
|
+
control_command?: string | null | undefined;
|
|
1133
|
+
authorized?: boolean | null | undefined;
|
|
1134
|
+
safety_critical?: boolean | undefined;
|
|
1135
|
+
};
|
|
1136
|
+
principal: {
|
|
1137
|
+
user_id?: string | undefined;
|
|
1138
|
+
account_id?: string | undefined;
|
|
1139
|
+
device_id?: string | undefined;
|
|
1140
|
+
session_id?: string | undefined;
|
|
1141
|
+
model_id?: string | undefined;
|
|
1142
|
+
service_id?: string | undefined;
|
|
1143
|
+
};
|
|
1144
|
+
integrity?: {
|
|
1145
|
+
hash?: string | undefined;
|
|
1146
|
+
signature?: string | undefined;
|
|
1147
|
+
} | undefined;
|
|
1148
|
+
timestamp?: string | undefined;
|
|
1149
|
+
confidence_hint?: number | undefined;
|
|
1150
|
+
provenance?: {
|
|
1151
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1152
|
+
source_id?: string | undefined;
|
|
1153
|
+
epoch_counter?: number | undefined;
|
|
1154
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1155
|
+
} | undefined;
|
|
1156
|
+
}>;
|
|
1157
|
+
declare const AnomalyFlagSignalSchema: z.ZodObject<{
|
|
1158
|
+
tenant_id: z.ZodString;
|
|
1159
|
+
signal_version: z.ZodString;
|
|
1160
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
1161
|
+
principal: z.ZodObject<{
|
|
1162
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1163
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
1164
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
1165
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
1166
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
1167
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
1168
|
+
}, "strip", z.ZodTypeAny, {
|
|
1169
|
+
user_id?: string | undefined;
|
|
1170
|
+
account_id?: string | undefined;
|
|
1171
|
+
device_id?: string | undefined;
|
|
1172
|
+
session_id?: string | undefined;
|
|
1173
|
+
model_id?: string | undefined;
|
|
1174
|
+
service_id?: string | undefined;
|
|
1175
|
+
}, {
|
|
1176
|
+
user_id?: string | undefined;
|
|
1177
|
+
account_id?: string | undefined;
|
|
1178
|
+
device_id?: string | undefined;
|
|
1179
|
+
session_id?: string | undefined;
|
|
1180
|
+
model_id?: string | undefined;
|
|
1181
|
+
service_id?: string | undefined;
|
|
1182
|
+
}>;
|
|
1183
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1184
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
1185
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1186
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
1187
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
1188
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
1189
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
1190
|
+
}, "strip", z.ZodTypeAny, {
|
|
1191
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1192
|
+
source_id?: string | undefined;
|
|
1193
|
+
epoch_counter?: number | undefined;
|
|
1194
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1195
|
+
}, {
|
|
1196
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1197
|
+
source_id?: string | undefined;
|
|
1198
|
+
epoch_counter?: number | undefined;
|
|
1199
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1200
|
+
}>>;
|
|
1201
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
1202
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1203
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
1204
|
+
}, "strip", z.ZodTypeAny, {
|
|
1205
|
+
hash?: string | undefined;
|
|
1206
|
+
signature?: string | undefined;
|
|
1207
|
+
}, {
|
|
1208
|
+
hash?: string | undefined;
|
|
1209
|
+
signature?: string | undefined;
|
|
1210
|
+
}>>;
|
|
1211
|
+
} & {
|
|
1212
|
+
signal_payload: z.ZodObject<{
|
|
1213
|
+
severity: z.ZodNumber;
|
|
1214
|
+
}, "strip", z.ZodTypeAny, {
|
|
1215
|
+
severity: number;
|
|
1216
|
+
}, {
|
|
1217
|
+
severity: number;
|
|
1218
|
+
}>;
|
|
1219
|
+
}, "strip", z.ZodTypeAny, {
|
|
1220
|
+
tenant_id: string;
|
|
1221
|
+
signal_version: string;
|
|
1222
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1223
|
+
signal_payload: {
|
|
1224
|
+
severity: number;
|
|
1225
|
+
};
|
|
1226
|
+
principal: {
|
|
1227
|
+
user_id?: string | undefined;
|
|
1228
|
+
account_id?: string | undefined;
|
|
1229
|
+
device_id?: string | undefined;
|
|
1230
|
+
session_id?: string | undefined;
|
|
1231
|
+
model_id?: string | undefined;
|
|
1232
|
+
service_id?: string | undefined;
|
|
1233
|
+
};
|
|
1234
|
+
integrity?: {
|
|
1235
|
+
hash?: string | undefined;
|
|
1236
|
+
signature?: string | undefined;
|
|
1237
|
+
} | undefined;
|
|
1238
|
+
timestamp?: string | undefined;
|
|
1239
|
+
confidence_hint?: number | undefined;
|
|
1240
|
+
provenance?: {
|
|
1241
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1242
|
+
source_id?: string | undefined;
|
|
1243
|
+
epoch_counter?: number | undefined;
|
|
1244
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1245
|
+
} | undefined;
|
|
1246
|
+
}, {
|
|
1247
|
+
tenant_id: string;
|
|
1248
|
+
signal_version: string;
|
|
1249
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1250
|
+
signal_payload: {
|
|
1251
|
+
severity: number;
|
|
1252
|
+
};
|
|
1253
|
+
principal: {
|
|
1254
|
+
user_id?: string | undefined;
|
|
1255
|
+
account_id?: string | undefined;
|
|
1256
|
+
device_id?: string | undefined;
|
|
1257
|
+
session_id?: string | undefined;
|
|
1258
|
+
model_id?: string | undefined;
|
|
1259
|
+
service_id?: string | undefined;
|
|
1260
|
+
};
|
|
1261
|
+
integrity?: {
|
|
1262
|
+
hash?: string | undefined;
|
|
1263
|
+
signature?: string | undefined;
|
|
1264
|
+
} | undefined;
|
|
1265
|
+
timestamp?: string | undefined;
|
|
1266
|
+
confidence_hint?: number | undefined;
|
|
1267
|
+
provenance?: {
|
|
1268
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1269
|
+
source_id?: string | undefined;
|
|
1270
|
+
epoch_counter?: number | undefined;
|
|
1271
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1272
|
+
} | undefined;
|
|
1273
|
+
}>;
|
|
1274
|
+
declare const AuthSignalSchema: z.ZodObject<{
|
|
1275
|
+
tenant_id: z.ZodString;
|
|
1276
|
+
signal_version: z.ZodString;
|
|
1277
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
1278
|
+
principal: z.ZodObject<{
|
|
1279
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1280
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
1281
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
1282
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
1283
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
1284
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
1285
|
+
}, "strip", z.ZodTypeAny, {
|
|
1286
|
+
user_id?: string | undefined;
|
|
1287
|
+
account_id?: string | undefined;
|
|
1288
|
+
device_id?: string | undefined;
|
|
1289
|
+
session_id?: string | undefined;
|
|
1290
|
+
model_id?: string | undefined;
|
|
1291
|
+
service_id?: string | undefined;
|
|
1292
|
+
}, {
|
|
1293
|
+
user_id?: string | undefined;
|
|
1294
|
+
account_id?: string | undefined;
|
|
1295
|
+
device_id?: string | undefined;
|
|
1296
|
+
session_id?: string | undefined;
|
|
1297
|
+
model_id?: string | undefined;
|
|
1298
|
+
service_id?: string | undefined;
|
|
1299
|
+
}>;
|
|
1300
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1301
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
1302
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1303
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
1304
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
1305
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
1306
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
1307
|
+
}, "strip", z.ZodTypeAny, {
|
|
1308
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1309
|
+
source_id?: string | undefined;
|
|
1310
|
+
epoch_counter?: number | undefined;
|
|
1311
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1312
|
+
}, {
|
|
1313
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1314
|
+
source_id?: string | undefined;
|
|
1315
|
+
epoch_counter?: number | undefined;
|
|
1316
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1317
|
+
}>>;
|
|
1318
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
1319
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1320
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
1321
|
+
}, "strip", z.ZodTypeAny, {
|
|
1322
|
+
hash?: string | undefined;
|
|
1323
|
+
signature?: string | undefined;
|
|
1324
|
+
}, {
|
|
1325
|
+
hash?: string | undefined;
|
|
1326
|
+
signature?: string | undefined;
|
|
1327
|
+
}>>;
|
|
1328
|
+
} & {
|
|
1329
|
+
signal_payload: z.ZodObject<{
|
|
1330
|
+
result: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1331
|
+
auth_method: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1332
|
+
mfa_used: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1333
|
+
mfa_bypassed: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1334
|
+
failed_attempts: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1335
|
+
ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1336
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1337
|
+
user_agent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1338
|
+
unusual_location: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1339
|
+
after_hours_login: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1340
|
+
}, "strip", z.ZodTypeAny, {
|
|
1341
|
+
mfa_bypassed: boolean;
|
|
1342
|
+
failed_attempts: number;
|
|
1343
|
+
unusual_location: boolean;
|
|
1344
|
+
after_hours_login: boolean;
|
|
1345
|
+
country?: string | null | undefined;
|
|
1346
|
+
result?: string | null | undefined;
|
|
1347
|
+
auth_method?: string | null | undefined;
|
|
1348
|
+
mfa_used?: boolean | null | undefined;
|
|
1349
|
+
ip?: string | null | undefined;
|
|
1350
|
+
user_agent?: string | null | undefined;
|
|
1351
|
+
}, {
|
|
1352
|
+
country?: string | null | undefined;
|
|
1353
|
+
result?: string | null | undefined;
|
|
1354
|
+
auth_method?: string | null | undefined;
|
|
1355
|
+
mfa_used?: boolean | null | undefined;
|
|
1356
|
+
mfa_bypassed?: boolean | undefined;
|
|
1357
|
+
failed_attempts?: number | undefined;
|
|
1358
|
+
ip?: string | null | undefined;
|
|
1359
|
+
user_agent?: string | null | undefined;
|
|
1360
|
+
unusual_location?: boolean | undefined;
|
|
1361
|
+
after_hours_login?: boolean | undefined;
|
|
1362
|
+
}>;
|
|
1363
|
+
}, "strip", z.ZodTypeAny, {
|
|
1364
|
+
tenant_id: string;
|
|
1365
|
+
signal_version: string;
|
|
1366
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1367
|
+
signal_payload: {
|
|
1368
|
+
mfa_bypassed: boolean;
|
|
1369
|
+
failed_attempts: number;
|
|
1370
|
+
unusual_location: boolean;
|
|
1371
|
+
after_hours_login: boolean;
|
|
1372
|
+
country?: string | null | undefined;
|
|
1373
|
+
result?: string | null | undefined;
|
|
1374
|
+
auth_method?: string | null | undefined;
|
|
1375
|
+
mfa_used?: boolean | null | undefined;
|
|
1376
|
+
ip?: string | null | undefined;
|
|
1377
|
+
user_agent?: string | null | undefined;
|
|
1378
|
+
};
|
|
1379
|
+
principal: {
|
|
1380
|
+
user_id?: string | undefined;
|
|
1381
|
+
account_id?: string | undefined;
|
|
1382
|
+
device_id?: string | undefined;
|
|
1383
|
+
session_id?: string | undefined;
|
|
1384
|
+
model_id?: string | undefined;
|
|
1385
|
+
service_id?: string | undefined;
|
|
1386
|
+
};
|
|
1387
|
+
integrity?: {
|
|
1388
|
+
hash?: string | undefined;
|
|
1389
|
+
signature?: string | undefined;
|
|
1390
|
+
} | undefined;
|
|
1391
|
+
timestamp?: string | undefined;
|
|
1392
|
+
confidence_hint?: number | undefined;
|
|
1393
|
+
provenance?: {
|
|
1394
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1395
|
+
source_id?: string | undefined;
|
|
1396
|
+
epoch_counter?: number | undefined;
|
|
1397
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1398
|
+
} | undefined;
|
|
1399
|
+
}, {
|
|
1400
|
+
tenant_id: string;
|
|
1401
|
+
signal_version: string;
|
|
1402
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1403
|
+
signal_payload: {
|
|
1404
|
+
country?: string | null | undefined;
|
|
1405
|
+
result?: string | null | undefined;
|
|
1406
|
+
auth_method?: string | null | undefined;
|
|
1407
|
+
mfa_used?: boolean | null | undefined;
|
|
1408
|
+
mfa_bypassed?: boolean | undefined;
|
|
1409
|
+
failed_attempts?: number | undefined;
|
|
1410
|
+
ip?: string | null | undefined;
|
|
1411
|
+
user_agent?: string | null | undefined;
|
|
1412
|
+
unusual_location?: boolean | undefined;
|
|
1413
|
+
after_hours_login?: boolean | undefined;
|
|
1414
|
+
};
|
|
1415
|
+
principal: {
|
|
1416
|
+
user_id?: string | undefined;
|
|
1417
|
+
account_id?: string | undefined;
|
|
1418
|
+
device_id?: string | undefined;
|
|
1419
|
+
session_id?: string | undefined;
|
|
1420
|
+
model_id?: string | undefined;
|
|
1421
|
+
service_id?: string | undefined;
|
|
1422
|
+
};
|
|
1423
|
+
integrity?: {
|
|
1424
|
+
hash?: string | undefined;
|
|
1425
|
+
signature?: string | undefined;
|
|
1426
|
+
} | undefined;
|
|
1427
|
+
timestamp?: string | undefined;
|
|
1428
|
+
confidence_hint?: number | undefined;
|
|
1429
|
+
provenance?: {
|
|
1430
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1431
|
+
source_id?: string | undefined;
|
|
1432
|
+
epoch_counter?: number | undefined;
|
|
1433
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1434
|
+
} | undefined;
|
|
1435
|
+
}>;
|
|
1436
|
+
declare const BehaviorSignalSchema: z.ZodObject<{
|
|
1437
|
+
tenant_id: z.ZodString;
|
|
1438
|
+
signal_version: z.ZodString;
|
|
1439
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
1440
|
+
principal: z.ZodObject<{
|
|
1441
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1442
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
1443
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
1444
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
1445
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
1446
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
1447
|
+
}, "strip", z.ZodTypeAny, {
|
|
1448
|
+
user_id?: string | undefined;
|
|
1449
|
+
account_id?: string | undefined;
|
|
1450
|
+
device_id?: string | undefined;
|
|
1451
|
+
session_id?: string | undefined;
|
|
1452
|
+
model_id?: string | undefined;
|
|
1453
|
+
service_id?: string | undefined;
|
|
1454
|
+
}, {
|
|
1455
|
+
user_id?: string | undefined;
|
|
1456
|
+
account_id?: string | undefined;
|
|
1457
|
+
device_id?: string | undefined;
|
|
1458
|
+
session_id?: string | undefined;
|
|
1459
|
+
model_id?: string | undefined;
|
|
1460
|
+
service_id?: string | undefined;
|
|
1461
|
+
}>;
|
|
1462
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1463
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
1464
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1465
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
1466
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
1467
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
1468
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
1469
|
+
}, "strip", z.ZodTypeAny, {
|
|
1470
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1471
|
+
source_id?: string | undefined;
|
|
1472
|
+
epoch_counter?: number | undefined;
|
|
1473
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1474
|
+
}, {
|
|
1475
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1476
|
+
source_id?: string | undefined;
|
|
1477
|
+
epoch_counter?: number | undefined;
|
|
1478
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1479
|
+
}>>;
|
|
1480
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
1481
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1482
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
1483
|
+
}, "strip", z.ZodTypeAny, {
|
|
1484
|
+
hash?: string | undefined;
|
|
1485
|
+
signature?: string | undefined;
|
|
1486
|
+
}, {
|
|
1487
|
+
hash?: string | undefined;
|
|
1488
|
+
signature?: string | undefined;
|
|
1489
|
+
}>>;
|
|
1490
|
+
} & {
|
|
1491
|
+
signal_payload: z.ZodObject<{
|
|
1492
|
+
deviation_score: z.ZodNumber;
|
|
1493
|
+
}, "strip", z.ZodTypeAny, {
|
|
1494
|
+
deviation_score: number;
|
|
1495
|
+
}, {
|
|
1496
|
+
deviation_score: number;
|
|
1497
|
+
}>;
|
|
1498
|
+
}, "strip", z.ZodTypeAny, {
|
|
1499
|
+
tenant_id: string;
|
|
1500
|
+
signal_version: string;
|
|
1501
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1502
|
+
signal_payload: {
|
|
1503
|
+
deviation_score: number;
|
|
1504
|
+
};
|
|
1505
|
+
principal: {
|
|
1506
|
+
user_id?: string | undefined;
|
|
1507
|
+
account_id?: string | undefined;
|
|
1508
|
+
device_id?: string | undefined;
|
|
1509
|
+
session_id?: string | undefined;
|
|
1510
|
+
model_id?: string | undefined;
|
|
1511
|
+
service_id?: string | undefined;
|
|
1512
|
+
};
|
|
1513
|
+
integrity?: {
|
|
1514
|
+
hash?: string | undefined;
|
|
1515
|
+
signature?: string | undefined;
|
|
1516
|
+
} | undefined;
|
|
1517
|
+
timestamp?: string | undefined;
|
|
1518
|
+
confidence_hint?: number | undefined;
|
|
1519
|
+
provenance?: {
|
|
1520
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1521
|
+
source_id?: string | undefined;
|
|
1522
|
+
epoch_counter?: number | undefined;
|
|
1523
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1524
|
+
} | undefined;
|
|
1525
|
+
}, {
|
|
1526
|
+
tenant_id: string;
|
|
1527
|
+
signal_version: string;
|
|
1528
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1529
|
+
signal_payload: {
|
|
1530
|
+
deviation_score: number;
|
|
1531
|
+
};
|
|
1532
|
+
principal: {
|
|
1533
|
+
user_id?: string | undefined;
|
|
1534
|
+
account_id?: string | undefined;
|
|
1535
|
+
device_id?: string | undefined;
|
|
1536
|
+
session_id?: string | undefined;
|
|
1537
|
+
model_id?: string | undefined;
|
|
1538
|
+
service_id?: string | undefined;
|
|
1539
|
+
};
|
|
1540
|
+
integrity?: {
|
|
1541
|
+
hash?: string | undefined;
|
|
1542
|
+
signature?: string | undefined;
|
|
1543
|
+
} | undefined;
|
|
1544
|
+
timestamp?: string | undefined;
|
|
1545
|
+
confidence_hint?: number | undefined;
|
|
1546
|
+
provenance?: {
|
|
1547
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1548
|
+
source_id?: string | undefined;
|
|
1549
|
+
epoch_counter?: number | undefined;
|
|
1550
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1551
|
+
} | undefined;
|
|
1552
|
+
}>;
|
|
1553
|
+
declare const NetworkSignalSchema: z.ZodObject<{
|
|
1554
|
+
tenant_id: z.ZodString;
|
|
1555
|
+
signal_version: z.ZodString;
|
|
1556
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
1557
|
+
principal: z.ZodObject<{
|
|
1558
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1559
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
1560
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
1561
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
1562
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
1563
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
1564
|
+
}, "strip", z.ZodTypeAny, {
|
|
1565
|
+
user_id?: string | undefined;
|
|
1566
|
+
account_id?: string | undefined;
|
|
1567
|
+
device_id?: string | undefined;
|
|
1568
|
+
session_id?: string | undefined;
|
|
1569
|
+
model_id?: string | undefined;
|
|
1570
|
+
service_id?: string | undefined;
|
|
1571
|
+
}, {
|
|
1572
|
+
user_id?: string | undefined;
|
|
1573
|
+
account_id?: string | undefined;
|
|
1574
|
+
device_id?: string | undefined;
|
|
1575
|
+
session_id?: string | undefined;
|
|
1576
|
+
model_id?: string | undefined;
|
|
1577
|
+
service_id?: string | undefined;
|
|
1578
|
+
}>;
|
|
1579
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1580
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
1581
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1582
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
1583
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
1584
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
1585
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
1586
|
+
}, "strip", z.ZodTypeAny, {
|
|
1587
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1588
|
+
source_id?: string | undefined;
|
|
1589
|
+
epoch_counter?: number | undefined;
|
|
1590
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1591
|
+
}, {
|
|
1592
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1593
|
+
source_id?: string | undefined;
|
|
1594
|
+
epoch_counter?: number | undefined;
|
|
1595
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1596
|
+
}>>;
|
|
1597
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
1598
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1599
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
1600
|
+
}, "strip", z.ZodTypeAny, {
|
|
1601
|
+
hash?: string | undefined;
|
|
1602
|
+
signature?: string | undefined;
|
|
1603
|
+
}, {
|
|
1604
|
+
hash?: string | undefined;
|
|
1605
|
+
signature?: string | undefined;
|
|
1606
|
+
}>>;
|
|
1607
|
+
} & {
|
|
1608
|
+
signal_payload: z.ZodObject<{
|
|
1609
|
+
ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1610
|
+
asn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1611
|
+
reputation_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1612
|
+
threat_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1613
|
+
is_datacenter: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1614
|
+
is_untrusted_segment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1615
|
+
asn_reputation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1616
|
+
}, "strip", z.ZodTypeAny, {
|
|
1617
|
+
is_untrusted_segment: boolean;
|
|
1618
|
+
ip?: string | null | undefined;
|
|
1619
|
+
asn?: string | null | undefined;
|
|
1620
|
+
reputation_score?: number | null | undefined;
|
|
1621
|
+
threat_score?: number | null | undefined;
|
|
1622
|
+
is_datacenter?: boolean | null | undefined;
|
|
1623
|
+
asn_reputation?: number | null | undefined;
|
|
1624
|
+
}, {
|
|
1625
|
+
ip?: string | null | undefined;
|
|
1626
|
+
asn?: string | null | undefined;
|
|
1627
|
+
reputation_score?: number | null | undefined;
|
|
1628
|
+
threat_score?: number | null | undefined;
|
|
1629
|
+
is_datacenter?: boolean | null | undefined;
|
|
1630
|
+
is_untrusted_segment?: boolean | undefined;
|
|
1631
|
+
asn_reputation?: number | null | undefined;
|
|
1632
|
+
}>;
|
|
1633
|
+
}, "strip", z.ZodTypeAny, {
|
|
1634
|
+
tenant_id: string;
|
|
1635
|
+
signal_version: string;
|
|
1636
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1637
|
+
signal_payload: {
|
|
1638
|
+
is_untrusted_segment: boolean;
|
|
1639
|
+
ip?: string | null | undefined;
|
|
1640
|
+
asn?: string | null | undefined;
|
|
1641
|
+
reputation_score?: number | null | undefined;
|
|
1642
|
+
threat_score?: number | null | undefined;
|
|
1643
|
+
is_datacenter?: boolean | null | undefined;
|
|
1644
|
+
asn_reputation?: number | null | undefined;
|
|
1645
|
+
};
|
|
1646
|
+
principal: {
|
|
1647
|
+
user_id?: string | undefined;
|
|
1648
|
+
account_id?: string | undefined;
|
|
1649
|
+
device_id?: string | undefined;
|
|
1650
|
+
session_id?: string | undefined;
|
|
1651
|
+
model_id?: string | undefined;
|
|
1652
|
+
service_id?: string | undefined;
|
|
1653
|
+
};
|
|
1654
|
+
integrity?: {
|
|
1655
|
+
hash?: string | undefined;
|
|
1656
|
+
signature?: string | undefined;
|
|
1657
|
+
} | undefined;
|
|
1658
|
+
timestamp?: string | undefined;
|
|
1659
|
+
confidence_hint?: number | undefined;
|
|
1660
|
+
provenance?: {
|
|
1661
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1662
|
+
source_id?: string | undefined;
|
|
1663
|
+
epoch_counter?: number | undefined;
|
|
1664
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1665
|
+
} | undefined;
|
|
1666
|
+
}, {
|
|
1667
|
+
tenant_id: string;
|
|
1668
|
+
signal_version: string;
|
|
1669
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1670
|
+
signal_payload: {
|
|
1671
|
+
ip?: string | null | undefined;
|
|
1672
|
+
asn?: string | null | undefined;
|
|
1673
|
+
reputation_score?: number | null | undefined;
|
|
1674
|
+
threat_score?: number | null | undefined;
|
|
1675
|
+
is_datacenter?: boolean | null | undefined;
|
|
1676
|
+
is_untrusted_segment?: boolean | undefined;
|
|
1677
|
+
asn_reputation?: number | null | undefined;
|
|
1678
|
+
};
|
|
1679
|
+
principal: {
|
|
1680
|
+
user_id?: string | undefined;
|
|
1681
|
+
account_id?: string | undefined;
|
|
1682
|
+
device_id?: string | undefined;
|
|
1683
|
+
session_id?: string | undefined;
|
|
1684
|
+
model_id?: string | undefined;
|
|
1685
|
+
service_id?: string | undefined;
|
|
1686
|
+
};
|
|
1687
|
+
integrity?: {
|
|
1688
|
+
hash?: string | undefined;
|
|
1689
|
+
signature?: string | undefined;
|
|
1690
|
+
} | undefined;
|
|
1691
|
+
timestamp?: string | undefined;
|
|
1692
|
+
confidence_hint?: number | undefined;
|
|
1693
|
+
provenance?: {
|
|
1694
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1695
|
+
source_id?: string | undefined;
|
|
1696
|
+
epoch_counter?: number | undefined;
|
|
1697
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1698
|
+
} | undefined;
|
|
1699
|
+
}>;
|
|
1700
|
+
declare const ModelOutputSignalSchema: z.ZodObject<{
|
|
1701
|
+
tenant_id: z.ZodString;
|
|
1702
|
+
signal_version: z.ZodString;
|
|
1703
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
1704
|
+
principal: z.ZodObject<{
|
|
1705
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1706
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
1707
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
1708
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
1709
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
1710
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
1711
|
+
}, "strip", z.ZodTypeAny, {
|
|
1712
|
+
user_id?: string | undefined;
|
|
1713
|
+
account_id?: string | undefined;
|
|
1714
|
+
device_id?: string | undefined;
|
|
1715
|
+
session_id?: string | undefined;
|
|
1716
|
+
model_id?: string | undefined;
|
|
1717
|
+
service_id?: string | undefined;
|
|
1718
|
+
}, {
|
|
1719
|
+
user_id?: string | undefined;
|
|
1720
|
+
account_id?: string | undefined;
|
|
1721
|
+
device_id?: string | undefined;
|
|
1722
|
+
session_id?: string | undefined;
|
|
1723
|
+
model_id?: string | undefined;
|
|
1724
|
+
service_id?: string | undefined;
|
|
1725
|
+
}>;
|
|
1726
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1727
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
1728
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1729
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
1730
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
1731
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
1732
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
1733
|
+
}, "strip", z.ZodTypeAny, {
|
|
1734
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1735
|
+
source_id?: string | undefined;
|
|
1736
|
+
epoch_counter?: number | undefined;
|
|
1737
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1738
|
+
}, {
|
|
1739
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1740
|
+
source_id?: string | undefined;
|
|
1741
|
+
epoch_counter?: number | undefined;
|
|
1742
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1743
|
+
}>>;
|
|
1744
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
1745
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1746
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
1747
|
+
}, "strip", z.ZodTypeAny, {
|
|
1748
|
+
hash?: string | undefined;
|
|
1749
|
+
signature?: string | undefined;
|
|
1750
|
+
}, {
|
|
1751
|
+
hash?: string | undefined;
|
|
1752
|
+
signature?: string | undefined;
|
|
1753
|
+
}>>;
|
|
1754
|
+
} & {
|
|
1755
|
+
signal_payload: z.ZodObject<{
|
|
1756
|
+
missing_citations_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1757
|
+
citation_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1758
|
+
expected_citation_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1759
|
+
policy_violations: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1760
|
+
policy_violation_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1761
|
+
tool_call_inconsistency: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1762
|
+
tool_inconsistency_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1763
|
+
tool_miss_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1764
|
+
eval_window_n: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1765
|
+
}, "strip", z.ZodTypeAny, {
|
|
1766
|
+
policy_violations: number;
|
|
1767
|
+
tool_call_inconsistency: number;
|
|
1768
|
+
missing_citations_rate?: number | null | undefined;
|
|
1769
|
+
citation_rate?: number | null | undefined;
|
|
1770
|
+
expected_citation_rate?: number | null | undefined;
|
|
1771
|
+
policy_violation_rate?: number | null | undefined;
|
|
1772
|
+
tool_inconsistency_rate?: number | null | undefined;
|
|
1773
|
+
tool_miss_rate?: number | null | undefined;
|
|
1774
|
+
eval_window_n?: number | null | undefined;
|
|
1775
|
+
}, {
|
|
1776
|
+
missing_citations_rate?: number | null | undefined;
|
|
1777
|
+
citation_rate?: number | null | undefined;
|
|
1778
|
+
expected_citation_rate?: number | null | undefined;
|
|
1779
|
+
policy_violations?: number | undefined;
|
|
1780
|
+
policy_violation_rate?: number | null | undefined;
|
|
1781
|
+
tool_call_inconsistency?: number | undefined;
|
|
1782
|
+
tool_inconsistency_rate?: number | null | undefined;
|
|
1783
|
+
tool_miss_rate?: number | null | undefined;
|
|
1784
|
+
eval_window_n?: number | null | undefined;
|
|
1785
|
+
}>;
|
|
1786
|
+
}, "strip", z.ZodTypeAny, {
|
|
1787
|
+
tenant_id: string;
|
|
1788
|
+
signal_version: string;
|
|
1789
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1790
|
+
signal_payload: {
|
|
1791
|
+
policy_violations: number;
|
|
1792
|
+
tool_call_inconsistency: number;
|
|
1793
|
+
missing_citations_rate?: number | null | undefined;
|
|
1794
|
+
citation_rate?: number | null | undefined;
|
|
1795
|
+
expected_citation_rate?: number | null | undefined;
|
|
1796
|
+
policy_violation_rate?: number | null | undefined;
|
|
1797
|
+
tool_inconsistency_rate?: number | null | undefined;
|
|
1798
|
+
tool_miss_rate?: number | null | undefined;
|
|
1799
|
+
eval_window_n?: number | null | undefined;
|
|
1800
|
+
};
|
|
1801
|
+
principal: {
|
|
1802
|
+
user_id?: string | undefined;
|
|
1803
|
+
account_id?: string | undefined;
|
|
1804
|
+
device_id?: string | undefined;
|
|
1805
|
+
session_id?: string | undefined;
|
|
1806
|
+
model_id?: string | undefined;
|
|
1807
|
+
service_id?: string | undefined;
|
|
1808
|
+
};
|
|
1809
|
+
integrity?: {
|
|
1810
|
+
hash?: string | undefined;
|
|
1811
|
+
signature?: string | undefined;
|
|
1812
|
+
} | undefined;
|
|
1813
|
+
timestamp?: string | undefined;
|
|
1814
|
+
confidence_hint?: number | undefined;
|
|
1815
|
+
provenance?: {
|
|
1816
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1817
|
+
source_id?: string | undefined;
|
|
1818
|
+
epoch_counter?: number | undefined;
|
|
1819
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1820
|
+
} | undefined;
|
|
1821
|
+
}, {
|
|
1822
|
+
tenant_id: string;
|
|
1823
|
+
signal_version: string;
|
|
1824
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1825
|
+
signal_payload: {
|
|
1826
|
+
missing_citations_rate?: number | null | undefined;
|
|
1827
|
+
citation_rate?: number | null | undefined;
|
|
1828
|
+
expected_citation_rate?: number | null | undefined;
|
|
1829
|
+
policy_violations?: number | undefined;
|
|
1830
|
+
policy_violation_rate?: number | null | undefined;
|
|
1831
|
+
tool_call_inconsistency?: number | undefined;
|
|
1832
|
+
tool_inconsistency_rate?: number | null | undefined;
|
|
1833
|
+
tool_miss_rate?: number | null | undefined;
|
|
1834
|
+
eval_window_n?: number | null | undefined;
|
|
1835
|
+
};
|
|
1836
|
+
principal: {
|
|
1837
|
+
user_id?: string | undefined;
|
|
1838
|
+
account_id?: string | undefined;
|
|
1839
|
+
device_id?: string | undefined;
|
|
1840
|
+
session_id?: string | undefined;
|
|
1841
|
+
model_id?: string | undefined;
|
|
1842
|
+
service_id?: string | undefined;
|
|
1843
|
+
};
|
|
1844
|
+
integrity?: {
|
|
1845
|
+
hash?: string | undefined;
|
|
1846
|
+
signature?: string | undefined;
|
|
1847
|
+
} | undefined;
|
|
1848
|
+
timestamp?: string | undefined;
|
|
1849
|
+
confidence_hint?: number | undefined;
|
|
1850
|
+
provenance?: {
|
|
1851
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1852
|
+
source_id?: string | undefined;
|
|
1853
|
+
epoch_counter?: number | undefined;
|
|
1854
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1855
|
+
} | undefined;
|
|
1856
|
+
}>;
|
|
1857
|
+
declare const SystemTelemetrySignalSchema: z.ZodObject<{
|
|
1858
|
+
tenant_id: z.ZodString;
|
|
1859
|
+
signal_version: z.ZodString;
|
|
1860
|
+
signal_type: z.ZodEnum<["TRANSACTION", "AUTH", "BEHAVIOR", "SYSTEM_TELEMETRY", "MODEL_OUTPUT", "ANOMALY_FLAG", "NETWORK_EVENT"]>;
|
|
1861
|
+
principal: z.ZodObject<{
|
|
1862
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1863
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
1864
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
1865
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
1866
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
1867
|
+
service_id: z.ZodOptional<z.ZodString>;
|
|
1868
|
+
}, "strip", z.ZodTypeAny, {
|
|
1869
|
+
user_id?: string | undefined;
|
|
1870
|
+
account_id?: string | undefined;
|
|
1871
|
+
device_id?: string | undefined;
|
|
1872
|
+
session_id?: string | undefined;
|
|
1873
|
+
model_id?: string | undefined;
|
|
1874
|
+
service_id?: string | undefined;
|
|
1875
|
+
}, {
|
|
1876
|
+
user_id?: string | undefined;
|
|
1877
|
+
account_id?: string | undefined;
|
|
1878
|
+
device_id?: string | undefined;
|
|
1879
|
+
session_id?: string | undefined;
|
|
1880
|
+
model_id?: string | undefined;
|
|
1881
|
+
service_id?: string | undefined;
|
|
1882
|
+
}>;
|
|
1883
|
+
timestamp: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1884
|
+
confidence_hint: z.ZodOptional<z.ZodNumber>;
|
|
1885
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1886
|
+
mode: z.ZodOptional<z.ZodEnum<["DETERMINISTIC", "EXTERNAL_RNG", "ATTESTED"]>>;
|
|
1887
|
+
source_id: z.ZodOptional<z.ZodString>;
|
|
1888
|
+
epoch_counter: z.ZodOptional<z.ZodNumber>;
|
|
1889
|
+
health_summary: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
1890
|
+
}, "strip", z.ZodTypeAny, {
|
|
1891
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1892
|
+
source_id?: string | undefined;
|
|
1893
|
+
epoch_counter?: number | undefined;
|
|
1894
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1895
|
+
}, {
|
|
1896
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1897
|
+
source_id?: string | undefined;
|
|
1898
|
+
epoch_counter?: number | undefined;
|
|
1899
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1900
|
+
}>>;
|
|
1901
|
+
integrity: z.ZodOptional<z.ZodObject<{
|
|
1902
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1903
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
1904
|
+
}, "strip", z.ZodTypeAny, {
|
|
1905
|
+
hash?: string | undefined;
|
|
1906
|
+
signature?: string | undefined;
|
|
1907
|
+
}, {
|
|
1908
|
+
hash?: string | undefined;
|
|
1909
|
+
signature?: string | undefined;
|
|
1910
|
+
}>>;
|
|
1911
|
+
} & {
|
|
1912
|
+
signal_payload: z.ZodObject<{
|
|
1913
|
+
metric_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1914
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1915
|
+
baseline: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1916
|
+
window_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1917
|
+
error_rate: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1918
|
+
baseline_error_rate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1919
|
+
unusual_auth_rate: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1920
|
+
firmware_hash_changed: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1921
|
+
expected_hash_match: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1922
|
+
sensor_deviation_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1923
|
+
}, "strip", z.ZodTypeAny, {
|
|
1924
|
+
error_rate: number;
|
|
1925
|
+
unusual_auth_rate: number;
|
|
1926
|
+
firmware_hash_changed: boolean;
|
|
1927
|
+
value?: number | null | undefined;
|
|
1928
|
+
metric_name?: string | null | undefined;
|
|
1929
|
+
baseline?: number | null | undefined;
|
|
1930
|
+
window_seconds?: number | null | undefined;
|
|
1931
|
+
baseline_error_rate?: number | null | undefined;
|
|
1932
|
+
expected_hash_match?: boolean | null | undefined;
|
|
1933
|
+
sensor_deviation_score?: number | null | undefined;
|
|
1934
|
+
}, {
|
|
1935
|
+
value?: number | null | undefined;
|
|
1936
|
+
metric_name?: string | null | undefined;
|
|
1937
|
+
baseline?: number | null | undefined;
|
|
1938
|
+
window_seconds?: number | null | undefined;
|
|
1939
|
+
error_rate?: number | undefined;
|
|
1940
|
+
baseline_error_rate?: number | null | undefined;
|
|
1941
|
+
unusual_auth_rate?: number | undefined;
|
|
1942
|
+
firmware_hash_changed?: boolean | undefined;
|
|
1943
|
+
expected_hash_match?: boolean | null | undefined;
|
|
1944
|
+
sensor_deviation_score?: number | null | undefined;
|
|
1945
|
+
}>;
|
|
1946
|
+
}, "strip", z.ZodTypeAny, {
|
|
1947
|
+
tenant_id: string;
|
|
1948
|
+
signal_version: string;
|
|
1949
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1950
|
+
signal_payload: {
|
|
1951
|
+
error_rate: number;
|
|
1952
|
+
unusual_auth_rate: number;
|
|
1953
|
+
firmware_hash_changed: boolean;
|
|
1954
|
+
value?: number | null | undefined;
|
|
1955
|
+
metric_name?: string | null | undefined;
|
|
1956
|
+
baseline?: number | null | undefined;
|
|
1957
|
+
window_seconds?: number | null | undefined;
|
|
1958
|
+
baseline_error_rate?: number | null | undefined;
|
|
1959
|
+
expected_hash_match?: boolean | null | undefined;
|
|
1960
|
+
sensor_deviation_score?: number | null | undefined;
|
|
1961
|
+
};
|
|
1962
|
+
principal: {
|
|
1963
|
+
user_id?: string | undefined;
|
|
1964
|
+
account_id?: string | undefined;
|
|
1965
|
+
device_id?: string | undefined;
|
|
1966
|
+
session_id?: string | undefined;
|
|
1967
|
+
model_id?: string | undefined;
|
|
1968
|
+
service_id?: string | undefined;
|
|
1969
|
+
};
|
|
1970
|
+
integrity?: {
|
|
1971
|
+
hash?: string | undefined;
|
|
1972
|
+
signature?: string | undefined;
|
|
1973
|
+
} | undefined;
|
|
1974
|
+
timestamp?: string | undefined;
|
|
1975
|
+
confidence_hint?: number | undefined;
|
|
1976
|
+
provenance?: {
|
|
1977
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
1978
|
+
source_id?: string | undefined;
|
|
1979
|
+
epoch_counter?: number | undefined;
|
|
1980
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
1981
|
+
} | undefined;
|
|
1982
|
+
}, {
|
|
1983
|
+
tenant_id: string;
|
|
1984
|
+
signal_version: string;
|
|
1985
|
+
signal_type: "TRANSACTION" | "AUTH" | "BEHAVIOR" | "SYSTEM_TELEMETRY" | "MODEL_OUTPUT" | "ANOMALY_FLAG" | "NETWORK_EVENT";
|
|
1986
|
+
signal_payload: {
|
|
1987
|
+
value?: number | null | undefined;
|
|
1988
|
+
metric_name?: string | null | undefined;
|
|
1989
|
+
baseline?: number | null | undefined;
|
|
1990
|
+
window_seconds?: number | null | undefined;
|
|
1991
|
+
error_rate?: number | undefined;
|
|
1992
|
+
baseline_error_rate?: number | null | undefined;
|
|
1993
|
+
unusual_auth_rate?: number | undefined;
|
|
1994
|
+
firmware_hash_changed?: boolean | undefined;
|
|
1995
|
+
expected_hash_match?: boolean | null | undefined;
|
|
1996
|
+
sensor_deviation_score?: number | null | undefined;
|
|
1997
|
+
};
|
|
1998
|
+
principal: {
|
|
1999
|
+
user_id?: string | undefined;
|
|
2000
|
+
account_id?: string | undefined;
|
|
2001
|
+
device_id?: string | undefined;
|
|
2002
|
+
session_id?: string | undefined;
|
|
2003
|
+
model_id?: string | undefined;
|
|
2004
|
+
service_id?: string | undefined;
|
|
2005
|
+
};
|
|
2006
|
+
integrity?: {
|
|
2007
|
+
hash?: string | undefined;
|
|
2008
|
+
signature?: string | undefined;
|
|
2009
|
+
} | undefined;
|
|
2010
|
+
timestamp?: string | undefined;
|
|
2011
|
+
confidence_hint?: number | undefined;
|
|
2012
|
+
provenance?: {
|
|
2013
|
+
mode?: "DETERMINISTIC" | "EXTERNAL_RNG" | "ATTESTED" | undefined;
|
|
2014
|
+
source_id?: string | undefined;
|
|
2015
|
+
epoch_counter?: number | undefined;
|
|
2016
|
+
health_summary?: string | Record<string, unknown> | undefined;
|
|
2017
|
+
} | undefined;
|
|
2018
|
+
}>;
|
|
2019
|
+
/** `signal_type: 'TRANSACTION'` with typed `signal_payload`. */
|
|
2020
|
+
type TransactionSignalEvent = z.infer<typeof TransactionSignalSchema>;
|
|
2021
|
+
/** `signal_type: 'ANOMALY_FLAG'` — `severity` required in `[0, 1]`. */
|
|
2022
|
+
type AnomalyFlagSignalEvent = z.infer<typeof AnomalyFlagSignalSchema>;
|
|
2023
|
+
/** `signal_type: 'AUTH'` with authentication outcome metadata. */
|
|
2024
|
+
type AuthSignalEvent = z.infer<typeof AuthSignalSchema>;
|
|
2025
|
+
/** `signal_type: 'BEHAVIOR'` — `deviation_score` in `[0, 1]`. */
|
|
2026
|
+
type BehaviorSignalEvent = z.infer<typeof BehaviorSignalSchema>;
|
|
2027
|
+
/** `signal_type: 'NETWORK_EVENT'` with ASN/IP/reputation fields. */
|
|
2028
|
+
type NetworkSignalEvent = z.infer<typeof NetworkSignalSchema>;
|
|
2029
|
+
/** `signal_type: 'MODEL_OUTPUT'` with citation / tool-consistency metrics in `[0, 1]` where applicable. */
|
|
2030
|
+
type ModelOutputSignalEvent = z.infer<typeof ModelOutputSignalSchema>;
|
|
2031
|
+
/** `signal_type: 'SYSTEM_TELEMETRY'` with metric samples and optional error-rate fractions in `[0, 1]`. */
|
|
2032
|
+
type SystemTelemetrySignalEvent = z.infer<typeof SystemTelemetrySignalSchema>;
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* Factory functions that build ingestion {@link RawEventRequest} values for signal schema **v1**.
|
|
2036
|
+
*
|
|
2037
|
+
* Each builder validates the typed envelope and `signal_payload` with Zod, writes `payload.signal_version` to `'v1'` and the correct `signal_type`. The ingestion API assigns the persisted event id (UUID v7); omitting `timestamp` on the envelope yields an RFC 3339 default from {@link BaseEventSchema}.
|
|
2038
|
+
*
|
|
2039
|
+
*/
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Transforms an incoming AuthSignalEvent into a validated RawEventRequest labeled as 'AUTH'.
|
|
2043
|
+
*
|
|
2044
|
+
* @remarks
|
|
2045
|
+
* This function validates the `event.signal_payload` against the {@link AuthSignalPayloadSchema}.
|
|
2046
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2047
|
+
*
|
|
2048
|
+
* @param event - The raw signal data received from the authentication provider.
|
|
2049
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2050
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2051
|
+
*
|
|
2052
|
+
* @example
|
|
2053
|
+
* const raw = createAuthEvent(incomingData);
|
|
2054
|
+
*/
|
|
2055
|
+
declare const createAuthEvent: (event: AuthSignalEvent) => RawEventRequest;
|
|
2056
|
+
/**
|
|
2057
|
+
* Transforms an incoming TransactionSignalEvent into a validated RawEventRequest labeled as 'TRANSACTION'.
|
|
2058
|
+
*
|
|
2059
|
+
* @remarks
|
|
2060
|
+
* This function validates the `event.signal_payload` against the {@link TransactionSignalPayloadSchema}.
|
|
2061
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2062
|
+
*
|
|
2063
|
+
* @param event - The raw signal data received from the transaction provider.
|
|
2064
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2065
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2066
|
+
*
|
|
2067
|
+
* @example
|
|
2068
|
+
* const raw = createTransactionEvent(incomingData);
|
|
2069
|
+
*/
|
|
2070
|
+
declare function createTransactionEvent(event: TransactionSignalEvent): RawEventRequest;
|
|
2071
|
+
/**
|
|
2072
|
+
* Transforms an incoming AnomalyFlagSignalEvent into a validated RawEventRequest labeled as 'ANOMALY_FLAG'.
|
|
2073
|
+
*
|
|
2074
|
+
* @remarks
|
|
2075
|
+
* This function validates the `event.signal_payload` against the {@link AnomalyFlagSignalPayloadSchema}.
|
|
2076
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2077
|
+
*
|
|
2078
|
+
* @param event - The raw signal data received from the anomaly flag provider.
|
|
2079
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2080
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2081
|
+
*
|
|
2082
|
+
* @example
|
|
2083
|
+
* const raw = createAnomalyFlagEvent(incomingData);
|
|
2084
|
+
*/
|
|
2085
|
+
declare const createAnomalyFlagEvent: (event: AnomalyFlagSignalEvent) => RawEventRequest;
|
|
2086
|
+
/**
|
|
2087
|
+
* Transforms an incoming BehaviorSignalEvent into a validated RawEventRequest labeled as 'BEHAVIOR'.
|
|
2088
|
+
*
|
|
2089
|
+
* @remarks
|
|
2090
|
+
* This function validates the `event.signal_payload` against the {@link BehaviorSignalPayloadSchema}.
|
|
2091
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2092
|
+
*
|
|
2093
|
+
* @param event - The raw signal data received from the behavior provider.
|
|
2094
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2095
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2096
|
+
*
|
|
2097
|
+
* @example
|
|
2098
|
+
* const raw = createBehaviorEvent(incomingData);
|
|
2099
|
+
*/
|
|
2100
|
+
declare const createBehaviorEvent: (event: BehaviorSignalEvent) => RawEventRequest;
|
|
2101
|
+
/**
|
|
2102
|
+
* Transforms an incoming NetworkSignalEvent into a validated RawEventRequest labeled as 'NETWORK_EVENT'.
|
|
2103
|
+
*
|
|
2104
|
+
* @remarks
|
|
2105
|
+
* This function validates the `event.signal_payload` against the {@link NetworkSignalPayloadSchema}.
|
|
2106
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2107
|
+
*
|
|
2108
|
+
* @param event - The raw signal data received from the network provider.
|
|
2109
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2110
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2111
|
+
*
|
|
2112
|
+
* @example
|
|
2113
|
+
* const raw = createNetworkEvent(incomingData);
|
|
2114
|
+
*/
|
|
2115
|
+
declare const createNetworkEvent: (event: NetworkSignalEvent) => RawEventRequest;
|
|
2116
|
+
/**
|
|
2117
|
+
* Transforms an incoming ModelOutputSignalEvent into a validated RawEventRequest labeled as 'MODEL_OUTPUT'.
|
|
2118
|
+
*
|
|
2119
|
+
* @remarks
|
|
2120
|
+
* This function validates the `event.signal_payload` against the {@link ModelOutputSignalPayloadSchema}.
|
|
2121
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2122
|
+
*
|
|
2123
|
+
* @param event - The raw signal data received from the model output provider.
|
|
2124
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2125
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2126
|
+
*
|
|
2127
|
+
* @example
|
|
2128
|
+
* const raw = createModelOutputEvent(incomingData);
|
|
2129
|
+
*/
|
|
2130
|
+
declare const createModelOutputEvent: (event: ModelOutputSignalEvent) => RawEventRequest;
|
|
2131
|
+
/**
|
|
2132
|
+
* Transforms an incoming SystemTelemetrySignalEvent into a validated RawEventRequest labeled as 'SYSTEM_TELEMETRY'.
|
|
2133
|
+
*
|
|
2134
|
+
* @remarks
|
|
2135
|
+
* This function validates the `event.signal_payload` against the {@link SystemTelemetrySignalPayloadSchema}.
|
|
2136
|
+
* If the payload is malformed, a ZodError will be thrown.
|
|
2137
|
+
*
|
|
2138
|
+
* @param event - The raw signal data received from the system telemetry provider.
|
|
2139
|
+
* @returns A formatted RawEventRequest ready for ingestion (enqueue / batch POST).
|
|
2140
|
+
* @throws {ZodError} If the signal_payload does not match the expected schema.
|
|
2141
|
+
*
|
|
2142
|
+
* @example
|
|
2143
|
+
* const raw = createSystemTelemetryEvent(incomingData);
|
|
2144
|
+
*/
|
|
2145
|
+
declare const createSystemTelemetryEvent: (event: SystemTelemetrySignalEvent) => RawEventRequest;
|
|
2146
|
+
|
|
2147
|
+
export { type APIErrorDetail, API_REGISTRY, type AdvisoryListResponse, type AdvisoryResponse, type AdvisorySeverity, type AdvisoryType, type AnomalyFlagSignalEvent, type AuthSignalEvent, type BaseEvent, type BatchEventResponse, type BehaviorSignalEvent, type EntityType, type EntityTypeLowerCase, type EventAcknowledgement, type EventError, type EventResourceOptions, type ExplainResponse, type ExplanationTrace, type ListAdvisoriesOptions, type ModelOutputSignalEvent, type NetworkSignalEvent, QatiAPIError, QatiAuthError, QatiConfigError, type QatiConfigInput, type QatiConfigOutput, QatiNotFoundError, QatiRateLimitError, QatiSDKError, QatiServerError, type RawEventRequest, RawEventRequestSchema, type RecommendedAction, Session, type SystemTelemetrySignalEvent, type TopContributor, type TransactionSignalEvent, type TrustState, type TrustStateOptions, type VerifyCredentialsResponse, baseUrlFor, createAnomalyFlagEvent, createAuthEvent, createBehaviorEvent, createModelOutputEvent, createNetworkEvent, createSystemTelemetryEvent, createTransactionEvent, parseQatiConfig, resolveQatiConfig };
|