@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.
@@ -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;
@@ -8812,10 +8808,7 @@ var init_axis_sensor_chain_service = __esm({
8812
8808
  continue;
8813
8809
  }
8814
8810
  try {
8815
- const supportsDecision = normalizeSensorDecision(
8816
- await sensor.supports(input)
8817
- );
8818
- if (supportsDecision.allow) {
8811
+ if (sensor.supports(input)) {
8819
8812
  relevantSensors.push(sensor);
8820
8813
  }
8821
8814
  } catch (error) {
@@ -11179,9 +11172,9 @@ var require_capability_enforcement_sensor = __commonJS({
11179
11172
  this.name = "CapabilityEnforcementSensor";
11180
11173
  this.order = sensor_bands_1.BAND.POLICY + 10;
11181
11174
  }
11182
- async supports(input) {
11175
+ supports(input) {
11183
11176
  void input;
11184
- return { action: "ALLOW" };
11177
+ return true;
11185
11178
  }
11186
11179
  async run(input) {
11187
11180
  const { intent, packet } = input;
@@ -11247,12 +11240,8 @@ var require_chunk_hash_sensor = __commonJS({
11247
11240
  this.name = "ChunkHashSensor";
11248
11241
  this.order = sensor_bands_1.BAND.CONTENT + 50;
11249
11242
  }
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
- };
11243
+ supports(input) {
11244
+ return input.intent === "file.chunk";
11256
11245
  }
11257
11246
  async run(input) {
11258
11247
  const headerTLVs = input.headerTLVs;
@@ -11479,8 +11468,8 @@ var require_execution_timeout_sensor = __commonJS({
11479
11468
  this.name = "ExecutionTimeoutSensor";
11480
11469
  this.order = sensor_bands_1.BAND.BUSINESS + 10;
11481
11470
  }
11482
- async supports() {
11483
- return Promise.resolve({ action: "ALLOW" });
11471
+ supports() {
11472
+ return true;
11484
11473
  }
11485
11474
  async run(input) {
11486
11475
  const { intent, context } = input;
@@ -11533,12 +11522,8 @@ var require_frame_budget_sensor = __commonJS({
11533
11522
  this.name = "FrameBudgetSensor";
11534
11523
  this.order = sensor_bands_1.BAND.WIRE + 20;
11535
11524
  }
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
- };
11525
+ supports(input) {
11526
+ return typeof input.contentLength === "number";
11542
11527
  }
11543
11528
  async run(input) {
11544
11529
  const maxBytes = Number(process.env["AXIS_MAX_FRAME_SIZE"]) || 50 * 1024 * 1024;
@@ -11583,12 +11568,8 @@ var require_frame_header_sanity_sensor = __commonJS({
11583
11568
  this.name = "FrameHeaderSanitySensor";
11584
11569
  this.order = sensor_bands_1.BAND.WIRE + 30;
11585
11570
  }
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
- };
11571
+ supports(input) {
11572
+ return !!input.peek && input.peek.length >= 7;
11592
11573
  }
11593
11574
  async run(input) {
11594
11575
  const peek = input.peek;
@@ -11654,12 +11635,8 @@ var require_header_tlv_limit_sensor = __commonJS({
11654
11635
  this.order = sensor_bands_1.BAND.CONTENT + 0;
11655
11636
  this.MAX_TLVS = 64;
11656
11637
  }
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
- };
11638
+ supports(input) {
11639
+ return !!input.headerTLVs || !!input.packet;
11663
11640
  }
11664
11641
  async run(input) {
11665
11642
  if (input.headerTLVs && input.headerTLVs.size > this.MAX_TLVS) {
@@ -11715,12 +11692,8 @@ var require_intent_allowlist_sensor = __commonJS({
11715
11692
  this.name = "IntentAllowlistSensor";
11716
11693
  this.order = sensor_bands_1.BAND.IDENTITY + 20;
11717
11694
  }
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
- };
11695
+ supports(input) {
11696
+ return !!input.intent;
11724
11697
  }
11725
11698
  async run(input) {
11726
11699
  const profile = input.metadata?.profile || "PUBLIC";
@@ -11770,8 +11743,8 @@ var require_intent_registry_sensor = __commonJS({
11770
11743
  this.name = "IntentRegistrySensor";
11771
11744
  this.order = sensor_bands_1.BAND.IDENTITY + 25;
11772
11745
  }
11773
- async supports() {
11774
- return Promise.resolve({ action: "ALLOW" });
11746
+ supports() {
11747
+ return true;
11775
11748
  }
11776
11749
  async run(input) {
11777
11750
  const intent = input.intent;
@@ -11820,12 +11793,8 @@ var require_law_evaluation_sensor = __commonJS({
11820
11793
  this.name = "LawEvaluationSensor";
11821
11794
  this.order = sensor_bands_1.BAND.POLICY + 5;
11822
11795
  }
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
- };
11796
+ supports(input) {
11797
+ return !!this.options.evaluator && !!input.intent;
11829
11798
  }
11830
11799
  async run(input) {
11831
11800
  const evaluator = this.options.evaluator;
@@ -12292,11 +12261,8 @@ var require_proof_presence_sensor = __commonJS({
12292
12261
  this.name = "ProofPresenceSensor";
12293
12262
  this.order = sensor_bands_1.BAND.IDENTITY + 30;
12294
12263
  }
12295
- async supports(input) {
12296
- if (!!input.profile && !!input.visibility) {
12297
- return { action: "ALLOW" };
12298
- }
12299
- return { action: "DENY", code: "MISSING_REQUIRED_FIELDS" };
12264
+ supports(input) {
12265
+ return !!input.profile && !!input.visibility;
12300
12266
  }
12301
12267
  async run(input) {
12302
12268
  const validatedInput = axis_schemas_1.ProofPresenceInputZ.safeParse(input);
@@ -12590,8 +12556,8 @@ var require_receipt_policy_sensor = __commonJS({
12590
12556
  this.name = "ReceiptPolicySensor";
12591
12557
  this.order = sensor_bands_1.BAND.BUSINESS + 20;
12592
12558
  }
12593
- async supports() {
12594
- return { action: "ALLOW" };
12559
+ supports() {
12560
+ return true;
12595
12561
  }
12596
12562
  async run() {
12597
12563
  return { action: "ALLOW" };
@@ -12751,11 +12717,8 @@ var require_schema_validation_sensor = __commonJS({
12751
12717
  this.name = "SchemaValidationSensor";
12752
12718
  this.order = sensor_bands_1.BAND.CONTENT + 35;
12753
12719
  }
12754
- async supports(input) {
12755
- if (input.metadata?.schema) {
12756
- return { action: "ALLOW" };
12757
- }
12758
- return { action: "DENY", code: "SCHEMA_NOT_CONFIGURED" };
12720
+ supports(input) {
12721
+ return !!input.metadata?.schema;
12759
12722
  }
12760
12723
  async run(input) {
12761
12724
  const schema = input.metadata?.schema;
@@ -12880,8 +12843,8 @@ var require_stream_scope_sensor = __commonJS({
12880
12843
  this.name = "StreamScopeSensor";
12881
12844
  this.order = sensor_bands_1.BAND.BUSINESS + 0;
12882
12845
  }
12883
- async supports() {
12884
- return { action: "ALLOW" };
12846
+ supports() {
12847
+ return true;
12885
12848
  }
12886
12849
  async run() {
12887
12850
  return { action: "ALLOW" };
@@ -12919,12 +12882,8 @@ var require_tickauth_sensor = __commonJS({
12919
12882
  this.matchIntent = options.matchIntent ?? true;
12920
12883
  this.acceptTypes = options.acceptTypes?.length ? new Set(options.acceptTypes) : null;
12921
12884
  }
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
- };
12885
+ supports(input) {
12886
+ return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule);
12928
12887
  }
12929
12888
  async run(input) {
12930
12889
  const capsule = input.metadata?.capsule ?? input.metadata?.tickauthCapsule ?? input.metadata?.cceEnvelope?.capsule;
@@ -13030,12 +12989,8 @@ var require_tlv_parse_sensor = __commonJS({
13030
12989
  this.name = "TLVParseSensor";
13031
12990
  this.order = sensor_bands_1.BAND.CONTENT + 20;
13032
12991
  }
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
- };
12992
+ supports(input) {
12993
+ return !!input.packet;
13039
12994
  }
13040
12995
  async run(input) {
13041
12996
  const packet = input.packet;
@@ -13167,13 +13122,9 @@ var require_tps_sensor = __commonJS({
13167
13122
  this.maxDriftMs = options.maxDriftMs ?? 3e4;
13168
13123
  this.resolver = options.resolver ?? parseINotation;
13169
13124
  }
13170
- async supports(input) {
13125
+ supports(input) {
13171
13126
  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
- };
13127
+ return typeof tps === "string" && tps.length > 0;
13177
13128
  }
13178
13129
  async run(input) {
13179
13130
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
@@ -13239,12 +13190,8 @@ var require_varint_hardening_sensor = __commonJS({
13239
13190
  this.order = sensor_bands_1.BAND.WIRE + 35;
13240
13191
  this.MAX_VARINT_BYTES = 5;
13241
13192
  }
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
- };
13193
+ supports(input) {
13194
+ return !!input.peek && input.peek.length >= 7;
13248
13195
  }
13249
13196
  async run(input) {
13250
13197
  const peek = input.peek;