@zwave-js/config 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/ConfigManager.d.ts +3 -0
- package/build/cjs/ConfigManager.js +15 -6
- package/build/cjs/ConfigManager.js.map +2 -2
- package/build/cjs/Manufacturers.js +2 -2
- package/build/cjs/Manufacturers.js.map +2 -2
- package/build/cjs/_version.d.ts +1 -1
- package/build/cjs/_version.js +1 -1
- package/build/cjs/_version.js.map +1 -1
- package/build/cjs/devices/DeviceConfig.js +2 -2
- package/build/cjs/devices/DeviceConfig.js.map +2 -2
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +1 -4
- package/build/cjs/index.js.map +2 -2
- package/build/cjs/utils.d.ts +2 -2
- package/build/cjs/utils.js +4 -5
- package/build/cjs/utils.js.map +2 -2
- package/build/esm/ConfigManager.d.ts +3 -0
- package/build/esm/ConfigManager.d.ts.map +1 -1
- package/build/esm/ConfigManager.js +17 -7
- package/build/esm/ConfigManager.js.map +1 -1
- package/build/esm/Manufacturers.js +3 -3
- package/build/esm/Manufacturers.js.map +1 -1
- package/build/esm/_version.d.ts +1 -1
- package/build/esm/_version.d.ts.map +1 -1
- package/build/esm/_version.js +1 -1
- package/build/esm/_version.js.map +1 -1
- package/build/esm/devices/DeviceConfig.js +3 -3
- package/build/esm/devices/DeviceConfig.js.map +1 -1
- package/build/esm/index.d.ts +0 -1
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js +0 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/utils.d.ts +2 -2
- package/build/esm/utils.d.ts.map +1 -1
- package/build/esm/utils.js +2 -3
- package/build/esm/utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -4,6 +4,7 @@ import { ConditionalDeviceConfig, type DeviceConfig, type DeviceConfigIndex, typ
|
|
|
4
4
|
export interface ConfigManagerOptions {
|
|
5
5
|
logContainer?: ZWaveLogContainer;
|
|
6
6
|
deviceConfigPriorityDir?: string;
|
|
7
|
+
deviceConfigExternalDir?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare class ConfigManager {
|
|
9
10
|
constructor(options?: ConfigManagerOptions);
|
|
@@ -13,6 +14,8 @@ export declare class ConfigManager {
|
|
|
13
14
|
private _manufacturers;
|
|
14
15
|
get manufacturers(): ManufacturersMap;
|
|
15
16
|
private deviceConfigPriorityDir;
|
|
17
|
+
private deviceConfigExternalDir;
|
|
18
|
+
get externalConfigDir(): string | undefined;
|
|
16
19
|
private index;
|
|
17
20
|
private fulltextIndex;
|
|
18
21
|
private _useExternalConfig;
|
|
@@ -43,6 +43,7 @@ class ConfigManager {
|
|
|
43
43
|
constructor(options = {}) {
|
|
44
44
|
this.logger = new import_Logger.ConfigLogger(options.logContainer ?? new import_core.ZWaveLogContainer({ enabled: false }));
|
|
45
45
|
this.deviceConfigPriorityDir = options.deviceConfigPriorityDir;
|
|
46
|
+
this.deviceConfigExternalDir = options.deviceConfigExternalDir;
|
|
46
47
|
this._configVersion = import_version.PACKAGE_VERSION;
|
|
47
48
|
}
|
|
48
49
|
_configVersion;
|
|
@@ -58,6 +59,10 @@ class ConfigManager {
|
|
|
58
59
|
return this._manufacturers;
|
|
59
60
|
}
|
|
60
61
|
deviceConfigPriorityDir;
|
|
62
|
+
deviceConfigExternalDir;
|
|
63
|
+
get externalConfigDir() {
|
|
64
|
+
return this.deviceConfigExternalDir ?? (0, import_utils.getExternalConfigDirEnvVariable)();
|
|
65
|
+
}
|
|
61
66
|
index;
|
|
62
67
|
fulltextIndex;
|
|
63
68
|
_useExternalConfig = false;
|
|
@@ -65,10 +70,14 @@ class ConfigManager {
|
|
|
65
70
|
return this._useExternalConfig;
|
|
66
71
|
}
|
|
67
72
|
async loadAll() {
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
let syncResult;
|
|
74
|
+
const externalConfigDir = this.externalConfigDir;
|
|
75
|
+
if (externalConfigDir) {
|
|
76
|
+
syncResult = await (0, import_utils.syncExternalConfigDir)(externalConfigDir, this.logger);
|
|
77
|
+
}
|
|
78
|
+
if (syncResult?.success) {
|
|
70
79
|
this._useExternalConfig = true;
|
|
71
|
-
this.logger.print(`Using external configuration dir ${
|
|
80
|
+
this.logger.print(`Using external configuration dir ${externalConfigDir}`);
|
|
72
81
|
this._configVersion = syncResult.version;
|
|
73
82
|
} else {
|
|
74
83
|
this._useExternalConfig = false;
|
|
@@ -80,7 +89,7 @@ class ConfigManager {
|
|
|
80
89
|
}
|
|
81
90
|
async loadManufacturers() {
|
|
82
91
|
try {
|
|
83
|
-
this._manufacturers = await (0, import_Manufacturers.loadManufacturersInternal)(this._useExternalConfig);
|
|
92
|
+
this._manufacturers = await (0, import_Manufacturers.loadManufacturersInternal)(this._useExternalConfig && this.externalConfigDir || void 0);
|
|
84
93
|
} catch (e) {
|
|
85
94
|
if ((0, import_core.isZWaveError)(e) && e.code === import_core.ZWaveErrorCodes.Config_Invalid) {
|
|
86
95
|
if (process.env.NODE_ENV !== "test") {
|
|
@@ -122,7 +131,7 @@ class ConfigManager {
|
|
|
122
131
|
}
|
|
123
132
|
async loadDeviceIndex() {
|
|
124
133
|
try {
|
|
125
|
-
const embeddedIndex = await (0, import_DeviceConfig.loadDeviceIndexInternal)(this.logger, this._useExternalConfig);
|
|
134
|
+
const embeddedIndex = await (0, import_DeviceConfig.loadDeviceIndexInternal)(this.logger, this._useExternalConfig && this.externalConfigDir || void 0);
|
|
126
135
|
const priorityIndex = [];
|
|
127
136
|
if (this.deviceConfigPriorityDir) {
|
|
128
137
|
if (await (0, import_shared.pathExists)(this.deviceConfigPriorityDir)) {
|
|
@@ -167,7 +176,7 @@ class ConfigManager {
|
|
|
167
176
|
const indexEntries = this.index.filter((0, import_utils.getDeviceEntryPredicate)(manufacturerId, productType, productId, firmwareVersion));
|
|
168
177
|
const indexEntry = indexEntries.find((e) => !!e.preferred) ?? indexEntries[0];
|
|
169
178
|
if (indexEntry) {
|
|
170
|
-
const devicesDir = (0, import_DeviceConfig.getDevicesPaths)(this._useExternalConfig
|
|
179
|
+
const devicesDir = (0, import_DeviceConfig.getDevicesPaths)(this._useExternalConfig && this.externalConfigDir || import_utils.configDir).devicesDir;
|
|
171
180
|
const filePath = import_node_path.default.isAbsolute(indexEntry.filename) ? indexEntry.filename : import_node_path.default.join(devicesDir, indexEntry.filename);
|
|
172
181
|
if (!await (0, import_shared.pathExists)(filePath))
|
|
173
182
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ConfigManager.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tZWaveError,\n\tZWaveErrorCodes,\n\tZWaveLogContainer,\n\tisZWaveError,\n} from \"@zwave-js/core\";\nimport { getErrorMessage, pathExists } from \"@zwave-js/shared\";\nimport path from \"node:path\";\nimport { ConfigLogger } from \"./Logger.js\";\nimport {\n\ttype ManufacturersMap,\n\tloadManufacturersInternal,\n\tsaveManufacturersInternal,\n} from \"./Manufacturers.js\";\nimport { PACKAGE_VERSION } from \"./_version.js\";\nimport {\n\tConditionalDeviceConfig,\n\ttype DeviceConfig,\n\ttype DeviceConfigIndex,\n\ttype FulltextDeviceConfigIndex,\n\tgeneratePriorityDeviceIndex,\n\tgetDevicesPaths,\n\tloadDeviceIndexInternal,\n\tloadFulltextDeviceIndexInternal,\n} from \"./devices/DeviceConfig.js\";\nimport {\n\tconfigDir,\n\texternalConfigDir,\n\tgetDeviceEntryPredicate,\n\tsyncExternalConfigDir,\n} from \"./utils.js\";\n\nexport interface ConfigManagerOptions {\n\tlogContainer?: ZWaveLogContainer;\n\tdeviceConfigPriorityDir?: string;\n}\n\nexport class ConfigManager {\n\tpublic constructor(options: ConfigManagerOptions = {}) {\n\t\tthis.logger = new ConfigLogger(\n\t\t\toptions.logContainer ?? new ZWaveLogContainer({ enabled: false }),\n\t\t);\n\t\tthis.deviceConfigPriorityDir = options.deviceConfigPriorityDir;\n\t\tthis._configVersion = PACKAGE_VERSION;\n\t}\n\n\tprivate _configVersion: string;\n\tpublic get configVersion(): string {\n\t\treturn this._configVersion;\n\t}\n\n\tprivate logger: ConfigLogger;\n\n\tprivate _manufacturers: ManufacturersMap | undefined;\n\tpublic get manufacturers(): ManufacturersMap {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\t\treturn this._manufacturers;\n\t}\n\n\tprivate deviceConfigPriorityDir: string | undefined;\n\tprivate index: DeviceConfigIndex | undefined;\n\tprivate fulltextIndex: FulltextDeviceConfigIndex | undefined;\n\n\tprivate _useExternalConfig: boolean = false;\n\tpublic get useExternalConfig(): boolean {\n\t\treturn this._useExternalConfig;\n\t}\n\n\tpublic async loadAll(): Promise<void> {\n\t\t// If the environment option for an external config dir is set\n\t\t// try to sync it and then use it\n\t\tconst syncResult = await syncExternalConfigDir(this.logger);\n\t\tif (syncResult.success) {\n\t\t\tthis._useExternalConfig = true;\n\t\t\tthis.logger.print(\n\t\t\t\t`Using external configuration dir ${externalConfigDir()}`,\n\t\t\t);\n\t\t\tthis._configVersion = syncResult.version;\n\t\t} else {\n\t\t\tthis._useExternalConfig = false;\n\t\t\tthis._configVersion = PACKAGE_VERSION;\n\t\t}\n\t\tthis.logger.print(`version ${this._configVersion}`, \"info\");\n\n\t\tawait this.loadManufacturers();\n\t\tawait this.loadDeviceIndex();\n\t}\n\n\tpublic async loadManufacturers(): Promise<void> {\n\t\ttry {\n\t\t\tthis._manufacturers = await loadManufacturersInternal(\n\t\t\t\tthis._useExternalConfig,\n\t\t\t);\n\t\t} catch (e) {\n\t\t\t// If the config file is missing or invalid, don't try to find it again\n\t\t\tif (isZWaveError(e) && e.code === ZWaveErrorCodes.Config_Invalid) {\n\t\t\t\tif (process.env.NODE_ENV !== \"test\") {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Could not load manufacturers config: ${e.message}`,\n\t\t\t\t\t\t\"error\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!this._manufacturers) this._manufacturers = new Map();\n\t\t\t} else {\n\t\t\t\t// This is an unexpected error\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async saveManufacturers(): Promise<void> {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\n\t\tawait saveManufacturersInternal(this._manufacturers);\n\t}\n\n\t/**\n\t * Looks up the name of the manufacturer with the given ID in the configuration DB\n\t * @param manufacturerId The manufacturer id to look up\n\t */\n\tpublic lookupManufacturer(manufacturerId: number): string | undefined {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\n\t\treturn this._manufacturers.get(manufacturerId);\n\t}\n\n\t/**\n\t * Add new manufacturers to configuration DB\n\t * @param manufacturerId The manufacturer id to look up\n\t * @param manufacturerName The manufacturer name\n\t */\n\tpublic setManufacturer(\n\t\tmanufacturerId: number,\n\t\tmanufacturerName: string,\n\t): void {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\n\t\tthis._manufacturers.set(manufacturerId, manufacturerName);\n\t}\n\n\tpublic async loadDeviceIndex(): Promise<void> {\n\t\ttry {\n\t\t\t// The index of config files included in this package\n\t\t\tconst embeddedIndex = await loadDeviceIndexInternal(\n\t\t\t\tthis.logger,\n\t\t\t\tthis._useExternalConfig,\n\t\t\t);\n\t\t\t// A dynamic index of the user-defined priority device config files\n\t\t\tconst priorityIndex: DeviceConfigIndex = [];\n\t\t\tif (this.deviceConfigPriorityDir) {\n\t\t\t\tif (await pathExists(this.deviceConfigPriorityDir)) {\n\t\t\t\t\tpriorityIndex.push(\n\t\t\t\t\t\t...(await generatePriorityDeviceIndex(\n\t\t\t\t\t\t\tthis.deviceConfigPriorityDir,\n\t\t\t\t\t\t\tthis.logger,\n\t\t\t\t\t\t)),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Priority device configuration directory ${this.deviceConfigPriorityDir} not found`,\n\t\t\t\t\t\t\"warn\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Put the priority index in front, so the files get resolved first\n\t\t\tthis.index = [...priorityIndex, ...embeddedIndex];\n\t\t} catch (e) {\n\t\t\t// If the index file is missing or invalid, don't try to find it again\n\t\t\tif (\n\t\t\t\t(!isZWaveError(e) && e instanceof Error)\n\t\t\t\t|| (isZWaveError(e)\n\t\t\t\t\t&& e.code === ZWaveErrorCodes.Config_Invalid)\n\t\t\t) {\n\t\t\t\t// Fall back to no index on production systems\n\t\t\t\tif (!this.index) this.index = [];\n\t\t\t\tif (process.env.NODE_ENV !== \"test\") {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Could not load or regenerate device config index: ${e.message}`,\n\t\t\t\t\t\t\"error\",\n\t\t\t\t\t);\n\t\t\t\t\t// and don't throw\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// But fail hard in tests\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getIndex(): DeviceConfigIndex | undefined {\n\t\treturn this.index;\n\t}\n\n\tpublic async loadFulltextDeviceIndex(): Promise<void> {\n\t\tthis.fulltextIndex = await loadFulltextDeviceIndexInternal(this.logger);\n\t}\n\n\tpublic getFulltextIndex(): FulltextDeviceConfigIndex | undefined {\n\t\treturn this.fulltextIndex;\n\t}\n\n\t/**\n\t * Looks up the definition of a given device in the configuration DB, but does not evaluate conditional settings.\n\t * @param manufacturerId The manufacturer id of the device\n\t * @param productType The product type of the device\n\t * @param productId The product id of the device\n\t * @param firmwareVersion If known, configuration for a specific firmware version can be loaded.\n\t * If this is `undefined` or not given, the first matching file with a defined firmware range will be returned.\n\t */\n\tpublic async lookupDevicePreserveConditions(\n\t\tmanufacturerId: number,\n\t\tproductType: number,\n\t\tproductId: number,\n\t\tfirmwareVersion?: string,\n\t): Promise<ConditionalDeviceConfig | undefined> {\n\t\t// Load/regenerate the index if necessary\n\t\tif (!this.index) await this.loadDeviceIndex();\n\n\t\t// Look up the device in the index\n\t\tconst indexEntries = this.index!.filter(\n\t\t\tgetDeviceEntryPredicate(\n\t\t\t\tmanufacturerId,\n\t\t\t\tproductType,\n\t\t\t\tproductId,\n\t\t\t\tfirmwareVersion,\n\t\t\t),\n\t\t);\n\t\t// If there are multiple with overlapping firmware ranges, return the preferred one first\n\t\tconst indexEntry = indexEntries.find((e) => !!e.preferred)\n\t\t\t?? indexEntries[0];\n\n\t\tif (indexEntry) {\n\t\t\tconst devicesDir = getDevicesPaths(\n\t\t\t\tthis._useExternalConfig ? externalConfigDir()! : configDir,\n\t\t\t).devicesDir;\n\t\t\tconst filePath = path.isAbsolute(indexEntry.filename)\n\t\t\t\t? indexEntry.filename\n\t\t\t\t: path.join(devicesDir, indexEntry.filename);\n\t\t\tif (!(await pathExists(filePath))) return;\n\n\t\t\t// A config file is treated as am embedded one when it is located under the devices root dir\n\t\t\t// or the external config dir\n\t\t\tconst isEmbedded = !path\n\t\t\t\t.relative(devicesDir, filePath)\n\t\t\t\t.startsWith(\"..\");\n\n\t\t\t// When a device file is located in a different root directory than the embedded config files,\n\t\t\t// we use the embedded dir a fallback\n\t\t\tconst rootDir = indexEntry.rootDir ?? devicesDir;\n\t\t\tconst fallbackDirs = rootDir === devicesDir\n\t\t\t\t? undefined\n\t\t\t\t: [devicesDir];\n\n\t\t\ttry {\n\t\t\t\treturn await ConditionalDeviceConfig.from(\n\t\t\t\t\tfilePath,\n\t\t\t\t\tisEmbedded,\n\t\t\t\t\t{ rootDir, fallbackDirs },\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tif (process.env.NODE_ENV !== \"test\") {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Error loading device config ${filePath}: ${\n\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\"error\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Looks up the definition of a given device in the configuration DB\n\t * @param manufacturerId The manufacturer id of the device\n\t * @param productType The product type of the device\n\t * @param productId The product id of the device\n\t * @param firmwareVersion If known, configuration for a specific firmware version can be loaded.\n\t * If this is `undefined` or not given, the first matching file with a defined firmware range will be returned.\n\t */\n\tpublic async lookupDevice(\n\t\tmanufacturerId: number,\n\t\tproductType: number,\n\t\tproductId: number,\n\t\tfirmwareVersion?: string,\n\t): Promise<DeviceConfig | undefined> {\n\t\tconst ret = await this.lookupDevicePreserveConditions(\n\t\t\tmanufacturerId,\n\t\t\tproductType,\n\t\t\tproductId,\n\t\t\tfirmwareVersion,\n\t\t);\n\t\treturn ret?.evaluate({\n\t\t\tmanufacturerId,\n\t\t\tproductType,\n\t\t\tproductId,\n\t\t\tfirmwareVersion,\n\t\t});\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,kBAKO;AACP,oBAA4C;AAC5C,uBAAiB;AACjB,oBAA6B;AAC7B,2BAIO;AACP,qBAAgC;AAChC,0BASO;AACP,
|
|
4
|
+
"sourcesContent": ["import {\n\tZWaveError,\n\tZWaveErrorCodes,\n\tZWaveLogContainer,\n\tisZWaveError,\n} from \"@zwave-js/core\";\nimport { getErrorMessage, pathExists } from \"@zwave-js/shared\";\nimport path from \"node:path\";\nimport { ConfigLogger } from \"./Logger.js\";\nimport {\n\ttype ManufacturersMap,\n\tloadManufacturersInternal,\n\tsaveManufacturersInternal,\n} from \"./Manufacturers.js\";\nimport { PACKAGE_VERSION } from \"./_version.js\";\nimport {\n\tConditionalDeviceConfig,\n\ttype DeviceConfig,\n\ttype DeviceConfigIndex,\n\ttype FulltextDeviceConfigIndex,\n\tgeneratePriorityDeviceIndex,\n\tgetDevicesPaths,\n\tloadDeviceIndexInternal,\n\tloadFulltextDeviceIndexInternal,\n} from \"./devices/DeviceConfig.js\";\nimport {\n\ttype SyncExternalConfigDirResult,\n\tconfigDir,\n\tgetDeviceEntryPredicate,\n\tgetExternalConfigDirEnvVariable,\n\tsyncExternalConfigDir,\n} from \"./utils.js\";\n\nexport interface ConfigManagerOptions {\n\tlogContainer?: ZWaveLogContainer;\n\tdeviceConfigPriorityDir?: string;\n\tdeviceConfigExternalDir?: string;\n}\n\nexport class ConfigManager {\n\tpublic constructor(options: ConfigManagerOptions = {}) {\n\t\tthis.logger = new ConfigLogger(\n\t\t\toptions.logContainer ?? new ZWaveLogContainer({ enabled: false }),\n\t\t);\n\t\tthis.deviceConfigPriorityDir = options.deviceConfigPriorityDir;\n\t\tthis.deviceConfigExternalDir = options.deviceConfigExternalDir;\n\n\t\tthis._configVersion = PACKAGE_VERSION;\n\t}\n\n\tprivate _configVersion: string;\n\tpublic get configVersion(): string {\n\t\treturn this._configVersion;\n\t}\n\n\tprivate logger: ConfigLogger;\n\n\tprivate _manufacturers: ManufacturersMap | undefined;\n\tpublic get manufacturers(): ManufacturersMap {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\t\treturn this._manufacturers;\n\t}\n\n\tprivate deviceConfigPriorityDir: string | undefined;\n\tprivate deviceConfigExternalDir: string | undefined;\n\tpublic get externalConfigDir(): string | undefined {\n\t\treturn this.deviceConfigExternalDir\n\t\t\t?? getExternalConfigDirEnvVariable();\n\t}\n\n\tprivate index: DeviceConfigIndex | undefined;\n\tprivate fulltextIndex: FulltextDeviceConfigIndex | undefined;\n\n\tprivate _useExternalConfig: boolean = false;\n\tpublic get useExternalConfig(): boolean {\n\t\treturn this._useExternalConfig;\n\t}\n\n\tpublic async loadAll(): Promise<void> {\n\t\t// If the environment option for an external config dir is set\n\t\t// try to sync it and then use it\n\t\tlet syncResult: SyncExternalConfigDirResult | undefined;\n\t\tconst externalConfigDir = this.externalConfigDir;\n\t\tif (externalConfigDir) {\n\t\t\tsyncResult = await syncExternalConfigDir(\n\t\t\t\texternalConfigDir,\n\t\t\t\tthis.logger,\n\t\t\t);\n\t\t}\n\n\t\tif (syncResult?.success) {\n\t\t\tthis._useExternalConfig = true;\n\t\t\tthis.logger.print(\n\t\t\t\t`Using external configuration dir ${externalConfigDir}`,\n\t\t\t);\n\t\t\tthis._configVersion = syncResult.version;\n\t\t} else {\n\t\t\tthis._useExternalConfig = false;\n\t\t\tthis._configVersion = PACKAGE_VERSION;\n\t\t}\n\t\tthis.logger.print(`version ${this._configVersion}`, \"info\");\n\n\t\tawait this.loadManufacturers();\n\t\tawait this.loadDeviceIndex();\n\t}\n\n\tpublic async loadManufacturers(): Promise<void> {\n\t\ttry {\n\t\t\tthis._manufacturers = await loadManufacturersInternal(\n\t\t\t\tthis._useExternalConfig && this.externalConfigDir || undefined,\n\t\t\t);\n\t\t} catch (e) {\n\t\t\t// If the config file is missing or invalid, don't try to find it again\n\t\t\tif (isZWaveError(e) && e.code === ZWaveErrorCodes.Config_Invalid) {\n\t\t\t\tif (process.env.NODE_ENV !== \"test\") {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Could not load manufacturers config: ${e.message}`,\n\t\t\t\t\t\t\"error\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!this._manufacturers) this._manufacturers = new Map();\n\t\t\t} else {\n\t\t\t\t// This is an unexpected error\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async saveManufacturers(): Promise<void> {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\n\t\tawait saveManufacturersInternal(this._manufacturers);\n\t}\n\n\t/**\n\t * Looks up the name of the manufacturer with the given ID in the configuration DB\n\t * @param manufacturerId The manufacturer id to look up\n\t */\n\tpublic lookupManufacturer(manufacturerId: number): string | undefined {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\n\t\treturn this._manufacturers.get(manufacturerId);\n\t}\n\n\t/**\n\t * Add new manufacturers to configuration DB\n\t * @param manufacturerId The manufacturer id to look up\n\t * @param manufacturerName The manufacturer name\n\t */\n\tpublic setManufacturer(\n\t\tmanufacturerId: number,\n\t\tmanufacturerName: string,\n\t): void {\n\t\tif (!this._manufacturers) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The config has not been loaded yet!\",\n\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t);\n\t\t}\n\n\t\tthis._manufacturers.set(manufacturerId, manufacturerName);\n\t}\n\n\tpublic async loadDeviceIndex(): Promise<void> {\n\t\ttry {\n\t\t\t// The index of config files included in this package\n\t\t\tconst embeddedIndex = await loadDeviceIndexInternal(\n\t\t\t\tthis.logger,\n\t\t\t\tthis._useExternalConfig && this.externalConfigDir || undefined,\n\t\t\t);\n\t\t\t// A dynamic index of the user-defined priority device config files\n\t\t\tconst priorityIndex: DeviceConfigIndex = [];\n\t\t\tif (this.deviceConfigPriorityDir) {\n\t\t\t\tif (await pathExists(this.deviceConfigPriorityDir)) {\n\t\t\t\t\tpriorityIndex.push(\n\t\t\t\t\t\t...(await generatePriorityDeviceIndex(\n\t\t\t\t\t\t\tthis.deviceConfigPriorityDir,\n\t\t\t\t\t\t\tthis.logger,\n\t\t\t\t\t\t)),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Priority device configuration directory ${this.deviceConfigPriorityDir} not found`,\n\t\t\t\t\t\t\"warn\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Put the priority index in front, so the files get resolved first\n\t\t\tthis.index = [...priorityIndex, ...embeddedIndex];\n\t\t} catch (e) {\n\t\t\t// If the index file is missing or invalid, don't try to find it again\n\t\t\tif (\n\t\t\t\t(!isZWaveError(e) && e instanceof Error)\n\t\t\t\t|| (isZWaveError(e)\n\t\t\t\t\t&& e.code === ZWaveErrorCodes.Config_Invalid)\n\t\t\t) {\n\t\t\t\t// Fall back to no index on production systems\n\t\t\t\tif (!this.index) this.index = [];\n\t\t\t\tif (process.env.NODE_ENV !== \"test\") {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Could not load or regenerate device config index: ${e.message}`,\n\t\t\t\t\t\t\"error\",\n\t\t\t\t\t);\n\t\t\t\t\t// and don't throw\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// But fail hard in tests\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getIndex(): DeviceConfigIndex | undefined {\n\t\treturn this.index;\n\t}\n\n\tpublic async loadFulltextDeviceIndex(): Promise<void> {\n\t\tthis.fulltextIndex = await loadFulltextDeviceIndexInternal(this.logger);\n\t}\n\n\tpublic getFulltextIndex(): FulltextDeviceConfigIndex | undefined {\n\t\treturn this.fulltextIndex;\n\t}\n\n\t/**\n\t * Looks up the definition of a given device in the configuration DB, but does not evaluate conditional settings.\n\t * @param manufacturerId The manufacturer id of the device\n\t * @param productType The product type of the device\n\t * @param productId The product id of the device\n\t * @param firmwareVersion If known, configuration for a specific firmware version can be loaded.\n\t * If this is `undefined` or not given, the first matching file with a defined firmware range will be returned.\n\t */\n\tpublic async lookupDevicePreserveConditions(\n\t\tmanufacturerId: number,\n\t\tproductType: number,\n\t\tproductId: number,\n\t\tfirmwareVersion?: string,\n\t): Promise<ConditionalDeviceConfig | undefined> {\n\t\t// Load/regenerate the index if necessary\n\t\tif (!this.index) await this.loadDeviceIndex();\n\n\t\t// Look up the device in the index\n\t\tconst indexEntries = this.index!.filter(\n\t\t\tgetDeviceEntryPredicate(\n\t\t\t\tmanufacturerId,\n\t\t\t\tproductType,\n\t\t\t\tproductId,\n\t\t\t\tfirmwareVersion,\n\t\t\t),\n\t\t);\n\t\t// If there are multiple with overlapping firmware ranges, return the preferred one first\n\t\tconst indexEntry = indexEntries.find((e) => !!e.preferred)\n\t\t\t?? indexEntries[0];\n\n\t\tif (indexEntry) {\n\t\t\tconst devicesDir = getDevicesPaths(\n\t\t\t\tthis._useExternalConfig && this.externalConfigDir || configDir,\n\t\t\t).devicesDir;\n\t\t\tconst filePath = path.isAbsolute(indexEntry.filename)\n\t\t\t\t? indexEntry.filename\n\t\t\t\t: path.join(devicesDir, indexEntry.filename);\n\t\t\tif (!(await pathExists(filePath))) return;\n\n\t\t\t// A config file is treated as am embedded one when it is located under the devices root dir\n\t\t\t// or the external config dir\n\t\t\tconst isEmbedded = !path\n\t\t\t\t.relative(devicesDir, filePath)\n\t\t\t\t.startsWith(\"..\");\n\n\t\t\t// When a device file is located in a different root directory than the embedded config files,\n\t\t\t// we use the embedded dir a fallback\n\t\t\tconst rootDir = indexEntry.rootDir ?? devicesDir;\n\t\t\tconst fallbackDirs = rootDir === devicesDir\n\t\t\t\t? undefined\n\t\t\t\t: [devicesDir];\n\n\t\t\ttry {\n\t\t\t\treturn await ConditionalDeviceConfig.from(\n\t\t\t\t\tfilePath,\n\t\t\t\t\tisEmbedded,\n\t\t\t\t\t{ rootDir, fallbackDirs },\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tif (process.env.NODE_ENV !== \"test\") {\n\t\t\t\t\tthis.logger.print(\n\t\t\t\t\t\t`Error loading device config ${filePath}: ${\n\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\"error\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Looks up the definition of a given device in the configuration DB\n\t * @param manufacturerId The manufacturer id of the device\n\t * @param productType The product type of the device\n\t * @param productId The product id of the device\n\t * @param firmwareVersion If known, configuration for a specific firmware version can be loaded.\n\t * If this is `undefined` or not given, the first matching file with a defined firmware range will be returned.\n\t */\n\tpublic async lookupDevice(\n\t\tmanufacturerId: number,\n\t\tproductType: number,\n\t\tproductId: number,\n\t\tfirmwareVersion?: string,\n\t): Promise<DeviceConfig | undefined> {\n\t\tconst ret = await this.lookupDevicePreserveConditions(\n\t\t\tmanufacturerId,\n\t\t\tproductType,\n\t\t\tproductId,\n\t\t\tfirmwareVersion,\n\t\t);\n\t\treturn ret?.evaluate({\n\t\t\tmanufacturerId,\n\t\t\tproductType,\n\t\t\tproductId,\n\t\t\tfirmwareVersion,\n\t\t});\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,kBAKO;AACP,oBAA4C;AAC5C,uBAAiB;AACjB,oBAA6B;AAC7B,2BAIO;AACP,qBAAgC;AAChC,0BASO;AACP,mBAMO;AAQD,MAAO,cAAa;EACzB,YAAmB,UAAgC,CAAA,GAAE;AACpD,SAAK,SAAS,IAAI,2BACjB,QAAQ,gBAAgB,IAAI,8BAAkB,EAAE,SAAS,MAAK,CAAE,CAAC;AAElE,SAAK,0BAA0B,QAAQ;AACvC,SAAK,0BAA0B,QAAQ;AAEvC,SAAK,iBAAiB;EACvB;EAEQ;EACR,IAAW,gBAAa;AACvB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xB,QAAI,CAAC,KAAK;AAAO,YAAM,KAAK,gBAAe;AAG3C,UAAM,eAAe,KAAK,MAAO,WAChC,sCACC,gBACA,aACA,WACA,eAAe,CACf;AAGF,UAAM,aAAa,aAAa,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,KACrD,aAAa,CAAC;AAElB,QAAI,YAAY;AACf,YAAM,iBAAa,qCAClB,KAAK,sBAAsB,KAAK,qBAAqB,sBAAS,EAC7D;AACF,YAAM,WAAW,iBAAAA,QAAK,WAAW,WAAW,QAAQ,IACjD,WAAW,WACX,iBAAAA,QAAK,KAAK,YAAY,WAAW,QAAQ;AAC5C,UAAI,CAAE,UAAM,0BAAW,QAAQ;AAAI;AAInC,YAAM,aAAa,CAAC,iBAAAA,QAClB,SAAS,YAAY,QAAQ,EAC7B,WAAW,IAAI;AAIjB,YAAM,UAAU,WAAW,WAAW;AACtC,YAAM,eAAe,YAAY,aAC9B,SACA,CAAC,UAAU;AAEd,UAAI;AACH,eAAO,MAAM,4CAAwB,KACpC,UACA,YACA,EAAE,SAAS,aAAY,CAAE;MAE3B,SAAS,GAAG;AACX,YAAI,QAAQ,IAAI,aAAa,QAAQ;AACpC,eAAK,OAAO,MACX,+BAA+B,QAAQ,SACtC,+BACC,GACA,IAAI,CAEN,IACA,OAAO;QAET;MACD;IACD;EACD;;;;;;;;;EAUO,MAAM,aACZ,gBACA,aACA,WACA,iBAAwB;AAExB,UAAM,MAAM,MAAM,KAAK,+BACtB,gBACA,aACA,WACA,eAAe;AAEhB,WAAO,KAAK,SAAS;MACpB;MACA;MACA;MACA;KACA;EACF;;",
|
|
6
6
|
"names": ["path"]
|
|
7
7
|
}
|
|
@@ -40,8 +40,8 @@ var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
|
40
40
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
41
41
|
var import_utils = require("./utils.js");
|
|
42
42
|
var import_utils_safe = require("./utils_safe.js");
|
|
43
|
-
async function loadManufacturersInternal(
|
|
44
|
-
const configPath = import_node_path.default.join(
|
|
43
|
+
async function loadManufacturersInternal(externalConfigDir) {
|
|
44
|
+
const configPath = import_node_path.default.join(externalConfigDir || import_utils.configDir, "manufacturers.json");
|
|
45
45
|
if (!await (0, import_shared.pathExists)(configPath)) {
|
|
46
46
|
throw new import_core.ZWaveError("The manufacturer config file does not exist!", import_core.ZWaveErrorCodes.Config_Invalid);
|
|
47
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Manufacturers.ts"],
|
|
4
|
-
"sourcesContent": ["import { ZWaveError, ZWaveErrorCodes, isZWaveError } from \"@zwave-js/core\";\nimport { formatId, pathExists, stringify } from \"@zwave-js/shared\";\nimport { isObject } from \"alcalzone-shared/typeguards/index.js\";\nimport JSON5 from \"json5\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { configDir
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAAA,kBAA0D;AAC1D,oBAAgD;AAChD,wBAAyB;AACzB,mBAAkB;AAClB,sBAAe;AACf,uBAAiB;AACjB,
|
|
4
|
+
"sourcesContent": ["import { ZWaveError, ZWaveErrorCodes, isZWaveError } from \"@zwave-js/core\";\nimport { formatId, pathExists, stringify } from \"@zwave-js/shared\";\nimport { isObject } from \"alcalzone-shared/typeguards/index.js\";\nimport JSON5 from \"json5\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { configDir } from \"./utils.js\";\nimport { hexKeyRegex4Digits, throwInvalidConfig } from \"./utils_safe.js\";\n\nexport type ManufacturersMap = Map<number, string>;\n\n/** @internal */\nexport async function loadManufacturersInternal(\n\texternalConfigDir?: string,\n): Promise<ManufacturersMap> {\n\tconst configPath = path.join(\n\t\texternalConfigDir || configDir,\n\t\t\"manufacturers.json\",\n\t);\n\n\tif (!(await pathExists(configPath))) {\n\t\tthrow new ZWaveError(\n\t\t\t\"The manufacturer config file does not exist!\",\n\t\t\tZWaveErrorCodes.Config_Invalid,\n\t\t);\n\t}\n\ttry {\n\t\tconst fileContents = await fs.readFile(configPath, \"utf8\");\n\t\tconst definition = JSON5.parse(fileContents);\n\t\tif (!isObject(definition)) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t\"manufacturers\",\n\t\t\t\t`the database is not an object!`,\n\t\t\t);\n\t\t}\n\n\t\tconst manufacturers = new Map();\n\t\tfor (const [id, name] of Object.entries(definition)) {\n\t\t\tif (!hexKeyRegex4Digits.test(id)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\"manufacturers\",\n\t\t\t\t\t`found invalid key ${id} at the root level. Manufacturer IDs must be hexadecimal lowercase.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (typeof name !== \"string\") {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\"manufacturers\",\n\t\t\t\t\t`Key ${id} has a non-string manufacturer name`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst idNum = parseInt(id.slice(2), 16);\n\t\t\tmanufacturers.set(idNum, name);\n\t\t}\n\n\t\treturn manufacturers;\n\t} catch (e) {\n\t\tif (isZWaveError(e) || ((e as any).code === \"ENOENT\")) {\n\t\t\tthrow e;\n\t\t} else {\n\t\t\tthrowInvalidConfig(\"manufacturers\");\n\t\t}\n\t}\n}\n\n/**\n * Write current manufacturers map to json\n */\nexport async function saveManufacturersInternal(\n\tmanufacturers: ManufacturersMap,\n): Promise<void> {\n\tconst data: Record<string, string> = {};\n\n\tconst orderedMap = new Map(\n\t\t[...manufacturers].sort((a, b) => (a[0] > b[0] ? 1 : -1)),\n\t);\n\n\tfor (const [id, name] of orderedMap) {\n\t\tdata[formatId(id)] = name;\n\t}\n\n\tconst configPath = path.join(configDir, \"manufacturers.json\");\n\tawait fs.writeFile(configPath, stringify(data, \"\\t\") + \"\\n\");\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;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C,aAAK,wBAAS,EAAE,CAAC,IAAI;EACtB;AAEA,QAAM,aAAa,iBAAAF,QAAK,KAAK,wBAAW,oBAAoB;AAC5D,QAAM,gBAAAC,QAAG,UAAU,gBAAY,yBAAU,MAAM,GAAI,IAAI,IAAI;AAC5D;",
|
|
6
6
|
"names": ["path", "fs", "JSON5"]
|
|
7
7
|
}
|
package/build/cjs/_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "14.0.0
|
|
1
|
+
export declare const PACKAGE_VERSION = "14.0.0";
|
|
2
2
|
//# sourceMappingURL=_version.d.ts.map
|
package/build/cjs/_version.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
PACKAGE_VERSION: () => PACKAGE_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const PACKAGE_VERSION = "14.0.0
|
|
24
|
+
const PACKAGE_VERSION = "14.0.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
PACKAGE_VERSION
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/_version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"14.0.0
|
|
4
|
+
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"14.0.0\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;AACO,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -166,8 +166,8 @@ async function generatePriorityDeviceIndex(deviceConfigPriorityDir, logger) {
|
|
|
166
166
|
filename: import_node_path.default.join(deviceConfigPriorityDir, filename)
|
|
167
167
|
}));
|
|
168
168
|
}
|
|
169
|
-
async function loadDeviceIndexInternal(logger,
|
|
170
|
-
const { devicesDir, indexPath } = getDevicesPaths(
|
|
169
|
+
async function loadDeviceIndexInternal(logger, externalConfigDir) {
|
|
170
|
+
const { devicesDir, indexPath } = getDevicesPaths(externalConfigDir || import_utils.configDir);
|
|
171
171
|
return loadDeviceIndexShared(devicesDir, indexPath, (config) => config.devices.map((dev) => ({
|
|
172
172
|
manufacturerId: (0, import_shared.formatId)(config.manufacturerId.toString(16)),
|
|
173
173
|
manufacturer: config.manufacturer,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/devices/DeviceConfig.ts"],
|
|
4
|
-
"sourcesContent": ["import { ZWaveError, ZWaveErrorCodes } from \"@zwave-js/core\";\nimport {\n\tBytes,\n\ttype JSONObject,\n\tenumFilesRecursive,\n\tformatId,\n\tnum2hex,\n\tpadVersion,\n\tpathExists,\n\tpick,\n\tstringify,\n} from \"@zwave-js/shared\";\nimport { isArray, isObject } from \"alcalzone-shared/typeguards/index.js\";\nimport JSON5 from \"json5\";\nimport { createHash } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport semver from \"semver\";\nimport { clearTemplateCache, readJsonWithTemplate } from \"../JsonTemplate.js\";\nimport type { ConfigLogger } from \"../Logger.js\";\nimport { configDir, externalConfigDir } from \"../utils.js\";\nimport { hexKeyRegex4Digits, throwInvalidConfig } from \"../utils_safe.js\";\nimport {\n\ttype AssociationConfig,\n\tConditionalAssociationConfig,\n} from \"./AssociationConfig.js\";\nimport { type CompatConfig, ConditionalCompatConfig } from \"./CompatConfig.js\";\nimport { evaluateDeep, validateCondition } from \"./ConditionalItem.js\";\nimport {\n\ttype ConditionalPrimitive,\n\tparseConditionalPrimitive,\n} from \"./ConditionalPrimitive.js\";\nimport {\n\tConditionalDeviceMetadata,\n\ttype DeviceMetadata,\n} from \"./DeviceMetadata.js\";\nimport {\n\tConditionalEndpointConfig,\n\ttype EndpointConfig,\n} from \"./EndpointConfig.js\";\nimport {\n\ttype ConditionalParamInfoMap,\n\ttype ParamInfoMap,\n\ttype ParamInformation,\n\tparseConditionalParamInformationMap,\n} from \"./ParamInformation.js\";\nimport type { DeviceID, FirmwareVersionRange } from \"./shared.js\";\n\nexport interface DeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport interface FulltextDeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tmanufacturer: string;\n\tlabel: string;\n\tdescription: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport const embeddedDevicesDir = path.join(configDir, \"devices\");\nconst fulltextIndexPath = path.join(embeddedDevicesDir, \"fulltext_index.json\");\n\nexport function getDevicesPaths(configDir: string): {\n\tdevicesDir: string;\n\tindexPath: string;\n} {\n\tconst devicesDir = path.join(configDir, \"devices\");\n\tconst indexPath = path.join(devicesDir, \"index.json\");\n\treturn { devicesDir, indexPath };\n}\n\nexport type DeviceConfigIndex = DeviceConfigIndexEntry[];\nexport type FulltextDeviceConfigIndex = FulltextDeviceConfigIndexEntry[];\n\nasync function hasChangedDeviceFiles(\n\tdevicesRoot: string,\n\tdir: string,\n\tlastChange: Date,\n): Promise<boolean> {\n\t// Check if there are any files BUT index.json that were changed\n\t// or directories that were modified\n\tconst filesAndDirs = await fs.readdir(dir);\n\tfor (const f of filesAndDirs) {\n\t\tconst fullPath = path.join(dir, f);\n\n\t\tconst stat = await fs.stat(fullPath);\n\t\tif (\n\t\t\t(dir !== devicesRoot || f !== \"index.json\")\n\t\t\t&& (stat.isFile() || stat.isDirectory())\n\t\t\t&& stat.mtime > lastChange\n\t\t) {\n\t\t\treturn true;\n\t\t} else if (stat.isDirectory()) {\n\t\t\t// we need to go deeper!\n\t\t\tif (\n\t\t\t\tawait hasChangedDeviceFiles(devicesRoot, fullPath, lastChange)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Read all device config files from a given directory and return them as index entries.\n * Does not update the index itself.\n */\nasync function generateIndex<T extends Record<string, unknown>>(\n\tdevicesDir: string,\n\tisEmbedded: boolean,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string; rootDir?: string })[]> {\n\tconst index: (T & { filename: string; rootDir?: string })[] = [];\n\n\tclearTemplateCache();\n\tconst configFiles = await enumFilesRecursive(\n\t\tdevicesDir,\n\t\t(file) =>\n\t\t\tfile.endsWith(\".json\")\n\t\t\t&& !file.endsWith(\"index.json\")\n\t\t\t&& !file.includes(\"/templates/\")\n\t\t\t&& !file.includes(\"\\\\templates\\\\\"),\n\t);\n\n\t// Add the embedded devices dir as a fallback if necessary\n\tconst fallbackDirs = devicesDir !== embeddedDevicesDir\n\t\t? [embeddedDevicesDir]\n\t\t: undefined;\n\n\tfor (const file of configFiles) {\n\t\tconst relativePath = path\n\t\t\t.relative(devicesDir, file)\n\t\t\t.replaceAll(\"\\\\\", \"/\");\n\t\t// Try parsing the file\n\t\ttry {\n\t\t\tconst config = await DeviceConfig.from(file, isEmbedded, {\n\t\t\t\trootDir: devicesDir,\n\t\t\t\tfallbackDirs,\n\t\t\t\trelative: true,\n\t\t\t});\n\t\t\t// Add the file to the index\n\t\t\tindex.push(\n\t\t\t\t...extractIndexEntries(config).map((entry) => {\n\t\t\t\t\tconst ret: T & { filename: string; rootDir?: string } = {\n\t\t\t\t\t\t...entry,\n\t\t\t\t\t\tfilename: relativePath,\n\t\t\t\t\t};\n\t\t\t\t\t// Only add the root dir to the index if necessary\n\t\t\t\t\tif (devicesDir !== embeddedDevicesDir) {\n\t\t\t\t\t\tret.rootDir = devicesDir;\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t}),\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tconst message = `Error parsing config file ${relativePath}: ${\n\t\t\t\t(e as Error).message\n\t\t\t}`;\n\t\t\t// Crash hard during tests, just print an error when in production systems.\n\t\t\t// A user could have changed a config file\n\t\t\tif (process.env.NODE_ENV === \"test\" || !!process.env.CI) {\n\t\t\t\tthrow new ZWaveError(message, ZWaveErrorCodes.Config_Invalid);\n\t\t\t} else {\n\t\t\t\tlogger?.print(message, \"error\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index;\n}\n\nasync function loadDeviceIndexShared<T extends Record<string, unknown>>(\n\tdevicesDir: string,\n\tindexPath: string,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string })[]> {\n\t// The index file needs to be regenerated if it does not exist\n\tlet needsUpdate = !(await pathExists(indexPath));\n\tlet index: (T & { filename: string })[] | undefined;\n\tlet mtimeIndex: Date | undefined;\n\t// ...or if cannot be parsed\n\tif (!needsUpdate) {\n\t\ttry {\n\t\t\tconst fileContents = await fs.readFile(indexPath, \"utf8\");\n\t\t\tindex = JSON5.parse(fileContents);\n\t\t\tmtimeIndex = (await fs.stat(indexPath)).mtime;\n\t\t} catch {\n\t\t\tlogger?.print(\n\t\t\t\t\"Error while parsing index file - regenerating...\",\n\t\t\t\t\"warn\",\n\t\t\t);\n\t\t\tneedsUpdate = true;\n\t\t} finally {\n\t\t\tif (!index) {\n\t\t\t\tlogger?.print(\n\t\t\t\t\t\"Index file was malformed - regenerating...\",\n\t\t\t\t\t\"warn\",\n\t\t\t\t);\n\t\t\t\tneedsUpdate = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// ...or if there were any changes in the file system\n\tif (!needsUpdate) {\n\t\tneedsUpdate = await hasChangedDeviceFiles(\n\t\t\tdevicesDir,\n\t\t\tdevicesDir,\n\t\t\tmtimeIndex!,\n\t\t);\n\t\tif (needsUpdate) {\n\t\t\tlogger?.print(\n\t\t\t\t\"Device configuration files on disk changed - regenerating index...\",\n\t\t\t\t\"verbose\",\n\t\t\t);\n\t\t}\n\t}\n\n\tif (needsUpdate) {\n\t\t// Read all files from disk and generate an index\n\t\tindex = await generateIndex(\n\t\t\tdevicesDir,\n\t\t\ttrue,\n\t\t\textractIndexEntries,\n\t\t\tlogger,\n\t\t);\n\t\t// Save the index to disk\n\t\ttry {\n\t\t\tawait fs.writeFile(\n\t\t\t\tpath.join(indexPath),\n\t\t\t\t`// This file is auto-generated. DO NOT edit it by hand if you don't know what you're doing!\"\n${stringify(index, \"\\t\")}\n`,\n\t\t\t\t\"utf8\",\n\t\t\t);\n\t\t\tlogger?.print(\"Device index regenerated\", \"verbose\");\n\t\t} catch (e) {\n\t\t\tlogger?.print(\n\t\t\t\t`Writing the device index to disk failed: ${\n\t\t\t\t\t(e as Error).message\n\t\t\t\t}`,\n\t\t\t\t\"error\",\n\t\t\t);\n\t\t}\n\t}\n\n\treturn index!;\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function generatePriorityDeviceIndex(\n\tdeviceConfigPriorityDir: string,\n\tlogger?: ConfigLogger,\n): Promise<DeviceConfigIndex> {\n\treturn (\n\t\tawait generateIndex(\n\t\t\tdeviceConfigPriorityDir,\n\t\t\tfalse,\n\t\t\t(config) =>\n\t\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\t\tmanufacturerId: formatId(\n\t\t\t\t\t\tconfig.manufacturerId.toString(16),\n\t\t\t\t\t),\n\t\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\t\tlabel: config.label,\n\t\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\t\trootDir: deviceConfigPriorityDir,\n\t\t\t\t})),\n\t\t\tlogger,\n\t\t)\n\t).map(({ filename, ...entry }) => ({\n\t\t...entry,\n\t\t// The generated index makes the filenames relative to the given directory\n\t\t// but we need them to be absolute\n\t\tfilename: path.join(deviceConfigPriorityDir, filename),\n\t}));\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadDeviceIndexInternal(\n\tlogger?: ConfigLogger,\n\texternalConfig?: boolean,\n): Promise<DeviceConfigIndex> {\n\tconst { devicesDir, indexPath } = getDevicesPaths(\n\t\t(externalConfig && externalConfigDir()) || configDir,\n\t);\n\n\treturn loadDeviceIndexShared(\n\t\tdevicesDir,\n\t\tindexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\n/**\n * @internal\n * Loads the full text index file to quickly search the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadFulltextDeviceIndexInternal(\n\tlogger?: ConfigLogger,\n): Promise<FulltextDeviceConfigIndex> {\n\t// This method is not meant to operate with the external device index!\n\treturn loadDeviceIndexShared(\n\t\tembeddedDevicesDir,\n\t\tfulltextIndexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tdescription: config.description,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\trootDir: embeddedDevicesDir,\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\nfunction isHexKeyWith4Digits(val: any): val is string {\n\treturn typeof val === \"string\" && hexKeyRegex4Digits.test(val);\n}\n\nconst firmwareVersionRegex = /^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$/;\nfunction isFirmwareVersion(val: any): val is string {\n\treturn (\n\t\ttypeof val === \"string\"\n\t\t&& firmwareVersionRegex.test(val)\n\t\t&& val\n\t\t\t.split(\".\")\n\t\t\t.map((str) => parseInt(str, 10))\n\t\t\t.every((num) => num >= 0 && num <= 255)\n\t);\n}\n\n/** This class represents a device config entry whose conditional settings have not been evaluated yet */\nexport class ConditionalDeviceConfig {\n\tpublic static async from(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t},\n\t): Promise<ConditionalDeviceConfig> {\n\t\tconst { relative, rootDir } = options;\n\n\t\tconst relativePath = relative\n\t\t\t? path.relative(rootDir, filename).replaceAll(\"\\\\\", \"/\")\n\t\t\t: filename;\n\t\tconst json = await readJsonWithTemplate(filename, [\n\t\t\toptions.rootDir,\n\t\t\t...(options.fallbackDirs ?? []),\n\t\t]);\n\t\treturn new ConditionalDeviceConfig(relativePath, isEmbedded, json);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tdefinition: JSONObject,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\n\t\tif (!isHexKeyWith4Digits(definition.manufacturerId)) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nmanufacturer id must be a lowercase hexadecimal number with 4 digits`,\n\t\t\t);\n\t\t}\n\t\tthis.manufacturerId = parseInt(definition.manufacturerId, 16);\n\n\t\tfor (const prop of [\"manufacturer\", \"label\", \"description\"] as const) {\n\t\t\tthis[prop] = parseConditionalPrimitive(\n\t\t\t\tfilename,\n\t\t\t\t\"string\",\n\t\t\t\tprop,\n\t\t\t\tdefinition[prop],\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t!isArray(definition.devices)\n\t\t\t|| !(definition.devices as any[]).every(\n\t\t\t\t(dev: unknown) =>\n\t\t\t\t\tisObject(dev)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productType)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productId),\n\t\t\t)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\ndevices is malformed (not an object or type/id that is not a lowercase 4-digit hex key)`,\n\t\t\t);\n\t\t}\n\t\tthis.devices = (definition.devices as any[]).map(\n\t\t\t({ productType, productId }) => ({\n\t\t\t\tproductType: parseInt(productType, 16),\n\t\t\t\tproductId: parseInt(productId, 16),\n\t\t\t}),\n\t\t);\n\n\t\tif (\n\t\t\t!isObject(definition.firmwareVersion)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.min)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.max)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion is malformed or invalid. Must be x.y or x.y.z where x, y, and z are integers between 0 and 255`,\n\t\t\t);\n\t\t} else {\n\t\t\tconst { min, max } = definition.firmwareVersion;\n\t\t\tif (semver.gt(padVersion(min), padVersion(max))) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion.min ${min} must not be greater than firmwareVersion.max ${max}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.firmwareVersion = { min, max };\n\t\t}\n\n\t\tif (\n\t\t\tdefinition.preferred != undefined\n\t\t\t&& definition.preferred !== true\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\npreferred must be true or omitted`,\n\t\t\t);\n\t\t}\n\t\tthis.preferred = !!definition.preferred;\n\n\t\tif (definition.endpoints != undefined) {\n\t\t\tconst endpoints = new Map<number, ConditionalEndpointConfig>();\n\t\t\tif (!isObject(definition.endpoints)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nendpoints is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (const [key, ep] of Object.entries(definition.endpoints)) {\n\t\t\t\tif (!/^\\d+$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric endpoint index \"${key}\" in endpoints`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst epIndex = parseInt(key, 10);\n\t\t\t\tendpoints.set(\n\t\t\t\t\tepIndex,\n\t\t\t\t\tnew ConditionalEndpointConfig(this, epIndex, ep as any),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.endpoints = endpoints;\n\t\t}\n\n\t\tif (definition.associations != undefined) {\n\t\t\tconst associations = new Map<\n\t\t\t\tnumber,\n\t\t\t\tConditionalAssociationConfig\n\t\t\t>();\n\t\t\tif (!isObject(definition.associations)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nassociations is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tconst [key, assocDefinition] of Object.entries(\n\t\t\t\t\tdefinition.associations,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (!/^[1-9][0-9]*$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric group id \"${key}\" in associations`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst keyNum = parseInt(key, 10);\n\t\t\t\tassociations.set(\n\t\t\t\t\tkeyNum,\n\t\t\t\t\tnew ConditionalAssociationConfig(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkeyNum,\n\t\t\t\t\t\tassocDefinition as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.associations = associations;\n\t\t}\n\n\t\tif (definition.paramInformation != undefined) {\n\t\t\tthis.paramInformation = parseConditionalParamInformationMap(\n\t\t\t\tdefinition,\n\t\t\t\tthis,\n\t\t\t);\n\t\t}\n\n\t\tif (definition.proprietary != undefined) {\n\t\t\tif (!isObject(definition.proprietary)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nproprietary is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.proprietary = definition.proprietary;\n\t\t}\n\n\t\tif (definition.compat != undefined) {\n\t\t\tif (\n\t\t\t\tisArray(definition.compat)\n\t\t\t\t&& definition.compat.every((item: any) => isObject(item))\n\t\t\t) {\n\t\t\t\t// Make sure all conditions are valid\n\t\t\t\tfor (const entry of definition.compat) {\n\t\t\t\t\tvalidateCondition(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\t`At least one entry of compat contains an`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.compat = definition.compat.map(\n\t\t\t\t\t(item: any) => new ConditionalCompatConfig(filename, item),\n\t\t\t\t);\n\t\t\t} else if (isObject(definition.compat)) {\n\t\t\t\tthis.compat = new ConditionalCompatConfig(\n\t\t\t\t\tfilename,\n\t\t\t\t\tdefinition.compat,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\ncompat must be an object or any array of conditional objects`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (definition.metadata != undefined) {\n\t\t\tif (!isObject(definition.metadata)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nmetadata is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.metadata = new ConditionalDeviceMetadata(\n\t\t\t\tfilename,\n\t\t\t\tdefinition.metadata,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic readonly filename: string;\n\n\tpublic readonly manufacturer!: ConditionalPrimitive<string>;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label!: ConditionalPrimitive<string>;\n\tpublic readonly description!: ConditionalPrimitive<string>;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, ConditionalEndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<\n\t\tnumber,\n\t\tConditionalAssociationConfig\n\t>;\n\tpublic readonly paramInformation?: ConditionalParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?:\n\t\t| ConditionalCompatConfig\n\t\t| ConditionalCompatConfig[];\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: ConditionalDeviceMetadata;\n\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\n\tpublic evaluate(deviceId?: DeviceID): DeviceConfig {\n\t\treturn new DeviceConfig(\n\t\t\tthis.filename,\n\t\t\tthis.isEmbedded,\n\t\t\tevaluateDeep(this.manufacturer, deviceId),\n\t\t\tthis.manufacturerId,\n\t\t\tevaluateDeep(this.label, deviceId),\n\t\t\tevaluateDeep(this.description, deviceId),\n\t\t\tthis.devices,\n\t\t\tthis.firmwareVersion,\n\t\t\tthis.preferred,\n\t\t\tevaluateDeep(this.endpoints, deviceId),\n\t\t\tevaluateDeep(this.associations, deviceId),\n\t\t\tevaluateDeep(this.paramInformation, deviceId),\n\t\t\tthis.proprietary,\n\t\t\tevaluateDeep(this.compat, deviceId),\n\t\t\tevaluateDeep(this.metadata, deviceId),\n\t\t);\n\t}\n}\n\nexport class DeviceConfig {\n\tpublic static async from(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t\tdeviceId?: DeviceID;\n\t\t},\n\t): Promise<DeviceConfig> {\n\t\tconst ret = await ConditionalDeviceConfig.from(\n\t\t\tfilename,\n\t\t\tisEmbedded,\n\t\t\toptions,\n\t\t);\n\t\treturn ret.evaluate(options.deviceId);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tmanufacturer: string,\n\t\tmanufacturerId: number,\n\t\tlabel: string,\n\t\tdescription: string,\n\t\tdevices: readonly {\n\t\t\tproductType: number;\n\t\t\tproductId: number;\n\t\t}[],\n\t\tfirmwareVersion: FirmwareVersionRange,\n\t\tpreferred: boolean,\n\t\tendpoints?: ReadonlyMap<number, EndpointConfig>,\n\t\tassociations?: ReadonlyMap<number, AssociationConfig>,\n\t\tparamInformation?: ParamInfoMap,\n\t\tproprietary?: Record<string, unknown>,\n\t\tcompat?: CompatConfig,\n\t\tmetadata?: DeviceMetadata,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\t\tthis.manufacturer = manufacturer;\n\t\tthis.manufacturerId = manufacturerId;\n\t\tthis.label = label;\n\t\tthis.description = description;\n\t\tthis.devices = devices;\n\t\tthis.firmwareVersion = firmwareVersion;\n\t\tthis.preferred = preferred;\n\t\tthis.endpoints = endpoints;\n\t\tthis.associations = associations;\n\t\tthis.paramInformation = paramInformation;\n\t\tthis.proprietary = proprietary;\n\t\tthis.compat = compat;\n\t\tthis.metadata = metadata;\n\t}\n\n\tpublic readonly filename: string;\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\tpublic readonly manufacturer: string;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label: string;\n\tpublic readonly description: string;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, EndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<number, AssociationConfig>;\n\tpublic readonly paramInformation?: ParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?: CompatConfig;\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: DeviceMetadata;\n\n\t/** Returns the association config for a given endpoint */\n\tpublic getAssociationConfigForEndpoint(\n\t\tendpointIndex: number,\n\t\tgroup: number,\n\t): AssociationConfig | undefined {\n\t\tif (endpointIndex === 0) {\n\t\t\t// The root endpoint's associations may be configured separately or as part of \"endpoints\"\n\t\t\treturn (\n\t\t\t\tthis.associations?.get(group)\n\t\t\t\t\t?? this.endpoints?.get(0)?.associations?.get(group)\n\t\t\t);\n\t\t} else {\n\t\t\t// The other endpoints can only have a configuration as part of \"endpoints\"\n\t\t\treturn this.endpoints?.get(endpointIndex)?.associations?.get(group);\n\t\t}\n\t}\n\n\t/**\n\t * Returns a hash code that can be used to check whether a device config has changed enough to require a re-interview.\n\t */\n\tpublic getHash(): Uint8Array {\n\t\t// We only need to compare the information that is persisted elsewhere:\n\t\t// - config parameters\n\t\t// - functional association settings\n\t\t// - CC-related compat flags\n\n\t\tlet hashable: Record<string, any> = {\n\t\t\t// endpoints: {\n\t\t\t// \tassociations: {},\n\t\t\t// \tparamInformation: []\n\t\t\t// },\n\t\t\t// proprietary: {},\n\t\t\t// compat: {},\n\t\t};\n\n\t\tconst sortObject = (obj: Record<string, any>) => {\n\t\t\tconst ret: Record<string, any> = {};\n\t\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\t\tret[key] = obj[key];\n\t\t\t}\n\t\t\treturn ret;\n\t\t};\n\n\t\tconst cloneAssociationConfig = (a: AssociationConfig) => {\n\t\t\treturn sortObject(\n\t\t\t\tpick(a, [\"maxNodes\", \"multiChannel\", \"isLifeline\"]),\n\t\t\t);\n\t\t};\n\t\tconst cloneAssociationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ReadonlyMap<number, AssociationConfig> | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\ttarget.associations = {};\n\t\t\tfor (const [key, value] of map) {\n\t\t\t\ttarget.associations[key] = cloneAssociationConfig(value);\n\t\t\t}\n\t\t\ttarget.associations = sortObject(target.associations);\n\t\t};\n\n\t\tconst cloneParamInformationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ParamInfoMap | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\tconst getParamKey = (param: ParamInformation) =>\n\t\t\t\t`${param.parameterNumber}${\n\t\t\t\t\tparam.valueBitMask ? `[${num2hex(param.valueBitMask)}]` : \"\"\n\t\t\t\t}`;\n\t\t\ttarget.paramInformation = [...map.values()].sort((a, b) =>\n\t\t\t\tgetParamKey(a).localeCompare(getParamKey(b))\n\t\t\t);\n\t\t};\n\n\t\t// Clone associations and param information on the root (ep 0) and endpoints\n\t\t{\n\t\t\tlet ep0: Record<string, any> = {};\n\t\t\tcloneAssociationMap(ep0, this.associations);\n\t\t\tcloneParamInformationMap(ep0, this.paramInformation);\n\t\t\tep0 = sortObject(ep0);\n\n\t\t\tif (Object.keys(ep0).length > 0) {\n\t\t\t\thashable.endpoints ??= {};\n\t\t\t\thashable.endpoints[0] = ep0;\n\t\t\t}\n\t\t}\n\n\t\tif (this.endpoints) {\n\t\t\tfor (const [index, endpoint] of this.endpoints) {\n\t\t\t\tlet ep: Record<string, any> = {};\n\n\t\t\t\tcloneAssociationMap(ep, endpoint.associations);\n\t\t\t\tcloneParamInformationMap(ep, endpoint.paramInformation);\n\n\t\t\t\tep = sortObject(ep);\n\n\t\t\t\tif (Object.keys(ep).length > 0) {\n\t\t\t\t\thashable.endpoints ??= {};\n\t\t\t\t\thashable.endpoints[index] = ep;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clone proprietary config\n\t\tif (this.proprietary && Object.keys(this.proprietary).length > 0) {\n\t\t\thashable.proprietary = sortObject({ ...this.proprietary });\n\t\t}\n\n\t\t// Clone relevant compat flags\n\t\tif (this.compat) {\n\t\t\tlet c: Record<string, any> = {};\n\n\t\t\t// Copy some simple flags over\n\t\t\tfor (\n\t\t\t\tconst prop of [\n\t\t\t\t\t\"forceSceneControllerGroupCount\",\n\t\t\t\t\t\"mapRootReportsToEndpoint\",\n\t\t\t\t\t\"mapBasicSet\",\n\t\t\t\t\t\"preserveRootApplicationCCValueIDs\",\n\t\t\t\t\t\"preserveEndpoints\",\n\t\t\t\t\t\"removeEndpoints\",\n\t\t\t\t\t\"treatMultilevelSwitchSetAsEvent\",\n\t\t\t\t] as const\n\t\t\t) {\n\t\t\t\tif (this.compat[prop] != undefined) {\n\t\t\t\t\tc[prop] = this.compat[prop];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copy other, more complex flags\n\t\t\tif (this.compat.overrideQueries) {\n\t\t\t\tc.overrideQueries = Object.fromEntries(\n\t\t\t\t\tthis.compat.overrideQueries[\"overrides\"],\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.addCCs) {\n\t\t\t\tc.addCCs = Object.fromEntries(\n\t\t\t\t\t[...this.compat.addCCs].map(([ccId, def]) => [\n\t\t\t\t\t\tccId,\n\t\t\t\t\t\tObject.fromEntries(def.endpoints),\n\t\t\t\t\t]),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.removeCCs) {\n\t\t\t\tc.removeCCs = Object.fromEntries(this.compat.removeCCs);\n\t\t\t}\n\t\t\tif (this.compat.treatSetAsReport) {\n\t\t\t\tc.treatSetAsReport = [...this.compat.treatSetAsReport].sort();\n\t\t\t}\n\n\t\t\tc = sortObject(c);\n\t\t\tif (Object.keys(c).length > 0) {\n\t\t\t\thashable.compat = c;\n\t\t\t}\n\t\t}\n\n\t\thashable = sortObject(hashable);\n\n\t\t// And create a hash from it. This does not need to be cryptographically secure, just good enough to detect changes.\n\t\tconst buffer = Bytes.from(JSON.stringify(hashable), \"utf8\");\n\t\tconst md5 = createHash(\"md5\");\n\t\treturn md5.update(buffer).digest();\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AAAA,kBAA4C;AAC5C,oBAUO;AACP,wBAAkC;AAClC,mBAAkB;AAClB,yBAA2B;AAC3B,sBAAe;AACf,uBAAiB;AACjB,oBAAmB;AACnB,0BAAyD;AAEzD,
|
|
4
|
+
"sourcesContent": ["import { ZWaveError, ZWaveErrorCodes } from \"@zwave-js/core\";\nimport {\n\tBytes,\n\ttype JSONObject,\n\tenumFilesRecursive,\n\tformatId,\n\tnum2hex,\n\tpadVersion,\n\tpathExists,\n\tpick,\n\tstringify,\n} from \"@zwave-js/shared\";\nimport { isArray, isObject } from \"alcalzone-shared/typeguards/index.js\";\nimport JSON5 from \"json5\";\nimport { createHash } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport semver from \"semver\";\nimport { clearTemplateCache, readJsonWithTemplate } from \"../JsonTemplate.js\";\nimport type { ConfigLogger } from \"../Logger.js\";\nimport { configDir } from \"../utils.js\";\nimport { hexKeyRegex4Digits, throwInvalidConfig } from \"../utils_safe.js\";\nimport {\n\ttype AssociationConfig,\n\tConditionalAssociationConfig,\n} from \"./AssociationConfig.js\";\nimport { type CompatConfig, ConditionalCompatConfig } from \"./CompatConfig.js\";\nimport { evaluateDeep, validateCondition } from \"./ConditionalItem.js\";\nimport {\n\ttype ConditionalPrimitive,\n\tparseConditionalPrimitive,\n} from \"./ConditionalPrimitive.js\";\nimport {\n\tConditionalDeviceMetadata,\n\ttype DeviceMetadata,\n} from \"./DeviceMetadata.js\";\nimport {\n\tConditionalEndpointConfig,\n\ttype EndpointConfig,\n} from \"./EndpointConfig.js\";\nimport {\n\ttype ConditionalParamInfoMap,\n\ttype ParamInfoMap,\n\ttype ParamInformation,\n\tparseConditionalParamInformationMap,\n} from \"./ParamInformation.js\";\nimport type { DeviceID, FirmwareVersionRange } from \"./shared.js\";\n\nexport interface DeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport interface FulltextDeviceConfigIndexEntry {\n\tmanufacturerId: string;\n\tmanufacturer: string;\n\tlabel: string;\n\tdescription: string;\n\tproductType: string;\n\tproductId: string;\n\tfirmwareVersion: FirmwareVersionRange;\n\tpreferred?: true;\n\trootDir?: string;\n\tfilename: string;\n}\n\nexport const embeddedDevicesDir = path.join(configDir, \"devices\");\nconst fulltextIndexPath = path.join(embeddedDevicesDir, \"fulltext_index.json\");\n\nexport function getDevicesPaths(configDir: string): {\n\tdevicesDir: string;\n\tindexPath: string;\n} {\n\tconst devicesDir = path.join(configDir, \"devices\");\n\tconst indexPath = path.join(devicesDir, \"index.json\");\n\treturn { devicesDir, indexPath };\n}\n\nexport type DeviceConfigIndex = DeviceConfigIndexEntry[];\nexport type FulltextDeviceConfigIndex = FulltextDeviceConfigIndexEntry[];\n\nasync function hasChangedDeviceFiles(\n\tdevicesRoot: string,\n\tdir: string,\n\tlastChange: Date,\n): Promise<boolean> {\n\t// Check if there are any files BUT index.json that were changed\n\t// or directories that were modified\n\tconst filesAndDirs = await fs.readdir(dir);\n\tfor (const f of filesAndDirs) {\n\t\tconst fullPath = path.join(dir, f);\n\n\t\tconst stat = await fs.stat(fullPath);\n\t\tif (\n\t\t\t(dir !== devicesRoot || f !== \"index.json\")\n\t\t\t&& (stat.isFile() || stat.isDirectory())\n\t\t\t&& stat.mtime > lastChange\n\t\t) {\n\t\t\treturn true;\n\t\t} else if (stat.isDirectory()) {\n\t\t\t// we need to go deeper!\n\t\t\tif (\n\t\t\t\tawait hasChangedDeviceFiles(devicesRoot, fullPath, lastChange)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Read all device config files from a given directory and return them as index entries.\n * Does not update the index itself.\n */\nasync function generateIndex<T extends Record<string, unknown>>(\n\tdevicesDir: string,\n\tisEmbedded: boolean,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string; rootDir?: string })[]> {\n\tconst index: (T & { filename: string; rootDir?: string })[] = [];\n\n\tclearTemplateCache();\n\tconst configFiles = await enumFilesRecursive(\n\t\tdevicesDir,\n\t\t(file) =>\n\t\t\tfile.endsWith(\".json\")\n\t\t\t&& !file.endsWith(\"index.json\")\n\t\t\t&& !file.includes(\"/templates/\")\n\t\t\t&& !file.includes(\"\\\\templates\\\\\"),\n\t);\n\n\t// Add the embedded devices dir as a fallback if necessary\n\tconst fallbackDirs = devicesDir !== embeddedDevicesDir\n\t\t? [embeddedDevicesDir]\n\t\t: undefined;\n\n\tfor (const file of configFiles) {\n\t\tconst relativePath = path\n\t\t\t.relative(devicesDir, file)\n\t\t\t.replaceAll(\"\\\\\", \"/\");\n\t\t// Try parsing the file\n\t\ttry {\n\t\t\tconst config = await DeviceConfig.from(file, isEmbedded, {\n\t\t\t\trootDir: devicesDir,\n\t\t\t\tfallbackDirs,\n\t\t\t\trelative: true,\n\t\t\t});\n\t\t\t// Add the file to the index\n\t\t\tindex.push(\n\t\t\t\t...extractIndexEntries(config).map((entry) => {\n\t\t\t\t\tconst ret: T & { filename: string; rootDir?: string } = {\n\t\t\t\t\t\t...entry,\n\t\t\t\t\t\tfilename: relativePath,\n\t\t\t\t\t};\n\t\t\t\t\t// Only add the root dir to the index if necessary\n\t\t\t\t\tif (devicesDir !== embeddedDevicesDir) {\n\t\t\t\t\t\tret.rootDir = devicesDir;\n\t\t\t\t\t}\n\t\t\t\t\treturn ret;\n\t\t\t\t}),\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tconst message = `Error parsing config file ${relativePath}: ${\n\t\t\t\t(e as Error).message\n\t\t\t}`;\n\t\t\t// Crash hard during tests, just print an error when in production systems.\n\t\t\t// A user could have changed a config file\n\t\t\tif (process.env.NODE_ENV === \"test\" || !!process.env.CI) {\n\t\t\t\tthrow new ZWaveError(message, ZWaveErrorCodes.Config_Invalid);\n\t\t\t} else {\n\t\t\t\tlogger?.print(message, \"error\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index;\n}\n\nasync function loadDeviceIndexShared<T extends Record<string, unknown>>(\n\tdevicesDir: string,\n\tindexPath: string,\n\textractIndexEntries: (config: DeviceConfig) => T[],\n\tlogger?: ConfigLogger,\n): Promise<(T & { filename: string })[]> {\n\t// The index file needs to be regenerated if it does not exist\n\tlet needsUpdate = !(await pathExists(indexPath));\n\tlet index: (T & { filename: string })[] | undefined;\n\tlet mtimeIndex: Date | undefined;\n\t// ...or if cannot be parsed\n\tif (!needsUpdate) {\n\t\ttry {\n\t\t\tconst fileContents = await fs.readFile(indexPath, \"utf8\");\n\t\t\tindex = JSON5.parse(fileContents);\n\t\t\tmtimeIndex = (await fs.stat(indexPath)).mtime;\n\t\t} catch {\n\t\t\tlogger?.print(\n\t\t\t\t\"Error while parsing index file - regenerating...\",\n\t\t\t\t\"warn\",\n\t\t\t);\n\t\t\tneedsUpdate = true;\n\t\t} finally {\n\t\t\tif (!index) {\n\t\t\t\tlogger?.print(\n\t\t\t\t\t\"Index file was malformed - regenerating...\",\n\t\t\t\t\t\"warn\",\n\t\t\t\t);\n\t\t\t\tneedsUpdate = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// ...or if there were any changes in the file system\n\tif (!needsUpdate) {\n\t\tneedsUpdate = await hasChangedDeviceFiles(\n\t\t\tdevicesDir,\n\t\t\tdevicesDir,\n\t\t\tmtimeIndex!,\n\t\t);\n\t\tif (needsUpdate) {\n\t\t\tlogger?.print(\n\t\t\t\t\"Device configuration files on disk changed - regenerating index...\",\n\t\t\t\t\"verbose\",\n\t\t\t);\n\t\t}\n\t}\n\n\tif (needsUpdate) {\n\t\t// Read all files from disk and generate an index\n\t\tindex = await generateIndex(\n\t\t\tdevicesDir,\n\t\t\ttrue,\n\t\t\textractIndexEntries,\n\t\t\tlogger,\n\t\t);\n\t\t// Save the index to disk\n\t\ttry {\n\t\t\tawait fs.writeFile(\n\t\t\t\tpath.join(indexPath),\n\t\t\t\t`// This file is auto-generated. DO NOT edit it by hand if you don't know what you're doing!\"\n${stringify(index, \"\\t\")}\n`,\n\t\t\t\t\"utf8\",\n\t\t\t);\n\t\t\tlogger?.print(\"Device index regenerated\", \"verbose\");\n\t\t} catch (e) {\n\t\t\tlogger?.print(\n\t\t\t\t`Writing the device index to disk failed: ${\n\t\t\t\t\t(e as Error).message\n\t\t\t\t}`,\n\t\t\t\t\"error\",\n\t\t\t);\n\t\t}\n\t}\n\n\treturn index!;\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function generatePriorityDeviceIndex(\n\tdeviceConfigPriorityDir: string,\n\tlogger?: ConfigLogger,\n): Promise<DeviceConfigIndex> {\n\treturn (\n\t\tawait generateIndex(\n\t\t\tdeviceConfigPriorityDir,\n\t\t\tfalse,\n\t\t\t(config) =>\n\t\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\t\tmanufacturerId: formatId(\n\t\t\t\t\t\tconfig.manufacturerId.toString(16),\n\t\t\t\t\t),\n\t\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\t\tlabel: config.label,\n\t\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\t\trootDir: deviceConfigPriorityDir,\n\t\t\t\t})),\n\t\t\tlogger,\n\t\t)\n\t).map(({ filename, ...entry }) => ({\n\t\t...entry,\n\t\t// The generated index makes the filenames relative to the given directory\n\t\t// but we need them to be absolute\n\t\tfilename: path.join(deviceConfigPriorityDir, filename),\n\t}));\n}\n\n/**\n * @internal\n * Loads the index file to quickly access the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadDeviceIndexInternal(\n\tlogger?: ConfigLogger,\n\texternalConfigDir?: string,\n): Promise<DeviceConfigIndex> {\n\tconst { devicesDir, indexPath } = getDevicesPaths(\n\t\texternalConfigDir || configDir,\n\t);\n\n\treturn loadDeviceIndexShared(\n\t\tdevicesDir,\n\t\tindexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\n/**\n * @internal\n * Loads the full text index file to quickly search the device configs.\n * Transparently handles updating the index if necessary\n */\nexport async function loadFulltextDeviceIndexInternal(\n\tlogger?: ConfigLogger,\n): Promise<FulltextDeviceConfigIndex> {\n\t// This method is not meant to operate with the external device index!\n\treturn loadDeviceIndexShared(\n\t\tembeddedDevicesDir,\n\t\tfulltextIndexPath,\n\t\t(config) =>\n\t\t\tconfig.devices.map((dev) => ({\n\t\t\t\tmanufacturerId: formatId(config.manufacturerId.toString(16)),\n\t\t\t\tmanufacturer: config.manufacturer,\n\t\t\t\tlabel: config.label,\n\t\t\t\tdescription: config.description,\n\t\t\t\tproductType: formatId(dev.productType),\n\t\t\t\tproductId: formatId(dev.productId),\n\t\t\t\tfirmwareVersion: config.firmwareVersion,\n\t\t\t\t...(config.preferred ? { preferred: true as const } : {}),\n\t\t\t\trootDir: embeddedDevicesDir,\n\t\t\t})),\n\t\tlogger,\n\t);\n}\n\nfunction isHexKeyWith4Digits(val: any): val is string {\n\treturn typeof val === \"string\" && hexKeyRegex4Digits.test(val);\n}\n\nconst firmwareVersionRegex = /^\\d{1,3}\\.\\d{1,3}(\\.\\d{1,3})?$/;\nfunction isFirmwareVersion(val: any): val is string {\n\treturn (\n\t\ttypeof val === \"string\"\n\t\t&& firmwareVersionRegex.test(val)\n\t\t&& val\n\t\t\t.split(\".\")\n\t\t\t.map((str) => parseInt(str, 10))\n\t\t\t.every((num) => num >= 0 && num <= 255)\n\t);\n}\n\n/** This class represents a device config entry whose conditional settings have not been evaluated yet */\nexport class ConditionalDeviceConfig {\n\tpublic static async from(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t},\n\t): Promise<ConditionalDeviceConfig> {\n\t\tconst { relative, rootDir } = options;\n\n\t\tconst relativePath = relative\n\t\t\t? path.relative(rootDir, filename).replaceAll(\"\\\\\", \"/\")\n\t\t\t: filename;\n\t\tconst json = await readJsonWithTemplate(filename, [\n\t\t\toptions.rootDir,\n\t\t\t...(options.fallbackDirs ?? []),\n\t\t]);\n\t\treturn new ConditionalDeviceConfig(relativePath, isEmbedded, json);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tdefinition: JSONObject,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\n\t\tif (!isHexKeyWith4Digits(definition.manufacturerId)) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nmanufacturer id must be a lowercase hexadecimal number with 4 digits`,\n\t\t\t);\n\t\t}\n\t\tthis.manufacturerId = parseInt(definition.manufacturerId, 16);\n\n\t\tfor (const prop of [\"manufacturer\", \"label\", \"description\"] as const) {\n\t\t\tthis[prop] = parseConditionalPrimitive(\n\t\t\t\tfilename,\n\t\t\t\t\"string\",\n\t\t\t\tprop,\n\t\t\t\tdefinition[prop],\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t!isArray(definition.devices)\n\t\t\t|| !(definition.devices as any[]).every(\n\t\t\t\t(dev: unknown) =>\n\t\t\t\t\tisObject(dev)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productType)\n\t\t\t\t\t&& isHexKeyWith4Digits(dev.productId),\n\t\t\t)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\ndevices is malformed (not an object or type/id that is not a lowercase 4-digit hex key)`,\n\t\t\t);\n\t\t}\n\t\tthis.devices = (definition.devices as any[]).map(\n\t\t\t({ productType, productId }) => ({\n\t\t\t\tproductType: parseInt(productType, 16),\n\t\t\t\tproductId: parseInt(productId, 16),\n\t\t\t}),\n\t\t);\n\n\t\tif (\n\t\t\t!isObject(definition.firmwareVersion)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.min)\n\t\t\t|| !isFirmwareVersion(definition.firmwareVersion.max)\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion is malformed or invalid. Must be x.y or x.y.z where x, y, and z are integers between 0 and 255`,\n\t\t\t);\n\t\t} else {\n\t\t\tconst { min, max } = definition.firmwareVersion;\n\t\t\tif (semver.gt(padVersion(min), padVersion(max))) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nfirmwareVersion.min ${min} must not be greater than firmwareVersion.max ${max}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.firmwareVersion = { min, max };\n\t\t}\n\n\t\tif (\n\t\t\tdefinition.preferred != undefined\n\t\t\t&& definition.preferred !== true\n\t\t) {\n\t\t\tthrowInvalidConfig(\n\t\t\t\t`device`,\n\t\t\t\t`packages/config/config/devices/${filename}:\npreferred must be true or omitted`,\n\t\t\t);\n\t\t}\n\t\tthis.preferred = !!definition.preferred;\n\n\t\tif (definition.endpoints != undefined) {\n\t\t\tconst endpoints = new Map<number, ConditionalEndpointConfig>();\n\t\t\tif (!isObject(definition.endpoints)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nendpoints is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (const [key, ep] of Object.entries(definition.endpoints)) {\n\t\t\t\tif (!/^\\d+$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric endpoint index \"${key}\" in endpoints`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst epIndex = parseInt(key, 10);\n\t\t\t\tendpoints.set(\n\t\t\t\t\tepIndex,\n\t\t\t\t\tnew ConditionalEndpointConfig(this, epIndex, ep as any),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.endpoints = endpoints;\n\t\t}\n\n\t\tif (definition.associations != undefined) {\n\t\t\tconst associations = new Map<\n\t\t\t\tnumber,\n\t\t\t\tConditionalAssociationConfig\n\t\t\t>();\n\t\t\tif (!isObject(definition.associations)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nassociations is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (\n\t\t\t\tconst [key, assocDefinition] of Object.entries(\n\t\t\t\t\tdefinition.associations,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (!/^[1-9][0-9]*$/.test(key)) {\n\t\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t\t`device`,\n\t\t\t\t\t\t`packages/config/config/devices/${filename}:\nfound non-numeric group id \"${key}\" in associations`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst keyNum = parseInt(key, 10);\n\t\t\t\tassociations.set(\n\t\t\t\t\tkeyNum,\n\t\t\t\t\tnew ConditionalAssociationConfig(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tkeyNum,\n\t\t\t\t\t\tassocDefinition as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.associations = associations;\n\t\t}\n\n\t\tif (definition.paramInformation != undefined) {\n\t\t\tthis.paramInformation = parseConditionalParamInformationMap(\n\t\t\t\tdefinition,\n\t\t\t\tthis,\n\t\t\t);\n\t\t}\n\n\t\tif (definition.proprietary != undefined) {\n\t\t\tif (!isObject(definition.proprietary)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nproprietary is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.proprietary = definition.proprietary;\n\t\t}\n\n\t\tif (definition.compat != undefined) {\n\t\t\tif (\n\t\t\t\tisArray(definition.compat)\n\t\t\t\t&& definition.compat.every((item: any) => isObject(item))\n\t\t\t) {\n\t\t\t\t// Make sure all conditions are valid\n\t\t\t\tfor (const entry of definition.compat) {\n\t\t\t\t\tvalidateCondition(\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\t`At least one entry of compat contains an`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.compat = definition.compat.map(\n\t\t\t\t\t(item: any) => new ConditionalCompatConfig(filename, item),\n\t\t\t\t);\n\t\t\t} else if (isObject(definition.compat)) {\n\t\t\t\tthis.compat = new ConditionalCompatConfig(\n\t\t\t\t\tfilename,\n\t\t\t\t\tdefinition.compat,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\ncompat must be an object or any array of conditional objects`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (definition.metadata != undefined) {\n\t\t\tif (!isObject(definition.metadata)) {\n\t\t\t\tthrowInvalidConfig(\n\t\t\t\t\t`device`,\n\t\t\t\t\t`packages/config/config/devices/${filename}:\nmetadata is not an object`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.metadata = new ConditionalDeviceMetadata(\n\t\t\t\tfilename,\n\t\t\t\tdefinition.metadata,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic readonly filename: string;\n\n\tpublic readonly manufacturer!: ConditionalPrimitive<string>;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label!: ConditionalPrimitive<string>;\n\tpublic readonly description!: ConditionalPrimitive<string>;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, ConditionalEndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<\n\t\tnumber,\n\t\tConditionalAssociationConfig\n\t>;\n\tpublic readonly paramInformation?: ConditionalParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?:\n\t\t| ConditionalCompatConfig\n\t\t| ConditionalCompatConfig[];\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: ConditionalDeviceMetadata;\n\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\n\tpublic evaluate(deviceId?: DeviceID): DeviceConfig {\n\t\treturn new DeviceConfig(\n\t\t\tthis.filename,\n\t\t\tthis.isEmbedded,\n\t\t\tevaluateDeep(this.manufacturer, deviceId),\n\t\t\tthis.manufacturerId,\n\t\t\tevaluateDeep(this.label, deviceId),\n\t\t\tevaluateDeep(this.description, deviceId),\n\t\t\tthis.devices,\n\t\t\tthis.firmwareVersion,\n\t\t\tthis.preferred,\n\t\t\tevaluateDeep(this.endpoints, deviceId),\n\t\t\tevaluateDeep(this.associations, deviceId),\n\t\t\tevaluateDeep(this.paramInformation, deviceId),\n\t\t\tthis.proprietary,\n\t\t\tevaluateDeep(this.compat, deviceId),\n\t\t\tevaluateDeep(this.metadata, deviceId),\n\t\t);\n\t}\n}\n\nexport class DeviceConfig {\n\tpublic static async from(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\toptions: {\n\t\t\trootDir: string;\n\t\t\tfallbackDirs?: string[];\n\t\t\trelative?: boolean;\n\t\t\tdeviceId?: DeviceID;\n\t\t},\n\t): Promise<DeviceConfig> {\n\t\tconst ret = await ConditionalDeviceConfig.from(\n\t\t\tfilename,\n\t\t\tisEmbedded,\n\t\t\toptions,\n\t\t);\n\t\treturn ret.evaluate(options.deviceId);\n\t}\n\n\tpublic constructor(\n\t\tfilename: string,\n\t\tisEmbedded: boolean,\n\t\tmanufacturer: string,\n\t\tmanufacturerId: number,\n\t\tlabel: string,\n\t\tdescription: string,\n\t\tdevices: readonly {\n\t\t\tproductType: number;\n\t\t\tproductId: number;\n\t\t}[],\n\t\tfirmwareVersion: FirmwareVersionRange,\n\t\tpreferred: boolean,\n\t\tendpoints?: ReadonlyMap<number, EndpointConfig>,\n\t\tassociations?: ReadonlyMap<number, AssociationConfig>,\n\t\tparamInformation?: ParamInfoMap,\n\t\tproprietary?: Record<string, unknown>,\n\t\tcompat?: CompatConfig,\n\t\tmetadata?: DeviceMetadata,\n\t) {\n\t\tthis.filename = filename;\n\t\tthis.isEmbedded = isEmbedded;\n\t\tthis.manufacturer = manufacturer;\n\t\tthis.manufacturerId = manufacturerId;\n\t\tthis.label = label;\n\t\tthis.description = description;\n\t\tthis.devices = devices;\n\t\tthis.firmwareVersion = firmwareVersion;\n\t\tthis.preferred = preferred;\n\t\tthis.endpoints = endpoints;\n\t\tthis.associations = associations;\n\t\tthis.paramInformation = paramInformation;\n\t\tthis.proprietary = proprietary;\n\t\tthis.compat = compat;\n\t\tthis.metadata = metadata;\n\t}\n\n\tpublic readonly filename: string;\n\t/** Whether this is an embedded configuration or not */\n\tpublic readonly isEmbedded: boolean;\n\tpublic readonly manufacturer: string;\n\tpublic readonly manufacturerId: number;\n\tpublic readonly label: string;\n\tpublic readonly description: string;\n\tpublic readonly devices: readonly {\n\t\tproductType: number;\n\t\tproductId: number;\n\t}[];\n\tpublic readonly firmwareVersion: FirmwareVersionRange;\n\t/** Mark this configuration as preferred over other config files with an overlapping firmware range */\n\tpublic readonly preferred: boolean;\n\tpublic readonly endpoints?: ReadonlyMap<number, EndpointConfig>;\n\tpublic readonly associations?: ReadonlyMap<number, AssociationConfig>;\n\tpublic readonly paramInformation?: ParamInfoMap;\n\t/**\n\t * Contains manufacturer-specific support information for the\n\t * ManufacturerProprietary CC\n\t */\n\tpublic readonly proprietary?: Record<string, unknown>;\n\t/** Contains compatibility options */\n\tpublic readonly compat?: CompatConfig;\n\t/** Contains instructions and other metadata for the device */\n\tpublic readonly metadata?: DeviceMetadata;\n\n\t/** Returns the association config for a given endpoint */\n\tpublic getAssociationConfigForEndpoint(\n\t\tendpointIndex: number,\n\t\tgroup: number,\n\t): AssociationConfig | undefined {\n\t\tif (endpointIndex === 0) {\n\t\t\t// The root endpoint's associations may be configured separately or as part of \"endpoints\"\n\t\t\treturn (\n\t\t\t\tthis.associations?.get(group)\n\t\t\t\t\t?? this.endpoints?.get(0)?.associations?.get(group)\n\t\t\t);\n\t\t} else {\n\t\t\t// The other endpoints can only have a configuration as part of \"endpoints\"\n\t\t\treturn this.endpoints?.get(endpointIndex)?.associations?.get(group);\n\t\t}\n\t}\n\n\t/**\n\t * Returns a hash code that can be used to check whether a device config has changed enough to require a re-interview.\n\t */\n\tpublic getHash(): Uint8Array {\n\t\t// We only need to compare the information that is persisted elsewhere:\n\t\t// - config parameters\n\t\t// - functional association settings\n\t\t// - CC-related compat flags\n\n\t\tlet hashable: Record<string, any> = {\n\t\t\t// endpoints: {\n\t\t\t// \tassociations: {},\n\t\t\t// \tparamInformation: []\n\t\t\t// },\n\t\t\t// proprietary: {},\n\t\t\t// compat: {},\n\t\t};\n\n\t\tconst sortObject = (obj: Record<string, any>) => {\n\t\t\tconst ret: Record<string, any> = {};\n\t\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\t\tret[key] = obj[key];\n\t\t\t}\n\t\t\treturn ret;\n\t\t};\n\n\t\tconst cloneAssociationConfig = (a: AssociationConfig) => {\n\t\t\treturn sortObject(\n\t\t\t\tpick(a, [\"maxNodes\", \"multiChannel\", \"isLifeline\"]),\n\t\t\t);\n\t\t};\n\t\tconst cloneAssociationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ReadonlyMap<number, AssociationConfig> | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\ttarget.associations = {};\n\t\t\tfor (const [key, value] of map) {\n\t\t\t\ttarget.associations[key] = cloneAssociationConfig(value);\n\t\t\t}\n\t\t\ttarget.associations = sortObject(target.associations);\n\t\t};\n\n\t\tconst cloneParamInformationMap = (\n\t\t\ttarget: Record<string, any>,\n\t\t\tmap: ParamInfoMap | undefined,\n\t\t) => {\n\t\t\tif (!map || !map.size) return;\n\t\t\tconst getParamKey = (param: ParamInformation) =>\n\t\t\t\t`${param.parameterNumber}${\n\t\t\t\t\tparam.valueBitMask ? `[${num2hex(param.valueBitMask)}]` : \"\"\n\t\t\t\t}`;\n\t\t\ttarget.paramInformation = [...map.values()].sort((a, b) =>\n\t\t\t\tgetParamKey(a).localeCompare(getParamKey(b))\n\t\t\t);\n\t\t};\n\n\t\t// Clone associations and param information on the root (ep 0) and endpoints\n\t\t{\n\t\t\tlet ep0: Record<string, any> = {};\n\t\t\tcloneAssociationMap(ep0, this.associations);\n\t\t\tcloneParamInformationMap(ep0, this.paramInformation);\n\t\t\tep0 = sortObject(ep0);\n\n\t\t\tif (Object.keys(ep0).length > 0) {\n\t\t\t\thashable.endpoints ??= {};\n\t\t\t\thashable.endpoints[0] = ep0;\n\t\t\t}\n\t\t}\n\n\t\tif (this.endpoints) {\n\t\t\tfor (const [index, endpoint] of this.endpoints) {\n\t\t\t\tlet ep: Record<string, any> = {};\n\n\t\t\t\tcloneAssociationMap(ep, endpoint.associations);\n\t\t\t\tcloneParamInformationMap(ep, endpoint.paramInformation);\n\n\t\t\t\tep = sortObject(ep);\n\n\t\t\t\tif (Object.keys(ep).length > 0) {\n\t\t\t\t\thashable.endpoints ??= {};\n\t\t\t\t\thashable.endpoints[index] = ep;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clone proprietary config\n\t\tif (this.proprietary && Object.keys(this.proprietary).length > 0) {\n\t\t\thashable.proprietary = sortObject({ ...this.proprietary });\n\t\t}\n\n\t\t// Clone relevant compat flags\n\t\tif (this.compat) {\n\t\t\tlet c: Record<string, any> = {};\n\n\t\t\t// Copy some simple flags over\n\t\t\tfor (\n\t\t\t\tconst prop of [\n\t\t\t\t\t\"forceSceneControllerGroupCount\",\n\t\t\t\t\t\"mapRootReportsToEndpoint\",\n\t\t\t\t\t\"mapBasicSet\",\n\t\t\t\t\t\"preserveRootApplicationCCValueIDs\",\n\t\t\t\t\t\"preserveEndpoints\",\n\t\t\t\t\t\"removeEndpoints\",\n\t\t\t\t\t\"treatMultilevelSwitchSetAsEvent\",\n\t\t\t\t] as const\n\t\t\t) {\n\t\t\t\tif (this.compat[prop] != undefined) {\n\t\t\t\t\tc[prop] = this.compat[prop];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copy other, more complex flags\n\t\t\tif (this.compat.overrideQueries) {\n\t\t\t\tc.overrideQueries = Object.fromEntries(\n\t\t\t\t\tthis.compat.overrideQueries[\"overrides\"],\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.addCCs) {\n\t\t\t\tc.addCCs = Object.fromEntries(\n\t\t\t\t\t[...this.compat.addCCs].map(([ccId, def]) => [\n\t\t\t\t\t\tccId,\n\t\t\t\t\t\tObject.fromEntries(def.endpoints),\n\t\t\t\t\t]),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.compat.removeCCs) {\n\t\t\t\tc.removeCCs = Object.fromEntries(this.compat.removeCCs);\n\t\t\t}\n\t\t\tif (this.compat.treatSetAsReport) {\n\t\t\t\tc.treatSetAsReport = [...this.compat.treatSetAsReport].sort();\n\t\t\t}\n\n\t\t\tc = sortObject(c);\n\t\t\tif (Object.keys(c).length > 0) {\n\t\t\t\thashable.compat = c;\n\t\t\t}\n\t\t}\n\n\t\thashable = sortObject(hashable);\n\n\t\t// And create a hash from it. This does not need to be cryptographically secure, just good enough to detect changes.\n\t\tconst buffer = Bytes.from(JSON.stringify(hashable), \"utf8\");\n\t\tconst md5 = createHash(\"md5\");\n\t\treturn md5.update(buffer).digest();\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AAAA,kBAA4C;AAC5C,oBAUO;AACP,wBAAkC;AAClC,mBAAkB;AAClB,yBAA2B;AAC3B,sBAAe;AACf,uBAAiB;AACjB,oBAAmB;AACnB,0BAAyD;AAEzD,mBAA0B;AAC1B,wBAAuD;AACvD,+BAGO;AACP,0BAA2D;AAC3D,6BAAgD;AAChD,kCAGO;AACP,4BAGO;AACP,4BAGO;AACP,8BAKO;AA0BA,MAAM,qBAAqB,iBAAAA,QAAK,KAAK,wBAAW,SAAS;AAChE,M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AC1D,UAAM,UAAM,+BAAW,KAAK;AAC5B,WAAO,IAAI,OAAO,MAAM,EAAE,OAAM;EACjC;;",
|
|
6
6
|
"names": ["path", "configDir", "fs", "JSON5", "semver"]
|
|
7
7
|
}
|
package/build/cjs/index.d.ts
CHANGED
|
@@ -9,5 +9,4 @@ export * from "./devices/DeviceMetadata.js";
|
|
|
9
9
|
export * from "./devices/EndpointConfig.js";
|
|
10
10
|
export * from "./devices/ParamInformation.js";
|
|
11
11
|
export * from "./devices/shared.js";
|
|
12
|
-
export { externalConfigDir } from "./utils.js";
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
package/build/cjs/index.js
CHANGED
|
@@ -19,8 +19,7 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var esm_exports = {};
|
|
21
21
|
__export(esm_exports, {
|
|
22
|
-
PACKAGE_VERSION: () => import_version.PACKAGE_VERSION
|
|
23
|
-
externalConfigDir: () => import_utils.externalConfigDir
|
|
22
|
+
PACKAGE_VERSION: () => import_version.PACKAGE_VERSION
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(esm_exports);
|
|
26
25
|
__reExport(esm_exports, require("./ConfigManager.js"), module.exports);
|
|
@@ -34,11 +33,9 @@ __reExport(esm_exports, require("./devices/DeviceMetadata.js"), module.exports);
|
|
|
34
33
|
__reExport(esm_exports, require("./devices/EndpointConfig.js"), module.exports);
|
|
35
34
|
__reExport(esm_exports, require("./devices/ParamInformation.js"), module.exports);
|
|
36
35
|
__reExport(esm_exports, require("./devices/shared.js"), module.exports);
|
|
37
|
-
var import_utils = require("./utils.js");
|
|
38
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
37
|
0 && (module.exports = {
|
|
40
38
|
PACKAGE_VERSION,
|
|
41
|
-
externalConfigDir,
|
|
42
39
|
...require("./ConfigManager.js"),
|
|
43
40
|
...require("./Logger_safe.js"),
|
|
44
41
|
...require("./Manufacturers.js"),
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/consistent-type-exports */\nexport * from \"./ConfigManager.js\";\nexport * from \"./Logger_safe.js\";\nexport * from \"./Manufacturers.js\";\nexport { PACKAGE_VERSION } from \"./_version.js\";\nexport * from \"./devices/AssociationConfig.js\";\nexport * from \"./devices/CompatConfig.js\";\nexport * from \"./devices/DeviceConfig.js\";\nexport * from \"./devices/DeviceMetadata.js\";\nexport * from \"./devices/EndpointConfig.js\";\nexport * from \"./devices/ParamInformation.js\";\nexport * from \"./devices/shared.js\";\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/consistent-type-exports */\nexport * from \"./ConfigManager.js\";\nexport * from \"./Logger_safe.js\";\nexport * from \"./Manufacturers.js\";\nexport { PACKAGE_VERSION } from \"./_version.js\";\nexport * from \"./devices/AssociationConfig.js\";\nexport * from \"./devices/CompatConfig.js\";\nexport * from \"./devices/DeviceConfig.js\";\nexport * from \"./devices/DeviceMetadata.js\";\nexport * from \"./devices/EndpointConfig.js\";\nexport * from \"./devices/ParamInformation.js\";\nexport * from \"./devices/shared.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;AACA,wBAAc,+BADd;AAEA,wBAAc,6BAFd;AAGA,wBAAc,+BAHd;AAIA,qBAAgC;AAChC,wBAAc,2CALd;AAMA,wBAAc,sCANd;AAOA,wBAAc,sCAPd;AAQA,wBAAc,wCARd;AASA,wBAAc,wCATd;AAUA,wBAAc,0CAVd;AAWA,wBAAc,gCAXd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/cjs/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { DeviceConfigIndexEntry } from "./devices/DeviceConfig.js";
|
|
|
3
3
|
/** The absolute path of the embedded configuration directory */
|
|
4
4
|
export declare const configDir: string;
|
|
5
5
|
/** The (optional) absolute path of an external configuration directory */
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getExternalConfigDirEnvVariable(): string | undefined;
|
|
7
7
|
export declare function getDeviceEntryPredicate(manufacturerId: number, productType: number, productId: number, firmwareVersion?: string): (entry: DeviceConfigIndexEntry) => boolean;
|
|
8
8
|
export type SyncExternalConfigDirResult = {
|
|
9
9
|
success: false;
|
|
@@ -14,6 +14,6 @@ export type SyncExternalConfigDirResult = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Synchronizes or updates the external config directory and returns whether the directory is in a state that can be used
|
|
16
16
|
*/
|
|
17
|
-
export declare function syncExternalConfigDir(logger: ConfigLogger): Promise<SyncExternalConfigDirResult>;
|
|
17
|
+
export declare function syncExternalConfigDir(extConfigDir: string, logger: ConfigLogger): Promise<SyncExternalConfigDirResult>;
|
|
18
18
|
export declare function versionInRange(version: string, min: string, max: string): boolean;
|
|
19
19
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/cjs/utils.js
CHANGED
|
@@ -29,8 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var utils_exports = {};
|
|
30
30
|
__export(utils_exports, {
|
|
31
31
|
configDir: () => configDir,
|
|
32
|
-
externalConfigDir: () => externalConfigDir,
|
|
33
32
|
getDeviceEntryPredicate: () => getDeviceEntryPredicate,
|
|
33
|
+
getExternalConfigDirEnvVariable: () => getExternalConfigDirEnvVariable,
|
|
34
34
|
syncExternalConfigDir: () => syncExternalConfigDir,
|
|
35
35
|
versionInRange: () => versionInRange
|
|
36
36
|
});
|
|
@@ -44,7 +44,7 @@ var semver = __toESM(require("semver"), 1);
|
|
|
44
44
|
var import_version = require("./_version.js");
|
|
45
45
|
const require2 = (0, import_node_module.createRequire)(__import_meta_url);
|
|
46
46
|
const configDir = import_node_path.default.resolve(import_node_path.default.dirname(require2.resolve("@zwave-js/config/package.json")), "config");
|
|
47
|
-
function
|
|
47
|
+
function getExternalConfigDirEnvVariable() {
|
|
48
48
|
return process.env.ZWAVEJS_EXTERNAL_CONFIG;
|
|
49
49
|
}
|
|
50
50
|
function getDeviceEntryPredicate(manufacturerId, productType, productId, firmwareVersion) {
|
|
@@ -61,8 +61,7 @@ function getDeviceEntryPredicate(manufacturerId, productType, productId, firmwar
|
|
|
61
61
|
return true;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
async function syncExternalConfigDir(logger) {
|
|
65
|
-
const extConfigDir = externalConfigDir();
|
|
64
|
+
async function syncExternalConfigDir(extConfigDir, logger) {
|
|
66
65
|
if (!extConfigDir)
|
|
67
66
|
return { success: false };
|
|
68
67
|
try {
|
|
@@ -109,8 +108,8 @@ function versionInRange(version, min, max) {
|
|
|
109
108
|
// Annotate the CommonJS export names for ESM import in node:
|
|
110
109
|
0 && (module.exports = {
|
|
111
110
|
configDir,
|
|
112
|
-
externalConfigDir,
|
|
113
111
|
getDeviceEntryPredicate,
|
|
112
|
+
getExternalConfigDirEnvVariable,
|
|
114
113
|
syncExternalConfigDir,
|
|
115
114
|
versionInRange
|
|
116
115
|
});
|
package/build/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.ts", "../../../../node_modules/.store/@alcalzone-esm2cjs-npm-1.2.3-e86ac3cbf2/package/shims/import.meta.url/shim.js"],
|
|
4
|
-
"sourcesContent": ["import { copyFilesRecursive, formatId, padVersion } from \"@zwave-js/shared\";\nimport fs from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport * as semver from \"semver\";\nimport type { ConfigLogger } from \"./Logger.js\";\nimport { PACKAGE_VERSION } from \"./_version.js\";\nimport type { DeviceConfigIndexEntry } from \"./devices/DeviceConfig.js\";\n\nconst require = createRequire(import.meta.url);\n\n/** The absolute path of the embedded configuration directory */\nexport const configDir = path.resolve(\n\tpath.dirname(require.resolve(\"@zwave-js/config/package.json\")),\n\t\"config\",\n);\n/** The (optional) absolute path of an external configuration directory */\nexport function
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACAO,IAAM,oBACX,OAAO,aAAa,cAAc,KAAK,QAAQ,MAAM,QAAQ,IAAI,EAAE,CAAC,GAAE,IAAK,UAAU,UAAU,EAAE,OAC9F,SAAS,iBAAiB,SAAS,cAAc,OAAO,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;ADFlG,oBAAyD;AACzD,sBAAe;AACf,yBAA8B;AAC9B,uBAAiB;AACjB,aAAwB;AAExB,qBAAgC;AAGhC,MAAMA,eAAU,kCAAc,iBAAe;AAGtC,MAAM,YAAY,iBAAAC,QAAK,QAC7B,iBAAAA,QAAK,QAAQD,SAAQ,QAAQ,+BAA+B,CAAC,GAC7D,QAAQ;
|
|
4
|
+
"sourcesContent": ["import { copyFilesRecursive, formatId, padVersion } from \"@zwave-js/shared\";\nimport fs from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport * as semver from \"semver\";\nimport type { ConfigLogger } from \"./Logger.js\";\nimport { PACKAGE_VERSION } from \"./_version.js\";\nimport type { DeviceConfigIndexEntry } from \"./devices/DeviceConfig.js\";\n\nconst require = createRequire(import.meta.url);\n\n/** The absolute path of the embedded configuration directory */\nexport const configDir = path.resolve(\n\tpath.dirname(require.resolve(\"@zwave-js/config/package.json\")),\n\t\"config\",\n);\n\n/** The (optional) absolute path of an external configuration directory */\nexport function getExternalConfigDirEnvVariable(): string | undefined {\n\treturn process.env.ZWAVEJS_EXTERNAL_CONFIG;\n}\n\nexport function getDeviceEntryPredicate(\n\tmanufacturerId: number,\n\tproductType: number,\n\tproductId: number,\n\tfirmwareVersion?: string,\n): (entry: DeviceConfigIndexEntry) => boolean {\n\treturn (entry) => {\n\t\tif (entry.manufacturerId !== formatId(manufacturerId)) return false;\n\t\tif (entry.productType !== formatId(productType)) return false;\n\t\tif (entry.productId !== formatId(productId)) return false;\n\t\tif (firmwareVersion != undefined) {\n\t\t\t// A firmware version was given, only look at files with a matching firmware version\n\t\t\treturn (\n\t\t\t\tsemver.lte(\n\t\t\t\t\tpadVersion(entry.firmwareVersion.min),\n\t\t\t\t\tpadVersion(firmwareVersion),\n\t\t\t\t)\n\t\t\t\t&& semver.gte(\n\t\t\t\t\tpadVersion(entry.firmwareVersion.max),\n\t\t\t\t\tpadVersion(firmwareVersion),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t};\n}\n\nexport type SyncExternalConfigDirResult =\n\t| {\n\t\tsuccess: false;\n\t}\n\t| {\n\t\tsuccess: true;\n\t\tversion: string;\n\t};\n\n/**\n * Synchronizes or updates the external config directory and returns whether the directory is in a state that can be used\n */\nexport async function syncExternalConfigDir(\n\textConfigDir: string,\n\tlogger: ConfigLogger,\n): Promise<SyncExternalConfigDirResult> {\n\tif (!extConfigDir) return { success: false };\n\n\t// Make sure the config dir exists\n\ttry {\n\t\tawait fs.mkdir(extConfigDir, { recursive: true });\n\t} catch {\n\t\tlogger.print(\n\t\t\t`Synchronizing external config dir failed - directory could not be created`,\n\t\t\t\"error\",\n\t\t);\n\t\treturn { success: false };\n\t}\n\n\tconst externalVersionFilename = path.join(extConfigDir, \"version\");\n\tconst currentVersion = PACKAGE_VERSION;\n\tconst supportedRange = `>=${currentVersion} <${\n\t\tsemver.inc(\n\t\t\tcurrentVersion,\n\t\t\t\"patch\",\n\t\t)\n\t}`;\n\n\t// We remember the config version that was copied there in a file called \"version\"\n\t// If that either...\n\t// ...isn't there,\n\t// ...can't be read,\n\t// ...doesn't contain a matching version (>= current && nightly)\n\t// wipe the external config dir and recreate it\n\tlet wipe = false;\n\tlet externalVersion: string | undefined;\n\ttry {\n\t\texternalVersion = await fs.readFile(externalVersionFilename, \"utf8\");\n\t\tif (!semver.valid(externalVersion)) {\n\t\t\twipe = true;\n\t\t} else if (\n\t\t\t!semver.satisfies(externalVersion, supportedRange, {\n\t\t\t\tincludePrerelease: true,\n\t\t\t})\n\t\t) {\n\t\t\twipe = true;\n\t\t}\n\t} catch {\n\t\twipe = true;\n\t}\n\n\t// Nothing to wipe, the external dir is good to go\n\tif (!wipe) return { success: true, version: externalVersion! };\n\n\t// Wipe and override the external dir\n\ttry {\n\t\tlogger.print(`Synchronizing external config dir ${extConfigDir}...`);\n\t\tawait fs.rm(extConfigDir, { recursive: true, force: true });\n\t\tawait fs.mkdir(extConfigDir, { recursive: true });\n\t\tawait copyFilesRecursive(\n\t\t\tconfigDir,\n\t\t\textConfigDir,\n\t\t\t(src) => src.endsWith(\".json\"),\n\t\t);\n\t\tawait fs.writeFile(externalVersionFilename, currentVersion, \"utf8\");\n\t\texternalVersion = currentVersion;\n\t} catch {\n\t\t// Something went wrong\n\t\tlogger.print(\n\t\t\t`Synchronizing external config dir failed - using embedded config`,\n\t\t\t\"error\",\n\t\t);\n\t\treturn { success: false };\n\t}\n\n\treturn { success: true, version: externalVersion };\n}\n\nexport function versionInRange(\n\tversion: string,\n\tmin: string,\n\tmax: string,\n): boolean {\n\treturn (\n\t\tsemver.gte(padVersion(version), padVersion(min))\n\t\t&& semver.lte(padVersion(version), padVersion(max))\n\t);\n}\n", "export const __import_meta_url =\n typeof document === 'undefined' ? new (require('url'.replace('', '')).URL)('file:' + __filename).href :\n (document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACAO,IAAM,oBACX,OAAO,aAAa,cAAc,KAAK,QAAQ,MAAM,QAAQ,IAAI,EAAE,CAAC,GAAE,IAAK,UAAU,UAAU,EAAE,OAC9F,SAAS,iBAAiB,SAAS,cAAc,OAAO,IAA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AAe,GAAG;AACnC,aAAO;IACR,WACC,CAAC,OAAO,UAAU,iBAAiB,gBAAgB;MAClD,mBAAmB;KACnB,GACA;AACD,aAAO;IACR;EACD,QAAQ;AACP,WAAO;EACR;AAGA,MAAI,CAAC;AAAM,WAAO,EAAE,SAAS,MAAM,SAAS,gBAAgB;AAG5D,MAAI;AACH,WAAO,MAAM,qCAAqC,YAAY,KAAK;AACnE,UAAM,gBAAAA,QAAG,GAAG,cAAc,EAAE,WAAW,MAAM,OAAO,KAAI,CAAE;AAC1D,UAAM,gBAAAA,QAAG,MAAM,cAAc,EAAE,WAAW,KAAI,CAAE;AAChD,cAAM,kCACL,WACA,cACA,CAAC,QAAQ,IAAI,SAAS,OAAO,CAAC;AAE/B,UAAM,gBAAAA,QAAG,UAAU,yBAAyB,gBAAgB,MAAM;AAClE,sBAAkB;EACnB,QAAQ;AAEP,WAAO,MACN,oEACA,OAAO;AAER,WAAO,EAAE,SAAS,MAAK;EACxB;AAEA,SAAO,EAAE,SAAS,MAAM,SAAS,gBAAe;AACjD;AAEM,SAAU,eACf,SACA,KACA,KAAW;AAEX,SACC,OAAO,QAAI,0BAAW,OAAO,OAAG,0BAAW,GAAG,CAAC,KAC5C,OAAO,QAAI,0BAAW,OAAO,OAAG,0BAAW,GAAG,CAAC;AAEpD;",
|
|
6
6
|
"names": ["require", "path", "fs"]
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@ import { ConditionalDeviceConfig, type DeviceConfig, type DeviceConfigIndex, typ
|
|
|
4
4
|
export interface ConfigManagerOptions {
|
|
5
5
|
logContainer?: ZWaveLogContainer;
|
|
6
6
|
deviceConfigPriorityDir?: string;
|
|
7
|
+
deviceConfigExternalDir?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare class ConfigManager {
|
|
9
10
|
constructor(options?: ConfigManagerOptions);
|
|
@@ -13,6 +14,8 @@ export declare class ConfigManager {
|
|
|
13
14
|
private _manufacturers;
|
|
14
15
|
get manufacturers(): ManufacturersMap;
|
|
15
16
|
private deviceConfigPriorityDir;
|
|
17
|
+
private deviceConfigExternalDir;
|
|
18
|
+
get externalConfigDir(): string | undefined;
|
|
16
19
|
private index;
|
|
17
20
|
private fulltextIndex;
|
|
18
21
|
private _useExternalConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigManager.d.ts","sourceRoot":"","sources":["../../src/ConfigManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,iBAAiB,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EACN,KAAK,gBAAgB,EAGrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,uBAAuB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAK9B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigManager.d.ts","sourceRoot":"","sources":["../../src/ConfigManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,iBAAiB,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EACN,KAAK,gBAAgB,EAGrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,uBAAuB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAK9B,MAAM,2BAA2B,CAAC;AASnC,MAAM,WAAW,oBAAoB;IACpC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,qBAAa,aAAa;gBACN,OAAO,GAAE,oBAAyB;IAUrD,OAAO,CAAC,cAAc,CAAS;IAC/B,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED,OAAO,CAAC,MAAM,CAAe;IAE7B,OAAO,CAAC,cAAc,CAA+B;IACrD,IAAW,aAAa,IAAI,gBAAgB,CAQ3C;IAED,OAAO,CAAC,uBAAuB,CAAqB;IACpD,OAAO,CAAC,uBAAuB,CAAqB;IACpD,IAAW,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAGjD;IAED,OAAO,CAAC,KAAK,CAAgC;IAC7C,OAAO,CAAC,aAAa,CAAwC;IAE7D,OAAO,CAAC,kBAAkB,CAAkB;IAC5C,IAAW,iBAAiB,IAAI,OAAO,CAEtC;IAEY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BxB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBlC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAW/C;;;OAGG;IACI,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAWrE;;;;OAIG;IACI,eAAe,CACrB,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,MAAM,GACtB,IAAI;IAWM,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAiDtC,QAAQ,IAAI,iBAAiB,GAAG,SAAS;IAInC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9C,gBAAgB,IAAI,yBAAyB,GAAG,SAAS;IAIhE;;;;;;;OAOG;IACU,8BAA8B,CAC1C,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC;IA6D/C;;;;;;;OAOG;IACU,YAAY,CACxB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;CAcpC"}
|
|
@@ -5,11 +5,12 @@ import { ConfigLogger } from "./Logger.js";
|
|
|
5
5
|
import { loadManufacturersInternal, saveManufacturersInternal, } from "./Manufacturers.js";
|
|
6
6
|
import { PACKAGE_VERSION } from "./_version.js";
|
|
7
7
|
import { ConditionalDeviceConfig, generatePriorityDeviceIndex, getDevicesPaths, loadDeviceIndexInternal, loadFulltextDeviceIndexInternal, } from "./devices/DeviceConfig.js";
|
|
8
|
-
import { configDir,
|
|
8
|
+
import { configDir, getDeviceEntryPredicate, getExternalConfigDirEnvVariable, syncExternalConfigDir, } from "./utils.js";
|
|
9
9
|
export class ConfigManager {
|
|
10
10
|
constructor(options = {}) {
|
|
11
11
|
this.logger = new ConfigLogger(options.logContainer ?? new ZWaveLogContainer({ enabled: false }));
|
|
12
12
|
this.deviceConfigPriorityDir = options.deviceConfigPriorityDir;
|
|
13
|
+
this.deviceConfigExternalDir = options.deviceConfigExternalDir;
|
|
13
14
|
this._configVersion = PACKAGE_VERSION;
|
|
14
15
|
}
|
|
15
16
|
_configVersion;
|
|
@@ -25,6 +26,11 @@ export class ConfigManager {
|
|
|
25
26
|
return this._manufacturers;
|
|
26
27
|
}
|
|
27
28
|
deviceConfigPriorityDir;
|
|
29
|
+
deviceConfigExternalDir;
|
|
30
|
+
get externalConfigDir() {
|
|
31
|
+
return this.deviceConfigExternalDir
|
|
32
|
+
?? getExternalConfigDirEnvVariable();
|
|
33
|
+
}
|
|
28
34
|
index;
|
|
29
35
|
fulltextIndex;
|
|
30
36
|
_useExternalConfig = false;
|
|
@@ -34,10 +40,14 @@ export class ConfigManager {
|
|
|
34
40
|
async loadAll() {
|
|
35
41
|
// If the environment option for an external config dir is set
|
|
36
42
|
// try to sync it and then use it
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
let syncResult;
|
|
44
|
+
const externalConfigDir = this.externalConfigDir;
|
|
45
|
+
if (externalConfigDir) {
|
|
46
|
+
syncResult = await syncExternalConfigDir(externalConfigDir, this.logger);
|
|
47
|
+
}
|
|
48
|
+
if (syncResult?.success) {
|
|
39
49
|
this._useExternalConfig = true;
|
|
40
|
-
this.logger.print(`Using external configuration dir ${externalConfigDir
|
|
50
|
+
this.logger.print(`Using external configuration dir ${externalConfigDir}`);
|
|
41
51
|
this._configVersion = syncResult.version;
|
|
42
52
|
}
|
|
43
53
|
else {
|
|
@@ -50,7 +60,7 @@ export class ConfigManager {
|
|
|
50
60
|
}
|
|
51
61
|
async loadManufacturers() {
|
|
52
62
|
try {
|
|
53
|
-
this._manufacturers = await loadManufacturersInternal(this._useExternalConfig);
|
|
63
|
+
this._manufacturers = await loadManufacturersInternal(this._useExternalConfig && this.externalConfigDir || undefined);
|
|
54
64
|
}
|
|
55
65
|
catch (e) {
|
|
56
66
|
// If the config file is missing or invalid, don't try to find it again
|
|
@@ -97,7 +107,7 @@ export class ConfigManager {
|
|
|
97
107
|
async loadDeviceIndex() {
|
|
98
108
|
try {
|
|
99
109
|
// The index of config files included in this package
|
|
100
|
-
const embeddedIndex = await loadDeviceIndexInternal(this.logger, this._useExternalConfig);
|
|
110
|
+
const embeddedIndex = await loadDeviceIndexInternal(this.logger, this._useExternalConfig && this.externalConfigDir || undefined);
|
|
101
111
|
// A dynamic index of the user-defined priority device config files
|
|
102
112
|
const priorityIndex = [];
|
|
103
113
|
if (this.deviceConfigPriorityDir) {
|
|
@@ -156,7 +166,7 @@ export class ConfigManager {
|
|
|
156
166
|
const indexEntry = indexEntries.find((e) => !!e.preferred)
|
|
157
167
|
?? indexEntries[0];
|
|
158
168
|
if (indexEntry) {
|
|
159
|
-
const devicesDir = getDevicesPaths(this._useExternalConfig
|
|
169
|
+
const devicesDir = getDevicesPaths(this._useExternalConfig && this.externalConfigDir || configDir).devicesDir;
|
|
160
170
|
const filePath = path.isAbsolute(indexEntry.filename)
|
|
161
171
|
? indexEntry.filename
|
|
162
172
|
: path.join(devicesDir, indexEntry.filename);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigManager.js","sourceRoot":"","sources":["../../src/ConfigManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,YAAY,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/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EACF,OAAO,CACP,CAAC;gBACH,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,YAAY,CACxB,cAAsB,EACtB,WAAmB,EACnB,SAAiB,EACjB,eAAwB;QAExB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,8BAA8B,CACpD,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,CACf,CAAC;QACF,OAAO,GAAG,EAAE,QAAQ,CAAC;YACpB,cAAc;YACd,WAAW;YACX,SAAS;YACT,eAAe;SACf,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -4,11 +4,11 @@ import { isObject } from "alcalzone-shared/typeguards/index.js";
|
|
|
4
4
|
import JSON5 from "json5";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
|
-
import { configDir
|
|
7
|
+
import { configDir } from "./utils.js";
|
|
8
8
|
import { hexKeyRegex4Digits, throwInvalidConfig } from "./utils_safe.js";
|
|
9
9
|
/** @internal */
|
|
10
|
-
export async function loadManufacturersInternal(
|
|
11
|
-
const configPath = path.join(
|
|
10
|
+
export async function loadManufacturersInternal(externalConfigDir) {
|
|
11
|
+
const configPath = path.join(externalConfigDir || configDir, "manufacturers.json");
|
|
12
12
|
if (!(await pathExists(configPath))) {
|
|
13
13
|
throw new ZWaveError("The manufacturer config file does not exist!", ZWaveErrorCodes.Config_Invalid);
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manufacturers.js","sourceRoot":"","sources":["../../src/Manufacturers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,KAAK,MAA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CAAC,CAAC,CAAC,CACzD,CAAC;IAEF,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AAC9D,CAAC"}
|
package/build/esm/_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "14.0.0
|
|
1
|
+
export declare const PACKAGE_VERSION = "14.0.0";
|
|
2
2
|
//# sourceMappingURL=_version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../../src/_version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../../src/_version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,WAAW,CAAC"}
|
package/build/esm/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_version.js","sourceRoot":"","sources":["../../src/_version.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,CAAC,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"_version.js","sourceRoot":"","sources":["../../src/_version.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC"}
|
|
@@ -7,7 +7,7 @@ import fs from "node:fs/promises";
|
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import semver from "semver";
|
|
9
9
|
import { clearTemplateCache, readJsonWithTemplate } from "../JsonTemplate.js";
|
|
10
|
-
import { configDir
|
|
10
|
+
import { configDir } from "../utils.js";
|
|
11
11
|
import { hexKeyRegex4Digits, throwInvalidConfig } from "../utils_safe.js";
|
|
12
12
|
import { ConditionalAssociationConfig, } from "./AssociationConfig.js";
|
|
13
13
|
import { ConditionalCompatConfig } from "./CompatConfig.js";
|
|
@@ -170,8 +170,8 @@ export async function generatePriorityDeviceIndex(deviceConfigPriorityDir, logge
|
|
|
170
170
|
* Loads the index file to quickly access the device configs.
|
|
171
171
|
* Transparently handles updating the index if necessary
|
|
172
172
|
*/
|
|
173
|
-
export async function loadDeviceIndexInternal(logger,
|
|
174
|
-
const { devicesDir, indexPath } = getDevicesPaths(
|
|
173
|
+
export async function loadDeviceIndexInternal(logger, externalConfigDir) {
|
|
174
|
+
const { devicesDir, indexPath } = getDevicesPaths(externalConfigDir || configDir);
|
|
175
175
|
return loadDeviceIndexShared(devicesDir, indexPath, (config) => config.devices.map((dev) => ({
|
|
176
176
|
manufacturerId: formatId(config.manufacturerId.toString(16)),
|
|
177
177
|
manufacturer: config.manufacturer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceConfig.js","sourceRoot":"","sources":["../../../src/devices/DeviceConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EACN,KAAK,EAEL,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,IAAI,EACJ,SAAS,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,QAAQ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/build/esm/index.d.ts
CHANGED
|
@@ -9,5 +9,4 @@ export * from "./devices/DeviceMetadata.js";
|
|
|
9
9
|
export * from "./devices/EndpointConfig.js";
|
|
10
10
|
export * from "./devices/ParamInformation.js";
|
|
11
11
|
export * from "./devices/shared.js";
|
|
12
|
-
export { externalConfigDir } from "./utils.js";
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
package/build/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
|
package/build/esm/index.js
CHANGED
|
@@ -10,5 +10,4 @@ export * from "./devices/DeviceMetadata.js";
|
|
|
10
10
|
export * from "./devices/EndpointConfig.js";
|
|
11
11
|
export * from "./devices/ParamInformation.js";
|
|
12
12
|
export * from "./devices/shared.js";
|
|
13
|
-
export { externalConfigDir } from "./utils.js";
|
|
14
13
|
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
|
package/build/esm/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { DeviceConfigIndexEntry } from "./devices/DeviceConfig.js";
|
|
|
3
3
|
/** The absolute path of the embedded configuration directory */
|
|
4
4
|
export declare const configDir: string;
|
|
5
5
|
/** The (optional) absolute path of an external configuration directory */
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getExternalConfigDirEnvVariable(): string | undefined;
|
|
7
7
|
export declare function getDeviceEntryPredicate(manufacturerId: number, productType: number, productId: number, firmwareVersion?: string): (entry: DeviceConfigIndexEntry) => boolean;
|
|
8
8
|
export type SyncExternalConfigDirResult = {
|
|
9
9
|
success: false;
|
|
@@ -14,6 +14,6 @@ export type SyncExternalConfigDirResult = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Synchronizes or updates the external config directory and returns whether the directory is in a state that can be used
|
|
16
16
|
*/
|
|
17
|
-
export declare function syncExternalConfigDir(logger: ConfigLogger): Promise<SyncExternalConfigDirResult>;
|
|
17
|
+
export declare function syncExternalConfigDir(extConfigDir: string, logger: ConfigLogger): Promise<SyncExternalConfigDirResult>;
|
|
18
18
|
export declare function versionInRange(version: string, min: string, max: string): boolean;
|
|
19
19
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/esm/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAIxE,gEAAgE;AAChE,eAAO,MAAM,SAAS,QAGrB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAIxE,gEAAgE;AAChE,eAAO,MAAM,SAAS,QAGrB,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,+BAA+B,IAAI,MAAM,GAAG,SAAS,CAEpE;AAED,wBAAgB,uBAAuB,CACtC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACtB,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAoB5C;AAED,MAAM,MAAM,2BAA2B,GACpC;IACD,OAAO,EAAE,KAAK,CAAC;CACf,GACC;IACD,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEH;;GAEG;AACH,wBAAsB,qBAAqB,CAC1C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,2BAA2B,CAAC,CAuEtC;AAED,wBAAgB,cAAc,CAC7B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,OAAO,CAKT"}
|
package/build/esm/utils.js
CHANGED
|
@@ -8,7 +8,7 @@ const require = createRequire(import.meta.url);
|
|
|
8
8
|
/** The absolute path of the embedded configuration directory */
|
|
9
9
|
export const configDir = path.resolve(path.dirname(require.resolve("@zwave-js/config/package.json")), "config");
|
|
10
10
|
/** The (optional) absolute path of an external configuration directory */
|
|
11
|
-
export function
|
|
11
|
+
export function getExternalConfigDirEnvVariable() {
|
|
12
12
|
return process.env.ZWAVEJS_EXTERNAL_CONFIG;
|
|
13
13
|
}
|
|
14
14
|
export function getDeviceEntryPredicate(manufacturerId, productType, productId, firmwareVersion) {
|
|
@@ -30,8 +30,7 @@ export function getDeviceEntryPredicate(manufacturerId, productType, productId,
|
|
|
30
30
|
/**
|
|
31
31
|
* Synchronizes or updates the external config directory and returns whether the directory is in a state that can be used
|
|
32
32
|
*/
|
|
33
|
-
export async function syncExternalConfigDir(logger) {
|
|
34
|
-
const extConfigDir = externalConfigDir();
|
|
33
|
+
export async function syncExternalConfigDir(extConfigDir, logger) {
|
|
35
34
|
if (!extConfigDir)
|
|
36
35
|
return { success: false };
|
|
37
36
|
// Make sure the config dir exists
|
package/build/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB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AAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAC9B,CAAC;QACF,MAAM,EAAE,CAAC,SAAS,CAAC,uBAAuB,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QACpE,eAAe,GAAG,cAAc,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACR,uBAAuB;QACvB,MAAM,CAAC,KAAK,CACX,kEAAkE,EAClE,OAAO,CACP,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,cAAc,CAC7B,OAAe,EACf,GAAW,EACX,GAAW;IAEX,OAAO,CACN,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;WAC7C,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CACnD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwave-js/config",
|
|
3
|
-
"version": "14.0.0
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "zwave-js: configuration files",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"test:dirty": "tsx ../maintenance/src/resolveDirtyTests.ts --run"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@zwave-js/core": "14.0.0
|
|
62
|
-
"@zwave-js/shared": "14.0.0
|
|
61
|
+
"@zwave-js/core": "14.0.0",
|
|
62
|
+
"@zwave-js/shared": "14.0.0",
|
|
63
63
|
"alcalzone-shared": "^4.0.8",
|
|
64
64
|
"ansi-colors": "^4.1.3",
|
|
65
65
|
"json-logic-js": "^2.0.5",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/sinon": "^17.0.3",
|
|
79
79
|
"@types/xml2js": "^0.4.14",
|
|
80
80
|
"@types/yargs": "^17.0.33",
|
|
81
|
-
"@zwave-js/maintenance": "14.0.0
|
|
81
|
+
"@zwave-js/maintenance": "14.0.0",
|
|
82
82
|
"comment-json": "^4.2.5",
|
|
83
83
|
"del-cli": "^6.0.0",
|
|
84
84
|
"es-main": "^1.3.0",
|