@nextera.one/axis-server-sdk 2.1.4 → 2.1.6
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/dist/index.d.mts +910 -906
- package/dist/index.d.ts +910 -906
- package/dist/index.js +214 -171
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +200 -157
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
1
2
|
import { A as AxisFrame$2 } from './index-DXHfWxLG.mjs';
|
|
2
3
|
export { a as AxisBinaryFrame, b as AxisError, c as AxisFrameZ, d as AxisMediaTypes, e as computeReceiptHash, f as computeSignaturePayload, i as core, g as decodeFrame, h as encodeFrame, j as generateEd25519KeyPair, k as getSignTarget, s as sha256, l as signFrame, v as verifyFrameSignature } from './index-DXHfWxLG.mjs';
|
|
3
4
|
import { ModuleRef, DiscoveryService, Reflector, MetadataScanner } from '@nestjs/core';
|
|
4
|
-
import * as z from 'zod';
|
|
5
5
|
import { PROOF_LOOM, TLV_LOOM_PRESENCE_ID, TLV_LOOM_THREAD_HASH, TLV_LOOM_WRIT } from '@nextera.one/axis-protocol';
|
|
6
6
|
export { AXIS_MAGIC, AXIS_VERSION, TLV as AxisTlvType, BodyProfile, ERR_BAD_SIGNATURE, ERR_CONTRACT_VIOLATION, ERR_INVALID_PACKET, ERR_REPLAY_DETECTED, FLAG_BODY_TLV, FLAG_CHAIN_REQ, FLAG_HAS_WITNESS, MAX_BODY_LEN, MAX_FRAME_LEN, MAX_HDR_LEN, MAX_SIG_LEN, NCERT_ALG, NCERT_EXP, NCERT_ISSUER_KID, NCERT_KID, NCERT_NBF, NCERT_NODE_ID, NCERT_PAYLOAD, NCERT_PUB, NCERT_SCOPE, NCERT_SIG, PROOF_CAPSULE, PROOF_JWT, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofType, TLV, TLV_ACTOR_ID, TLV_AUD, TLV_BODY_ARR, TLV_BODY_OBJ, TLV_CAPSULE, TLV_EFFECT, TLV_ERROR_CODE, TLV_ERROR_MSG, TLV_INDEX, TLV_INTENT, TLV_KID, TLV_LOOM_PRESENCE_ID, TLV_LOOM_THREAD_HASH, TLV_LOOM_WRIT, TLV_NODE, TLV_NODE_CERT_HASH, TLV_NODE_KID, TLV_NONCE, TLV_OFFSET, TLV_OK, TLV_PID, TLV_LOOM_PRESENCE_ID as TLV_PRESENCE_ID, TLV_PREV_HASH, TLV_PROOF_REF, TLV_PROOF_TYPE, TLV_REALM, TLV_RECEIPT_HASH, TLV_RID, TLV_SHA256_CHUNK, TLV_LOOM_THREAD_HASH as TLV_THREAD_HASH, TLV_TRACE_ID, TLV_TS, TLV_UPLOAD_ID, TLV_LOOM_WRIT as TLV_WRIT, decodeArray, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeTLVs, encodeVarint, varintLength } from '@nextera.one/axis-protocol';
|
|
7
7
|
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
@@ -139,800 +139,73 @@ declare function CapsulePolicy(options?: CapsulePolicyOptions): ClassDecorator &
|
|
|
139
139
|
declare function normalizeCapsulePolicyOptions(options?: CapsulePolicyOptions): CapsulePolicyOptions;
|
|
140
140
|
declare function mergeCapsulePolicyOptions(base?: CapsulePolicyOptions, override?: CapsulePolicyOptions): CapsulePolicyOptions | undefined;
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
name: string;
|
|
150
|
-
tag: number;
|
|
151
|
-
kind: 'utf8' | 'u64' | 'bytes' | 'bytes16' | 'bool' | 'obj' | 'arr';
|
|
152
|
-
required?: boolean;
|
|
153
|
-
maxLen?: number;
|
|
154
|
-
max?: string;
|
|
155
|
-
scope?: 'header' | 'body';
|
|
156
|
-
}
|
|
157
|
-
interface IntentRoute {
|
|
158
|
-
action: string;
|
|
159
|
-
methodName: string | symbol;
|
|
160
|
-
absolute?: boolean;
|
|
161
|
-
frame?: boolean;
|
|
162
|
-
kind?: IntentKind;
|
|
163
|
-
chain?: boolean | ChainOptions;
|
|
164
|
-
bodyProfile?: 'TLV_MAP' | 'RAW' | 'TLV_OBJ' | 'TLV_ARR';
|
|
165
|
-
tlv?: IntentTlvField[];
|
|
166
|
-
dto?: Function;
|
|
167
|
-
}
|
|
168
|
-
interface IntentOptions {
|
|
169
|
-
kind?: IntentKind;
|
|
170
|
-
absolute?: boolean;
|
|
171
|
-
frame?: boolean;
|
|
172
|
-
chain?: boolean | ChainOptions;
|
|
173
|
-
bodyProfile?: 'TLV_MAP' | 'RAW' | 'TLV_OBJ' | 'TLV_ARR';
|
|
174
|
-
tlv?: IntentTlvField[];
|
|
175
|
-
dto?: Function;
|
|
176
|
-
}
|
|
177
|
-
declare function Intent(action: string, options?: IntentOptions): MethodDecorator;
|
|
178
|
-
|
|
179
|
-
declare const INTENT_BODY_KEY = "axis:intent:body";
|
|
180
|
-
declare function IntentBody(decoder: (buf: Buffer) => any): MethodDecorator;
|
|
181
|
-
|
|
182
|
-
declare const INTENT_SENSORS_KEY = "axis:intent:sensors";
|
|
183
|
-
declare function IntentSensors(sensors: Function[]): MethodDecorator;
|
|
184
|
-
|
|
185
|
-
declare const OBSERVER_METADATA_KEY = "axis:observer";
|
|
186
|
-
declare const OBSERVER_BINDINGS_KEY = "axis:observer:bindings";
|
|
187
|
-
type AxisObserverRef = string | Function;
|
|
188
|
-
interface AxisObserverDefinition {
|
|
189
|
-
name?: string;
|
|
190
|
-
tags?: string[];
|
|
191
|
-
events?: AxisObserverEvent[];
|
|
192
|
-
intents?: string[];
|
|
193
|
-
handlers?: string[];
|
|
194
|
-
}
|
|
195
|
-
interface AxisObserverBinding {
|
|
196
|
-
refs: AxisObserverRef[];
|
|
197
|
-
tags?: string[];
|
|
198
|
-
events?: AxisObserverEvent[];
|
|
199
|
-
}
|
|
200
|
-
interface AxisObserverBindingOptions {
|
|
201
|
-
use: AxisObserverRef | AxisObserverRef[];
|
|
202
|
-
tags?: string[];
|
|
203
|
-
events?: AxisObserverEvent[];
|
|
204
|
-
}
|
|
205
|
-
declare function Observer(input?: AxisObserverDefinition | AxisObserverBindingOptions | AxisObserverRef | AxisObserverRef[]): ClassDecorator & MethodDecorator;
|
|
206
|
-
|
|
207
|
-
declare const HANDLER_SENSORS_KEY = "axis:handler:sensors";
|
|
208
|
-
declare function HandlerSensors(sensors: Function[]): ClassDecorator;
|
|
209
|
-
|
|
210
|
-
declare const SENSOR_METADATA_KEY = "axis:sensor";
|
|
211
|
-
type SensorPhase = 'PRE_DECODE' | 'POST_DECODE';
|
|
212
|
-
interface SensorOptions {
|
|
213
|
-
phase?: SensorPhase;
|
|
214
|
-
}
|
|
215
|
-
declare function Sensor(options?: SensorOptions): ClassDecorator;
|
|
216
|
-
|
|
217
|
-
declare const TLV_FIELDS_KEY = "axis:tlv:fields";
|
|
218
|
-
declare const TLV_VALIDATORS_KEY = "axis:tlv:validators";
|
|
219
|
-
type TlvFieldKind = 'utf8' | 'u64' | 'bytes' | 'bytes16' | 'bool' | 'obj' | 'arr';
|
|
220
|
-
interface TlvFieldOptions {
|
|
221
|
-
kind: TlvFieldKind;
|
|
222
|
-
required?: boolean;
|
|
223
|
-
maxLen?: number;
|
|
224
|
-
max?: string;
|
|
225
|
-
scope?: 'header' | 'body';
|
|
226
|
-
}
|
|
227
|
-
interface TlvFieldMeta {
|
|
228
|
-
property: string;
|
|
229
|
-
tag: number;
|
|
230
|
-
options: TlvFieldOptions;
|
|
231
|
-
}
|
|
232
|
-
type TlvValidatorFn = (value: Uint8Array, property: string) => string | null | undefined;
|
|
233
|
-
interface TlvValidatorMeta {
|
|
234
|
-
property: string;
|
|
235
|
-
tag: number;
|
|
236
|
-
validators: TlvValidatorFn[];
|
|
237
|
-
}
|
|
238
|
-
declare function TlvField(tag: number, options: TlvFieldOptions): PropertyDecorator;
|
|
239
|
-
declare function TlvValidate(validator: TlvValidatorFn): PropertyDecorator;
|
|
240
|
-
declare function TlvUtf8Pattern(pattern: RegExp, message?: string): PropertyDecorator;
|
|
241
|
-
declare function TlvMinLen(min: number, message?: string): PropertyDecorator;
|
|
242
|
-
declare function TlvEnum(allowed: string[], message?: string): PropertyDecorator;
|
|
243
|
-
declare function TlvRange(min: bigint, max: bigint, message?: string): PropertyDecorator;
|
|
244
|
-
|
|
245
|
-
interface DtoSchema {
|
|
246
|
-
fields: IntentTlvField[];
|
|
247
|
-
validators: Map<number, TlvValidatorFn[]>;
|
|
248
|
-
}
|
|
249
|
-
declare function extractDtoSchema(dto: Function): DtoSchema;
|
|
250
|
-
declare function buildDtoDecoder(dto: Function): (bodyBytes: Buffer) => Record<string, any>;
|
|
251
|
-
|
|
252
|
-
declare abstract class AxisTlvDto {
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
declare class AxisIdDto extends AxisTlvDto {
|
|
256
|
-
id: string;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
declare function AxisPartialType<T extends new (...args: any[]) => AxisTlvDto>(BaseDto: T): new (...args: any[]) => Partial<InstanceType<T>> & AxisTlvDto;
|
|
260
|
-
|
|
261
|
-
declare const RESPONSE_TAG_ID = 1;
|
|
262
|
-
declare const RESPONSE_TAG_CREATED_AT = 2;
|
|
263
|
-
declare const RESPONSE_TAG_UPDATED_AT = 3;
|
|
264
|
-
declare const RESPONSE_TAG_CREATED_BY = 4;
|
|
265
|
-
declare const RESPONSE_TAG_UPDATED_BY = 5;
|
|
266
|
-
declare abstract class AxisResponseDto extends AxisTlvDto {
|
|
267
|
-
id?: string;
|
|
268
|
-
created_at?: bigint;
|
|
269
|
-
updated_at?: bigint;
|
|
270
|
-
created_by?: string;
|
|
271
|
-
updated_by?: string;
|
|
142
|
+
interface ExecutionContract {
|
|
143
|
+
maxDbWrites: number;
|
|
144
|
+
maxDbReads?: number;
|
|
145
|
+
maxExternalCalls: number;
|
|
146
|
+
maxTimeMs: number;
|
|
147
|
+
allowedEffects: string[];
|
|
148
|
+
maxMemoryMb?: number;
|
|
272
149
|
}
|
|
150
|
+
declare const DEFAULT_CONTRACTS: Record<string, ExecutionContract>;
|
|
151
|
+
declare const FALLBACK_CONTRACT: ExecutionContract;
|
|
273
152
|
|
|
274
|
-
declare const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
declare const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
aad_descriptor?: string;
|
|
331
|
-
}
|
|
332
|
-
interface CceEncryptedKey {
|
|
333
|
-
alg: CceKemAlgorithm;
|
|
334
|
-
axis_kid: string;
|
|
335
|
-
ciphertext: string;
|
|
336
|
-
ephemeral_pk?: string;
|
|
337
|
-
}
|
|
338
|
-
interface CceEncryptedPayload {
|
|
339
|
-
alg: CceAlgorithm;
|
|
340
|
-
iv: string;
|
|
341
|
-
ciphertext: string;
|
|
342
|
-
tag: string;
|
|
343
|
-
}
|
|
344
|
-
interface CceAlgorithmDescriptor {
|
|
345
|
-
kem: CceKemAlgorithm;
|
|
346
|
-
enc: CceAlgorithm;
|
|
347
|
-
kdf: CceKdfAlgorithm;
|
|
348
|
-
sig: "EdDSA" | "ES256";
|
|
349
|
-
}
|
|
350
|
-
interface CceResponseEnvelope {
|
|
351
|
-
ver: typeof CCE_PROTOCOL_VERSION;
|
|
352
|
-
response_id: string;
|
|
353
|
-
request_id: string;
|
|
354
|
-
correlation_id: string;
|
|
355
|
-
capsule_id: string;
|
|
356
|
-
encrypted_key: CceEncryptedKey;
|
|
357
|
-
encrypted_payload: CceEncryptedPayload;
|
|
358
|
-
response_nonce: string;
|
|
359
|
-
axis_sig: CceSignature;
|
|
360
|
-
witness_ref?: string;
|
|
361
|
-
algorithms: CceAlgorithmDescriptor;
|
|
362
|
-
status: CceResponseStatus;
|
|
363
|
-
}
|
|
364
|
-
type CceResponseStatus = "SUCCESS" | "DENIED" | "PARTIAL" | "FAILED" | "ERROR";
|
|
365
|
-
interface CceExecutionContext {
|
|
366
|
-
execution_key_hash: string;
|
|
367
|
-
request_id: string;
|
|
368
|
-
capsule_id: string;
|
|
369
|
-
sub: string;
|
|
370
|
-
kid: string;
|
|
371
|
-
intent: string;
|
|
372
|
-
aud: string;
|
|
373
|
-
tps_from: number;
|
|
374
|
-
tps_to: number;
|
|
375
|
-
policy_hash?: string;
|
|
376
|
-
derived_at: number;
|
|
377
|
-
valid: boolean;
|
|
378
|
-
}
|
|
379
|
-
interface CceWitnessRecord {
|
|
380
|
-
witness_id: string;
|
|
381
|
-
request_id: string;
|
|
382
|
-
capsule_id: string;
|
|
383
|
-
sub: string;
|
|
384
|
-
intent: string;
|
|
385
|
-
aud: string;
|
|
386
|
-
tps_from: number;
|
|
387
|
-
tps_to: number;
|
|
388
|
-
timestamp: number;
|
|
389
|
-
verification: {
|
|
390
|
-
client_sig: boolean;
|
|
391
|
-
capsule_sig: boolean;
|
|
392
|
-
tps_valid: boolean;
|
|
393
|
-
audience_match: boolean;
|
|
394
|
-
intent_match: boolean;
|
|
395
|
-
replay_clean: boolean;
|
|
396
|
-
nonce_unique: boolean;
|
|
397
|
-
decryption_ok: boolean;
|
|
398
|
-
};
|
|
399
|
-
execution: {
|
|
400
|
-
status: CceResponseStatus;
|
|
401
|
-
handler_duration_ms: number;
|
|
402
|
-
effect?: string;
|
|
403
|
-
};
|
|
404
|
-
response_encrypted: boolean;
|
|
405
|
-
execution_context_hash: string;
|
|
406
|
-
request_payload_hash?: string;
|
|
407
|
-
response_payload_hash?: string;
|
|
408
|
-
}
|
|
409
|
-
declare const CCE_ERROR: {
|
|
410
|
-
readonly INVALID_ENVELOPE: "CCE_INVALID_ENVELOPE";
|
|
411
|
-
readonly UNSUPPORTED_VERSION: "CCE_UNSUPPORTED_VERSION";
|
|
412
|
-
readonly MISSING_CAPSULE: "CCE_MISSING_CAPSULE";
|
|
413
|
-
readonly MISSING_ENCRYPTED_KEY: "CCE_MISSING_ENCRYPTED_KEY";
|
|
414
|
-
readonly CLIENT_SIG_INVALID: "CCE_CLIENT_SIG_INVALID";
|
|
415
|
-
readonly CLIENT_KEY_NOT_FOUND: "CCE_CLIENT_KEY_NOT_FOUND";
|
|
416
|
-
readonly CAPSULE_SIG_INVALID: "CCE_CAPSULE_SIG_INVALID";
|
|
417
|
-
readonly CAPSULE_EXPIRED: "CCE_CAPSULE_EXPIRED";
|
|
418
|
-
readonly CAPSULE_NOT_YET_VALID: "CCE_CAPSULE_NOT_YET_VALID";
|
|
419
|
-
readonly CAPSULE_REVOKED: "CCE_CAPSULE_REVOKED";
|
|
420
|
-
readonly CAPSULE_CONSUMED: "CCE_CAPSULE_CONSUMED";
|
|
421
|
-
readonly AUDIENCE_MISMATCH: "CCE_AUDIENCE_MISMATCH";
|
|
422
|
-
readonly INTENT_MISMATCH: "CCE_INTENT_MISMATCH";
|
|
423
|
-
readonly TPS_WINDOW_EXPIRED: "CCE_TPS_WINDOW_EXPIRED";
|
|
424
|
-
readonly TPS_WINDOW_FUTURE: "CCE_TPS_WINDOW_FUTURE";
|
|
425
|
-
readonly REPLAY_DETECTED: "CCE_REPLAY_DETECTED";
|
|
426
|
-
readonly NONCE_REUSED: "CCE_NONCE_REUSED";
|
|
427
|
-
readonly DECRYPTION_FAILED: "CCE_DECRYPTION_FAILED";
|
|
428
|
-
readonly KEY_UNWRAP_FAILED: "CCE_KEY_UNWRAP_FAILED";
|
|
429
|
-
readonly AEAD_TAG_MISMATCH: "CCE_AEAD_TAG_MISMATCH";
|
|
430
|
-
readonly PAYLOAD_TOO_LARGE: "CCE_PAYLOAD_TOO_LARGE";
|
|
431
|
-
readonly PAYLOAD_SCHEMA_INVALID: "CCE_PAYLOAD_SCHEMA_INVALID";
|
|
432
|
-
readonly INTENT_SCHEMA_MISMATCH: "CCE_INTENT_SCHEMA_MISMATCH";
|
|
433
|
-
readonly POLICY_DENIED: "CCE_POLICY_DENIED";
|
|
434
|
-
readonly CONSTRAINT_VIOLATED: "CCE_CONSTRAINT_VIOLATED";
|
|
435
|
-
readonly HANDLER_NOT_FOUND: "CCE_HANDLER_NOT_FOUND";
|
|
436
|
-
readonly HANDLER_EXECUTION_FAILED: "CCE_HANDLER_EXECUTION_FAILED";
|
|
437
|
-
readonly HANDLER_TIMEOUT: "CCE_HANDLER_TIMEOUT";
|
|
438
|
-
readonly RESPONSE_ENCRYPTION_FAILED: "CCE_RESPONSE_ENCRYPTION_FAILED";
|
|
439
|
-
};
|
|
440
|
-
type CceErrorCode = (typeof CCE_ERROR)[keyof typeof CCE_ERROR];
|
|
441
|
-
declare class CceError extends Error {
|
|
442
|
-
readonly code: CceErrorCode;
|
|
443
|
-
readonly metadata?: Record<string, unknown> | undefined;
|
|
444
|
-
constructor(code: CceErrorCode, message: string, metadata?: Record<string, unknown> | undefined);
|
|
445
|
-
get clientSafe(): boolean;
|
|
446
|
-
toClientError(): {
|
|
447
|
-
code: CceErrorCode;
|
|
448
|
-
message: string;
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
interface CceClientKeyEncryptor {
|
|
453
|
-
wrapKey(aesKey: Uint8Array, clientKid: string, clientPublicKeyHex: string): Promise<CceEncryptedKey>;
|
|
454
|
-
}
|
|
455
|
-
interface CceAxisSigner {
|
|
456
|
-
sign(payload: Uint8Array): Promise<CceSignature>;
|
|
457
|
-
}
|
|
458
|
-
interface CceResponseOptions {
|
|
459
|
-
request: CceRequestEnvelope;
|
|
460
|
-
capsule: CceCapsuleClaims;
|
|
461
|
-
status: CceResponseStatus;
|
|
462
|
-
body: Uint8Array;
|
|
463
|
-
clientPublicKeyHex: string;
|
|
464
|
-
witnessRef?: string;
|
|
465
|
-
}
|
|
466
|
-
declare function buildCceResponse(options: CceResponseOptions, clientKeyEncryptor: CceClientKeyEncryptor, axisSigner: CceAxisSigner): Promise<{
|
|
467
|
-
envelope: CceResponseEnvelope;
|
|
468
|
-
responsePayloadHash: string;
|
|
469
|
-
}>;
|
|
470
|
-
declare function buildCceErrorResponse(requestId: string, correlationId: string, status: CceResponseStatus, errorCode: string, message: string): {
|
|
471
|
-
ver: string;
|
|
472
|
-
request_id: string;
|
|
473
|
-
correlation_id: string;
|
|
474
|
-
status: CceResponseStatus;
|
|
475
|
-
error: {
|
|
476
|
-
code: string;
|
|
477
|
-
message: string;
|
|
478
|
-
};
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
interface CceWitnessStore {
|
|
482
|
-
record(witness: CceWitnessRecord): Promise<void>;
|
|
483
|
-
}
|
|
484
|
-
declare class InMemoryCceWitnessStore implements CceWitnessStore {
|
|
485
|
-
readonly records: CceWitnessRecord[];
|
|
486
|
-
record(witness: CceWitnessRecord): Promise<void>;
|
|
487
|
-
getByRequestId(requestId: string): CceWitnessRecord | undefined;
|
|
488
|
-
getByCapsuleId(capsuleId: string): CceWitnessRecord[];
|
|
489
|
-
}
|
|
490
|
-
interface CceVerificationState {
|
|
491
|
-
clientSigVerified: boolean;
|
|
492
|
-
capsuleSigVerified: boolean;
|
|
493
|
-
tpsValid: boolean;
|
|
494
|
-
audienceMatch: boolean;
|
|
495
|
-
intentMatch: boolean;
|
|
496
|
-
replayClean: boolean;
|
|
497
|
-
nonceUnique: boolean;
|
|
498
|
-
decryptionOk: boolean;
|
|
499
|
-
}
|
|
500
|
-
declare function buildWitnessRecord(envelope: CceRequestEnvelope, capsule: CceCapsuleClaims, verification: CceVerificationState, execution: {
|
|
501
|
-
status: CceResponseStatus;
|
|
502
|
-
handlerDurationMs: number;
|
|
503
|
-
effect?: string;
|
|
504
|
-
}, options: {
|
|
505
|
-
axisLocalSecret: string;
|
|
506
|
-
requestPayload?: Uint8Array;
|
|
507
|
-
responsePayload?: Uint8Array;
|
|
508
|
-
responseEncrypted: boolean;
|
|
509
|
-
}): CceWitnessRecord;
|
|
510
|
-
declare function extractVerificationState(metadata: Record<string, any>): CceVerificationState;
|
|
511
|
-
|
|
512
|
-
type AxisAlg$1 = 'EdDSA' | 'ES256' | 'RS256';
|
|
513
|
-
type CapsuleStatus = 'ACTIVE' | 'CONSUMED' | 'REVOKED' | 'EXPIRED';
|
|
514
|
-
type CapsuleMode = 'SINGLE_USE' | 'MULTI_USE';
|
|
515
|
-
type KeyStatus = 'ACTIVE' | 'GRACE' | 'REVOKED' | 'RETIRED';
|
|
516
|
-
interface AxisSig$1 {
|
|
517
|
-
alg: AxisAlg$1;
|
|
518
|
-
kid: string;
|
|
519
|
-
value: string;
|
|
520
|
-
}
|
|
521
|
-
interface AxisPacket$1<T = any> {
|
|
522
|
-
v: 1;
|
|
523
|
-
pid: string;
|
|
524
|
-
nonce: string;
|
|
525
|
-
ts: number;
|
|
526
|
-
actorId: string;
|
|
527
|
-
opcode: string;
|
|
528
|
-
body: T;
|
|
529
|
-
sig: AxisSig$1;
|
|
530
|
-
}
|
|
531
|
-
interface AxisCapsuleConstraints {
|
|
532
|
-
maxAmount?: number;
|
|
533
|
-
maxCount?: number;
|
|
534
|
-
ttlSeconds?: number;
|
|
535
|
-
ipCidrAllow?: string[];
|
|
536
|
-
countryAllow?: string[];
|
|
537
|
-
deviceIdAllow?: string[];
|
|
538
|
-
sessionIdLock?: string;
|
|
539
|
-
nonceRequired?: boolean;
|
|
540
|
-
}
|
|
541
|
-
interface TickWindow {
|
|
542
|
-
start: number;
|
|
543
|
-
end: number;
|
|
544
|
-
}
|
|
545
|
-
interface AxisCapsulePayload {
|
|
546
|
-
v: 1;
|
|
547
|
-
capsuleId: string;
|
|
548
|
-
actorId: string;
|
|
549
|
-
issuer: string;
|
|
550
|
-
audience: string;
|
|
551
|
-
subject?: string;
|
|
552
|
-
intent: string;
|
|
553
|
-
scopes: string[];
|
|
554
|
-
actions?: string[];
|
|
555
|
-
iat: number;
|
|
556
|
-
nbf?: number;
|
|
557
|
-
exp: number;
|
|
558
|
-
tickWindow?: TickWindow;
|
|
559
|
-
mode: CapsuleMode;
|
|
560
|
-
maxUses: number;
|
|
561
|
-
nonceSeed?: string;
|
|
562
|
-
policyRefs?: string[];
|
|
563
|
-
riskScore?: number;
|
|
564
|
-
constraints?: AxisCapsuleConstraints;
|
|
565
|
-
meta?: Record<string, unknown>;
|
|
566
|
-
}
|
|
567
|
-
interface AxisCapsule {
|
|
568
|
-
payload: AxisCapsulePayload;
|
|
569
|
-
sig: AxisSig$1;
|
|
570
|
-
}
|
|
571
|
-
interface CapsuleIssueBody {
|
|
572
|
-
intent: string;
|
|
573
|
-
audience: string;
|
|
574
|
-
scopes: string[];
|
|
575
|
-
subject?: string;
|
|
576
|
-
mode: CapsuleMode;
|
|
577
|
-
maxUses?: number;
|
|
578
|
-
expSeconds?: number;
|
|
579
|
-
constraints?: AxisCapsuleConstraints;
|
|
580
|
-
hints?: {
|
|
581
|
-
ip?: string;
|
|
582
|
-
ua?: string;
|
|
583
|
-
deviceId?: string;
|
|
584
|
-
geo?: string;
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
interface CapsuleBatchBody extends Omit<CapsuleIssueBody, 'mode' | 'maxUses'> {
|
|
588
|
-
count: number;
|
|
589
|
-
mode: 'SINGLE_USE';
|
|
590
|
-
}
|
|
591
|
-
interface IntentExecBody {
|
|
592
|
-
intent: string;
|
|
593
|
-
capsule: AxisCapsule;
|
|
594
|
-
execNonce?: string;
|
|
595
|
-
args: Record<string, any>;
|
|
596
|
-
}
|
|
597
|
-
interface CapsuleRevokeBody {
|
|
598
|
-
capsuleId: string;
|
|
599
|
-
reason: string;
|
|
600
|
-
}
|
|
601
|
-
interface AxisResponse$1<T = any> {
|
|
602
|
-
ok: boolean;
|
|
603
|
-
pid: string;
|
|
604
|
-
decisionId: string;
|
|
605
|
-
code: string;
|
|
606
|
-
message?: string;
|
|
607
|
-
data?: T;
|
|
608
|
-
meta?: Record<string, unknown>;
|
|
609
|
-
}
|
|
610
|
-
interface CapsuleIssueResult {
|
|
611
|
-
capsule: AxisCapsule;
|
|
612
|
-
}
|
|
613
|
-
interface CapsuleBatchResult {
|
|
614
|
-
capsules: AxisCapsule[];
|
|
615
|
-
}
|
|
616
|
-
interface ActorKeyRecord {
|
|
617
|
-
id: Buffer;
|
|
618
|
-
actor_id: string;
|
|
619
|
-
key_id: string;
|
|
620
|
-
algorithm: string;
|
|
621
|
-
public_key: Buffer;
|
|
622
|
-
purpose: string;
|
|
623
|
-
status: KeyStatus;
|
|
624
|
-
is_primary: boolean;
|
|
625
|
-
not_before: Date | null;
|
|
626
|
-
expires_at: Date | null;
|
|
627
|
-
rotated_from_key_id: string | null;
|
|
628
|
-
revoked_at: Date | null;
|
|
629
|
-
revocation_reason: string | null;
|
|
630
|
-
metadata: any;
|
|
631
|
-
created_at: Date;
|
|
632
|
-
updated_at: Date;
|
|
633
|
-
}
|
|
634
|
-
interface IssuerKeyRecord {
|
|
635
|
-
id: Buffer;
|
|
636
|
-
kid: string;
|
|
637
|
-
issuer_id: string;
|
|
638
|
-
alg: string;
|
|
639
|
-
public_key_pem: string;
|
|
640
|
-
status: KeyStatus;
|
|
641
|
-
not_before: Date | null;
|
|
642
|
-
not_after: Date | null;
|
|
643
|
-
fingerprint: string | null;
|
|
644
|
-
metadata: any;
|
|
645
|
-
created_at: Date;
|
|
646
|
-
updated_at: Date;
|
|
647
|
-
}
|
|
648
|
-
interface CapsuleRecord {
|
|
649
|
-
id: Buffer;
|
|
650
|
-
capsule_id: string;
|
|
651
|
-
actor_id: string;
|
|
652
|
-
intent: string;
|
|
653
|
-
audience: string;
|
|
654
|
-
issuer: string;
|
|
655
|
-
subject: string | null;
|
|
656
|
-
status: CapsuleStatus;
|
|
657
|
-
mode: CapsuleMode;
|
|
658
|
-
max_uses: number;
|
|
659
|
-
used_count: number;
|
|
660
|
-
iat: Date;
|
|
661
|
-
nbf: Date | null;
|
|
662
|
-
exp: Date;
|
|
663
|
-
scopes_json: any;
|
|
664
|
-
constraints_json: any;
|
|
665
|
-
policy_refs_json: any;
|
|
666
|
-
risk_score: number | null;
|
|
667
|
-
payload_hash: Buffer;
|
|
668
|
-
sig_alg: string;
|
|
669
|
-
sig_kid: string;
|
|
670
|
-
sig_value: Buffer;
|
|
671
|
-
created_at: Date;
|
|
672
|
-
updated_at: Date;
|
|
673
|
-
last_used_at: Date | null;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
type AxisAlg = Extract<AxisAlg$1, 'EdDSA'>;
|
|
677
|
-
type AxisSig = AxisSig$1 & {
|
|
678
|
-
alg: AxisAlg;
|
|
679
|
-
};
|
|
680
|
-
interface AxisFrame$1<T = any> {
|
|
681
|
-
v: 1;
|
|
682
|
-
pid: string;
|
|
683
|
-
nonce: string;
|
|
684
|
-
ts: number;
|
|
685
|
-
actorId: string;
|
|
686
|
-
aud?: string;
|
|
687
|
-
opcode: string;
|
|
688
|
-
headers: Map<number, Uint8Array>;
|
|
689
|
-
body: T;
|
|
690
|
-
sig: AxisSig;
|
|
691
|
-
}
|
|
692
|
-
type AxisResponse<T = any> = AxisResponse$1<T> & {
|
|
693
|
-
policyRefs?: string[];
|
|
694
|
-
riskScore?: number;
|
|
695
|
-
};
|
|
696
|
-
interface AxisObservedContext {
|
|
697
|
-
ip?: string;
|
|
698
|
-
ua?: string;
|
|
699
|
-
geo?: string;
|
|
700
|
-
}
|
|
701
|
-
interface AxisRequestContext {
|
|
702
|
-
observed: AxisObservedContext;
|
|
703
|
-
actorKeyKid?: string;
|
|
704
|
-
issuerKeyKid?: string;
|
|
705
|
-
decisionId: string;
|
|
706
|
-
actorId: string;
|
|
707
|
-
aud?: string;
|
|
708
|
-
opcode: string;
|
|
709
|
-
deviceId?: string;
|
|
710
|
-
sessionId?: string;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
interface SensorPhaseMetadata {
|
|
714
|
-
phase: 'PRE_DECODE' | 'POST_DECODE';
|
|
715
|
-
dependencies?: string[];
|
|
716
|
-
asyncOk?: boolean;
|
|
717
|
-
cryptoOk?: boolean;
|
|
718
|
-
description?: string;
|
|
719
|
-
}
|
|
720
|
-
interface AxisSensor {
|
|
721
|
-
readonly name: string;
|
|
722
|
-
readonly order?: number;
|
|
723
|
-
phase?: SensorPhaseMetadata | 'PRE_DECODE' | 'POST_DECODE';
|
|
724
|
-
supports?(input: SensorInput): boolean;
|
|
725
|
-
run(input: SensorInput): Promise<SensorDecision>;
|
|
726
|
-
}
|
|
727
|
-
interface AxisSensorInit extends AxisSensor {
|
|
728
|
-
onModuleInit?(): void | Promise<void>;
|
|
729
|
-
}
|
|
730
|
-
interface AxisPreSensor extends AxisSensor {
|
|
731
|
-
phase: 'PRE_DECODE';
|
|
732
|
-
}
|
|
733
|
-
interface AxisPostSensor extends AxisSensor {
|
|
734
|
-
phase: 'POST_DECODE';
|
|
735
|
-
}
|
|
736
|
-
interface SensorInput {
|
|
737
|
-
rawBytes?: Buffer | Uint8Array;
|
|
738
|
-
intent?: string;
|
|
739
|
-
ip?: string;
|
|
740
|
-
path?: string;
|
|
741
|
-
contentLength?: number;
|
|
742
|
-
peek?: Uint8Array;
|
|
743
|
-
country?: string;
|
|
744
|
-
clientId?: string;
|
|
745
|
-
isWs?: boolean;
|
|
746
|
-
metadata?: Record<string, any>;
|
|
747
|
-
actorId?: string;
|
|
748
|
-
opcode?: string;
|
|
749
|
-
aud?: string;
|
|
750
|
-
observed?: AxisObservedContext;
|
|
751
|
-
frameBody?: any;
|
|
752
|
-
deviceId?: string;
|
|
753
|
-
sessionId?: string;
|
|
754
|
-
packet?: Record<string, any>;
|
|
755
|
-
[key: string]: any;
|
|
756
|
-
}
|
|
757
|
-
declare enum Decision {
|
|
758
|
-
ALLOW = "ALLOW",
|
|
759
|
-
DENY = "DENY",
|
|
760
|
-
THROTTLE = "THROTTLE",
|
|
761
|
-
FLAG = "FLAG"
|
|
762
|
-
}
|
|
763
|
-
type SensorDecision = {
|
|
764
|
-
decision?: Decision;
|
|
765
|
-
allow: boolean;
|
|
766
|
-
riskScore: number;
|
|
767
|
-
reasons: string[];
|
|
768
|
-
code?: string;
|
|
769
|
-
retryAfterMs?: number;
|
|
770
|
-
scoreDelta?: number;
|
|
771
|
-
tags?: Record<string, any>;
|
|
772
|
-
meta?: any;
|
|
773
|
-
tighten?: {
|
|
774
|
-
expSecondsMax?: number;
|
|
775
|
-
constraintsPatch?: Record<string, any>;
|
|
776
|
-
};
|
|
777
|
-
} | {
|
|
778
|
-
action: 'ALLOW';
|
|
779
|
-
meta?: any;
|
|
780
|
-
} | {
|
|
781
|
-
action: 'DENY';
|
|
782
|
-
code: string;
|
|
783
|
-
reason?: string;
|
|
784
|
-
retryAfterMs?: number;
|
|
785
|
-
meta?: any;
|
|
786
|
-
} | {
|
|
787
|
-
action: 'THROTTLE';
|
|
788
|
-
retryAfterMs: number;
|
|
789
|
-
meta?: any;
|
|
790
|
-
} | {
|
|
791
|
-
action: 'FLAG';
|
|
792
|
-
scoreDelta: number;
|
|
793
|
-
reasons: string[];
|
|
794
|
-
meta?: any;
|
|
795
|
-
};
|
|
796
|
-
type SensorMinifiedDecision = {
|
|
797
|
-
allow: boolean;
|
|
798
|
-
riskScore: number;
|
|
799
|
-
reasons: string[];
|
|
800
|
-
tags?: Record<string, any>;
|
|
801
|
-
meta?: any;
|
|
802
|
-
tighten?: {
|
|
803
|
-
expSecondsMax?: number;
|
|
804
|
-
constraintsPatch?: Record<string, any>;
|
|
805
|
-
};
|
|
806
|
-
retryAfterMs?: number;
|
|
807
|
-
};
|
|
808
|
-
declare function normalizeSensorDecision(sensorDecision: SensorDecision): SensorMinifiedDecision;
|
|
809
|
-
declare const SensorDecisions: {
|
|
810
|
-
allow(meta?: any, tags?: Record<string, any>): SensorDecision;
|
|
811
|
-
deny(code: string, reason?: string, meta?: any): SensorDecision;
|
|
812
|
-
throttle(retryAfterMs: number, meta?: any): SensorDecision;
|
|
813
|
-
flag(scoreDelta: number, reasons: string[], meta?: any): SensorDecision;
|
|
814
|
-
};
|
|
815
|
-
|
|
816
|
-
type CceHandler = (payload: Uint8Array, context: CceHandlerContext) => Promise<CceHandlerResult>;
|
|
817
|
-
interface CceHandlerContext {
|
|
818
|
-
capsule: CceCapsuleClaims;
|
|
819
|
-
executionContext: CceExecutionContext;
|
|
820
|
-
envelope: CceRequestEnvelope;
|
|
821
|
-
clientPublicKeyHex: string;
|
|
822
|
-
intent: string;
|
|
823
|
-
sub: string;
|
|
824
|
-
}
|
|
825
|
-
interface CceHandlerResult {
|
|
826
|
-
status: CceResponseStatus;
|
|
827
|
-
body: Uint8Array;
|
|
828
|
-
effect?: string;
|
|
829
|
-
}
|
|
830
|
-
interface CcePolicyContext {
|
|
831
|
-
envelope: CceRequestEnvelope;
|
|
832
|
-
capsule: CceCapsuleClaims;
|
|
833
|
-
executionContext: CceExecutionContext;
|
|
834
|
-
decryptedPayload: Uint8Array;
|
|
835
|
-
clientPublicKeyHex: string;
|
|
836
|
-
}
|
|
837
|
-
interface CcePolicyDecision {
|
|
838
|
-
allow: boolean;
|
|
839
|
-
code?: string;
|
|
840
|
-
message?: string;
|
|
841
|
-
}
|
|
842
|
-
interface CcePolicyEvaluator {
|
|
843
|
-
evaluate(context: CcePolicyContext): Promise<CcePolicyDecision>;
|
|
844
|
-
}
|
|
845
|
-
interface CcePipelineConfig {
|
|
846
|
-
axisLocalSecret: string;
|
|
847
|
-
axisAudience: string;
|
|
848
|
-
sensors: AxisSensor[];
|
|
849
|
-
handlers: Map<string, CceHandler>;
|
|
850
|
-
witnessStore: CceWitnessStore;
|
|
851
|
-
clientKeyEncryptor: CceClientKeyEncryptor;
|
|
852
|
-
axisSigner: CceAxisSigner;
|
|
853
|
-
policyEvaluator?: CcePolicyEvaluator;
|
|
854
|
-
}
|
|
855
|
-
type CcePipelineResult = {
|
|
856
|
-
ok: true;
|
|
857
|
-
response: CceResponseEnvelope;
|
|
858
|
-
witnessId: string;
|
|
859
|
-
} | {
|
|
860
|
-
ok: false;
|
|
861
|
-
error: {
|
|
862
|
-
code: string;
|
|
863
|
-
message: string;
|
|
864
|
-
};
|
|
865
|
-
status: CceResponseStatus;
|
|
866
|
-
};
|
|
867
|
-
declare function executeCcePipeline(envelope: CceRequestEnvelope, config: CcePipelineConfig): Promise<CcePipelineResult>;
|
|
868
|
-
|
|
869
|
-
interface ExecutionContract {
|
|
870
|
-
maxDbWrites: number;
|
|
871
|
-
maxDbReads?: number;
|
|
872
|
-
maxExternalCalls: number;
|
|
873
|
-
maxTimeMs: number;
|
|
874
|
-
allowedEffects: string[];
|
|
875
|
-
maxMemoryMb?: number;
|
|
876
|
-
}
|
|
877
|
-
declare const DEFAULT_CONTRACTS: Record<string, ExecutionContract>;
|
|
878
|
-
declare const FALLBACK_CONTRACT: ExecutionContract;
|
|
879
|
-
|
|
880
|
-
declare const SensorDecisionZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
881
|
-
action: z.ZodLiteral<"ALLOW">;
|
|
882
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
883
|
-
}, z.z.core.$strip>, z.ZodObject<{
|
|
884
|
-
action: z.ZodLiteral<"DENY">;
|
|
885
|
-
code: z.ZodString;
|
|
886
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
887
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
888
|
-
}, z.z.core.$strip>]>;
|
|
889
|
-
declare const SensorDecisionWithMetadataZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
890
|
-
action: z.ZodLiteral<"ALLOW">;
|
|
891
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
892
|
-
}, z.z.core.$strip>, z.ZodObject<{
|
|
893
|
-
action: z.ZodLiteral<"DENY">;
|
|
894
|
-
code: z.ZodString;
|
|
895
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
896
|
-
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
897
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
898
|
-
}, z.z.core.$strip>]>;
|
|
899
|
-
declare const CountryBlockSensorInputZ: z.ZodObject<{
|
|
900
|
-
ip: z.ZodString;
|
|
901
|
-
country: z.ZodOptional<z.ZodString>;
|
|
902
|
-
}, z.z.core.$strip>;
|
|
903
|
-
type CountryBlockSensorInput = z.infer<typeof CountryBlockSensorInputZ>;
|
|
904
|
-
declare const CountryBlockDecisionZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
905
|
-
action: z.ZodLiteral<"ALLOW">;
|
|
906
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
907
|
-
}, z.z.core.$strip>, z.ZodObject<{
|
|
908
|
-
action: z.ZodLiteral<"DENY">;
|
|
909
|
-
code: z.ZodString;
|
|
910
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
911
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
912
|
-
}, z.z.core.$strip>]>;
|
|
913
|
-
type CountryBlockDecision = z.infer<typeof CountryBlockDecisionZ>;
|
|
914
|
-
declare const ScanBurstSensorInputZ: z.ZodObject<{
|
|
915
|
-
ip: z.ZodString;
|
|
916
|
-
isFailure: z.ZodOptional<z.ZodBoolean>;
|
|
917
|
-
}, z.z.core.$strip>;
|
|
918
|
-
type ScanBurstSensorInput = z.infer<typeof ScanBurstSensorInputZ>;
|
|
919
|
-
declare const ScanBurstDecisionZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
920
|
-
action: z.ZodLiteral<"ALLOW">;
|
|
921
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
922
|
-
}, z.z.core.$strip>, z.ZodObject<{
|
|
923
|
-
action: z.ZodLiteral<"DENY">;
|
|
924
|
-
code: z.ZodString;
|
|
925
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
926
|
-
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
927
|
-
meta: z.ZodOptional<z.ZodAny>;
|
|
928
|
-
}, z.z.core.$strip>]>;
|
|
929
|
-
type ScanBurstDecision = z.infer<typeof ScanBurstDecisionZ>;
|
|
930
|
-
declare const ProofKindZ: z.ZodEnum<{
|
|
931
|
-
NONE: "NONE";
|
|
932
|
-
CAPSULE: "CAPSULE";
|
|
933
|
-
PASSPORT: "PASSPORT";
|
|
934
|
-
MTLS: "MTLS";
|
|
935
|
-
JWT: "JWT";
|
|
153
|
+
declare const SensorDecisionZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
154
|
+
action: z.ZodLiteral<"ALLOW">;
|
|
155
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
156
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
157
|
+
action: z.ZodLiteral<"DENY">;
|
|
158
|
+
code: z.ZodString;
|
|
159
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
160
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
161
|
+
}, z.z.core.$strip>]>;
|
|
162
|
+
declare const SensorDecisionWithMetadataZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
163
|
+
action: z.ZodLiteral<"ALLOW">;
|
|
164
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
165
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
166
|
+
action: z.ZodLiteral<"DENY">;
|
|
167
|
+
code: z.ZodString;
|
|
168
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
169
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
171
|
+
}, z.z.core.$strip>]>;
|
|
172
|
+
declare const CountryBlockSensorInputZ: z.ZodObject<{
|
|
173
|
+
ip: z.ZodString;
|
|
174
|
+
country: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.z.core.$strip>;
|
|
176
|
+
type CountryBlockSensorInput = z.infer<typeof CountryBlockSensorInputZ>;
|
|
177
|
+
declare const CountryBlockDecisionZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
178
|
+
action: z.ZodLiteral<"ALLOW">;
|
|
179
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
180
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
181
|
+
action: z.ZodLiteral<"DENY">;
|
|
182
|
+
code: z.ZodString;
|
|
183
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
184
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
185
|
+
}, z.z.core.$strip>]>;
|
|
186
|
+
type CountryBlockDecision = z.infer<typeof CountryBlockDecisionZ>;
|
|
187
|
+
declare const ScanBurstSensorInputZ: z.ZodObject<{
|
|
188
|
+
ip: z.ZodString;
|
|
189
|
+
isFailure: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
}, z.z.core.$strip>;
|
|
191
|
+
type ScanBurstSensorInput = z.infer<typeof ScanBurstSensorInputZ>;
|
|
192
|
+
declare const ScanBurstDecisionZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
193
|
+
action: z.ZodLiteral<"ALLOW">;
|
|
194
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
195
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
196
|
+
action: z.ZodLiteral<"DENY">;
|
|
197
|
+
code: z.ZodString;
|
|
198
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
199
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
201
|
+
}, z.z.core.$strip>]>;
|
|
202
|
+
type ScanBurstDecision = z.infer<typeof ScanBurstDecisionZ>;
|
|
203
|
+
declare const ProofKindZ: z.ZodEnum<{
|
|
204
|
+
NONE: "NONE";
|
|
205
|
+
CAPSULE: "CAPSULE";
|
|
206
|
+
PASSPORT: "PASSPORT";
|
|
207
|
+
MTLS: "MTLS";
|
|
208
|
+
JWT: "JWT";
|
|
936
209
|
}>;
|
|
937
210
|
type ProofKind = z.infer<typeof ProofKindZ>;
|
|
938
211
|
declare const AccessProfileZ: z.ZodEnum<{
|
|
@@ -1195,8 +468,8 @@ declare const SchemaFieldKindZ: z.ZodEnum<{
|
|
|
1195
468
|
}>;
|
|
1196
469
|
type SchemaFieldKind = z.infer<typeof SchemaFieldKindZ>;
|
|
1197
470
|
declare const ScopeZ: z.ZodEnum<{
|
|
1198
|
-
header: "header";
|
|
1199
471
|
body: "body";
|
|
472
|
+
header: "header";
|
|
1200
473
|
}>;
|
|
1201
474
|
type Scope = z.infer<typeof ScopeZ>;
|
|
1202
475
|
declare const SchemaFieldZ: z.ZodObject<{
|
|
@@ -1215,8 +488,8 @@ declare const SchemaFieldZ: z.ZodObject<{
|
|
|
1215
488
|
maxLen: z.ZodOptional<z.ZodNumber>;
|
|
1216
489
|
max: z.ZodOptional<z.ZodString>;
|
|
1217
490
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
1218
|
-
header: "header";
|
|
1219
491
|
body: "body";
|
|
492
|
+
header: "header";
|
|
1220
493
|
}>>;
|
|
1221
494
|
}, z.z.core.$strip>;
|
|
1222
495
|
type SchemaField = z.infer<typeof SchemaFieldZ>;
|
|
@@ -1251,8 +524,8 @@ declare const IntentSchemaZ: z.ZodObject<{
|
|
|
1251
524
|
maxLen: z.ZodOptional<z.ZodNumber>;
|
|
1252
525
|
max: z.ZodOptional<z.ZodString>;
|
|
1253
526
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
1254
|
-
header: "header";
|
|
1255
527
|
body: "body";
|
|
528
|
+
header: "header";
|
|
1256
529
|
}>>;
|
|
1257
530
|
}, z.z.core.$strip>>;
|
|
1258
531
|
}, z.z.core.$strip>;
|
|
@@ -1290,117 +563,846 @@ declare const UploadStatusZ: z.ZodEnum<{
|
|
|
1290
563
|
DONE: "DONE";
|
|
1291
564
|
ABORTED: "ABORTED";
|
|
1292
565
|
}>;
|
|
1293
|
-
type UploadStatus = z.infer<typeof UploadStatusZ>;
|
|
1294
|
-
declare const UploadSessionZ: z.ZodObject<{
|
|
1295
|
-
uploadIdHex: z.ZodString;
|
|
1296
|
-
fileName: z.ZodString;
|
|
1297
|
-
totalSize: z.ZodNumber;
|
|
1298
|
-
chunkSize: z.ZodNumber;
|
|
1299
|
-
totalChunks: z.ZodNumber;
|
|
1300
|
-
receivedCount: z.ZodNumber;
|
|
1301
|
-
status: z.ZodEnum<{
|
|
1302
|
-
INIT: "INIT";
|
|
1303
|
-
UPLOADING: "UPLOADING";
|
|
1304
|
-
FINALIZING: "FINALIZING";
|
|
1305
|
-
DONE: "DONE";
|
|
1306
|
-
ABORTED: "ABORTED";
|
|
1307
|
-
}>;
|
|
1308
|
-
}, z.z.core.$strip>;
|
|
1309
|
-
type UploadSession = z.infer<typeof UploadSessionZ>;
|
|
1310
|
-
declare const BodyBudgetInputZ: z.ZodObject<{
|
|
1311
|
-
intent: z.ZodString;
|
|
1312
|
-
headerLen: z.ZodNumber;
|
|
1313
|
-
bodyLen: z.ZodNumber;
|
|
1314
|
-
}, z.z.core.$strip>;
|
|
1315
|
-
type BodyBudgetInput = z.infer<typeof BodyBudgetInputZ>;
|
|
1316
|
-
declare const BodyBudgetPolicyZ: z.ZodObject<{
|
|
1317
|
-
maxHeaderBytes: z.ZodNumber;
|
|
1318
|
-
maxBodyBytes: z.ZodNumber;
|
|
1319
|
-
}, z.z.core.$strip>;
|
|
1320
|
-
type BodyBudgetPolicy = z.infer<typeof BodyBudgetPolicyZ>;
|
|
1321
|
-
declare const ChunkHashInputZ: z.ZodObject<{
|
|
1322
|
-
headerTLVs: z.ZodAny;
|
|
1323
|
-
bodyBytes: z.ZodAny;
|
|
1324
|
-
intent: z.ZodString;
|
|
1325
|
-
}, z.z.core.$strip>;
|
|
1326
|
-
type ChunkHashInput = z.infer<typeof ChunkHashInputZ>;
|
|
1327
|
-
declare enum ProofType$1 {
|
|
1328
|
-
CAPSULE = 1,
|
|
1329
|
-
JWT = 2,
|
|
1330
|
-
MTLS_ID = 3,
|
|
1331
|
-
DEVICE_SE = 4,
|
|
1332
|
-
WITNESS_SIG = 5
|
|
566
|
+
type UploadStatus = z.infer<typeof UploadStatusZ>;
|
|
567
|
+
declare const UploadSessionZ: z.ZodObject<{
|
|
568
|
+
uploadIdHex: z.ZodString;
|
|
569
|
+
fileName: z.ZodString;
|
|
570
|
+
totalSize: z.ZodNumber;
|
|
571
|
+
chunkSize: z.ZodNumber;
|
|
572
|
+
totalChunks: z.ZodNumber;
|
|
573
|
+
receivedCount: z.ZodNumber;
|
|
574
|
+
status: z.ZodEnum<{
|
|
575
|
+
INIT: "INIT";
|
|
576
|
+
UPLOADING: "UPLOADING";
|
|
577
|
+
FINALIZING: "FINALIZING";
|
|
578
|
+
DONE: "DONE";
|
|
579
|
+
ABORTED: "ABORTED";
|
|
580
|
+
}>;
|
|
581
|
+
}, z.z.core.$strip>;
|
|
582
|
+
type UploadSession = z.infer<typeof UploadSessionZ>;
|
|
583
|
+
declare const BodyBudgetInputZ: z.ZodObject<{
|
|
584
|
+
intent: z.ZodString;
|
|
585
|
+
headerLen: z.ZodNumber;
|
|
586
|
+
bodyLen: z.ZodNumber;
|
|
587
|
+
}, z.z.core.$strip>;
|
|
588
|
+
type BodyBudgetInput = z.infer<typeof BodyBudgetInputZ>;
|
|
589
|
+
declare const BodyBudgetPolicyZ: z.ZodObject<{
|
|
590
|
+
maxHeaderBytes: z.ZodNumber;
|
|
591
|
+
maxBodyBytes: z.ZodNumber;
|
|
592
|
+
}, z.z.core.$strip>;
|
|
593
|
+
type BodyBudgetPolicy = z.infer<typeof BodyBudgetPolicyZ>;
|
|
594
|
+
declare const ChunkHashInputZ: z.ZodObject<{
|
|
595
|
+
headerTLVs: z.ZodAny;
|
|
596
|
+
bodyBytes: z.ZodAny;
|
|
597
|
+
intent: z.ZodString;
|
|
598
|
+
}, z.z.core.$strip>;
|
|
599
|
+
type ChunkHashInput = z.infer<typeof ChunkHashInputZ>;
|
|
600
|
+
declare enum ProofType$1 {
|
|
601
|
+
CAPSULE = 1,
|
|
602
|
+
JWT = 2,
|
|
603
|
+
MTLS_ID = 3,
|
|
604
|
+
DEVICE_SE = 4,
|
|
605
|
+
WITNESS_SIG = 5
|
|
606
|
+
}
|
|
607
|
+
declare const AxisContextZ: z.ZodObject<{
|
|
608
|
+
pid: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
609
|
+
ts: z.ZodBigInt;
|
|
610
|
+
intent: z.ZodString;
|
|
611
|
+
actorId: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
612
|
+
proofType: z.ZodEnum<typeof ProofType$1>;
|
|
613
|
+
proofRef: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
614
|
+
nonce: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
615
|
+
ip: z.ZodString;
|
|
616
|
+
nodeCertHash: z.ZodOptional<z.ZodString>;
|
|
617
|
+
capsule: z.ZodOptional<z.ZodObject<{
|
|
618
|
+
id: z.ZodString;
|
|
619
|
+
claims: z.ZodObject<{
|
|
620
|
+
capsuleId: z.ZodString;
|
|
621
|
+
allowIntents: z.ZodArray<z.ZodString>;
|
|
622
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
623
|
+
maxBodyBytes: z.ZodOptional<z.ZodNumber>;
|
|
624
|
+
}, z.z.core.$strip>>;
|
|
625
|
+
scopes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
626
|
+
}, z.z.core.$strip>;
|
|
627
|
+
issuedAt: z.ZodNumber;
|
|
628
|
+
expiresAt: z.ZodNumber;
|
|
629
|
+
tier: z.ZodEnum<{
|
|
630
|
+
FREE: "FREE";
|
|
631
|
+
STANDARD: "STANDARD";
|
|
632
|
+
PREMIUM: "PREMIUM";
|
|
633
|
+
}>;
|
|
634
|
+
}, z.z.core.$strip>>;
|
|
635
|
+
passport: z.ZodOptional<z.ZodObject<{
|
|
636
|
+
id: z.ZodString;
|
|
637
|
+
public_key: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
638
|
+
status: z.ZodEnum<{
|
|
639
|
+
ACTIVE: "ACTIVE";
|
|
640
|
+
REVOKED: "REVOKED";
|
|
641
|
+
EXPIRED: "EXPIRED";
|
|
642
|
+
PENDING: "PENDING";
|
|
643
|
+
}>;
|
|
644
|
+
issuedAt: z.ZodNumber;
|
|
645
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
646
|
+
}, z.z.core.$strip>>;
|
|
647
|
+
meter: z.ZodOptional<z.ZodAny>;
|
|
648
|
+
}, z.z.core.$strip>;
|
|
649
|
+
type AxisContext$1 = z.infer<typeof AxisContextZ>;
|
|
650
|
+
declare const AxisErrorZ: z.ZodObject<{
|
|
651
|
+
code: z.ZodString;
|
|
652
|
+
message: z.ZodString;
|
|
653
|
+
httpStatus: z.ZodNumber;
|
|
654
|
+
}, z.z.core.$strip>;
|
|
655
|
+
type AxisError = z.infer<typeof AxisErrorZ>;
|
|
656
|
+
|
|
657
|
+
declare const AXIS_META_KEY = "axis:axis";
|
|
658
|
+
declare const SENSITIVITY_METADATA_KEY = "axis:sensitivity";
|
|
659
|
+
declare const CONTRACT_METADATA_KEY = "axis:contract";
|
|
660
|
+
declare const REQUIRED_PROOF_METADATA_KEY = "axis:required_proof";
|
|
661
|
+
type RequiredProofKind = ProofKind | "WITNESS";
|
|
662
|
+
declare function Sensitivity(level: SensitivityLevel): ClassDecorator & MethodDecorator;
|
|
663
|
+
declare function Contract(options: Partial<ExecutionContract>): ClassDecorator & MethodDecorator;
|
|
664
|
+
declare function RequiredProof(proofs: [RequiredProofKind, ...RequiredProofKind[]]): ClassDecorator & MethodDecorator;
|
|
665
|
+
declare function Capsule(): ClassDecorator & MethodDecorator;
|
|
666
|
+
declare function Witness(): ClassDecorator & MethodDecorator;
|
|
667
|
+
declare function Axis(): ClassDecorator;
|
|
668
|
+
declare const AXIS_PUBLIC_KEY = "axis:public";
|
|
669
|
+
declare function AxisPublic(): ClassDecorator & MethodDecorator;
|
|
670
|
+
declare const AXIS_ANONYMOUS_KEY = "axis:anonymous";
|
|
671
|
+
declare function AxisAnonymous(): ClassDecorator & MethodDecorator;
|
|
672
|
+
declare const AXIS_RATE_LIMIT_KEY = "axis:rateLimit";
|
|
673
|
+
interface AxisRateLimitConfig {
|
|
674
|
+
max: number;
|
|
675
|
+
windowSec: number;
|
|
676
|
+
key?: string;
|
|
677
|
+
}
|
|
678
|
+
declare function AxisRateLimit(config: AxisRateLimitConfig): MethodDecorator;
|
|
679
|
+
|
|
680
|
+
declare const HANDLER_METADATA_KEY = "axis:handler";
|
|
681
|
+
declare function Handler(intent?: string): ClassDecorator;
|
|
682
|
+
|
|
683
|
+
declare const INTENT_METADATA_KEY = "axis:intent";
|
|
684
|
+
declare const INTENT_ROUTES_KEY = "axis:intent_routes";
|
|
685
|
+
type IntentKind = 'create' | 'read' | 'update' | 'delete' | 'action';
|
|
686
|
+
interface IntentTlvField {
|
|
687
|
+
name: string;
|
|
688
|
+
tag: number;
|
|
689
|
+
kind: 'utf8' | 'u64' | 'bytes' | 'bytes16' | 'bool' | 'obj' | 'arr';
|
|
690
|
+
required?: boolean;
|
|
691
|
+
maxLen?: number;
|
|
692
|
+
max?: string;
|
|
693
|
+
scope?: 'header' | 'body';
|
|
694
|
+
}
|
|
695
|
+
interface IntentRoute {
|
|
696
|
+
action: string;
|
|
697
|
+
methodName: string | symbol;
|
|
698
|
+
absolute?: boolean;
|
|
699
|
+
frame?: boolean;
|
|
700
|
+
kind?: IntentKind;
|
|
701
|
+
chain?: boolean | ChainOptions;
|
|
702
|
+
bodyProfile?: 'TLV_MAP' | 'RAW' | 'TLV_OBJ' | 'TLV_ARR';
|
|
703
|
+
tlv?: IntentTlvField[];
|
|
704
|
+
dto?: Function;
|
|
705
|
+
}
|
|
706
|
+
interface IntentOptions {
|
|
707
|
+
kind?: IntentKind;
|
|
708
|
+
absolute?: boolean;
|
|
709
|
+
frame?: boolean;
|
|
710
|
+
chain?: boolean | ChainOptions;
|
|
711
|
+
bodyProfile?: 'TLV_MAP' | 'RAW' | 'TLV_OBJ' | 'TLV_ARR';
|
|
712
|
+
tlv?: IntentTlvField[];
|
|
713
|
+
dto?: Function;
|
|
714
|
+
}
|
|
715
|
+
declare function Intent(action: string, options?: IntentOptions): MethodDecorator;
|
|
716
|
+
|
|
717
|
+
declare const INTENT_BODY_KEY = "axis:intent:body";
|
|
718
|
+
declare function IntentBody(decoder: (buf: Buffer) => any): MethodDecorator;
|
|
719
|
+
|
|
720
|
+
declare const INTENT_SENSORS_KEY = "axis:intent:sensors";
|
|
721
|
+
declare function IntentSensors(sensors: Function[]): MethodDecorator;
|
|
722
|
+
|
|
723
|
+
declare const OBSERVER_METADATA_KEY = "axis:observer";
|
|
724
|
+
declare const OBSERVER_BINDINGS_KEY = "axis:observer:bindings";
|
|
725
|
+
type AxisObserverRef = string | Function;
|
|
726
|
+
interface AxisObserverDefinition {
|
|
727
|
+
name?: string;
|
|
728
|
+
tags?: string[];
|
|
729
|
+
events?: AxisObserverEvent[];
|
|
730
|
+
intents?: string[];
|
|
731
|
+
handlers?: string[];
|
|
732
|
+
}
|
|
733
|
+
interface AxisObserverBinding {
|
|
734
|
+
refs: AxisObserverRef[];
|
|
735
|
+
tags?: string[];
|
|
736
|
+
events?: AxisObserverEvent[];
|
|
737
|
+
}
|
|
738
|
+
interface AxisObserverBindingOptions {
|
|
739
|
+
use: AxisObserverRef | AxisObserverRef[];
|
|
740
|
+
tags?: string[];
|
|
741
|
+
events?: AxisObserverEvent[];
|
|
742
|
+
}
|
|
743
|
+
declare function Observer(input?: AxisObserverDefinition | AxisObserverBindingOptions | AxisObserverRef | AxisObserverRef[]): ClassDecorator & MethodDecorator;
|
|
744
|
+
|
|
745
|
+
declare const HANDLER_SENSORS_KEY = "axis:handler:sensors";
|
|
746
|
+
declare function HandlerSensors(sensors: Function[]): ClassDecorator;
|
|
747
|
+
|
|
748
|
+
declare const SENSOR_METADATA_KEY = "axis:sensor";
|
|
749
|
+
type SensorPhase = 'PRE_DECODE' | 'POST_DECODE';
|
|
750
|
+
interface SensorOptions {
|
|
751
|
+
phase?: SensorPhase;
|
|
752
|
+
}
|
|
753
|
+
declare function Sensor(options?: SensorOptions): ClassDecorator;
|
|
754
|
+
|
|
755
|
+
declare const TLV_FIELDS_KEY = "axis:tlv:fields";
|
|
756
|
+
declare const TLV_VALIDATORS_KEY = "axis:tlv:validators";
|
|
757
|
+
type TlvFieldKind = 'utf8' | 'u64' | 'bytes' | 'bytes16' | 'bool' | 'obj' | 'arr';
|
|
758
|
+
interface TlvFieldOptions {
|
|
759
|
+
kind: TlvFieldKind;
|
|
760
|
+
required?: boolean;
|
|
761
|
+
maxLen?: number;
|
|
762
|
+
max?: string;
|
|
763
|
+
scope?: 'header' | 'body';
|
|
764
|
+
}
|
|
765
|
+
interface TlvFieldMeta {
|
|
766
|
+
property: string;
|
|
767
|
+
tag: number;
|
|
768
|
+
options: TlvFieldOptions;
|
|
769
|
+
}
|
|
770
|
+
type TlvValidatorFn = (value: Uint8Array, property: string) => string | null | undefined;
|
|
771
|
+
interface TlvValidatorMeta {
|
|
772
|
+
property: string;
|
|
773
|
+
tag: number;
|
|
774
|
+
validators: TlvValidatorFn[];
|
|
775
|
+
}
|
|
776
|
+
declare function TlvField(tag: number, options: TlvFieldOptions): PropertyDecorator;
|
|
777
|
+
declare function TlvValidate(validator: TlvValidatorFn): PropertyDecorator;
|
|
778
|
+
declare function TlvUtf8Pattern(pattern: RegExp, message?: string): PropertyDecorator;
|
|
779
|
+
declare function TlvMinLen(min: number, message?: string): PropertyDecorator;
|
|
780
|
+
declare function TlvEnum(allowed: string[], message?: string): PropertyDecorator;
|
|
781
|
+
declare function TlvRange(min: bigint, max: bigint, message?: string): PropertyDecorator;
|
|
782
|
+
|
|
783
|
+
interface DtoSchema {
|
|
784
|
+
fields: IntentTlvField[];
|
|
785
|
+
validators: Map<number, TlvValidatorFn[]>;
|
|
786
|
+
}
|
|
787
|
+
declare function extractDtoSchema(dto: Function): DtoSchema;
|
|
788
|
+
declare function buildDtoDecoder(dto: Function): (bodyBytes: Buffer) => Record<string, any>;
|
|
789
|
+
|
|
790
|
+
declare abstract class AxisTlvDto {
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
declare class AxisIdDto extends AxisTlvDto {
|
|
794
|
+
id: string;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
declare function AxisPartialType<T extends new (...args: any[]) => AxisTlvDto>(BaseDto: T): new (...args: any[]) => Partial<InstanceType<T>> & AxisTlvDto;
|
|
798
|
+
|
|
799
|
+
declare const RESPONSE_TAG_ID = 1;
|
|
800
|
+
declare const RESPONSE_TAG_CREATED_AT = 2;
|
|
801
|
+
declare const RESPONSE_TAG_UPDATED_AT = 3;
|
|
802
|
+
declare const RESPONSE_TAG_CREATED_BY = 4;
|
|
803
|
+
declare const RESPONSE_TAG_UPDATED_BY = 5;
|
|
804
|
+
declare abstract class AxisResponseDto extends AxisTlvDto {
|
|
805
|
+
id?: string;
|
|
806
|
+
created_at?: bigint;
|
|
807
|
+
updated_at?: bigint;
|
|
808
|
+
created_by?: string;
|
|
809
|
+
updated_by?: string;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
declare const CCE_PROTOCOL_VERSION: "cce-v1";
|
|
813
|
+
declare const CCE_DERIVATION: {
|
|
814
|
+
readonly REQUEST: "axis:cce:req:v1";
|
|
815
|
+
readonly RESPONSE: "axis:cce:resp:v1";
|
|
816
|
+
readonly WITNESS: "axis:cce:witness:v1";
|
|
817
|
+
};
|
|
818
|
+
type CceAlgorithm = "AES-256-GCM";
|
|
819
|
+
type CceKemAlgorithm = "X25519" | "RSA-OAEP-256";
|
|
820
|
+
type CceKdfAlgorithm = "HKDF-SHA256";
|
|
821
|
+
declare const CCE_AES_KEY_BYTES = 32;
|
|
822
|
+
declare const CCE_IV_BYTES = 12;
|
|
823
|
+
declare const CCE_TAG_BYTES = 16;
|
|
824
|
+
declare const CCE_NONCE_BYTES = 32;
|
|
825
|
+
interface CceCapsuleClaims {
|
|
826
|
+
capsule_id: string;
|
|
827
|
+
ver: typeof CCE_PROTOCOL_VERSION;
|
|
828
|
+
sub: string;
|
|
829
|
+
kid: string;
|
|
830
|
+
intent: string;
|
|
831
|
+
aud: string;
|
|
832
|
+
tps_from: number;
|
|
833
|
+
tps_to: number;
|
|
834
|
+
capsule_nonce: string;
|
|
835
|
+
challenge_id: string;
|
|
836
|
+
proof_hash?: string;
|
|
837
|
+
policy_hash?: string;
|
|
838
|
+
iat: number;
|
|
839
|
+
exp: number;
|
|
840
|
+
mode: "SINGLE_USE" | "SESSION";
|
|
841
|
+
scope?: string[];
|
|
842
|
+
constraints?: CceConstraints;
|
|
843
|
+
issuer_sig: CceSignature;
|
|
844
|
+
}
|
|
845
|
+
interface CceConstraints {
|
|
846
|
+
max_payload_bytes?: number;
|
|
847
|
+
ip_allow?: string[];
|
|
848
|
+
device_allow?: string[];
|
|
849
|
+
country_allow?: string[];
|
|
850
|
+
}
|
|
851
|
+
interface CceSignature {
|
|
852
|
+
alg: "EdDSA" | "ES256";
|
|
853
|
+
kid: string;
|
|
854
|
+
value: string;
|
|
855
|
+
}
|
|
856
|
+
interface CceRequestEnvelope {
|
|
857
|
+
ver: typeof CCE_PROTOCOL_VERSION;
|
|
858
|
+
request_id: string;
|
|
859
|
+
correlation_id: string;
|
|
860
|
+
client_kid: string;
|
|
861
|
+
capsule: CceCapsuleClaims;
|
|
862
|
+
encrypted_key: CceEncryptedKey;
|
|
863
|
+
encrypted_payload: CceEncryptedPayload;
|
|
864
|
+
request_nonce: string;
|
|
865
|
+
client_sig: CceSignature;
|
|
866
|
+
content_type: string;
|
|
867
|
+
algorithms: CceAlgorithmDescriptor;
|
|
868
|
+
aad_descriptor?: string;
|
|
869
|
+
}
|
|
870
|
+
interface CceEncryptedKey {
|
|
871
|
+
alg: CceKemAlgorithm;
|
|
872
|
+
axis_kid: string;
|
|
873
|
+
ciphertext: string;
|
|
874
|
+
ephemeral_pk?: string;
|
|
875
|
+
}
|
|
876
|
+
interface CceEncryptedPayload {
|
|
877
|
+
alg: CceAlgorithm;
|
|
878
|
+
iv: string;
|
|
879
|
+
ciphertext: string;
|
|
880
|
+
tag: string;
|
|
881
|
+
}
|
|
882
|
+
interface CceAlgorithmDescriptor {
|
|
883
|
+
kem: CceKemAlgorithm;
|
|
884
|
+
enc: CceAlgorithm;
|
|
885
|
+
kdf: CceKdfAlgorithm;
|
|
886
|
+
sig: "EdDSA" | "ES256";
|
|
887
|
+
}
|
|
888
|
+
interface CceResponseEnvelope {
|
|
889
|
+
ver: typeof CCE_PROTOCOL_VERSION;
|
|
890
|
+
response_id: string;
|
|
891
|
+
request_id: string;
|
|
892
|
+
correlation_id: string;
|
|
893
|
+
capsule_id: string;
|
|
894
|
+
encrypted_key: CceEncryptedKey;
|
|
895
|
+
encrypted_payload: CceEncryptedPayload;
|
|
896
|
+
response_nonce: string;
|
|
897
|
+
axis_sig: CceSignature;
|
|
898
|
+
witness_ref?: string;
|
|
899
|
+
algorithms: CceAlgorithmDescriptor;
|
|
900
|
+
status: CceResponseStatus;
|
|
901
|
+
}
|
|
902
|
+
type CceResponseStatus = "SUCCESS" | "DENIED" | "PARTIAL" | "FAILED" | "ERROR";
|
|
903
|
+
interface CceExecutionContext {
|
|
904
|
+
execution_key_hash: string;
|
|
905
|
+
request_id: string;
|
|
906
|
+
capsule_id: string;
|
|
907
|
+
sub: string;
|
|
908
|
+
kid: string;
|
|
909
|
+
intent: string;
|
|
910
|
+
aud: string;
|
|
911
|
+
tps_from: number;
|
|
912
|
+
tps_to: number;
|
|
913
|
+
policy_hash?: string;
|
|
914
|
+
derived_at: number;
|
|
915
|
+
valid: boolean;
|
|
916
|
+
}
|
|
917
|
+
interface CceWitnessRecord {
|
|
918
|
+
witness_id: string;
|
|
919
|
+
request_id: string;
|
|
920
|
+
capsule_id: string;
|
|
921
|
+
sub: string;
|
|
922
|
+
intent: string;
|
|
923
|
+
aud: string;
|
|
924
|
+
tps_from: number;
|
|
925
|
+
tps_to: number;
|
|
926
|
+
timestamp: number;
|
|
927
|
+
verification: {
|
|
928
|
+
client_sig: boolean;
|
|
929
|
+
capsule_sig: boolean;
|
|
930
|
+
tps_valid: boolean;
|
|
931
|
+
audience_match: boolean;
|
|
932
|
+
intent_match: boolean;
|
|
933
|
+
replay_clean: boolean;
|
|
934
|
+
nonce_unique: boolean;
|
|
935
|
+
decryption_ok: boolean;
|
|
936
|
+
};
|
|
937
|
+
execution: {
|
|
938
|
+
status: CceResponseStatus;
|
|
939
|
+
handler_duration_ms: number;
|
|
940
|
+
effect?: string;
|
|
941
|
+
};
|
|
942
|
+
response_encrypted: boolean;
|
|
943
|
+
execution_context_hash: string;
|
|
944
|
+
request_payload_hash?: string;
|
|
945
|
+
response_payload_hash?: string;
|
|
946
|
+
}
|
|
947
|
+
declare const CCE_ERROR: {
|
|
948
|
+
readonly INVALID_ENVELOPE: "CCE_INVALID_ENVELOPE";
|
|
949
|
+
readonly UNSUPPORTED_VERSION: "CCE_UNSUPPORTED_VERSION";
|
|
950
|
+
readonly MISSING_CAPSULE: "CCE_MISSING_CAPSULE";
|
|
951
|
+
readonly MISSING_ENCRYPTED_KEY: "CCE_MISSING_ENCRYPTED_KEY";
|
|
952
|
+
readonly CLIENT_SIG_INVALID: "CCE_CLIENT_SIG_INVALID";
|
|
953
|
+
readonly CLIENT_KEY_NOT_FOUND: "CCE_CLIENT_KEY_NOT_FOUND";
|
|
954
|
+
readonly CAPSULE_SIG_INVALID: "CCE_CAPSULE_SIG_INVALID";
|
|
955
|
+
readonly CAPSULE_EXPIRED: "CCE_CAPSULE_EXPIRED";
|
|
956
|
+
readonly CAPSULE_NOT_YET_VALID: "CCE_CAPSULE_NOT_YET_VALID";
|
|
957
|
+
readonly CAPSULE_REVOKED: "CCE_CAPSULE_REVOKED";
|
|
958
|
+
readonly CAPSULE_CONSUMED: "CCE_CAPSULE_CONSUMED";
|
|
959
|
+
readonly AUDIENCE_MISMATCH: "CCE_AUDIENCE_MISMATCH";
|
|
960
|
+
readonly INTENT_MISMATCH: "CCE_INTENT_MISMATCH";
|
|
961
|
+
readonly TPS_WINDOW_EXPIRED: "CCE_TPS_WINDOW_EXPIRED";
|
|
962
|
+
readonly TPS_WINDOW_FUTURE: "CCE_TPS_WINDOW_FUTURE";
|
|
963
|
+
readonly REPLAY_DETECTED: "CCE_REPLAY_DETECTED";
|
|
964
|
+
readonly NONCE_REUSED: "CCE_NONCE_REUSED";
|
|
965
|
+
readonly DECRYPTION_FAILED: "CCE_DECRYPTION_FAILED";
|
|
966
|
+
readonly KEY_UNWRAP_FAILED: "CCE_KEY_UNWRAP_FAILED";
|
|
967
|
+
readonly AEAD_TAG_MISMATCH: "CCE_AEAD_TAG_MISMATCH";
|
|
968
|
+
readonly PAYLOAD_TOO_LARGE: "CCE_PAYLOAD_TOO_LARGE";
|
|
969
|
+
readonly PAYLOAD_SCHEMA_INVALID: "CCE_PAYLOAD_SCHEMA_INVALID";
|
|
970
|
+
readonly INTENT_SCHEMA_MISMATCH: "CCE_INTENT_SCHEMA_MISMATCH";
|
|
971
|
+
readonly POLICY_DENIED: "CCE_POLICY_DENIED";
|
|
972
|
+
readonly CONSTRAINT_VIOLATED: "CCE_CONSTRAINT_VIOLATED";
|
|
973
|
+
readonly HANDLER_NOT_FOUND: "CCE_HANDLER_NOT_FOUND";
|
|
974
|
+
readonly HANDLER_EXECUTION_FAILED: "CCE_HANDLER_EXECUTION_FAILED";
|
|
975
|
+
readonly HANDLER_TIMEOUT: "CCE_HANDLER_TIMEOUT";
|
|
976
|
+
readonly RESPONSE_ENCRYPTION_FAILED: "CCE_RESPONSE_ENCRYPTION_FAILED";
|
|
977
|
+
};
|
|
978
|
+
type CceErrorCode = (typeof CCE_ERROR)[keyof typeof CCE_ERROR];
|
|
979
|
+
declare class CceError extends Error {
|
|
980
|
+
readonly code: CceErrorCode;
|
|
981
|
+
readonly metadata?: Record<string, unknown> | undefined;
|
|
982
|
+
constructor(code: CceErrorCode, message: string, metadata?: Record<string, unknown> | undefined);
|
|
983
|
+
get clientSafe(): boolean;
|
|
984
|
+
toClientError(): {
|
|
985
|
+
code: CceErrorCode;
|
|
986
|
+
message: string;
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
interface CceClientKeyEncryptor {
|
|
991
|
+
wrapKey(aesKey: Uint8Array, clientKid: string, clientPublicKeyHex: string): Promise<CceEncryptedKey>;
|
|
992
|
+
}
|
|
993
|
+
interface CceAxisSigner {
|
|
994
|
+
sign(payload: Uint8Array): Promise<CceSignature>;
|
|
995
|
+
}
|
|
996
|
+
interface CceResponseOptions {
|
|
997
|
+
request: CceRequestEnvelope;
|
|
998
|
+
capsule: CceCapsuleClaims;
|
|
999
|
+
status: CceResponseStatus;
|
|
1000
|
+
body: Uint8Array;
|
|
1001
|
+
clientPublicKeyHex: string;
|
|
1002
|
+
witnessRef?: string;
|
|
1003
|
+
}
|
|
1004
|
+
declare function buildCceResponse(options: CceResponseOptions, clientKeyEncryptor: CceClientKeyEncryptor, axisSigner: CceAxisSigner): Promise<{
|
|
1005
|
+
envelope: CceResponseEnvelope;
|
|
1006
|
+
responsePayloadHash: string;
|
|
1007
|
+
}>;
|
|
1008
|
+
declare function buildCceErrorResponse(requestId: string, correlationId: string, status: CceResponseStatus, errorCode: string, message: string): {
|
|
1009
|
+
ver: string;
|
|
1010
|
+
request_id: string;
|
|
1011
|
+
correlation_id: string;
|
|
1012
|
+
status: CceResponseStatus;
|
|
1013
|
+
error: {
|
|
1014
|
+
code: string;
|
|
1015
|
+
message: string;
|
|
1016
|
+
};
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
interface CceWitnessStore {
|
|
1020
|
+
record(witness: CceWitnessRecord): Promise<void>;
|
|
1021
|
+
}
|
|
1022
|
+
declare class InMemoryCceWitnessStore implements CceWitnessStore {
|
|
1023
|
+
readonly records: CceWitnessRecord[];
|
|
1024
|
+
record(witness: CceWitnessRecord): Promise<void>;
|
|
1025
|
+
getByRequestId(requestId: string): CceWitnessRecord | undefined;
|
|
1026
|
+
getByCapsuleId(capsuleId: string): CceWitnessRecord[];
|
|
1027
|
+
}
|
|
1028
|
+
interface CceVerificationState {
|
|
1029
|
+
clientSigVerified: boolean;
|
|
1030
|
+
capsuleSigVerified: boolean;
|
|
1031
|
+
tpsValid: boolean;
|
|
1032
|
+
audienceMatch: boolean;
|
|
1033
|
+
intentMatch: boolean;
|
|
1034
|
+
replayClean: boolean;
|
|
1035
|
+
nonceUnique: boolean;
|
|
1036
|
+
decryptionOk: boolean;
|
|
1037
|
+
}
|
|
1038
|
+
declare function buildWitnessRecord(envelope: CceRequestEnvelope, capsule: CceCapsuleClaims, verification: CceVerificationState, execution: {
|
|
1039
|
+
status: CceResponseStatus;
|
|
1040
|
+
handlerDurationMs: number;
|
|
1041
|
+
effect?: string;
|
|
1042
|
+
}, options: {
|
|
1043
|
+
axisLocalSecret: string;
|
|
1044
|
+
requestPayload?: Uint8Array;
|
|
1045
|
+
responsePayload?: Uint8Array;
|
|
1046
|
+
responseEncrypted: boolean;
|
|
1047
|
+
}): CceWitnessRecord;
|
|
1048
|
+
declare function extractVerificationState(metadata: Record<string, any>): CceVerificationState;
|
|
1049
|
+
|
|
1050
|
+
type AxisAlg$1 = 'EdDSA' | 'ES256' | 'RS256';
|
|
1051
|
+
type CapsuleStatus = 'ACTIVE' | 'CONSUMED' | 'REVOKED' | 'EXPIRED';
|
|
1052
|
+
type CapsuleMode = 'SINGLE_USE' | 'MULTI_USE';
|
|
1053
|
+
type KeyStatus = 'ACTIVE' | 'GRACE' | 'REVOKED' | 'RETIRED';
|
|
1054
|
+
interface AxisSig$1 {
|
|
1055
|
+
alg: AxisAlg$1;
|
|
1056
|
+
kid: string;
|
|
1057
|
+
value: string;
|
|
1058
|
+
}
|
|
1059
|
+
interface AxisPacket$1<T = any> {
|
|
1060
|
+
v: 1;
|
|
1061
|
+
pid: string;
|
|
1062
|
+
nonce: string;
|
|
1063
|
+
ts: number;
|
|
1064
|
+
actorId: string;
|
|
1065
|
+
opcode: string;
|
|
1066
|
+
body: T;
|
|
1067
|
+
sig: AxisSig$1;
|
|
1068
|
+
}
|
|
1069
|
+
interface AxisCapsuleConstraints {
|
|
1070
|
+
maxAmount?: number;
|
|
1071
|
+
maxCount?: number;
|
|
1072
|
+
ttlSeconds?: number;
|
|
1073
|
+
ipCidrAllow?: string[];
|
|
1074
|
+
countryAllow?: string[];
|
|
1075
|
+
deviceIdAllow?: string[];
|
|
1076
|
+
sessionIdLock?: string;
|
|
1077
|
+
nonceRequired?: boolean;
|
|
1078
|
+
}
|
|
1079
|
+
interface TickWindow {
|
|
1080
|
+
start: number;
|
|
1081
|
+
end: number;
|
|
1082
|
+
}
|
|
1083
|
+
interface AxisCapsulePayload {
|
|
1084
|
+
v: 1;
|
|
1085
|
+
capsuleId: string;
|
|
1086
|
+
actorId: string;
|
|
1087
|
+
issuer: string;
|
|
1088
|
+
audience: string;
|
|
1089
|
+
subject?: string;
|
|
1090
|
+
intent: string;
|
|
1091
|
+
scopes: string[];
|
|
1092
|
+
actions?: string[];
|
|
1093
|
+
iat: number;
|
|
1094
|
+
nbf?: number;
|
|
1095
|
+
exp: number;
|
|
1096
|
+
tickWindow?: TickWindow;
|
|
1097
|
+
mode: CapsuleMode;
|
|
1098
|
+
maxUses: number;
|
|
1099
|
+
nonceSeed?: string;
|
|
1100
|
+
policyRefs?: string[];
|
|
1101
|
+
riskScore?: number;
|
|
1102
|
+
constraints?: AxisCapsuleConstraints;
|
|
1103
|
+
meta?: Record<string, unknown>;
|
|
1104
|
+
}
|
|
1105
|
+
interface AxisCapsule {
|
|
1106
|
+
payload: AxisCapsulePayload;
|
|
1107
|
+
sig: AxisSig$1;
|
|
1108
|
+
}
|
|
1109
|
+
interface CapsuleIssueBody {
|
|
1110
|
+
intent: string;
|
|
1111
|
+
audience: string;
|
|
1112
|
+
scopes: string[];
|
|
1113
|
+
subject?: string;
|
|
1114
|
+
mode: CapsuleMode;
|
|
1115
|
+
maxUses?: number;
|
|
1116
|
+
expSeconds?: number;
|
|
1117
|
+
constraints?: AxisCapsuleConstraints;
|
|
1118
|
+
hints?: {
|
|
1119
|
+
ip?: string;
|
|
1120
|
+
ua?: string;
|
|
1121
|
+
deviceId?: string;
|
|
1122
|
+
geo?: string;
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
interface CapsuleBatchBody extends Omit<CapsuleIssueBody, 'mode' | 'maxUses'> {
|
|
1126
|
+
count: number;
|
|
1127
|
+
mode: 'SINGLE_USE';
|
|
1128
|
+
}
|
|
1129
|
+
interface IntentExecBody {
|
|
1130
|
+
intent: string;
|
|
1131
|
+
capsule: AxisCapsule;
|
|
1132
|
+
execNonce?: string;
|
|
1133
|
+
args: Record<string, any>;
|
|
1134
|
+
}
|
|
1135
|
+
interface CapsuleRevokeBody {
|
|
1136
|
+
capsuleId: string;
|
|
1137
|
+
reason: string;
|
|
1138
|
+
}
|
|
1139
|
+
interface AxisResponse$1<T = any> {
|
|
1140
|
+
ok: boolean;
|
|
1141
|
+
pid: string;
|
|
1142
|
+
decisionId: string;
|
|
1143
|
+
code: string;
|
|
1144
|
+
message?: string;
|
|
1145
|
+
data?: T;
|
|
1146
|
+
meta?: Record<string, unknown>;
|
|
1147
|
+
}
|
|
1148
|
+
interface CapsuleIssueResult {
|
|
1149
|
+
capsule: AxisCapsule;
|
|
1150
|
+
}
|
|
1151
|
+
interface CapsuleBatchResult {
|
|
1152
|
+
capsules: AxisCapsule[];
|
|
1153
|
+
}
|
|
1154
|
+
interface ActorKeyRecord {
|
|
1155
|
+
id: Buffer;
|
|
1156
|
+
actor_id: string;
|
|
1157
|
+
key_id: string;
|
|
1158
|
+
algorithm: string;
|
|
1159
|
+
public_key: Buffer;
|
|
1160
|
+
purpose: string;
|
|
1161
|
+
status: KeyStatus;
|
|
1162
|
+
is_primary: boolean;
|
|
1163
|
+
not_before: Date | null;
|
|
1164
|
+
expires_at: Date | null;
|
|
1165
|
+
rotated_from_key_id: string | null;
|
|
1166
|
+
revoked_at: Date | null;
|
|
1167
|
+
revocation_reason: string | null;
|
|
1168
|
+
metadata: any;
|
|
1169
|
+
created_at: Date;
|
|
1170
|
+
updated_at: Date;
|
|
1171
|
+
}
|
|
1172
|
+
interface IssuerKeyRecord {
|
|
1173
|
+
id: Buffer;
|
|
1174
|
+
kid: string;
|
|
1175
|
+
issuer_id: string;
|
|
1176
|
+
alg: string;
|
|
1177
|
+
public_key_pem: string;
|
|
1178
|
+
status: KeyStatus;
|
|
1179
|
+
not_before: Date | null;
|
|
1180
|
+
not_after: Date | null;
|
|
1181
|
+
fingerprint: string | null;
|
|
1182
|
+
metadata: any;
|
|
1183
|
+
created_at: Date;
|
|
1184
|
+
updated_at: Date;
|
|
1185
|
+
}
|
|
1186
|
+
interface CapsuleRecord {
|
|
1187
|
+
id: Buffer;
|
|
1188
|
+
capsule_id: string;
|
|
1189
|
+
actor_id: string;
|
|
1190
|
+
intent: string;
|
|
1191
|
+
audience: string;
|
|
1192
|
+
issuer: string;
|
|
1193
|
+
subject: string | null;
|
|
1194
|
+
status: CapsuleStatus;
|
|
1195
|
+
mode: CapsuleMode;
|
|
1196
|
+
max_uses: number;
|
|
1197
|
+
used_count: number;
|
|
1198
|
+
iat: Date;
|
|
1199
|
+
nbf: Date | null;
|
|
1200
|
+
exp: Date;
|
|
1201
|
+
scopes_json: any;
|
|
1202
|
+
constraints_json: any;
|
|
1203
|
+
policy_refs_json: any;
|
|
1204
|
+
risk_score: number | null;
|
|
1205
|
+
payload_hash: Buffer;
|
|
1206
|
+
sig_alg: string;
|
|
1207
|
+
sig_kid: string;
|
|
1208
|
+
sig_value: Buffer;
|
|
1209
|
+
created_at: Date;
|
|
1210
|
+
updated_at: Date;
|
|
1211
|
+
last_used_at: Date | null;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
type AxisAlg = Extract<AxisAlg$1, 'EdDSA'>;
|
|
1215
|
+
type AxisSig = AxisSig$1 & {
|
|
1216
|
+
alg: AxisAlg;
|
|
1217
|
+
};
|
|
1218
|
+
interface AxisFrame$1<T = any> {
|
|
1219
|
+
v: 1;
|
|
1220
|
+
pid: string;
|
|
1221
|
+
nonce: string;
|
|
1222
|
+
ts: number;
|
|
1223
|
+
actorId: string;
|
|
1224
|
+
aud?: string;
|
|
1225
|
+
opcode: string;
|
|
1226
|
+
headers: Map<number, Uint8Array>;
|
|
1227
|
+
body: T;
|
|
1228
|
+
sig: AxisSig;
|
|
1229
|
+
}
|
|
1230
|
+
type AxisResponse<T = any> = AxisResponse$1<T> & {
|
|
1231
|
+
policyRefs?: string[];
|
|
1232
|
+
riskScore?: number;
|
|
1233
|
+
};
|
|
1234
|
+
interface AxisObservedContext {
|
|
1235
|
+
ip?: string;
|
|
1236
|
+
ua?: string;
|
|
1237
|
+
geo?: string;
|
|
1238
|
+
}
|
|
1239
|
+
interface AxisRequestContext {
|
|
1240
|
+
observed: AxisObservedContext;
|
|
1241
|
+
actorKeyKid?: string;
|
|
1242
|
+
issuerKeyKid?: string;
|
|
1243
|
+
decisionId: string;
|
|
1244
|
+
actorId: string;
|
|
1245
|
+
aud?: string;
|
|
1246
|
+
opcode: string;
|
|
1247
|
+
deviceId?: string;
|
|
1248
|
+
sessionId?: string;
|
|
1333
1249
|
}
|
|
1334
|
-
declare const AxisContextZ: z.ZodObject<{
|
|
1335
|
-
pid: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
1336
|
-
ts: z.ZodBigInt;
|
|
1337
|
-
intent: z.ZodString;
|
|
1338
|
-
actorId: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
1339
|
-
proofType: z.ZodEnum<typeof ProofType$1>;
|
|
1340
|
-
proofRef: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
1341
|
-
nonce: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
1342
|
-
ip: z.ZodString;
|
|
1343
|
-
nodeCertHash: z.ZodOptional<z.ZodString>;
|
|
1344
|
-
capsule: z.ZodOptional<z.ZodObject<{
|
|
1345
|
-
id: z.ZodString;
|
|
1346
|
-
claims: z.ZodObject<{
|
|
1347
|
-
capsuleId: z.ZodString;
|
|
1348
|
-
allowIntents: z.ZodArray<z.ZodString>;
|
|
1349
|
-
limits: z.ZodOptional<z.ZodObject<{
|
|
1350
|
-
maxBodyBytes: z.ZodOptional<z.ZodNumber>;
|
|
1351
|
-
}, z.z.core.$strip>>;
|
|
1352
|
-
scopes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1353
|
-
}, z.z.core.$strip>;
|
|
1354
|
-
issuedAt: z.ZodNumber;
|
|
1355
|
-
expiresAt: z.ZodNumber;
|
|
1356
|
-
tier: z.ZodEnum<{
|
|
1357
|
-
FREE: "FREE";
|
|
1358
|
-
STANDARD: "STANDARD";
|
|
1359
|
-
PREMIUM: "PREMIUM";
|
|
1360
|
-
}>;
|
|
1361
|
-
}, z.z.core.$strip>>;
|
|
1362
|
-
passport: z.ZodOptional<z.ZodObject<{
|
|
1363
|
-
id: z.ZodString;
|
|
1364
|
-
public_key: z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
1365
|
-
status: z.ZodEnum<{
|
|
1366
|
-
ACTIVE: "ACTIVE";
|
|
1367
|
-
REVOKED: "REVOKED";
|
|
1368
|
-
EXPIRED: "EXPIRED";
|
|
1369
|
-
PENDING: "PENDING";
|
|
1370
|
-
}>;
|
|
1371
|
-
issuedAt: z.ZodNumber;
|
|
1372
|
-
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1373
|
-
}, z.z.core.$strip>>;
|
|
1374
|
-
meter: z.ZodOptional<z.ZodAny>;
|
|
1375
|
-
}, z.z.core.$strip>;
|
|
1376
|
-
type AxisContext$1 = z.infer<typeof AxisContextZ>;
|
|
1377
|
-
declare const AxisErrorZ: z.ZodObject<{
|
|
1378
|
-
code: z.ZodString;
|
|
1379
|
-
message: z.ZodString;
|
|
1380
|
-
httpStatus: z.ZodNumber;
|
|
1381
|
-
}, z.z.core.$strip>;
|
|
1382
|
-
type AxisError = z.infer<typeof AxisErrorZ>;
|
|
1383
1250
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
declare function RequiredProof(proofs: [RequiredProofKind, ...RequiredProofKind[]]): ClassDecorator & MethodDecorator;
|
|
1391
|
-
declare function Capsule(): ClassDecorator & MethodDecorator;
|
|
1392
|
-
declare function Witness(): ClassDecorator & MethodDecorator;
|
|
1393
|
-
declare const AXIS_PUBLIC_KEY = "axis:public";
|
|
1394
|
-
declare function AxisPublic(): ClassDecorator & MethodDecorator;
|
|
1395
|
-
declare const AXIS_ANONYMOUS_KEY = "axis:anonymous";
|
|
1396
|
-
declare function AxisAnonymous(): ClassDecorator & MethodDecorator;
|
|
1397
|
-
declare const AXIS_RATE_LIMIT_KEY = "axis:rateLimit";
|
|
1398
|
-
interface AxisRateLimitConfig {
|
|
1399
|
-
max: number;
|
|
1400
|
-
windowSec: number;
|
|
1401
|
-
key?: string;
|
|
1251
|
+
interface SensorPhaseMetadata {
|
|
1252
|
+
phase: 'PRE_DECODE' | 'POST_DECODE';
|
|
1253
|
+
dependencies?: string[];
|
|
1254
|
+
asyncOk?: boolean;
|
|
1255
|
+
cryptoOk?: boolean;
|
|
1256
|
+
description?: string;
|
|
1402
1257
|
}
|
|
1403
|
-
|
|
1258
|
+
interface AxisSensor {
|
|
1259
|
+
readonly name: string;
|
|
1260
|
+
readonly order?: number;
|
|
1261
|
+
phase?: SensorPhaseMetadata | 'PRE_DECODE' | 'POST_DECODE';
|
|
1262
|
+
supports?(input: SensorInput): boolean;
|
|
1263
|
+
run(input: SensorInput): Promise<SensorDecision>;
|
|
1264
|
+
}
|
|
1265
|
+
interface AxisSensorInit extends AxisSensor {
|
|
1266
|
+
onModuleInit?(): void | Promise<void>;
|
|
1267
|
+
}
|
|
1268
|
+
interface AxisPreSensor extends AxisSensor {
|
|
1269
|
+
phase: 'PRE_DECODE';
|
|
1270
|
+
}
|
|
1271
|
+
interface AxisPostSensor extends AxisSensor {
|
|
1272
|
+
phase: 'POST_DECODE';
|
|
1273
|
+
}
|
|
1274
|
+
interface SensorInput {
|
|
1275
|
+
rawBytes?: Buffer | Uint8Array;
|
|
1276
|
+
intent?: string;
|
|
1277
|
+
ip?: string;
|
|
1278
|
+
path?: string;
|
|
1279
|
+
contentLength?: number;
|
|
1280
|
+
peek?: Uint8Array;
|
|
1281
|
+
country?: string;
|
|
1282
|
+
clientId?: string;
|
|
1283
|
+
isWs?: boolean;
|
|
1284
|
+
metadata?: Record<string, any>;
|
|
1285
|
+
actorId?: string;
|
|
1286
|
+
opcode?: string;
|
|
1287
|
+
aud?: string;
|
|
1288
|
+
observed?: AxisObservedContext;
|
|
1289
|
+
frameBody?: any;
|
|
1290
|
+
deviceId?: string;
|
|
1291
|
+
sessionId?: string;
|
|
1292
|
+
packet?: Record<string, any>;
|
|
1293
|
+
[key: string]: any;
|
|
1294
|
+
}
|
|
1295
|
+
declare enum Decision {
|
|
1296
|
+
ALLOW = "ALLOW",
|
|
1297
|
+
DENY = "DENY",
|
|
1298
|
+
THROTTLE = "THROTTLE",
|
|
1299
|
+
FLAG = "FLAG"
|
|
1300
|
+
}
|
|
1301
|
+
type SensorDecision = {
|
|
1302
|
+
decision?: Decision;
|
|
1303
|
+
allow: boolean;
|
|
1304
|
+
riskScore: number;
|
|
1305
|
+
reasons: string[];
|
|
1306
|
+
code?: string;
|
|
1307
|
+
retryAfterMs?: number;
|
|
1308
|
+
scoreDelta?: number;
|
|
1309
|
+
tags?: Record<string, any>;
|
|
1310
|
+
meta?: any;
|
|
1311
|
+
tighten?: {
|
|
1312
|
+
expSecondsMax?: number;
|
|
1313
|
+
constraintsPatch?: Record<string, any>;
|
|
1314
|
+
};
|
|
1315
|
+
} | {
|
|
1316
|
+
action: 'ALLOW';
|
|
1317
|
+
meta?: any;
|
|
1318
|
+
} | {
|
|
1319
|
+
action: 'DENY';
|
|
1320
|
+
code: string;
|
|
1321
|
+
reason?: string;
|
|
1322
|
+
retryAfterMs?: number;
|
|
1323
|
+
meta?: any;
|
|
1324
|
+
} | {
|
|
1325
|
+
action: 'THROTTLE';
|
|
1326
|
+
retryAfterMs: number;
|
|
1327
|
+
meta?: any;
|
|
1328
|
+
} | {
|
|
1329
|
+
action: 'FLAG';
|
|
1330
|
+
scoreDelta: number;
|
|
1331
|
+
reasons: string[];
|
|
1332
|
+
meta?: any;
|
|
1333
|
+
};
|
|
1334
|
+
type SensorMinifiedDecision = {
|
|
1335
|
+
allow: boolean;
|
|
1336
|
+
riskScore: number;
|
|
1337
|
+
reasons: string[];
|
|
1338
|
+
tags?: Record<string, any>;
|
|
1339
|
+
meta?: any;
|
|
1340
|
+
tighten?: {
|
|
1341
|
+
expSecondsMax?: number;
|
|
1342
|
+
constraintsPatch?: Record<string, any>;
|
|
1343
|
+
};
|
|
1344
|
+
retryAfterMs?: number;
|
|
1345
|
+
};
|
|
1346
|
+
declare function normalizeSensorDecision(sensorDecision: SensorDecision): SensorMinifiedDecision;
|
|
1347
|
+
declare const SensorDecisions: {
|
|
1348
|
+
allow(meta?: any, tags?: Record<string, any>): SensorDecision;
|
|
1349
|
+
deny(code: string, reason?: string, meta?: any): SensorDecision;
|
|
1350
|
+
throttle(retryAfterMs: number, meta?: any): SensorDecision;
|
|
1351
|
+
flag(scoreDelta: number, reasons: string[], meta?: any): SensorDecision;
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
type CceHandler = (payload: Uint8Array, context: CceHandlerContext) => Promise<CceHandlerResult>;
|
|
1355
|
+
interface CceHandlerContext {
|
|
1356
|
+
capsule: CceCapsuleClaims;
|
|
1357
|
+
executionContext: CceExecutionContext;
|
|
1358
|
+
envelope: CceRequestEnvelope;
|
|
1359
|
+
clientPublicKeyHex: string;
|
|
1360
|
+
intent: string;
|
|
1361
|
+
sub: string;
|
|
1362
|
+
}
|
|
1363
|
+
interface CceHandlerResult {
|
|
1364
|
+
status: CceResponseStatus;
|
|
1365
|
+
body: Uint8Array;
|
|
1366
|
+
effect?: string;
|
|
1367
|
+
}
|
|
1368
|
+
interface CcePolicyContext {
|
|
1369
|
+
envelope: CceRequestEnvelope;
|
|
1370
|
+
capsule: CceCapsuleClaims;
|
|
1371
|
+
executionContext: CceExecutionContext;
|
|
1372
|
+
decryptedPayload: Uint8Array;
|
|
1373
|
+
clientPublicKeyHex: string;
|
|
1374
|
+
}
|
|
1375
|
+
interface CcePolicyDecision {
|
|
1376
|
+
allow: boolean;
|
|
1377
|
+
code?: string;
|
|
1378
|
+
message?: string;
|
|
1379
|
+
}
|
|
1380
|
+
interface CcePolicyEvaluator {
|
|
1381
|
+
evaluate(context: CcePolicyContext): Promise<CcePolicyDecision>;
|
|
1382
|
+
}
|
|
1383
|
+
interface CcePipelineConfig {
|
|
1384
|
+
axisLocalSecret: string;
|
|
1385
|
+
axisAudience: string;
|
|
1386
|
+
sensors: AxisSensor[];
|
|
1387
|
+
handlers: Map<string, CceHandler>;
|
|
1388
|
+
witnessStore: CceWitnessStore;
|
|
1389
|
+
clientKeyEncryptor: CceClientKeyEncryptor;
|
|
1390
|
+
axisSigner: CceAxisSigner;
|
|
1391
|
+
policyEvaluator?: CcePolicyEvaluator;
|
|
1392
|
+
}
|
|
1393
|
+
type CcePipelineResult = {
|
|
1394
|
+
ok: true;
|
|
1395
|
+
response: CceResponseEnvelope;
|
|
1396
|
+
witnessId: string;
|
|
1397
|
+
} | {
|
|
1398
|
+
ok: false;
|
|
1399
|
+
error: {
|
|
1400
|
+
code: string;
|
|
1401
|
+
message: string;
|
|
1402
|
+
};
|
|
1403
|
+
status: CceResponseStatus;
|
|
1404
|
+
};
|
|
1405
|
+
declare function executeCcePipeline(envelope: CceRequestEnvelope, config: CcePipelineConfig): Promise<CcePipelineResult>;
|
|
1404
1406
|
|
|
1405
1407
|
interface IntentSchema {
|
|
1406
1408
|
intent: string;
|
|
@@ -2774,8 +2776,10 @@ declare namespace index$8 {
|
|
|
2774
2776
|
}
|
|
2775
2777
|
|
|
2776
2778
|
declare const index$7_AXIS_ANONYMOUS_KEY: typeof AXIS_ANONYMOUS_KEY;
|
|
2779
|
+
declare const index$7_AXIS_META_KEY: typeof AXIS_META_KEY;
|
|
2777
2780
|
declare const index$7_AXIS_PUBLIC_KEY: typeof AXIS_PUBLIC_KEY;
|
|
2778
2781
|
declare const index$7_AXIS_RATE_LIMIT_KEY: typeof AXIS_RATE_LIMIT_KEY;
|
|
2782
|
+
declare const index$7_Axis: typeof Axis;
|
|
2779
2783
|
declare const index$7_AxisAnonymous: typeof AxisAnonymous;
|
|
2780
2784
|
declare const index$7_AxisContext: typeof AxisContext;
|
|
2781
2785
|
declare const index$7_AxisDemoPubkey: typeof AxisDemoPubkey;
|
|
@@ -2844,7 +2848,7 @@ declare const index$7_extractDtoSchema: typeof extractDtoSchema;
|
|
|
2844
2848
|
declare const index$7_mergeCapsulePolicyOptions: typeof mergeCapsulePolicyOptions;
|
|
2845
2849
|
declare const index$7_normalizeCapsulePolicyOptions: typeof normalizeCapsulePolicyOptions;
|
|
2846
2850
|
declare namespace index$7 {
|
|
2847
|
-
export { index$7_AXIS_ANONYMOUS_KEY as AXIS_ANONYMOUS_KEY, index$7_AXIS_PUBLIC_KEY as AXIS_PUBLIC_KEY, index$7_AXIS_RATE_LIMIT_KEY as AXIS_RATE_LIMIT_KEY, index$7_AxisAnonymous as AxisAnonymous, index$7_AxisContext as AxisContext, index$7_AxisDemoPubkey as AxisDemoPubkey, index$7_AxisFrame as AxisFrame, index$7_AxisIp as AxisIp, type index$7_AxisObserverBinding as AxisObserverBinding, type index$7_AxisObserverBindingOptions as AxisObserverBindingOptions, type index$7_AxisObserverDefinition as AxisObserverDefinition, type index$7_AxisObserverRef as AxisObserverRef, index$7_AxisPublic as AxisPublic, index$7_AxisRateLimit as AxisRateLimit, type index$7_AxisRateLimitConfig as AxisRateLimitConfig, index$7_AxisRaw as AxisRaw, type index$7_AxisRequestData as AxisRequestData, index$7_CAPSULE_POLICY_METADATA_KEY as CAPSULE_POLICY_METADATA_KEY, index$7_CHAIN_METADATA_KEY as CHAIN_METADATA_KEY, index$7_CONTRACT_METADATA_KEY as CONTRACT_METADATA_KEY, index$7_Capsule as Capsule, index$7_CapsulePolicy as CapsulePolicy, type index$7_CapsulePolicyOptions as CapsulePolicyOptions, type index$7_CapsuleScopeMode as CapsuleScopeMode, index$7_Chain as Chain, index$7_Contract as Contract, type index$7_DtoSchema as DtoSchema, index$7_HANDLER_METADATA_KEY as HANDLER_METADATA_KEY, index$7_Handler as Handler, index$7_INTENT_BODY_KEY as INTENT_BODY_KEY, index$7_INTENT_METADATA_KEY as INTENT_METADATA_KEY, index$7_INTENT_ROUTES_KEY as INTENT_ROUTES_KEY, index$7_INTENT_SENSORS_KEY as INTENT_SENSORS_KEY, index$7_Intent as Intent, index$7_IntentBody as IntentBody, type index$7_IntentKind as IntentKind, type index$7_IntentOptions as IntentOptions, type index$7_IntentRoute as IntentRoute, index$7_IntentSensors as IntentSensors, type index$7_IntentTlvField as IntentTlvField, index$7_OBSERVER_BINDINGS_KEY as OBSERVER_BINDINGS_KEY, index$7_OBSERVER_METADATA_KEY as OBSERVER_METADATA_KEY, index$7_Observer as Observer, index$7_REQUIRED_PROOF_METADATA_KEY as REQUIRED_PROOF_METADATA_KEY, index$7_RequiredProof as RequiredProof, type index$7_RequiredProofKind as RequiredProofKind, index$7_SENSITIVITY_METADATA_KEY as SENSITIVITY_METADATA_KEY, index$7_SENSOR_METADATA_KEY as SENSOR_METADATA_KEY, index$7_Sensitivity as Sensitivity, index$7_Sensor as Sensor, type index$7_SensorOptions as SensorOptions, type index$7_SensorPhase as SensorPhase, index$7_TLV_FIELDS_KEY as TLV_FIELDS_KEY, index$7_TLV_VALIDATORS_KEY as TLV_VALIDATORS_KEY, index$7_TlvEnum as TlvEnum, index$7_TlvField as TlvField, type index$7_TlvFieldKind as TlvFieldKind, type index$7_TlvFieldMeta as TlvFieldMeta, type index$7_TlvFieldOptions as TlvFieldOptions, index$7_TlvMinLen as TlvMinLen, index$7_TlvRange as TlvRange, index$7_TlvUtf8Pattern as TlvUtf8Pattern, index$7_TlvValidate as TlvValidate, type index$7_TlvValidatorFn as TlvValidatorFn, type index$7_TlvValidatorMeta as TlvValidatorMeta, index$7_Witness as Witness, index$7_buildDtoDecoder as buildDtoDecoder, index$7_extractDtoSchema as extractDtoSchema, index$7_mergeCapsulePolicyOptions as mergeCapsulePolicyOptions, index$7_normalizeCapsulePolicyOptions as normalizeCapsulePolicyOptions };
|
|
2851
|
+
export { index$7_AXIS_ANONYMOUS_KEY as AXIS_ANONYMOUS_KEY, index$7_AXIS_META_KEY as AXIS_META_KEY, index$7_AXIS_PUBLIC_KEY as AXIS_PUBLIC_KEY, index$7_AXIS_RATE_LIMIT_KEY as AXIS_RATE_LIMIT_KEY, index$7_Axis as Axis, index$7_AxisAnonymous as AxisAnonymous, index$7_AxisContext as AxisContext, index$7_AxisDemoPubkey as AxisDemoPubkey, index$7_AxisFrame as AxisFrame, index$7_AxisIp as AxisIp, type index$7_AxisObserverBinding as AxisObserverBinding, type index$7_AxisObserverBindingOptions as AxisObserverBindingOptions, type index$7_AxisObserverDefinition as AxisObserverDefinition, type index$7_AxisObserverRef as AxisObserverRef, index$7_AxisPublic as AxisPublic, index$7_AxisRateLimit as AxisRateLimit, type index$7_AxisRateLimitConfig as AxisRateLimitConfig, index$7_AxisRaw as AxisRaw, type index$7_AxisRequestData as AxisRequestData, index$7_CAPSULE_POLICY_METADATA_KEY as CAPSULE_POLICY_METADATA_KEY, index$7_CHAIN_METADATA_KEY as CHAIN_METADATA_KEY, index$7_CONTRACT_METADATA_KEY as CONTRACT_METADATA_KEY, index$7_Capsule as Capsule, index$7_CapsulePolicy as CapsulePolicy, type index$7_CapsulePolicyOptions as CapsulePolicyOptions, type index$7_CapsuleScopeMode as CapsuleScopeMode, index$7_Chain as Chain, index$7_Contract as Contract, type index$7_DtoSchema as DtoSchema, index$7_HANDLER_METADATA_KEY as HANDLER_METADATA_KEY, index$7_Handler as Handler, index$7_INTENT_BODY_KEY as INTENT_BODY_KEY, index$7_INTENT_METADATA_KEY as INTENT_METADATA_KEY, index$7_INTENT_ROUTES_KEY as INTENT_ROUTES_KEY, index$7_INTENT_SENSORS_KEY as INTENT_SENSORS_KEY, index$7_Intent as Intent, index$7_IntentBody as IntentBody, type index$7_IntentKind as IntentKind, type index$7_IntentOptions as IntentOptions, type index$7_IntentRoute as IntentRoute, index$7_IntentSensors as IntentSensors, type index$7_IntentTlvField as IntentTlvField, index$7_OBSERVER_BINDINGS_KEY as OBSERVER_BINDINGS_KEY, index$7_OBSERVER_METADATA_KEY as OBSERVER_METADATA_KEY, index$7_Observer as Observer, index$7_REQUIRED_PROOF_METADATA_KEY as REQUIRED_PROOF_METADATA_KEY, index$7_RequiredProof as RequiredProof, type index$7_RequiredProofKind as RequiredProofKind, index$7_SENSITIVITY_METADATA_KEY as SENSITIVITY_METADATA_KEY, index$7_SENSOR_METADATA_KEY as SENSOR_METADATA_KEY, index$7_Sensitivity as Sensitivity, index$7_Sensor as Sensor, type index$7_SensorOptions as SensorOptions, type index$7_SensorPhase as SensorPhase, index$7_TLV_FIELDS_KEY as TLV_FIELDS_KEY, index$7_TLV_VALIDATORS_KEY as TLV_VALIDATORS_KEY, index$7_TlvEnum as TlvEnum, index$7_TlvField as TlvField, type index$7_TlvFieldKind as TlvFieldKind, type index$7_TlvFieldMeta as TlvFieldMeta, type index$7_TlvFieldOptions as TlvFieldOptions, index$7_TlvMinLen as TlvMinLen, index$7_TlvRange as TlvRange, index$7_TlvUtf8Pattern as TlvUtf8Pattern, index$7_TlvValidate as TlvValidate, type index$7_TlvValidatorFn as TlvValidatorFn, type index$7_TlvValidatorMeta as TlvValidatorMeta, index$7_Witness as Witness, index$7_buildDtoDecoder as buildDtoDecoder, index$7_extractDtoSchema as extractDtoSchema, index$7_mergeCapsulePolicyOptions as mergeCapsulePolicyOptions, index$7_normalizeCapsulePolicyOptions as normalizeCapsulePolicyOptions };
|
|
2848
2852
|
}
|
|
2849
2853
|
|
|
2850
2854
|
type index$6_ObservationQueueConfig = ObservationQueueConfig;
|
|
@@ -3317,4 +3321,4 @@ declare namespace index {
|
|
|
3317
3321
|
export { index_encodeAxisTlvDto as encodeAxisTlvDto };
|
|
3318
3322
|
}
|
|
3319
3323
|
|
|
3320
|
-
export { ATS1_HDR, ATS1_SCHEMA, AXIS_EXECUTION_CONTEXT_KEY, AXIS_OPCODES, AXIS_UPLOAD_FILE_STORE, AXIS_UPLOAD_RECEIPT_SIGNER, AXIS_UPLOAD_SESSION_STORE, ats1 as Ats1Codec, type Axis1DecodedFrame, type Axis1FrameToEncode, type AxisAlg$1 as AxisAlg, type AxisPacket as AxisBinaryPacket, type AxisCapsule, type AxisCapsuleConstraints, type AxisCapsulePayload, type AxisCapsuleRef, type AxisChainEncryption, type AxisChainEnvelope, AxisChainExecutor, type AxisChainRequest, type AxisChainResult, type AxisChainStatus, type AxisChainStep, type AxisChainStepResult, type AxisChainStepStatus, AxisContext, type AxisCrudHandler, type AxisDecoded, AxisDemoPubkey, type AxisEffect, type AxisExecutionContext, type AxisExecutionMode, AxisFilesDownloadHandler, AxisFilesFinalizeHandler, AxisFrame$2 as AxisFrame, type AxisHandler, type AxisHandlerInit, AxisIdDto, type AxisIntentEnvelope, type AxisIntentObserver, AxisIp, type AxisAlg as AxisJsonAlg, type AxisFrame$1 as AxisJsonFrame, type AxisResponse as AxisJsonResponse, type AxisSig as AxisJsonSig, type AxisKeyExchangeRef, type AxisObservation, type AxisObservedContext, type AxisObserverBinding, type AxisObserverBindingOptions, type AxisObserverContext, type AxisObserverDefinition, type AxisObserverEvent, type AxisObserverRef, type AxisObserverRegistration, type AxisPacket$1 as AxisPacket, T as AxisPacketTags, AxisPartialType, type AxisPostSensor, type AxisPreSensor, AxisRaw, type AxisRequestContext, type AxisRequestData, AxisResponseDto, type AxisSensor, AxisSensorChainService, type AxisSensorInit, type AxisSig$1 as AxisSig, AxisTlvDto, BAND, CAPABILITIES, CAPSULE_POLICY_METADATA_KEY, CCE_ERROR, CCE_PROTOCOL_VERSION, CHAIN_METADATA_KEY, type Capability, type CapsuleMode, CapsulePolicy, type CapsulePolicyOptions, type CapsuleScopeMode, type CceCapsuleClaims as CceCapsuleClaimsType, CceError, type CceExecutionContext as CceExecutionContextType, type CceHandler, type CceHandlerContext, type CceHandlerResult, type CcePipelineConfig, type CcePipelineResult, type CcePolicyContext, type CcePolicyDecision, type CcePolicyEvaluator, type CceRequestEnvelope as CceRequestEnvelopeType, type CceResponseEnvelope as CceResponseEnvelopeType, type CceWitnessRecord as CceWitnessRecordType, Chain, type ChainOptions, type ChainResult, ContractViolationError, DEFAULT_CONTRACTS, DEFAULT_TIMEOUT, Decision, DiskUploadFileStore, type DtoSchema, type ExecutionContract, ExecutionMeter, type ExecutionMetrics, FALLBACK_CONTRACT, type Grant, type GrantCapability, type GrantMeta, type GrantStatus, type GrantType, type GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, HandlerDiscoveryService, HandlerSensors, INTENT_BODY_KEY, INTENT_METADATA_KEY, INTENT_REQUIREMENTS, INTENT_ROUTES_KEY, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, Intent, IntentBody, type IntentDefinition, type IntentKind, type IntentOptions, type IntentRoute, IntentRouter, IntentSensitivity, IntentSensors, type IntentTlvField, type KeyStatus, type LoomReceipt, type LoomValidationResult, OBSERVER_BINDINGS_KEY, OBSERVER_METADATA_KEY, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationSensor, type ObservationStage, type ObservationStreamEntry, type ObservationWitnessSummary, Observer, ObserverDiscoveryService, ObserverDispatcherService, ObserverRegistry, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, type PresenceChallenge, type PresenceDeclaration, type PresenceProof, type PresenceReceipt, type PresenceStatus, type PresenceVerifyResult, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, type RegisteredChainConfig, type ResponseContract, ResponseObserver, type ResponseObserverContext, type Revocation, type RevocationTargetType, RiskDecision, type RiskEvaluation, type RiskSignal, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, type SensorDecision, SensorDecisions, SensorDiscoveryService, type SensorInput, type SensorMinifiedDecision, type SensorOptions, type SensorPhase, type SensorPhaseMetadata, SensorRegistry, TLV_FIELDS_KEY, TLV_VALIDATORS_KEY, type ThreadState, TlvEnum, TlvField, type TlvFieldKind, type TlvFieldMeta, type TlvFieldOptions, TlvMinLen, TlvRange, TlvUtf8Pattern, TlvValidate, type TlvValidatorFn, type TlvValidatorMeta, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, type Writ, type WritBody, type WritHead, type WritMeta, type WritSignature, type WritValidationResult, axis1SigningBytes, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeGrant, canonicalizeObservation, canonicalizeWrit, index$9 as cce, classifyIntent, createObservation, index$8 as crypto, decodeAxis1Frame, decodeQueueMessage, index$7 as decorators, deriveAnchorReflection, encVarint, encodeAxis1Frame, encodeAxisTlvDto, encodeQueueMessage, endStage, index$5 as engine, executeCcePipeline, extractDtoSchema, finalizeObservation, getAxisExecutionContext, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isTimestampValid, index$4 as loom, mergeAxisExecutionContext, nonce16, normalizeSensorDecision, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, recordSensor, resolveTimeout, index$3 as schemas, index$2 as security, sensitivityName, index$1 as sensors, stableJsonStringify, startStage, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, utf8, index as utils, validateFrameShape, varintU, verifyResponse, withAxisExecutionContext };
|
|
3324
|
+
export { ATS1_HDR, ATS1_SCHEMA, AXIS_ANONYMOUS_KEY, AXIS_EXECUTION_CONTEXT_KEY, AXIS_META_KEY, AXIS_OPCODES, AXIS_PUBLIC_KEY, AXIS_RATE_LIMIT_KEY, AXIS_UPLOAD_FILE_STORE, AXIS_UPLOAD_RECEIPT_SIGNER, AXIS_UPLOAD_SESSION_STORE, ats1 as Ats1Codec, Axis, type Axis1DecodedFrame, type Axis1FrameToEncode, type AxisAlg$1 as AxisAlg, AxisAnonymous, type AxisPacket as AxisBinaryPacket, type AxisCapsule, type AxisCapsuleConstraints, type AxisCapsulePayload, type AxisCapsuleRef, type AxisChainEncryption, type AxisChainEnvelope, AxisChainExecutor, type AxisChainRequest, type AxisChainResult, type AxisChainStatus, type AxisChainStep, type AxisChainStepResult, type AxisChainStepStatus, AxisContext, type AxisCrudHandler, type AxisDecoded, AxisDemoPubkey, type AxisEffect, type AxisExecutionContext, type AxisExecutionMode, AxisFilesDownloadHandler, AxisFilesFinalizeHandler, AxisFrame$2 as AxisFrame, type AxisHandler, type AxisHandlerInit, AxisIdDto, type AxisIntentEnvelope, type AxisIntentObserver, AxisIp, type AxisAlg as AxisJsonAlg, type AxisFrame$1 as AxisJsonFrame, type AxisResponse as AxisJsonResponse, type AxisSig as AxisJsonSig, type AxisKeyExchangeRef, type AxisObservation, type AxisObservedContext, type AxisObserverBinding, type AxisObserverBindingOptions, type AxisObserverContext, type AxisObserverDefinition, type AxisObserverEvent, type AxisObserverRef, type AxisObserverRegistration, type AxisPacket$1 as AxisPacket, T as AxisPacketTags, AxisPartialType, type AxisPostSensor, type AxisPreSensor, AxisPublic, AxisRateLimit, type AxisRateLimitConfig, AxisRaw, type AxisRequestContext, type AxisRequestData, AxisResponseDto, type AxisSensor, AxisSensorChainService, type AxisSensorInit, type AxisSig$1 as AxisSig, AxisTlvDto, BAND, CAPABILITIES, CAPSULE_POLICY_METADATA_KEY, CCE_ERROR, CCE_PROTOCOL_VERSION, CHAIN_METADATA_KEY, CONTRACT_METADATA_KEY, type Capability, Capsule, type CapsuleMode, CapsulePolicy, type CapsulePolicyOptions, type CapsuleScopeMode, type CceCapsuleClaims as CceCapsuleClaimsType, CceError, type CceExecutionContext as CceExecutionContextType, type CceHandler, type CceHandlerContext, type CceHandlerResult, type CcePipelineConfig, type CcePipelineResult, type CcePolicyContext, type CcePolicyDecision, type CcePolicyEvaluator, type CceRequestEnvelope as CceRequestEnvelopeType, type CceResponseEnvelope as CceResponseEnvelopeType, type CceWitnessRecord as CceWitnessRecordType, Chain, type ChainOptions, type ChainResult, Contract, ContractViolationError, DEFAULT_CONTRACTS, DEFAULT_TIMEOUT, Decision, DiskUploadFileStore, type DtoSchema, type ExecutionContract, ExecutionMeter, type ExecutionMetrics, FALLBACK_CONTRACT, type Grant, type GrantCapability, type GrantMeta, type GrantStatus, type GrantType, type GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, HandlerDiscoveryService, HandlerSensors, INTENT_BODY_KEY, INTENT_METADATA_KEY, INTENT_REQUIREMENTS, INTENT_ROUTES_KEY, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, Intent, IntentBody, type IntentDefinition, type IntentKind, type IntentOptions, type IntentRoute, IntentRouter, IntentSensitivity, IntentSensors, type IntentTlvField, type KeyStatus, type LoomReceipt, type LoomValidationResult, OBSERVER_BINDINGS_KEY, OBSERVER_METADATA_KEY, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationSensor, type ObservationStage, type ObservationStreamEntry, type ObservationWitnessSummary, Observer, ObserverDiscoveryService, ObserverDispatcherService, ObserverRegistry, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, type PresenceChallenge, type PresenceDeclaration, type PresenceProof, type PresenceReceipt, type PresenceStatus, type PresenceVerifyResult, REQUIRED_PROOF_METADATA_KEY, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, type RegisteredChainConfig, RequiredProof, type RequiredProofKind, type ResponseContract, ResponseObserver, type ResponseObserverContext, type Revocation, type RevocationTargetType, RiskDecision, type RiskEvaluation, type RiskSignal, SENSITIVITY_METADATA_KEY, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensitivity, Sensor, type SensorBand, type SensorDecision, SensorDecisions, SensorDiscoveryService, type SensorInput, type SensorMinifiedDecision, type SensorOptions, type SensorPhase, type SensorPhaseMetadata, SensorRegistry, TLV_FIELDS_KEY, TLV_VALIDATORS_KEY, type ThreadState, TlvEnum, TlvField, type TlvFieldKind, type TlvFieldMeta, type TlvFieldOptions, TlvMinLen, TlvRange, TlvUtf8Pattern, TlvValidate, type TlvValidatorFn, type TlvValidatorMeta, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, Witness, type Writ, type WritBody, type WritHead, type WritMeta, type WritSignature, type WritValidationResult, axis1SigningBytes, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeGrant, canonicalizeObservation, canonicalizeWrit, index$9 as cce, classifyIntent, createObservation, index$8 as crypto, decodeAxis1Frame, decodeQueueMessage, index$7 as decorators, deriveAnchorReflection, encVarint, encodeAxis1Frame, encodeAxisTlvDto, encodeQueueMessage, endStage, index$5 as engine, executeCcePipeline, extractDtoSchema, finalizeObservation, getAxisExecutionContext, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isTimestampValid, index$4 as loom, mergeAxisExecutionContext, nonce16, normalizeSensorDecision, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, recordSensor, resolveTimeout, index$3 as schemas, index$2 as security, sensitivityName, index$1 as sensors, stableJsonStringify, startStage, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, utf8, index as utils, validateFrameShape, varintU, verifyResponse, withAxisExecutionContext };
|