@zwave-js/config 14.0.0-beta.1 → 14.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/build/{ConfigManager.d.ts → cjs/ConfigManager.d.ts} +5 -2
  2. package/build/cjs/ConfigManager.js +217 -0
  3. package/build/cjs/ConfigManager.js.map +7 -0
  4. package/build/cjs/JsonTemplate.js +198 -0
  5. package/build/cjs/JsonTemplate.js.map +7 -0
  6. package/build/{Logger.d.ts → cjs/Logger.d.ts} +1 -1
  7. package/build/cjs/Logger.js +50 -0
  8. package/build/cjs/Logger.js.map +7 -0
  9. package/build/cjs/Logger_safe.js +32 -0
  10. package/build/cjs/Logger_safe.js.map +7 -0
  11. package/build/cjs/Logic.js +71 -0
  12. package/build/cjs/Logic.js.map +7 -0
  13. package/build/cjs/LogicParser.js +1343 -0
  14. package/build/cjs/LogicParser.js.map +7 -0
  15. package/build/cjs/Manufacturers.js +88 -0
  16. package/build/cjs/Manufacturers.js.map +7 -0
  17. package/build/cjs/_version.d.ts +2 -0
  18. package/build/cjs/_version.js +29 -0
  19. package/build/cjs/_version.js.map +7 -0
  20. package/build/{devices → cjs/devices}/AssociationConfig.d.ts +2 -2
  21. package/build/cjs/devices/AssociationConfig.js +93 -0
  22. package/build/cjs/devices/AssociationConfig.js.map +7 -0
  23. package/build/{devices → cjs/devices}/CompatConfig.d.ts +2 -2
  24. package/build/cjs/devices/CompatConfig.js +584 -0
  25. package/build/cjs/devices/CompatConfig.js.map +7 -0
  26. package/build/{devices → cjs/devices}/ConditionalItem.d.ts +1 -1
  27. package/build/cjs/devices/ConditionalItem.js +107 -0
  28. package/build/cjs/devices/ConditionalItem.js.map +7 -0
  29. package/build/{devices → cjs/devices}/ConditionalPrimitive.d.ts +2 -2
  30. package/build/cjs/devices/ConditionalPrimitive.js +59 -0
  31. package/build/cjs/devices/ConditionalPrimitive.js.map +7 -0
  32. package/build/{devices → cjs/devices}/DeviceConfig.d.ts +7 -7
  33. package/build/cjs/devices/DeviceConfig.js +502 -0
  34. package/build/cjs/devices/DeviceConfig.js.map +7 -0
  35. package/build/cjs/devices/DeviceConfig.unit._test.js +17 -0
  36. package/build/cjs/devices/DeviceConfig.unit._test.js.map +7 -0
  37. package/build/{devices → cjs/devices}/DeviceMetadata.d.ts +3 -3
  38. package/build/cjs/devices/DeviceMetadata.js +112 -0
  39. package/build/cjs/devices/DeviceMetadata.js.map +7 -0
  40. package/build/{devices → cjs/devices}/EndpointConfig.d.ts +5 -5
  41. package/build/cjs/devices/EndpointConfig.js +87 -0
  42. package/build/cjs/devices/EndpointConfig.js.map +7 -0
  43. package/build/{devices → cjs/devices}/ParamInformation.d.ts +3 -3
  44. package/build/cjs/devices/ParamInformation.js +209 -0
  45. package/build/cjs/devices/ParamInformation.js.map +7 -0
  46. package/build/cjs/devices/shared.js +17 -0
  47. package/build/cjs/devices/shared.js.map +7 -0
  48. package/build/cjs/index.d.ts +12 -0
  49. package/build/cjs/index.js +50 -0
  50. package/build/cjs/index.js.map +7 -0
  51. package/build/cjs/index_safe.d.ts +3 -0
  52. package/build/cjs/index_safe.js +32 -0
  53. package/build/cjs/index_safe.js.map +7 -0
  54. package/build/cjs/package.json +3 -0
  55. package/build/{utils.d.ts → cjs/utils.d.ts} +4 -4
  56. package/build/cjs/utils.js +116 -0
  57. package/build/cjs/utils.js.map +7 -0
  58. package/build/cjs/utils_safe.js +57 -0
  59. package/build/cjs/utils_safe.js.map +7 -0
  60. package/build/esm/ConfigManager.d.ts +60 -0
  61. package/build/esm/ConfigManager.d.ts.map +1 -0
  62. package/build/{ConfigManager.js → esm/ConfigManager.js} +47 -44
  63. package/build/esm/ConfigManager.js.map +1 -0
  64. package/build/esm/JsonTemplate.d.ts +4 -0
  65. package/build/esm/JsonTemplate.d.ts.map +1 -0
  66. package/build/{JsonTemplate.js → esm/JsonTemplate.js} +30 -60
  67. package/build/esm/JsonTemplate.js.map +1 -0
  68. package/build/esm/Logger.d.ts +11 -0
  69. package/build/esm/Logger.d.ts.map +1 -0
  70. package/build/esm/Logger.js +23 -0
  71. package/build/esm/Logger.js.map +1 -0
  72. package/build/esm/Logger_safe.d.ts +5 -0
  73. package/build/esm/Logger_safe.d.ts.map +1 -0
  74. package/build/esm/Logger_safe.js +3 -0
  75. package/build/esm/Logger_safe.js.map +1 -0
  76. package/build/esm/Logic.d.ts +4 -0
  77. package/build/esm/Logic.d.ts.map +1 -0
  78. package/build/esm/Logic.js +35 -0
  79. package/build/esm/Logic.js.map +1 -0
  80. package/build/esm/LogicParser.d.ts +93 -0
  81. package/build/esm/LogicParser.d.ts.map +1 -0
  82. package/build/{LogicParser.js → esm/LogicParser.js} +2 -5
  83. package/build/{LogicParser.js.map → esm/LogicParser.js.map} +1 -1
  84. package/build/esm/Manufacturers.d.ts +6 -0
  85. package/build/esm/Manufacturers.d.ts.map +1 -0
  86. package/build/esm/Manufacturers.js +55 -0
  87. package/build/esm/Manufacturers.js.map +1 -0
  88. package/build/esm/_version.d.ts +2 -0
  89. package/build/esm/_version.d.ts.map +1 -0
  90. package/build/esm/_version.js +3 -0
  91. package/build/esm/_version.js.map +1 -0
  92. package/build/esm/devices/AssociationConfig.d.ts +27 -0
  93. package/build/esm/devices/AssociationConfig.d.ts.map +1 -0
  94. package/build/{devices → esm/devices}/AssociationConfig.js +12 -16
  95. package/build/esm/devices/AssociationConfig.js.map +1 -0
  96. package/build/esm/devices/CompatConfig.d.ts +112 -0
  97. package/build/esm/devices/CompatConfig.d.ts.map +1 -0
  98. package/build/{devices → esm/devices}/CompatConfig.js +112 -119
  99. package/build/esm/devices/CompatConfig.js.map +1 -0
  100. package/build/esm/devices/ConditionalItem.d.ts +14 -0
  101. package/build/esm/devices/ConditionalItem.d.ts.map +1 -0
  102. package/build/{devices → esm/devices}/ConditionalItem.js +15 -21
  103. package/build/esm/devices/ConditionalItem.js.map +1 -0
  104. package/build/esm/devices/ConditionalPrimitive.d.ts +13 -0
  105. package/build/esm/devices/ConditionalPrimitive.d.ts.map +1 -0
  106. package/build/esm/devices/ConditionalPrimitive.js +35 -0
  107. package/build/esm/devices/ConditionalPrimitive.js.map +1 -0
  108. package/build/esm/devices/DeviceConfig.d.ts +117 -0
  109. package/build/esm/devices/DeviceConfig.d.ts.map +1 -0
  110. package/build/{devices → esm/devices}/DeviceConfig.js +96 -108
  111. package/build/esm/devices/DeviceConfig.js.map +1 -0
  112. package/build/esm/devices/DeviceConfig.unit._test.d.ts +2 -0
  113. package/build/esm/devices/DeviceConfig.unit._test.d.ts.map +1 -0
  114. package/build/{devices → esm/devices}/DeviceConfig.unit._test.js +1 -2
  115. package/build/esm/devices/DeviceConfig.unit._test.js.map +1 -0
  116. package/build/esm/devices/DeviceMetadata.d.ts +41 -0
  117. package/build/esm/devices/DeviceMetadata.d.ts.map +1 -0
  118. package/build/{devices → esm/devices}/DeviceMetadata.js +16 -21
  119. package/build/esm/devices/DeviceMetadata.js.map +1 -0
  120. package/build/esm/devices/EndpointConfig.d.ts +20 -0
  121. package/build/esm/devices/EndpointConfig.d.ts.map +1 -0
  122. package/build/esm/devices/EndpointConfig.js +60 -0
  123. package/build/esm/devices/EndpointConfig.js.map +1 -0
  124. package/build/esm/devices/ParamInformation.d.ts +50 -0
  125. package/build/esm/devices/ParamInformation.d.ts.map +1 -0
  126. package/build/{devices → esm/devices}/ParamInformation.js +38 -44
  127. package/build/esm/devices/ParamInformation.js.map +1 -0
  128. package/build/esm/devices/shared.d.ts +11 -0
  129. package/build/esm/devices/shared.d.ts.map +1 -0
  130. package/build/esm/devices/shared.js +2 -0
  131. package/build/{devices → esm/devices}/shared.js.map +1 -1
  132. package/build/esm/index.d.ts +12 -0
  133. package/build/esm/index.d.ts.map +1 -0
  134. package/build/esm/index.js +13 -0
  135. package/build/esm/index.js.map +1 -0
  136. package/build/esm/index_safe.d.ts +3 -0
  137. package/build/esm/index_safe.d.ts.map +1 -0
  138. package/build/esm/index_safe.js +4 -0
  139. package/build/esm/index_safe.js.map +1 -0
  140. package/build/esm/package.json +3 -0
  141. package/build/esm/utils.d.ts +19 -0
  142. package/build/esm/utils.d.ts.map +1 -0
  143. package/build/esm/utils.js +92 -0
  144. package/build/esm/utils.js.map +1 -0
  145. package/build/esm/utils_safe.d.ts +7 -0
  146. package/build/esm/utils_safe.d.ts.map +1 -0
  147. package/build/esm/utils_safe.js +28 -0
  148. package/build/esm/utils_safe.js.map +1 -0
  149. package/package.json +22 -19
  150. package/build/ConfigManager.d.ts.map +0 -1
  151. package/build/ConfigManager.js.map +0 -1
  152. package/build/JsonTemplate.d.ts.map +0 -1
  153. package/build/JsonTemplate.js.map +0 -1
  154. package/build/Logger.d.ts.map +0 -1
  155. package/build/Logger.js +0 -27
  156. package/build/Logger.js.map +0 -1
  157. package/build/Logger_safe.d.ts.map +0 -1
  158. package/build/Logger_safe.js +0 -6
  159. package/build/Logger_safe.js.map +0 -1
  160. package/build/Logic.d.ts.map +0 -1
  161. package/build/Logic.js +0 -60
  162. package/build/Logic.js.map +0 -1
  163. package/build/LogicParser.d.ts.map +0 -1
  164. package/build/Manufacturers.d.ts.map +0 -1
  165. package/build/Manufacturers.js +0 -62
  166. package/build/Manufacturers.js.map +0 -1
  167. package/build/_version.d.ts +0 -2
  168. package/build/_version.d.ts.map +0 -1
  169. package/build/_version.js +0 -6
  170. package/build/_version.js.map +0 -1
  171. package/build/devices/AssociationConfig.d.ts.map +0 -1
  172. package/build/devices/AssociationConfig.js.map +0 -1
  173. package/build/devices/CompatConfig.d.ts.map +0 -1
  174. package/build/devices/CompatConfig.js.map +0 -1
  175. package/build/devices/ConditionalItem.d.ts.map +0 -1
  176. package/build/devices/ConditionalItem.js.map +0 -1
  177. package/build/devices/ConditionalPrimitive.d.ts.map +0 -1
  178. package/build/devices/ConditionalPrimitive.js +0 -40
  179. package/build/devices/ConditionalPrimitive.js.map +0 -1
  180. package/build/devices/DeviceConfig.d.ts.map +0 -1
  181. package/build/devices/DeviceConfig.js.map +0 -1
  182. package/build/devices/DeviceConfig.unit._test.d.ts.map +0 -1
  183. package/build/devices/DeviceConfig.unit._test.js.map +0 -1
  184. package/build/devices/DeviceMetadata.d.ts.map +0 -1
  185. package/build/devices/DeviceMetadata.js.map +0 -1
  186. package/build/devices/EndpointConfig.d.ts.map +0 -1
  187. package/build/devices/EndpointConfig.js +0 -64
  188. package/build/devices/EndpointConfig.js.map +0 -1
  189. package/build/devices/ParamInformation.d.ts.map +0 -1
  190. package/build/devices/ParamInformation.js.map +0 -1
  191. package/build/devices/shared.d.ts.map +0 -1
  192. package/build/devices/shared.js +0 -3
  193. package/build/index.d.ts +0 -13
  194. package/build/index.d.ts.map +0 -1
  195. package/build/index.js +0 -33
  196. package/build/index.js.map +0 -1
  197. package/build/index_safe.d.ts +0 -3
  198. package/build/index_safe.d.ts.map +0 -1
  199. package/build/index_safe.js +0 -22
  200. package/build/index_safe.js.map +0 -1
  201. package/build/utils.d.ts.map +0 -1
  202. package/build/utils.js +0 -124
  203. package/build/utils.js.map +0 -1
  204. package/build/utils_safe.d.ts.map +0 -1
  205. package/build/utils_safe.js +0 -33
  206. package/build/utils_safe.js.map +0 -1
  207. /package/build/{JsonTemplate.d.ts → cjs/JsonTemplate.d.ts} +0 -0
  208. /package/build/{Logger_safe.d.ts → cjs/Logger_safe.d.ts} +0 -0
  209. /package/build/{Logic.d.ts → cjs/Logic.d.ts} +0 -0
  210. /package/build/{LogicParser.d.ts → cjs/LogicParser.d.ts} +0 -0
  211. /package/build/{Manufacturers.d.ts → cjs/Manufacturers.d.ts} +0 -0
  212. /package/build/{devices → cjs/devices}/DeviceConfig.unit._test.d.ts +0 -0
  213. /package/build/{devices → cjs/devices}/shared.d.ts +0 -0
  214. /package/build/{utils_safe.d.ts → cjs/utils_safe.d.ts} +0 -0
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConditionalDeviceComment = exports.ConditionalDeviceMetadata = void 0;
4
- const safe_1 = require("@zwave-js/shared/safe");
5
- const typeguards_1 = require("alcalzone-shared/typeguards");
6
- const utils_safe_1 = require("../utils_safe");
7
- const ConditionalItem_1 = require("./ConditionalItem");
8
- const ConditionalPrimitive_1 = require("./ConditionalPrimitive");
9
- class ConditionalDeviceMetadata {
1
+ import { pick } from "@zwave-js/shared/safe";
2
+ import { isArray, isObject } from "alcalzone-shared/typeguards/index.js";
3
+ import { throwInvalidConfig } from "../utils_safe.js";
4
+ import { conditionApplies, evaluateDeep, } from "./ConditionalItem.js";
5
+ import { parseConditionalPrimitive, } from "./ConditionalPrimitive.js";
6
+ export class ConditionalDeviceMetadata {
10
7
  constructor(filename, definition) {
11
8
  for (const prop of [
12
9
  "wakeup",
@@ -16,29 +13,29 @@ class ConditionalDeviceMetadata {
16
13
  "manual",
17
14
  ]) {
18
15
  if (prop in definition) {
19
- this[prop] = (0, ConditionalPrimitive_1.parseConditionalPrimitive)(filename, "string", prop, definition[prop], "The metadata entry ");
16
+ this[prop] = parseConditionalPrimitive(filename, "string", prop, definition[prop], "The metadata entry ");
20
17
  }
21
18
  }
22
19
  if ("comments" in definition) {
23
20
  const value = definition.comments;
24
- const isComment = (opt) => (0, typeguards_1.isObject)(opt)
21
+ const isComment = (opt) => isObject(opt)
25
22
  && typeof opt.level === "string"
26
23
  && typeof opt.text === "string";
27
24
  if (isComment(value)) {
28
25
  this.comments = new ConditionalDeviceComment(value.level, value.text, value.$if);
29
26
  }
30
- else if ((0, typeguards_1.isArray)(value) && value.every(isComment)) {
27
+ else if (isArray(value) && value.every(isComment)) {
31
28
  this.comments = value.map((c) => new ConditionalDeviceComment(c.level, c.text, c.$if));
32
29
  }
33
30
  else {
34
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${filename}:
31
+ throwInvalidConfig("devices", `packages/config/config/devices/${filename}:
35
32
  The metadata entry comments is invalid!`);
36
33
  }
37
34
  }
38
35
  }
39
36
  condition;
40
37
  evaluateCondition(deviceId) {
41
- if (!(0, ConditionalItem_1.conditionApplies)(this, deviceId))
38
+ if (!conditionApplies(this, deviceId))
42
39
  return;
43
40
  const ret = {};
44
41
  for (const prop of [
@@ -49,12 +46,12 @@ The metadata entry comments is invalid!`);
49
46
  "manual",
50
47
  ]) {
51
48
  if (this[prop]) {
52
- const evaluated = (0, ConditionalItem_1.evaluateDeep)(this[prop], deviceId);
49
+ const evaluated = evaluateDeep(this[prop], deviceId);
53
50
  if (evaluated)
54
51
  ret[prop] = evaluated;
55
52
  }
56
53
  }
57
- const comments = (0, ConditionalItem_1.evaluateDeep)(this.comments, deviceId, true);
54
+ const comments = evaluateDeep(this.comments, deviceId, true);
58
55
  if (comments)
59
56
  ret.comments = comments;
60
57
  return ret;
@@ -72,8 +69,7 @@ The metadata entry comments is invalid!`);
72
69
  /** Comments for this device */
73
70
  comments;
74
71
  }
75
- exports.ConditionalDeviceMetadata = ConditionalDeviceMetadata;
76
- class ConditionalDeviceComment {
72
+ export class ConditionalDeviceComment {
77
73
  level;
78
74
  text;
79
75
  condition;
@@ -83,10 +79,9 @@ class ConditionalDeviceComment {
83
79
  this.condition = condition;
84
80
  }
85
81
  evaluateCondition(deviceId) {
86
- if (!(0, ConditionalItem_1.conditionApplies)(this, deviceId))
82
+ if (!conditionApplies(this, deviceId))
87
83
  return;
88
- return (0, safe_1.pick)(this, ["level", "text"]);
84
+ return pick(this, ["level", "text"]);
89
85
  }
90
86
  }
91
- exports.ConditionalDeviceComment = ConditionalDeviceComment;
92
87
  //# sourceMappingURL=DeviceMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceMetadata.js","sourceRoot":"","sources":["../../../src/devices/DeviceMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAEN,gBAAgB,EA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AE,QAAQ,CAAC;YAAE,OAAO;QAC9C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC;CACD"}
@@ -0,0 +1,20 @@
1
+ import type { JSONObject } from "@zwave-js/shared/safe";
2
+ import { type AssociationConfig, ConditionalAssociationConfig } from "./AssociationConfig.js";
3
+ import { type ConditionalItem } from "./ConditionalItem.js";
4
+ import type { ConditionalDeviceConfig } from "./DeviceConfig.js";
5
+ import { type ConditionalParamInfoMap, type ParamInfoMap } from "./ParamInformation.js";
6
+ import type { DeviceID } from "./shared.js";
7
+ export declare class ConditionalEndpointConfig implements ConditionalItem<EndpointConfig> {
8
+ constructor(parent: ConditionalDeviceConfig, index: number, definition: JSONObject);
9
+ readonly index: number;
10
+ readonly associations?: ReadonlyMap<number, ConditionalAssociationConfig>;
11
+ readonly paramInformation?: ConditionalParamInfoMap;
12
+ readonly condition?: string;
13
+ readonly label?: string;
14
+ evaluateCondition(deviceId?: DeviceID): EndpointConfig | undefined;
15
+ }
16
+ export type EndpointConfig = Omit<ConditionalEndpointConfig, "condition" | "evaluateCondition" | "associations" | "paramInformation"> & {
17
+ associations?: Map<number, AssociationConfig> | undefined;
18
+ paramInformation?: ParamInfoMap;
19
+ };
20
+ //# sourceMappingURL=EndpointConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndpointConfig.d.ts","sourceRoot":"","sources":["../../../src/devices/EndpointConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EACN,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,KAAK,eAAe,EAIpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,qBAAa,yBACZ,YAAW,eAAe,CAAC,cAAc,CAAC;gBAGzC,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,UAAU;IAsEvB,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,YAAY,CAAC,EAAE,WAAW,CACzC,MAAM,EACN,4BAA4B,CAC5B,CAAC;IAEF,SAAgB,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAE3D,SAAgB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnC,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS;CAczE;AAED,MAAM,MAAM,cAAc,GACvB,IAAI,CACL,yBAAyB,EACzB,WAAW,GAAG,mBAAmB,GAAG,cAAc,GAAG,kBAAkB,CACvE,GACC;IACD,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAAS,CAAC;IAC1D,gBAAgB,CAAC,EAAE,YAAY,CAAC;CAChC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { isObject } from "alcalzone-shared/typeguards/index.js";
2
+ import { throwInvalidConfig } from "../utils_safe.js";
3
+ import { ConditionalAssociationConfig, } from "./AssociationConfig.js";
4
+ import { conditionApplies, evaluateDeep, validateCondition, } from "./ConditionalItem.js";
5
+ import { parseConditionalParamInformationMap, } from "./ParamInformation.js";
6
+ export class ConditionalEndpointConfig {
7
+ constructor(parent, index, definition) {
8
+ this.index = index;
9
+ const filename = parent.filename;
10
+ validateCondition(filename, definition, `Endpoint ${index} contains an`);
11
+ this.condition = definition.$if;
12
+ if (definition.label != undefined) {
13
+ if (typeof definition.label !== "string") {
14
+ throwInvalidConfig(`device`, `packages/config/config/devices/${filename}:
15
+ Endpoint ${index}: label is not a string`);
16
+ }
17
+ this.label = definition.label;
18
+ }
19
+ if (definition.associations != undefined) {
20
+ const associations = new Map();
21
+ if (!isObject(definition.associations)) {
22
+ throwInvalidConfig(`device`, `packages/config/config/devices/${filename}:
23
+ Endpoint ${index}: associations is not an object`);
24
+ }
25
+ for (const [key, assocDefinition] of Object.entries(definition.associations)) {
26
+ if (!/^[1-9][0-9]*$/.test(key)) {
27
+ throwInvalidConfig(`device`, `packages/config/config/devices/${filename}:
28
+ Endpoint ${index}: found non-numeric group id "${key}" in associations`);
29
+ }
30
+ const keyNum = parseInt(key, 10);
31
+ associations.set(keyNum, new ConditionalAssociationConfig(filename, keyNum, assocDefinition));
32
+ }
33
+ this.associations = associations;
34
+ }
35
+ if (definition.paramInformation != undefined) {
36
+ this.paramInformation = parseConditionalParamInformationMap(definition, parent, `Endpoint ${index}: `);
37
+ }
38
+ }
39
+ index;
40
+ associations;
41
+ paramInformation;
42
+ condition;
43
+ label;
44
+ evaluateCondition(deviceId) {
45
+ if (!conditionApplies(this, deviceId))
46
+ return;
47
+ const ret = {
48
+ index: this.index,
49
+ label: this.label,
50
+ };
51
+ const associations = evaluateDeep(this.associations, deviceId);
52
+ if (associations)
53
+ ret.associations = associations;
54
+ const paramInformation = evaluateDeep(this.paramInformation, deviceId);
55
+ if (paramInformation)
56
+ ret.paramInformation = paramInformation;
57
+ return ret;
58
+ }
59
+ }
60
+ //# sourceMappingURL=EndpointConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndpointConfig.js","sourceRoot":"","sources":["../../../src/devices/EndpointConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAEN,4BAA4B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEN,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GACjB,M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,GAAG,EAAE,EAAE,CAAC,CAAC;gBACjC,YAAY,CAAC,GAAG,CACf,MAAM,EACN,IAAI,4BAA4B,CAC/B,QAAQ,EACR,MAAM,EACN,eAAsB,CACtB,CACD,CAAC;YACH,CAAC;YACD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAClC,CAAC;QAED,IAAI,UAAU,CAAC,gBAAgB,IAAI,SAAS,EAAE,CAAC;YAC9C,IAAI,CAAC,gBAAgB,GAAG,mCAAmC,CAC1D,UAAU,EACV,MAAM,EACN,YAAY,KAAK,IAAI,CACrB,CAAC;QACH,CAAC;IACF,CAAC;IAEe,KAAK,CAAS;IACd,YAAY,CAG1B;IAEc,gBAAgB,CAA2B;IAE3C,SAAS,CAAU;IACnB,KAAK,CAAU;IAExB,iBAAiB,CAAC,QAAmB;QAC3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC;YAAE,OAAO;QAC9C,MAAM,GAAG,GAAmB;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,CAAC;QACF,MAAM,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAC/D,IAAI,YAAY;YAAE,GAAG,CAAC,YAAY,GAAG,YAAY,CAAC;QAElD,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACvE,IAAI,gBAAgB;YAAE,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAE9D,OAAO,GAAG,CAAC;IACZ,CAAC;CACD"}
@@ -0,0 +1,50 @@
1
+ import { type JSONObject, type ReadonlyObjectKeyMap } from "@zwave-js/shared/safe";
2
+ import { type ConditionalItem } from "./ConditionalItem.js";
3
+ import type { ConditionalDeviceConfig } from "./DeviceConfig.js";
4
+ import type { DeviceID } from "./shared.js";
5
+ export declare class ConditionalParamInformation implements ConditionalItem<ParamInformation> {
6
+ constructor(parent: ConditionalDeviceConfig, parameterNumber: number, valueBitMask: number | undefined, definition: JSONObject);
7
+ private parent;
8
+ readonly parameterNumber: number;
9
+ readonly valueBitMask?: number;
10
+ readonly label: string;
11
+ readonly description?: string;
12
+ readonly valueSize: number;
13
+ readonly minValue?: number;
14
+ readonly maxValue?: number;
15
+ readonly unsigned?: boolean;
16
+ readonly defaultValue: number;
17
+ readonly unit?: string;
18
+ readonly readOnly?: true;
19
+ readonly writeOnly?: true;
20
+ readonly allowManualEntry: boolean;
21
+ readonly options: readonly ConditionalConfigOption[];
22
+ readonly condition?: string;
23
+ evaluateCondition(deviceId?: DeviceID): ParamInformation | undefined;
24
+ }
25
+ export type ParamInformation = Omit<ConditionalParamInformation, "condition" | "evaluateCondition" | "options" | "minValue" | "maxValue"> & {
26
+ options: readonly ConfigOption[];
27
+ minValue: NonNullable<ConditionalParamInformation["minValue"]>;
28
+ maxValue: NonNullable<ConditionalParamInformation["maxValue"]>;
29
+ };
30
+ export declare class ConditionalConfigOption implements ConditionalItem<ConfigOption> {
31
+ readonly value: number;
32
+ readonly label: string;
33
+ readonly condition?: string | undefined;
34
+ constructor(value: number, label: string, condition?: string | undefined);
35
+ evaluateCondition(deviceId?: DeviceID): ConfigOption | undefined;
36
+ }
37
+ export interface ConfigOption {
38
+ value: number;
39
+ label: string;
40
+ }
41
+ export type ConditionalParamInfoMap = ReadonlyObjectKeyMap<{
42
+ parameter: number;
43
+ valueBitMask?: number;
44
+ }, ConditionalParamInformation[]>;
45
+ export type ParamInfoMap = ReadonlyObjectKeyMap<{
46
+ parameter: number;
47
+ valueBitMask?: number;
48
+ }, ParamInformation>;
49
+ export declare function parseConditionalParamInformationMap(definition: JSONObject, parent: ConditionalDeviceConfig, errorPrefix?: string): ConditionalParamInfoMap;
50
+ //# sourceMappingURL=ParamInformation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParamInformation.d.ts","sourceRoot":"","sources":["../../../src/devices/Par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AI,CACL,2BAA2B,EAC3B,WAAW,GAAG,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CACvE,GACC;IACD,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/D,QAAQ,EAAE,WAAW,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC,CAAC;CAC/D,CAAC;AAEH,qBAAa,uBAAwB,YAAW,eAAe,CAAC,YAAY,CAAC;aAE3D,KAAK,EAAE,MAAM;aACb,KAAK,EAAE,MAAM;aACb,SAAS,CAAC,EAAE,MAAM;gBAFlB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,YAAA;IAG5B,iBAAiB,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS;CAKvE;AAED,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CACzD;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5C,2BAA2B,EAAE,CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAC9C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5C,gBAAgB,CAChB,CAAC;AAEF,wBAAgB,mCAAmC,CAClD,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,uBAAuB,EAC/B,WAAW,GAAE,MAAW,GACtB,uBAAuB,CA6DzB"}
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConditionalConfigOption = exports.ConditionalParamInformation = void 0;
4
- exports.parseConditionalParamInformationMap = parseConditionalParamInformationMap;
5
- const core_1 = require("@zwave-js/core");
6
- const safe_1 = require("@zwave-js/shared/safe");
7
- const typeguards_1 = require("alcalzone-shared/typeguards");
8
- const utils_safe_1 = require("../utils_safe");
9
- const ConditionalItem_1 = require("./ConditionalItem");
10
- class ConditionalParamInformation {
1
+ import { tryParseParamNumber } from "@zwave-js/core";
2
+ import { ObjectKeyMap, pick, } from "@zwave-js/shared/safe";
3
+ import { isArray, isObject } from "alcalzone-shared/typeguards/index.js";
4
+ import { throwInvalidConfig } from "../utils_safe.js";
5
+ import { conditionApplies, evaluateDeep, validateCondition, } from "./ConditionalItem.js";
6
+ export class ConditionalParamInformation {
11
7
  constructor(parent, parameterNumber, valueBitMask, definition) {
12
8
  this.parent = parent;
13
9
  this.parameterNumber = parameterNumber;
@@ -15,81 +11,81 @@ class ConditionalParamInformation {
15
11
  // No need to validate here, this should be done one level higher
16
12
  this.condition = definition.$if;
17
13
  if (typeof definition.label !== "string") {
18
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
14
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
19
15
  Parameter #${parameterNumber} has a non-string label`);
20
16
  }
21
17
  this.label = definition.label;
22
18
  if (definition.description != undefined
23
19
  && typeof definition.description !== "string") {
24
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
20
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
25
21
  Parameter #${parameterNumber} has a non-string description`);
26
22
  }
27
23
  this.description = definition.description;
28
24
  if (typeof definition.valueSize !== "number"
29
25
  || definition.valueSize <= 0) {
30
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
26
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
31
27
  Parameter #${parameterNumber} has an invalid value size`);
32
28
  }
33
29
  this.valueSize = definition.valueSize;
34
30
  if (definition.minValue != undefined
35
31
  && typeof definition.minValue !== "number") {
36
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
32
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
37
33
  Parameter #${parameterNumber} has a non-numeric property minValue`);
38
34
  }
39
35
  this.minValue = definition.minValue;
40
36
  if (definition.maxValue != undefined
41
37
  && typeof definition.maxValue !== "number") {
42
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
38
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
43
39
  Parameter #${parameterNumber} has a non-numeric property maxValue`);
44
40
  }
45
41
  this.maxValue = definition.maxValue;
46
42
  if (definition.unsigned != undefined
47
43
  && typeof definition.unsigned !== "boolean") {
48
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
44
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
49
45
  Parameter #${parameterNumber} has a non-boolean property unsigned`);
50
46
  }
51
47
  this.unsigned = definition.unsigned === true;
52
48
  if (definition.unit != undefined
53
49
  && typeof definition.unit !== "string") {
54
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
50
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
55
51
  Parameter #${parameterNumber} has a non-string unit`);
56
52
  }
57
53
  this.unit = definition.unit;
58
54
  if (definition.readOnly != undefined && definition.readOnly !== true) {
59
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
55
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
60
56
  Parameter #${parameterNumber}: readOnly must true or omitted!`);
61
57
  }
62
58
  this.readOnly = definition.readOnly;
63
59
  if (definition.writeOnly != undefined
64
60
  && definition.writeOnly !== true) {
65
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
61
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
66
62
  Parameter #${parameterNumber}: writeOnly must be true or omitted!`);
67
63
  }
68
64
  this.writeOnly = definition.writeOnly;
69
65
  if (definition.defaultValue == undefined) {
70
66
  if (!this.readOnly) {
71
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
67
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
72
68
  Parameter #${parameterNumber} is missing defaultValue, which is required unless the parameter is readOnly`);
73
69
  }
74
70
  }
75
71
  else if (typeof definition.defaultValue !== "number") {
76
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
72
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
77
73
  Parameter #${parameterNumber} has a non-numeric property defaultValue`);
78
74
  }
79
75
  this.defaultValue = definition.defaultValue;
80
76
  if (definition.allowManualEntry != undefined
81
77
  && definition.allowManualEntry !== false) {
82
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
78
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
83
79
  Parameter #${parameterNumber}: allowManualEntry must be false or omitted!`);
84
80
  }
85
81
  // Default to allowing manual entry, except if the param is readonly
86
82
  this.allowManualEntry = definition.allowManualEntry
87
83
  ?? (this.readOnly ? false : true);
88
- if ((0, typeguards_1.isArray)(definition.options)
89
- && !definition.options.every((opt) => (0, typeguards_1.isObject)(opt)
84
+ if (isArray(definition.options)
85
+ && !definition.options.every((opt) => isObject(opt)
90
86
  && typeof opt.label === "string"
91
87
  && typeof opt.value === "number")) {
92
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${parent.filename}:
88
+ throwInvalidConfig("devices", `packages/config/config/devices/${parent.filename}:
93
89
  Parameter #${parameterNumber}: options is malformed!`);
94
90
  }
95
91
  this.options = definition.options?.map((opt) => new ConditionalConfigOption(opt.value, opt.label, opt.$if)) ?? [];
@@ -111,10 +107,10 @@ Parameter #${parameterNumber}: options is malformed!`);
111
107
  options;
112
108
  condition;
113
109
  evaluateCondition(deviceId) {
114
- if (!(0, ConditionalItem_1.conditionApplies)(this, deviceId))
110
+ if (!conditionApplies(this, deviceId))
115
111
  return;
116
112
  const ret = {
117
- ...(0, safe_1.pick)(this, [
113
+ ...pick(this, [
118
114
  "parameterNumber",
119
115
  "valueBitMask",
120
116
  "label",
@@ -129,7 +125,7 @@ Parameter #${parameterNumber}: options is malformed!`);
129
125
  "writeOnly",
130
126
  "allowManualEntry",
131
127
  ]),
132
- options: (0, ConditionalItem_1.evaluateDeep)(this.options, deviceId, true),
128
+ options: evaluateDeep(this.options, deviceId, true),
133
129
  };
134
130
  // Infer minValue from options if possible
135
131
  if (ret.minValue == undefined) {
@@ -137,7 +133,7 @@ Parameter #${parameterNumber}: options is malformed!`);
137
133
  ret.minValue = Math.min(...ret.options.map((o) => o.value));
138
134
  }
139
135
  else {
140
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${this.parent.filename}:
136
+ throwInvalidConfig("devices", `packages/config/config/devices/${this.parent.filename}:
141
137
  Parameter #${this.parameterNumber} is missing required property "minValue"!`);
142
138
  }
143
139
  }
@@ -146,7 +142,7 @@ Parameter #${this.parameterNumber} is missing required property "minValue"!`);
146
142
  ret.maxValue = Math.max(...ret.options.map((o) => o.value));
147
143
  }
148
144
  else {
149
- (0, utils_safe_1.throwInvalidConfig)("devices", `packages/config/config/devices/${this.parent.filename}:
145
+ throwInvalidConfig("devices", `packages/config/config/devices/${this.parent.filename}:
150
146
  Parameter #${this.parameterNumber} is missing required property "maxValue"!`);
151
147
  }
152
148
  }
@@ -154,8 +150,7 @@ Parameter #${this.parameterNumber} is missing required property "maxValue"!`);
154
150
  return ret;
155
151
  }
156
152
  }
157
- exports.ConditionalParamInformation = ConditionalParamInformation;
158
- class ConditionalConfigOption {
153
+ export class ConditionalConfigOption {
159
154
  value;
160
155
  label;
161
156
  condition;
@@ -165,30 +160,29 @@ class ConditionalConfigOption {
165
160
  this.condition = condition;
166
161
  }
167
162
  evaluateCondition(deviceId) {
168
- if (!(0, ConditionalItem_1.conditionApplies)(this, deviceId))
163
+ if (!conditionApplies(this, deviceId))
169
164
  return;
170
- return (0, safe_1.pick)(this, ["value", "label"]);
165
+ return pick(this, ["value", "label"]);
171
166
  }
172
167
  }
173
- exports.ConditionalConfigOption = ConditionalConfigOption;
174
- function parseConditionalParamInformationMap(definition, parent, errorPrefix = "") {
175
- const paramInformation = new safe_1.ObjectKeyMap();
168
+ export function parseConditionalParamInformationMap(definition, parent, errorPrefix = "") {
169
+ const paramInformation = new ObjectKeyMap();
176
170
  const filename = parent.filename;
177
- if ((0, typeguards_1.isArray)(definition.paramInformation)) {
171
+ if (isArray(definition.paramInformation)) {
178
172
  // Check that every param has a param number
179
173
  if (!definition.paramInformation.every((entry) => "#" in entry)) {
180
- (0, utils_safe_1.throwInvalidConfig)(`device`, `packages/config/config/devices/${filename}:
174
+ throwInvalidConfig(`device`, `packages/config/config/devices/${filename}:
181
175
  ${errorPrefix}required property "#" missing in at least one entry of paramInformation`);
182
176
  }
183
177
  // And a valid $if condition
184
178
  for (const entry of definition.paramInformation) {
185
- (0, ConditionalItem_1.validateCondition)(filename, entry, `${errorPrefix}At least one entry of paramInformation contains an`);
179
+ validateCondition(filename, entry, `${errorPrefix}At least one entry of paramInformation contains an`);
186
180
  }
187
181
  for (const paramDefinition of definition.paramInformation) {
188
182
  const { ["#"]: paramNo, ...defn } = paramDefinition;
189
- const key = (0, core_1.tryParseParamNumber)(paramNo);
183
+ const key = tryParseParamNumber(paramNo);
190
184
  if (!key) {
191
- (0, utils_safe_1.throwInvalidConfig)(`device`, `packages/config/config/devices/${filename}:
185
+ throwInvalidConfig(`device`, `packages/config/config/devices/${filename}:
192
186
  ${errorPrefix}found invalid param number "${paramNo}" in paramInformation`);
193
187
  }
194
188
  if (!paramInformation.has(key))
@@ -198,11 +192,11 @@ ${errorPrefix}found invalid param number "${paramNo}" in paramInformation`);
198
192
  .push(new ConditionalParamInformation(parent, key.parameter, key.valueBitMask, defn));
199
193
  }
200
194
  }
201
- else if ((0, typeguards_1.isObject)(definition.paramInformation)) {
195
+ else if (isObject(definition.paramInformation)) {
202
196
  // Silently ignore this old format
203
197
  }
204
198
  else {
205
- (0, utils_safe_1.throwInvalidConfig)(`device`, `packages/config/config/devices/${filename}:
199
+ throwInvalidConfig(`device`, `packages/config/config/devices/${filename}:
206
200
  ${errorPrefix}paramInformation must be an array!`);
207
201
  }
208
202
  return paramInformation;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParamInformation.js","sourceRoot":"","sources":["../../../src/devices/ParamInformation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAEN,YAAY,EAEZ,IAAI,GACJ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAEN,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,OAAO,2BAA2B;IAGvC,YACC,MAA+B,EAC/B,eAAuB,EACvB,YAAgC,EAChC,UAAsB;QAEtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,iEAAiE;QACjE,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC;QAEhC,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC1C,kBAAkB,CACjB,SAAS,EACT,kCAAkC,MAAM,CAAC,QAAQ;aACxC,eAAe,yBAAyB,CACjD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAE9B,IACC,UAAU,CAAC,WAAW,IAAI,SAAS;eAChC,O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ACH,CAAC;QAED,KAAK,MAAM,eAAe,IAAI,UAAU,CAAC,gBAAgB,EAAE,CAAC;YAC3D,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,eAAe,CAAC;YACpD,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;YACzC,IAAI,CAAC,GAAG,EAAE,CAAC;gBACV,kBAAkB,CACjB,QAAQ,EACR,kCAAkC,QAAQ;EAC7C,WAAW,+BAA+B,OAAO,uBAAuB,CACrE,CAAC;YACH,CAAC;YAED,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC9D,gBAAgB;iBACd,GAAG,CAAC,GAAG,CAAE;iBACT,IAAI,CACJ,IAAI,2BAA2B,CAC9B,MAAM,EACN,GAAG,CAAC,SAAS,EACb,GAAG,CAAC,YAAY,EAChB,IAAI,CACJ,CACD,CAAC;QACJ,CAAC;IACF,CAAC;SAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAClD,kCAAkC;IACnC,CAAC;SAAM,CAAC;QACP,kBAAkB,CACjB,QAAQ,EACR,kCAAkC,QAAQ;EAC3C,WAAW,oCAAoC,CAC9C,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface FirmwareVersionRange {
2
+ min: string;
3
+ max: string;
4
+ }
5
+ export interface DeviceID {
6
+ manufacturerId: number;
7
+ productType: number;
8
+ productId: number;
9
+ firmwareVersion?: string;
10
+ }
11
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/devices/shared.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,QAAQ;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/devices/shared.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/devices/shared.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export * from "./ConfigManager.js";
2
+ export * from "./Logger_safe.js";
3
+ export * from "./Manufacturers.js";
4
+ export { PACKAGE_VERSION } from "./_version.js";
5
+ export * from "./devices/AssociationConfig.js";
6
+ export * from "./devices/CompatConfig.js";
7
+ export * from "./devices/DeviceConfig.js";
8
+ export * from "./devices/DeviceMetadata.js";
9
+ export * from "./devices/EndpointConfig.js";
10
+ export * from "./devices/ParamInformation.js";
11
+ export * from "./devices/shared.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,13 @@
1
+ /* eslint-disable @typescript-eslint/consistent-type-exports */
2
+ export * from "./ConfigManager.js";
3
+ export * from "./Logger_safe.js";
4
+ export * from "./Manufacturers.js";
5
+ export { PACKAGE_VERSION } from "./_version.js";
6
+ export * from "./devices/AssociationConfig.js";
7
+ export * from "./devices/CompatConfig.js";
8
+ export * from "./devices/DeviceConfig.js";
9
+ export * from "./devices/DeviceMetadata.js";
10
+ export * from "./devices/EndpointConfig.js";
11
+ export * from "./devices/ParamInformation.js";
12
+ export * from "./devices/shared.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export * from "./Logger_safe.js";
2
+ export { PACKAGE_VERSION } from "./_version.js";
3
+ //# sourceMappingURL=index_safe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index_safe.d.ts","sourceRoot":"","sources":["../../src/index_safe.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ /* @forbiddenImports external */
2
+ export * from "./Logger_safe.js";
3
+ export { PACKAGE_VERSION } from "./_version.js";
4
+ //# sourceMappingURL=index_safe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index_safe.js","sourceRoot":"","sources":["../../src/index_safe.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,19 @@
1
+ import type { ConfigLogger } from "./Logger.js";
2
+ import type { DeviceConfigIndexEntry } from "./devices/DeviceConfig.js";
3
+ /** The absolute path of the embedded configuration directory */
4
+ export declare const configDir: string;
5
+ /** The (optional) absolute path of an external configuration directory */
6
+ export declare function getExternalConfigDirEnvVariable(): string | undefined;
7
+ export declare function getDeviceEntryPredicate(manufacturerId: number, productType: number, productId: number, firmwareVersion?: string): (entry: DeviceConfigIndexEntry) => boolean;
8
+ export type SyncExternalConfigDirResult = {
9
+ success: false;
10
+ } | {
11
+ success: true;
12
+ version: string;
13
+ };
14
+ /**
15
+ * Synchronizes or updates the external config directory and returns whether the directory is in a state that can be used
16
+ */
17
+ export declare function syncExternalConfigDir(extConfigDir: string, logger: ConfigLogger): Promise<SyncExternalConfigDirResult>;
18
+ export declare function versionInRange(version: string, min: string, max: string): boolean;
19
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +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;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"}