@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
|
@@ -25,70 +25,117 @@ module.exports = __toCommonJS(ApplicationCCsFile_exports);
|
|
|
25
25
|
var import_safe = require("@zwave-js/core/safe");
|
|
26
26
|
var import_safe2 = require("@zwave-js/shared/safe");
|
|
27
27
|
var import_NVMFile = require("./NVMFile.js");
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
29
|
+
function accept(f) {
|
|
30
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
31
|
+
return f;
|
|
32
|
+
}
|
|
33
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
34
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
35
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
36
|
+
var _, done = false;
|
|
37
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
38
|
+
var context = {};
|
|
39
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
40
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
41
|
+
context.addInitializer = function(f) {
|
|
42
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
43
|
+
extraInitializers.push(accept(f || null));
|
|
44
|
+
};
|
|
45
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
46
|
+
if (kind === "accessor") {
|
|
47
|
+
if (result === void 0) continue;
|
|
48
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
49
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
50
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
51
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
52
|
+
} else if (_ = accept(result)) {
|
|
53
|
+
if (kind === "field") initializers.unshift(_);
|
|
54
|
+
else descriptor[key] = _;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
58
|
+
done = true;
|
|
59
|
+
};
|
|
60
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
61
|
+
var useValue = arguments.length > 2;
|
|
62
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
63
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
64
|
+
}
|
|
65
|
+
return useValue ? value : void 0;
|
|
33
66
|
};
|
|
34
67
|
const MAX_CCs = 35;
|
|
35
68
|
const ApplicationCCsFileID = 103;
|
|
36
|
-
let ApplicationCCsFile =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
69
|
+
let ApplicationCCsFile = (() => {
|
|
70
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationCCsFileID), (0, import_NVMFile.nvmSection)("application")];
|
|
71
|
+
let _classDescriptor;
|
|
72
|
+
let _classExtraInitializers = [];
|
|
73
|
+
let _classThis;
|
|
74
|
+
let _classSuper = import_NVMFile.NVMFile;
|
|
75
|
+
var ApplicationCCsFile2 = class extends _classSuper {
|
|
76
|
+
static {
|
|
77
|
+
_classThis = this;
|
|
78
|
+
}
|
|
79
|
+
static {
|
|
80
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
81
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
82
|
+
ApplicationCCsFile2 = _classThis = _classDescriptor.value;
|
|
83
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
84
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
85
|
+
}
|
|
86
|
+
constructor(options) {
|
|
87
|
+
super(options);
|
|
88
|
+
if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
89
|
+
let offset = 0;
|
|
90
|
+
let numCCs = this.payload[offset];
|
|
91
|
+
this.includedInsecurely = [
|
|
92
|
+
...this.payload.subarray(offset + 1, offset + 1 + numCCs)
|
|
93
|
+
];
|
|
94
|
+
offset += MAX_CCs;
|
|
95
|
+
numCCs = this.payload[offset];
|
|
96
|
+
this.includedSecurelyInsecureCCs = [
|
|
97
|
+
...this.payload.subarray(offset + 1, offset + 1 + numCCs)
|
|
98
|
+
];
|
|
99
|
+
offset += MAX_CCs;
|
|
100
|
+
numCCs = this.payload[offset];
|
|
101
|
+
this.includedSecurelySecureCCs = [
|
|
102
|
+
...this.payload.subarray(offset + 1, offset + 1 + numCCs)
|
|
103
|
+
];
|
|
104
|
+
} else {
|
|
105
|
+
this.includedInsecurely = options.includedInsecurely;
|
|
106
|
+
this.includedSecurelyInsecureCCs = options.includedSecurelyInsecureCCs;
|
|
107
|
+
this.includedSecurelySecureCCs = options.includedSecurelySecureCCs;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
includedInsecurely;
|
|
111
|
+
includedSecurelyInsecureCCs;
|
|
112
|
+
includedSecurelySecureCCs;
|
|
113
|
+
serialize() {
|
|
114
|
+
this.payload = new import_safe2.Bytes((1 + MAX_CCs) * 3);
|
|
40
115
|
let offset = 0;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
numCCs = this.payload[offset];
|
|
52
|
-
this.includedSecurelySecureCCs = [
|
|
53
|
-
...this.payload.subarray(offset + 1, offset + 1 + numCCs)
|
|
54
|
-
];
|
|
55
|
-
} else {
|
|
56
|
-
this.includedInsecurely = options.includedInsecurely;
|
|
57
|
-
this.includedSecurelyInsecureCCs = options.includedSecurelyInsecureCCs;
|
|
58
|
-
this.includedSecurelySecureCCs = options.includedSecurelySecureCCs;
|
|
116
|
+
for (const array of [
|
|
117
|
+
this.includedInsecurely,
|
|
118
|
+
this.includedSecurelyInsecureCCs,
|
|
119
|
+
this.includedSecurelySecureCCs
|
|
120
|
+
]) {
|
|
121
|
+
this.payload[offset] = array.length;
|
|
122
|
+
this.payload.set(array, offset + 1);
|
|
123
|
+
offset += 1 + MAX_CCs;
|
|
124
|
+
}
|
|
125
|
+
return super.serialize();
|
|
59
126
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.includedInsecurely,
|
|
69
|
-
this.includedSecurelyInsecureCCs,
|
|
70
|
-
this.includedSecurelySecureCCs
|
|
71
|
-
]) {
|
|
72
|
-
this.payload[offset] = array.length;
|
|
73
|
-
this.payload.set(array, offset + 1);
|
|
74
|
-
offset += 1 + MAX_CCs;
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
128
|
+
toJSON() {
|
|
129
|
+
return {
|
|
130
|
+
...super.toJSON(),
|
|
131
|
+
"included insecurely": this.includedInsecurely.map((cc) => import_safe.CommandClasses[cc]).join(", "),
|
|
132
|
+
"included securely (insecure)": this.includedSecurelyInsecureCCs.map((cc) => import_safe.CommandClasses[cc]).join(", "),
|
|
133
|
+
"included securely (secure)": this.includedSecurelySecureCCs.map((cc) => import_safe.CommandClasses[cc]).join(", ")
|
|
134
|
+
};
|
|
75
135
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
toJSON() {
|
|
80
|
-
return {
|
|
81
|
-
...super.toJSON(),
|
|
82
|
-
"included insecurely": this.includedInsecurely.map((cc) => import_safe.CommandClasses[cc]).join(", "),
|
|
83
|
-
"included securely (insecure)": this.includedSecurelyInsecureCCs.map((cc) => import_safe.CommandClasses[cc]).join(", "),
|
|
84
|
-
"included securely (secure)": this.includedSecurelySecureCCs.map((cc) => import_safe.CommandClasses[cc]).join(", ")
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
ApplicationCCsFile = __decorate([
|
|
89
|
-
(0, import_NVMFile.nvmFileID)(ApplicationCCsFileID),
|
|
90
|
-
(0, import_NVMFile.nvmSection)("application")
|
|
91
|
-
], ApplicationCCsFile);
|
|
136
|
+
};
|
|
137
|
+
return ApplicationCCsFile2 = _classThis;
|
|
138
|
+
})();
|
|
92
139
|
// Annotate the CommonJS export names for ESM import in node:
|
|
93
140
|
0 && (module.exports = {
|
|
94
141
|
ApplicationCCsFile,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/ApplicationCCsFile.ts"],
|
|
4
4
|
"sourcesContent": ["import { CommandClasses } from \"@zwave-js/core/safe\";\nimport { 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 ApplicationCCsFileOptions extends NVMFileCreationOptions {\n\tincludedInsecurely: CommandClasses[];\n\tincludedSecurelyInsecureCCs: CommandClasses[];\n\tincludedSecurelySecureCCs: CommandClasses[];\n}\n\nconst MAX_CCs = 35;\n\nexport const ApplicationCCsFileID = 103;\n\n@nvmFileID(ApplicationCCsFileID)\n@nvmSection(\"application\")\nexport class ApplicationCCsFile extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | ApplicationCCsFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tlet offset = 0;\n\t\t\tlet numCCs = this.payload[offset];\n\t\t\tthis.includedInsecurely = [\n\t\t\t\t...this.payload.subarray(offset + 1, offset + 1 + numCCs),\n\t\t\t];\n\t\t\toffset += MAX_CCs;\n\n\t\t\tnumCCs = this.payload[offset];\n\t\t\tthis.includedSecurelyInsecureCCs = [\n\t\t\t\t...this.payload.subarray(offset + 1, offset + 1 + numCCs),\n\t\t\t];\n\t\t\toffset += MAX_CCs;\n\t\t\tnumCCs = this.payload[offset];\n\t\t\tthis.includedSecurelySecureCCs = [\n\t\t\t\t...this.payload.subarray(offset + 1, offset + 1 + numCCs),\n\t\t\t];\n\t\t} else {\n\t\t\tthis.includedInsecurely = options.includedInsecurely;\n\t\t\tthis.includedSecurelyInsecureCCs =\n\t\t\t\toptions.includedSecurelyInsecureCCs;\n\t\t\tthis.includedSecurelySecureCCs = options.includedSecurelySecureCCs;\n\t\t}\n\t}\n\n\tpublic includedInsecurely: CommandClasses[];\n\tpublic includedSecurelyInsecureCCs: CommandClasses[];\n\tpublic includedSecurelySecureCCs: CommandClasses[];\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\tthis.payload = new Bytes((1 + MAX_CCs) * 3);\n\t\tlet offset = 0;\n\t\tfor (\n\t\t\tconst array of [\n\t\t\t\tthis.includedInsecurely,\n\t\t\t\tthis.includedSecurelyInsecureCCs,\n\t\t\t\tthis.includedSecurelySecureCCs,\n\t\t\t]\n\t\t) {\n\t\t\tthis.payload[offset] = array.length;\n\t\t\tthis.payload.set(array, offset + 1);\n\t\t\toffset += 1 + MAX_CCs;\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\"included insecurely\": this.includedInsecurely\n\t\t\t\t.map((cc) => CommandClasses[cc])\n\t\t\t\t.join(\", \"),\n\t\t\t\"included securely (insecure)\": this.includedSecurelyInsecureCCs\n\t\t\t\t.map((cc) => CommandClasses[cc])\n\t\t\t\t.join(\", \"),\n\t\t\t\"included securely (secure)\": this.includedSecurelySecureCCs\n\t\t\t\t.map((cc) => CommandClasses[cc])\n\t\t\t\t.join(\", \"),\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAA+B;AAC/B,IAAAA,eAAsB;AAEtB,qBAOO
|
|
6
|
-
"names": ["import_safe"
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAA+B;AAC/B,IAAAA,eAAsB;AAEtB,qBAOO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQP,MAAM,UAAU;AAET,MAAM,uBAAuB;IAIvB,sBAAkB,MAAA;8BAF9B,0BAAU,oBAAoB,OAC9B,2BAAW,aAAa,CAAC;;;;oBACc;0CAAA,YAAO;;;;;;AAA/C,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAAkE;AAElE,YAAM,OAAO;AACb,cAAI,0CAA0B,OAAO,GAAG;AACvC,YAAI,SAAS;AACb,YAAI,SAAS,KAAK,QAAQ,MAAM;AAChC,aAAK,qBAAqB;UACzB,GAAG,KAAK,QAAQ,SAAS,SAAS,GAAG,SAAS,IAAI,MAAM;;AAEzD,kBAAU;AAEV,iBAAS,KAAK,QAAQ,MAAM;AAC5B,aAAK,8BAA8B;UAClC,GAAG,KAAK,QAAQ,SAAS,SAAS,GAAG,SAAS,IAAI,MAAM;;AAEzD,kBAAU;AACV,iBAAS,KAAK,QAAQ,MAAM;AAC5B,aAAK,4BAA4B;UAChC,GAAG,KAAK,QAAQ,SAAS,SAAS,GAAG,SAAS,IAAI,MAAM;;MAE1D,OAAO;AACN,aAAK,qBAAqB,QAAQ;AAClC,aAAK,8BACJ,QAAQ;AACT,aAAK,4BAA4B,QAAQ;MAC1C;IACD;IAEO;IACA;IACA;IAEA,YAAS;AACf,WAAK,UAAU,IAAI,oBAAO,IAAI,WAAW,CAAC;AAC1C,UAAI,SAAS;AACb,iBACO,SAAS;QACd,KAAK;QACL,KAAK;QACL,KAAK;SAEL;AACD,aAAK,QAAQ,MAAM,IAAI,MAAM;AAC7B,aAAK,QAAQ,IAAI,OAAO,SAAS,CAAC;AAClC,kBAAU,IAAI;MACf;AACA,aAAO,MAAM,UAAS;IACvB;;IAGO,SAAM;AACZ,aAAO;QACN,GAAG,MAAM,OAAM;QACf,uBAAuB,KAAK,mBAC1B,IAAI,CAAC,OAAO,2BAAe,EAAE,CAAC,EAC9B,KAAK,IAAI;QACX,gCAAgC,KAAK,4BACnC,IAAI,CAAC,OAAO,2BAAe,EAAE,CAAC,EAC9B,KAAK,IAAI;QACX,8BAA8B,KAAK,0BACjC,IAAI,CAAC,OAAO,2BAAe,EAAE,CAAC,EAC9B,KAAK,IAAI;;IAEb;;;;",
|
|
6
|
+
"names": ["import_safe"]
|
|
7
7
|
}
|
|
@@ -23,32 +23,79 @@ __export(ApplicationDataFile_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(ApplicationDataFile_exports);
|
|
25
25
|
var import_NVMFile = require("./NVMFile.js");
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
-
};
|
|
32
|
-
const ApplicationDataFileID = 200;
|
|
33
|
-
let ApplicationDataFile = class ApplicationDataFile2 extends import_NVMFile.NVMFile {
|
|
34
|
-
constructor(options) {
|
|
35
|
-
super(options);
|
|
36
|
-
if (!(0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
37
|
-
this.payload = options.applicationData;
|
|
38
|
-
}
|
|
26
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
27
|
+
function accept(f) {
|
|
28
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
29
|
+
return f;
|
|
39
30
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
32
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
33
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
34
|
+
var _, done = false;
|
|
35
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
36
|
+
var context = {};
|
|
37
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
38
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
39
|
+
context.addInitializer = function(f) {
|
|
40
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
41
|
+
extraInitializers.push(accept(f || null));
|
|
42
|
+
};
|
|
43
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
44
|
+
if (kind === "accessor") {
|
|
45
|
+
if (result === void 0) continue;
|
|
46
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
47
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
48
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
49
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
50
|
+
} else if (_ = accept(result)) {
|
|
51
|
+
if (kind === "field") initializers.unshift(_);
|
|
52
|
+
else descriptor[key] = _;
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
56
|
+
done = true;
|
|
57
|
+
};
|
|
58
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
59
|
+
var useValue = arguments.length > 2;
|
|
60
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
61
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
46
62
|
}
|
|
63
|
+
return useValue ? value : void 0;
|
|
47
64
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(0, import_NVMFile.nvmSection)("application")
|
|
51
|
-
|
|
65
|
+
const ApplicationDataFileID = 200;
|
|
66
|
+
let ApplicationDataFile = (() => {
|
|
67
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationDataFileID), (0, import_NVMFile.nvmSection)("application")];
|
|
68
|
+
let _classDescriptor;
|
|
69
|
+
let _classExtraInitializers = [];
|
|
70
|
+
let _classThis;
|
|
71
|
+
let _classSuper = import_NVMFile.NVMFile;
|
|
72
|
+
var ApplicationDataFile2 = class extends _classSuper {
|
|
73
|
+
static {
|
|
74
|
+
_classThis = this;
|
|
75
|
+
}
|
|
76
|
+
static {
|
|
77
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
78
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
79
|
+
ApplicationDataFile2 = _classThis = _classDescriptor.value;
|
|
80
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
81
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
82
|
+
}
|
|
83
|
+
constructor(options) {
|
|
84
|
+
super(options);
|
|
85
|
+
if (!(0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
86
|
+
this.payload = options.applicationData;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Just binary data
|
|
90
|
+
get applicationData() {
|
|
91
|
+
return this.payload;
|
|
92
|
+
}
|
|
93
|
+
set applicationData(value) {
|
|
94
|
+
this.payload = value;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return ApplicationDataFile2 = _classThis;
|
|
98
|
+
})();
|
|
52
99
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
100
|
0 && (module.exports = {
|
|
54
101
|
ApplicationDataFile,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/ApplicationDataFile.ts"],
|
|
4
4
|
"sourcesContent": ["import { type Bytes } from \"@zwave-js/shared/safe\";\nimport {\n\tNVMFile,\n\ttype NVMFileCreationOptions,\n\ttype NVMFileDeserializationOptions,\n\tgotDeserializationOptions,\n\tnvmFileID,\n\tnvmSection,\n} from \"./NVMFile.js\";\n\nexport interface ApplicationDataFileOptions extends NVMFileCreationOptions {\n\tapplicationData: Bytes;\n}\n\nexport const ApplicationDataFileID = 200;\n\n@nvmFileID(ApplicationDataFileID)\n@nvmSection(\"application\")\nexport class ApplicationDataFile extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | ApplicationDataFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (!gotDeserializationOptions(options)) {\n\t\t\tthis.payload = options.applicationData;\n\t\t}\n\t}\n\n\t// Just binary data\n\tpublic get applicationData(): Bytes {\n\t\treturn this.payload;\n\t}\n\tpublic set applicationData(value: Bytes) {\n\t\tthis.payload = value;\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AACA,qBAOO
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AACA,qBAOO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,wBAAwB;IAIxB,uBAAmB,MAAA;8BAF/B,0BAAU,qBAAqB,OAC/B,2BAAW,aAAa,CAAC;;;;oBACe;2CAAA,YAAO;;;;;;AAAhD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAAmE;AAEnE,YAAM,OAAO;AACb,UAAI,KAAC,0CAA0B,OAAO,GAAG;AACxC,aAAK,UAAU,QAAQ;MACxB;IACD;;IAGA,IAAW,kBAAe;AACzB,aAAO,KAAK;IACb;IACA,IAAW,gBAAgB,OAAY;AACtC,WAAK,UAAU;IAChB;;;;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -24,34 +24,81 @@ __export(ApplicationNameFile_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(ApplicationNameFile_exports);
|
|
25
25
|
var import_shared = require("@zwave-js/shared");
|
|
26
26
|
var import_NVMFile = require("./NVMFile.js");
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
28
|
+
function accept(f) {
|
|
29
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
30
|
+
return f;
|
|
31
|
+
}
|
|
32
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
33
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
34
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
35
|
+
var _, done = false;
|
|
36
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
37
|
+
var context = {};
|
|
38
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
39
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
40
|
+
context.addInitializer = function(f) {
|
|
41
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
42
|
+
extraInitializers.push(accept(f || null));
|
|
43
|
+
};
|
|
44
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
45
|
+
if (kind === "accessor") {
|
|
46
|
+
if (result === void 0) continue;
|
|
47
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
48
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
49
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
50
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
51
|
+
} else if (_ = accept(result)) {
|
|
52
|
+
if (kind === "field") initializers.unshift(_);
|
|
53
|
+
else descriptor[key] = _;
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
|
-
name;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
57
|
+
done = true;
|
|
58
|
+
};
|
|
59
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
60
|
+
var useValue = arguments.length > 2;
|
|
61
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
62
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
49
63
|
}
|
|
64
|
+
return useValue ? value : void 0;
|
|
50
65
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(0, import_NVMFile.nvmSection)("application")
|
|
54
|
-
|
|
66
|
+
const ApplicationNameFileID = 266252;
|
|
67
|
+
let ApplicationNameFile = (() => {
|
|
68
|
+
let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationNameFileID), (0, import_NVMFile.nvmSection)("application")];
|
|
69
|
+
let _classDescriptor;
|
|
70
|
+
let _classExtraInitializers = [];
|
|
71
|
+
let _classThis;
|
|
72
|
+
let _classSuper = import_NVMFile.NVMFile;
|
|
73
|
+
var ApplicationNameFile2 = class extends _classSuper {
|
|
74
|
+
static {
|
|
75
|
+
_classThis = this;
|
|
76
|
+
}
|
|
77
|
+
static {
|
|
78
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
79
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
80
|
+
ApplicationNameFile2 = _classThis = _classDescriptor.value;
|
|
81
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
82
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
83
|
+
}
|
|
84
|
+
constructor(options) {
|
|
85
|
+
super(options);
|
|
86
|
+
if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
|
|
87
|
+
this.name = (0, import_shared.cpp2js)(this.payload.toString("utf8"));
|
|
88
|
+
} else {
|
|
89
|
+
this.name = options.name;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
name;
|
|
93
|
+
serialize() {
|
|
94
|
+
const nameAsString = import_shared.Bytes.from(this.name, "utf8");
|
|
95
|
+
this.payload = new import_shared.Bytes(30).fill(0);
|
|
96
|
+
this.payload.set(nameAsString.subarray(0, this.payload.length), 0);
|
|
97
|
+
return super.serialize();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return ApplicationNameFile2 = _classThis;
|
|
101
|
+
})();
|
|
55
102
|
// Annotate the CommonJS export names for ESM import in node:
|
|
56
103
|
0 && (module.exports = {
|
|
57
104
|
ApplicationNameFile,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/nvm3/files/ApplicationNameFile.ts"],
|
|
4
4
|
"sourcesContent": ["import { Bytes, cpp2js } 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 ApplicationNameFileOptions extends NVMFileCreationOptions {\n\tname: string;\n}\n\nexport const ApplicationNameFileID = 0x4100c;\n\n@nvmFileID(ApplicationNameFileID)\n@nvmSection(\"application\")\nexport class ApplicationNameFile extends NVMFile {\n\tpublic constructor(\n\t\toptions: NVMFileDeserializationOptions | ApplicationNameFileOptions,\n\t) {\n\t\tsuper(options);\n\t\tif (gotDeserializationOptions(options)) {\n\t\t\tthis.name = cpp2js(this.payload.toString(\"utf8\"));\n\t\t} else {\n\t\t\tthis.name = options.name;\n\t\t}\n\t}\n\n\tpublic name: string;\n\n\tpublic serialize(): NVM3Object & { data: Bytes } {\n\t\t// Return a zero-terminated string with a fixed length of 30 bytes\n\t\tconst nameAsString = Bytes.from(this.name, \"utf8\");\n\t\tthis.payload = new Bytes(30).fill(0);\n\t\tthis.payload.set(nameAsString.subarray(0, this.payload.length), 0);\n\t\treturn super.serialize();\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAA8B;AAE9B,qBAOO
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAA8B;AAE9B,qBAOO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,wBAAwB;IAIxB,uBAAmB,MAAA;8BAF/B,0BAAU,qBAAqB,OAC/B,2BAAW,aAAa,CAAC;;;;oBACe;2CAAA,YAAO;;;;;;AAAhD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAAmE;AAEnE,YAAM,OAAO;AACb,cAAI,0CAA0B,OAAO,GAAG;AACvC,aAAK,WAAO,sBAAO,KAAK,QAAQ,SAAS,MAAM,CAAC;MACjD,OAAO;AACN,aAAK,OAAO,QAAQ;MACrB;IACD;IAEO;IAEA,YAAS;AAEf,YAAM,eAAe,oBAAM,KAAK,KAAK,MAAM,MAAM;AACjD,WAAK,UAAU,IAAI,oBAAM,EAAE,EAAE,KAAK,CAAC;AACnC,WAAK,QAAQ,IAAI,aAAa,SAAS,GAAG,KAAK,QAAQ,MAAM,GAAG,CAAC;AACjE,aAAO,MAAM,UAAS;IACvB;;;;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|