@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.mjs
CHANGED
|
@@ -757,92 +757,6 @@ var init_handler_sensors_decorator = __esm({
|
|
|
757
757
|
}
|
|
758
758
|
});
|
|
759
759
|
|
|
760
|
-
// src/decorators/priority-order.decorator.ts
|
|
761
|
-
var require_priority_order_decorator = __commonJS({
|
|
762
|
-
"src/decorators/priority-order.decorator.ts"(exports) {
|
|
763
|
-
"use strict";
|
|
764
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
765
|
-
exports.priorityOrder = exports.PRIORITY_ORDER_METADATA_KEY = void 0;
|
|
766
|
-
exports.getPriorityOrder = getPriorityOrder2;
|
|
767
|
-
exports.comparePriorityOrder = comparePriorityOrder2;
|
|
768
|
-
exports.getPriorityOrderedTargets = getPriorityOrderedTargets2;
|
|
769
|
-
exports.PriorityOrder = PriorityOrder2;
|
|
770
|
-
__require("reflect-metadata");
|
|
771
|
-
exports.PRIORITY_ORDER_METADATA_KEY = "axis:priority-order";
|
|
772
|
-
var PRIORITY_ORDER_WEIGHT = {
|
|
773
|
-
HIGH: 0,
|
|
774
|
-
MEDIUM: 1,
|
|
775
|
-
LOW: 2
|
|
776
|
-
};
|
|
777
|
-
var priorityOrderRegistry = /* @__PURE__ */ new Set();
|
|
778
|
-
function normalizePriority(priority) {
|
|
779
|
-
const normalized = String(priority).toUpperCase();
|
|
780
|
-
if (normalized === "HIGH" || normalized === "MEDIUM" || normalized === "LOW") {
|
|
781
|
-
return normalized;
|
|
782
|
-
}
|
|
783
|
-
throw new Error(`@PriorityOrder() received invalid priority "${String(priority)}"`);
|
|
784
|
-
}
|
|
785
|
-
function normalizeOrder(order) {
|
|
786
|
-
if (typeof order !== "number" || !Number.isInteger(order) || !Number.isFinite(order) || order < 0) {
|
|
787
|
-
throw new Error(`@PriorityOrder() requires a non-negative integer order, received "${String(order)}"`);
|
|
788
|
-
}
|
|
789
|
-
return order;
|
|
790
|
-
}
|
|
791
|
-
function isPriorityOrderOptions(value) {
|
|
792
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
793
|
-
}
|
|
794
|
-
function resolvePriorityOrder(priorityOrOptions, order = 0) {
|
|
795
|
-
if (isPriorityOrderOptions(priorityOrOptions)) {
|
|
796
|
-
return {
|
|
797
|
-
priority: normalizePriority(priorityOrOptions.priority ?? "MEDIUM"),
|
|
798
|
-
order: normalizeOrder(priorityOrOptions.order ?? 0)
|
|
799
|
-
};
|
|
800
|
-
}
|
|
801
|
-
return {
|
|
802
|
-
priority: normalizePriority(priorityOrOptions ?? "MEDIUM"),
|
|
803
|
-
order: normalizeOrder(order)
|
|
804
|
-
};
|
|
805
|
-
}
|
|
806
|
-
function getPriorityOrder2(target) {
|
|
807
|
-
return Reflect.getMetadata(exports.PRIORITY_ORDER_METADATA_KEY, target) ?? null;
|
|
808
|
-
}
|
|
809
|
-
function comparePriorityOrder2(left, right) {
|
|
810
|
-
const priorityDelta = PRIORITY_ORDER_WEIGHT[left.priority] - PRIORITY_ORDER_WEIGHT[right.priority];
|
|
811
|
-
if (priorityDelta !== 0) {
|
|
812
|
-
return priorityDelta;
|
|
813
|
-
}
|
|
814
|
-
return left.order - right.order;
|
|
815
|
-
}
|
|
816
|
-
function getPriorityOrderedTargets2(targets) {
|
|
817
|
-
const pool = targets ? Array.from(targets) : Array.from(priorityOrderRegistry);
|
|
818
|
-
return pool.sort((left, right) => {
|
|
819
|
-
const leftMeta = getPriorityOrder2(left);
|
|
820
|
-
const rightMeta = getPriorityOrder2(right);
|
|
821
|
-
if (!leftMeta && !rightMeta) {
|
|
822
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
823
|
-
}
|
|
824
|
-
if (!leftMeta)
|
|
825
|
-
return 1;
|
|
826
|
-
if (!rightMeta)
|
|
827
|
-
return -1;
|
|
828
|
-
const ordered = comparePriorityOrder2(leftMeta, rightMeta);
|
|
829
|
-
if (ordered !== 0) {
|
|
830
|
-
return ordered;
|
|
831
|
-
}
|
|
832
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
function PriorityOrder2(priorityOrOptions, order = 0) {
|
|
836
|
-
const definition = resolvePriorityOrder(priorityOrOptions, order);
|
|
837
|
-
return (target) => {
|
|
838
|
-
Reflect.defineMetadata(exports.PRIORITY_ORDER_METADATA_KEY, definition, target);
|
|
839
|
-
priorityOrderRegistry.add(target);
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
exports.priorityOrder = PriorityOrder2;
|
|
843
|
-
}
|
|
844
|
-
});
|
|
845
|
-
|
|
846
760
|
// src/decorators/tlv-field.decorator.ts
|
|
847
761
|
var require_tlv_field_decorator = __commonJS({
|
|
848
762
|
"src/decorators/tlv-field.decorator.ts"(exports) {
|
|
@@ -10580,7 +10494,6 @@ __export(index_exports, {
|
|
|
10580
10494
|
ObserverDispatcherService: () => ObserverDispatcherService,
|
|
10581
10495
|
ObserverRegistry: () => ObserverRegistry,
|
|
10582
10496
|
PRE_DECODE_BOUNDARY: () => PRE_DECODE_BOUNDARY,
|
|
10583
|
-
PRIORITY_ORDER_METADATA_KEY: () => import_priority_order.PRIORITY_ORDER_METADATA_KEY,
|
|
10584
10497
|
PROOF_CAPABILITIES: () => PROOF_CAPABILITIES,
|
|
10585
10498
|
PROOF_CAPSULE: () => PROOF_CAPSULE,
|
|
10586
10499
|
PROOF_JWT: () => PROOF_JWT,
|
|
@@ -10588,7 +10501,6 @@ __export(index_exports, {
|
|
|
10588
10501
|
PROOF_MTLS: () => PROOF_MTLS,
|
|
10589
10502
|
PROOF_NONE: () => PROOF_NONE,
|
|
10590
10503
|
PROOF_WITNESS: () => PROOF_WITNESS,
|
|
10591
|
-
PriorityOrder: () => import_priority_order.PriorityOrder,
|
|
10592
10504
|
ProofType: () => ProofType,
|
|
10593
10505
|
ProofVerificationService: () => ProofVerificationService,
|
|
10594
10506
|
REQUIRED_PROOF_METADATA_KEY: () => REQUIRED_PROOF_METADATA_KEY,
|
|
@@ -10680,7 +10592,6 @@ __export(index_exports, {
|
|
|
10680
10592
|
canonicalizeObservation: () => canonicalizeObservation,
|
|
10681
10593
|
canonicalizeWrit: () => canonicalizeWrit,
|
|
10682
10594
|
classifyIntent: () => classifyIntent,
|
|
10683
|
-
comparePriorityOrder: () => import_priority_order.comparePriorityOrder,
|
|
10684
10595
|
computeReceiptHash: () => computeReceiptHash,
|
|
10685
10596
|
computeSignaturePayload: () => computeSignaturePayload,
|
|
10686
10597
|
createFabric: () => createFabric,
|
|
@@ -10725,8 +10636,6 @@ __export(index_exports, {
|
|
|
10725
10636
|
getGrantStatus: () => getGrantStatus,
|
|
10726
10637
|
getIrreversibleKnots: () => getIrreversibleKnots,
|
|
10727
10638
|
getPresenceStatus: () => getPresenceStatus,
|
|
10728
|
-
getPriorityOrder: () => import_priority_order.getPriorityOrder,
|
|
10729
|
-
getPriorityOrderedTargets: () => import_priority_order.getPriorityOrderedTargets,
|
|
10730
10639
|
getSignTarget: () => getSignTarget,
|
|
10731
10640
|
grantCoversAction: () => grantCoversAction,
|
|
10732
10641
|
hasScope: () => hasScope,
|
|
@@ -10751,7 +10660,6 @@ __export(index_exports, {
|
|
|
10751
10660
|
parseAutoClaimEntries: () => parseAutoClaimEntries,
|
|
10752
10661
|
parseScope: () => parseScope,
|
|
10753
10662
|
parseStreamEntries: () => parseStreamEntries,
|
|
10754
|
-
priorityOrder: () => import_priority_order.priorityOrder,
|
|
10755
10663
|
projectAt: () => projectAt,
|
|
10756
10664
|
queryFabric: () => queryFabric,
|
|
10757
10665
|
recordOccurrence: () => recordOccurrence,
|
|
@@ -10788,7 +10696,7 @@ __export(index_exports, {
|
|
|
10788
10696
|
weave: () => weave,
|
|
10789
10697
|
withAxisExecutionContext: () => withAxisExecutionContext
|
|
10790
10698
|
});
|
|
10791
|
-
var
|
|
10699
|
+
var import_tlv_field2, import_dto_schema2, import_axis_id, import_axis_response;
|
|
10792
10700
|
var init_index = __esm({
|
|
10793
10701
|
"src/index.ts"() {
|
|
10794
10702
|
init_chain_decorator();
|
|
@@ -10801,7 +10709,6 @@ var init_index = __esm({
|
|
|
10801
10709
|
init_observer_decorator();
|
|
10802
10710
|
init_handler_sensors_decorator();
|
|
10803
10711
|
init_sensor_decorator();
|
|
10804
|
-
import_priority_order = __toESM(require_priority_order_decorator());
|
|
10805
10712
|
import_tlv_field2 = __toESM(require_tlv_field_decorator());
|
|
10806
10713
|
import_dto_schema2 = __toESM(require_dto_schema_util());
|
|
10807
10714
|
init_axis_tlv_dto();
|