@nextera.one/axis-server-sdk 2.3.6 → 2.3.8

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-CffTWMtI.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-CqAU2zlr.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;
@@ -8612,11 +8608,13 @@ var init_sensor_registry = __esm({
8612
8608
  return this.sensorsByName.get(name);
8613
8609
  }
8614
8610
  getPreDecodeSensors() {
8615
- return this.list().filter((s) => (s.order ?? 999) < 40);
8611
+ return this.list().filter(
8612
+ (s) => this.isPreDecodeSensor(s)
8613
+ );
8616
8614
  }
8617
8615
  getPostDecodeSensors() {
8618
8616
  return this.list().filter(
8619
- (s) => (s.order ?? 999) >= 40
8617
+ (s) => this.isPostDecodeSensor(s)
8620
8618
  );
8621
8619
  }
8622
8620
  getSensorCountByPhase() {
@@ -8632,11 +8630,13 @@ var init_sensor_registry = __esm({
8632
8630
  }
8633
8631
  isPreDecodeSensor(sensor) {
8634
8632
  const phase = typeof sensor.phase === "string" ? sensor.phase : sensor.phase?.phase;
8635
- return phase === "PRE_DECODE" || (sensor.order ?? 999) < 40;
8633
+ if (phase) return phase === "PRE_DECODE";
8634
+ return (sensor.order ?? 999) < 40;
8636
8635
  }
8637
8636
  isPostDecodeSensor(sensor) {
8638
8637
  const phase = typeof sensor.phase === "string" ? sensor.phase : sensor.phase?.phase;
8639
- return phase === "POST_DECODE" || (sensor.order ?? 999) >= 40;
8638
+ if (phase) return phase === "POST_DECODE";
8639
+ return (sensor.order ?? 999) >= 40;
8640
8640
  }
8641
8641
  indexSensor(sensor) {
8642
8642
  this.sensorsByName.set(sensor.name, sensor);
@@ -8743,10 +8743,7 @@ var init_axis_sensor_chain_service = __esm({
8743
8743
  continue;
8744
8744
  }
8745
8745
  try {
8746
- const supportsDecision = normalizeSensorDecision(
8747
- await sensor.supports(input)
8748
- );
8749
- if (supportsDecision.allow) {
8746
+ if (sensor.supports(input)) {
8750
8747
  relevantSensors.push(sensor);
8751
8748
  }
8752
8749
  } catch (error) {
@@ -11113,9 +11110,9 @@ var require_capability_enforcement_sensor = __commonJS({
11113
11110
  this.name = "CapabilityEnforcementSensor";
11114
11111
  this.order = sensor_bands_1.BAND.POLICY + 10;
11115
11112
  }
11116
- async supports(input) {
11113
+ supports(input) {
11117
11114
  void input;
11118
- return { action: "ALLOW" };
11115
+ return true;
11119
11116
  }
11120
11117
  async run(input) {
11121
11118
  const { intent, packet } = input;
@@ -11181,12 +11178,8 @@ var require_chunk_hash_sensor = __commonJS({
11181
11178
  this.name = "ChunkHashSensor";
11182
11179
  this.order = sensor_bands_1.BAND.CONTENT + 50;
11183
11180
  }
11184
- async supports(input) {
11185
- return input.intent === "file.chunk" ? { action: "ALLOW" } : {
11186
- action: "DENY",
11187
- code: "SENSOR_NOT_APPLICABLE",
11188
- reason: "Only file.chunk intent is supported"
11189
- };
11181
+ supports(input) {
11182
+ return input.intent === "file.chunk";
11190
11183
  }
11191
11184
  async run(input) {
11192
11185
  const headerTLVs = input.headerTLVs;
@@ -11413,8 +11406,8 @@ var require_execution_timeout_sensor = __commonJS({
11413
11406
  this.name = "ExecutionTimeoutSensor";
11414
11407
  this.order = sensor_bands_1.BAND.BUSINESS + 10;
11415
11408
  }
11416
- async supports() {
11417
- return Promise.resolve({ action: "ALLOW" });
11409
+ supports() {
11410
+ return true;
11418
11411
  }
11419
11412
  async run(input) {
11420
11413
  const { intent, context } = input;
@@ -11467,12 +11460,8 @@ var require_frame_budget_sensor = __commonJS({
11467
11460
  this.name = "FrameBudgetSensor";
11468
11461
  this.order = sensor_bands_1.BAND.WIRE + 20;
11469
11462
  }
11470
- async supports(input) {
11471
- return typeof input.contentLength === "number" ? { action: "ALLOW" } : {
11472
- action: "DENY",
11473
- code: "SENSOR_NOT_APPLICABLE",
11474
- reason: "Content-Length not available"
11475
- };
11463
+ supports(input) {
11464
+ return typeof input.contentLength === "number";
11476
11465
  }
11477
11466
  async run(input) {
11478
11467
  const maxBytes = Number(process.env["AXIS_MAX_FRAME_SIZE"]) || 50 * 1024 * 1024;
@@ -11517,12 +11506,8 @@ var require_frame_header_sanity_sensor = __commonJS({
11517
11506
  this.name = "FrameHeaderSanitySensor";
11518
11507
  this.order = sensor_bands_1.BAND.WIRE + 30;
11519
11508
  }
11520
- async supports(input) {
11521
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
11522
- action: "DENY",
11523
- code: "SENSOR_NOT_APPLICABLE",
11524
- reason: "Insufficient peek data for header sanity checks"
11525
- };
11509
+ supports(input) {
11510
+ return !!input.peek && input.peek.length >= 7;
11526
11511
  }
11527
11512
  async run(input) {
11528
11513
  const peek = input.peek;
@@ -11588,12 +11573,8 @@ var require_header_tlv_limit_sensor = __commonJS({
11588
11573
  this.order = sensor_bands_1.BAND.CONTENT + 0;
11589
11574
  this.MAX_TLVS = 64;
11590
11575
  }
11591
- async supports(input) {
11592
- return !!input.headerTLVs || !!input.packet ? { action: "ALLOW" } : {
11593
- action: "DENY",
11594
- code: "SENSOR_NOT_APPLICABLE",
11595
- reason: "Header TLV context is not available"
11596
- };
11576
+ supports(input) {
11577
+ return !!input.headerTLVs || !!input.packet;
11597
11578
  }
11598
11579
  async run(input) {
11599
11580
  if (input.headerTLVs && input.headerTLVs.size > this.MAX_TLVS) {
@@ -11649,12 +11630,8 @@ var require_intent_allowlist_sensor = __commonJS({
11649
11630
  this.name = "IntentAllowlistSensor";
11650
11631
  this.order = sensor_bands_1.BAND.IDENTITY + 20;
11651
11632
  }
11652
- async supports(input) {
11653
- return !!input.intent ? { action: "ALLOW" } : {
11654
- action: "DENY",
11655
- code: "SENSOR_NOT_APPLICABLE",
11656
- reason: "Intent is not available"
11657
- };
11633
+ supports(input) {
11634
+ return !!input.intent;
11658
11635
  }
11659
11636
  async run(input) {
11660
11637
  const profile = input.metadata?.profile || "PUBLIC";
@@ -11704,8 +11681,8 @@ var require_intent_registry_sensor = __commonJS({
11704
11681
  this.name = "IntentRegistrySensor";
11705
11682
  this.order = sensor_bands_1.BAND.IDENTITY + 25;
11706
11683
  }
11707
- async supports() {
11708
- return Promise.resolve({ action: "ALLOW" });
11684
+ supports() {
11685
+ return true;
11709
11686
  }
11710
11687
  async run(input) {
11711
11688
  const intent = input.intent;
@@ -11754,12 +11731,8 @@ var require_law_evaluation_sensor = __commonJS({
11754
11731
  this.name = "LawEvaluationSensor";
11755
11732
  this.order = sensor_bands_1.BAND.POLICY + 5;
11756
11733
  }
11757
- async supports(input) {
11758
- return !!this.options.evaluator && !!input.intent ? { action: "ALLOW" } : {
11759
- action: "DENY",
11760
- code: "SENSOR_NOT_APPLICABLE",
11761
- reason: "Law evaluator or intent missing"
11762
- };
11734
+ supports(input) {
11735
+ return !!this.options.evaluator && !!input.intent;
11763
11736
  }
11764
11737
  async run(input) {
11765
11738
  const evaluator = this.options.evaluator;
@@ -12226,11 +12199,8 @@ var require_proof_presence_sensor = __commonJS({
12226
12199
  this.name = "ProofPresenceSensor";
12227
12200
  this.order = sensor_bands_1.BAND.IDENTITY + 30;
12228
12201
  }
12229
- async supports(input) {
12230
- if (!!input.profile && !!input.visibility) {
12231
- return { action: "ALLOW" };
12232
- }
12233
- return { action: "DENY", code: "MISSING_REQUIRED_FIELDS" };
12202
+ supports(input) {
12203
+ return !!input.profile && !!input.visibility;
12234
12204
  }
12235
12205
  async run(input) {
12236
12206
  const validatedInput = axis_schemas_1.ProofPresenceInputZ.safeParse(input);
@@ -12524,8 +12494,8 @@ var require_receipt_policy_sensor = __commonJS({
12524
12494
  this.name = "ReceiptPolicySensor";
12525
12495
  this.order = sensor_bands_1.BAND.BUSINESS + 20;
12526
12496
  }
12527
- async supports() {
12528
- return { action: "ALLOW" };
12497
+ supports() {
12498
+ return true;
12529
12499
  }
12530
12500
  async run() {
12531
12501
  return { action: "ALLOW" };
@@ -12685,11 +12655,8 @@ var require_schema_validation_sensor = __commonJS({
12685
12655
  this.name = "SchemaValidationSensor";
12686
12656
  this.order = sensor_bands_1.BAND.CONTENT + 35;
12687
12657
  }
12688
- async supports(input) {
12689
- if (input.metadata?.schema) {
12690
- return { action: "ALLOW" };
12691
- }
12692
- return { action: "DENY", code: "SCHEMA_NOT_CONFIGURED" };
12658
+ supports(input) {
12659
+ return !!input.metadata?.schema;
12693
12660
  }
12694
12661
  async run(input) {
12695
12662
  const schema = input.metadata?.schema;
@@ -12814,8 +12781,8 @@ var require_stream_scope_sensor = __commonJS({
12814
12781
  this.name = "StreamScopeSensor";
12815
12782
  this.order = sensor_bands_1.BAND.BUSINESS + 0;
12816
12783
  }
12817
- async supports() {
12818
- return { action: "ALLOW" };
12784
+ supports() {
12785
+ return true;
12819
12786
  }
12820
12787
  async run() {
12821
12788
  return { action: "ALLOW" };
@@ -12853,12 +12820,8 @@ var require_tickauth_sensor = __commonJS({
12853
12820
  this.matchIntent = options.matchIntent ?? true;
12854
12821
  this.acceptTypes = options.acceptTypes?.length ? new Set(options.acceptTypes) : null;
12855
12822
  }
12856
- async supports(input) {
12857
- return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule) ? { action: "ALLOW" } : {
12858
- action: "DENY",
12859
- code: "SENSOR_NOT_APPLICABLE",
12860
- reason: "TickAuth capsule not found"
12861
- };
12823
+ supports(input) {
12824
+ return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule);
12862
12825
  }
12863
12826
  async run(input) {
12864
12827
  const capsule = input.metadata?.capsule ?? input.metadata?.tickauthCapsule ?? input.metadata?.cceEnvelope?.capsule;
@@ -12964,12 +12927,8 @@ var require_tlv_parse_sensor = __commonJS({
12964
12927
  this.name = "TLVParseSensor";
12965
12928
  this.order = sensor_bands_1.BAND.CONTENT + 20;
12966
12929
  }
12967
- async supports(input) {
12968
- return !!input.packet ? { action: "ALLOW" } : {
12969
- action: "DENY",
12970
- code: "SENSOR_NOT_APPLICABLE",
12971
- reason: "Packet is not available"
12972
- };
12930
+ supports(input) {
12931
+ return !!input.packet;
12973
12932
  }
12974
12933
  async run(input) {
12975
12934
  const packet = input.packet;
@@ -13101,13 +13060,9 @@ var require_tps_sensor = __commonJS({
13101
13060
  this.maxDriftMs = options.maxDriftMs ?? 3e4;
13102
13061
  this.resolver = options.resolver ?? parseINotation;
13103
13062
  }
13104
- async supports(input) {
13063
+ supports(input) {
13105
13064
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
13106
- return typeof tps === "string" && tps.length > 0 ? { action: "ALLOW" } : {
13107
- action: "DENY",
13108
- code: "SENSOR_NOT_APPLICABLE",
13109
- reason: "TPS coordinate not available"
13110
- };
13065
+ return typeof tps === "string" && tps.length > 0;
13111
13066
  }
13112
13067
  async run(input) {
13113
13068
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
@@ -13173,12 +13128,8 @@ var require_varint_hardening_sensor = __commonJS({
13173
13128
  this.order = sensor_bands_1.BAND.WIRE + 35;
13174
13129
  this.MAX_VARINT_BYTES = 5;
13175
13130
  }
13176
- async supports(input) {
13177
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
13178
- action: "DENY",
13179
- code: "SENSOR_NOT_APPLICABLE",
13180
- reason: "Insufficient peek data for varint hardening"
13181
- };
13131
+ supports(input) {
13132
+ return !!input.peek && input.peek.length >= 7;
13182
13133
  }
13183
13134
  async run(input) {
13184
13135
  const peek = input.peek;