@nextera.one/axis-server-sdk 2.3.9 → 2.3.10

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
@@ -11423,6 +11423,80 @@ var require_intent_registry_sensor = __commonJS({
11423
11423
  }
11424
11424
  });
11425
11425
 
11426
+ // src/sensors/law-article-presence.sensor.ts
11427
+ var require_law_article_presence_sensor = __commonJS({
11428
+ "src/sensors/law-article-presence.sensor.ts"(exports) {
11429
+ "use strict";
11430
+ var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
11431
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11432
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11433
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11434
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11435
+ };
11436
+ var __metadata = exports && exports.__metadata || function(k, v) {
11437
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11438
+ };
11439
+ Object.defineProperty(exports, "__esModule", { value: true });
11440
+ exports.LawArticlePresenceSensor = void 0;
11441
+ var sensor_decorator_1 = (init_sensor_decorator(), __toCommonJS(sensor_decorator_exports));
11442
+ var sensor_bands_1 = (init_sensor_bands(), __toCommonJS(sensor_bands_exports));
11443
+ var LawArticlePresenceSensor = class LawArticlePresenceSensor {
11444
+ constructor(options) {
11445
+ this.options = options;
11446
+ this.name = "LawArticlePresenceSensor";
11447
+ this.order = sensor_bands_1.BAND.IDENTITY + 27;
11448
+ }
11449
+ supports(input) {
11450
+ if (this.mode() === "off")
11451
+ return false;
11452
+ if (!input.intent)
11453
+ return false;
11454
+ if (this.exemptIntents().includes(input.intent))
11455
+ return false;
11456
+ return true;
11457
+ }
11458
+ async run(input) {
11459
+ const intent = input.intent;
11460
+ const count = await this.options.getLawArticleCount(intent, input);
11461
+ if (count > 0) {
11462
+ return {
11463
+ action: "ALLOW",
11464
+ meta: { lawArticles: count }
11465
+ };
11466
+ }
11467
+ const reason = `Intent '${intent}' has no law article mapping`;
11468
+ if (this.mode() === "strict") {
11469
+ return {
11470
+ action: "DENY",
11471
+ code: this.options.missingCode ?? "CAPSULE_NOT_LAWFUL",
11472
+ reason
11473
+ };
11474
+ }
11475
+ return {
11476
+ action: "FLAG",
11477
+ scoreDelta: this.options.auditScoreDelta ?? 5,
11478
+ reasons: ["LAW_ARTICLE_MISSING", reason],
11479
+ meta: { lawArticles: 0 }
11480
+ };
11481
+ }
11482
+ mode() {
11483
+ const configured = this.options.mode;
11484
+ if (typeof configured === "function")
11485
+ return configured();
11486
+ return configured ?? "audit";
11487
+ }
11488
+ exemptIntents() {
11489
+ return this.options.exemptIntents ?? ["system.ping"];
11490
+ }
11491
+ };
11492
+ exports.LawArticlePresenceSensor = LawArticlePresenceSensor;
11493
+ exports.LawArticlePresenceSensor = LawArticlePresenceSensor = __decorate([
11494
+ (0, sensor_decorator_1.Sensor)({ phase: "POST_DECODE" }),
11495
+ __metadata("design:paramtypes", [Object])
11496
+ ], LawArticlePresenceSensor);
11497
+ }
11498
+ });
11499
+
11426
11500
  // src/sensors/law-evaluation.sensor.ts
11427
11501
  var require_law_evaluation_sensor = __commonJS({
11428
11502
  "src/sensors/law-evaluation.sensor.ts"(exports) {
@@ -12894,6 +12968,7 @@ var init_sensors = __esm({
12894
12968
  __reExport(sensors_exports, __toESM(require_header_tlv_limit_sensor()));
12895
12969
  __reExport(sensors_exports, __toESM(require_intent_allowlist_sensor()));
12896
12970
  __reExport(sensors_exports, __toESM(require_intent_registry_sensor()));
12971
+ __reExport(sensors_exports, __toESM(require_law_article_presence_sensor()));
12897
12972
  __reExport(sensors_exports, __toESM(require_law_evaluation_sensor()));
12898
12973
  __reExport(sensors_exports, __toESM(require_proof_presence_sensor()));
12899
12974
  __reExport(sensors_exports, __toESM(require_protocol_strict_sensor()));