@nextera.one/axis-server-sdk 2.3.24 → 2.3.26
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-DiWSbPZ8.d.mts → index-CZbbGuUq.d.mts} +8 -0
- package/dist/{index-BRV_ohRW.d.ts → index-gFSt2xrf.d.ts} +8 -0
- package/dist/index.d.mts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.js +105 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -4
- package/dist/index.mjs.map +1 -1
- package/dist/sensors/index.d.mts +1 -1
- package/dist/sensors/index.d.ts +1 -1
- package/dist/sensors/index.js +104 -4
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +104 -4
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -357,6 +357,10 @@ interface IntentRoute extends AxisIntentSensorOptions {
|
|
|
357
357
|
bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
358
358
|
tlv?: IntentTlvField[];
|
|
359
359
|
dto?: Function;
|
|
360
|
+
maxUseCount?: number;
|
|
361
|
+
useCount?: number;
|
|
362
|
+
maxDuration?: number;
|
|
363
|
+
duration?: number;
|
|
360
364
|
}
|
|
361
365
|
interface IntentOptions extends AxisIntentSensorOptions {
|
|
362
366
|
kind?: IntentKind;
|
|
@@ -368,6 +372,10 @@ interface IntentOptions extends AxisIntentSensorOptions {
|
|
|
368
372
|
bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
369
373
|
tlv?: IntentTlvField[];
|
|
370
374
|
dto?: Function;
|
|
375
|
+
maxUseCount?: number;
|
|
376
|
+
useCount?: number;
|
|
377
|
+
duration?: number;
|
|
378
|
+
maxDuration?: number;
|
|
371
379
|
decoder?: (buf: Buffer) => any;
|
|
372
380
|
}
|
|
373
381
|
declare function Intent(action: string, options?: IntentOptions): MethodDecorator;
|
|
@@ -357,6 +357,10 @@ interface IntentRoute extends AxisIntentSensorOptions {
|
|
|
357
357
|
bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
358
358
|
tlv?: IntentTlvField[];
|
|
359
359
|
dto?: Function;
|
|
360
|
+
maxUseCount?: number;
|
|
361
|
+
useCount?: number;
|
|
362
|
+
maxDuration?: number;
|
|
363
|
+
duration?: number;
|
|
360
364
|
}
|
|
361
365
|
interface IntentOptions extends AxisIntentSensorOptions {
|
|
362
366
|
kind?: IntentKind;
|
|
@@ -368,6 +372,10 @@ interface IntentOptions extends AxisIntentSensorOptions {
|
|
|
368
372
|
bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
369
373
|
tlv?: IntentTlvField[];
|
|
370
374
|
dto?: Function;
|
|
375
|
+
maxUseCount?: number;
|
|
376
|
+
useCount?: number;
|
|
377
|
+
duration?: number;
|
|
378
|
+
maxDuration?: number;
|
|
371
379
|
decoder?: (buf: Buffer) => any;
|
|
372
380
|
}
|
|
373
381
|
declare function Intent(action: string, options?: IntentOptions): MethodDecorator;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-
|
|
2
|
-
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as AxisConfigReader, y as AxisEffect, z as AxisExecutionMode, B as AxisIntentEnvelope, D as AxisIntentObserver, E as AxisIntentSensorBinding, F as AxisIntentSensorBindingOptions, G as AxisIntentSensorRef, H as AxisIntentSensorWhen, J as AxisKeyExchangeRef, K as AxisLawArticleSummary, L as AxisLawDecision, M as AxisLawEvaluationContext, N as AxisLawEvaluationResult, P as AxisLawEvaluator, Q as AxisObserverBinding, U as AxisObserverBindingOptions, V as AxisObserverContext, W as AxisObserverDefinition, X as AxisObserverEvent, Y as AxisObserverRef, Z as AxisObserverRegistration, _ as AxisPublic, $ as AxisRateLimit, a0 as AxisRateLimitConfig, a1 as AxisSensorConfigProvider, a2 as AxisStream, a3 as AxisStreamOptions, a4 as BodyBudgetSensor, a5 as CAPSULE_POLICY_METADATA_KEY, a6 as CONTRACT_METADATA_KEY, a7 as CapabilityEnforcementSensor, a8 as Capsule, a9 as CapsulePolicy, aa as CapsulePolicyOptions, ab as CapsuleScopeMode, ac as ChunkHashSensor, ad as Contract, ae as DEFAULT_CONTRACTS, af as EntropySensor, ag as ExecutionContract, ah as ExecutionTimeoutSensor, ai as FALLBACK_CONTRACT, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, am as INTENT_METADATA_KEY, an as INTENT_ROUTES_KEY, ao as Intent, ap as IntentAllowlistSensor, aq as IntentKind, ar as IntentOptions, as as IntentRegistrySensor, at as IntentRoute, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, ay as LawEvaluationSensorOptions, az as OBSERVER_BINDINGS_KEY, aA as OBSERVER_METADATA_KEY, aB as Observer, aC as ObserverRegistry, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aF as REQUIRED_PROOF_METADATA_KEY, aG as ReceiptPolicySensor, aH as RegisteredChainConfig, aI as RequiredProof, aJ as RiskDecision, aK as RiskEvaluation, aL as RiskGateSensor, aM as RiskGateSensorOptions, aN as RiskSignal, aO as RiskSignalCollector, aP as SENSITIVITY_METADATA_KEY, aQ as SchemaValidationSensor, aR as Sensitivity, aS as SensorConfigSnapshot, aT as SensorsSource, aU as StreamScopeSensor, aV as TLVParseSensor, aW as TLV_FIELDS_KEY, aX as TLV_VALIDATORS_KEY, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, b0 as TlvEnum, b1 as TlvField, b2 as TlvFieldEncodeRule, b3 as TlvFieldEncodeVisibility, b4 as TlvFieldKind, b5 as TlvFieldMeta, b6 as TlvFieldOptions, b7 as TlvMinLen, b8 as TlvRange, b9 as TlvUtf8Pattern, ba as TlvValidate, bb as TlvValidatorMeta, bc as TpsSensor, bd as TpsSensorOptions, be as VarintHardeningSensor, bf as Witness, bg as buildAxisLawEvaluationContext, bh as toIntentSensorBinding, bi as toObserverBinding } from './index-
|
|
1
|
+
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-CZbbGuUq.mjs';
|
|
2
|
+
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as AxisConfigReader, y as AxisEffect, z as AxisExecutionMode, B as AxisIntentEnvelope, D as AxisIntentObserver, E as AxisIntentSensorBinding, F as AxisIntentSensorBindingOptions, G as AxisIntentSensorRef, H as AxisIntentSensorWhen, J as AxisKeyExchangeRef, K as AxisLawArticleSummary, L as AxisLawDecision, M as AxisLawEvaluationContext, N as AxisLawEvaluationResult, P as AxisLawEvaluator, Q as AxisObserverBinding, U as AxisObserverBindingOptions, V as AxisObserverContext, W as AxisObserverDefinition, X as AxisObserverEvent, Y as AxisObserverRef, Z as AxisObserverRegistration, _ as AxisPublic, $ as AxisRateLimit, a0 as AxisRateLimitConfig, a1 as AxisSensorConfigProvider, a2 as AxisStream, a3 as AxisStreamOptions, a4 as BodyBudgetSensor, a5 as CAPSULE_POLICY_METADATA_KEY, a6 as CONTRACT_METADATA_KEY, a7 as CapabilityEnforcementSensor, a8 as Capsule, a9 as CapsulePolicy, aa as CapsulePolicyOptions, ab as CapsuleScopeMode, ac as ChunkHashSensor, ad as Contract, ae as DEFAULT_CONTRACTS, af as EntropySensor, ag as ExecutionContract, ah as ExecutionTimeoutSensor, ai as FALLBACK_CONTRACT, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, am as INTENT_METADATA_KEY, an as INTENT_ROUTES_KEY, ao as Intent, ap as IntentAllowlistSensor, aq as IntentKind, ar as IntentOptions, as as IntentRegistrySensor, at as IntentRoute, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, ay as LawEvaluationSensorOptions, az as OBSERVER_BINDINGS_KEY, aA as OBSERVER_METADATA_KEY, aB as Observer, aC as ObserverRegistry, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aF as REQUIRED_PROOF_METADATA_KEY, aG as ReceiptPolicySensor, aH as RegisteredChainConfig, aI as RequiredProof, aJ as RiskDecision, aK as RiskEvaluation, aL as RiskGateSensor, aM as RiskGateSensorOptions, aN as RiskSignal, aO as RiskSignalCollector, aP as SENSITIVITY_METADATA_KEY, aQ as SchemaValidationSensor, aR as Sensitivity, aS as SensorConfigSnapshot, aT as SensorsSource, aU as StreamScopeSensor, aV as TLVParseSensor, aW as TLV_FIELDS_KEY, aX as TLV_VALIDATORS_KEY, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, b0 as TlvEnum, b1 as TlvField, b2 as TlvFieldEncodeRule, b3 as TlvFieldEncodeVisibility, b4 as TlvFieldKind, b5 as TlvFieldMeta, b6 as TlvFieldOptions, b7 as TlvMinLen, b8 as TlvRange, b9 as TlvUtf8Pattern, ba as TlvValidate, bb as TlvValidatorMeta, bc as TpsSensor, bd as TpsSensorOptions, be as VarintHardeningSensor, bf as Witness, bg as buildAxisLawEvaluationContext, bh as toIntentSensorBinding, bi as toObserverBinding } from './index-CZbbGuUq.mjs';
|
|
3
3
|
import { AxisFrame } from '@nextera.one/axis-protocol';
|
|
4
4
|
export { AXIS_MAGIC, AXIS_VERSION, AxisBinaryFrame, AxisFrame, TLV as AxisTlvType, 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_KINDS, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofKind, 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, decodeFrame, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeFrame, encodeTLVs, encodeVarint, getSignTarget, varintLength } from '@nextera.one/axis-protocol';
|
|
5
5
|
import { A as AxisObservation, L as LoomReceipt, T as ThreadState, W as WritValidationResult, G as Grant, a as GrantCapability, P as PresenceDeclaration, b as PresenceChallenge, c as Writ, R as Revocation, d as WritBody, e as WritMeta, f as PresenceReceipt, g as GrantStatus, h as PresenceStatus, i as PresenceProof, j as GrantValidationResult, k as PresenceVerifyResult } from './index-CXewlhg-.mjs';
|
|
@@ -749,6 +749,36 @@ declare class AxisSensorChainService {
|
|
|
749
749
|
private normalizeProofKinds;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
+
type AxisTlvVisibilityRule = IntentTlvField["encode"];
|
|
753
|
+
interface AxisTlvVisibilityOverride {
|
|
754
|
+
intent?: string;
|
|
755
|
+
dtoName?: string;
|
|
756
|
+
field?: string;
|
|
757
|
+
tag?: number;
|
|
758
|
+
encode: AxisTlvVisibilityRule;
|
|
759
|
+
enabled?: boolean;
|
|
760
|
+
}
|
|
761
|
+
interface AxisTlvVisibilityResolveInput<T extends object = object> {
|
|
762
|
+
intent?: string;
|
|
763
|
+
dtoName?: string;
|
|
764
|
+
field: IntentTlvField;
|
|
765
|
+
value: unknown;
|
|
766
|
+
data: Partial<Record<keyof T, unknown>>;
|
|
767
|
+
context: unknown;
|
|
768
|
+
}
|
|
769
|
+
interface AxisTlvVisibilityResolver<T extends object = object> {
|
|
770
|
+
resolve(input: AxisTlvVisibilityResolveInput<T>): AxisTlvVisibilityRule | undefined;
|
|
771
|
+
}
|
|
772
|
+
declare class AxisTlvVisibilityRegistry<T extends object = object> implements AxisTlvVisibilityResolver<T> {
|
|
773
|
+
private overrides;
|
|
774
|
+
constructor(overrides?: AxisTlvVisibilityOverride[]);
|
|
775
|
+
setOverrides(overrides: AxisTlvVisibilityOverride[]): void;
|
|
776
|
+
listOverrides(): AxisTlvVisibilityOverride[];
|
|
777
|
+
upsert(override: AxisTlvVisibilityOverride): void;
|
|
778
|
+
remove(match: Omit<AxisTlvVisibilityOverride, "encode">): number;
|
|
779
|
+
resolve(input: AxisTlvVisibilityResolveInput<T>): AxisTlvVisibilityRule | undefined;
|
|
780
|
+
}
|
|
781
|
+
|
|
752
782
|
type AxisTlvDtoCtor<T = object> = new (...args: never[]) => T;
|
|
753
783
|
interface AxisTlvFieldPolicyInput<T extends object = object> {
|
|
754
784
|
field: IntentTlvField;
|
|
@@ -758,10 +788,13 @@ interface AxisTlvFieldPolicyInput<T extends object = object> {
|
|
|
758
788
|
}
|
|
759
789
|
type AxisTlvFieldPolicy<T extends object = object> = (input: AxisTlvFieldPolicyInput<T>) => boolean;
|
|
760
790
|
interface AxisTlvEncodeContext<T extends object = object> {
|
|
791
|
+
intent?: string;
|
|
792
|
+
dtoName?: string;
|
|
761
793
|
roles?: readonly string[];
|
|
762
794
|
actorId?: string;
|
|
763
795
|
phase?: 'request' | 'response';
|
|
764
796
|
policies?: Record<string, AxisTlvFieldPolicy<T>>;
|
|
797
|
+
visibilityRegistry?: AxisTlvVisibilityResolver<T>;
|
|
765
798
|
}
|
|
766
799
|
declare function encodeAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>, context?: AxisTlvEncodeContext<T>): Uint8Array;
|
|
767
800
|
declare function projectAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>, context?: AxisTlvEncodeContext<T>): Partial<Record<keyof T, unknown>>;
|
|
@@ -801,4 +834,4 @@ declare function executeLoomPipeline(writ: Writ, publicKeyHex: string, presence:
|
|
|
801
834
|
code: string;
|
|
802
835
|
};
|
|
803
836
|
|
|
804
|
-
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, Axis1DecodedFrame, type AxisPacket as AxisBinaryPacket, AxisCapsuleRef, AxisChainEnvelope, AxisChainExecutor, AxisChainResult, AxisChainStep, type AxisCrudHandler, type AxisDecoded, type AxisExecutionContext, type AxisHandler, type AxisHandlerInit, AxisIdDto, AxisIntentSensorBindingInput, AxisIntentSensorOptions, AxisMediaTypes, AxisObservation, AxisObserverBindingInput, T as AxisPacketTags, AxisPartialType, AxisResponseDto, AxisSensorChainService, AxisTlvDto, type AxisTlvEncodeContext, type AxisTlvFieldPolicy, type AxisTlvFieldPolicyInput, BAND, BodyProfile, type BodyProfileValidation, BodyProfileValidator, CAPABILITIES, CHAIN_METADATA_KEY, type Capability, Chain, ChainOptions, type ChainResult, ContractViolationError, DEFAULT_TIMEOUT, type DeviceSEContext, DiskUploadFileStore, type DtoSchema, ExecutionMeter, type ExecutionMetrics, Grant, GrantCapability, GrantStatus, GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, type HandlerOptions, HandlerSensors, INTENT_BODY_KEY, INTENT_REQUIREMENTS, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, IntentBody, type IntentDefinition, IntentRouter, IntentSensitivity, IntentSensors, IntentTlvField, type LoomExecutionResult, LoomReceipt, type MTLSContext, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationStreamEntry, type ObservationWitnessSummary, ObserverDispatcherService, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, PresenceChallenge, PresenceDeclaration, PresenceProof, PresenceReceipt, PresenceStatus, PresenceVerifyResult, type ProofType, type ProofVerificationResult, ProofVerificationService, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, RequiredProofKind, type ResponseContract, ResponseObserver, type ResponseObserverContext, Revocation, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, SensorDecision, SensorInput, type SensorOptions, type SensorPhase, SensorRegistry, ThreadState, TlvValidatorFn, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, Writ, WritBody, WritMeta, WritValidationResult, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeObservation, classifyIntent, createGrant, createPresenceChallenge, createReceipt, createRevocation, createWrit, decodeQueueMessage, encVarint, encodeAxisTlvDto, encodeQueueMessage, executeLoomPipeline, extractDtoSchema, getAxisExecutionContext, getGrantStatus, getPresenceStatus, grantCoversAction, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isRevoked, isTimestampValid, mergeAxisExecutionContext, nonce16, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, projectAxisTlvDto, renewPresence, resolveTimeout, sensitivityName, signPresenceChallenge, stableJsonStringify, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, updateThreadState, utf8, validateFrameShape, validateGrant, validateWrit, varintU, verifyPresenceProof, verifyReceiptChain, verifyResponse, withAxisExecutionContext };
|
|
837
|
+
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, Axis1DecodedFrame, type AxisPacket as AxisBinaryPacket, AxisCapsuleRef, AxisChainEnvelope, AxisChainExecutor, AxisChainResult, AxisChainStep, type AxisCrudHandler, type AxisDecoded, type AxisExecutionContext, type AxisHandler, type AxisHandlerInit, AxisIdDto, AxisIntentSensorBindingInput, AxisIntentSensorOptions, AxisMediaTypes, AxisObservation, AxisObserverBindingInput, T as AxisPacketTags, AxisPartialType, AxisResponseDto, AxisSensorChainService, AxisTlvDto, type AxisTlvEncodeContext, type AxisTlvFieldPolicy, type AxisTlvFieldPolicyInput, type AxisTlvVisibilityOverride, AxisTlvVisibilityRegistry, type AxisTlvVisibilityResolveInput, type AxisTlvVisibilityResolver, type AxisTlvVisibilityRule, BAND, BodyProfile, type BodyProfileValidation, BodyProfileValidator, CAPABILITIES, CHAIN_METADATA_KEY, type Capability, Chain, ChainOptions, type ChainResult, ContractViolationError, DEFAULT_TIMEOUT, type DeviceSEContext, DiskUploadFileStore, type DtoSchema, ExecutionMeter, type ExecutionMetrics, Grant, GrantCapability, GrantStatus, GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, type HandlerOptions, HandlerSensors, INTENT_BODY_KEY, INTENT_REQUIREMENTS, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, IntentBody, type IntentDefinition, IntentRouter, IntentSensitivity, IntentSensors, IntentTlvField, type LoomExecutionResult, LoomReceipt, type MTLSContext, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationStreamEntry, type ObservationWitnessSummary, ObserverDispatcherService, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, PresenceChallenge, PresenceDeclaration, PresenceProof, PresenceReceipt, PresenceStatus, PresenceVerifyResult, type ProofType, type ProofVerificationResult, ProofVerificationService, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, RequiredProofKind, type ResponseContract, ResponseObserver, type ResponseObserverContext, Revocation, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, SensorDecision, SensorInput, type SensorOptions, type SensorPhase, SensorRegistry, ThreadState, TlvValidatorFn, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, Writ, WritBody, WritMeta, WritValidationResult, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeObservation, classifyIntent, createGrant, createPresenceChallenge, createReceipt, createRevocation, createWrit, decodeQueueMessage, encVarint, encodeAxisTlvDto, encodeQueueMessage, executeLoomPipeline, extractDtoSchema, getAxisExecutionContext, getGrantStatus, getPresenceStatus, grantCoversAction, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isRevoked, isTimestampValid, mergeAxisExecutionContext, nonce16, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, projectAxisTlvDto, renewPresence, resolveTimeout, sensitivityName, signPresenceChallenge, stableJsonStringify, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, updateThreadState, utf8, validateFrameShape, validateGrant, validateWrit, varintU, verifyPresenceProof, verifyReceiptChain, verifyResponse, withAxisExecutionContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-
|
|
2
|
-
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as AxisConfigReader, y as AxisEffect, z as AxisExecutionMode, B as AxisIntentEnvelope, D as AxisIntentObserver, E as AxisIntentSensorBinding, F as AxisIntentSensorBindingOptions, G as AxisIntentSensorRef, H as AxisIntentSensorWhen, J as AxisKeyExchangeRef, K as AxisLawArticleSummary, L as AxisLawDecision, M as AxisLawEvaluationContext, N as AxisLawEvaluationResult, P as AxisLawEvaluator, Q as AxisObserverBinding, U as AxisObserverBindingOptions, V as AxisObserverContext, W as AxisObserverDefinition, X as AxisObserverEvent, Y as AxisObserverRef, Z as AxisObserverRegistration, _ as AxisPublic, $ as AxisRateLimit, a0 as AxisRateLimitConfig, a1 as AxisSensorConfigProvider, a2 as AxisStream, a3 as AxisStreamOptions, a4 as BodyBudgetSensor, a5 as CAPSULE_POLICY_METADATA_KEY, a6 as CONTRACT_METADATA_KEY, a7 as CapabilityEnforcementSensor, a8 as Capsule, a9 as CapsulePolicy, aa as CapsulePolicyOptions, ab as CapsuleScopeMode, ac as ChunkHashSensor, ad as Contract, ae as DEFAULT_CONTRACTS, af as EntropySensor, ag as ExecutionContract, ah as ExecutionTimeoutSensor, ai as FALLBACK_CONTRACT, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, am as INTENT_METADATA_KEY, an as INTENT_ROUTES_KEY, ao as Intent, ap as IntentAllowlistSensor, aq as IntentKind, ar as IntentOptions, as as IntentRegistrySensor, at as IntentRoute, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, ay as LawEvaluationSensorOptions, az as OBSERVER_BINDINGS_KEY, aA as OBSERVER_METADATA_KEY, aB as Observer, aC as ObserverRegistry, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aF as REQUIRED_PROOF_METADATA_KEY, aG as ReceiptPolicySensor, aH as RegisteredChainConfig, aI as RequiredProof, aJ as RiskDecision, aK as RiskEvaluation, aL as RiskGateSensor, aM as RiskGateSensorOptions, aN as RiskSignal, aO as RiskSignalCollector, aP as SENSITIVITY_METADATA_KEY, aQ as SchemaValidationSensor, aR as Sensitivity, aS as SensorConfigSnapshot, aT as SensorsSource, aU as StreamScopeSensor, aV as TLVParseSensor, aW as TLV_FIELDS_KEY, aX as TLV_VALIDATORS_KEY, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, b0 as TlvEnum, b1 as TlvField, b2 as TlvFieldEncodeRule, b3 as TlvFieldEncodeVisibility, b4 as TlvFieldKind, b5 as TlvFieldMeta, b6 as TlvFieldOptions, b7 as TlvMinLen, b8 as TlvRange, b9 as TlvUtf8Pattern, ba as TlvValidate, bb as TlvValidatorMeta, bc as TpsSensor, bd as TpsSensorOptions, be as VarintHardeningSensor, bf as Witness, bg as buildAxisLawEvaluationContext, bh as toIntentSensorBinding, bi as toObserverBinding } from './index-
|
|
1
|
+
import { C as ChainOptions, A as AxisIntentSensorOptions, a as AxisObserverBindingInput, b as AxisIntentSensorBindingInput, R as RequiredProofKind, I as IntentTlvField, T as TlvValidatorFn, c as IntentRouter, O as ObserverDispatcherService, d as AxisChainEnvelope, e as AxisChainResult, f as AxisCapsuleRef, g as AxisChainStep, h as AxisContext, S as SensorRegistry } from './index-gFSt2xrf.js';
|
|
2
|
+
export { i as AXIS_ANONYMOUS_KEY, j as AXIS_AUTHORIZED_KEY, k as AXIS_META_KEY, l as AXIS_PUBLIC_KEY, m as AXIS_RATE_LIMIT_KEY, n as AXIS_STREAM_META_KEY, o as AccessProfileResolverSensor, p as Axis, q as AxisAnonymous, r as AxisAuthorized, s as AxisChainEncryption, t as AxisChainRequest, u as AxisChainStatus, v as AxisChainStepResult, w as AxisChainStepStatus, x as AxisConfigReader, y as AxisEffect, z as AxisExecutionMode, B as AxisIntentEnvelope, D as AxisIntentObserver, E as AxisIntentSensorBinding, F as AxisIntentSensorBindingOptions, G as AxisIntentSensorRef, H as AxisIntentSensorWhen, J as AxisKeyExchangeRef, K as AxisLawArticleSummary, L as AxisLawDecision, M as AxisLawEvaluationContext, N as AxisLawEvaluationResult, P as AxisLawEvaluator, Q as AxisObserverBinding, U as AxisObserverBindingOptions, V as AxisObserverContext, W as AxisObserverDefinition, X as AxisObserverEvent, Y as AxisObserverRef, Z as AxisObserverRegistration, _ as AxisPublic, $ as AxisRateLimit, a0 as AxisRateLimitConfig, a1 as AxisSensorConfigProvider, a2 as AxisStream, a3 as AxisStreamOptions, a4 as BodyBudgetSensor, a5 as CAPSULE_POLICY_METADATA_KEY, a6 as CONTRACT_METADATA_KEY, a7 as CapabilityEnforcementSensor, a8 as Capsule, a9 as CapsulePolicy, aa as CapsulePolicyOptions, ab as CapsuleScopeMode, ac as ChunkHashSensor, ad as Contract, ae as DEFAULT_CONTRACTS, af as EntropySensor, ag as ExecutionContract, ah as ExecutionTimeoutSensor, ai as FALLBACK_CONTRACT, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, am as INTENT_METADATA_KEY, an as INTENT_ROUTES_KEY, ao as Intent, ap as IntentAllowlistSensor, aq as IntentKind, ar as IntentOptions, as as IntentRegistrySensor, at as IntentRoute, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, ay as LawEvaluationSensorOptions, az as OBSERVER_BINDINGS_KEY, aA as OBSERVER_METADATA_KEY, aB as Observer, aC as ObserverRegistry, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aF as REQUIRED_PROOF_METADATA_KEY, aG as ReceiptPolicySensor, aH as RegisteredChainConfig, aI as RequiredProof, aJ as RiskDecision, aK as RiskEvaluation, aL as RiskGateSensor, aM as RiskGateSensorOptions, aN as RiskSignal, aO as RiskSignalCollector, aP as SENSITIVITY_METADATA_KEY, aQ as SchemaValidationSensor, aR as Sensitivity, aS as SensorConfigSnapshot, aT as SensorsSource, aU as StreamScopeSensor, aV as TLVParseSensor, aW as TLV_FIELDS_KEY, aX as TLV_VALIDATORS_KEY, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, b0 as TlvEnum, b1 as TlvField, b2 as TlvFieldEncodeRule, b3 as TlvFieldEncodeVisibility, b4 as TlvFieldKind, b5 as TlvFieldMeta, b6 as TlvFieldOptions, b7 as TlvMinLen, b8 as TlvRange, b9 as TlvUtf8Pattern, ba as TlvValidate, bb as TlvValidatorMeta, bc as TpsSensor, bd as TpsSensorOptions, be as VarintHardeningSensor, bf as Witness, bg as buildAxisLawEvaluationContext, bh as toIntentSensorBinding, bi as toObserverBinding } from './index-gFSt2xrf.js';
|
|
3
3
|
import { AxisFrame } from '@nextera.one/axis-protocol';
|
|
4
4
|
export { AXIS_MAGIC, AXIS_VERSION, AxisBinaryFrame, AxisFrame, TLV as AxisTlvType, 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_KINDS, PROOF_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, ProofKind, 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, decodeFrame, decodeObject, decodeTLVs, decodeTLVsList, decodeVarint, encodeFrame, encodeTLVs, encodeVarint, getSignTarget, varintLength } from '@nextera.one/axis-protocol';
|
|
5
5
|
import { A as AxisObservation, L as LoomReceipt, T as ThreadState, W as WritValidationResult, G as Grant, a as GrantCapability, P as PresenceDeclaration, b as PresenceChallenge, c as Writ, R as Revocation, d as WritBody, e as WritMeta, f as PresenceReceipt, g as GrantStatus, h as PresenceStatus, i as PresenceProof, j as GrantValidationResult, k as PresenceVerifyResult } from './index-ChuwP1RU.js';
|
|
@@ -749,6 +749,36 @@ declare class AxisSensorChainService {
|
|
|
749
749
|
private normalizeProofKinds;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
+
type AxisTlvVisibilityRule = IntentTlvField["encode"];
|
|
753
|
+
interface AxisTlvVisibilityOverride {
|
|
754
|
+
intent?: string;
|
|
755
|
+
dtoName?: string;
|
|
756
|
+
field?: string;
|
|
757
|
+
tag?: number;
|
|
758
|
+
encode: AxisTlvVisibilityRule;
|
|
759
|
+
enabled?: boolean;
|
|
760
|
+
}
|
|
761
|
+
interface AxisTlvVisibilityResolveInput<T extends object = object> {
|
|
762
|
+
intent?: string;
|
|
763
|
+
dtoName?: string;
|
|
764
|
+
field: IntentTlvField;
|
|
765
|
+
value: unknown;
|
|
766
|
+
data: Partial<Record<keyof T, unknown>>;
|
|
767
|
+
context: unknown;
|
|
768
|
+
}
|
|
769
|
+
interface AxisTlvVisibilityResolver<T extends object = object> {
|
|
770
|
+
resolve(input: AxisTlvVisibilityResolveInput<T>): AxisTlvVisibilityRule | undefined;
|
|
771
|
+
}
|
|
772
|
+
declare class AxisTlvVisibilityRegistry<T extends object = object> implements AxisTlvVisibilityResolver<T> {
|
|
773
|
+
private overrides;
|
|
774
|
+
constructor(overrides?: AxisTlvVisibilityOverride[]);
|
|
775
|
+
setOverrides(overrides: AxisTlvVisibilityOverride[]): void;
|
|
776
|
+
listOverrides(): AxisTlvVisibilityOverride[];
|
|
777
|
+
upsert(override: AxisTlvVisibilityOverride): void;
|
|
778
|
+
remove(match: Omit<AxisTlvVisibilityOverride, "encode">): number;
|
|
779
|
+
resolve(input: AxisTlvVisibilityResolveInput<T>): AxisTlvVisibilityRule | undefined;
|
|
780
|
+
}
|
|
781
|
+
|
|
752
782
|
type AxisTlvDtoCtor<T = object> = new (...args: never[]) => T;
|
|
753
783
|
interface AxisTlvFieldPolicyInput<T extends object = object> {
|
|
754
784
|
field: IntentTlvField;
|
|
@@ -758,10 +788,13 @@ interface AxisTlvFieldPolicyInput<T extends object = object> {
|
|
|
758
788
|
}
|
|
759
789
|
type AxisTlvFieldPolicy<T extends object = object> = (input: AxisTlvFieldPolicyInput<T>) => boolean;
|
|
760
790
|
interface AxisTlvEncodeContext<T extends object = object> {
|
|
791
|
+
intent?: string;
|
|
792
|
+
dtoName?: string;
|
|
761
793
|
roles?: readonly string[];
|
|
762
794
|
actorId?: string;
|
|
763
795
|
phase?: 'request' | 'response';
|
|
764
796
|
policies?: Record<string, AxisTlvFieldPolicy<T>>;
|
|
797
|
+
visibilityRegistry?: AxisTlvVisibilityResolver<T>;
|
|
765
798
|
}
|
|
766
799
|
declare function encodeAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>, context?: AxisTlvEncodeContext<T>): Uint8Array;
|
|
767
800
|
declare function projectAxisTlvDto<T extends object>(dtoClass: AxisTlvDtoCtor<T>, data: Partial<Record<keyof T, unknown>>, context?: AxisTlvEncodeContext<T>): Partial<Record<keyof T, unknown>>;
|
|
@@ -801,4 +834,4 @@ declare function executeLoomPipeline(writ: Writ, publicKeyHex: string, presence:
|
|
|
801
834
|
code: string;
|
|
802
835
|
};
|
|
803
836
|
|
|
804
|
-
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, Axis1DecodedFrame, type AxisPacket as AxisBinaryPacket, AxisCapsuleRef, AxisChainEnvelope, AxisChainExecutor, AxisChainResult, AxisChainStep, type AxisCrudHandler, type AxisDecoded, type AxisExecutionContext, type AxisHandler, type AxisHandlerInit, AxisIdDto, AxisIntentSensorBindingInput, AxisIntentSensorOptions, AxisMediaTypes, AxisObservation, AxisObserverBindingInput, T as AxisPacketTags, AxisPartialType, AxisResponseDto, AxisSensorChainService, AxisTlvDto, type AxisTlvEncodeContext, type AxisTlvFieldPolicy, type AxisTlvFieldPolicyInput, BAND, BodyProfile, type BodyProfileValidation, BodyProfileValidator, CAPABILITIES, CHAIN_METADATA_KEY, type Capability, Chain, ChainOptions, type ChainResult, ContractViolationError, DEFAULT_TIMEOUT, type DeviceSEContext, DiskUploadFileStore, type DtoSchema, ExecutionMeter, type ExecutionMetrics, Grant, GrantCapability, GrantStatus, GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, type HandlerOptions, HandlerSensors, INTENT_BODY_KEY, INTENT_REQUIREMENTS, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, IntentBody, type IntentDefinition, IntentRouter, IntentSensitivity, IntentSensors, IntentTlvField, type LoomExecutionResult, LoomReceipt, type MTLSContext, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationStreamEntry, type ObservationWitnessSummary, ObserverDispatcherService, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, PresenceChallenge, PresenceDeclaration, PresenceProof, PresenceReceipt, PresenceStatus, PresenceVerifyResult, type ProofType, type ProofVerificationResult, ProofVerificationService, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, RequiredProofKind, type ResponseContract, ResponseObserver, type ResponseObserverContext, Revocation, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, SensorDecision, SensorInput, type SensorOptions, type SensorPhase, SensorRegistry, ThreadState, TlvValidatorFn, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, Writ, WritBody, WritMeta, WritValidationResult, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeObservation, classifyIntent, createGrant, createPresenceChallenge, createReceipt, createRevocation, createWrit, decodeQueueMessage, encVarint, encodeAxisTlvDto, encodeQueueMessage, executeLoomPipeline, extractDtoSchema, getAxisExecutionContext, getGrantStatus, getPresenceStatus, grantCoversAction, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isRevoked, isTimestampValid, mergeAxisExecutionContext, nonce16, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, projectAxisTlvDto, renewPresence, resolveTimeout, sensitivityName, signPresenceChallenge, stableJsonStringify, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, updateThreadState, utf8, validateFrameShape, validateGrant, validateWrit, varintU, verifyPresenceProof, verifyReceiptChain, verifyResponse, withAxisExecutionContext };
|
|
837
|
+
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, Axis1DecodedFrame, type AxisPacket as AxisBinaryPacket, AxisCapsuleRef, AxisChainEnvelope, AxisChainExecutor, AxisChainResult, AxisChainStep, type AxisCrudHandler, type AxisDecoded, type AxisExecutionContext, type AxisHandler, type AxisHandlerInit, AxisIdDto, AxisIntentSensorBindingInput, AxisIntentSensorOptions, AxisMediaTypes, AxisObservation, AxisObserverBindingInput, T as AxisPacketTags, AxisPartialType, AxisResponseDto, AxisSensorChainService, AxisTlvDto, type AxisTlvEncodeContext, type AxisTlvFieldPolicy, type AxisTlvFieldPolicyInput, type AxisTlvVisibilityOverride, AxisTlvVisibilityRegistry, type AxisTlvVisibilityResolveInput, type AxisTlvVisibilityResolver, type AxisTlvVisibilityRule, BAND, BodyProfile, type BodyProfileValidation, BodyProfileValidator, CAPABILITIES, CHAIN_METADATA_KEY, type Capability, Chain, ChainOptions, type ChainResult, ContractViolationError, DEFAULT_TIMEOUT, type DeviceSEContext, DiskUploadFileStore, type DtoSchema, ExecutionMeter, type ExecutionMetrics, Grant, GrantCapability, GrantStatus, GrantValidationResult, HANDLER_METADATA_KEY, HANDLER_SENSORS_KEY, Handler, type HandlerOptions, HandlerSensors, INTENT_BODY_KEY, INTENT_REQUIREMENTS, INTENT_SENSITIVITY_MAP, INTENT_SENSORS_KEY, INTENT_TIMEOUTS, IntentBody, type IntentDefinition, IntentRouter, IntentSensitivity, IntentSensors, IntentTlvField, type LoomExecutionResult, LoomReceipt, type MTLSContext, type ObservationQueueConfig, type ObservationQueueMessage, type ObservationStreamEntry, type ObservationWitnessSummary, ObserverDispatcherService, type ObserverVerdict, PRE_DECODE_BOUNDARY, PROOF_CAPABILITIES, PresenceChallenge, PresenceDeclaration, PresenceProof, PresenceReceipt, PresenceStatus, PresenceVerifyResult, type ProofType, type ProofVerificationResult, ProofVerificationService, RESPONSE_TAG_CREATED_AT, RESPONSE_TAG_CREATED_BY, RESPONSE_TAG_ID, RESPONSE_TAG_UPDATED_AT, RESPONSE_TAG_UPDATED_BY, type ReceiptEffect, RequiredProofKind, type ResponseContract, ResponseObserver, type ResponseObserverContext, Revocation, SENSOR_METADATA_KEY, Schema2002_PasskeyLoginOptionsRes, Schema2011_PasskeyLoginVerifyReq, Schema2012_PasskeyLoginVerifyRes, Schema2021_PasskeyRegisterOptionsReq, Sensor, type SensorBand, SensorDecision, SensorInput, type SensorOptions, type SensorPhase, SensorRegistry, ThreadState, TlvValidatorFn, type UnsignedObservationWitness, type UploadFileStat, type UploadFileStore, type UploadReceiptSigner, type UploadSessionRecord, type UploadSessionStatus, type UploadSessionStore, Writ, WritBody, WritMeta, WritValidationResult, b64urlDecode, b64urlDecodeString, b64urlEncode, b64urlEncodeString, buildAts1Hdr, buildDtoDecoder, buildPacket, buildQueueMessage, buildReceiptHash, buildTLVs, buildUnsignedWitness, bytes, canAccessResource, canonicalJson, canonicalJsonExcluding, canonicalizeObservation, classifyIntent, createGrant, createPresenceChallenge, createReceipt, createRevocation, createWrit, decodeQueueMessage, encVarint, encodeAxisTlvDto, encodeQueueMessage, executeLoomPipeline, extractDtoSchema, getAxisExecutionContext, getGrantStatus, getPresenceStatus, grantCoversAction, hasScope, hashObservation, isAdminOpcode, isKnownOpcode, isRevoked, isTimestampValid, mergeAxisExecutionContext, nonce16, packPasskeyLoginOptionsReq, packPasskeyLoginOptionsRes, packPasskeyLoginVerifyReq, packPasskeyLoginVerifyRes, packPasskeyRegisterOptionsReq, parseAutoClaimEntries, parseScope, parseStreamEntries, projectAxisTlvDto, renewPresence, resolveTimeout, sensitivityName, signPresenceChallenge, stableJsonStringify, tlv, u64be, unpackPasskeyLoginOptionsReq, unpackPasskeyLoginVerifyReq, unpackPasskeyRegisterOptionsReq, updateThreadState, utf8, validateFrameShape, validateGrant, validateWrit, varintU, verifyPresenceProof, verifyReceiptChain, verifyResponse, withAxisExecutionContext };
|
package/dist/index.js
CHANGED
|
@@ -434,7 +434,11 @@ function Intent(action, options) {
|
|
|
434
434
|
bodyProfile: options?.bodyProfile,
|
|
435
435
|
tlv: options?.tlv,
|
|
436
436
|
dto: options?.dto,
|
|
437
|
-
is: options?.is
|
|
437
|
+
is: options?.is,
|
|
438
|
+
maxUseCount: options?.maxUseCount,
|
|
439
|
+
useCount: options?.useCount,
|
|
440
|
+
duration: options?.duration,
|
|
441
|
+
maxDuration: options?.maxDuration
|
|
438
442
|
});
|
|
439
443
|
Reflect.defineMetadata(INTENT_ROUTES_KEY, routes, target.constructor);
|
|
440
444
|
};
|
|
@@ -9360,9 +9364,10 @@ var init_timeline_store = __esm({
|
|
|
9360
9364
|
// src/utils/axis-tlv-codec.ts
|
|
9361
9365
|
function encodeAxisTlvDto(dtoClass, data, context = {}) {
|
|
9362
9366
|
const schema = (0, import_dto_schema2.extractDtoSchema)(dtoClass);
|
|
9367
|
+
const effectiveContext = withDtoName(dtoClass, context);
|
|
9363
9368
|
const items = schema.fields.flatMap((field) => {
|
|
9364
9369
|
const value = data[field.name];
|
|
9365
|
-
if (!shouldEncodeField(field, value, data,
|
|
9370
|
+
if (!shouldEncodeField(field, value, data, effectiveContext)) return [];
|
|
9366
9371
|
if (value === void 0 || value === null) {
|
|
9367
9372
|
if (field.required) {
|
|
9368
9373
|
throw new Error(`Missing required TLV response field: ${field.name}`);
|
|
@@ -9375,17 +9380,18 @@ function encodeAxisTlvDto(dtoClass, data, context = {}) {
|
|
|
9375
9380
|
}
|
|
9376
9381
|
function projectAxisTlvDto(dtoClass, data, context = {}) {
|
|
9377
9382
|
const schema = (0, import_dto_schema2.extractDtoSchema)(dtoClass);
|
|
9383
|
+
const effectiveContext = withDtoName(dtoClass, context);
|
|
9378
9384
|
const result = {};
|
|
9379
9385
|
for (const field of schema.fields) {
|
|
9380
9386
|
const value = data[field.name];
|
|
9381
|
-
if (!shouldEncodeField(field, value, data,
|
|
9387
|
+
if (!shouldEncodeField(field, value, data, effectiveContext)) continue;
|
|
9382
9388
|
if (value === void 0 || value === null) continue;
|
|
9383
9389
|
result[field.name] = value;
|
|
9384
9390
|
}
|
|
9385
9391
|
return result;
|
|
9386
9392
|
}
|
|
9387
9393
|
function shouldEncodeField(field, value, data, context) {
|
|
9388
|
-
const rule = field
|
|
9394
|
+
const rule = resolveEncodeRule(field, value, data, context);
|
|
9389
9395
|
if (rule === void 0) return true;
|
|
9390
9396
|
if (rule === false) return false;
|
|
9391
9397
|
if (rule.onlyRoles?.length && !hasAnyRole(context, rule.onlyRoles)) {
|
|
@@ -9405,6 +9411,22 @@ function shouldEncodeField(field, value, data, context) {
|
|
|
9405
9411
|
}
|
|
9406
9412
|
return true;
|
|
9407
9413
|
}
|
|
9414
|
+
function withDtoName(dtoClass, context) {
|
|
9415
|
+
return {
|
|
9416
|
+
...context,
|
|
9417
|
+
dtoName: context.dtoName ?? dtoClass.name
|
|
9418
|
+
};
|
|
9419
|
+
}
|
|
9420
|
+
function resolveEncodeRule(field, value, data, context) {
|
|
9421
|
+
return context.visibilityRegistry?.resolve({
|
|
9422
|
+
intent: context.intent,
|
|
9423
|
+
dtoName: context.dtoName,
|
|
9424
|
+
field,
|
|
9425
|
+
value,
|
|
9426
|
+
data,
|
|
9427
|
+
context
|
|
9428
|
+
}) ?? field.encode;
|
|
9429
|
+
}
|
|
9408
9430
|
function hasAnyRole(context, expectedRoles) {
|
|
9409
9431
|
const actualRoles = context.roles ?? [];
|
|
9410
9432
|
return expectedRoles.some((role) => actualRoles.includes(role));
|
|
@@ -9452,6 +9474,82 @@ var init_axis_tlv_codec = __esm({
|
|
|
9452
9474
|
}
|
|
9453
9475
|
});
|
|
9454
9476
|
|
|
9477
|
+
// src/utils/axis-tlv-visibility-registry.ts
|
|
9478
|
+
function overrideKey(override) {
|
|
9479
|
+
return [
|
|
9480
|
+
normalizeKey(override.intent),
|
|
9481
|
+
normalizeKey(override.dtoName),
|
|
9482
|
+
normalizeKey(override.field),
|
|
9483
|
+
override.tag ?? ""
|
|
9484
|
+
].join("|");
|
|
9485
|
+
}
|
|
9486
|
+
function normalizeKey(value) {
|
|
9487
|
+
return typeof value === "string" ? value.trim() : "";
|
|
9488
|
+
}
|
|
9489
|
+
function matchScore(override, input) {
|
|
9490
|
+
if (override.enabled === false) return -1;
|
|
9491
|
+
const intent = normalizeKey(input.intent);
|
|
9492
|
+
const dtoName = normalizeKey(input.dtoName);
|
|
9493
|
+
const overrideIntent = normalizeKey(override.intent);
|
|
9494
|
+
const overrideDtoName = normalizeKey(override.dtoName);
|
|
9495
|
+
const overrideField = normalizeKey(override.field);
|
|
9496
|
+
const fieldName = normalizeKey(input.field.name);
|
|
9497
|
+
if (overrideIntent && overrideIntent !== intent) return -1;
|
|
9498
|
+
if (overrideDtoName && overrideDtoName !== dtoName) return -1;
|
|
9499
|
+
const fieldMatches = Boolean(overrideField && overrideField === fieldName);
|
|
9500
|
+
const tagMatches = typeof override.tag === "number" && override.tag === input.field.tag;
|
|
9501
|
+
if (!fieldMatches && !tagMatches) return -1;
|
|
9502
|
+
return (overrideIntent ? 100 : 0) + (overrideDtoName ? 50 : 0) + (fieldMatches ? 10 : 0) + (tagMatches ? 8 : 0);
|
|
9503
|
+
}
|
|
9504
|
+
var AxisTlvVisibilityRegistry;
|
|
9505
|
+
var init_axis_tlv_visibility_registry = __esm({
|
|
9506
|
+
"src/utils/axis-tlv-visibility-registry.ts"() {
|
|
9507
|
+
AxisTlvVisibilityRegistry = class {
|
|
9508
|
+
constructor(overrides = []) {
|
|
9509
|
+
this.overrides = [];
|
|
9510
|
+
this.setOverrides(overrides);
|
|
9511
|
+
}
|
|
9512
|
+
setOverrides(overrides) {
|
|
9513
|
+
this.overrides = overrides.map((override) => ({ ...override }));
|
|
9514
|
+
}
|
|
9515
|
+
listOverrides() {
|
|
9516
|
+
return this.overrides.map((override) => ({ ...override }));
|
|
9517
|
+
}
|
|
9518
|
+
upsert(override) {
|
|
9519
|
+
const key = overrideKey(override);
|
|
9520
|
+
const index = this.overrides.findIndex((item) => overrideKey(item) === key);
|
|
9521
|
+
if (index >= 0) {
|
|
9522
|
+
this.overrides[index] = { ...override };
|
|
9523
|
+
return;
|
|
9524
|
+
}
|
|
9525
|
+
this.overrides.push({ ...override });
|
|
9526
|
+
}
|
|
9527
|
+
remove(match) {
|
|
9528
|
+
const before = this.overrides.length;
|
|
9529
|
+
this.overrides = this.overrides.filter(
|
|
9530
|
+
(item) => overrideKey(item) !== overrideKey(match)
|
|
9531
|
+
);
|
|
9532
|
+
return before - this.overrides.length;
|
|
9533
|
+
}
|
|
9534
|
+
resolve(input) {
|
|
9535
|
+
let bestScore = -1;
|
|
9536
|
+
let bestIndex = -1;
|
|
9537
|
+
let best;
|
|
9538
|
+
this.overrides.forEach((override, index) => {
|
|
9539
|
+
const score = matchScore(override, input);
|
|
9540
|
+
if (score < 0) return;
|
|
9541
|
+
if (score > bestScore || score === bestScore && index > bestIndex) {
|
|
9542
|
+
bestScore = score;
|
|
9543
|
+
bestIndex = index;
|
|
9544
|
+
best = override;
|
|
9545
|
+
}
|
|
9546
|
+
});
|
|
9547
|
+
return best?.encode;
|
|
9548
|
+
}
|
|
9549
|
+
};
|
|
9550
|
+
}
|
|
9551
|
+
});
|
|
9552
|
+
|
|
9455
9553
|
// src/loom/loom.types.ts
|
|
9456
9554
|
function deriveAnchorReflection(softid, context = "openlogs", scope = "loom") {
|
|
9457
9555
|
return `ar:${context}:${scope}:${softid}`;
|
|
@@ -13190,6 +13288,7 @@ __export(index_exports, {
|
|
|
13190
13288
|
AxisSensorChainService: () => AxisSensorChainService,
|
|
13191
13289
|
AxisStream: () => AxisStream,
|
|
13192
13290
|
AxisTlvDto: () => AxisTlvDto,
|
|
13291
|
+
AxisTlvVisibilityRegistry: () => AxisTlvVisibilityRegistry,
|
|
13193
13292
|
BAND: () => BAND,
|
|
13194
13293
|
BodyProfile: () => BodyProfile2,
|
|
13195
13294
|
BodyProfileValidator: () => BodyProfileValidator,
|
|
@@ -13536,6 +13635,7 @@ var init_index = __esm({
|
|
|
13536
13635
|
init_cce_pipeline();
|
|
13537
13636
|
init_cce_types();
|
|
13538
13637
|
init_axis_tlv_codec();
|
|
13638
|
+
init_axis_tlv_visibility_registry();
|
|
13539
13639
|
init_loom_types();
|
|
13540
13640
|
init_loom_engine();
|
|
13541
13641
|
init_idel_compiler();
|
|
@@ -13582,6 +13682,7 @@ init_index();
|
|
|
13582
13682
|
AxisSensorChainService,
|
|
13583
13683
|
AxisStream,
|
|
13584
13684
|
AxisTlvDto,
|
|
13685
|
+
AxisTlvVisibilityRegistry,
|
|
13585
13686
|
BAND,
|
|
13586
13687
|
BodyProfile,
|
|
13587
13688
|
BodyProfileValidator,
|