@nextera.one/axis-server-sdk 2.3.8 → 2.3.9
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-DRnTsYrk.d.ts → index-DPQEO0Qh.d.ts} +3 -0
- package/dist/{index-Bdahn8mq.d.mts → index-DfG00R_f.d.mts} +3 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +67 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -26
- 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 +67 -26
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +67 -26
- 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 LawEvaluationSensor, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ay as ReceiptPolicySensor, aD as RiskGateSensor, aE as RiskGateSensorOptions, aG as RiskSignalCollector, aI as SchemaValidationSensor, aK as StreamScopeSensor, aL as TLVParseSensor, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, b0 as TpsSensor, b1 as TpsSensorOptions, b2 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 LawEvaluationSensor, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ay as ReceiptPolicySensor, aD as RiskGateSensor, aE as RiskGateSensorOptions, aG as RiskSignalCollector, aI as SchemaValidationSensor, aK as StreamScopeSensor, aL as TLVParseSensor, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, b0 as TpsSensor, b1 as TpsSensorOptions, b2 as VarintHardeningSensor } from '../index-DfG00R_f.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 LawEvaluationSensor, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ay as ReceiptPolicySensor, aD as RiskGateSensor, aE as RiskGateSensorOptions, aG as RiskSignalCollector, aI as SchemaValidationSensor, aK as StreamScopeSensor, aL as TLVParseSensor, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, b0 as TpsSensor, b1 as TpsSensorOptions, b2 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 LawEvaluationSensor, av as ProofPresenceSensor, aw as ProtocolStrictSensor, ay as ReceiptPolicySensor, aD as RiskGateSensor, aE as RiskGateSensorOptions, aG as RiskSignalCollector, aI as SchemaValidationSensor, aK as StreamScopeSensor, aL as TLVParseSensor, aO as TickAuthCapsuleRef, aP as TickAuthSensor, aQ as TickAuthSensorOptions, aR as TickAuthVerifier, b0 as TpsSensor, b1 as TpsSensorOptions, b2 as VarintHardeningSensor } from '../index-DPQEO0Qh.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
|
@@ -2588,6 +2588,10 @@ var init_intent_router = __esm({
|
|
|
2588
2588
|
this.handlerIntents = /* @__PURE__ */ new Map();
|
|
2589
2589
|
/** Handler class name → intent namespace prefix (from @Handler('auth')) */
|
|
2590
2590
|
this.handlerPrefixes = /* @__PURE__ */ new Map();
|
|
2591
|
+
/** Handler namespace prefix → handler class name, used by `handler...intent` lookup. */
|
|
2592
|
+
this.handlerByPrefix = /* @__PURE__ */ new Map();
|
|
2593
|
+
/** Intent → handler class name, avoids scanning handlerIntents for normal lookups. */
|
|
2594
|
+
this.handlerByIntent = /* @__PURE__ */ new Map();
|
|
2591
2595
|
/** Handler class name → class-level sensor bindings (from @HandlerSensors) */
|
|
2592
2596
|
this.handlerClassSensors = /* @__PURE__ */ new Map();
|
|
2593
2597
|
/** Handler class name → class-level observer bindings (from @Handler({ observe: [...] })) */
|
|
@@ -2597,35 +2601,37 @@ var init_intent_router = __esm({
|
|
|
2597
2601
|
this.sensorRegistry = sensorRegistry;
|
|
2598
2602
|
}
|
|
2599
2603
|
getSchema(intent) {
|
|
2600
|
-
return this.intentSchemas.get(intent);
|
|
2604
|
+
return this.intentSchemas.get(this.resolveIntentAlias(intent));
|
|
2601
2605
|
}
|
|
2602
2606
|
getValidators(intent) {
|
|
2603
|
-
return this.intentValidators.get(intent);
|
|
2607
|
+
return this.intentValidators.get(this.resolveIntentAlias(intent));
|
|
2604
2608
|
}
|
|
2605
2609
|
has(intent) {
|
|
2606
|
-
|
|
2610
|
+
const resolved = this.resolveIntentAlias(intent);
|
|
2611
|
+
return this.handlers.has(resolved) || _IntentRouter.BUILTIN_INTENTS.has(resolved);
|
|
2607
2612
|
}
|
|
2608
2613
|
getRegisteredIntents() {
|
|
2609
2614
|
return [..._IntentRouter.BUILTIN_INTENTS, ...this.handlers.keys()];
|
|
2610
2615
|
}
|
|
2611
2616
|
getIntentEntry(intent) {
|
|
2612
|
-
|
|
2617
|
+
const resolved = this.resolveIntentAlias(intent);
|
|
2618
|
+
if (!this.has(resolved)) return null;
|
|
2613
2619
|
return {
|
|
2614
|
-
schema: this.intentSchemas.get(
|
|
2615
|
-
validators: this.intentValidators.get(
|
|
2616
|
-
hasSensors: this.intentSensors.has(
|
|
2617
|
-
builtin: _IntentRouter.BUILTIN_INTENTS.has(
|
|
2618
|
-
kind: this.intentKinds.get(
|
|
2619
|
-
chain: this.intentChains.get(
|
|
2620
|
-
capsulePolicy: this.intentCapsulePolicies.get(
|
|
2621
|
-
observerCount: this.getObservers(
|
|
2620
|
+
schema: this.intentSchemas.get(resolved),
|
|
2621
|
+
validators: this.intentValidators.get(resolved),
|
|
2622
|
+
hasSensors: this.intentSensors.has(resolved),
|
|
2623
|
+
builtin: _IntentRouter.BUILTIN_INTENTS.has(resolved),
|
|
2624
|
+
kind: this.intentKinds.get(resolved),
|
|
2625
|
+
chain: this.intentChains.get(resolved),
|
|
2626
|
+
capsulePolicy: this.intentCapsulePolicies.get(resolved),
|
|
2627
|
+
observerCount: this.getObservers(resolved).length
|
|
2622
2628
|
};
|
|
2623
2629
|
}
|
|
2624
2630
|
getChainConfig(intent) {
|
|
2625
|
-
return this.intentChains.get(intent);
|
|
2631
|
+
return this.intentChains.get(this.resolveIntentAlias(intent));
|
|
2626
2632
|
}
|
|
2627
2633
|
getObservers(intent) {
|
|
2628
|
-
return this.intentObservers.get(intent) || [];
|
|
2634
|
+
return this.intentObservers.get(this.resolveIntentAlias(intent)) || [];
|
|
2629
2635
|
}
|
|
2630
2636
|
/**
|
|
2631
2637
|
* Registers a handler for a specific intent.
|
|
@@ -2668,6 +2674,14 @@ var init_intent_router = __esm({
|
|
|
2668
2674
|
);
|
|
2669
2675
|
const handlerSensors = Reflect.getMetadata(HANDLER_SENSORS_KEY, instance.constructor) || [];
|
|
2670
2676
|
const handlerObservers = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, instance.constructor) || [];
|
|
2677
|
+
if (prefix) {
|
|
2678
|
+
this.trackHandlerMeta(
|
|
2679
|
+
instance.constructor.name,
|
|
2680
|
+
prefix,
|
|
2681
|
+
handlerSensors,
|
|
2682
|
+
handlerObservers
|
|
2683
|
+
);
|
|
2684
|
+
}
|
|
2671
2685
|
const proto = Object.getPrototypeOf(instance);
|
|
2672
2686
|
for (const route of routes) {
|
|
2673
2687
|
const intentName = route.absolute ? route.action : `${prefix}.${route.action}`;
|
|
@@ -2727,7 +2741,7 @@ var init_intent_router = __esm({
|
|
|
2727
2741
|
try {
|
|
2728
2742
|
const intentBytes = frame.headers.get(import_axis_protocol.TLV_INTENT);
|
|
2729
2743
|
if (!intentBytes) throw new Error("Missing intent");
|
|
2730
|
-
intent = this.decoder.decode(intentBytes);
|
|
2744
|
+
intent = this.resolveIntentAlias(this.decoder.decode(intentBytes));
|
|
2731
2745
|
handlerRef = this.intentHandlerRefs.get(intent);
|
|
2732
2746
|
const observerBindings = this.getObservers(intent);
|
|
2733
2747
|
await this.emitIntentObservers(observerBindings, {
|
|
@@ -3037,25 +3051,25 @@ var init_intent_router = __esm({
|
|
|
3037
3051
|
}
|
|
3038
3052
|
// ─── Policy Getters ────────────────────────────────────────────────────────
|
|
3039
3053
|
getSensitivity(intent) {
|
|
3040
|
-
return this.intentSensitivity.get(intent);
|
|
3054
|
+
return this.intentSensitivity.get(this.resolveIntentAlias(intent));
|
|
3041
3055
|
}
|
|
3042
3056
|
getContract(intent) {
|
|
3043
|
-
return this.intentContracts.get(intent);
|
|
3057
|
+
return this.intentContracts.get(this.resolveIntentAlias(intent));
|
|
3044
3058
|
}
|
|
3045
3059
|
getRequiredProof(intent) {
|
|
3046
|
-
return this.intentRequiredProof.get(intent);
|
|
3060
|
+
return this.intentRequiredProof.get(this.resolveIntentAlias(intent));
|
|
3047
3061
|
}
|
|
3048
3062
|
isPublic(intent) {
|
|
3049
|
-
return this.publicIntents.has(intent);
|
|
3063
|
+
return this.publicIntents.has(this.resolveIntentAlias(intent));
|
|
3050
3064
|
}
|
|
3051
3065
|
isAnonymous(intent) {
|
|
3052
|
-
return this.anonymousIntents.has(intent);
|
|
3066
|
+
return this.anonymousIntents.has(this.resolveIntentAlias(intent));
|
|
3053
3067
|
}
|
|
3054
3068
|
isAuthorized(intent) {
|
|
3055
|
-
return this.authorizedIntents.has(intent);
|
|
3069
|
+
return this.authorizedIntents.has(this.resolveIntentAlias(intent));
|
|
3056
3070
|
}
|
|
3057
3071
|
getRateLimit(intent) {
|
|
3058
|
-
return this.intentRateLimits.get(intent);
|
|
3072
|
+
return this.intentRateLimits.get(this.resolveIntentAlias(intent));
|
|
3059
3073
|
}
|
|
3060
3074
|
// ─── Handler-level Getters ─────────────────────────────────────────────────
|
|
3061
3075
|
/** All intents registered under the given handler class name. */
|
|
@@ -3064,10 +3078,8 @@ var init_intent_router = __esm({
|
|
|
3064
3078
|
}
|
|
3065
3079
|
/** Returns the handler class name that owns the given intent, or undefined if not found. */
|
|
3066
3080
|
getHandlerByIntent(intent) {
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
}
|
|
3070
|
-
return void 0;
|
|
3081
|
+
const resolved = this.resolveIntentAlias(intent);
|
|
3082
|
+
return this.handlerByIntent.get(resolved);
|
|
3071
3083
|
}
|
|
3072
3084
|
/** All registered handler class names. */
|
|
3073
3085
|
getRegisteredHandlers() {
|
|
@@ -3143,6 +3155,33 @@ var init_intent_router = __esm({
|
|
|
3143
3155
|
getHandlerClassObservers(handlerName) {
|
|
3144
3156
|
return this.handlerClassObservers.get(handlerName);
|
|
3145
3157
|
}
|
|
3158
|
+
/**
|
|
3159
|
+
* Resolves the optional `handler...intent` wire shorthand to a registered
|
|
3160
|
+
* canonical intent. Existing exact intent names always win.
|
|
3161
|
+
*/
|
|
3162
|
+
resolveIntentAlias(intent) {
|
|
3163
|
+
if (this.handlers.has(intent) || _IntentRouter.BUILTIN_INTENTS.has(intent)) {
|
|
3164
|
+
return intent;
|
|
3165
|
+
}
|
|
3166
|
+
const separator = "...";
|
|
3167
|
+
const separatorIndex = intent.indexOf(separator);
|
|
3168
|
+
if (separatorIndex <= 0) return intent;
|
|
3169
|
+
const handlerKey = intent.slice(0, separatorIndex);
|
|
3170
|
+
const action = intent.slice(separatorIndex + separator.length);
|
|
3171
|
+
if (!handlerKey || !action) return intent;
|
|
3172
|
+
const handlerName = this.handlerByPrefix.get(handlerKey) ?? (this.handlerIntents.has(handlerKey) ? handlerKey : void 0);
|
|
3173
|
+
if (!handlerName) return intent;
|
|
3174
|
+
const prefix = this.getHandlerPrefix(handlerName) ?? handlerKey;
|
|
3175
|
+
const handlerIntents = this.getHandlerIntents(handlerName);
|
|
3176
|
+
const prefixedIntent = `${prefix}.${action}`;
|
|
3177
|
+
if (handlerIntents.includes(prefixedIntent)) return prefixedIntent;
|
|
3178
|
+
if (handlerIntents.includes(action)) return action;
|
|
3179
|
+
const suffix = `.${action}`;
|
|
3180
|
+
const suffixMatches = handlerIntents.filter(
|
|
3181
|
+
(candidate) => candidate.endsWith(suffix)
|
|
3182
|
+
);
|
|
3183
|
+
return suffixMatches.length === 1 ? suffixMatches[0] : intent;
|
|
3184
|
+
}
|
|
3146
3185
|
/** Full summary of a handler's registered intents and aggregated policies. Returns null if unknown. */
|
|
3147
3186
|
getHandlerSummary(handlerName) {
|
|
3148
3187
|
const intents = this.getHandlerIntents(handlerName);
|
|
@@ -3219,6 +3258,7 @@ var init_intent_router = __esm({
|
|
|
3219
3258
|
}
|
|
3220
3259
|
}
|
|
3221
3260
|
trackHandlerIntent(handlerName, intent) {
|
|
3261
|
+
this.handlerByIntent.set(intent, handlerName);
|
|
3222
3262
|
const existing = this.handlerIntents.get(handlerName);
|
|
3223
3263
|
if (existing) {
|
|
3224
3264
|
if (!existing.includes(intent)) existing.push(intent);
|
|
@@ -3232,6 +3272,7 @@ var init_intent_router = __esm({
|
|
|
3232
3272
|
*/
|
|
3233
3273
|
trackHandlerMeta(className, prefix, sensors, observers) {
|
|
3234
3274
|
this.handlerPrefixes.set(className, prefix);
|
|
3275
|
+
this.handlerByPrefix.set(prefix, className);
|
|
3235
3276
|
if (sensors.length > 0) {
|
|
3236
3277
|
this.handlerClassSensors.set(
|
|
3237
3278
|
className,
|