@nextera.one/axis-server-sdk 2.3.6 → 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.
package/dist/index.js CHANGED
@@ -8635,10 +8635,7 @@ var init_axis_sensor_chain_service = __esm({
8635
8635
  continue;
8636
8636
  }
8637
8637
  try {
8638
- const supportsDecision = normalizeSensorDecision(
8639
- await sensor.supports(input)
8640
- );
8641
- if (supportsDecision.allow) {
8638
+ if (sensor.supports(input)) {
8642
8639
  relevantSensors.push(sensor);
8643
8640
  }
8644
8641
  } catch (error) {
@@ -10613,9 +10610,9 @@ var require_access_profile_resolver_sensor = __commonJS({
10613
10610
  this.name = "AccessProfileResolverSensor";
10614
10611
  this.order = sensor_bands_1.BAND.IDENTITY + 10;
10615
10612
  }
10616
- async supports(input) {
10613
+ supports(input) {
10617
10614
  void input;
10618
- return { action: "ALLOW" };
10615
+ return true;
10619
10616
  }
10620
10617
  async run(input) {
10621
10618
  const hasCapsule = !!input.metadata?.capsuleId;
@@ -10656,12 +10653,8 @@ var require_body_budget_sensor = __commonJS({
10656
10653
  this.name = "BodyBudgetSensor";
10657
10654
  this.order = sensor_bands_1.BAND.CONTENT + 10;
10658
10655
  }
10659
- async supports(input) {
10660
- return !!input.peek && input.peek.length >= 8 ? { action: "ALLOW" } : {
10661
- action: "DENY",
10662
- code: "SENSOR_NOT_APPLICABLE",
10663
- reason: "Insufficient peek data to read headers"
10664
- };
10656
+ supports(input) {
10657
+ return !!input.peek && input.peek.length >= 8;
10665
10658
  }
10666
10659
  async run(input) {
10667
10660
  const { peek } = input;
@@ -10725,9 +10718,9 @@ var require_capability_enforcement_sensor = __commonJS({
10725
10718
  this.name = "CapabilityEnforcementSensor";
10726
10719
  this.order = sensor_bands_1.BAND.POLICY + 10;
10727
10720
  }
10728
- async supports(input) {
10721
+ supports(input) {
10729
10722
  void input;
10730
- return { action: "ALLOW" };
10723
+ return true;
10731
10724
  }
10732
10725
  async run(input) {
10733
10726
  const { intent, packet } = input;
@@ -10793,12 +10786,8 @@ var require_chunk_hash_sensor = __commonJS({
10793
10786
  this.name = "ChunkHashSensor";
10794
10787
  this.order = sensor_bands_1.BAND.CONTENT + 50;
10795
10788
  }
10796
- async supports(input) {
10797
- return input.intent === "file.chunk" ? { action: "ALLOW" } : {
10798
- action: "DENY",
10799
- code: "SENSOR_NOT_APPLICABLE",
10800
- reason: "Only file.chunk intent is supported"
10801
- };
10789
+ supports(input) {
10790
+ return input.intent === "file.chunk";
10802
10791
  }
10803
10792
  async run(input) {
10804
10793
  const headerTLVs = input.headerTLVs;
@@ -11025,8 +11014,8 @@ var require_execution_timeout_sensor = __commonJS({
11025
11014
  this.name = "ExecutionTimeoutSensor";
11026
11015
  this.order = sensor_bands_1.BAND.BUSINESS + 10;
11027
11016
  }
11028
- async supports() {
11029
- return Promise.resolve({ action: "ALLOW" });
11017
+ supports() {
11018
+ return true;
11030
11019
  }
11031
11020
  async run(input) {
11032
11021
  const { intent, context } = input;
@@ -11079,12 +11068,8 @@ var require_frame_budget_sensor = __commonJS({
11079
11068
  this.name = "FrameBudgetSensor";
11080
11069
  this.order = sensor_bands_1.BAND.WIRE + 20;
11081
11070
  }
11082
- async supports(input) {
11083
- return typeof input.contentLength === "number" ? { action: "ALLOW" } : {
11084
- action: "DENY",
11085
- code: "SENSOR_NOT_APPLICABLE",
11086
- reason: "Content-Length not available"
11087
- };
11071
+ supports(input) {
11072
+ return typeof input.contentLength === "number";
11088
11073
  }
11089
11074
  async run(input) {
11090
11075
  const maxBytes = Number(process.env["AXIS_MAX_FRAME_SIZE"]) || 50 * 1024 * 1024;
@@ -11129,12 +11114,8 @@ var require_frame_header_sanity_sensor = __commonJS({
11129
11114
  this.name = "FrameHeaderSanitySensor";
11130
11115
  this.order = sensor_bands_1.BAND.WIRE + 30;
11131
11116
  }
11132
- async supports(input) {
11133
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
11134
- action: "DENY",
11135
- code: "SENSOR_NOT_APPLICABLE",
11136
- reason: "Insufficient peek data for header sanity checks"
11137
- };
11117
+ supports(input) {
11118
+ return !!input.peek && input.peek.length >= 7;
11138
11119
  }
11139
11120
  async run(input) {
11140
11121
  const peek = input.peek;
@@ -11200,12 +11181,8 @@ var require_header_tlv_limit_sensor = __commonJS({
11200
11181
  this.order = sensor_bands_1.BAND.CONTENT + 0;
11201
11182
  this.MAX_TLVS = 64;
11202
11183
  }
11203
- async supports(input) {
11204
- return !!input.headerTLVs || !!input.packet ? { action: "ALLOW" } : {
11205
- action: "DENY",
11206
- code: "SENSOR_NOT_APPLICABLE",
11207
- reason: "Header TLV context is not available"
11208
- };
11184
+ supports(input) {
11185
+ return !!input.headerTLVs || !!input.packet;
11209
11186
  }
11210
11187
  async run(input) {
11211
11188
  if (input.headerTLVs && input.headerTLVs.size > this.MAX_TLVS) {
@@ -11261,12 +11238,8 @@ var require_intent_allowlist_sensor = __commonJS({
11261
11238
  this.name = "IntentAllowlistSensor";
11262
11239
  this.order = sensor_bands_1.BAND.IDENTITY + 20;
11263
11240
  }
11264
- async supports(input) {
11265
- return !!input.intent ? { action: "ALLOW" } : {
11266
- action: "DENY",
11267
- code: "SENSOR_NOT_APPLICABLE",
11268
- reason: "Intent is not available"
11269
- };
11241
+ supports(input) {
11242
+ return !!input.intent;
11270
11243
  }
11271
11244
  async run(input) {
11272
11245
  const profile = input.metadata?.profile || "PUBLIC";
@@ -11316,8 +11289,8 @@ var require_intent_registry_sensor = __commonJS({
11316
11289
  this.name = "IntentRegistrySensor";
11317
11290
  this.order = sensor_bands_1.BAND.IDENTITY + 25;
11318
11291
  }
11319
- async supports() {
11320
- return Promise.resolve({ action: "ALLOW" });
11292
+ supports() {
11293
+ return true;
11321
11294
  }
11322
11295
  async run(input) {
11323
11296
  const intent = input.intent;
@@ -11366,12 +11339,8 @@ var require_law_evaluation_sensor = __commonJS({
11366
11339
  this.name = "LawEvaluationSensor";
11367
11340
  this.order = sensor_bands_1.BAND.POLICY + 5;
11368
11341
  }
11369
- async supports(input) {
11370
- return !!this.options.evaluator && !!input.intent ? { action: "ALLOW" } : {
11371
- action: "DENY",
11372
- code: "SENSOR_NOT_APPLICABLE",
11373
- reason: "Law evaluator or intent missing"
11374
- };
11342
+ supports(input) {
11343
+ return !!this.options.evaluator && !!input.intent;
11375
11344
  }
11376
11345
  async run(input) {
11377
11346
  const evaluator = this.options.evaluator;
@@ -11838,11 +11807,8 @@ var require_proof_presence_sensor = __commonJS({
11838
11807
  this.name = "ProofPresenceSensor";
11839
11808
  this.order = sensor_bands_1.BAND.IDENTITY + 30;
11840
11809
  }
11841
- async supports(input) {
11842
- if (!!input.profile && !!input.visibility) {
11843
- return { action: "ALLOW" };
11844
- }
11845
- return { action: "DENY", code: "MISSING_REQUIRED_FIELDS" };
11810
+ supports(input) {
11811
+ return !!input.profile && !!input.visibility;
11846
11812
  }
11847
11813
  async run(input) {
11848
11814
  const validatedInput = axis_schemas_1.ProofPresenceInputZ.safeParse(input);
@@ -12136,8 +12102,8 @@ var require_receipt_policy_sensor = __commonJS({
12136
12102
  this.name = "ReceiptPolicySensor";
12137
12103
  this.order = sensor_bands_1.BAND.BUSINESS + 20;
12138
12104
  }
12139
- async supports() {
12140
- return { action: "ALLOW" };
12105
+ supports() {
12106
+ return true;
12141
12107
  }
12142
12108
  async run() {
12143
12109
  return { action: "ALLOW" };
@@ -12297,11 +12263,8 @@ var require_schema_validation_sensor = __commonJS({
12297
12263
  this.name = "SchemaValidationSensor";
12298
12264
  this.order = sensor_bands_1.BAND.CONTENT + 35;
12299
12265
  }
12300
- async supports(input) {
12301
- if (input.metadata?.schema) {
12302
- return { action: "ALLOW" };
12303
- }
12304
- return { action: "DENY", code: "SCHEMA_NOT_CONFIGURED" };
12266
+ supports(input) {
12267
+ return !!input.metadata?.schema;
12305
12268
  }
12306
12269
  async run(input) {
12307
12270
  const schema = input.metadata?.schema;
@@ -12426,8 +12389,8 @@ var require_stream_scope_sensor = __commonJS({
12426
12389
  this.name = "StreamScopeSensor";
12427
12390
  this.order = sensor_bands_1.BAND.BUSINESS + 0;
12428
12391
  }
12429
- async supports() {
12430
- return { action: "ALLOW" };
12392
+ supports() {
12393
+ return true;
12431
12394
  }
12432
12395
  async run() {
12433
12396
  return { action: "ALLOW" };
@@ -12465,12 +12428,8 @@ var require_tickauth_sensor = __commonJS({
12465
12428
  this.matchIntent = options.matchIntent ?? true;
12466
12429
  this.acceptTypes = options.acceptTypes?.length ? new Set(options.acceptTypes) : null;
12467
12430
  }
12468
- async supports(input) {
12469
- return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule) ? { action: "ALLOW" } : {
12470
- action: "DENY",
12471
- code: "SENSOR_NOT_APPLICABLE",
12472
- reason: "TickAuth capsule not found"
12473
- };
12431
+ supports(input) {
12432
+ return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule);
12474
12433
  }
12475
12434
  async run(input) {
12476
12435
  const capsule = input.metadata?.capsule ?? input.metadata?.tickauthCapsule ?? input.metadata?.cceEnvelope?.capsule;
@@ -12576,12 +12535,8 @@ var require_tlv_parse_sensor = __commonJS({
12576
12535
  this.name = "TLVParseSensor";
12577
12536
  this.order = sensor_bands_1.BAND.CONTENT + 20;
12578
12537
  }
12579
- async supports(input) {
12580
- return !!input.packet ? { action: "ALLOW" } : {
12581
- action: "DENY",
12582
- code: "SENSOR_NOT_APPLICABLE",
12583
- reason: "Packet is not available"
12584
- };
12538
+ supports(input) {
12539
+ return !!input.packet;
12585
12540
  }
12586
12541
  async run(input) {
12587
12542
  const packet = input.packet;
@@ -12713,13 +12668,9 @@ var require_tps_sensor = __commonJS({
12713
12668
  this.maxDriftMs = options.maxDriftMs ?? 3e4;
12714
12669
  this.resolver = options.resolver ?? parseINotation;
12715
12670
  }
12716
- async supports(input) {
12671
+ supports(input) {
12717
12672
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
12718
- return typeof tps === "string" && tps.length > 0 ? { action: "ALLOW" } : {
12719
- action: "DENY",
12720
- code: "SENSOR_NOT_APPLICABLE",
12721
- reason: "TPS coordinate not available"
12722
- };
12673
+ return typeof tps === "string" && tps.length > 0;
12723
12674
  }
12724
12675
  async run(input) {
12725
12676
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
@@ -12785,12 +12736,8 @@ var require_varint_hardening_sensor = __commonJS({
12785
12736
  this.order = sensor_bands_1.BAND.WIRE + 35;
12786
12737
  this.MAX_VARINT_BYTES = 5;
12787
12738
  }
12788
- async supports(input) {
12789
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
12790
- action: "DENY",
12791
- code: "SENSOR_NOT_APPLICABLE",
12792
- reason: "Insufficient peek data for varint hardening"
12793
- };
12739
+ supports(input) {
12740
+ return !!input.peek && input.peek.length >= 7;
12794
12741
  }
12795
12742
  async run(input) {
12796
12743
  const peek = input.peek;