@nextera.one/axis-server-sdk 2.3.15 → 2.3.17
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-ogUOoBI-.d.mts → index-D4Oz7vc1.d.mts} +4 -1
- package/dist/{index-Dd-WVBj9.d.ts → index-DwBRLF9t.d.ts} +4 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -10
- 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 +34 -9
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +38 -10
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -293,7 +293,7 @@ declare const INTENT_METADATA_KEY = "axis:intent";
|
|
|
293
293
|
declare const INTENT_ROUTES_KEY = "axis:intent_routes";
|
|
294
294
|
type IntentKind = "create" | "read" | "update" | "delete" | "action";
|
|
295
295
|
type AxisIntentSensorRef = string | Function;
|
|
296
|
-
type AxisIntentSensorWhen =
|
|
296
|
+
type AxisIntentSensorWhen = "before" | "after" | "both";
|
|
297
297
|
interface AxisIntentSensorBindingOptions {
|
|
298
298
|
use: AxisIntentSensorRef;
|
|
299
299
|
when?: AxisIntentSensorWhen;
|
|
@@ -323,6 +323,7 @@ interface IntentRoute extends AxisIntentSensorOptions {
|
|
|
323
323
|
frame?: boolean;
|
|
324
324
|
kind?: IntentKind;
|
|
325
325
|
sensitivity?: SensitivityLevel;
|
|
326
|
+
requiredProof?: RequiredProofKind[];
|
|
326
327
|
chain?: boolean | ChainOptions;
|
|
327
328
|
bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
328
329
|
tlv?: IntentTlvField[];
|
|
@@ -331,6 +332,7 @@ interface IntentRoute extends AxisIntentSensorOptions {
|
|
|
331
332
|
interface IntentOptions extends AxisIntentSensorOptions {
|
|
332
333
|
kind?: IntentKind;
|
|
333
334
|
sensitivity?: SensitivityLevel;
|
|
335
|
+
requiredProof?: RequiredProofKind | RequiredProofKind[];
|
|
334
336
|
absolute?: boolean;
|
|
335
337
|
frame?: boolean;
|
|
336
338
|
chain?: boolean | ChainOptions;
|
|
@@ -403,6 +405,7 @@ interface IntentSchema {
|
|
|
403
405
|
intent: string;
|
|
404
406
|
version: number;
|
|
405
407
|
bodyProfile: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
408
|
+
dtoName?: string;
|
|
406
409
|
fields: Array<{
|
|
407
410
|
name: string;
|
|
408
411
|
tlv: number;
|
|
@@ -293,7 +293,7 @@ declare const INTENT_METADATA_KEY = "axis:intent";
|
|
|
293
293
|
declare const INTENT_ROUTES_KEY = "axis:intent_routes";
|
|
294
294
|
type IntentKind = "create" | "read" | "update" | "delete" | "action";
|
|
295
295
|
type AxisIntentSensorRef = string | Function;
|
|
296
|
-
type AxisIntentSensorWhen =
|
|
296
|
+
type AxisIntentSensorWhen = "before" | "after" | "both";
|
|
297
297
|
interface AxisIntentSensorBindingOptions {
|
|
298
298
|
use: AxisIntentSensorRef;
|
|
299
299
|
when?: AxisIntentSensorWhen;
|
|
@@ -323,6 +323,7 @@ interface IntentRoute extends AxisIntentSensorOptions {
|
|
|
323
323
|
frame?: boolean;
|
|
324
324
|
kind?: IntentKind;
|
|
325
325
|
sensitivity?: SensitivityLevel;
|
|
326
|
+
requiredProof?: RequiredProofKind[];
|
|
326
327
|
chain?: boolean | ChainOptions;
|
|
327
328
|
bodyProfile?: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
328
329
|
tlv?: IntentTlvField[];
|
|
@@ -331,6 +332,7 @@ interface IntentRoute extends AxisIntentSensorOptions {
|
|
|
331
332
|
interface IntentOptions extends AxisIntentSensorOptions {
|
|
332
333
|
kind?: IntentKind;
|
|
333
334
|
sensitivity?: SensitivityLevel;
|
|
335
|
+
requiredProof?: RequiredProofKind | RequiredProofKind[];
|
|
334
336
|
absolute?: boolean;
|
|
335
337
|
frame?: boolean;
|
|
336
338
|
chain?: boolean | ChainOptions;
|
|
@@ -403,6 +405,7 @@ interface IntentSchema {
|
|
|
403
405
|
intent: string;
|
|
404
406
|
version: number;
|
|
405
407
|
bodyProfile: "TLV_MAP" | "RAW" | "TLV_OBJ" | "TLV_ARR";
|
|
408
|
+
dtoName?: string;
|
|
406
409
|
fields: Array<{
|
|
407
410
|
name: string;
|
|
408
411
|
tlv: number;
|
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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, at as LawEvaluationSensorOptions, au as OBSERVER_BINDINGS_KEY, av as OBSERVER_METADATA_KEY, aw as Observer, ax as ObserverRegistry, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aA as REQUIRED_PROOF_METADATA_KEY, aB as ReceiptPolicySensor, aC as RegisteredChainConfig, aD as RequiredProof, aE as RiskDecision, aF as RiskEvaluation, aG as RiskGateSensor, aH as RiskGateSensorOptions, aI as RiskSignal, aJ as RiskSignalCollector, aK as SENSITIVITY_METADATA_KEY, aL as SchemaValidationSensor, aM as Sensitivity, aN as StreamScopeSensor, aO as TLVParseSensor, aP as TLV_FIELDS_KEY, aQ as TLV_VALIDATORS_KEY, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, aV as TlvEnum, aW as TlvField, aX as TlvFieldKind, aY as TlvFieldMeta, aZ as TlvFieldOptions, a_ as TlvMinLen, a$ as TlvRange, b0 as TlvUtf8Pattern, b1 as TlvValidate, b2 as TlvValidatorMeta, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor, b6 as Witness, b7 as buildAxisLawEvaluationContext, b8 as toIntentSensorBinding, b9 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-D4Oz7vc1.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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, at as LawEvaluationSensorOptions, au as OBSERVER_BINDINGS_KEY, av as OBSERVER_METADATA_KEY, aw as Observer, ax as ObserverRegistry, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aA as REQUIRED_PROOF_METADATA_KEY, aB as ReceiptPolicySensor, aC as RegisteredChainConfig, aD as RequiredProof, aE as RiskDecision, aF as RiskEvaluation, aG as RiskGateSensor, aH as RiskGateSensorOptions, aI as RiskSignal, aJ as RiskSignalCollector, aK as SENSITIVITY_METADATA_KEY, aL as SchemaValidationSensor, aM as Sensitivity, aN as StreamScopeSensor, aO as TLVParseSensor, aP as TLV_FIELDS_KEY, aQ as TLV_VALIDATORS_KEY, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, aV as TlvEnum, aW as TlvField, aX as TlvFieldKind, aY as TlvFieldMeta, aZ as TlvFieldOptions, a_ as TlvMinLen, a$ as TlvRange, b0 as TlvUtf8Pattern, b1 as TlvValidate, b2 as TlvValidatorMeta, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor, b6 as Witness, b7 as buildAxisLawEvaluationContext, b8 as toIntentSensorBinding, b9 as toObserverBinding } from './index-D4Oz7vc1.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_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, 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';
|
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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, at as LawEvaluationSensorOptions, au as OBSERVER_BINDINGS_KEY, av as OBSERVER_METADATA_KEY, aw as Observer, ax as ObserverRegistry, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aA as REQUIRED_PROOF_METADATA_KEY, aB as ReceiptPolicySensor, aC as RegisteredChainConfig, aD as RequiredProof, aE as RiskDecision, aF as RiskEvaluation, aG as RiskGateSensor, aH as RiskGateSensorOptions, aI as RiskSignal, aJ as RiskSignalCollector, aK as SENSITIVITY_METADATA_KEY, aL as SchemaValidationSensor, aM as Sensitivity, aN as StreamScopeSensor, aO as TLVParseSensor, aP as TLV_FIELDS_KEY, aQ as TLV_VALIDATORS_KEY, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, aV as TlvEnum, aW as TlvField, aX as TlvFieldKind, aY as TlvFieldMeta, aZ as TlvFieldOptions, a_ as TlvMinLen, a$ as TlvRange, b0 as TlvUtf8Pattern, b1 as TlvValidate, b2 as TlvValidatorMeta, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor, b6 as Witness, b7 as buildAxisLawEvaluationContext, b8 as toIntentSensorBinding, b9 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-DwBRLF9t.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 AccessProfileResolverSensor, o as Axis, p as AxisAnonymous, q as AxisAuthorized, r as AxisChainEncryption, s as AxisChainRequest, t as AxisChainStatus, u as AxisChainStepResult, v as AxisChainStepStatus, w as AxisEffect, x as AxisExecutionMode, y as AxisIntentEnvelope, z as AxisIntentObserver, B as AxisIntentSensorBinding, D as AxisIntentSensorBindingOptions, E as AxisIntentSensorRef, F as AxisIntentSensorWhen, G as AxisKeyExchangeRef, H as AxisLawArticleSummary, J as AxisLawDecision, K as AxisLawEvaluationContext, L as AxisLawEvaluationResult, M as AxisLawEvaluator, N as AxisObserverBinding, P as AxisObserverBindingOptions, Q as AxisObserverContext, U as AxisObserverDefinition, V as AxisObserverEvent, W as AxisObserverRef, X as AxisObserverRegistration, Y as AxisPublic, Z as AxisRateLimit, _ as AxisRateLimitConfig, $ as BodyBudgetSensor, a0 as CAPSULE_POLICY_METADATA_KEY, a1 as CONTRACT_METADATA_KEY, a2 as CapabilityEnforcementSensor, a3 as Capsule, a4 as CapsulePolicy, a5 as CapsulePolicyOptions, a6 as CapsuleScopeMode, a7 as ChunkHashSensor, a8 as Contract, a9 as DEFAULT_CONTRACTS, aa as EntropySensor, ab as ExecutionContract, ac as ExecutionTimeoutSensor, ad as FALLBACK_CONTRACT, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ah as INTENT_METADATA_KEY, ai as INTENT_ROUTES_KEY, aj as Intent, ak as IntentAllowlistSensor, al as IntentKind, am as IntentOptions, an as IntentRegistrySensor, ao as IntentRoute, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, at as LawEvaluationSensorOptions, au as OBSERVER_BINDINGS_KEY, av as OBSERVER_METADATA_KEY, aw as Observer, ax as ObserverRegistry, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aA as REQUIRED_PROOF_METADATA_KEY, aB as ReceiptPolicySensor, aC as RegisteredChainConfig, aD as RequiredProof, aE as RiskDecision, aF as RiskEvaluation, aG as RiskGateSensor, aH as RiskGateSensorOptions, aI as RiskSignal, aJ as RiskSignalCollector, aK as SENSITIVITY_METADATA_KEY, aL as SchemaValidationSensor, aM as Sensitivity, aN as StreamScopeSensor, aO as TLVParseSensor, aP as TLV_FIELDS_KEY, aQ as TLV_VALIDATORS_KEY, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, aV as TlvEnum, aW as TlvField, aX as TlvFieldKind, aY as TlvFieldMeta, aZ as TlvFieldOptions, a_ as TlvMinLen, a$ as TlvRange, b0 as TlvUtf8Pattern, b1 as TlvValidate, b2 as TlvValidatorMeta, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor, b6 as Witness, b7 as buildAxisLawEvaluationContext, b8 as toIntentSensorBinding, b9 as toObserverBinding } from './index-DwBRLF9t.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_LOOM, PROOF_MTLS, PROOF_NONE, PROOF_WITNESS, 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';
|
package/dist/index.js
CHANGED
|
@@ -122,15 +122,19 @@ var init_capsule_policy_decorator = __esm({
|
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
// src/decorators/intent-policy.decorator.ts
|
|
125
|
+
function normalizeRequiredProof(proofs) {
|
|
126
|
+
if (proofs === void 0) return void 0;
|
|
127
|
+
const normalized = Array.from(
|
|
128
|
+
new Set(Array.isArray(proofs) ? proofs : [proofs])
|
|
129
|
+
);
|
|
130
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
131
|
+
}
|
|
125
132
|
function appendRequiredProof(target, propertyKey, proof) {
|
|
126
133
|
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
127
134
|
REQUIRED_PROOF_METADATA_KEY,
|
|
128
135
|
target,
|
|
129
136
|
propertyKey
|
|
130
|
-
) ?? [] : Reflect.getMetadata(
|
|
131
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
132
|
-
target
|
|
133
|
-
) ?? [];
|
|
137
|
+
) ?? [] : Reflect.getMetadata(REQUIRED_PROOF_METADATA_KEY, target) ?? [];
|
|
134
138
|
const merged = existing.includes(proof) ? existing : [...existing, proof];
|
|
135
139
|
if (propertyKey !== void 0) {
|
|
136
140
|
Reflect.defineMetadata(
|
|
@@ -370,7 +374,12 @@ function toIntentSensorBinding(input) {
|
|
|
370
374
|
}
|
|
371
375
|
function Intent(action, options) {
|
|
372
376
|
return (target, propertyKey) => {
|
|
373
|
-
const
|
|
377
|
+
const requiredProof = normalizeRequiredProof(options?.requiredProof);
|
|
378
|
+
const metadata = {
|
|
379
|
+
intent: action,
|
|
380
|
+
...options,
|
|
381
|
+
...requiredProof ? { requiredProof } : {}
|
|
382
|
+
};
|
|
374
383
|
Reflect.defineMetadata(INTENT_METADATA_KEY, metadata, target, propertyKey);
|
|
375
384
|
if (options?.decoder) {
|
|
376
385
|
Reflect.defineMetadata(
|
|
@@ -388,6 +397,14 @@ function Intent(action, options) {
|
|
|
388
397
|
propertyKey
|
|
389
398
|
);
|
|
390
399
|
}
|
|
400
|
+
if (requiredProof) {
|
|
401
|
+
Reflect.defineMetadata(
|
|
402
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
403
|
+
requiredProof,
|
|
404
|
+
target,
|
|
405
|
+
propertyKey
|
|
406
|
+
);
|
|
407
|
+
}
|
|
391
408
|
const routes = Reflect.getMetadata(INTENT_ROUTES_KEY, target.constructor) || [];
|
|
392
409
|
routes.push({
|
|
393
410
|
action,
|
|
@@ -396,6 +413,7 @@ function Intent(action, options) {
|
|
|
396
413
|
frame: options?.frame,
|
|
397
414
|
kind: options?.kind,
|
|
398
415
|
sensitivity: options?.sensitivity,
|
|
416
|
+
requiredProof,
|
|
399
417
|
chain: options?.chain,
|
|
400
418
|
bodyProfile: options?.bodyProfile,
|
|
401
419
|
tlv: options?.tlv,
|
|
@@ -2631,7 +2649,9 @@ var init_intent_router = __esm({
|
|
|
2631
2649
|
*/
|
|
2632
2650
|
register(intent, handler) {
|
|
2633
2651
|
if (this.handlers.has(intent)) {
|
|
2634
|
-
this.logger.warn(
|
|
2652
|
+
this.logger.warn(
|
|
2653
|
+
`Intent ${intent} is already registered; replacing handler`
|
|
2654
|
+
);
|
|
2635
2655
|
}
|
|
2636
2656
|
this.handlers.set(intent, handler);
|
|
2637
2657
|
if (typeof handler === "function" && handler.name) {
|
|
@@ -2902,7 +2922,9 @@ var init_intent_router = __esm({
|
|
|
2902
2922
|
body: bodyRes
|
|
2903
2923
|
};
|
|
2904
2924
|
}
|
|
2905
|
-
throw new Error(
|
|
2925
|
+
throw new Error(
|
|
2926
|
+
`Handler for ${intent} does not implement handle or execute`
|
|
2927
|
+
);
|
|
2906
2928
|
}
|
|
2907
2929
|
logIntent(intent, start, ok, error) {
|
|
2908
2930
|
const diff = process.hrtime(start);
|
|
@@ -2997,9 +3019,11 @@ var init_intent_router = __esm({
|
|
|
2997
3019
|
if (contract) {
|
|
2998
3020
|
this.intentContracts.set(intent, contract);
|
|
2999
3021
|
}
|
|
3022
|
+
const inlineRequiredProof = normalizeRequiredProof(meta?.requiredProof);
|
|
3000
3023
|
const proofPolicy = resolveIntentProofPolicy(proto, methodName);
|
|
3001
|
-
|
|
3002
|
-
|
|
3024
|
+
const requiredProof = inlineRequiredProof ?? proofPolicy.requiredProof;
|
|
3025
|
+
if (requiredProof.length > 0) {
|
|
3026
|
+
this.intentRequiredProof.set(intent, requiredProof);
|
|
3003
3027
|
}
|
|
3004
3028
|
const rateLimit = Reflect.getMetadata(
|
|
3005
3029
|
AXIS_RATE_LIMIT_KEY,
|
|
@@ -3608,6 +3632,7 @@ var init_intent_router = __esm({
|
|
|
3608
3632
|
intent: meta.intent,
|
|
3609
3633
|
version: 1,
|
|
3610
3634
|
bodyProfile: meta.bodyProfile || "TLV_MAP",
|
|
3635
|
+
dtoName: meta.dto.name || void 0,
|
|
3611
3636
|
fields: extracted.fields.map((f) => ({
|
|
3612
3637
|
name: f.name,
|
|
3613
3638
|
tlv: f.tag,
|