@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.mjs CHANGED
@@ -8704,10 +8704,7 @@ var init_axis_sensor_chain_service = __esm({
8704
8704
  continue;
8705
8705
  }
8706
8706
  try {
8707
- const supportsDecision = normalizeSensorDecision(
8708
- await sensor.supports(input)
8709
- );
8710
- if (supportsDecision.allow) {
8707
+ if (sensor.supports(input)) {
8711
8708
  relevantSensors.push(sensor);
8712
8709
  }
8713
8710
  } catch (error) {
@@ -10679,9 +10676,9 @@ var require_access_profile_resolver_sensor = __commonJS({
10679
10676
  this.name = "AccessProfileResolverSensor";
10680
10677
  this.order = sensor_bands_1.BAND.IDENTITY + 10;
10681
10678
  }
10682
- async supports(input) {
10679
+ supports(input) {
10683
10680
  void input;
10684
- return { action: "ALLOW" };
10681
+ return true;
10685
10682
  }
10686
10683
  async run(input) {
10687
10684
  const hasCapsule = !!input.metadata?.capsuleId;
@@ -10722,12 +10719,8 @@ var require_body_budget_sensor = __commonJS({
10722
10719
  this.name = "BodyBudgetSensor";
10723
10720
  this.order = sensor_bands_1.BAND.CONTENT + 10;
10724
10721
  }
10725
- async supports(input) {
10726
- return !!input.peek && input.peek.length >= 8 ? { action: "ALLOW" } : {
10727
- action: "DENY",
10728
- code: "SENSOR_NOT_APPLICABLE",
10729
- reason: "Insufficient peek data to read headers"
10730
- };
10722
+ supports(input) {
10723
+ return !!input.peek && input.peek.length >= 8;
10731
10724
  }
10732
10725
  async run(input) {
10733
10726
  const { peek } = input;
@@ -10791,9 +10784,9 @@ var require_capability_enforcement_sensor = __commonJS({
10791
10784
  this.name = "CapabilityEnforcementSensor";
10792
10785
  this.order = sensor_bands_1.BAND.POLICY + 10;
10793
10786
  }
10794
- async supports(input) {
10787
+ supports(input) {
10795
10788
  void input;
10796
- return { action: "ALLOW" };
10789
+ return true;
10797
10790
  }
10798
10791
  async run(input) {
10799
10792
  const { intent, packet } = input;
@@ -10859,12 +10852,8 @@ var require_chunk_hash_sensor = __commonJS({
10859
10852
  this.name = "ChunkHashSensor";
10860
10853
  this.order = sensor_bands_1.BAND.CONTENT + 50;
10861
10854
  }
10862
- async supports(input) {
10863
- return input.intent === "file.chunk" ? { action: "ALLOW" } : {
10864
- action: "DENY",
10865
- code: "SENSOR_NOT_APPLICABLE",
10866
- reason: "Only file.chunk intent is supported"
10867
- };
10855
+ supports(input) {
10856
+ return input.intent === "file.chunk";
10868
10857
  }
10869
10858
  async run(input) {
10870
10859
  const headerTLVs = input.headerTLVs;
@@ -11091,8 +11080,8 @@ var require_execution_timeout_sensor = __commonJS({
11091
11080
  this.name = "ExecutionTimeoutSensor";
11092
11081
  this.order = sensor_bands_1.BAND.BUSINESS + 10;
11093
11082
  }
11094
- async supports() {
11095
- return Promise.resolve({ action: "ALLOW" });
11083
+ supports() {
11084
+ return true;
11096
11085
  }
11097
11086
  async run(input) {
11098
11087
  const { intent, context } = input;
@@ -11145,12 +11134,8 @@ var require_frame_budget_sensor = __commonJS({
11145
11134
  this.name = "FrameBudgetSensor";
11146
11135
  this.order = sensor_bands_1.BAND.WIRE + 20;
11147
11136
  }
11148
- async supports(input) {
11149
- return typeof input.contentLength === "number" ? { action: "ALLOW" } : {
11150
- action: "DENY",
11151
- code: "SENSOR_NOT_APPLICABLE",
11152
- reason: "Content-Length not available"
11153
- };
11137
+ supports(input) {
11138
+ return typeof input.contentLength === "number";
11154
11139
  }
11155
11140
  async run(input) {
11156
11141
  const maxBytes = Number(process.env["AXIS_MAX_FRAME_SIZE"]) || 50 * 1024 * 1024;
@@ -11195,12 +11180,8 @@ var require_frame_header_sanity_sensor = __commonJS({
11195
11180
  this.name = "FrameHeaderSanitySensor";
11196
11181
  this.order = sensor_bands_1.BAND.WIRE + 30;
11197
11182
  }
11198
- async supports(input) {
11199
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
11200
- action: "DENY",
11201
- code: "SENSOR_NOT_APPLICABLE",
11202
- reason: "Insufficient peek data for header sanity checks"
11203
- };
11183
+ supports(input) {
11184
+ return !!input.peek && input.peek.length >= 7;
11204
11185
  }
11205
11186
  async run(input) {
11206
11187
  const peek = input.peek;
@@ -11266,12 +11247,8 @@ var require_header_tlv_limit_sensor = __commonJS({
11266
11247
  this.order = sensor_bands_1.BAND.CONTENT + 0;
11267
11248
  this.MAX_TLVS = 64;
11268
11249
  }
11269
- async supports(input) {
11270
- return !!input.headerTLVs || !!input.packet ? { action: "ALLOW" } : {
11271
- action: "DENY",
11272
- code: "SENSOR_NOT_APPLICABLE",
11273
- reason: "Header TLV context is not available"
11274
- };
11250
+ supports(input) {
11251
+ return !!input.headerTLVs || !!input.packet;
11275
11252
  }
11276
11253
  async run(input) {
11277
11254
  if (input.headerTLVs && input.headerTLVs.size > this.MAX_TLVS) {
@@ -11327,12 +11304,8 @@ var require_intent_allowlist_sensor = __commonJS({
11327
11304
  this.name = "IntentAllowlistSensor";
11328
11305
  this.order = sensor_bands_1.BAND.IDENTITY + 20;
11329
11306
  }
11330
- async supports(input) {
11331
- return !!input.intent ? { action: "ALLOW" } : {
11332
- action: "DENY",
11333
- code: "SENSOR_NOT_APPLICABLE",
11334
- reason: "Intent is not available"
11335
- };
11307
+ supports(input) {
11308
+ return !!input.intent;
11336
11309
  }
11337
11310
  async run(input) {
11338
11311
  const profile = input.metadata?.profile || "PUBLIC";
@@ -11382,8 +11355,8 @@ var require_intent_registry_sensor = __commonJS({
11382
11355
  this.name = "IntentRegistrySensor";
11383
11356
  this.order = sensor_bands_1.BAND.IDENTITY + 25;
11384
11357
  }
11385
- async supports() {
11386
- return Promise.resolve({ action: "ALLOW" });
11358
+ supports() {
11359
+ return true;
11387
11360
  }
11388
11361
  async run(input) {
11389
11362
  const intent = input.intent;
@@ -11432,12 +11405,8 @@ var require_law_evaluation_sensor = __commonJS({
11432
11405
  this.name = "LawEvaluationSensor";
11433
11406
  this.order = sensor_bands_1.BAND.POLICY + 5;
11434
11407
  }
11435
- async supports(input) {
11436
- return !!this.options.evaluator && !!input.intent ? { action: "ALLOW" } : {
11437
- action: "DENY",
11438
- code: "SENSOR_NOT_APPLICABLE",
11439
- reason: "Law evaluator or intent missing"
11440
- };
11408
+ supports(input) {
11409
+ return !!this.options.evaluator && !!input.intent;
11441
11410
  }
11442
11411
  async run(input) {
11443
11412
  const evaluator = this.options.evaluator;
@@ -11904,11 +11873,8 @@ var require_proof_presence_sensor = __commonJS({
11904
11873
  this.name = "ProofPresenceSensor";
11905
11874
  this.order = sensor_bands_1.BAND.IDENTITY + 30;
11906
11875
  }
11907
- async supports(input) {
11908
- if (!!input.profile && !!input.visibility) {
11909
- return { action: "ALLOW" };
11910
- }
11911
- return { action: "DENY", code: "MISSING_REQUIRED_FIELDS" };
11876
+ supports(input) {
11877
+ return !!input.profile && !!input.visibility;
11912
11878
  }
11913
11879
  async run(input) {
11914
11880
  const validatedInput = axis_schemas_1.ProofPresenceInputZ.safeParse(input);
@@ -12202,8 +12168,8 @@ var require_receipt_policy_sensor = __commonJS({
12202
12168
  this.name = "ReceiptPolicySensor";
12203
12169
  this.order = sensor_bands_1.BAND.BUSINESS + 20;
12204
12170
  }
12205
- async supports() {
12206
- return { action: "ALLOW" };
12171
+ supports() {
12172
+ return true;
12207
12173
  }
12208
12174
  async run() {
12209
12175
  return { action: "ALLOW" };
@@ -12363,11 +12329,8 @@ var require_schema_validation_sensor = __commonJS({
12363
12329
  this.name = "SchemaValidationSensor";
12364
12330
  this.order = sensor_bands_1.BAND.CONTENT + 35;
12365
12331
  }
12366
- async supports(input) {
12367
- if (input.metadata?.schema) {
12368
- return { action: "ALLOW" };
12369
- }
12370
- return { action: "DENY", code: "SCHEMA_NOT_CONFIGURED" };
12332
+ supports(input) {
12333
+ return !!input.metadata?.schema;
12371
12334
  }
12372
12335
  async run(input) {
12373
12336
  const schema = input.metadata?.schema;
@@ -12492,8 +12455,8 @@ var require_stream_scope_sensor = __commonJS({
12492
12455
  this.name = "StreamScopeSensor";
12493
12456
  this.order = sensor_bands_1.BAND.BUSINESS + 0;
12494
12457
  }
12495
- async supports() {
12496
- return { action: "ALLOW" };
12458
+ supports() {
12459
+ return true;
12497
12460
  }
12498
12461
  async run() {
12499
12462
  return { action: "ALLOW" };
@@ -12531,12 +12494,8 @@ var require_tickauth_sensor = __commonJS({
12531
12494
  this.matchIntent = options.matchIntent ?? true;
12532
12495
  this.acceptTypes = options.acceptTypes?.length ? new Set(options.acceptTypes) : null;
12533
12496
  }
12534
- async supports(input) {
12535
- return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule) ? { action: "ALLOW" } : {
12536
- action: "DENY",
12537
- code: "SENSOR_NOT_APPLICABLE",
12538
- reason: "TickAuth capsule not found"
12539
- };
12497
+ supports(input) {
12498
+ return !!(input.metadata?.capsule || input.metadata?.tickauthCapsule || input.metadata?.cceEnvelope?.capsule);
12540
12499
  }
12541
12500
  async run(input) {
12542
12501
  const capsule = input.metadata?.capsule ?? input.metadata?.tickauthCapsule ?? input.metadata?.cceEnvelope?.capsule;
@@ -12642,12 +12601,8 @@ var require_tlv_parse_sensor = __commonJS({
12642
12601
  this.name = "TLVParseSensor";
12643
12602
  this.order = sensor_bands_1.BAND.CONTENT + 20;
12644
12603
  }
12645
- async supports(input) {
12646
- return !!input.packet ? { action: "ALLOW" } : {
12647
- action: "DENY",
12648
- code: "SENSOR_NOT_APPLICABLE",
12649
- reason: "Packet is not available"
12650
- };
12604
+ supports(input) {
12605
+ return !!input.packet;
12651
12606
  }
12652
12607
  async run(input) {
12653
12608
  const packet = input.packet;
@@ -12779,13 +12734,9 @@ var require_tps_sensor = __commonJS({
12779
12734
  this.maxDriftMs = options.maxDriftMs ?? 3e4;
12780
12735
  this.resolver = options.resolver ?? parseINotation;
12781
12736
  }
12782
- async supports(input) {
12737
+ supports(input) {
12783
12738
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
12784
- return typeof tps === "string" && tps.length > 0 ? { action: "ALLOW" } : {
12785
- action: "DENY",
12786
- code: "SENSOR_NOT_APPLICABLE",
12787
- reason: "TPS coordinate not available"
12788
- };
12739
+ return typeof tps === "string" && tps.length > 0;
12789
12740
  }
12790
12741
  async run(input) {
12791
12742
  const tps = input.metadata?.tps_coordinate ?? input.metadata?.tps ?? input.packet?.tps;
@@ -12851,12 +12802,8 @@ var require_varint_hardening_sensor = __commonJS({
12851
12802
  this.order = sensor_bands_1.BAND.WIRE + 35;
12852
12803
  this.MAX_VARINT_BYTES = 5;
12853
12804
  }
12854
- async supports(input) {
12855
- return !!input.peek && input.peek.length >= 7 ? { action: "ALLOW" } : {
12856
- action: "DENY",
12857
- code: "SENSOR_NOT_APPLICABLE",
12858
- reason: "Insufficient peek data for varint hardening"
12859
- };
12805
+ supports(input) {
12806
+ return !!input.peek && input.peek.length >= 7;
12860
12807
  }
12861
12808
  async run(input) {
12862
12809
  const peek = input.peek;