@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
package/dist/sensors/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { n as AccessProfileResolverSensor, $ as BodyBudgetSensor, a2 as CapabilityEnforcementSensor, a7 as ChunkHashSensor, aa as EntropySensor, ac as ExecutionTimeoutSensor, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ak as IntentAllowlistSensor, an as IntentRegistrySensor, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aB as ReceiptPolicySensor, aG as RiskGateSensor, aH as RiskGateSensorOptions, aJ as RiskSignalCollector, aL as SchemaValidationSensor, aN as StreamScopeSensor, aO as TLVParseSensor, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor } from '../index-
|
|
1
|
+
export { n as AccessProfileResolverSensor, $ as BodyBudgetSensor, a2 as CapabilityEnforcementSensor, a7 as ChunkHashSensor, aa as EntropySensor, ac as ExecutionTimeoutSensor, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ak as IntentAllowlistSensor, an as IntentRegistrySensor, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aB as ReceiptPolicySensor, aG as RiskGateSensor, aH as RiskGateSensorOptions, aJ as RiskSignalCollector, aL as SchemaValidationSensor, aN as StreamScopeSensor, aO as TLVParseSensor, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor } from '../index-D4Oz7vc1.mjs';
|
|
2
2
|
import '../axis-sensor-BLUemDiZ.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@nextera.one/axis-protocol';
|
package/dist/sensors/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { n as AccessProfileResolverSensor, $ as BodyBudgetSensor, a2 as CapabilityEnforcementSensor, a7 as ChunkHashSensor, aa as EntropySensor, ac as ExecutionTimeoutSensor, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ak as IntentAllowlistSensor, an as IntentRegistrySensor, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aB as ReceiptPolicySensor, aG as RiskGateSensor, aH as RiskGateSensorOptions, aJ as RiskSignalCollector, aL as SchemaValidationSensor, aN as StreamScopeSensor, aO as TLVParseSensor, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor } from '../index-
|
|
1
|
+
export { n as AccessProfileResolverSensor, $ as BodyBudgetSensor, a2 as CapabilityEnforcementSensor, a7 as ChunkHashSensor, aa as EntropySensor, ac as ExecutionTimeoutSensor, ae as FrameBudgetSensor, af as FrameHeaderSanitySensor, ag as HeaderTLVLimitSensor, ak as IntentAllowlistSensor, an as IntentRegistrySensor, ap as LawArticlePresenceMode, aq as LawArticlePresenceSensor, ar as LawArticlePresenceSensorOptions, as as LawEvaluationSensor, ay as ProofPresenceSensor, az as ProtocolStrictSensor, aB as ReceiptPolicySensor, aG as RiskGateSensor, aH as RiskGateSensorOptions, aJ as RiskSignalCollector, aL as SchemaValidationSensor, aN as StreamScopeSensor, aO as TLVParseSensor, aR as TickAuthCapsuleRef, aS as TickAuthSensor, aT as TickAuthSensorOptions, aU as TickAuthVerifier, b3 as TpsSensor, b4 as TpsSensorOptions, b5 as VarintHardeningSensor } from '../index-DwBRLF9t.js';
|
|
2
2
|
import '../axis-sensor-BLUemDiZ.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@nextera.one/axis-protocol';
|
package/dist/sensors/index.js
CHANGED
|
@@ -381,15 +381,19 @@ var init_capsule_policy_decorator = __esm({
|
|
|
381
381
|
});
|
|
382
382
|
|
|
383
383
|
// src/decorators/intent-policy.decorator.ts
|
|
384
|
+
function normalizeRequiredProof(proofs) {
|
|
385
|
+
if (proofs === void 0) return void 0;
|
|
386
|
+
const normalized = Array.from(
|
|
387
|
+
new Set(Array.isArray(proofs) ? proofs : [proofs])
|
|
388
|
+
);
|
|
389
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
390
|
+
}
|
|
384
391
|
function appendRequiredProof(target, propertyKey, proof) {
|
|
385
392
|
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
386
393
|
REQUIRED_PROOF_METADATA_KEY,
|
|
387
394
|
target,
|
|
388
395
|
propertyKey
|
|
389
|
-
) ?? [] : Reflect.getMetadata(
|
|
390
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
391
|
-
target
|
|
392
|
-
) ?? [];
|
|
396
|
+
) ?? [] : Reflect.getMetadata(REQUIRED_PROOF_METADATA_KEY, target) ?? [];
|
|
393
397
|
const merged = existing.includes(proof) ? existing : [...existing, proof];
|
|
394
398
|
if (propertyKey !== void 0) {
|
|
395
399
|
Reflect.defineMetadata(
|
|
@@ -629,7 +633,12 @@ function toIntentSensorBinding(input) {
|
|
|
629
633
|
}
|
|
630
634
|
function Intent(action, options) {
|
|
631
635
|
return (target, propertyKey) => {
|
|
632
|
-
const
|
|
636
|
+
const requiredProof = normalizeRequiredProof(options?.requiredProof);
|
|
637
|
+
const metadata = {
|
|
638
|
+
intent: action,
|
|
639
|
+
...options,
|
|
640
|
+
...requiredProof ? { requiredProof } : {}
|
|
641
|
+
};
|
|
633
642
|
Reflect.defineMetadata(INTENT_METADATA_KEY, metadata, target, propertyKey);
|
|
634
643
|
if (options?.decoder) {
|
|
635
644
|
Reflect.defineMetadata(
|
|
@@ -647,6 +656,14 @@ function Intent(action, options) {
|
|
|
647
656
|
propertyKey
|
|
648
657
|
);
|
|
649
658
|
}
|
|
659
|
+
if (requiredProof) {
|
|
660
|
+
Reflect.defineMetadata(
|
|
661
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
662
|
+
requiredProof,
|
|
663
|
+
target,
|
|
664
|
+
propertyKey
|
|
665
|
+
);
|
|
666
|
+
}
|
|
650
667
|
const routes = Reflect.getMetadata(INTENT_ROUTES_KEY, target.constructor) || [];
|
|
651
668
|
routes.push({
|
|
652
669
|
action,
|
|
@@ -655,6 +672,7 @@ function Intent(action, options) {
|
|
|
655
672
|
frame: options?.frame,
|
|
656
673
|
kind: options?.kind,
|
|
657
674
|
sensitivity: options?.sensitivity,
|
|
675
|
+
requiredProof,
|
|
658
676
|
chain: options?.chain,
|
|
659
677
|
bodyProfile: options?.bodyProfile,
|
|
660
678
|
tlv: options?.tlv,
|
|
@@ -2776,7 +2794,9 @@ var init_intent_router = __esm({
|
|
|
2776
2794
|
*/
|
|
2777
2795
|
register(intent, handler) {
|
|
2778
2796
|
if (this.handlers.has(intent)) {
|
|
2779
|
-
this.logger.warn(
|
|
2797
|
+
this.logger.warn(
|
|
2798
|
+
`Intent ${intent} is already registered; replacing handler`
|
|
2799
|
+
);
|
|
2780
2800
|
}
|
|
2781
2801
|
this.handlers.set(intent, handler);
|
|
2782
2802
|
if (typeof handler === "function" && handler.name) {
|
|
@@ -3047,7 +3067,9 @@ var init_intent_router = __esm({
|
|
|
3047
3067
|
body: bodyRes
|
|
3048
3068
|
};
|
|
3049
3069
|
}
|
|
3050
|
-
throw new Error(
|
|
3070
|
+
throw new Error(
|
|
3071
|
+
`Handler for ${intent} does not implement handle or execute`
|
|
3072
|
+
);
|
|
3051
3073
|
}
|
|
3052
3074
|
logIntent(intent, start, ok, error) {
|
|
3053
3075
|
const diff = process.hrtime(start);
|
|
@@ -3142,9 +3164,11 @@ var init_intent_router = __esm({
|
|
|
3142
3164
|
if (contract) {
|
|
3143
3165
|
this.intentContracts.set(intent, contract);
|
|
3144
3166
|
}
|
|
3167
|
+
const inlineRequiredProof = normalizeRequiredProof(meta?.requiredProof);
|
|
3145
3168
|
const proofPolicy = resolveIntentProofPolicy(proto, methodName);
|
|
3146
|
-
|
|
3147
|
-
|
|
3169
|
+
const requiredProof = inlineRequiredProof ?? proofPolicy.requiredProof;
|
|
3170
|
+
if (requiredProof.length > 0) {
|
|
3171
|
+
this.intentRequiredProof.set(intent, requiredProof);
|
|
3148
3172
|
}
|
|
3149
3173
|
const rateLimit = Reflect.getMetadata(
|
|
3150
3174
|
AXIS_RATE_LIMIT_KEY,
|
|
@@ -3753,6 +3777,7 @@ var init_intent_router = __esm({
|
|
|
3753
3777
|
intent: meta.intent,
|
|
3754
3778
|
version: 1,
|
|
3755
3779
|
bodyProfile: meta.bodyProfile || "TLV_MAP",
|
|
3780
|
+
dtoName: meta.dto.name || void 0,
|
|
3756
3781
|
fields: extracted.fields.map((f) => ({
|
|
3757
3782
|
name: f.name,
|
|
3758
3783
|
tlv: f.tag,
|