@nextera.one/axis-server-sdk 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-QGwgvVDY.d.ts → index-CwXlBXJf.d.ts} +2 -0
- package/dist/{index-C4ApiXHX.d.mts → index-ldPtIocV.d.mts} +2 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- 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 +105 -4
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +105 -4
- 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 { m as AccessProfileResolverSensor, Y as BodyBudgetSensor, $ as CapabilityEnforcementSensor, a4 as ChunkHashSensor, a7 as EntropySensor, a9 as ExecutionTimeoutSensor, ab as FrameBudgetSensor, ac as FrameHeaderSanitySensor, ad as HeaderTLVLimitSensor, ah as IntentAllowlistSensor, ak as IntentRegistrySensor, am as LawEvaluationSensor, as as ProofPresenceSensor, at as ProtocolStrictSensor, av as ReceiptPolicySensor, aB as RiskGateSensor, aC as RiskGateSensorOptions, aE as RiskSignalCollector, aG as SchemaValidationSensor, aI as StreamScopeSensor, aJ as TLVParseSensor, aM as TickAuthCapsuleRef, aN as TickAuthSensor, aO as TickAuthSensorOptions, aP as TickAuthVerifier, a_ as TpsSensor, a$ as TpsSensorOptions, b0 as VarintHardeningSensor } from '../index-
|
|
1
|
+
export { m as AccessProfileResolverSensor, Y as BodyBudgetSensor, $ as CapabilityEnforcementSensor, a4 as ChunkHashSensor, a7 as EntropySensor, a9 as ExecutionTimeoutSensor, ab as FrameBudgetSensor, ac as FrameHeaderSanitySensor, ad as HeaderTLVLimitSensor, ah as IntentAllowlistSensor, ak as IntentRegistrySensor, am as LawEvaluationSensor, as as ProofPresenceSensor, at as ProtocolStrictSensor, av as ReceiptPolicySensor, aB as RiskGateSensor, aC as RiskGateSensorOptions, aE as RiskSignalCollector, aG as SchemaValidationSensor, aI as StreamScopeSensor, aJ as TLVParseSensor, aM as TickAuthCapsuleRef, aN as TickAuthSensor, aO as TickAuthSensorOptions, aP as TickAuthVerifier, a_ as TpsSensor, a$ as TpsSensorOptions, b0 as VarintHardeningSensor } from '../index-ldPtIocV.mjs';
|
|
2
2
|
import '../axis-sensor-GBEI3Fab.mjs';
|
|
3
3
|
import '../cce-pipeline-B-zUBHo3.mjs';
|
|
4
4
|
import '@nextera.one/axis-protocol';
|
package/dist/sensors/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { m as AccessProfileResolverSensor, Y as BodyBudgetSensor, $ as CapabilityEnforcementSensor, a4 as ChunkHashSensor, a7 as EntropySensor, a9 as ExecutionTimeoutSensor, ab as FrameBudgetSensor, ac as FrameHeaderSanitySensor, ad as HeaderTLVLimitSensor, ah as IntentAllowlistSensor, ak as IntentRegistrySensor, am as LawEvaluationSensor, as as ProofPresenceSensor, at as ProtocolStrictSensor, av as ReceiptPolicySensor, aB as RiskGateSensor, aC as RiskGateSensorOptions, aE as RiskSignalCollector, aG as SchemaValidationSensor, aI as StreamScopeSensor, aJ as TLVParseSensor, aM as TickAuthCapsuleRef, aN as TickAuthSensor, aO as TickAuthSensorOptions, aP as TickAuthVerifier, a_ as TpsSensor, a$ as TpsSensorOptions, b0 as VarintHardeningSensor } from '../index-
|
|
1
|
+
export { m as AccessProfileResolverSensor, Y as BodyBudgetSensor, $ as CapabilityEnforcementSensor, a4 as ChunkHashSensor, a7 as EntropySensor, a9 as ExecutionTimeoutSensor, ab as FrameBudgetSensor, ac as FrameHeaderSanitySensor, ad as HeaderTLVLimitSensor, ah as IntentAllowlistSensor, ak as IntentRegistrySensor, am as LawEvaluationSensor, as as ProofPresenceSensor, at as ProtocolStrictSensor, av as ReceiptPolicySensor, aB as RiskGateSensor, aC as RiskGateSensorOptions, aE as RiskSignalCollector, aG as SchemaValidationSensor, aI as StreamScopeSensor, aJ as TLVParseSensor, aM as TickAuthCapsuleRef, aN as TickAuthSensor, aO as TickAuthSensorOptions, aP as TickAuthVerifier, a_ as TpsSensor, a$ as TpsSensorOptions, b0 as VarintHardeningSensor } from '../index-CwXlBXJf.js';
|
|
2
2
|
import '../axis-sensor-GBEI3Fab.js';
|
|
3
3
|
import '../cce-pipeline-DbGBSsCG.js';
|
|
4
4
|
import '@nextera.one/axis-protocol';
|
package/dist/sensors/index.js
CHANGED
|
@@ -1221,6 +1221,7 @@ var init_axis_chain_executor = __esm({
|
|
|
1221
1221
|
timestamp: startedAt,
|
|
1222
1222
|
chainId: envelope.chainId,
|
|
1223
1223
|
stepId: step.stepId,
|
|
1224
|
+
handler: step.handler,
|
|
1224
1225
|
intent: step.intent,
|
|
1225
1226
|
envelope,
|
|
1226
1227
|
step,
|
|
@@ -1255,6 +1256,7 @@ var init_axis_chain_executor = __esm({
|
|
|
1255
1256
|
timestamp: finishedAt,
|
|
1256
1257
|
chainId: envelope.chainId,
|
|
1257
1258
|
stepId: step.stepId,
|
|
1259
|
+
handler: step.handler,
|
|
1258
1260
|
intent: step.intent,
|
|
1259
1261
|
effect,
|
|
1260
1262
|
envelope,
|
|
@@ -1269,6 +1271,7 @@ var init_axis_chain_executor = __esm({
|
|
|
1269
1271
|
timestamp: finishedAt,
|
|
1270
1272
|
chainId: envelope.chainId,
|
|
1271
1273
|
stepId: step.stepId,
|
|
1274
|
+
handler: step.handler,
|
|
1272
1275
|
intent: step.intent,
|
|
1273
1276
|
envelope,
|
|
1274
1277
|
step,
|
|
@@ -1283,6 +1286,7 @@ var init_axis_chain_executor = __esm({
|
|
|
1283
1286
|
timestamp: finishedAt,
|
|
1284
1287
|
chainId: envelope.chainId,
|
|
1285
1288
|
stepId: step.stepId,
|
|
1289
|
+
handler: step.handler,
|
|
1286
1290
|
intent: step.intent,
|
|
1287
1291
|
effect,
|
|
1288
1292
|
envelope,
|
|
@@ -1313,6 +1317,7 @@ var init_axis_chain_executor = __esm({
|
|
|
1313
1317
|
timestamp: finishedAt,
|
|
1314
1318
|
chainId: envelope.chainId,
|
|
1315
1319
|
stepId: step.stepId,
|
|
1320
|
+
handler: step.handler,
|
|
1316
1321
|
intent: step.intent,
|
|
1317
1322
|
error: error.message,
|
|
1318
1323
|
envelope,
|
|
@@ -2532,6 +2537,8 @@ var init_intent_router = __esm({
|
|
|
2532
2537
|
this.handlers = /* @__PURE__ */ new Map();
|
|
2533
2538
|
/** Per-intent sensor refs (resolved through SensorRegistry at call time) */
|
|
2534
2539
|
this.intentSensors = /* @__PURE__ */ new Map();
|
|
2540
|
+
/** Per-intent handler identifier (e.g. UsersHandler.usersPage) */
|
|
2541
|
+
this.intentHandlerRefs = /* @__PURE__ */ new Map();
|
|
2535
2542
|
/** Per-intent body decoders */
|
|
2536
2543
|
this.intentDecoders = /* @__PURE__ */ new Map();
|
|
2537
2544
|
/** Per-intent TLV schemas */
|
|
@@ -2607,6 +2614,16 @@ var init_intent_router = __esm({
|
|
|
2607
2614
|
*/
|
|
2608
2615
|
register(intent, handler) {
|
|
2609
2616
|
this.handlers.set(intent, handler);
|
|
2617
|
+
if (typeof handler === "function" && handler.name) {
|
|
2618
|
+
this.intentHandlerRefs.set(intent, handler.name);
|
|
2619
|
+
} else if (handler && typeof handler === "object") {
|
|
2620
|
+
const objectName = handler.constructor?.name;
|
|
2621
|
+
if (objectName) {
|
|
2622
|
+
this.intentHandlerRefs.set(intent, `${objectName}.handle`);
|
|
2623
|
+
}
|
|
2624
|
+
} else {
|
|
2625
|
+
this.intentHandlerRefs.set(intent, `intent:${intent}`);
|
|
2626
|
+
}
|
|
2610
2627
|
}
|
|
2611
2628
|
/**
|
|
2612
2629
|
* Automatically registers all `@Intent`-decorated methods from a handler instance.
|
|
@@ -2637,6 +2654,10 @@ var init_intent_router = __esm({
|
|
|
2637
2654
|
} else {
|
|
2638
2655
|
this.register(intentName, fn);
|
|
2639
2656
|
}
|
|
2657
|
+
this.intentHandlerRefs.set(
|
|
2658
|
+
intentName,
|
|
2659
|
+
`${instance.constructor.name}.${String(route.methodName)}`
|
|
2660
|
+
);
|
|
2640
2661
|
this.registerIntentMeta(
|
|
2641
2662
|
intentName,
|
|
2642
2663
|
proto,
|
|
@@ -2677,15 +2698,18 @@ var init_intent_router = __esm({
|
|
|
2677
2698
|
async route(frame) {
|
|
2678
2699
|
const start = process.hrtime();
|
|
2679
2700
|
let intent = "unknown";
|
|
2701
|
+
let handlerRef;
|
|
2680
2702
|
try {
|
|
2681
2703
|
const intentBytes = frame.headers.get(import_axis_protocol.TLV_INTENT);
|
|
2682
2704
|
if (!intentBytes) throw new Error("Missing intent");
|
|
2683
2705
|
intent = this.decoder.decode(intentBytes);
|
|
2706
|
+
handlerRef = this.intentHandlerRefs.get(intent);
|
|
2684
2707
|
const observerBindings = this.getObservers(intent);
|
|
2685
2708
|
await this.emitIntentObservers(observerBindings, {
|
|
2686
2709
|
event: "intent.received",
|
|
2687
2710
|
timestamp: Date.now(),
|
|
2688
2711
|
intent,
|
|
2712
|
+
handler: handlerRef,
|
|
2689
2713
|
frame
|
|
2690
2714
|
});
|
|
2691
2715
|
let effect;
|
|
@@ -2815,6 +2839,7 @@ var init_intent_router = __esm({
|
|
|
2815
2839
|
event: "intent.completed",
|
|
2816
2840
|
timestamp: Date.now(),
|
|
2817
2841
|
intent,
|
|
2842
|
+
handler: handlerRef,
|
|
2818
2843
|
frame,
|
|
2819
2844
|
effect,
|
|
2820
2845
|
metadata: effect.metadata
|
|
@@ -2826,6 +2851,7 @@ var init_intent_router = __esm({
|
|
|
2826
2851
|
event: "intent.failed",
|
|
2827
2852
|
timestamp: Date.now(),
|
|
2828
2853
|
intent,
|
|
2854
|
+
handler: handlerRef,
|
|
2829
2855
|
frame,
|
|
2830
2856
|
error: e.message
|
|
2831
2857
|
});
|
|
@@ -2992,8 +3018,11 @@ var init_intent_router = __esm({
|
|
|
2992
3018
|
return this.intentRateLimits.get(intent);
|
|
2993
3019
|
}
|
|
2994
3020
|
async emitIntentObservers(bindings, context) {
|
|
2995
|
-
if (!this.observerDispatcher
|
|
2996
|
-
await this.observerDispatcher.dispatch(
|
|
3021
|
+
if (!this.observerDispatcher) return;
|
|
3022
|
+
await this.observerDispatcher.dispatch(
|
|
3023
|
+
bindings.length > 0 ? bindings : void 0,
|
|
3024
|
+
context
|
|
3025
|
+
);
|
|
2997
3026
|
}
|
|
2998
3027
|
async runIntentSensors(sensorBindings, intent, frame, stage, extras) {
|
|
2999
3028
|
for (const binding of sensorBindings) {
|
|
@@ -8159,6 +8188,61 @@ var init_disk_upload_file_store = __esm({
|
|
|
8159
8188
|
function unique(values) {
|
|
8160
8189
|
return Array.from(new Set(values));
|
|
8161
8190
|
}
|
|
8191
|
+
function matchesObserverIntent(intents, intent) {
|
|
8192
|
+
if (!intents || intents.length === 0) {
|
|
8193
|
+
return true;
|
|
8194
|
+
}
|
|
8195
|
+
if (!intent) {
|
|
8196
|
+
return false;
|
|
8197
|
+
}
|
|
8198
|
+
return intents.includes(intent);
|
|
8199
|
+
}
|
|
8200
|
+
function normalizeHandlerToken(value) {
|
|
8201
|
+
return value.trim().toLowerCase();
|
|
8202
|
+
}
|
|
8203
|
+
function matchesObserverHandler(handlers, handler) {
|
|
8204
|
+
if (!handlers || handlers.length === 0) {
|
|
8205
|
+
return true;
|
|
8206
|
+
}
|
|
8207
|
+
if (!handler) {
|
|
8208
|
+
return false;
|
|
8209
|
+
}
|
|
8210
|
+
const normalizedHandler = normalizeHandlerToken(handler);
|
|
8211
|
+
return handlers.some((candidate) => {
|
|
8212
|
+
if (!candidate) {
|
|
8213
|
+
return false;
|
|
8214
|
+
}
|
|
8215
|
+
const normalizedCandidate = normalizeHandlerToken(candidate);
|
|
8216
|
+
return normalizedHandler === normalizedCandidate || normalizedHandler.endsWith(`.${normalizedCandidate}`) || normalizedHandler.startsWith(`${normalizedCandidate}.`) || normalizedCandidate.endsWith(`.${normalizedHandler}`) || normalizedCandidate.startsWith(`${normalizedHandler}.`);
|
|
8217
|
+
});
|
|
8218
|
+
}
|
|
8219
|
+
function observerRefKey2(ref) {
|
|
8220
|
+
return typeof ref === "string" ? ref : ref.name || "(anonymous)";
|
|
8221
|
+
}
|
|
8222
|
+
function mergeBindingRefs(...bindingGroups) {
|
|
8223
|
+
const merged = /* @__PURE__ */ new Map();
|
|
8224
|
+
for (const bindings of bindingGroups) {
|
|
8225
|
+
for (const binding of bindings) {
|
|
8226
|
+
for (const ref of binding.refs) {
|
|
8227
|
+
const key = observerRefKey2(ref);
|
|
8228
|
+
const current = merged.get(key);
|
|
8229
|
+
if (!current) {
|
|
8230
|
+
merged.set(key, {
|
|
8231
|
+
refs: [ref],
|
|
8232
|
+
tags: binding.tags ? [...new Set(binding.tags)] : void 0,
|
|
8233
|
+
events: binding.events ? [...new Set(binding.events)] : void 0
|
|
8234
|
+
});
|
|
8235
|
+
continue;
|
|
8236
|
+
}
|
|
8237
|
+
current.tags = Array.from(
|
|
8238
|
+
/* @__PURE__ */ new Set([...current.tags || [], ...binding.tags || []])
|
|
8239
|
+
);
|
|
8240
|
+
current.events = current.events === void 0 || binding.events === void 0 ? void 0 : Array.from(/* @__PURE__ */ new Set([...current.events || [], ...binding.events]));
|
|
8241
|
+
}
|
|
8242
|
+
}
|
|
8243
|
+
}
|
|
8244
|
+
return Array.from(merged.values());
|
|
8245
|
+
}
|
|
8162
8246
|
var ObserverDispatcherService;
|
|
8163
8247
|
var init_observer_dispatcher_service = __esm({
|
|
8164
8248
|
"src/engine/observer-dispatcher.service.ts"() {
|
|
@@ -8169,9 +8253,20 @@ var init_observer_dispatcher_service = __esm({
|
|
|
8169
8253
|
this.logger = createAxisLogger(_ObserverDispatcherService.name);
|
|
8170
8254
|
}
|
|
8171
8255
|
async dispatch(bindings, context) {
|
|
8172
|
-
|
|
8256
|
+
const explicitBindings = bindings || [];
|
|
8257
|
+
const implicitRegistrations = this.getImplicitRegistrations();
|
|
8258
|
+
if (!explicitBindings.length && implicitRegistrations.length === 0) {
|
|
8259
|
+
return;
|
|
8260
|
+
}
|
|
8173
8261
|
const invoked = /* @__PURE__ */ new Set();
|
|
8174
|
-
|
|
8262
|
+
const implicitBindings = implicitRegistrations.map(
|
|
8263
|
+
(registration) => ({
|
|
8264
|
+
refs: [registration.instance.constructor],
|
|
8265
|
+
events: registration.events
|
|
8266
|
+
})
|
|
8267
|
+
);
|
|
8268
|
+
const merged = mergeBindingRefs(explicitBindings, implicitBindings);
|
|
8269
|
+
for (const binding of merged) {
|
|
8175
8270
|
if (binding.events && binding.events.length > 0 && !binding.events.includes(context.event)) {
|
|
8176
8271
|
continue;
|
|
8177
8272
|
}
|
|
@@ -8182,6 +8277,9 @@ var init_observer_dispatcher_service = __esm({
|
|
|
8182
8277
|
continue;
|
|
8183
8278
|
}
|
|
8184
8279
|
if (invoked.has(registration.name)) continue;
|
|
8280
|
+
if (!matchesObserverIntent(registration.intents, context.intent) || !matchesObserverHandler(registration.handlers, context.handler)) {
|
|
8281
|
+
continue;
|
|
8282
|
+
}
|
|
8185
8283
|
if (registration.events && registration.events.length > 0 && !registration.events.includes(context.event)) {
|
|
8186
8284
|
continue;
|
|
8187
8285
|
}
|
|
@@ -8207,6 +8305,9 @@ var init_observer_dispatcher_service = __esm({
|
|
|
8207
8305
|
}
|
|
8208
8306
|
}
|
|
8209
8307
|
}
|
|
8308
|
+
getImplicitRegistrations() {
|
|
8309
|
+
return this.registry.list();
|
|
8310
|
+
}
|
|
8210
8311
|
};
|
|
8211
8312
|
}
|
|
8212
8313
|
});
|