@nextera.one/axis-server-sdk 2.2.2 → 2.2.4
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-B2G6cbRL.d.mts → index-C4ApiXHX.d.mts} +38 -25
- package/dist/{index-DbSxdR0f.d.ts → index-QGwgvVDY.d.ts} +38 -25
- package/dist/index.d.mts +9 -23
- package/dist/index.d.ts +9 -23
- package/dist/index.js +163 -196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +159 -198
- 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 +161 -190
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +157 -186
- 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 {
|
|
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-C4ApiXHX.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 {
|
|
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-QGwgvVDY.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
|
@@ -525,17 +525,76 @@ var init_intent_policy_decorator = __esm({
|
|
|
525
525
|
}
|
|
526
526
|
});
|
|
527
527
|
|
|
528
|
-
// src/decorators/handler.decorator.ts
|
|
529
|
-
function
|
|
528
|
+
// src/decorators/handler-sensors.decorator.ts
|
|
529
|
+
function HandlerSensors(sensors) {
|
|
530
530
|
return (target) => {
|
|
531
|
-
Reflect.defineMetadata(
|
|
531
|
+
Reflect.defineMetadata(HANDLER_SENSORS_KEY, sensors, target);
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
var import_reflect_metadata5,
|
|
535
|
-
var
|
|
536
|
-
"src/decorators/handler.decorator.ts"() {
|
|
534
|
+
var import_reflect_metadata5, HANDLER_SENSORS_KEY;
|
|
535
|
+
var init_handler_sensors_decorator = __esm({
|
|
536
|
+
"src/decorators/handler-sensors.decorator.ts"() {
|
|
537
537
|
import_reflect_metadata5 = require("reflect-metadata");
|
|
538
|
-
|
|
538
|
+
HANDLER_SENSORS_KEY = "axis:handler:sensors";
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// src/decorators/observer.decorator.ts
|
|
543
|
+
function isBindingOptions(value) {
|
|
544
|
+
return !!value && typeof value === "object" && "use" in value;
|
|
545
|
+
}
|
|
546
|
+
function isDefinitionOptions(value) {
|
|
547
|
+
return !!value && typeof value === "object" && !Array.isArray(value) && !isBindingOptions(value);
|
|
548
|
+
}
|
|
549
|
+
function toObserverBinding(input) {
|
|
550
|
+
if (!input) return null;
|
|
551
|
+
if (isBindingOptions(input)) {
|
|
552
|
+
const refs = Array.isArray(input.use) ? input.use : [input.use];
|
|
553
|
+
return { refs, tags: input.tags, events: input.events };
|
|
554
|
+
}
|
|
555
|
+
if (Array.isArray(input)) {
|
|
556
|
+
return { refs: input };
|
|
557
|
+
}
|
|
558
|
+
if (typeof input === "function" || typeof input === "string") {
|
|
559
|
+
return { refs: [input] };
|
|
560
|
+
}
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
function Observer(input) {
|
|
564
|
+
return ((target, propertyKey) => {
|
|
565
|
+
const binding = toObserverBinding(input);
|
|
566
|
+
if (binding) {
|
|
567
|
+
if (propertyKey !== void 0) {
|
|
568
|
+
const existing2 = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target, propertyKey) || [];
|
|
569
|
+
existing2.push(binding);
|
|
570
|
+
Reflect.defineMetadata(
|
|
571
|
+
OBSERVER_BINDINGS_KEY,
|
|
572
|
+
existing2,
|
|
573
|
+
target,
|
|
574
|
+
propertyKey
|
|
575
|
+
);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const existing = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target) || [];
|
|
579
|
+
existing.push(binding);
|
|
580
|
+
Reflect.defineMetadata(OBSERVER_BINDINGS_KEY, existing, target);
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
if (propertyKey !== void 0) {
|
|
584
|
+
throw new Error(
|
|
585
|
+
"@Observer method usage must reference one or more observer classes or names"
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
const definition = isDefinitionOptions(input) ? input : {};
|
|
589
|
+
Reflect.defineMetadata(OBSERVER_METADATA_KEY, definition, target);
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
var import_reflect_metadata6, OBSERVER_METADATA_KEY, OBSERVER_BINDINGS_KEY;
|
|
593
|
+
var init_observer_decorator = __esm({
|
|
594
|
+
"src/decorators/observer.decorator.ts"() {
|
|
595
|
+
import_reflect_metadata6 = require("reflect-metadata");
|
|
596
|
+
OBSERVER_METADATA_KEY = "axis:observer";
|
|
597
|
+
OBSERVER_BINDINGS_KEY = "axis:observer:bindings";
|
|
539
598
|
}
|
|
540
599
|
});
|
|
541
600
|
|
|
@@ -545,15 +604,30 @@ function IntentBody(decoder) {
|
|
|
545
604
|
Reflect.defineMetadata(INTENT_BODY_KEY, decoder, target, propertyKey);
|
|
546
605
|
};
|
|
547
606
|
}
|
|
548
|
-
var
|
|
607
|
+
var import_reflect_metadata7, INTENT_BODY_KEY;
|
|
549
608
|
var init_intent_body_decorator = __esm({
|
|
550
609
|
"src/decorators/intent-body.decorator.ts"() {
|
|
551
|
-
|
|
610
|
+
import_reflect_metadata7 = require("reflect-metadata");
|
|
552
611
|
INTENT_BODY_KEY = "axis:intent:body";
|
|
553
612
|
}
|
|
554
613
|
});
|
|
555
614
|
|
|
556
615
|
// src/decorators/intent.decorator.ts
|
|
616
|
+
function isIntentSensorBindingOptions(value) {
|
|
617
|
+
return !!value && typeof value === "object" && !Array.isArray(value) && "use" in value;
|
|
618
|
+
}
|
|
619
|
+
function toIntentSensorBinding(input) {
|
|
620
|
+
if (isIntentSensorBindingOptions(input)) {
|
|
621
|
+
return {
|
|
622
|
+
ref: input.use,
|
|
623
|
+
when: input.when || "before"
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
return {
|
|
627
|
+
ref: input,
|
|
628
|
+
when: "before"
|
|
629
|
+
};
|
|
630
|
+
}
|
|
557
631
|
function Intent(action, options) {
|
|
558
632
|
return (target, propertyKey) => {
|
|
559
633
|
const metadata = { intent: action, ...options };
|
|
@@ -591,10 +665,10 @@ function Intent(action, options) {
|
|
|
591
665
|
Reflect.defineMetadata(INTENT_ROUTES_KEY, routes, target.constructor);
|
|
592
666
|
};
|
|
593
667
|
}
|
|
594
|
-
var
|
|
668
|
+
var import_reflect_metadata8, INTENT_METADATA_KEY, INTENT_ROUTES_KEY;
|
|
595
669
|
var init_intent_decorator = __esm({
|
|
596
670
|
"src/decorators/intent.decorator.ts"() {
|
|
597
|
-
|
|
671
|
+
import_reflect_metadata8 = require("reflect-metadata");
|
|
598
672
|
init_intent_body_decorator();
|
|
599
673
|
init_intent_policy_decorator();
|
|
600
674
|
INTENT_METADATA_KEY = "axis:intent";
|
|
@@ -602,176 +676,62 @@ var init_intent_decorator = __esm({
|
|
|
602
676
|
}
|
|
603
677
|
});
|
|
604
678
|
|
|
605
|
-
// src/decorators/
|
|
606
|
-
function
|
|
607
|
-
return (target
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
if (isBindingOptions(input)) {
|
|
629
|
-
const refs = Array.isArray(input.use) ? input.use : [input.use];
|
|
630
|
-
return { refs, tags: input.tags, events: input.events };
|
|
631
|
-
}
|
|
632
|
-
if (Array.isArray(input)) {
|
|
633
|
-
return { refs: input };
|
|
634
|
-
}
|
|
635
|
-
if (typeof input === "function" || typeof input === "string") {
|
|
636
|
-
return { refs: [input] };
|
|
637
|
-
}
|
|
638
|
-
return null;
|
|
639
|
-
}
|
|
640
|
-
function Observer(input) {
|
|
641
|
-
return ((target, propertyKey) => {
|
|
642
|
-
const binding = toBinding(input);
|
|
643
|
-
if (binding) {
|
|
644
|
-
if (propertyKey !== void 0) {
|
|
645
|
-
const existing2 = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target, propertyKey) || [];
|
|
646
|
-
existing2.push(binding);
|
|
647
|
-
Reflect.defineMetadata(
|
|
648
|
-
OBSERVER_BINDINGS_KEY,
|
|
649
|
-
existing2,
|
|
650
|
-
target,
|
|
651
|
-
propertyKey
|
|
652
|
-
);
|
|
653
|
-
return;
|
|
654
|
-
}
|
|
655
|
-
const existing = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target) || [];
|
|
656
|
-
existing.push(binding);
|
|
657
|
-
Reflect.defineMetadata(OBSERVER_BINDINGS_KEY, existing, target);
|
|
658
|
-
return;
|
|
679
|
+
// src/decorators/handler.decorator.ts
|
|
680
|
+
function Handler(intentOrOptions, options) {
|
|
681
|
+
return (target) => {
|
|
682
|
+
const intent = typeof intentOrOptions === "string" ? intentOrOptions : void 0;
|
|
683
|
+
const handlerOptions = typeof intentOrOptions === "string" ? options : intentOrOptions;
|
|
684
|
+
const sensorBindings = Array.isArray(handlerOptions?.is) ? handlerOptions.is.map(
|
|
685
|
+
(input) => toIntentSensorBinding(input)
|
|
686
|
+
) : [];
|
|
687
|
+
const observerBindings = Array.isArray(
|
|
688
|
+
handlerOptions?.observe
|
|
689
|
+
) ? handlerOptions.observe.map((input) => toObserverBinding(input)).filter((binding) => !!binding) : [];
|
|
690
|
+
Reflect.defineMetadata(
|
|
691
|
+
HANDLER_METADATA_KEY,
|
|
692
|
+
{ intent, ...handlerOptions || {} },
|
|
693
|
+
target
|
|
694
|
+
);
|
|
695
|
+
if (sensorBindings.length > 0) {
|
|
696
|
+
const existing = Reflect.getMetadata(HANDLER_SENSORS_KEY, target) || [];
|
|
697
|
+
Reflect.defineMetadata(
|
|
698
|
+
HANDLER_SENSORS_KEY,
|
|
699
|
+
[...existing, ...sensorBindings],
|
|
700
|
+
target
|
|
701
|
+
);
|
|
659
702
|
}
|
|
660
|
-
if (
|
|
661
|
-
|
|
662
|
-
|
|
703
|
+
if (observerBindings.length > 0) {
|
|
704
|
+
const existing = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target) || [];
|
|
705
|
+
Reflect.defineMetadata(
|
|
706
|
+
OBSERVER_BINDINGS_KEY,
|
|
707
|
+
[...existing, ...observerBindings],
|
|
708
|
+
target
|
|
663
709
|
);
|
|
664
710
|
}
|
|
665
|
-
|
|
666
|
-
Reflect.defineMetadata(OBSERVER_METADATA_KEY, definition, target);
|
|
667
|
-
});
|
|
711
|
+
};
|
|
668
712
|
}
|
|
669
|
-
var import_reflect_metadata9,
|
|
670
|
-
var
|
|
671
|
-
"src/decorators/
|
|
713
|
+
var import_reflect_metadata9, HANDLER_METADATA_KEY;
|
|
714
|
+
var init_handler_decorator = __esm({
|
|
715
|
+
"src/decorators/handler.decorator.ts"() {
|
|
672
716
|
import_reflect_metadata9 = require("reflect-metadata");
|
|
673
|
-
|
|
674
|
-
|
|
717
|
+
init_handler_sensors_decorator();
|
|
718
|
+
init_observer_decorator();
|
|
719
|
+
init_intent_decorator();
|
|
720
|
+
HANDLER_METADATA_KEY = "axis:handler";
|
|
675
721
|
}
|
|
676
722
|
});
|
|
677
723
|
|
|
678
|
-
// src/decorators/
|
|
679
|
-
function
|
|
680
|
-
return (target) => {
|
|
681
|
-
Reflect.defineMetadata(
|
|
724
|
+
// src/decorators/intent-sensors.decorator.ts
|
|
725
|
+
function IntentSensors(sensors) {
|
|
726
|
+
return (target, propertyKey) => {
|
|
727
|
+
Reflect.defineMetadata(INTENT_SENSORS_KEY, sensors, target, propertyKey);
|
|
682
728
|
};
|
|
683
729
|
}
|
|
684
|
-
var import_reflect_metadata10,
|
|
685
|
-
var
|
|
686
|
-
"src/decorators/
|
|
730
|
+
var import_reflect_metadata10, INTENT_SENSORS_KEY;
|
|
731
|
+
var init_intent_sensors_decorator = __esm({
|
|
732
|
+
"src/decorators/intent-sensors.decorator.ts"() {
|
|
687
733
|
import_reflect_metadata10 = require("reflect-metadata");
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
|
|
692
|
-
// src/decorators/priority-order.decorator.ts
|
|
693
|
-
var require_priority_order_decorator = __commonJS({
|
|
694
|
-
"src/decorators/priority-order.decorator.ts"(exports2) {
|
|
695
|
-
"use strict";
|
|
696
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
697
|
-
exports2.priorityOrder = exports2.PRIORITY_ORDER_METADATA_KEY = void 0;
|
|
698
|
-
exports2.getPriorityOrder = getPriorityOrder2;
|
|
699
|
-
exports2.comparePriorityOrder = comparePriorityOrder2;
|
|
700
|
-
exports2.getPriorityOrderedTargets = getPriorityOrderedTargets2;
|
|
701
|
-
exports2.PriorityOrder = PriorityOrder2;
|
|
702
|
-
require("reflect-metadata");
|
|
703
|
-
exports2.PRIORITY_ORDER_METADATA_KEY = "axis:priority-order";
|
|
704
|
-
var PRIORITY_ORDER_WEIGHT = {
|
|
705
|
-
HIGH: 0,
|
|
706
|
-
MEDIUM: 1,
|
|
707
|
-
LOW: 2
|
|
708
|
-
};
|
|
709
|
-
var priorityOrderRegistry = /* @__PURE__ */ new Set();
|
|
710
|
-
function normalizePriority(priority) {
|
|
711
|
-
const normalized = String(priority).toUpperCase();
|
|
712
|
-
if (normalized === "HIGH" || normalized === "MEDIUM" || normalized === "LOW") {
|
|
713
|
-
return normalized;
|
|
714
|
-
}
|
|
715
|
-
throw new Error(`@PriorityOrder() received invalid priority "${String(priority)}"`);
|
|
716
|
-
}
|
|
717
|
-
function normalizeOrder(order) {
|
|
718
|
-
if (typeof order !== "number" || !Number.isInteger(order) || !Number.isFinite(order) || order < 0) {
|
|
719
|
-
throw new Error(`@PriorityOrder() requires a non-negative integer order, received "${String(order)}"`);
|
|
720
|
-
}
|
|
721
|
-
return order;
|
|
722
|
-
}
|
|
723
|
-
function isPriorityOrderOptions(value) {
|
|
724
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
725
|
-
}
|
|
726
|
-
function resolvePriorityOrder(priorityOrOptions, order = 0) {
|
|
727
|
-
if (isPriorityOrderOptions(priorityOrOptions)) {
|
|
728
|
-
return {
|
|
729
|
-
priority: normalizePriority(priorityOrOptions.priority ?? "MEDIUM"),
|
|
730
|
-
order: normalizeOrder(priorityOrOptions.order ?? 0)
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
return {
|
|
734
|
-
priority: normalizePriority(priorityOrOptions ?? "MEDIUM"),
|
|
735
|
-
order: normalizeOrder(order)
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
function getPriorityOrder2(target) {
|
|
739
|
-
return Reflect.getMetadata(exports2.PRIORITY_ORDER_METADATA_KEY, target) ?? null;
|
|
740
|
-
}
|
|
741
|
-
function comparePriorityOrder2(left, right) {
|
|
742
|
-
const priorityDelta = PRIORITY_ORDER_WEIGHT[left.priority] - PRIORITY_ORDER_WEIGHT[right.priority];
|
|
743
|
-
if (priorityDelta !== 0) {
|
|
744
|
-
return priorityDelta;
|
|
745
|
-
}
|
|
746
|
-
return left.order - right.order;
|
|
747
|
-
}
|
|
748
|
-
function getPriorityOrderedTargets2(targets) {
|
|
749
|
-
const pool = targets ? Array.from(targets) : Array.from(priorityOrderRegistry);
|
|
750
|
-
return pool.sort((left, right) => {
|
|
751
|
-
const leftMeta = getPriorityOrder2(left);
|
|
752
|
-
const rightMeta = getPriorityOrder2(right);
|
|
753
|
-
if (!leftMeta && !rightMeta) {
|
|
754
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
755
|
-
}
|
|
756
|
-
if (!leftMeta)
|
|
757
|
-
return 1;
|
|
758
|
-
if (!rightMeta)
|
|
759
|
-
return -1;
|
|
760
|
-
const ordered = comparePriorityOrder2(leftMeta, rightMeta);
|
|
761
|
-
if (ordered !== 0) {
|
|
762
|
-
return ordered;
|
|
763
|
-
}
|
|
764
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function PriorityOrder2(priorityOrOptions, order = 0) {
|
|
768
|
-
const definition = resolvePriorityOrder(priorityOrOptions, order);
|
|
769
|
-
return (target) => {
|
|
770
|
-
Reflect.defineMetadata(exports2.PRIORITY_ORDER_METADATA_KEY, definition, target);
|
|
771
|
-
priorityOrderRegistry.add(target);
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
exports2.priorityOrder = PriorityOrder2;
|
|
734
|
+
INTENT_SENSORS_KEY = "axis:intent:sensors";
|
|
775
735
|
}
|
|
776
736
|
});
|
|
777
737
|
|
|
@@ -2484,15 +2444,19 @@ function observerRefKey(ref) {
|
|
|
2484
2444
|
function sensorRefKey(ref) {
|
|
2485
2445
|
return typeof ref === "string" ? ref : ref.name;
|
|
2486
2446
|
}
|
|
2487
|
-
function
|
|
2447
|
+
function sensorBindingKey(binding) {
|
|
2448
|
+
return `${binding.when}:${sensorRefKey(binding.ref)}`;
|
|
2449
|
+
}
|
|
2450
|
+
function mergeIntentSensorBindings(...sensorGroups) {
|
|
2488
2451
|
const merged = /* @__PURE__ */ new Map();
|
|
2489
2452
|
for (const group of sensorGroups) {
|
|
2490
2453
|
if (!Array.isArray(group)) continue;
|
|
2491
|
-
for (const
|
|
2492
|
-
const
|
|
2454
|
+
for (const input of group) {
|
|
2455
|
+
const binding = toIntentSensorBinding(input);
|
|
2456
|
+
const key = sensorBindingKey(binding);
|
|
2493
2457
|
const existing = merged.get(key);
|
|
2494
|
-
if (!existing || typeof existing === "string" && typeof ref !== "string") {
|
|
2495
|
-
merged.set(key,
|
|
2458
|
+
if (!existing || typeof existing.ref === "string" && typeof binding.ref !== "string") {
|
|
2459
|
+
merged.set(key, binding);
|
|
2496
2460
|
}
|
|
2497
2461
|
}
|
|
2498
2462
|
}
|
|
@@ -2796,9 +2760,9 @@ var init_intent_router = __esm({
|
|
|
2796
2760
|
if (!handler) {
|
|
2797
2761
|
throw new Error(`Intent not found: ${intent}`);
|
|
2798
2762
|
}
|
|
2799
|
-
const
|
|
2800
|
-
if (
|
|
2801
|
-
await this.runIntentSensors(
|
|
2763
|
+
const sensorBindings = this.intentSensors.get(intent);
|
|
2764
|
+
if (sensorBindings && sensorBindings.length > 0) {
|
|
2765
|
+
await this.runIntentSensors(sensorBindings, intent, frame, "before");
|
|
2802
2766
|
}
|
|
2803
2767
|
const decoder = this.intentDecoders.get(intent);
|
|
2804
2768
|
let decodedBody = frame.body;
|
|
@@ -2840,6 +2804,12 @@ var init_intent_router = __esm({
|
|
|
2840
2804
|
);
|
|
2841
2805
|
}
|
|
2842
2806
|
}
|
|
2807
|
+
if (sensorBindings && sensorBindings.length > 0) {
|
|
2808
|
+
await this.runIntentSensors(sensorBindings, intent, frame, "after", {
|
|
2809
|
+
decodedBody,
|
|
2810
|
+
effect
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2843
2813
|
}
|
|
2844
2814
|
await this.emitIntentObservers(observerBindings, {
|
|
2845
2815
|
event: "intent.completed",
|
|
@@ -2883,7 +2853,7 @@ var init_intent_router = __esm({
|
|
|
2883
2853
|
methodName
|
|
2884
2854
|
);
|
|
2885
2855
|
const meta = Reflect.getMetadata(INTENT_METADATA_KEY, proto, methodName);
|
|
2886
|
-
const combined =
|
|
2856
|
+
const combined = mergeIntentSensorBindings(
|
|
2887
2857
|
handlerSensors,
|
|
2888
2858
|
Array.isArray(intentSensors) ? intentSensors : void 0,
|
|
2889
2859
|
Array.isArray(meta?.is) ? meta.is : void 0
|
|
@@ -3025,8 +2995,10 @@ var init_intent_router = __esm({
|
|
|
3025
2995
|
if (!this.observerDispatcher || bindings.length === 0) return;
|
|
3026
2996
|
await this.observerDispatcher.dispatch(bindings, context);
|
|
3027
2997
|
}
|
|
3028
|
-
async runIntentSensors(
|
|
3029
|
-
for (const
|
|
2998
|
+
async runIntentSensors(sensorBindings, intent, frame, stage, extras) {
|
|
2999
|
+
for (const binding of sensorBindings) {
|
|
3000
|
+
if (binding.when !== stage && binding.when !== "both") continue;
|
|
3001
|
+
const sensorRef = binding.ref;
|
|
3030
3002
|
const sensor = this.resolveIntentSensor(sensorRef);
|
|
3031
3003
|
const sensorName = sensorRefKey(sensorRef);
|
|
3032
3004
|
if (!sensor) {
|
|
@@ -3043,9 +3015,12 @@ var init_intent_router = __esm({
|
|
|
3043
3015
|
frameBody: frame.body,
|
|
3044
3016
|
metadata: {
|
|
3045
3017
|
phase: "intent",
|
|
3018
|
+
stage,
|
|
3046
3019
|
intent,
|
|
3047
3020
|
schema: this.getSchema(intent),
|
|
3048
|
-
validators: this.getValidators(intent)
|
|
3021
|
+
validators: this.getValidators(intent),
|
|
3022
|
+
decodedBody: extras?.decodedBody,
|
|
3023
|
+
effect: extras?.effect
|
|
3049
3024
|
}
|
|
3050
3025
|
};
|
|
3051
3026
|
if (sensor.supports && !sensor.supports(sensorInput)) continue;
|
|
@@ -10511,7 +10486,6 @@ __export(index_exports, {
|
|
|
10511
10486
|
ObserverDispatcherService: () => ObserverDispatcherService,
|
|
10512
10487
|
ObserverRegistry: () => ObserverRegistry,
|
|
10513
10488
|
PRE_DECODE_BOUNDARY: () => PRE_DECODE_BOUNDARY,
|
|
10514
|
-
PRIORITY_ORDER_METADATA_KEY: () => import_priority_order.PRIORITY_ORDER_METADATA_KEY,
|
|
10515
10489
|
PROOF_CAPABILITIES: () => PROOF_CAPABILITIES,
|
|
10516
10490
|
PROOF_CAPSULE: () => import_axis_protocol.PROOF_CAPSULE,
|
|
10517
10491
|
PROOF_JWT: () => import_axis_protocol.PROOF_JWT,
|
|
@@ -10519,7 +10493,6 @@ __export(index_exports, {
|
|
|
10519
10493
|
PROOF_MTLS: () => import_axis_protocol.PROOF_MTLS,
|
|
10520
10494
|
PROOF_NONE: () => import_axis_protocol.PROOF_NONE,
|
|
10521
10495
|
PROOF_WITNESS: () => import_axis_protocol.PROOF_WITNESS,
|
|
10522
|
-
PriorityOrder: () => import_priority_order.PriorityOrder,
|
|
10523
10496
|
ProofType: () => import_axis_protocol.ProofType,
|
|
10524
10497
|
ProofVerificationService: () => ProofVerificationService,
|
|
10525
10498
|
REQUIRED_PROOF_METADATA_KEY: () => REQUIRED_PROOF_METADATA_KEY,
|
|
@@ -10611,7 +10584,6 @@ __export(index_exports, {
|
|
|
10611
10584
|
canonicalizeObservation: () => canonicalizeObservation,
|
|
10612
10585
|
canonicalizeWrit: () => canonicalizeWrit,
|
|
10613
10586
|
classifyIntent: () => classifyIntent,
|
|
10614
|
-
comparePriorityOrder: () => import_priority_order.comparePriorityOrder,
|
|
10615
10587
|
computeReceiptHash: () => computeReceiptHash,
|
|
10616
10588
|
computeSignaturePayload: () => computeSignaturePayload,
|
|
10617
10589
|
createFabric: () => createFabric,
|
|
@@ -10656,8 +10628,6 @@ __export(index_exports, {
|
|
|
10656
10628
|
getGrantStatus: () => getGrantStatus,
|
|
10657
10629
|
getIrreversibleKnots: () => getIrreversibleKnots,
|
|
10658
10630
|
getPresenceStatus: () => getPresenceStatus,
|
|
10659
|
-
getPriorityOrder: () => import_priority_order.getPriorityOrder,
|
|
10660
|
-
getPriorityOrderedTargets: () => import_priority_order.getPriorityOrderedTargets,
|
|
10661
10631
|
getSignTarget: () => import_axis_protocol5.getSignTarget,
|
|
10662
10632
|
grantCoversAction: () => grantCoversAction,
|
|
10663
10633
|
hasScope: () => hasScope,
|
|
@@ -10682,7 +10652,6 @@ __export(index_exports, {
|
|
|
10682
10652
|
parseAutoClaimEntries: () => parseAutoClaimEntries,
|
|
10683
10653
|
parseScope: () => parseScope,
|
|
10684
10654
|
parseStreamEntries: () => parseStreamEntries,
|
|
10685
|
-
priorityOrder: () => import_priority_order.priorityOrder,
|
|
10686
10655
|
projectAt: () => projectAt,
|
|
10687
10656
|
queryFabric: () => queryFabric,
|
|
10688
10657
|
recordOccurrence: () => recordOccurrence,
|
|
@@ -10699,6 +10668,8 @@ __export(index_exports, {
|
|
|
10699
10668
|
startStage: () => startStage,
|
|
10700
10669
|
tieKnot: () => tieKnot,
|
|
10701
10670
|
tlv: () => tlv,
|
|
10671
|
+
toIntentSensorBinding: () => toIntentSensorBinding,
|
|
10672
|
+
toObserverBinding: () => toObserverBinding,
|
|
10702
10673
|
u64be: () => u64be,
|
|
10703
10674
|
unpackPasskeyLoginOptionsReq: () => unpackPasskeyLoginOptionsReq,
|
|
10704
10675
|
unpackPasskeyLoginVerifyReq: () => unpackPasskeyLoginVerifyReq,
|
|
@@ -10719,7 +10690,7 @@ __export(index_exports, {
|
|
|
10719
10690
|
weave: () => weave,
|
|
10720
10691
|
withAxisExecutionContext: () => withAxisExecutionContext
|
|
10721
10692
|
});
|
|
10722
|
-
var
|
|
10693
|
+
var import_tlv_field2, import_dto_schema2, import_axis_id, import_axis_response;
|
|
10723
10694
|
var init_index = __esm({
|
|
10724
10695
|
"src/index.ts"() {
|
|
10725
10696
|
init_chain_decorator();
|
|
@@ -10730,9 +10701,9 @@ var init_index = __esm({
|
|
|
10730
10701
|
init_intent_body_decorator();
|
|
10731
10702
|
init_intent_sensors_decorator();
|
|
10732
10703
|
init_observer_decorator();
|
|
10704
|
+
init_observer_decorator();
|
|
10733
10705
|
init_handler_sensors_decorator();
|
|
10734
10706
|
init_sensor_decorator();
|
|
10735
|
-
import_priority_order = __toESM(require_priority_order_decorator());
|
|
10736
10707
|
import_tlv_field2 = __toESM(require_tlv_field_decorator());
|
|
10737
10708
|
import_dto_schema2 = __toESM(require_dto_schema_util());
|
|
10738
10709
|
init_axis_tlv_dto();
|