@zwave-js/nvmedit 14.0.0-beta.4 → 14.0.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.
Files changed (49) hide show
  1. package/build/cjs/lib/nvm3/files/ApplicationCCsFile.js +105 -58
  2. package/build/cjs/lib/nvm3/files/ApplicationCCsFile.js.map +2 -2
  3. package/build/cjs/lib/nvm3/files/ApplicationDataFile.js +69 -22
  4. package/build/cjs/lib/nvm3/files/ApplicationDataFile.js.map +2 -2
  5. package/build/cjs/lib/nvm3/files/ApplicationNameFile.js +71 -24
  6. package/build/cjs/lib/nvm3/files/ApplicationNameFile.js.map +2 -2
  7. package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js +140 -93
  8. package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js.map +2 -2
  9. package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js +92 -45
  10. package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js.map +2 -2
  11. package/build/cjs/lib/nvm3/files/ControllerInfoFile.js +176 -129
  12. package/build/cjs/lib/nvm3/files/ControllerInfoFile.js.map +2 -2
  13. package/build/cjs/lib/nvm3/files/NVMFile.d.ts +3 -3
  14. package/build/cjs/lib/nvm3/files/NVMFile.js.map +1 -1
  15. package/build/cjs/lib/nvm3/files/NodeInfoFiles.js +186 -111
  16. package/build/cjs/lib/nvm3/files/NodeInfoFiles.js.map +2 -2
  17. package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js +243 -84
  18. package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +2 -2
  19. package/build/cjs/lib/nvm3/files/RouteCacheFiles.js +143 -82
  20. package/build/cjs/lib/nvm3/files/RouteCacheFiles.js.map +2 -2
  21. package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js +134 -73
  22. package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js.map +2 -2
  23. package/build/cjs/lib/nvm3/files/VersionFiles.js +98 -23
  24. package/build/cjs/lib/nvm3/files/VersionFiles.js.map +2 -2
  25. package/build/esm/lib/nvm3/files/ApplicationCCsFile.js +106 -66
  26. package/build/esm/lib/nvm3/files/ApplicationCCsFile.js.map +1 -1
  27. package/build/esm/lib/nvm3/files/ApplicationDataFile.js +63 -23
  28. package/build/esm/lib/nvm3/files/ApplicationDataFile.js.map +1 -1
  29. package/build/esm/lib/nvm3/files/ApplicationNameFile.js +66 -26
  30. package/build/esm/lib/nvm3/files/ApplicationNameFile.js.map +1 -1
  31. package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js +137 -97
  32. package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js.map +1 -1
  33. package/build/esm/lib/nvm3/files/ApplicationTypeFile.js +87 -47
  34. package/build/esm/lib/nvm3/files/ApplicationTypeFile.js.map +1 -1
  35. package/build/esm/lib/nvm3/files/ControllerInfoFile.js +172 -132
  36. package/build/esm/lib/nvm3/files/ControllerInfoFile.js.map +1 -1
  37. package/build/esm/lib/nvm3/files/NVMFile.d.ts +3 -3
  38. package/build/esm/lib/nvm3/files/NVMFile.d.ts.map +1 -1
  39. package/build/esm/lib/nvm3/files/NodeInfoFiles.js +191 -127
  40. package/build/esm/lib/nvm3/files/NodeInfoFiles.js.map +1 -1
  41. package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js +221 -85
  42. package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +1 -1
  43. package/build/esm/lib/nvm3/files/RouteCacheFiles.js +143 -91
  44. package/build/esm/lib/nvm3/files/RouteCacheFiles.js.map +1 -1
  45. package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js +126 -74
  46. package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js.map +1 -1
  47. package/build/esm/lib/nvm3/files/VersionFiles.js +87 -23
  48. package/build/esm/lib/nvm3/files/VersionFiles.js.map +1 -1
  49. package/package.json +3 -3
@@ -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/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\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// eslint-disable-next-line @typescript-eslint/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// eslint-disable-next-line @typescript-eslint/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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAyC;AACzC,IAAAA,eAAsB;AACtB,wBAOO;AAEP,qBAOO;;;;;;;AAEA,MAAM,0BAA0B;AAMhC,MAAM,yBAAyB;AAChC,SAAU,2BAA2B,QAAc;AACxD,SAAO,yBAAyB,SAAS;AAC1C;AAOO,IAAM,mBAAN,MAAMC,0BAAyB,uBAAO;EAC5C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,0CAA0B,OAAO,GAAG;AACvC,aAAK,cAAc,CAAA;AACnB,iBAAS,IAAI,GAAG,IAAI,yBAAyB,KAAK;AACjD,gBAAM,SAAS,IAAI,KAAK,4BAAgB;AACxC,gBAAM,QAAQ,KAAK,QAAQ,SAC1B,QACA,SAAS,KAAK,4BAAgB,EAAE;AAEjC,cAAI,MAAM,OAAO,iCAAe;AAAG;AAEnC,gBAAM,UAAU,KAAK,SAAS,0BAC1B,0BACD,IACA;AACH,gBAAM,UAAM,8BAAW,KAAK,SAAS,MAAM;AAC3C,gBAAM,WAAO,8BACZ,KAAK,SACL,SAAS,4BAAgB,CAAC;AAG3B,eAAK,YAAY,KAAK,EAAE,QAAQ,KAAK,KAAI,CAAE;QAC5C;MACD,OAAO;AACN,aAAK,cAAc,QAAQ;MAC5B;IACD;IAEO;IAEA,YAAS;AAEf,WAAK,YAAY,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM;AACnD,YAAM,YAAY,KAAK,YAAY,CAAC,EAAE;AACtC,WAAK,SAAS,2BAA2B,SAAS;AAElD,WAAK,UAAU,IAAI,mBAAM,0BAA0B,iCAAe,EAChE,KAAK,uCAAqB;AAE5B,YAAM,gBACL,KAAK,OAAO,YAAY,KAAK,uBAAuB,IACjD,0BACD;AAEH,iBAAW,cAAc,KAAK,aAAa;AAC1C,cAAM,UAAU,WAAW,SAAS,iBACjC;AACH,cAAM,SAAS,mBAAM,OAAO;cAC3B,+BAAY,WAAW,GAAG;cAC1B,+BAAY,WAAW,IAAI;SAC3B;AACD,aAAK,QAAQ,IAAI,QAAQ,MAAM;MAChC;AAEA,aAAO,MAAM,UAAS;IACvB;;IAGO,SAAM;AACZ,aAAO;QACN,GAAG,MAAM,OAAM;QACf,gBAAgB,KAAK;;IAEvB;;;;",
6
+ "names": ["import_safe"]
7
7
  }
@@ -31,93 +31,154 @@ var import_safe = require("@zwave-js/shared/safe");
31
31
  var import_consts = require("../../../consts.js");
32
32
  var import_sucUpdateEntry = require("../../common/sucUpdateEntry.js");
33
33
  var import_NVMFile = require("./NVMFile.js");
34
- var __decorate = function(decorators, target, key, desc) {
35
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
37
- 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;
38
- return c > 3 && r && Object.defineProperty(target, key, r), r;
34
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
35
+ function accept(f) {
36
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
37
+ return f;
38
+ }
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;
39
72
  };
40
73
  const SUC_UPDATES_PER_FILE_V5 = 8;
41
74
  const SUCUpdateEntriesFileIDV0 = 327683;
42
- let SUCUpdateEntriesFileV0 = class SUCUpdateEntriesFileV02 extends import_NVMFile.NVMFile {
43
- constructor(options) {
44
- super(options);
45
- if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
46
- this.updateEntries = [];
47
- for (let entry = 0; entry < import_consts.SUC_MAX_UPDATES; entry++) {
48
- const offset = entry * import_consts.SUC_UPDATE_ENTRY_SIZE;
49
- const updateEntry = (0, import_sucUpdateEntry.parseSUCUpdateEntry)(this.payload, offset);
50
- if (updateEntry)
51
- this.updateEntries.push(updateEntry);
75
+ let SUCUpdateEntriesFileV0 = (() => {
76
+ let _classDecorators = [(0, import_NVMFile.nvmFileID)(SUCUpdateEntriesFileIDV0), (0, import_NVMFile.nvmSection)("protocol")];
77
+ let _classDescriptor;
78
+ let _classExtraInitializers = [];
79
+ let _classThis;
80
+ let _classSuper = import_NVMFile.NVMFile;
81
+ var SUCUpdateEntriesFileV02 = class extends _classSuper {
82
+ static {
83
+ _classThis = this;
84
+ }
85
+ static {
86
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
87
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
88
+ SUCUpdateEntriesFileV02 = _classThis = _classDescriptor.value;
89
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
90
+ __runInitializers(_classThis, _classExtraInitializers);
91
+ }
92
+ constructor(options) {
93
+ super(options);
94
+ if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
95
+ this.updateEntries = [];
96
+ for (let entry = 0; entry < import_consts.SUC_MAX_UPDATES; entry++) {
97
+ const offset = entry * import_consts.SUC_UPDATE_ENTRY_SIZE;
98
+ const updateEntry = (0, import_sucUpdateEntry.parseSUCUpdateEntry)(this.payload, offset);
99
+ if (updateEntry)
100
+ this.updateEntries.push(updateEntry);
101
+ }
102
+ } else {
103
+ this.updateEntries = options.updateEntries;
52
104
  }
53
- } else {
54
- this.updateEntries = options.updateEntries;
55
105
  }
56
- }
57
- updateEntries;
58
- serialize() {
59
- this.payload = new import_safe.Bytes(import_consts.SUC_MAX_UPDATES * import_consts.SUC_UPDATE_ENTRY_SIZE).fill(0);
60
- for (let i = 0; i < this.updateEntries.length; i++) {
61
- const offset = i * import_consts.SUC_UPDATE_ENTRY_SIZE;
62
- const entry = this.updateEntries[i];
63
- this.payload.set((0, import_sucUpdateEntry.encodeSUCUpdateEntry)(entry), offset);
106
+ updateEntries;
107
+ serialize() {
108
+ this.payload = new import_safe.Bytes(import_consts.SUC_MAX_UPDATES * import_consts.SUC_UPDATE_ENTRY_SIZE).fill(0);
109
+ for (let i = 0; i < this.updateEntries.length; i++) {
110
+ const offset = i * import_consts.SUC_UPDATE_ENTRY_SIZE;
111
+ const entry = this.updateEntries[i];
112
+ this.payload.set((0, import_sucUpdateEntry.encodeSUCUpdateEntry)(entry), offset);
113
+ }
114
+ return super.serialize();
64
115
  }
65
- return super.serialize();
66
- }
67
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
68
- toJSON() {
69
- return {
70
- ...super.toJSON(),
71
- "SUC update entries": this.updateEntries
72
- };
73
- }
74
- };
75
- SUCUpdateEntriesFileV0 = __decorate([
76
- (0, import_NVMFile.nvmFileID)(SUCUpdateEntriesFileIDV0),
77
- (0, import_NVMFile.nvmSection)("protocol")
78
- ], SUCUpdateEntriesFileV0);
116
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
117
+ toJSON() {
118
+ return {
119
+ ...super.toJSON(),
120
+ "SUC update entries": this.updateEntries
121
+ };
122
+ }
123
+ };
124
+ return SUCUpdateEntriesFileV02 = _classThis;
125
+ })();
79
126
  const SUCUpdateEntriesFileV5IDBase = 344064;
80
127
  const SUCUpdateEntriesFileV5IDMax = SUCUpdateEntriesFileV5IDBase + import_consts.SUC_MAX_UPDATES / SUC_UPDATES_PER_FILE_V5 - 1;
81
128
  function sucUpdateIndexToSUCUpdateEntriesFileIDV5(index) {
82
129
  return SUCUpdateEntriesFileV5IDBase + Math.floor(index / SUC_UPDATES_PER_FILE_V5);
83
130
  }
84
- let SUCUpdateEntriesFileV5 = class SUCUpdateEntriesFileV52 extends import_NVMFile.NVMFile {
85
- constructor(options) {
86
- super(options);
87
- if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
88
- this.updateEntries = [];
89
- for (let entry = 0; entry < SUC_UPDATES_PER_FILE_V5; entry++) {
90
- const offset = entry * import_consts.SUC_UPDATE_ENTRY_SIZE;
91
- const updateEntry = (0, import_sucUpdateEntry.parseSUCUpdateEntry)(this.payload, offset);
92
- if (updateEntry)
93
- this.updateEntries.push(updateEntry);
131
+ let SUCUpdateEntriesFileV5 = (() => {
132
+ let _classDecorators = [(0, import_NVMFile.nvmFileID)((id) => id >= SUCUpdateEntriesFileV5IDBase && id <= SUCUpdateEntriesFileV5IDMax), (0, import_NVMFile.nvmSection)("protocol")];
133
+ let _classDescriptor;
134
+ let _classExtraInitializers = [];
135
+ let _classThis;
136
+ let _classSuper = import_NVMFile.NVMFile;
137
+ var SUCUpdateEntriesFileV52 = class extends _classSuper {
138
+ static {
139
+ _classThis = this;
140
+ }
141
+ static {
142
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
143
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
144
+ SUCUpdateEntriesFileV52 = _classThis = _classDescriptor.value;
145
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
146
+ __runInitializers(_classThis, _classExtraInitializers);
147
+ }
148
+ constructor(options) {
149
+ super(options);
150
+ if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
151
+ this.updateEntries = [];
152
+ for (let entry = 0; entry < SUC_UPDATES_PER_FILE_V5; entry++) {
153
+ const offset = entry * import_consts.SUC_UPDATE_ENTRY_SIZE;
154
+ const updateEntry = (0, import_sucUpdateEntry.parseSUCUpdateEntry)(this.payload, offset);
155
+ if (updateEntry)
156
+ this.updateEntries.push(updateEntry);
157
+ }
158
+ } else {
159
+ this.updateEntries = options.updateEntries;
94
160
  }
95
- } else {
96
- this.updateEntries = options.updateEntries;
97
161
  }
98
- }
99
- updateEntries;
100
- serialize() {
101
- this.payload = new import_safe.Bytes(SUC_UPDATES_PER_FILE_V5 * import_consts.SUC_UPDATE_ENTRY_SIZE).fill(255);
102
- for (let i = 0; i < this.updateEntries.length; i++) {
103
- const offset = i * import_consts.SUC_UPDATE_ENTRY_SIZE;
104
- const entry = this.updateEntries[i];
105
- this.payload.set((0, import_sucUpdateEntry.encodeSUCUpdateEntry)(entry), offset);
162
+ updateEntries;
163
+ serialize() {
164
+ this.payload = new import_safe.Bytes(SUC_UPDATES_PER_FILE_V5 * import_consts.SUC_UPDATE_ENTRY_SIZE).fill(255);
165
+ for (let i = 0; i < this.updateEntries.length; i++) {
166
+ const offset = i * import_consts.SUC_UPDATE_ENTRY_SIZE;
167
+ const entry = this.updateEntries[i];
168
+ this.payload.set((0, import_sucUpdateEntry.encodeSUCUpdateEntry)(entry), offset);
169
+ }
170
+ return super.serialize();
106
171
  }
107
- return super.serialize();
108
- }
109
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
110
- toJSON() {
111
- return {
112
- ...super.toJSON(),
113
- "SUC update entries": this.updateEntries
114
- };
115
- }
116
- };
117
- SUCUpdateEntriesFileV5 = __decorate([
118
- (0, import_NVMFile.nvmFileID)((id) => id >= SUCUpdateEntriesFileV5IDBase && id <= SUCUpdateEntriesFileV5IDMax),
119
- (0, import_NVMFile.nvmSection)("protocol")
120
- ], SUCUpdateEntriesFileV5);
172
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
173
+ toJSON() {
174
+ return {
175
+ ...super.toJSON(),
176
+ "SUC update entries": this.updateEntries
177
+ };
178
+ }
179
+ };
180
+ return SUCUpdateEntriesFileV52 = _classThis;
181
+ })();
121
182
  // Annotate the CommonJS export names for ESM import in node:
122
183
  0 && (module.exports = {
123
184
  SUCUpdateEntriesFileIDV0,
@@ -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/safe\";\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// eslint-disable-next-line @typescript-eslint/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// eslint-disable-next-line @typescript-eslint/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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAsB;AACtB,oBAAuD;AACvD,4BAIO;AAEP,qBAOO;;;;;;;AAEA,MAAM,0BAA0B;AAMhC,MAAM,2BAA2B;AAIjC,IAAM,yBAAN,MAAMA,gCAA+B,uBAAO;EAClD,YACC,SAAoE;AAEpE,UAAM,OAAO;AACb,YAAI,0CAA0B,OAAO,GAAG;AACvC,WAAK,gBAAgB,CAAA;AACrB,eAAS,QAAQ,GAAG,QAAQ,+BAAiB,SAAS;AACrD,cAAM,SAAS,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AAI,4CAAqB,KAAK,GAAG,MAAM;MACrD;AACA,aAAO,MAAM,UAAS;IACvB;;IAGO,SAAM;AACZ,aAAO;QACN,GAAG,MAAM,OAAM;QACf,sBAAsB,KAAK;;IAE7B;;;;",
6
+ "names": []
7
7
  }
@@ -29,11 +29,44 @@ __export(VersionFiles_exports, {
29
29
  module.exports = __toCommonJS(VersionFiles_exports);
30
30
  var import_shared = require("@zwave-js/shared");
31
31
  var import_NVMFile = require("./NVMFile.js");
32
- var __decorate = function(decorators, target, key, desc) {
33
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
35
- 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;
36
- return c > 3 && r && Object.defineProperty(target, key, r), r;
32
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
33
+ function accept(f) {
34
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
35
+ return f;
36
+ }
37
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
38
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
39
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
40
+ var _, done = false;
41
+ for (var i = decorators.length - 1; i >= 0; i--) {
42
+ var context = {};
43
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
44
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
45
+ context.addInitializer = function(f) {
46
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
47
+ extraInitializers.push(accept(f || null));
48
+ };
49
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
50
+ if (kind === "accessor") {
51
+ if (result === void 0) continue;
52
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
53
+ if (_ = accept(result.get)) descriptor.get = _;
54
+ if (_ = accept(result.set)) descriptor.set = _;
55
+ if (_ = accept(result.init)) initializers.unshift(_);
56
+ } else if (_ = accept(result)) {
57
+ if (kind === "field") initializers.unshift(_);
58
+ else descriptor[key] = _;
59
+ }
60
+ }
61
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
62
+ done = true;
63
+ };
64
+ var __runInitializers = function(thisArg, initializers, value) {
65
+ var useValue = arguments.length > 2;
66
+ for (var i = 0; i < initializers.length; i++) {
67
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
68
+ }
69
+ return useValue ? value : void 0;
37
70
  };
38
71
  class VersionFile extends import_NVMFile.NVMFile {
39
72
  constructor(options) {
@@ -73,26 +106,68 @@ class VersionFile extends import_NVMFile.NVMFile {
73
106
  }
74
107
  }
75
108
  const ApplicationVersionFileID = 331776;
76
- let ApplicationVersionFile = class ApplicationVersionFile2 extends VersionFile {
77
- };
78
- ApplicationVersionFile = __decorate([
79
- (0, import_NVMFile.nvmFileID)(ApplicationVersionFileID),
80
- (0, import_NVMFile.nvmSection)("application")
81
- ], ApplicationVersionFile);
109
+ let ApplicationVersionFile = (() => {
110
+ let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationVersionFileID), (0, import_NVMFile.nvmSection)("application")];
111
+ let _classDescriptor;
112
+ let _classExtraInitializers = [];
113
+ let _classThis;
114
+ let _classSuper = VersionFile;
115
+ var ApplicationVersionFile2 = class extends _classSuper {
116
+ static {
117
+ _classThis = this;
118
+ }
119
+ static {
120
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
121
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
122
+ ApplicationVersionFile2 = _classThis = _classDescriptor.value;
123
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
124
+ __runInitializers(_classThis, _classExtraInitializers);
125
+ }
126
+ };
127
+ return ApplicationVersionFile2 = _classThis;
128
+ })();
82
129
  const ApplicationVersionFile800ID = 266240;
83
- let ApplicationVersionFile800 = class ApplicationVersionFile8002 extends VersionFile {
84
- };
85
- ApplicationVersionFile800 = __decorate([
86
- (0, import_NVMFile.nvmFileID)(ApplicationVersionFile800ID),
87
- (0, import_NVMFile.nvmSection)("application")
88
- ], ApplicationVersionFile800);
130
+ let ApplicationVersionFile800 = (() => {
131
+ let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationVersionFile800ID), (0, import_NVMFile.nvmSection)("application")];
132
+ let _classDescriptor;
133
+ let _classExtraInitializers = [];
134
+ let _classThis;
135
+ let _classSuper = VersionFile;
136
+ var ApplicationVersionFile8002 = class extends _classSuper {
137
+ static {
138
+ _classThis = this;
139
+ }
140
+ static {
141
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
142
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
143
+ ApplicationVersionFile8002 = _classThis = _classDescriptor.value;
144
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
145
+ __runInitializers(_classThis, _classExtraInitializers);
146
+ }
147
+ };
148
+ return ApplicationVersionFile8002 = _classThis;
149
+ })();
89
150
  const ProtocolVersionFileID = 327680;
90
- let ProtocolVersionFile = class ProtocolVersionFile2 extends VersionFile {
91
- };
92
- ProtocolVersionFile = __decorate([
93
- (0, import_NVMFile.nvmFileID)(ProtocolVersionFileID),
94
- (0, import_NVMFile.nvmSection)("protocol")
95
- ], ProtocolVersionFile);
151
+ let ProtocolVersionFile = (() => {
152
+ let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolVersionFileID), (0, import_NVMFile.nvmSection)("protocol")];
153
+ let _classDescriptor;
154
+ let _classExtraInitializers = [];
155
+ let _classThis;
156
+ let _classSuper = VersionFile;
157
+ var ProtocolVersionFile2 = class extends _classSuper {
158
+ static {
159
+ _classThis = this;
160
+ }
161
+ static {
162
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
163
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
164
+ ProtocolVersionFile2 = _classThis = _classDescriptor.value;
165
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
166
+ __runInitializers(_classThis, _classExtraInitializers);
167
+ }
168
+ };
169
+ return ProtocolVersionFile2 = _classThis;
170
+ })();
96
171
  // Annotate the CommonJS export names for ESM import in node:
97
172
  0 && (module.exports = {
98
173
  ApplicationVersionFile,
@@ -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// eslint-disable-next-line @typescript-eslint/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@nvmFileID(ProtocolVersionFileID)\n@nvmSection(\"protocol\")\nexport class ProtocolVersionFile extends VersionFile {}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAAsB;AAEtB,qBAOO;;;;;;;AASD,MAAO,oBAAoB,uBAAO;EACvC,YACC,SAA2D;AAE3D,UAAM,OAAO;AACb,YAAI,0CAA0B,OAAO,GAAG;AACvC,WAAK,SAAS,KAAK,QAAQ,CAAC;AAC5B,WAAK,QAAQ,KAAK,QAAQ,CAAC;AAC3B,WAAK,QAAQ,KAAK,QAAQ,CAAC;AAC3B,WAAK,QAAQ,KAAK,QAAQ,CAAC;IAC5B,OAAO;AACN,WAAK,SAAS,QAAQ;A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