@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.
@@ -104,9 +104,9 @@ var require_access_profile_resolver_sensor = __commonJS({
104
104
  this.name = "AccessProfileResolverSensor";
105
105
  this.order = sensor_bands_1.BAND.IDENTITY + 10;
106
106
  }
107
- async supports(input) {
107
+ supports(input) {
108
108
  void input;
109
- return { action: "ALLOW" };
109
+ return true;
110
110
  }
111
111
  async run(input) {
112
112
  const hasCapsule = !!input.metadata?.capsuleId;
@@ -318,12 +318,8 @@ var require_body_budget_sensor = __commonJS({
318
318
  this.name = "BodyBudgetSensor";
319
319
  this.order = sensor_bands_1.BAND.CONTENT + 10;
320
320
  }
321
- async supports(input) {
322
- return !!input.peek && input.peek.length >= 8 ? { action: "ALLOW" } : {
323
- action: "DENY",
324
- code: "SENSOR_NOT_APPLICABLE",
325
- reason: "Insufficient peek data to read headers"
326
- };
321
+ supports(input) {
322
+ return !!input.peek && input.peek.length >= 8;
327
323
  }
328
324
  async run(input) {
329
325
  const { peek } = input;
@@ -8682,11 +8678,13 @@ var init_sensor_registry = __esm({
8682
8678
  return this.sensorsByName.get(name);
8683
8679
  }
8684
8680
  getPreDecodeSensors() {
8685
- return this.list().filter((s) => (s.order ?? 999) < 40);
8681
+ return this.list().filter(
8682
+ (s) => this.isPreDecodeSensor(s)
8683
+ );
8686
8684
  }
8687
8685
  getPostDecodeSensors() {
8688
8686
  return this.list().filter(
8689
- (s) => (s.order ?? 999) >= 40
8687
+ (s) => this.isPostDecodeSensor(s)
8690
8688
  );
8691
8689
  }
8692
8690
  getSensorCountByPhase() {
@@ -8702,11 +8700,13 @@ var init_sensor_registry = __esm({
8702
8700
  }
8703
8701
  isPreDecodeSensor(sensor) {
8704
8702
  const phase = typeof sensor.phase === "string" ? sensor.phase : sensor.phase?.phase;
8705
- return phase === "PRE_DECODE" || (sensor.order ?? 999) < 40;
8703
+ if (phase) return phase === "PRE_DECODE";
8704
+ return (sensor.order ?? 999) < 40;
8706
8705
  }
8707
8706
  isPostDecodeSensor(sensor) {
8708
8707
  const phase = typeof sensor.phase === "string" ? sensor.phase : sensor.phase?.phase;
8709
- return phase === "POST_DECODE" || (sensor.order ?? 999) >= 40;
8708
+ if (phase) return phase === "POST_DECODE";
8709
+ return (sensor.order ?? 999) >= 40;
8710
8710
  }
8711
8711
  indexSensor(sensor) {
8712
8712
  this.sensorsByName.set(sensor.name, sensor);
@@ -8812,10 +8812,7 @@ var init_axis_sensor_chain_service = __esm({
8812
8812
  continue;
8813
8813
  }
8814
8814
  try {
8815
- const supportsDecision = normalizeSensorDecision(
8816
- await sensor.supports(input)
8817
- );
8818
- if (supportsDecision.allow) {
8815
+ if (sensor.supports(input)) {
8819
8816
  relevantSensors.push(sensor);
8820
8817
  }
8821
8818
  } catch (error) {
@@ -11179,9 +11176,9 @@ var require_capability_enforcement_sensor = __commonJS({
11179
11176
  this.name = "CapabilityEnforcementSensor";
11180
11177
  this.order = sensor_bands_1.BAND.POLICY + 10;
11181
11178
  }
11182
- async supports(input) {
11179
+ supports(input) {
11183
11180
  void input;
11184
- return { action: "ALLOW" };
11181
+ return true;
11185
11182
  }
11186
11183
  async run(input) {
11187
11184
  const { intent, packet } = input;
@@ -11247,12 +11244,8 @@ var require_chunk_hash_sensor = __commonJS({
11247
11244
  this.name = "ChunkHashSensor";
11248
11245
  this.order = sensor_bands_1.BAND.CONTENT + 50;
11249
11246
  }
11250
- async supports(input) {
11251
- return input.intent === "file.chunk" ? { action: "ALLOW" } : {
11252
- action: "DENY",
11253
- code: "SENSOR_NOT_APPLICABLE",
11254
- reason: "Only file.chunk intent is supported"
11255
- };
11247
+ supports(input) {
11248
+ return input.intent === "file.chunk";
11256
11249
  }
11257
11250
  async run(input) {
11258
11251
  const headerTLVs = input.headerTLVs;
@@ -11479,8 +11472,8 @@ var require_execution_timeout_sensor = __commonJS({
11479
11472
  this.name = "ExecutionTimeoutSensor";
11480
11473
  this.order = sensor_bands_1.BAND.BUSINESS + 10;
11481
11474
  }
11482
- async supports() {
11483
- return Promise.resolve({ action: "ALLOW" });
11475
+ supports() {
11476
+ return true;
11484
11477
  }
11485
11478
  async run(input) {
11486
11479
  const { intent, context } = input;
@@ -11533,12 +11526,8 @@ var require_frame_budget_sensor = __commonJS({
11533
11526
  this.name = "FrameBudgetSensor";
11534
11527
  this.order = sensor_bands_1.BAND.WIRE + 20;
11535
11528
  }
11536
- async supports(input) {
11537
- return typeof input.contentLength === "number" ? { action: "ALLOW" } : {
11538
- action: "DENY",
11539
- code: "SENSOR_NOT_APPLICABLE",
11540
- reason: "Content-Length not available"
11541
- };
11529
+ supports(input) {
11530
+ return typeof input.contentLength === "number";
11542
11531
  }
11543
11532
  async run(input) {
11544
11533
  const maxBytes = Number(process.env["AXIS_MAX_FRAME_SIZE"]) || 50 * 1024 * 1024;
@@ -11583,12 +11572,8 @@ var require_frame_header_sanity_sensor = __commonJS({
11583
11572
  this.name = "FrameHeaderSanitySensor";
11584
11573
  this.order = sensor_bands_1.BAND.WIRE + 30;
11585
11574
  }
11586
- async supports(input) {
11587
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
11588
- action: "DENY",
11589
- code: "SENSOR_NOT_APPLICABLE",
11590
- reason: "Insufficient peek data for header sanity checks"
11591
- };
11575
+ supports(input) {
11576
+ return !!input.peek && input.peek.length >= 7;
11592
11577
  }
11593
11578
  async run(input) {
11594
11579
  const peek = input.peek;
@@ -11654,12 +11639,8 @@ var require_header_tlv_limit_sensor = __commonJS({
11654
11639
  this.order = sensor_bands_1.BAND.CONTENT + 0;
11655
11640
  this.MAX_TLVS = 64;
11656
11641
  }
11657
- async supports(input) {
11658
- return !!input.headerTLVs || !!input.packet ? { action: "ALLOW" } : {
11659
- action: "DENY",
11660
- code: "SENSOR_NOT_APPLICABLE",
11661
- reason: "Header TLV context is not available"
11662
- };
11642
+ supports(input) {
11643
+ return !!input.headerTLVs || !!input.packet;
11663
11644
  }
11664
11645
  async run(input) {
11665
11646
  if (input.headerTLVs && input.headerTLVs.size > this.MAX_TLVS) {
@@ -11715,12 +11696,8 @@ var require_intent_allowlist_sensor = __commonJS({
11715
11696
  this.name = "IntentAllowlistSensor";
11716
11697
  this.order = sensor_bands_1.BAND.IDENTITY + 20;
11717
11698
  }
11718
- async supports(input) {
11719
- return !!input.intent ? { action: "ALLOW" } : {
11720
- action: "DENY",
11721
- code: "SENSOR_NOT_APPLICABLE",
11722
- reason: "Intent is not available"
11723
- };
11699
+ supports(input) {
11700
+ return !!input.intent;
11724
11701
  }
11725
11702
  async run(input) {
11726
11703
  const profile = input.metadata?.profile || "PUBLIC";
@@ -11770,8 +11747,8 @@ var require_intent_registry_sensor = __commonJS({
11770
11747
  this.name = "IntentRegistrySensor";
11771
11748
  this.order = sensor_bands_1.BAND.IDENTITY + 25;
11772
11749
  }
11773
- async supports() {
11774
- return Promise.resolve({ action: "ALLOW" });
11750
+ supports() {
11751
+ return true;
11775
11752
  }
11776
11753
  async run(input) {
11777
11754
  const intent = input.intent;
@@ -11820,12 +11797,8 @@ var require_law_evaluation_sensor = __commonJS({
11820
11797
  this.name = "LawEvaluationSensor";
11821
11798
  this.order = sensor_bands_1.BAND.POLICY + 5;
11822
11799
  }
11823
- async supports(input) {
11824
- return !!this.options.evaluator && !!input.intent ? { action: "ALLOW" } : {
11825
- action: "DENY",
11826
- code: "SENSOR_NOT_APPLICABLE",
11827
- reason: "Law evaluator or intent missing"
11828
- };
11800
+ supports(input) {
11801
+ return !!this.options.evaluator && !!input.intent;
11829
11802
  }
11830
11803
  async run(input) {
11831
11804
  const evaluator = this.options.evaluator;
@@ -12292,11 +12265,8 @@ var require_proof_presence_sensor = __commonJS({
12292
12265
  this.name = "ProofPresenceSensor";
12293
12266
  this.order = sensor_bands_1.BAND.IDENTITY + 30;
12294
12267
  }
12295
- async supports(input) {
12296
- if (!!input.profile && !!input.visibility) {
12297
- return { action: "ALLOW" };
12298
- }
12299
- return { action: "DENY", code: "MISSING_REQUIRED_FIELDS" };
12268
+ supports(input) {
12269
+ return !!input.profile && !!input.visibility;
12300
12270
  }
12301
12271
  async run(input) {
12302
12272
  const validatedInput = axis_schemas_1.ProofPresenceInputZ.safeParse(input);
@@ -12590,8 +12560,8 @@ var require_receipt_policy_sensor = __commonJS({
12590
12560
  this.name = "ReceiptPolicySensor";
12591
12561
  this.order = sensor_bands_1.BAND.BUSINESS + 20;
12592
12562
  }
12593
- async supports() {
12594
- return { action: "ALLOW" };
12563
+ supports() {
12564
+ return true;
12595
12565
  }
12596
12566
  async run() {
12597
12567
  return { action: "ALLOW" };
@@ -12751,11 +12721,8 @@ var require_schema_validation_sensor = __commonJS({
12751
12721
  this.name = "SchemaValidationSensor";
12752
12722
  this.order = sensor_bands_1.BAND.CONTENT + 35;
12753
12723
  }
12754
- async supports(input) {
12755
- if (input.metadata?.schema) {
12756
- return { action: "ALLOW" };
12757
- }
12758
- return { action: "DENY", code: "SCHEMA_NOT_CONFIGURED" };
12724
+ supports(input) {
12725
+ return !!input.metadata?.schema;
12759
12726
  }
12760
12727
  async run(input) {
12761
12728
  const schema = input.metadata?.schema;
@@ -12880,8 +12847,8 @@ var require_stream_scope_sensor = __commonJS({
12880
12847
  this.name = "StreamScopeSensor";
12881
12848
  this.order = sensor_bands_1.BAND.BUSINESS + 0;
12882
12849
  }
12883
- async supports() {
12884
- return { action: "ALLOW" };
12850
+ supports() {
12851
+ return true;
12885
12852
  }
12886
12853
  async run() {
12887
12854
  return { action: "ALLOW" };
@@ -12919,12 +12886,8 @@ var require_tickauth_sensor = __commonJS({
12919
12886
  this.matchIntent = options.matchIntent ?? true;
12920
12887
  this.acceptTypes = options.acceptTypes?.length ? new Set(options.acceptTypes) : null;
12921
12888
  }
12922
- async supports(input) {
12923
- return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule) ? { action: "ALLOW" } : {
12924
- action: "DENY",
12925
- code: "SENSOR_NOT_APPLICABLE",
12926
- reason: "TickAuth capsule not found"
12927
- };
12889
+ supports(input) {
12890
+ return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule);
12928
12891
  }
12929
12892
  async run(input) {
12930
12893
  const capsule = input.metadata?.capsule ?? input.metadata?.tickauthCapsule ?? input.metadata?.cceEnvelope?.capsule;
@@ -13030,12 +12993,8 @@ var require_tlv_parse_sensor = __commonJS({
13030
12993
  this.name = "TLVParseSensor";
13031
12994
  this.order = sensor_bands_1.BAND.CONTENT + 20;
13032
12995
  }
13033
- async supports(input) {
13034
- return !!input.packet ? { action: "ALLOW" } : {
13035
- action: "DENY",
13036
- code: "SENSOR_NOT_APPLICABLE",
13037
- reason: "Packet is not available"
13038
- };
12996
+ supports(input) {
12997
+ return !!input.packet;
13039
12998
  }
13040
12999
  async run(input) {
13041
13000
  const packet = input.packet;
@@ -13167,13 +13126,9 @@ var require_tps_sensor = __commonJS({
13167
13126
  this.maxDriftMs = options.maxDriftMs ?? 3e4;
13168
13127
  this.resolver = options.resolver ?? parseINotation;
13169
13128
  }
13170
- async supports(input) {
13129
+ supports(input) {
13171
13130
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
13172
- return typeof tps === "string" && tps.length > 0 ? { action: "ALLOW" } : {
13173
- action: "DENY",
13174
- code: "SENSOR_NOT_APPLICABLE",
13175
- reason: "TPS coordinate not available"
13176
- };
13131
+ return typeof tps === "string" && tps.length > 0;
13177
13132
  }
13178
13133
  async run(input) {
13179
13134
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
@@ -13239,12 +13194,8 @@ var require_varint_hardening_sensor = __commonJS({
13239
13194
  this.order = sensor_bands_1.BAND.WIRE + 35;
13240
13195
  this.MAX_VARINT_BYTES = 5;
13241
13196
  }
13242
- async supports(input) {
13243
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
13244
- action: "DENY",
13245
- code: "SENSOR_NOT_APPLICABLE",
13246
- reason: "Insufficient peek data for varint hardening"
13247
- };
13197
+ supports(input) {
13198
+ return !!input.peek && input.peek.length >= 7;
13248
13199
  }
13249
13200
  async run(input) {
13250
13201
  const peek = input.peek;