@nextera.one/axis-server-sdk 2.2.2 → 2.2.3
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.d.mts +1 -18
- package/dist/index.d.ts +1 -18
- package/dist/index.js +1 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -106
- package/dist/index.mjs.map +1 -1
- package/dist/sensors/index.js +1 -94
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +1 -94
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/sensors/index.js
CHANGED
|
@@ -689,92 +689,6 @@ var init_handler_sensors_decorator = __esm({
|
|
|
689
689
|
}
|
|
690
690
|
});
|
|
691
691
|
|
|
692
|
-
// src/decorators/priority-order.decorator.ts
|
|
693
|
-
var require_priority_order_decorator = __commonJS({
|
|
694
|
-
"src/decorators/priority-order.decorator.ts"(exports2) {
|
|
695
|
-
"use strict";
|
|
696
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
697
|
-
exports2.priorityOrder = exports2.PRIORITY_ORDER_METADATA_KEY = void 0;
|
|
698
|
-
exports2.getPriorityOrder = getPriorityOrder2;
|
|
699
|
-
exports2.comparePriorityOrder = comparePriorityOrder2;
|
|
700
|
-
exports2.getPriorityOrderedTargets = getPriorityOrderedTargets2;
|
|
701
|
-
exports2.PriorityOrder = PriorityOrder2;
|
|
702
|
-
require("reflect-metadata");
|
|
703
|
-
exports2.PRIORITY_ORDER_METADATA_KEY = "axis:priority-order";
|
|
704
|
-
var PRIORITY_ORDER_WEIGHT = {
|
|
705
|
-
HIGH: 0,
|
|
706
|
-
MEDIUM: 1,
|
|
707
|
-
LOW: 2
|
|
708
|
-
};
|
|
709
|
-
var priorityOrderRegistry = /* @__PURE__ */ new Set();
|
|
710
|
-
function normalizePriority(priority) {
|
|
711
|
-
const normalized = String(priority).toUpperCase();
|
|
712
|
-
if (normalized === "HIGH" || normalized === "MEDIUM" || normalized === "LOW") {
|
|
713
|
-
return normalized;
|
|
714
|
-
}
|
|
715
|
-
throw new Error(`@PriorityOrder() received invalid priority "${String(priority)}"`);
|
|
716
|
-
}
|
|
717
|
-
function normalizeOrder(order) {
|
|
718
|
-
if (typeof order !== "number" || !Number.isInteger(order) || !Number.isFinite(order) || order < 0) {
|
|
719
|
-
throw new Error(`@PriorityOrder() requires a non-negative integer order, received "${String(order)}"`);
|
|
720
|
-
}
|
|
721
|
-
return order;
|
|
722
|
-
}
|
|
723
|
-
function isPriorityOrderOptions(value) {
|
|
724
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
725
|
-
}
|
|
726
|
-
function resolvePriorityOrder(priorityOrOptions, order = 0) {
|
|
727
|
-
if (isPriorityOrderOptions(priorityOrOptions)) {
|
|
728
|
-
return {
|
|
729
|
-
priority: normalizePriority(priorityOrOptions.priority ?? "MEDIUM"),
|
|
730
|
-
order: normalizeOrder(priorityOrOptions.order ?? 0)
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
return {
|
|
734
|
-
priority: normalizePriority(priorityOrOptions ?? "MEDIUM"),
|
|
735
|
-
order: normalizeOrder(order)
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
function getPriorityOrder2(target) {
|
|
739
|
-
return Reflect.getMetadata(exports2.PRIORITY_ORDER_METADATA_KEY, target) ?? null;
|
|
740
|
-
}
|
|
741
|
-
function comparePriorityOrder2(left, right) {
|
|
742
|
-
const priorityDelta = PRIORITY_ORDER_WEIGHT[left.priority] - PRIORITY_ORDER_WEIGHT[right.priority];
|
|
743
|
-
if (priorityDelta !== 0) {
|
|
744
|
-
return priorityDelta;
|
|
745
|
-
}
|
|
746
|
-
return left.order - right.order;
|
|
747
|
-
}
|
|
748
|
-
function getPriorityOrderedTargets2(targets) {
|
|
749
|
-
const pool = targets ? Array.from(targets) : Array.from(priorityOrderRegistry);
|
|
750
|
-
return pool.sort((left, right) => {
|
|
751
|
-
const leftMeta = getPriorityOrder2(left);
|
|
752
|
-
const rightMeta = getPriorityOrder2(right);
|
|
753
|
-
if (!leftMeta && !rightMeta) {
|
|
754
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
755
|
-
}
|
|
756
|
-
if (!leftMeta)
|
|
757
|
-
return 1;
|
|
758
|
-
if (!rightMeta)
|
|
759
|
-
return -1;
|
|
760
|
-
const ordered = comparePriorityOrder2(leftMeta, rightMeta);
|
|
761
|
-
if (ordered !== 0) {
|
|
762
|
-
return ordered;
|
|
763
|
-
}
|
|
764
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function PriorityOrder2(priorityOrOptions, order = 0) {
|
|
768
|
-
const definition = resolvePriorityOrder(priorityOrOptions, order);
|
|
769
|
-
return (target) => {
|
|
770
|
-
Reflect.defineMetadata(exports2.PRIORITY_ORDER_METADATA_KEY, definition, target);
|
|
771
|
-
priorityOrderRegistry.add(target);
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
exports2.priorityOrder = PriorityOrder2;
|
|
775
|
-
}
|
|
776
|
-
});
|
|
777
|
-
|
|
778
692
|
// src/decorators/tlv-field.decorator.ts
|
|
779
693
|
var require_tlv_field_decorator = __commonJS({
|
|
780
694
|
"src/decorators/tlv-field.decorator.ts"(exports2) {
|
|
@@ -10511,7 +10425,6 @@ __export(index_exports, {
|
|
|
10511
10425
|
ObserverDispatcherService: () => ObserverDispatcherService,
|
|
10512
10426
|
ObserverRegistry: () => ObserverRegistry,
|
|
10513
10427
|
PRE_DECODE_BOUNDARY: () => PRE_DECODE_BOUNDARY,
|
|
10514
|
-
PRIORITY_ORDER_METADATA_KEY: () => import_priority_order.PRIORITY_ORDER_METADATA_KEY,
|
|
10515
10428
|
PROOF_CAPABILITIES: () => PROOF_CAPABILITIES,
|
|
10516
10429
|
PROOF_CAPSULE: () => import_axis_protocol.PROOF_CAPSULE,
|
|
10517
10430
|
PROOF_JWT: () => import_axis_protocol.PROOF_JWT,
|
|
@@ -10519,7 +10432,6 @@ __export(index_exports, {
|
|
|
10519
10432
|
PROOF_MTLS: () => import_axis_protocol.PROOF_MTLS,
|
|
10520
10433
|
PROOF_NONE: () => import_axis_protocol.PROOF_NONE,
|
|
10521
10434
|
PROOF_WITNESS: () => import_axis_protocol.PROOF_WITNESS,
|
|
10522
|
-
PriorityOrder: () => import_priority_order.PriorityOrder,
|
|
10523
10435
|
ProofType: () => import_axis_protocol.ProofType,
|
|
10524
10436
|
ProofVerificationService: () => ProofVerificationService,
|
|
10525
10437
|
REQUIRED_PROOF_METADATA_KEY: () => REQUIRED_PROOF_METADATA_KEY,
|
|
@@ -10611,7 +10523,6 @@ __export(index_exports, {
|
|
|
10611
10523
|
canonicalizeObservation: () => canonicalizeObservation,
|
|
10612
10524
|
canonicalizeWrit: () => canonicalizeWrit,
|
|
10613
10525
|
classifyIntent: () => classifyIntent,
|
|
10614
|
-
comparePriorityOrder: () => import_priority_order.comparePriorityOrder,
|
|
10615
10526
|
computeReceiptHash: () => computeReceiptHash,
|
|
10616
10527
|
computeSignaturePayload: () => computeSignaturePayload,
|
|
10617
10528
|
createFabric: () => createFabric,
|
|
@@ -10656,8 +10567,6 @@ __export(index_exports, {
|
|
|
10656
10567
|
getGrantStatus: () => getGrantStatus,
|
|
10657
10568
|
getIrreversibleKnots: () => getIrreversibleKnots,
|
|
10658
10569
|
getPresenceStatus: () => getPresenceStatus,
|
|
10659
|
-
getPriorityOrder: () => import_priority_order.getPriorityOrder,
|
|
10660
|
-
getPriorityOrderedTargets: () => import_priority_order.getPriorityOrderedTargets,
|
|
10661
10570
|
getSignTarget: () => import_axis_protocol5.getSignTarget,
|
|
10662
10571
|
grantCoversAction: () => grantCoversAction,
|
|
10663
10572
|
hasScope: () => hasScope,
|
|
@@ -10682,7 +10591,6 @@ __export(index_exports, {
|
|
|
10682
10591
|
parseAutoClaimEntries: () => parseAutoClaimEntries,
|
|
10683
10592
|
parseScope: () => parseScope,
|
|
10684
10593
|
parseStreamEntries: () => parseStreamEntries,
|
|
10685
|
-
priorityOrder: () => import_priority_order.priorityOrder,
|
|
10686
10594
|
projectAt: () => projectAt,
|
|
10687
10595
|
queryFabric: () => queryFabric,
|
|
10688
10596
|
recordOccurrence: () => recordOccurrence,
|
|
@@ -10719,7 +10627,7 @@ __export(index_exports, {
|
|
|
10719
10627
|
weave: () => weave,
|
|
10720
10628
|
withAxisExecutionContext: () => withAxisExecutionContext
|
|
10721
10629
|
});
|
|
10722
|
-
var
|
|
10630
|
+
var import_tlv_field2, import_dto_schema2, import_axis_id, import_axis_response;
|
|
10723
10631
|
var init_index = __esm({
|
|
10724
10632
|
"src/index.ts"() {
|
|
10725
10633
|
init_chain_decorator();
|
|
@@ -10732,7 +10640,6 @@ var init_index = __esm({
|
|
|
10732
10640
|
init_observer_decorator();
|
|
10733
10641
|
init_handler_sensors_decorator();
|
|
10734
10642
|
init_sensor_decorator();
|
|
10735
|
-
import_priority_order = __toESM(require_priority_order_decorator());
|
|
10736
10643
|
import_tlv_field2 = __toESM(require_tlv_field_decorator());
|
|
10737
10644
|
import_dto_schema2 = __toESM(require_dto_schema_util());
|
|
10738
10645
|
init_axis_tlv_dto();
|