@zwave-js/nvmedit 15.20.0 → 15.22.0
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/build/cjs/lib/nvm3/files/ApplicationCCsFile.js +3 -42
- package/build/cjs/lib/nvm3/files/ApplicationCCsFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/ApplicationDataFile.js +3 -42
- package/build/cjs/lib/nvm3/files/ApplicationDataFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/ApplicationNameFile.js +3 -42
- package/build/cjs/lib/nvm3/files/ApplicationNameFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js +3 -42
- package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js +3 -42
- package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/ControllerInfoFile.js +3 -42
- package/build/cjs/lib/nvm3/files/ControllerInfoFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/NodeInfoFiles.js +7 -46
- package/build/cjs/lib/nvm3/files/NodeInfoFiles.js.map +1 -1
- package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js +19 -58
- package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +1 -1
- package/build/cjs/lib/nvm3/files/RouteCacheFiles.js +5 -44
- package/build/cjs/lib/nvm3/files/RouteCacheFiles.js.map +1 -1
- package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js +5 -44
- package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/VersionFiles.js +7 -46
- package/build/cjs/lib/nvm3/files/VersionFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationCCsFile.js +1 -34
- package/build/esm/lib/nvm3/files/ApplicationCCsFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationDataFile.js +1 -34
- package/build/esm/lib/nvm3/files/ApplicationDataFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationNameFile.js +1 -34
- package/build/esm/lib/nvm3/files/ApplicationNameFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js +1 -34
- package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationTypeFile.js +1 -34
- package/build/esm/lib/nvm3/files/ApplicationTypeFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ControllerInfoFile.js +1 -34
- package/build/esm/lib/nvm3/files/ControllerInfoFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/NodeInfoFiles.js +1 -34
- package/build/esm/lib/nvm3/files/NodeInfoFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js +1 -34
- package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/RouteCacheFiles.js +1 -34
- package/build/esm/lib/nvm3/files/RouteCacheFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js +1 -34
- package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/VersionFiles.js +1 -34
- package/build/esm/lib/nvm3/files/VersionFiles.js.map +1 -1
- package/package.json +7 -6
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/NodeInfoFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import {\n\ttype DataRate,\n\ttype FLiRS,\n\tMAX_NODES,\n\tMAX_NODES_LR,\n\tNUM_NODEMASK_BYTES,\n\ttype NodeProtocolInfo,\n\tNodeType,\n\tencodeBitMask,\n\tencodeNodeProtocolInfo,\n\tparseBitMask,\n\tparseNodeProtocolInfo,\n} from \"@zwave-js/core\";\nimport { Bytes, type BytesView, pick } from \"@zwave-js/shared\";\nimport type { NVM3Object } from \"../object.js\";\nimport {\n\tNVMFile,\n\ttype NVMFileCreationOptions,\n\ttype NVMFileDeserializationOptions,\n\tgotDeserializationOptions,\n\tnvmFileID,\n\tnvmSection,\n} from \"./NVMFile.js\";\n\nexport const NODEINFOS_PER_FILE_V1 = 4;\nexport const LR_NODEINFOS_PER_FILE_V5 = 50;\nconst NODEINFO_SIZE = 1 + 5 + NUM_NODEMASK_BYTES;\nconst LR_NODEINFO_SIZE = 3;\nconst EMPTY_NODEINFO_FILL = 0xff;\nconst emptyNodeInfo = new Uint8Array(NODEINFO_SIZE).fill(EMPTY_NODEINFO_FILL);\n\nexport interface NodeInfo\n\textends Omit<NodeProtocolInfo, \"hasSpecificDeviceClass\">\n{\n\tnodeId: number;\n\tgenericDeviceClass: number;\n\tspecificDeviceClass?: number | null;\n\tneighbors: number[];\n\tsucUpdateIndex: number;\n}\n\nfunction parseNodeInfo(\n\tnodeId: number,\n\tbuffer: BytesView,\n\toffset: number,\n): NodeInfo {\n\tconst { hasSpecificDeviceClass, ...protocolInfo } = parseNodeProtocolInfo(\n\t\tbuffer,\n\t\toffset,\n\t);\n\tconst genericDeviceClass = buffer[offset + 3];\n\tconst specificDeviceClass = hasSpecificDeviceClass\n\t\t? buffer[offset + 4]\n\t\t: null;\n\tconst neighbors = parseBitMask(\n\t\tbuffer.subarray(offset + 5, offset + 5 + NUM_NODEMASK_BYTES),\n\t);\n\tconst sucUpdateIndex = buffer[offset + 5 + NUM_NODEMASK_BYTES];\n\treturn {\n\t\tnodeId,\n\t\t...protocolInfo,\n\t\tgenericDeviceClass,\n\t\tspecificDeviceClass,\n\t\tneighbors,\n\t\tsucUpdateIndex,\n\t};\n}\n\nfunction encodeNodeInfo(nodeInfo: NodeInfo): Bytes {\n\tconst ret = new Bytes(NODEINFO_SIZE);\n\n\tconst hasSpecificDeviceClass = nodeInfo.specificDeviceClass != null;\n\tconst protocolInfo: NodeProtocolInfo = {\n\t\t...pick(nodeInfo, [\n\t\t\t\"isListening\",\n\t\t\t\"isFrequentListening\",\n\t\t\t\"isRouting\",\n\t\t\t\"supportedDataRates\",\n\t\t\t\"protocolVersion\",\n\t\t\t\"optionalFunctionality\",\n\t\t\t\"nodeType\",\n\t\t\t\"supportsSecurity\",\n\t\t\t\"supportsBeaming\",\n\t\t]),\n\t\thasSpecificDeviceClass,\n\t};\n\tret.set(encodeNodeProtocolInfo(protocolInfo), 0);\n\n\tret[3] = nodeInfo.genericDeviceClass;\n\tif (hasSpecificDeviceClass) ret[4] = nodeInfo.specificDeviceClass!;\n\tret.set(encodeBitMask(nodeInfo.neighbors, MAX_NODES), 5);\n\tret[5 + NUM_NODEMASK_BYTES] = nodeInfo.sucUpdateIndex;\n\n\treturn ret;\n}\n\nexport interface LRNodeInfo\n\textends Omit<NodeProtocolInfo, \"hasSpecificDeviceClass\">\n{\n\tnodeId: number;\n\tgenericDeviceClass: number;\n\tspecificDeviceClass?: number | null;\n}\n\nfunction parseLRNodeInfo(\n\tnodeId: number,\n\tbuffer: BytesView,\n\toffset: number,\n): LRNodeInfo {\n\t// The node info in LR NVM files is packed:\n\t// Byte 0 CAPABILITY:\n\t// Bit 0: Routing (?)\n\t// Bit 1: Listening\n\t// Bit 2: has specific device class (?)\n\t// Bit 3: Beam capability\n\t// Bit 4: Optional functionality\n\t// Bits 5-6: FLiRS\n\t// Bit 7: Unused (?)\n\t// Byte 1: Generic device class\n\t// Byte 2: Specific device class\n\n\t// Protocol version is always 3\n\t// Security is always true\n\t// Supported speed is always 100kbps (speed = 0, speed ext = 2)\n\t// Never: routing end node, controller\n\n\tconst capability = buffer[offset];\n\tconst isRouting = !!(capability & 0b0000_0001); // ZWLR Mesh??\n\tconst isListening = !!(capability & 0b0000_0010);\n\tconst hasSpecificDeviceClass = !!(capability & 0b0000_0100);\n\tconst supportsBeaming = !!(capability & 0b0000_1000);\n\tconst optionalFunctionality = !!(capability & 0b0001_0000);\n\tlet isFrequentListening: FLiRS;\n\tswitch (capability & 0b0110_0000) {\n\t\tcase 0b0100_0000:\n\t\t\tisFrequentListening = \"1000ms\";\n\t\t\tbreak;\n\t\tcase 0b0010_0000:\n\t\t\tisFrequentListening = \"250ms\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tisFrequentListening = false;\n\t}\n\tconst nodeType = NodeType[\"End Node\"];\n\tconst supportsSecurity = true;\n\tconst protocolVersion = 3;\n\tconst supportedDataRates: DataRate[] = [100000];\n\n\treturn {\n\t\tnodeId,\n\t\tisRouting,\n\t\tisListening,\n\t\tsupportsBeaming,\n\t\tisFrequentListening,\n\t\toptionalFunctionality,\n\t\tnodeType,\n\t\tsupportsSecurity,\n\t\tprotocolVersion,\n\t\tsupportedDataRates,\n\t\tgenericDeviceClass: buffer[offset + 1],\n\t\tspecificDeviceClass: hasSpecificDeviceClass ? buffer[offset + 2] : null,\n\t};\n}\n\nfunction encodeLRNodeInfo(nodeInfo: LRNodeInfo): BytesView {\n\tconst ret = new Bytes(LR_NODEINFO_SIZE);\n\n\tlet capability = 0;\n\tif (nodeInfo.isRouting) capability |= 0b0000_0001;\n\tif (nodeInfo.isListening) capability |= 0b0000_0010;\n\tif (nodeInfo.specificDeviceClass != null) capability |= 0b0000_0100;\n\tif (nodeInfo.supportsBeaming) capability |= 0b0000_1000;\n\tif (nodeInfo.optionalFunctionality) capability |= 0b0001_0000;\n\tif (nodeInfo.isFrequentListening === \"1000ms\") {\n\t\tcapability |= 0b0100_0000;\n\t} else if (nodeInfo.isFrequentListening === \"250ms\") {\n\t\tcapability |= 0b0010_0000;\n\t}\n\n\tret[0] = capability;\n\tret[1] = nodeInfo.genericDeviceClass;\n\tret[2] = nodeInfo.specificDeviceClass ?? 0;\n\n\treturn ret;\n}\n\nexport interface NodeInfoFileV0Options extends NVMFileCreationOptions {\n\tnodeInfo: NodeInfo;\n}\n\nexport const NodeInfoFileV0IDBase = 0x50100;\nexport function nodeIdToNodeInfoFileIDV0(nodeId: number): number {\n\treturn NodeInfoFileV0IDBase + nodeId - 1;\n}\n\n@nvmFileID(\n\t(id) => id >= NodeInfoFileV0IDBase && id < NodeInfoFileV0IDBase + MAX_NODES,\n)\n@nvmSection(\"protocol\")\nexport class NodeInfoFileV0 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | NodeInfoFileV0Options,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.nodeInfo = parseNodeInfo(\n\t\t\t\tthis.fileId - NodeInfoFileV0IDBase + 1,\n\t\t\t\tthis.payload,\n\t\t\t\t0,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.nodeInfo = options.nodeInfo;\n\t\t}\n\t}\n\n\tpublic nodeInfo: NodeInfo;\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.fileId = nodeIdToNodeInfoFileIDV0(this.nodeInfo.nodeId);\n\t\tthis.payload = encodeNodeInfo(this.nodeInfo);\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\tnodeInfo: this.nodeInfo,\n\t\t};\n\t}\n}\n\nexport interface NodeInfoFileV1Options extends NVMFileCreationOptions {\n\tnodeInfos: NodeInfo[];\n}\n\nexport const NodeInfoFileV1IDBase = 0x50200;\nexport function nodeIdToNodeInfoFileIDV1(nodeId: number): number {\n\treturn (\n\t\tNodeInfoFileV1IDBase + Math.floor((nodeId - 1) / NODEINFOS_PER_FILE_V1)\n\t);\n}\n\n@nvmFileID(\n\t(id) =>\n\t\tid >= NodeInfoFileV1IDBase\n\t\t&& id < NodeInfoFileV1IDBase + MAX_NODES / NODEINFOS_PER_FILE_V1,\n)\n@nvmSection(\"protocol\")\nexport class NodeInfoFileV1 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | NodeInfoFileV1Options,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.nodeInfos = [];\n\t\t\tfor (let i = 0; i < NODEINFOS_PER_FILE_V1; i++) {\n\t\t\t\tconst nodeId = (this.fileId - NodeInfoFileV1IDBase)\n\t\t\t\t\t\t* NODEINFOS_PER_FILE_V1\n\t\t\t\t\t+ 1\n\t\t\t\t\t+ i;\n\t\t\t\tconst offset = i * NODEINFO_SIZE;\n\t\t\t\tconst entry = this.payload.subarray(\n\t\t\t\t\toffset,\n\t\t\t\t\toffset + NODEINFO_SIZE,\n\t\t\t\t);\n\t\t\t\tif (entry.equals(emptyNodeInfo)) continue;\n\n\t\t\t\tconst nodeInfo = parseNodeInfo(\n\t\t\t\t\tnodeId,\n\t\t\t\t\tentry,\n\t\t\t\t\t0,\n\t\t\t\t);\n\t\t\t\tthis.nodeInfos.push(nodeInfo);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.nodeInfos = options.nodeInfos;\n\t\t}\n\t}\n\n\tpublic nodeInfos: NodeInfo[];\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\t// The infos must be sorted by node ID\n\t\tthis.nodeInfos.sort((a, b) => a.nodeId - b.nodeId);\n\t\tconst minNodeId = this.nodeInfos[0].nodeId;\n\t\tthis.fileId = nodeIdToNodeInfoFileIDV1(minNodeId);\n\n\t\tthis.payload = new Bytes(NODEINFO_SIZE * NODEINFOS_PER_FILE_V1).fill(\n\t\t\tEMPTY_NODEINFO_FILL,\n\t\t);\n\n\t\tconst minFileNodeId =\n\t\t\tMath.floor((minNodeId - 1) / NODEINFOS_PER_FILE_V1)\n\t\t\t\t* NODEINFOS_PER_FILE_V1\n\t\t\t+ 1;\n\n\t\tfor (const nodeInfo of this.nodeInfos) {\n\t\t\tconst offset = (nodeInfo.nodeId - minFileNodeId) * NODEINFO_SIZE;\n\t\t\tthis.payload.set(encodeNodeInfo(nodeInfo), offset);\n\t\t}\n\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"node infos\": this.nodeInfos,\n\t\t};\n\t}\n}\n\nexport interface LRNodeInfoFileV5Options extends NVMFileCreationOptions {\n\tnodeInfos: LRNodeInfo[];\n}\n\nexport const LRNodeInfoFileV5IDBase = 0x50800;\nexport function nodeIdToLRNodeInfoFileIDV5(nodeId: number): number {\n\treturn (\n\t\tLRNodeInfoFileV5IDBase\n\t\t+ Math.floor((nodeId - 256) / LR_NODEINFOS_PER_FILE_V5)\n\t);\n}\n\n// Counting starts with 5, because we only implemented this after reaching protocol file format 5\n@nvmFileID(\n\t(id) =>\n\t\tid >= LRNodeInfoFileV5IDBase\n\t\t&& id\n\t\t\t< LRNodeInfoFileV5IDBase + MAX_NODES_LR / LR_NODEINFOS_PER_FILE_V5,\n)\n@nvmSection(\"protocol\")\nexport class LRNodeInfoFileV5 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | LRNodeInfoFileV5Options,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.nodeInfos = [];\n\t\t\tfor (let i = 0; i < LR_NODEINFOS_PER_FILE_V5; i++) {\n\t\t\t\tconst nodeId = (this.fileId - LRNodeInfoFileV5IDBase)\n\t\t\t\t\t\t* LR_NODEINFOS_PER_FILE_V5\n\t\t\t\t\t+ 256\n\t\t\t\t\t+ i;\n\t\t\t\tconst offset = i * LR_NODEINFO_SIZE;\n\t\t\t\tconst entry = this.payload.subarray(\n\t\t\t\t\toffset,\n\t\t\t\t\toffset + LR_NODEINFO_SIZE,\n\t\t\t\t);\n\t\t\t\tif (entry.equals(emptyNodeInfo)) continue;\n\n\t\t\t\tconst nodeInfo = parseLRNodeInfo(\n\t\t\t\t\tnodeId,\n\t\t\t\t\tentry,\n\t\t\t\t\t0,\n\t\t\t\t);\n\t\t\t\tthis.nodeInfos.push(nodeInfo);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.nodeInfos = options.nodeInfos;\n\t\t}\n\t}\n\n\tpublic nodeInfos: LRNodeInfo[];\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\t// The infos must be sorted by node ID\n\t\tthis.nodeInfos.sort((a, b) => a.nodeId - b.nodeId);\n\t\tconst minNodeId = this.nodeInfos[0].nodeId;\n\t\tthis.fileId = nodeIdToLRNodeInfoFileIDV5(minNodeId);\n\n\t\tthis.payload = new Bytes(LR_NODEINFO_SIZE * LR_NODEINFOS_PER_FILE_V5)\n\t\t\t.fill(EMPTY_NODEINFO_FILL);\n\n\t\tconst minFileNodeId =\n\t\t\tMath.floor((minNodeId - 256) / LR_NODEINFOS_PER_FILE_V5)\n\t\t\t\t* LR_NODEINFOS_PER_FILE_V5\n\t\t\t+ 256;\n\n\t\tfor (const nodeInfo of this.nodeInfos) {\n\t\t\tconst offset = (nodeInfo.nodeId - minFileNodeId) * LR_NODEINFO_SIZE;\n\t\t\tthis.payload.set(encodeLRNodeInfo(nodeInfo), offset);\n\t\t}\n\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"node infos\": this.nodeInfos,\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAYO;AACP,oBAA4C;AAE5C,qBAOO;AAEA,MAAM,wBAAwB;AAC9B,MAAM,2BAA2B;AACxC,MAAM,gBAAgB,IAAI,IAAI;AAC9B,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAC5B,MAAM,gBAAgB,IAAI,WAAW,aAAa,EAAE,KAAK,mBAAmB;AAY5E,SAAS,cACR,QACA,QACA,QAAc;AAEd,QAAM,EAAE,wBAAwB,GAAG,aAAY,QAAK,mCACnD,QACA,MAAM;AAEP,QAAM,qBAAqB,OAAO,SAAS,CAA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C,EAAE;AACpC,WAAK,SAAS,2BAA2B,SAAS;AAElD,WAAK,UAAU,IAAI,oBAAM,mBAAmB,wBAAwB,EAClE,KAAK,mBAAmB;AAE1B,YAAM,gBACL,KAAK,OAAO,YAAY,OAAO,wBAAwB,IACpD,2BACD;AAEH,iBAAW,YAAY,KAAK,WAAW;AACtC,cAAM,UAAU,SAAS,SAAS,iBAAiB;AACnD,aAAK,QAAQ,IAAI,iBAAiB,QAAQ,GAAG,MAAM;MACpD;AAEA,aAAO,MAAM,UAAS;IACvB;;IAGO,SAAM;AACZ,aAAO;QACN,GAAG,MAAM,OAAM;QACf,cAAc,KAAK;;IAErB;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -40,48 +40,9 @@ __export(ProtocolNodeMaskFiles_exports, {
|
|
|
40
40
|
ProtocolVirtualNodeMaskFileID: () => ProtocolVirtualNodeMaskFileID
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(ProtocolNodeMaskFiles_exports);
|
|
43
|
+
var import_tslib = require("tslib");
|
|
43
44
|
var import_core = require("@zwave-js/core");
|
|
44
45
|
var import_NVMFile = require("./NVMFile.js");
|
|
45
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
46
|
-
function accept(f) {
|
|
47
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
48
|
-
return f;
|
|
49
|
-
}
|
|
50
|
-
__name(accept, "accept");
|
|
51
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
52
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
53
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
54
|
-
var _, done = false;
|
|
55
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
56
|
-
var context = {};
|
|
57
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
58
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
59
|
-
context.addInitializer = function(f) {
|
|
60
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
61
|
-
extraInitializers.push(accept(f || null));
|
|
62
|
-
};
|
|
63
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
64
|
-
if (kind === "accessor") {
|
|
65
|
-
if (result === void 0) continue;
|
|
66
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
67
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
68
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
69
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
70
|
-
} else if (_ = accept(result)) {
|
|
71
|
-
if (kind === "field") initializers.unshift(_);
|
|
72
|
-
else descriptor[key] = _;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
76
|
-
done = true;
|
|
77
|
-
};
|
|
78
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
79
|
-
var useValue = arguments.length > 2;
|
|
80
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
81
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
82
|
-
}
|
|
83
|
-
return useValue ? value : void 0;
|
|
84
|
-
};
|
|
85
46
|
class ProtocolNodeMaskFile extends import_NVMFile.NVMFile {
|
|
86
47
|
static {
|
|
87
48
|
__name(this, "ProtocolNodeMaskFile");
|
|
@@ -129,10 +90,10 @@ let ProtocolPreferredRepeatersFile = (() => {
|
|
|
129
90
|
}
|
|
130
91
|
static {
|
|
131
92
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
132
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
93
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
133
94
|
ProtocolPreferredRepeatersFile2 = _classThis = _classDescriptor.value;
|
|
134
95
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
135
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
96
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
136
97
|
}
|
|
137
98
|
};
|
|
138
99
|
return ProtocolPreferredRepeatersFile2 = _classThis;
|
|
@@ -153,10 +114,10 @@ let ProtocolNodeListFile = (() => {
|
|
|
153
114
|
}
|
|
154
115
|
static {
|
|
155
116
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
156
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
117
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
157
118
|
ProtocolNodeListFile2 = _classThis = _classDescriptor.value;
|
|
158
119
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
159
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
120
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
160
121
|
}
|
|
161
122
|
};
|
|
162
123
|
return ProtocolNodeListFile2 = _classThis;
|
|
@@ -177,10 +138,10 @@ let ProtocolAppRouteLockNodeMaskFile = (() => {
|
|
|
177
138
|
}
|
|
178
139
|
static {
|
|
179
140
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
180
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
141
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
181
142
|
ProtocolAppRouteLockNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
182
143
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
183
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
144
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
184
145
|
}
|
|
185
146
|
};
|
|
186
147
|
return ProtocolAppRouteLockNodeMaskFile2 = _classThis;
|
|
@@ -201,10 +162,10 @@ let ProtocolRouteSlaveSUCNodeMaskFile = (() => {
|
|
|
201
162
|
}
|
|
202
163
|
static {
|
|
203
164
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
204
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
165
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
205
166
|
ProtocolRouteSlaveSUCNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
206
167
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
207
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
168
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
208
169
|
}
|
|
209
170
|
};
|
|
210
171
|
return ProtocolRouteSlaveSUCNodeMaskFile2 = _classThis;
|
|
@@ -225,10 +186,10 @@ let ProtocolSUCPendingUpdateNodeMaskFile = (() => {
|
|
|
225
186
|
}
|
|
226
187
|
static {
|
|
227
188
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
228
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
189
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
229
190
|
ProtocolSUCPendingUpdateNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
230
191
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
231
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
192
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
232
193
|
}
|
|
233
194
|
};
|
|
234
195
|
return ProtocolSUCPendingUpdateNodeMaskFile2 = _classThis;
|
|
@@ -249,10 +210,10 @@ let ProtocolVirtualNodeMaskFile = (() => {
|
|
|
249
210
|
}
|
|
250
211
|
static {
|
|
251
212
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
252
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
213
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
253
214
|
ProtocolVirtualNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
254
215
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
255
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
216
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
256
217
|
}
|
|
257
218
|
};
|
|
258
219
|
return ProtocolVirtualNodeMaskFile2 = _classThis;
|
|
@@ -273,10 +234,10 @@ let ProtocolPendingDiscoveryNodeMaskFile = (() => {
|
|
|
273
234
|
}
|
|
274
235
|
static {
|
|
275
236
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
276
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
237
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
277
238
|
ProtocolPendingDiscoveryNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
278
239
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
279
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
240
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
280
241
|
}
|
|
281
242
|
};
|
|
282
243
|
return ProtocolPendingDiscoveryNodeMaskFile2 = _classThis;
|
|
@@ -297,10 +258,10 @@ let ProtocolRouteCacheExistsNodeMaskFile = (() => {
|
|
|
297
258
|
}
|
|
298
259
|
static {
|
|
299
260
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
300
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
261
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
301
262
|
ProtocolRouteCacheExistsNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
302
263
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
303
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
264
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
304
265
|
}
|
|
305
266
|
};
|
|
306
267
|
return ProtocolRouteCacheExistsNodeMaskFile2 = _classThis;
|
|
@@ -321,10 +282,10 @@ let ProtocolLRNodeListFile = (() => {
|
|
|
321
282
|
}
|
|
322
283
|
static {
|
|
323
284
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
324
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
285
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
325
286
|
ProtocolLRNodeListFile2 = _classThis = _classDescriptor.value;
|
|
326
287
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
327
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
288
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
328
289
|
}
|
|
329
290
|
constructor(options) {
|
|
330
291
|
super(options);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/ProtocolNodeMaskFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import { NODE_ID_MAX, encodeBitMask, parseBitMask } from \"@zwave-js/core\";\nimport type { Bytes } from \"@zwave-js/shared\";\nimport type { NVM3Object } from \"../object.js\";\nimport {\n\tNVMFile,\n\ttype NVMFileCreationOptions,\n\ttype NVMFileDeserializationOptions,\n\tgotDeserializationOptions,\n\tnvmFileID,\n\tnvmSection,\n} from \"./NVMFile.js\";\n\nexport interface ProtocolNodeMaskFileOptions extends NVMFileCreationOptions {\n\tnodeIds: number[];\n}\n\nexport class ProtocolNodeMaskFile extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | ProtocolNodeMaskFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.nodeIdSet = new Set(parseBitMask(this.payload));\n\t\t} else {\n\t\t\tthis.nodeIdSet = new Set(options.nodeIds);\n\t\t}\n\t}\n\n\tpublic nodeIdSet: Set<number>;\n\tpublic get nodeIds(): number[] {\n\t\treturn [...this.nodeIdSet];\n\t}\n\tpublic set nodeIds(value: number[]) {\n\t\tthis.nodeIdSet = new Set(value);\n\t}\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.payload = encodeBitMask([...this.nodeIdSet], NODE_ID_MAX);\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"node IDs\": [...this.nodeIdSet].join(\", \"),\n\t\t};\n\t}\n}\n\nexport const ProtocolPreferredRepeatersFileID = 0x50002;\n\n@nvmFileID(ProtocolPreferredRepeatersFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolPreferredRepeatersFile extends ProtocolNodeMaskFile {}\n\nexport const ProtocolNodeListFileID = 0x50005;\n\n@nvmFileID(ProtocolNodeListFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolNodeListFile extends ProtocolNodeMaskFile {}\n\nexport const ProtocolAppRouteLockNodeMaskFileID = 0x50006;\n\n@nvmFileID(ProtocolAppRouteLockNodeMaskFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolAppRouteLockNodeMaskFile extends ProtocolNodeMaskFile {}\n\nexport const ProtocolRouteSlaveSUCNodeMaskFileID = 0x50007;\n\n@nvmFileID(ProtocolRouteSlaveSUCNodeMaskFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolRouteSlaveSUCNodeMaskFile extends ProtocolNodeMaskFile {}\n\nexport const ProtocolSUCPendingUpdateNodeMaskFileID = 0x50008;\n\n@nvmFileID(ProtocolSUCPendingUpdateNodeMaskFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolSUCPendingUpdateNodeMaskFile\n\textends ProtocolNodeMaskFile\n{}\n\nexport const ProtocolVirtualNodeMaskFileID = 0x50009;\n\n@nvmFileID(ProtocolVirtualNodeMaskFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolVirtualNodeMaskFile extends ProtocolNodeMaskFile {}\n\nexport const ProtocolPendingDiscoveryNodeMaskFileID = 0x5000a;\n\n@nvmFileID(ProtocolPendingDiscoveryNodeMaskFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolPendingDiscoveryNodeMaskFile\n\textends ProtocolNodeMaskFile\n{}\n\nexport const ProtocolRouteCacheExistsNodeMaskFileID = 0x5000b;\n\n@nvmFileID(ProtocolRouteCacheExistsNodeMaskFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolRouteCacheExistsNodeMaskFile\n\textends ProtocolNodeMaskFile\n{}\n\nexport const ProtocolLRNodeListFileID = 0x5000c;\n\n@nvmFileID(ProtocolLRNodeListFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolLRNodeListFile extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | ProtocolNodeMaskFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.nodeIdSet = new Set(parseBitMask(this.payload, 256));\n\t\t} else {\n\t\t\tthis.nodeIdSet = new Set(options.nodeIds);\n\t\t}\n\t}\n\n\tpublic nodeIdSet: Set<number>;\n\tpublic get nodeIds(): number[] {\n\t\treturn [...this.nodeIdSet];\n\t}\n\tpublic set nodeIds(value: number[]) {\n\t\tthis.nodeIdSet = new Set(value);\n\t}\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\t// There are only 128 bytes for the bitmask, so the LR node IDs only go up to 1279\n\t\tthis.payload = encodeBitMask([...this.nodeIdSet], 1279, 256);\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"node IDs\": [...this.nodeIdSet].join(\", \"),\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAyD;AAGzD,qBAOO;AAMD,MAAO,6BAA6B,uBAAO;SAAA;;;EAChD,YACC,SAAoE;AAEpE,UAAM,OAAO;AACb,YAAI,0CAA0B,OAAO,GAAG;AACvC,WAAK,YAAY,IAAI,QAAI,0BAAa,KAAK,OAAO,CAAC;IACpD,OAAO;AACN,WAAK,YAAY,IAAI,IAAI,QAAQ,OAAO;IACzC;EACD;EAEO;EACP,IAAW,UAAO;AACjB,WAAO,CAAC,GAAG,KAAK,SAAS;EAC1B;EACA,IAAW,QAAQ,OAAe;AACjC,SAAK,YAAY,IAAI,IAAI,KAAK;EAC/B;EAEO,YAAS;AACf,SAAK,cAAU,2BAAc,CAAC,GAAG,KAAK,SAAS,GAAG,uBAAW;AAC7D,WAAO,MAAM,UAAS;EACvB;;EAGO,SAAM;AACZ,WAAO;MACN,GAAG,MAAM,OAAM;MACf,YAAY,CAAC,GAAG,KAAK,SAAS,EAAE,KAAK,IAAI;;EAE3C;;AAGM,MAAM,mCAAmC;IAInC,kCAA8B,MAAA;8BAF1C,0BAAU,gCAAgC,OAC1C,2BAAW,UAAU,CAAC;;;;oBAC6B;sDAAA,YAAoB;WAAA;;;;;;;;AAAxE,qCAAA,MAAA,mBAAA,EAAA,OAAA,WA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AEpE,YAAM,OAAO;AACb,cAAI,0CAA0B,OAAO,GAAG;AACvC,aAAK,YAAY,IAAI,QAAI,0BAAa,KAAK,SAAS,GAAG,CAAC;MACzD,OAAO;AACN,aAAK,YAAY,IAAI,IAAI,QAAQ,OAAO;MACzC;IACD;IAEO;IACP,IAAW,UAAO;AACjB,aAAO,CAAC,GAAG,KAAK,SAAS;IAC1B;IACA,IAAW,QAAQ,OAAe;AACjC,WAAK,YAAY,IAAI,IAAI,KAAK;IAC/B;IAEO,YAAS;AAEf,WAAK,cAAU,2BAAc,CAAC,GAAG,KAAK,SAAS,GAAG,MAAM,GAAG;AAC3D,aAAO,MAAM,UAAS;IACvB;;IAGO,SAAM;AACZ,aAAO;QACN,GAAG,MAAM,OAAM;QACf,YAAY,CAAC,GAAG,KAAK,SAAS,EAAE,KAAK,IAAI;;IAE3C;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,50 +28,11 @@ __export(RouteCacheFiles_exports, {
|
|
|
28
28
|
nodeIdToRouteCacheFileIDV1: () => nodeIdToRouteCacheFileIDV1
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(RouteCacheFiles_exports);
|
|
31
|
+
var import_tslib = require("tslib");
|
|
31
32
|
var import_core = require("@zwave-js/core");
|
|
32
33
|
var import_shared = require("@zwave-js/shared");
|
|
33
34
|
var import_routeCache = require("../../common/routeCache.js");
|
|
34
35
|
var import_NVMFile = require("./NVMFile.js");
|
|
35
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
36
|
-
function accept(f) {
|
|
37
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
38
|
-
return f;
|
|
39
|
-
}
|
|
40
|
-
__name(accept, "accept");
|
|
41
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
42
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
43
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
44
|
-
var _, done = false;
|
|
45
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
46
|
-
var context = {};
|
|
47
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
48
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
49
|
-
context.addInitializer = function(f) {
|
|
50
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
51
|
-
extraInitializers.push(accept(f || null));
|
|
52
|
-
};
|
|
53
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
54
|
-
if (kind === "accessor") {
|
|
55
|
-
if (result === void 0) continue;
|
|
56
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
57
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
58
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
59
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
60
|
-
} else if (_ = accept(result)) {
|
|
61
|
-
if (kind === "field") initializers.unshift(_);
|
|
62
|
-
else descriptor[key] = _;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
66
|
-
done = true;
|
|
67
|
-
};
|
|
68
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
69
|
-
var useValue = arguments.length > 2;
|
|
70
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
71
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
72
|
-
}
|
|
73
|
-
return useValue ? value : void 0;
|
|
74
|
-
};
|
|
75
36
|
const ROUTECACHES_PER_FILE_V1 = 8;
|
|
76
37
|
const RouteCacheFileV0IDBase = 328704;
|
|
77
38
|
function nodeIdToRouteCacheFileIDV0(nodeId) {
|
|
@@ -93,10 +54,10 @@ let RouteCacheFileV0 = (() => {
|
|
|
93
54
|
}
|
|
94
55
|
static {
|
|
95
56
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
96
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
57
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
97
58
|
RouteCacheFileV02 = _classThis = _classDescriptor.value;
|
|
98
59
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
99
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
60
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
100
61
|
}
|
|
101
62
|
constructor(options) {
|
|
102
63
|
super(options);
|
|
@@ -148,10 +109,10 @@ let RouteCacheFileV1 = (() => {
|
|
|
148
109
|
}
|
|
149
110
|
static {
|
|
150
111
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
151
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
112
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
152
113
|
RouteCacheFileV12 = _classThis = _classDescriptor.value;
|
|
153
114
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
154
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
115
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
155
116
|
}
|
|
156
117
|
constructor(options) {
|
|
157
118
|
super(options);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/RouteCacheFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import { MAX_NODES, MAX_REPEATERS } from \"@zwave-js/core\";\nimport { Bytes } from \"@zwave-js/shared\";\nimport {\n\tEMPTY_ROUTECACHE_FILL,\n\tROUTECACHE_SIZE,\n\ttype RouteCache,\n\temptyRouteCache,\n\tencodeRoute,\n\tparseRoute,\n} from \"../../common/routeCache.js\";\nimport type { NVM3Object } from \"../object.js\";\nimport {\n\tNVMFile,\n\ttype NVMFileCreationOptions,\n\ttype NVMFileDeserializationOptions,\n\tgotDeserializationOptions,\n\tnvmFileID,\n\tnvmSection,\n} from \"./NVMFile.js\";\n\nexport const ROUTECACHES_PER_FILE_V1 = 8;\n\nexport interface RouteCacheFileV0Options extends NVMFileCreationOptions {\n\trouteCache: RouteCache;\n}\n\nexport const RouteCacheFileV0IDBase = 0x50400;\nexport function nodeIdToRouteCacheFileIDV0(nodeId: number): number {\n\treturn RouteCacheFileV0IDBase + nodeId - 1;\n}\n\n@nvmFileID(\n\t(id) =>\n\t\tid >= RouteCacheFileV0IDBase && id < RouteCacheFileV0IDBase + MAX_NODES,\n)\n@nvmSection(\"protocol\")\nexport class RouteCacheFileV0 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | RouteCacheFileV0Options,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tconst nodeId = this.fileId - RouteCacheFileV0IDBase + 1;\n\t\t\tconst lwr = parseRoute(this.payload, 0);\n\t\t\tconst nlwr = parseRoute(this.payload, MAX_REPEATERS + 1);\n\t\t\tthis.routeCache = { nodeId, lwr, nlwr };\n\t\t} else {\n\t\t\tthis.routeCache = options.routeCache;\n\t\t}\n\t}\n\n\tpublic routeCache: RouteCache;\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.fileId = nodeIdToRouteCacheFileIDV0(this.routeCache.nodeId);\n\t\tthis.payload = Bytes.concat([\n\t\t\tencodeRoute(this.routeCache.lwr),\n\t\t\tencodeRoute(this.routeCache.nlwr),\n\t\t]);\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\trouteCache: this.routeCache,\n\t\t};\n\t}\n}\n\nexport interface RouteCacheFileV1Options extends NVMFileCreationOptions {\n\trouteCaches: RouteCache[];\n}\n\nexport const RouteCacheFileV1IDBase = 0x51400;\nexport function nodeIdToRouteCacheFileIDV1(nodeId: number): number {\n\treturn (\n\t\tRouteCacheFileV1IDBase\n\t\t+ Math.floor((nodeId - 1) / ROUTECACHES_PER_FILE_V1)\n\t);\n}\n\n@nvmFileID(\n\t(id) =>\n\t\tid >= RouteCacheFileV1IDBase\n\t\t&& id < RouteCacheFileV1IDBase + MAX_NODES / ROUTECACHES_PER_FILE_V1,\n)\n@nvmSection(\"protocol\")\nexport class RouteCacheFileV1 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | RouteCacheFileV1Options,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.routeCaches = [];\n\t\t\tfor (let i = 0; i < ROUTECACHES_PER_FILE_V1; i++) {\n\t\t\t\tconst offset = i * 2 * (MAX_REPEATERS + 1);\n\t\t\t\tconst entry = this.payload.subarray(\n\t\t\t\t\toffset,\n\t\t\t\t\toffset + 2 * (MAX_REPEATERS + 1),\n\t\t\t\t);\n\t\t\t\tif (entry.equals(emptyRouteCache)) continue;\n\n\t\t\t\tconst nodeId = (this.fileId - RouteCacheFileV1IDBase)\n\t\t\t\t\t\t* ROUTECACHES_PER_FILE_V1\n\t\t\t\t\t+ 1\n\t\t\t\t\t+ i;\n\t\t\t\tconst lwr = parseRoute(this.payload, offset);\n\t\t\t\tconst nlwr = parseRoute(\n\t\t\t\t\tthis.payload,\n\t\t\t\t\toffset + MAX_REPEATERS + 1,\n\t\t\t\t);\n\n\t\t\t\tthis.routeCaches.push({ nodeId, lwr, nlwr });\n\t\t\t}\n\t\t} else {\n\t\t\tthis.routeCaches = options.routeCaches;\n\t\t}\n\t}\n\n\tpublic routeCaches: RouteCache[];\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\t// The route infos must be sorted by node ID\n\t\tthis.routeCaches.sort((a, b) => a.nodeId - b.nodeId);\n\t\tconst minNodeId = this.routeCaches[0].nodeId;\n\t\tthis.fileId = nodeIdToRouteCacheFileIDV1(minNodeId);\n\n\t\tthis.payload = new Bytes(ROUTECACHES_PER_FILE_V1 * ROUTECACHE_SIZE)\n\t\t\t.fill(EMPTY_ROUTECACHE_FILL);\n\n\t\tconst minFileNodeId =\n\t\t\tMath.floor((minNodeId - 1) / ROUTECACHES_PER_FILE_V1)\n\t\t\t\t* ROUTECACHES_PER_FILE_V1\n\t\t\t+ 1;\n\n\t\tfor (const routeCache of this.routeCaches) {\n\t\t\tconst offset = (routeCache.nodeId - minFileNodeId)\n\t\t\t\t* ROUTECACHE_SIZE;\n\t\t\tconst routes = Bytes.concat([\n\t\t\t\tencodeRoute(routeCache.lwr),\n\t\t\t\tencodeRoute(routeCache.nlwr),\n\t\t\t]);\n\t\t\tthis.payload.set(routes, offset);\n\t\t}\n\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"route caches\": this.routeCaches,\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAyC;AACzC,oBAAsB;AACtB,wBAOO;AAEP,qBAOO;AAEA,MAAM,0BAA0B;AAMhC,MAAM,yBAAyB;AAChC,SAA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f,gBAAgB,KAAK;;IAEvB;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,50 +28,11 @@ __export(SUCUpdateEntriesFile_exports, {
|
|
|
28
28
|
sucUpdateIndexToSUCUpdateEntriesFileIDV5: () => sucUpdateIndexToSUCUpdateEntriesFileIDV5
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(SUCUpdateEntriesFile_exports);
|
|
31
|
+
var import_tslib = require("tslib");
|
|
31
32
|
var import_shared = require("@zwave-js/shared");
|
|
32
33
|
var import_consts = require("../../../consts.js");
|
|
33
34
|
var import_sucUpdateEntry = require("../../common/sucUpdateEntry.js");
|
|
34
35
|
var import_NVMFile = require("./NVMFile.js");
|
|
35
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
36
|
-
function accept(f) {
|
|
37
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
38
|
-
return f;
|
|
39
|
-
}
|
|
40
|
-
__name(accept, "accept");
|
|
41
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
42
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
43
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
44
|
-
var _, done = false;
|
|
45
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
46
|
-
var context = {};
|
|
47
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
48
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
49
|
-
context.addInitializer = function(f) {
|
|
50
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
51
|
-
extraInitializers.push(accept(f || null));
|
|
52
|
-
};
|
|
53
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
54
|
-
if (kind === "accessor") {
|
|
55
|
-
if (result === void 0) continue;
|
|
56
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
57
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
58
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
59
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
60
|
-
} else if (_ = accept(result)) {
|
|
61
|
-
if (kind === "field") initializers.unshift(_);
|
|
62
|
-
else descriptor[key] = _;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
66
|
-
done = true;
|
|
67
|
-
};
|
|
68
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
69
|
-
var useValue = arguments.length > 2;
|
|
70
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
71
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
72
|
-
}
|
|
73
|
-
return useValue ? value : void 0;
|
|
74
|
-
};
|
|
75
36
|
const SUC_UPDATES_PER_FILE_V5 = 8;
|
|
76
37
|
const SUCUpdateEntriesFileIDV0 = 327683;
|
|
77
38
|
let SUCUpdateEntriesFileV0 = (() => {
|
|
@@ -89,10 +50,10 @@ let SUCUpdateEntriesFileV0 = (() => {
|
|
|
89
50
|
}
|
|
90
51
|
static {
|
|
91
52
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
92
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
53
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
93
54
|
SUCUpdateEntriesFileV02 = _classThis = _classDescriptor.value;
|
|
94
55
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
95
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
56
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
96
57
|
}
|
|
97
58
|
constructor(options) {
|
|
98
59
|
super(options);
|
|
@@ -149,10 +110,10 @@ let SUCUpdateEntriesFileV5 = (() => {
|
|
|
149
110
|
}
|
|
150
111
|
static {
|
|
151
112
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
152
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
113
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
153
114
|
SUCUpdateEntriesFileV52 = _classThis = _classDescriptor.value;
|
|
154
115
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
155
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
116
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
156
117
|
}
|
|
157
118
|
constructor(options) {
|
|
158
119
|
super(options);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/SUCUpdateEntriesFile.ts"],
|
|
4
4
|
"sourcesContent": ["import { Bytes } from \"@zwave-js/shared\";\nimport { SUC_MAX_UPDATES, SUC_UPDATE_ENTRY_SIZE } from \"../../../consts.js\";\nimport {\n\ttype SUCUpdateEntry,\n\tencodeSUCUpdateEntry,\n\tparseSUCUpdateEntry,\n} from \"../../common/sucUpdateEntry.js\";\nimport type { NVM3Object } from \"../object.js\";\nimport {\n\tNVMFile,\n\ttype NVMFileCreationOptions,\n\ttype NVMFileDeserializationOptions,\n\tgotDeserializationOptions,\n\tnvmFileID,\n\tnvmSection,\n} from \"./NVMFile.js\";\n\nexport const SUC_UPDATES_PER_FILE_V5 = 8;\n\nexport interface SUCUpdateEntriesFileOptions extends NVMFileCreationOptions {\n\tupdateEntries: SUCUpdateEntry[];\n}\n\nexport const SUCUpdateEntriesFileIDV0 = 0x50003;\n\n@nvmFileID(SUCUpdateEntriesFileIDV0)\n@nvmSection(\"protocol\")\nexport class SUCUpdateEntriesFileV0 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | SUCUpdateEntriesFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.updateEntries = [];\n\t\t\tfor (let entry = 0; entry < SUC_MAX_UPDATES; entry++) {\n\t\t\t\tconst offset = entry * SUC_UPDATE_ENTRY_SIZE;\n\t\t\t\tconst updateEntry = parseSUCUpdateEntry(this.payload, offset);\n\t\t\t\tif (updateEntry) this.updateEntries.push(updateEntry);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.updateEntries = options.updateEntries;\n\t\t}\n\t}\n\n\tpublic updateEntries: SUCUpdateEntry[];\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.payload = new Bytes(SUC_MAX_UPDATES * SUC_UPDATE_ENTRY_SIZE).fill(\n\t\t\t0,\n\t\t);\n\t\tfor (let i = 0; i < this.updateEntries.length; i++) {\n\t\t\tconst offset = i * SUC_UPDATE_ENTRY_SIZE;\n\t\t\tconst entry = this.updateEntries[i];\n\t\t\tthis.payload.set(encodeSUCUpdateEntry(entry), offset);\n\t\t}\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"SUC update entries\": this.updateEntries,\n\t\t};\n\t}\n}\n\nexport const SUCUpdateEntriesFileV5IDBase = 0x54000;\nexport const SUCUpdateEntriesFileV5IDMax = SUCUpdateEntriesFileV5IDBase\n\t+ SUC_MAX_UPDATES / SUC_UPDATES_PER_FILE_V5\n\t- 1;\nexport function sucUpdateIndexToSUCUpdateEntriesFileIDV5(\n\tindex: number,\n): number {\n\treturn (\n\t\tSUCUpdateEntriesFileV5IDBase\n\t\t+ Math.floor(index / SUC_UPDATES_PER_FILE_V5)\n\t);\n}\n\n@nvmFileID(\n\t(id) =>\n\t\tid >= SUCUpdateEntriesFileV5IDBase\n\t\t&& id <= SUCUpdateEntriesFileV5IDMax,\n)\n@nvmSection(\"protocol\")\nexport class SUCUpdateEntriesFileV5 extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | SUCUpdateEntriesFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.updateEntries = [];\n\t\t\tfor (let entry = 0; entry < SUC_UPDATES_PER_FILE_V5; entry++) {\n\t\t\t\tconst offset = entry * SUC_UPDATE_ENTRY_SIZE;\n\t\t\t\tconst updateEntry = parseSUCUpdateEntry(this.payload, offset);\n\t\t\t\tif (updateEntry) this.updateEntries.push(updateEntry);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.updateEntries = options.updateEntries;\n\t\t}\n\t}\n\n\tpublic updateEntries: SUCUpdateEntry[];\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.payload = new Bytes(\n\t\t\tSUC_UPDATES_PER_FILE_V5 * SUC_UPDATE_ENTRY_SIZE,\n\t\t).fill(0xff);\n\t\tfor (let i = 0; i < this.updateEntries.length; i++) {\n\t\t\tconst offset = i * SUC_UPDATE_ENTRY_SIZE;\n\t\t\tconst entry = this.updateEntries[i];\n\t\t\tthis.payload.set(encodeSUCUpdateEntry(entry), offset);\n\t\t}\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\t\"SUC update entries\": this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ACf,OAAa;AAEb,SACC,+BACE,KAAK,MAAM,QAAQ,uBAAuB;AAE9C;AAPgB;IAeH,0BAAsB,MAAA;8BANlC,0BACA,CAAC,OACA,MAAM,gCACH,MAAM,2BAA2B,OAErC,2BAAW,UAAU,CAAC;;;;oBACqB;8CAAA,YAAO;WAAA;;;;;;;;AAAnD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACZ,YACC,SAAoE;AAEpE,YAAM,OAAO;AACb,cAAI,0CAA0B,OAAO,GAAG;AACvC,aAAK,gBAAgB,CAAA;AACrB,iBAAS,QAAQ,GAAG,QAAQ,yBAAyB,SAAS;AAC7D,gBAAM,SAAS,QAAQ;AACvB,gBAAM,kBAAc,2CAAoB,KAAK,SAAS,MAAM;AAC5D,cAAI;AAAa,iBAAK,cAAc,KAAK,WAAW;QACrD;MACD,OAAO;AACN,aAAK,gBAAgB,QAAQ;MAC9B;IACD;IAEO;IAEA,YAAS;AACf,WAAK,UAAU,IAAI,oBAClB,0BAA0B,mCAAqB,EAC9C,KAAK,GAAI;AACX,eAAS,IAAI,GAAG,IAAI,KAAK,cAAc,QAAQ,KAAK;AACnD,cAAM,SAAS,IAAI;AACnB,cAAM,QAAQ,KAAK,cAAc,CAAC;AAClC,aAAK,QAAQ,QAAI,4CAAqB,KAAK,GAAG,MAAM;MACrD;AACA,aAAO,MAAM,UAAS;IACvB;;IAGO,SAAM;AACZ,aAAO;QACN,GAAG,MAAM,OAAM;QACf,sBAAsB,KAAK;;IAE7B;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,48 +28,9 @@ __export(VersionFiles_exports, {
|
|
|
28
28
|
VersionFile: () => VersionFile
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(VersionFiles_exports);
|
|
31
|
+
var import_tslib = require("tslib");
|
|
31
32
|
var import_shared = require("@zwave-js/shared");
|
|
32
33
|
var import_NVMFile = require("./NVMFile.js");
|
|
33
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
34
|
-
function accept(f) {
|
|
35
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
36
|
-
return f;
|
|
37
|
-
}
|
|
38
|
-
__name(accept, "accept");
|
|
39
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
40
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
41
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
42
|
-
var _, done = false;
|
|
43
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
44
|
-
var context = {};
|
|
45
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
46
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
47
|
-
context.addInitializer = function(f) {
|
|
48
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
49
|
-
extraInitializers.push(accept(f || null));
|
|
50
|
-
};
|
|
51
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
52
|
-
if (kind === "accessor") {
|
|
53
|
-
if (result === void 0) continue;
|
|
54
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
55
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
56
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
57
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
58
|
-
} else if (_ = accept(result)) {
|
|
59
|
-
if (kind === "field") initializers.unshift(_);
|
|
60
|
-
else descriptor[key] = _;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
64
|
-
done = true;
|
|
65
|
-
};
|
|
66
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
67
|
-
var useValue = arguments.length > 2;
|
|
68
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
69
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
70
|
-
}
|
|
71
|
-
return useValue ? value : void 0;
|
|
72
|
-
};
|
|
73
34
|
class VersionFile extends import_NVMFile.NVMFile {
|
|
74
35
|
static {
|
|
75
36
|
__name(this, "VersionFile");
|
|
@@ -126,10 +87,10 @@ let ApplicationVersionFile = (() => {
|
|
|
126
87
|
}
|
|
127
88
|
static {
|
|
128
89
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
129
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
90
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
130
91
|
ApplicationVersionFile2 = _classThis = _classDescriptor.value;
|
|
131
92
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
132
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
93
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
133
94
|
}
|
|
134
95
|
};
|
|
135
96
|
return ApplicationVersionFile2 = _classThis;
|
|
@@ -150,10 +111,10 @@ let ApplicationVersionFile800 = (() => {
|
|
|
150
111
|
}
|
|
151
112
|
static {
|
|
152
113
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
153
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
114
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
154
115
|
ApplicationVersionFile8002 = _classThis = _classDescriptor.value;
|
|
155
116
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
156
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
117
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
157
118
|
}
|
|
158
119
|
};
|
|
159
120
|
return ApplicationVersionFile8002 = _classThis;
|
|
@@ -174,10 +135,10 @@ let ProtocolVersionFile = (() => {
|
|
|
174
135
|
}
|
|
175
136
|
static {
|
|
176
137
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
177
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
138
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
178
139
|
ProtocolVersionFile2 = _classThis = _classDescriptor.value;
|
|
179
140
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
180
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
141
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
181
142
|
}
|
|
182
143
|
};
|
|
183
144
|
return ProtocolVersionFile2 = _classThis;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/VersionFiles.ts"],
|
|
4
4
|
"sourcesContent": ["import { Bytes } from \"@zwave-js/shared\";\nimport type { NVM3Object } from \"../object.js\";\nimport {\n\tNVMFile,\n\ttype NVMFileCreationOptions,\n\ttype NVMFileDeserializationOptions,\n\tgotDeserializationOptions,\n\tnvmFileID,\n\tnvmSection,\n} from \"./NVMFile.js\";\n\nexport interface VersionFileOptions extends NVMFileCreationOptions {\n\tformat: number;\n\tmajor: number;\n\tminor: number;\n\tpatch: number;\n}\n\nexport class VersionFile extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | VersionFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.format = this.payload[3];\n\t\t\tthis.major = this.payload[2];\n\t\t\tthis.minor = this.payload[1];\n\t\t\tthis.patch = this.payload[0];\n\t\t} else {\n\t\t\tthis.format = options.format;\n\t\t\tthis.major = options.major;\n\t\t\tthis.minor = options.minor;\n\t\t\tthis.patch = options.patch;\n\t\t}\n\t}\n\n\tpublic format: number;\n\tpublic major: number;\n\tpublic minor: number;\n\tpublic patch: number;\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.patch,\n\t\t\tthis.minor,\n\t\t\tthis.major,\n\t\t\tthis.format,\n\t\t]);\n\t\treturn super.serialize();\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\tformat: this.format,\n\t\t\tversion: `${this.major}.${this.minor}.${this.patch}`,\n\t\t};\n\t}\n}\n\nexport const ApplicationVersionFileID = 0x51000;\n\n@nvmFileID(ApplicationVersionFileID)\n@nvmSection(\"application\")\nexport class ApplicationVersionFile extends VersionFile {}\n\n// The 800 series has a shared application/protocol file system\n// and uses a different ID for the application version file\nexport const ApplicationVersionFile800ID = 0x41000;\n\n@nvmFileID(ApplicationVersionFile800ID)\n@nvmSection(\"application\")\nexport class ApplicationVersionFile800 extends VersionFile {}\n\nexport const ProtocolVersionFileID = 0x50000;\n\n@nv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;;oBACqB;iDAAA,YAAW;WAAA;;;;;;;;AAA1D,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;AAEN,MAAM,wBAAwB;IAIxB,uBAAmB,MAAA;8BAF/B,0BAAU,qBAAqB,OAC/B,2BAAW,UAAU,CAAC;;;;oBACkB;2CAAA,YAAW;WAAA;;;;;;;;AAApD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
35
2
|
import { CommandClasses } from "@zwave-js/core";
|
|
36
3
|
import { Bytes } from "@zwave-js/shared";
|
|
37
4
|
import { NVMFile, gotDeserializationOptions, nvmFileID, nvmSection, } from "./NVMFile.js";
|