@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.
- package/build/cjs/lib/nvm3/files/ApplicationCCsFile.js +105 -58
- package/build/cjs/lib/nvm3/files/ApplicationCCsFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationDataFile.js +69 -22
- package/build/cjs/lib/nvm3/files/ApplicationDataFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationNameFile.js +71 -24
- package/build/cjs/lib/nvm3/files/ApplicationNameFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js +140 -93
- package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js +92 -45
- package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ControllerInfoFile.js +176 -129
- package/build/cjs/lib/nvm3/files/ControllerInfoFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/NVMFile.d.ts +3 -3
- package/build/cjs/lib/nvm3/files/NVMFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/NodeInfoFiles.js +186 -111
- package/build/cjs/lib/nvm3/files/NodeInfoFiles.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js +243 -84
- package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +2 -2
- package/build/cjs/lib/nvm3/files/RouteCacheFiles.js +143 -82
- package/build/cjs/lib/nvm3/files/RouteCacheFiles.js.map +2 -2
- package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js +134 -73
- package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/VersionFiles.js +98 -23
- package/build/cjs/lib/nvm3/files/VersionFiles.js.map +2 -2
- package/build/esm/lib/nvm3/files/ApplicationCCsFile.js +106 -66
- package/build/esm/lib/nvm3/files/ApplicationCCsFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationDataFile.js +63 -23
- package/build/esm/lib/nvm3/files/ApplicationDataFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationNameFile.js +66 -26
- package/build/esm/lib/nvm3/files/ApplicationNameFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js +137 -97
- package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationTypeFile.js +87 -47
- package/build/esm/lib/nvm3/files/ApplicationTypeFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ControllerInfoFile.js +172 -132
- package/build/esm/lib/nvm3/files/ControllerInfoFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/NVMFile.d.ts +3 -3
- package/build/esm/lib/nvm3/files/NVMFile.d.ts.map +1 -1
- package/build/esm/lib/nvm3/files/NodeInfoFiles.js +191 -127
- package/build/esm/lib/nvm3/files/NodeInfoFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js +221 -85
- package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/RouteCacheFiles.js +143 -91
- package/build/esm/lib/nvm3/files/RouteCacheFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js +126 -74
- package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/VersionFiles.js +87 -23
- package/build/esm/lib/nvm3/files/VersionFiles.js.map +1 -1
- package/package.json +3 -3
|
@@ -41,11 +41,44 @@ __export(ProtocolNodeMaskFiles_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(ProtocolNodeMaskFiles_exports);
|
|
42
42
|
var import_safe = require("@zwave-js/core/safe");
|
|
43
43
|
var import_NVMFile = require("./NVMFile.js");
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
45
|
+
function accept(f) {
|
|
46
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
47
|
+
return f;
|
|
48
|
+
}
|
|
49
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
50
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
51
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
52
|
+
var _, done = false;
|
|
53
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
54
|
+
var context = {};
|
|
55
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
56
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
57
|
+
context.addInitializer = function(f) {
|
|
58
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
59
|
+
extraInitializers.push(accept(f || null));
|
|
60
|
+
};
|
|
61
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
62
|
+
if (kind === "accessor") {
|
|
63
|
+
if (result === void 0) continue;
|
|
64
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
65
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
66
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
67
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
68
|
+
} else if (_ = accept(result)) {
|
|
69
|
+
if (kind === "field") initializers.unshift(_);
|
|
70
|
+
else descriptor[key] = _;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
74
|
+
done = true;
|
|
75
|
+
};
|
|
76
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
77
|
+
var useValue = arguments.length > 2;
|
|
78
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
79
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
80
|
+
}
|
|
81
|
+
return useValue ? value : void 0;
|
|
49
82
|
};
|
|
50
83
|
class ProtocolNodeMaskFile extends import_NVMFile.NVMFile {
|
|
51
84
|
constructor(options) {
|
|
@@ -76,94 +109,220 @@ class ProtocolNodeMaskFile extends import_NVMFile.NVMFile {
|
|
|
76
109
|
}
|
|
77
110
|
}
|
|
78
111
|
const ProtocolPreferredRepeatersFileID = 327682;
|
|
79
|
-
let ProtocolPreferredRepeatersFile =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
112
|
+
let ProtocolPreferredRepeatersFile = (() => {
|
|
113
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolPreferredRepeatersFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
114
|
+
let _classDescriptor;
|
|
115
|
+
let _classExtraInitializers = [];
|
|
116
|
+
let _classThis;
|
|
117
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
118
|
+
var ProtocolPreferredRepeatersFile2 = class extends _classSuper {
|
|
119
|
+
static {
|
|
120
|
+
_classThis = this;
|
|
121
|
+
}
|
|
122
|
+
static {
|
|
123
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
124
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
125
|
+
ProtocolPreferredRepeatersFile2 = _classThis = _classDescriptor.value;
|
|
126
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
127
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
return ProtocolPreferredRepeatersFile2 = _classThis;
|
|
131
|
+
})();
|
|
85
132
|
const ProtocolNodeListFileID = 327685;
|
|
86
|
-
let ProtocolNodeListFile =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
133
|
+
let ProtocolNodeListFile = (() => {
|
|
134
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolNodeListFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
135
|
+
let _classDescriptor;
|
|
136
|
+
let _classExtraInitializers = [];
|
|
137
|
+
let _classThis;
|
|
138
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
139
|
+
var ProtocolNodeListFile2 = class extends _classSuper {
|
|
140
|
+
static {
|
|
141
|
+
_classThis = this;
|
|
142
|
+
}
|
|
143
|
+
static {
|
|
144
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
145
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
146
|
+
ProtocolNodeListFile2 = _classThis = _classDescriptor.value;
|
|
147
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
148
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
return ProtocolNodeListFile2 = _classThis;
|
|
152
|
+
})();
|
|
92
153
|
const ProtocolAppRouteLockNodeMaskFileID = 327686;
|
|
93
|
-
let ProtocolAppRouteLockNodeMaskFile =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
154
|
+
let ProtocolAppRouteLockNodeMaskFile = (() => {
|
|
155
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolAppRouteLockNodeMaskFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
156
|
+
let _classDescriptor;
|
|
157
|
+
let _classExtraInitializers = [];
|
|
158
|
+
let _classThis;
|
|
159
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
160
|
+
var ProtocolAppRouteLockNodeMaskFile2 = class extends _classSuper {
|
|
161
|
+
static {
|
|
162
|
+
_classThis = this;
|
|
163
|
+
}
|
|
164
|
+
static {
|
|
165
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
166
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
167
|
+
ProtocolAppRouteLockNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
168
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
169
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
return ProtocolAppRouteLockNodeMaskFile2 = _classThis;
|
|
173
|
+
})();
|
|
99
174
|
const ProtocolRouteSlaveSUCNodeMaskFileID = 327687;
|
|
100
|
-
let ProtocolRouteSlaveSUCNodeMaskFile =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
175
|
+
let ProtocolRouteSlaveSUCNodeMaskFile = (() => {
|
|
176
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolRouteSlaveSUCNodeMaskFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
177
|
+
let _classDescriptor;
|
|
178
|
+
let _classExtraInitializers = [];
|
|
179
|
+
let _classThis;
|
|
180
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
181
|
+
var ProtocolRouteSlaveSUCNodeMaskFile2 = class extends _classSuper {
|
|
182
|
+
static {
|
|
183
|
+
_classThis = this;
|
|
184
|
+
}
|
|
185
|
+
static {
|
|
186
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
187
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
188
|
+
ProtocolRouteSlaveSUCNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
189
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
190
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
return ProtocolRouteSlaveSUCNodeMaskFile2 = _classThis;
|
|
194
|
+
})();
|
|
106
195
|
const ProtocolSUCPendingUpdateNodeMaskFileID = 327688;
|
|
107
|
-
let ProtocolSUCPendingUpdateNodeMaskFile =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
196
|
+
let ProtocolSUCPendingUpdateNodeMaskFile = (() => {
|
|
197
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolSUCPendingUpdateNodeMaskFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
198
|
+
let _classDescriptor;
|
|
199
|
+
let _classExtraInitializers = [];
|
|
200
|
+
let _classThis;
|
|
201
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
202
|
+
var ProtocolSUCPendingUpdateNodeMaskFile2 = class extends _classSuper {
|
|
203
|
+
static {
|
|
204
|
+
_classThis = this;
|
|
205
|
+
}
|
|
206
|
+
static {
|
|
207
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
208
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
209
|
+
ProtocolSUCPendingUpdateNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
210
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
211
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
return ProtocolSUCPendingUpdateNodeMaskFile2 = _classThis;
|
|
215
|
+
})();
|
|
113
216
|
const ProtocolVirtualNodeMaskFileID = 327689;
|
|
114
|
-
let ProtocolVirtualNodeMaskFile =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
217
|
+
let ProtocolVirtualNodeMaskFile = (() => {
|
|
218
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolVirtualNodeMaskFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
219
|
+
let _classDescriptor;
|
|
220
|
+
let _classExtraInitializers = [];
|
|
221
|
+
let _classThis;
|
|
222
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
223
|
+
var ProtocolVirtualNodeMaskFile2 = class extends _classSuper {
|
|
224
|
+
static {
|
|
225
|
+
_classThis = this;
|
|
226
|
+
}
|
|
227
|
+
static {
|
|
228
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
229
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
230
|
+
ProtocolVirtualNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
231
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
232
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
return ProtocolVirtualNodeMaskFile2 = _classThis;
|
|
236
|
+
})();
|
|
120
237
|
const ProtocolPendingDiscoveryNodeMaskFileID = 327690;
|
|
121
|
-
let ProtocolPendingDiscoveryNodeMaskFile =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
238
|
+
let ProtocolPendingDiscoveryNodeMaskFile = (() => {
|
|
239
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolPendingDiscoveryNodeMaskFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
240
|
+
let _classDescriptor;
|
|
241
|
+
let _classExtraInitializers = [];
|
|
242
|
+
let _classThis;
|
|
243
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
244
|
+
var ProtocolPendingDiscoveryNodeMaskFile2 = class extends _classSuper {
|
|
245
|
+
static {
|
|
246
|
+
_classThis = this;
|
|
247
|
+
}
|
|
248
|
+
static {
|
|
249
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
250
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
251
|
+
ProtocolPendingDiscoveryNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
252
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
253
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
return ProtocolPendingDiscoveryNodeMaskFile2 = _classThis;
|
|
257
|
+
})();
|
|
127
258
|
const ProtocolRouteCacheExistsNodeMaskFileID = 327691;
|
|
128
|
-
let ProtocolRouteCacheExistsNodeMaskFile =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
259
|
+
let ProtocolRouteCacheExistsNodeMaskFile = (() => {
|
|
260
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolRouteCacheExistsNodeMaskFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
261
|
+
let _classDescriptor;
|
|
262
|
+
let _classExtraInitializers = [];
|
|
263
|
+
let _classThis;
|
|
264
|
+
let _classSuper = ProtocolNodeMaskFile;
|
|
265
|
+
var ProtocolRouteCacheExistsNodeMaskFile2 = class extends _classSuper {
|
|
266
|
+
static {
|
|
267
|
+
_classThis = this;
|
|
268
|
+
}
|
|
269
|
+
static {
|
|
270
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
271
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
272
|
+
ProtocolRouteCacheExistsNodeMaskFile2 = _classThis = _classDescriptor.value;
|
|
273
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
274
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
return ProtocolRouteCacheExistsNodeMaskFile2 = _classThis;
|
|
278
|
+
})();
|
|
134
279
|
const ProtocolLRNodeListFileID = 327692;
|
|
135
|
-
let ProtocolLRNodeListFile =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
280
|
+
let ProtocolLRNodeListFile = (() => {
|
|
281
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolLRNodeListFileID), (0, import_NVMFile.nvmSection)("protocol")];
|
|
282
|
+
let _classDescriptor;
|
|
283
|
+
let _classExtraInitializers = [];
|
|
284
|
+
let _classThis;
|
|
285
|
+
let _classSuper = import_NVMFile.NVMFile;
|
|
286
|
+
var ProtocolLRNodeListFile2 = class extends _classSuper {
|
|
287
|
+
static {
|
|
288
|
+
_classThis = this;
|
|
142
289
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
],
|
|
290
|
+
static {
|
|
291
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
292
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
293
|
+
ProtocolLRNodeListFile2 = _classThis = _classDescriptor.value;
|
|
294
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
295
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
296
|
+
}
|
|
297
|
+
constructor(options) {
|
|
298
|
+
super(options);
|
|
299
|
+
if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
300
|
+
this.nodeIdSet = new Set((0, import_safe.parseBitMask)(this.payload, 256));
|
|
301
|
+
} else {
|
|
302
|
+
this.nodeIdSet = new Set(options.nodeIds);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
nodeIdSet;
|
|
306
|
+
get nodeIds() {
|
|
307
|
+
return [...this.nodeIdSet];
|
|
308
|
+
}
|
|
309
|
+
set nodeIds(value) {
|
|
310
|
+
this.nodeIdSet = new Set(value);
|
|
311
|
+
}
|
|
312
|
+
serialize() {
|
|
313
|
+
this.payload = (0, import_safe.encodeBitMask)([...this.nodeIdSet], 1279, 256);
|
|
314
|
+
return super.serialize();
|
|
315
|
+
}
|
|
316
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
317
|
+
toJSON() {
|
|
318
|
+
return {
|
|
319
|
+
...super.toJSON(),
|
|
320
|
+
"node IDs": [...this.nodeIdSet].join(", ")
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
return ProtocolLRNodeListFile2 = _classThis;
|
|
325
|
+
})();
|
|
167
326
|
// Annotate the CommonJS export names for ESM import in node:
|
|
168
327
|
0 && (module.exports = {
|
|
169
328
|
ProtocolAppRouteLockNodeMaskFile,
|
|
@@ -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/safe\";\nimport { type Bytes } from \"@zwave-js/shared/safe\";\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// 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\"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// 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\"node IDs\": [...this.nodeIdSet].join(\", \"),\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAyD;AAGzD,qBAOO
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAyD;AAGzD,qBAOO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMD,MAAO,6BAA6B,uBAAO;EAChD,YACC,SAA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core/safe");
|
|
|
31
31
|
var import_safe2 = require("@zwave-js/shared/safe");
|
|
32
32
|
var import_routeCache = require("../../common/routeCache.js");
|
|
33
33
|
var import_NVMFile = require("./NVMFile.js");
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 ROUTECACHES_PER_FILE_V1 = 8;
|
|
41
74
|
const RouteCacheFileV0IDBase = 328704;
|
|
42
75
|
function nodeIdToRouteCacheFileIDV0(nodeId) {
|
|
43
76
|
return RouteCacheFileV0IDBase + nodeId - 1;
|
|
44
77
|
}
|
|
45
|
-
let RouteCacheFileV0 =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.routeCache = options.routeCache;
|
|
78
|
+
let RouteCacheFileV0 = (() => {
|
|
79
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)((id) => id >= RouteCacheFileV0IDBase && id < RouteCacheFileV0IDBase + import_safe.MAX_NODES), (0, import_NVMFile.nvmSection)("protocol")];
|
|
80
|
+
let _classDescriptor;
|
|
81
|
+
let _classExtraInitializers = [];
|
|
82
|
+
let _classThis;
|
|
83
|
+
let _classSuper = import_NVMFile.NVMFile;
|
|
84
|
+
var RouteCacheFileV02 = class extends _classSuper {
|
|
85
|
+
static {
|
|
86
|
+
_classThis = this;
|
|
55
87
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
static {
|
|
89
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
90
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
91
|
+
RouteCacheFileV02 = _classThis = _classDescriptor.value;
|
|
92
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
93
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
94
|
+
}
|
|
95
|
+
constructor(options) {
|
|
96
|
+
super(options);
|
|
97
|
+
if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
98
|
+
const nodeId = this.fileId - RouteCacheFileV0IDBase + 1;
|
|
99
|
+
const lwr = (0, import_routeCache.parseRoute)(this.payload, 0);
|
|
100
|
+
const nlwr = (0, import_routeCache.parseRoute)(this.payload, import_safe.MAX_REPEATERS + 1);
|
|
101
|
+
this.routeCache = { nodeId, lwr, nlwr };
|
|
102
|
+
} else {
|
|
103
|
+
this.routeCache = options.routeCache;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
routeCache;
|
|
107
|
+
serialize() {
|
|
108
|
+
this.fileId = nodeIdToRouteCacheFileIDV0(this.routeCache.nodeId);
|
|
109
|
+
this.payload = import_safe2.Bytes.concat([
|
|
110
|
+
(0, import_routeCache.encodeRoute)(this.routeCache.lwr),
|
|
111
|
+
(0, import_routeCache.encodeRoute)(this.routeCache.nlwr)
|
|
112
|
+
]);
|
|
113
|
+
return super.serialize();
|
|
114
|
+
}
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
116
|
+
toJSON() {
|
|
117
|
+
return {
|
|
118
|
+
...super.toJSON(),
|
|
119
|
+
routeCache: this.routeCache
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return RouteCacheFileV02 = _classThis;
|
|
124
|
+
})();
|
|
78
125
|
const RouteCacheFileV1IDBase = 332800;
|
|
79
126
|
function nodeIdToRouteCacheFileIDV1(nodeId) {
|
|
80
127
|
return RouteCacheFileV1IDBase + Math.floor((nodeId - 1) / ROUTECACHES_PER_FILE_V1);
|
|
81
128
|
}
|
|
82
|
-
let RouteCacheFileV1 =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
129
|
+
let RouteCacheFileV1 = (() => {
|
|
130
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)((id) => id >= RouteCacheFileV1IDBase && id < RouteCacheFileV1IDBase + import_safe.MAX_NODES / ROUTECACHES_PER_FILE_V1), (0, import_NVMFile.nvmSection)("protocol")];
|
|
131
|
+
let _classDescriptor;
|
|
132
|
+
let _classExtraInitializers = [];
|
|
133
|
+
let _classThis;
|
|
134
|
+
let _classSuper = import_NVMFile.NVMFile;
|
|
135
|
+
var RouteCacheFileV12 = class extends _classSuper {
|
|
136
|
+
static {
|
|
137
|
+
_classThis = this;
|
|
138
|
+
}
|
|
139
|
+
static {
|
|
140
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
141
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
142
|
+
RouteCacheFileV12 = _classThis = _classDescriptor.value;
|
|
143
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
144
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
145
|
+
}
|
|
146
|
+
constructor(options) {
|
|
147
|
+
super(options);
|
|
148
|
+
if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
149
|
+
this.routeCaches = [];
|
|
150
|
+
for (let i = 0; i < ROUTECACHES_PER_FILE_V1; i++) {
|
|
151
|
+
const offset = i * 2 * (import_safe.MAX_REPEATERS + 1);
|
|
152
|
+
const entry = this.payload.subarray(offset, offset + 2 * (import_safe.MAX_REPEATERS + 1));
|
|
153
|
+
if (entry.equals(import_routeCache.emptyRouteCache))
|
|
154
|
+
continue;
|
|
155
|
+
const nodeId = (this.fileId - RouteCacheFileV1IDBase) * ROUTECACHES_PER_FILE_V1 + 1 + i;
|
|
156
|
+
const lwr = (0, import_routeCache.parseRoute)(this.payload, offset);
|
|
157
|
+
const nlwr = (0, import_routeCache.parseRoute)(this.payload, offset + import_safe.MAX_REPEATERS + 1);
|
|
158
|
+
this.routeCaches.push({ nodeId, lwr, nlwr });
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
this.routeCaches = options.routeCaches;
|
|
96
162
|
}
|
|
97
|
-
} else {
|
|
98
|
-
this.routeCaches = options.routeCaches;
|
|
99
163
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
164
|
+
routeCaches;
|
|
165
|
+
serialize() {
|
|
166
|
+
this.routeCaches.sort((a, b) => a.nodeId - b.nodeId);
|
|
167
|
+
const minNodeId = this.routeCaches[0].nodeId;
|
|
168
|
+
this.fileId = nodeIdToRouteCacheFileIDV1(minNodeId);
|
|
169
|
+
this.payload = new import_safe2.Bytes(ROUTECACHES_PER_FILE_V1 * import_routeCache.ROUTECACHE_SIZE).fill(import_routeCache.EMPTY_ROUTECACHE_FILL);
|
|
170
|
+
const minFileNodeId = Math.floor((minNodeId - 1) / ROUTECACHES_PER_FILE_V1) * ROUTECACHES_PER_FILE_V1 + 1;
|
|
171
|
+
for (const routeCache of this.routeCaches) {
|
|
172
|
+
const offset = (routeCache.nodeId - minFileNodeId) * import_routeCache.ROUTECACHE_SIZE;
|
|
173
|
+
const routes = import_safe2.Bytes.concat([
|
|
174
|
+
(0, import_routeCache.encodeRoute)(routeCache.lwr),
|
|
175
|
+
(0, import_routeCache.encodeRoute)(routeCache.nlwr)
|
|
176
|
+
]);
|
|
177
|
+
this.payload.set(routes, offset);
|
|
178
|
+
}
|
|
179
|
+
return super.serialize();
|
|
115
180
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
RouteCacheFileV1 = __decorate([
|
|
127
|
-
(0, import_NVMFile.nvmFileID)((id) => id >= RouteCacheFileV1IDBase && id < RouteCacheFileV1IDBase + import_safe.MAX_NODES / ROUTECACHES_PER_FILE_V1),
|
|
128
|
-
(0, import_NVMFile.nvmSection)("protocol")
|
|
129
|
-
], RouteCacheFileV1);
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
182
|
+
toJSON() {
|
|
183
|
+
return {
|
|
184
|
+
...super.toJSON(),
|
|
185
|
+
"route caches": this.routeCaches
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return RouteCacheFileV12 = _classThis;
|
|
190
|
+
})();
|
|
130
191
|
// Annotate the CommonJS export names for ESM import in node:
|
|
131
192
|
0 && (module.exports = {
|
|
132
193
|
ROUTECACHES_PER_FILE_V1,
|