@nextera.one/axis-server-sdk 2.3.5 → 2.3.7

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.
@@ -1,5 +1,5 @@
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-9Wqoiq9_.mjs';
2
- import '../axis-sensor-DMW4rfRg.mjs';
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-Bdahn8mq.mjs';
2
+ import '../axis-sensor-BLUemDiZ.mjs';
3
3
  import 'zod';
4
4
  import '@nextera.one/axis-protocol';
5
- import '../cce-pipeline-CBt56guN.mjs';
5
+ import '../cce-pipeline-By7ps8_F.mjs';
@@ -1,5 +1,5 @@
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-BN48uIiy.js';
2
- import '../axis-sensor-DMW4rfRg.js';
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-DRnTsYrk.js';
2
+ import '../axis-sensor-BLUemDiZ.js';
3
3
  import 'zod';
4
4
  import '@nextera.one/axis-protocol';
5
- import '../cce-pipeline-BJ-F1isr.js';
5
+ import '../cce-pipeline-CVeMpuKr.js';
@@ -98,9 +98,9 @@ var require_access_profile_resolver_sensor = __commonJS({
98
98
  this.name = "AccessProfileResolverSensor";
99
99
  this.order = sensor_bands_1.BAND.IDENTITY + 10;
100
100
  }
101
- async supports(input) {
101
+ supports(input) {
102
102
  void input;
103
- return { action: "ALLOW" };
103
+ return true;
104
104
  }
105
105
  async run(input) {
106
106
  const hasCapsule = !!input.metadata?.capsuleId;
@@ -250,12 +250,8 @@ var require_body_budget_sensor = __commonJS({
250
250
  this.name = "BodyBudgetSensor";
251
251
  this.order = sensor_bands_1.BAND.CONTENT + 10;
252
252
  }
253
- async supports(input) {
254
- return !!input.peek && input.peek.length >= 8 ? { action: "ALLOW" } : {
255
- action: "DENY",
256
- code: "SENSOR_NOT_APPLICABLE",
257
- reason: "Insufficient peek data to read headers"
258
- };
253
+ supports(input) {
254
+ return !!input.peek && input.peek.length >= 8;
259
255
  }
260
256
  async run(input) {
261
257
  const { peek } = input;
@@ -2590,6 +2586,12 @@ var init_intent_router = __esm({
2590
2586
  this.ccePipelineConfig = null;
2591
2587
  /** Reverse index: handler class name → list of registered intents */
2592
2588
  this.handlerIntents = /* @__PURE__ */ new Map();
2589
+ /** Handler class name → intent namespace prefix (from @Handler('auth')) */
2590
+ this.handlerPrefixes = /* @__PURE__ */ new Map();
2591
+ /** Handler class name → class-level sensor bindings (from @HandlerSensors) */
2592
+ this.handlerClassSensors = /* @__PURE__ */ new Map();
2593
+ /** Handler class name → class-level observer bindings (from @Handler({ observe: [...] })) */
2594
+ this.handlerClassObservers = /* @__PURE__ */ new Map();
2593
2595
  this.dependencyResolver = dependencyResolver;
2594
2596
  this.observerDispatcher = observerDispatcher;
2595
2597
  this.sensorRegistry = sensorRegistry;
@@ -3129,12 +3131,25 @@ var init_intent_router = __esm({
3129
3131
  }
3130
3132
  return void 0;
3131
3133
  }
3134
+ /** Intent namespace prefix declared in @Handler('auth'). */
3135
+ getHandlerPrefix(handlerName) {
3136
+ return this.handlerPrefixes.get(handlerName);
3137
+ }
3138
+ /** Class-level sensor bindings from @HandlerSensors (run before every intent in this handler). */
3139
+ getHandlerClassSensors(handlerName) {
3140
+ return this.handlerClassSensors.get(handlerName);
3141
+ }
3142
+ /** Class-level observer bindings from @Handler({ observe: [...] }). */
3143
+ getHandlerClassObservers(handlerName) {
3144
+ return this.handlerClassObservers.get(handlerName);
3145
+ }
3132
3146
  /** Full summary of a handler's registered intents and aggregated policies. Returns null if unknown. */
3133
3147
  getHandlerSummary(handlerName) {
3134
3148
  const intents = this.getHandlerIntents(handlerName);
3135
3149
  if (intents.length === 0) return null;
3136
3150
  return {
3137
3151
  handler: handlerName,
3152
+ prefix: this.getHandlerPrefix(handlerName),
3138
3153
  intents,
3139
3154
  isPublic: this.isHandlerPublic(handlerName),
3140
3155
  isAnonymous: this.isHandlerAnonymous(handlerName),
@@ -3143,7 +3158,9 @@ var init_intent_router = __esm({
3143
3158
  contract: this.getHandlerContract(handlerName),
3144
3159
  sensitivity: this.getHandlerSensitivity(handlerName),
3145
3160
  rateLimit: this.getHandlerRateLimit(handlerName),
3146
- capsulePolicy: this.getHandlerCapsulePolicy(handlerName)
3161
+ capsulePolicy: this.getHandlerCapsulePolicy(handlerName),
3162
+ classSensors: this.getHandlerClassSensors(handlerName),
3163
+ classObservers: this.getHandlerClassObservers(handlerName)
3147
3164
  };
3148
3165
  }
3149
3166
  /** Summary of all registered handlers keyed by handler class name. */
@@ -3209,6 +3226,25 @@ var init_intent_router = __esm({
3209
3226
  this.handlerIntents.set(handlerName, [intent]);
3210
3227
  }
3211
3228
  }
3229
+ /**
3230
+ * Stores class-level handler metadata (prefix, sensors, observers) gathered
3231
+ * at discovery time. Should be called once per handler class.
3232
+ */
3233
+ trackHandlerMeta(className, prefix, sensors, observers) {
3234
+ this.handlerPrefixes.set(className, prefix);
3235
+ if (sensors.length > 0) {
3236
+ this.handlerClassSensors.set(
3237
+ className,
3238
+ mergeIntentSensorBindings(sensors)
3239
+ );
3240
+ }
3241
+ if (observers.length > 0) {
3242
+ this.handlerClassObservers.set(
3243
+ className,
3244
+ mergeObserverBindings(observers)
3245
+ );
3246
+ }
3247
+ }
3212
3248
  resolveIntentSensor(ref) {
3213
3249
  const registered = this.sensorRegistry?.resolve(ref);
3214
3250
  if (registered) {
@@ -8703,10 +8739,7 @@ var init_axis_sensor_chain_service = __esm({
8703
8739
  continue;
8704
8740
  }
8705
8741
  try {
8706
- const supportsDecision = normalizeSensorDecision(
8707
- await sensor.supports(input)
8708
- );
8709
- if (supportsDecision.allow) {
8742
+ if (sensor.supports(input)) {
8710
8743
  relevantSensors.push(sensor);
8711
8744
  }
8712
8745
  } catch (error) {
@@ -11073,9 +11106,9 @@ var require_capability_enforcement_sensor = __commonJS({
11073
11106
  this.name = "CapabilityEnforcementSensor";
11074
11107
  this.order = sensor_bands_1.BAND.POLICY + 10;
11075
11108
  }
11076
- async supports(input) {
11109
+ supports(input) {
11077
11110
  void input;
11078
- return { action: "ALLOW" };
11111
+ return true;
11079
11112
  }
11080
11113
  async run(input) {
11081
11114
  const { intent, packet } = input;
@@ -11141,12 +11174,8 @@ var require_chunk_hash_sensor = __commonJS({
11141
11174
  this.name = "ChunkHashSensor";
11142
11175
  this.order = sensor_bands_1.BAND.CONTENT + 50;
11143
11176
  }
11144
- async supports(input) {
11145
- return input.intent === "file.chunk" ? { action: "ALLOW" } : {
11146
- action: "DENY",
11147
- code: "SENSOR_NOT_APPLICABLE",
11148
- reason: "Only file.chunk intent is supported"
11149
- };
11177
+ supports(input) {
11178
+ return input.intent === "file.chunk";
11150
11179
  }
11151
11180
  async run(input) {
11152
11181
  const headerTLVs = input.headerTLVs;
@@ -11373,8 +11402,8 @@ var require_execution_timeout_sensor = __commonJS({
11373
11402
  this.name = "ExecutionTimeoutSensor";
11374
11403
  this.order = sensor_bands_1.BAND.BUSINESS + 10;
11375
11404
  }
11376
- async supports() {
11377
- return Promise.resolve({ action: "ALLOW" });
11405
+ supports() {
11406
+ return true;
11378
11407
  }
11379
11408
  async run(input) {
11380
11409
  const { intent, context } = input;
@@ -11427,12 +11456,8 @@ var require_frame_budget_sensor = __commonJS({
11427
11456
  this.name = "FrameBudgetSensor";
11428
11457
  this.order = sensor_bands_1.BAND.WIRE + 20;
11429
11458
  }
11430
- async supports(input) {
11431
- return typeof input.contentLength === "number" ? { action: "ALLOW" } : {
11432
- action: "DENY",
11433
- code: "SENSOR_NOT_APPLICABLE",
11434
- reason: "Content-Length not available"
11435
- };
11459
+ supports(input) {
11460
+ return typeof input.contentLength === "number";
11436
11461
  }
11437
11462
  async run(input) {
11438
11463
  const maxBytes = Number(process.env["AXIS_MAX_FRAME_SIZE"]) || 50 * 1024 * 1024;
@@ -11477,12 +11502,8 @@ var require_frame_header_sanity_sensor = __commonJS({
11477
11502
  this.name = "FrameHeaderSanitySensor";
11478
11503
  this.order = sensor_bands_1.BAND.WIRE + 30;
11479
11504
  }
11480
- async supports(input) {
11481
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
11482
- action: "DENY",
11483
- code: "SENSOR_NOT_APPLICABLE",
11484
- reason: "Insufficient peek data for header sanity checks"
11485
- };
11505
+ supports(input) {
11506
+ return !!input.peek && input.peek.length >= 7;
11486
11507
  }
11487
11508
  async run(input) {
11488
11509
  const peek = input.peek;
@@ -11548,12 +11569,8 @@ var require_header_tlv_limit_sensor = __commonJS({
11548
11569
  this.order = sensor_bands_1.BAND.CONTENT + 0;
11549
11570
  this.MAX_TLVS = 64;
11550
11571
  }
11551
- async supports(input) {
11552
- return !!input.headerTLVs || !!input.packet ? { action: "ALLOW" } : {
11553
- action: "DENY",
11554
- code: "SENSOR_NOT_APPLICABLE",
11555
- reason: "Header TLV context is not available"
11556
- };
11572
+ supports(input) {
11573
+ return !!input.headerTLVs || !!input.packet;
11557
11574
  }
11558
11575
  async run(input) {
11559
11576
  if (input.headerTLVs && input.headerTLVs.size > this.MAX_TLVS) {
@@ -11609,12 +11626,8 @@ var require_intent_allowlist_sensor = __commonJS({
11609
11626
  this.name = "IntentAllowlistSensor";
11610
11627
  this.order = sensor_bands_1.BAND.IDENTITY + 20;
11611
11628
  }
11612
- async supports(input) {
11613
- return !!input.intent ? { action: "ALLOW" } : {
11614
- action: "DENY",
11615
- code: "SENSOR_NOT_APPLICABLE",
11616
- reason: "Intent is not available"
11617
- };
11629
+ supports(input) {
11630
+ return !!input.intent;
11618
11631
  }
11619
11632
  async run(input) {
11620
11633
  const profile = input.metadata?.profile || "PUBLIC";
@@ -11664,8 +11677,8 @@ var require_intent_registry_sensor = __commonJS({
11664
11677
  this.name = "IntentRegistrySensor";
11665
11678
  this.order = sensor_bands_1.BAND.IDENTITY + 25;
11666
11679
  }
11667
- async supports() {
11668
- return Promise.resolve({ action: "ALLOW" });
11680
+ supports() {
11681
+ return true;
11669
11682
  }
11670
11683
  async run(input) {
11671
11684
  const intent = input.intent;
@@ -11714,12 +11727,8 @@ var require_law_evaluation_sensor = __commonJS({
11714
11727
  this.name = "LawEvaluationSensor";
11715
11728
  this.order = sensor_bands_1.BAND.POLICY + 5;
11716
11729
  }
11717
- async supports(input) {
11718
- return !!this.options.evaluator && !!input.intent ? { action: "ALLOW" } : {
11719
- action: "DENY",
11720
- code: "SENSOR_NOT_APPLICABLE",
11721
- reason: "Law evaluator or intent missing"
11722
- };
11730
+ supports(input) {
11731
+ return !!this.options.evaluator && !!input.intent;
11723
11732
  }
11724
11733
  async run(input) {
11725
11734
  const evaluator = this.options.evaluator;
@@ -12186,11 +12195,8 @@ var require_proof_presence_sensor = __commonJS({
12186
12195
  this.name = "ProofPresenceSensor";
12187
12196
  this.order = sensor_bands_1.BAND.IDENTITY + 30;
12188
12197
  }
12189
- async supports(input) {
12190
- if (!!input.profile && !!input.visibility) {
12191
- return { action: "ALLOW" };
12192
- }
12193
- return { action: "DENY", code: "MISSING_REQUIRED_FIELDS" };
12198
+ supports(input) {
12199
+ return !!input.profile && !!input.visibility;
12194
12200
  }
12195
12201
  async run(input) {
12196
12202
  const validatedInput = axis_schemas_1.ProofPresenceInputZ.safeParse(input);
@@ -12484,8 +12490,8 @@ var require_receipt_policy_sensor = __commonJS({
12484
12490
  this.name = "ReceiptPolicySensor";
12485
12491
  this.order = sensor_bands_1.BAND.BUSINESS + 20;
12486
12492
  }
12487
- async supports() {
12488
- return { action: "ALLOW" };
12493
+ supports() {
12494
+ return true;
12489
12495
  }
12490
12496
  async run() {
12491
12497
  return { action: "ALLOW" };
@@ -12645,11 +12651,8 @@ var require_schema_validation_sensor = __commonJS({
12645
12651
  this.name = "SchemaValidationSensor";
12646
12652
  this.order = sensor_bands_1.BAND.CONTENT + 35;
12647
12653
  }
12648
- async supports(input) {
12649
- if (input.metadata?.schema) {
12650
- return { action: "ALLOW" };
12651
- }
12652
- return { action: "DENY", code: "SCHEMA_NOT_CONFIGURED" };
12654
+ supports(input) {
12655
+ return !!input.metadata?.schema;
12653
12656
  }
12654
12657
  async run(input) {
12655
12658
  const schema = input.metadata?.schema;
@@ -12774,8 +12777,8 @@ var require_stream_scope_sensor = __commonJS({
12774
12777
  this.name = "StreamScopeSensor";
12775
12778
  this.order = sensor_bands_1.BAND.BUSINESS + 0;
12776
12779
  }
12777
- async supports() {
12778
- return { action: "ALLOW" };
12780
+ supports() {
12781
+ return true;
12779
12782
  }
12780
12783
  async run() {
12781
12784
  return { action: "ALLOW" };
@@ -12813,12 +12816,8 @@ var require_tickauth_sensor = __commonJS({
12813
12816
  this.matchIntent = options.matchIntent ?? true;
12814
12817
  this.acceptTypes = options.acceptTypes?.length ? new Set(options.acceptTypes) : null;
12815
12818
  }
12816
- async supports(input) {
12817
- return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule) ? { action: "ALLOW" } : {
12818
- action: "DENY",
12819
- code: "SENSOR_NOT_APPLICABLE",
12820
- reason: "TickAuth capsule not found"
12821
- };
12819
+ supports(input) {
12820
+ return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule);
12822
12821
  }
12823
12822
  async run(input) {
12824
12823
  const capsule = input.metadata?.capsule ?? input.metadata?.tickauthCapsule ?? input.metadata?.cceEnvelope?.capsule;
@@ -12924,12 +12923,8 @@ var require_tlv_parse_sensor = __commonJS({
12924
12923
  this.name = "TLVParseSensor";
12925
12924
  this.order = sensor_bands_1.BAND.CONTENT + 20;
12926
12925
  }
12927
- async supports(input) {
12928
- return !!input.packet ? { action: "ALLOW" } : {
12929
- action: "DENY",
12930
- code: "SENSOR_NOT_APPLICABLE",
12931
- reason: "Packet is not available"
12932
- };
12926
+ supports(input) {
12927
+ return !!input.packet;
12933
12928
  }
12934
12929
  async run(input) {
12935
12930
  const packet = input.packet;
@@ -13061,13 +13056,9 @@ var require_tps_sensor = __commonJS({
13061
13056
  this.maxDriftMs = options.maxDriftMs ?? 3e4;
13062
13057
  this.resolver = options.resolver ?? parseINotation;
13063
13058
  }
13064
- async supports(input) {
13059
+ supports(input) {
13065
13060
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
13066
- return typeof tps === "string" && tps.length > 0 ? { action: "ALLOW" } : {
13067
- action: "DENY",
13068
- code: "SENSOR_NOT_APPLICABLE",
13069
- reason: "TPS coordinate not available"
13070
- };
13061
+ return typeof tps === "string" && tps.length > 0;
13071
13062
  }
13072
13063
  async run(input) {
13073
13064
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
@@ -13133,12 +13124,8 @@ var require_varint_hardening_sensor = __commonJS({
13133
13124
  this.order = sensor_bands_1.BAND.WIRE + 35;
13134
13125
  this.MAX_VARINT_BYTES = 5;
13135
13126
  }
13136
- async supports(input) {
13137
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
13138
- action: "DENY",
13139
- code: "SENSOR_NOT_APPLICABLE",
13140
- reason: "Insufficient peek data for varint hardening"
13141
- };
13127
+ supports(input) {
13128
+ return !!input.peek && input.peek.length >= 7;
13142
13129
  }
13143
13130
  async run(input) {
13144
13131
  const peek = input.peek;