@zwave-js/host 14.3.4-0-pr-7407-1bf5879 → 14.3.7
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/mocks.js +10 -8
- package/build/cjs/mocks.js.map +1 -1
- package/package.json +7 -8
package/build/cjs/mocks.js
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -39,8 +40,8 @@ function createTestingHost(options = {}) {
|
|
|
39
40
|
// securityManagerLR: undefined,
|
|
40
41
|
// getDeviceConfig: () => undefined,
|
|
41
42
|
// lookupManufacturer: () => undefined,
|
|
42
|
-
logNode: () => {
|
|
43
|
-
},
|
|
43
|
+
logNode: /* @__PURE__ */ __name(() => {
|
|
44
|
+
}, "logNode"),
|
|
44
45
|
// options: {
|
|
45
46
|
// attempts: {
|
|
46
47
|
// nodeInterview: 1,
|
|
@@ -78,18 +79,18 @@ function createTestingHost(options = {}) {
|
|
|
78
79
|
nodes.set(nodeId, node);
|
|
79
80
|
},
|
|
80
81
|
// getSafeCCVersion: options.getSafeCCVersion ?? (() => 100),
|
|
81
|
-
getSupportedCCVersion: (cc, nodeId, endpoint) => {
|
|
82
|
+
getSupportedCCVersion: /* @__PURE__ */ __name((cc, nodeId, endpoint) => {
|
|
82
83
|
return nodes.get(nodeId)?.getEndpoint(endpoint ?? 0)?.getCCVersion(cc) ?? 0;
|
|
83
|
-
},
|
|
84
|
-
getValueDB: (nodeId) => {
|
|
84
|
+
}, "getSupportedCCVersion"),
|
|
85
|
+
getValueDB: /* @__PURE__ */ __name((nodeId) => {
|
|
85
86
|
if (!valueDBCache.has(nodeId)) {
|
|
86
87
|
valueDBCache.set(nodeId, new import_core.ValueDB(nodeId, valuesStorage, metadataStorage));
|
|
87
88
|
}
|
|
88
89
|
return valueDBCache.get(nodeId);
|
|
89
|
-
},
|
|
90
|
-
tryGetValueDB: (nodeId) => {
|
|
90
|
+
}, "getValueDB"),
|
|
91
|
+
tryGetValueDB: /* @__PURE__ */ __name((nodeId) => {
|
|
91
92
|
return ret.getValueDB(nodeId);
|
|
92
|
-
}
|
|
93
|
+
}, "tryGetValueDB")
|
|
93
94
|
// getHighestSecurityClass: (nodeId) => {
|
|
94
95
|
// const node = nodes.getOrThrow(nodeId);
|
|
95
96
|
// return node.getHighestSecurityClass();
|
|
@@ -111,6 +112,7 @@ function createTestingHost(options = {}) {
|
|
|
111
112
|
};
|
|
112
113
|
return ret;
|
|
113
114
|
}
|
|
115
|
+
__name(createTestingHost, "createTestingHost");
|
|
114
116
|
// Annotate the CommonJS export names for ESM import in node:
|
|
115
117
|
0 && (module.exports = {
|
|
116
118
|
createTestingHost
|
package/build/cjs/mocks.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mocks.ts"],
|
|
4
4
|
"sourcesContent": ["import {\n\ttype ControlsCC,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype IsCCSecure,\n\ttype ListenBehavior,\n\ttype NodeId,\n\ttype QuerySecurityClasses,\n\ttype SetSecurityClass,\n\ttype SupportsCC,\n\tValueDB,\n\tZWaveError,\n\tZWaveErrorCodes,\n} from \"@zwave-js/core\";\nimport { createThrowingMap } from \"@zwave-js/shared\";\nimport type {\n\tGetAllNodes,\n\tGetDeviceConfig,\n\tGetNode,\n\tGetSupportedCCVersion,\n\tGetValueDB,\n\tHostIDs,\n\tLogNode,\n} from \"./ZWaveHost.js\";\n\nexport interface CreateTestingHostOptions extends HostIDs, GetDeviceConfig {}\n\nexport type BaseTestEndpoint =\n\t& EndpointId\n\t& SupportsCC\n\t& ControlsCC\n\t& IsCCSecure;\n\nexport type BaseTestNode =\n\t& BaseTestEndpoint\n\t& NodeId\n\t& ListenBehavior\n\t& QuerySecurityClasses\n\t& SetSecurityClass\n\t& SupportsCC\n\t& ControlsCC\n\t& IsCCSecure\n\t& GetEndpoint<BaseTestEndpoint>;\n\nexport interface TestingHost\n\textends\n\t\tHostIDs,\n\t\tGetValueDB,\n\t\tGetSupportedCCVersion,\n\t\tGetAllNodes<BaseTestNode>,\n\t\tGetNode<BaseTestNode>,\n\t\tGetDeviceConfig,\n\t\tLogNode\n{\n\tsetNode(nodeId: number, node: BaseTestNode): void;\n}\n\n/** Creates a {@link TestingHost} that can be used instead of a real driver instance in tests */\nexport function createTestingHost(\n\toptions: Partial<CreateTestingHostOptions> = {},\n): TestingHost {\n\tconst valuesStorage = new Map();\n\tconst metadataStorage = new Map();\n\tconst valueDBCache = new Map<number, ValueDB>();\n\tconst nodes = createThrowingMap<number, BaseTestNode>((nodeId) => {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeId} was not found!`,\n\t\t\tZWaveErrorCodes.Controller_NodeNotFound,\n\t\t);\n\t});\n\n\tconst ret: TestingHost = {\n\t\thomeId: options.homeId ?? 0x7e570001,\n\t\townNodeId: options.ownNodeId ?? 1,\n\t\tgetDeviceConfig: options.getDeviceConfig ?? (() => undefined),\n\t\t// securityManager: undefined,\n\t\t// securityManager2: undefined,\n\t\t// securityManagerLR: undefined,\n\t\t// getDeviceConfig: () => undefined,\n\t\t// lookupManufacturer: () => undefined,\n\t\tlogNode: () => {},\n\t\t// options: {\n\t\t// \tattempts: {\n\t\t// \t\tnodeInterview: 1,\n\t\t// \t\t// openSerialPort: 1,\n\t\t// \t\tsendData: 3,\n\t\t// \t\tcontroller: 3,\n\t\t// \t},\n\t\t// \ttimeouts: {\n\t\t// \t\trefreshValue: 5000,\n\t\t// \t\trefreshValueAfterTransition: 1000,\n\t\t// \t},\n\t\t// },\n\t\t// getInterviewOptions() {\n\t\t// \treturn {};\n\t\t// },\n\t\t// getUserPreferences() {\n\t\t// \treturn undefined;\n\t\t// },\n\t\t// getCommunicationTimeouts() {\n\t\t// \treturn {\n\t\t// \t\trefreshValue: 5000,\n\t\t// \t\trefreshValueAfterTransition: 1000,\n\t\t// \t};\n\t\t// },\n\t\tgetNode(nodeId) {\n\t\t\treturn nodes.get(nodeId);\n\t\t},\n\t\tgetNodeOrThrow(nodeId) {\n\t\t\treturn nodes.getOrThrow(nodeId);\n\t\t},\n\t\tgetAllNodes() {\n\t\t\treturn [...nodes.values()];\n\t\t},\n\t\tsetNode(nodeId, node) {\n\t\t\tnodes.set(nodeId, node);\n\t\t},\n\t\t// getSafeCCVersion: options.getSafeCCVersion ?? (() => 100),\n\t\tgetSupportedCCVersion: (cc, nodeId, endpoint) => {\n\t\t\treturn nodes.get(nodeId)?.getEndpoint(endpoint ?? 0)?.getCCVersion(\n\t\t\t\tcc,\n\t\t\t) ?? 0;\n\t\t\t// \treturn options.getSupportedCCVersion?.(cc, nodeId, endpoint)\n\t\t\t// \t\t?? options.getSafeCCVersion?.(cc, nodeId, endpoint)\n\t\t\t// \t\t?? 100;\n\t\t},\n\t\tgetValueDB: (nodeId) => {\n\t\t\tif (!valueDBCache.has(nodeId)) {\n\t\t\t\tvalueDBCache.set(\n\t\t\t\t\tnodeId,\n\t\t\t\t\tnew ValueDB(\n\t\t\t\t\t\tnodeId,\n\t\t\t\t\t\tvaluesStorage as any,\n\t\t\t\t\t\tmetadataStorage as any,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn valueDBCache.get(nodeId)!;\n\t\t},\n\t\ttryGetValueDB: (nodeId) => {\n\t\t\treturn ret.getValueDB(nodeId);\n\t\t},\n\t\t// getHighestSecurityClass: (nodeId) => {\n\t\t// \tconst node = nodes.getOrThrow(nodeId);\n\t\t// \treturn node.getHighestSecurityClass();\n\t\t// },\n\t\t// hasSecurityClass: (nodeId, securityClass) => {\n\t\t// \tconst node = nodes.getOrThrow(nodeId);\n\t\t// \treturn node.hasSecurityClass(securityClass);\n\t\t// },\n\t\t// setSecurityClass: (nodeId, securityClass, granted) => {\n\t\t// \tconst node = nodes.getOrThrow(nodeId);\n\t\t// \tnode.setSecurityClass(securityClass, granted);\n\t\t// },\n\t\t// sendCommand: async (_command, _options) => {\n\t\t// \treturn undefined as any;\n\t\t// },\n\t\t// schedulePoll: (_nodeId, _valueId, _options) => {\n\t\t// \treturn false;\n\t\t// },\n\t};\n\treturn ret;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,kBAaO;AACP,oBAAkC;AA4C5B,SAAU,kBACf,UAA6C,CAAA,GAAE;AAE/C,QAAM,gBAAgB,oBAAI,IAAG;AAC7B,QAAM,kBAAkB,oBAAI,IAAG;AAC/B,QAAM,eAAe,oBAAI,IAAG;AAC5B,QAAM,YAAQ,iCAAwC,CAAC,WAAU;AAChE,UAAM,IAAI,uBACT,QAAQ,MAAM,mBACd,4BAAgB,uBAAuB;EAEzC,CAAC;AAED,QAAM,MAAmB;IACxB,QAAQ,QAAQ,UAAU;IAC1B,WAAW,QAAQ,aAAa;IAChC,iBAAiB,QAAQ,oBAAoB,MAAM;;;;;;IAMnD,SAAS,6BAAK;IAAE,GAAP;;;;;;;;;;;;;;;;;;;;;;;;;IAyBT,QAAQ,QAAM;AACb,aAAO,MAAM,IAAI,MAAM;IACxB;IACA,eAAe,QAAM;AACpB,aAAO,MAAM,WAAW,MAAM;IAC/B;IACA,cAAW;AACV,aAAO,CAAC,GAAG,MAAM,OAAM,CAAE;IAC1B;IACA,QAAQ,QAAQ,MAAI;AACnB,YAAM,IAAI,QAAQ,IAAI;IACvB;;IAEA,uBAAuB,wBAAC,IAAI,QAAQ,aAAY;AAC/C,aAAO,MAAM,IAAI,MAAM,GAAG,YAAY,YAAY,CAAC,GAAG,aACrD,EAAE,KACE;IAIN,GAPuB;IAQvB,YAAY,wBAAC,WAAU;AACtB,UAAI,CAAC,aAAa,IAAI,MAAM,GAAG;AAC9B,qBAAa,IACZ,QACA,IAAI,oBACH,QACA,eACA,eAAsB,CACtB;MAEH;AACA,aAAO,aAAa,IAAI,MAAM;IAC/B,GAZY;IAaZ,eAAe,wBAAC,WAAU;AACzB,aAAO,IAAI,WAAW,MAAM;IAC7B,GAFe;;;;;;;;;;;;;;;;;;;;AAsBhB,SAAO;AACR;AAxGgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwave-js/host",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.7",
|
|
4
4
|
"description": "zwave-js: Host abstractions",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"publishConfig": {
|
|
@@ -52,17 +52,16 @@
|
|
|
52
52
|
"lint:ts:fix": "yarn run lint:ts --fix"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@zwave-js/config": "14.3.
|
|
56
|
-
"@zwave-js/core": "14.3.
|
|
57
|
-
"@zwave-js/shared": "14.3.
|
|
55
|
+
"@zwave-js/config": "14.3.7",
|
|
56
|
+
"@zwave-js/core": "14.3.7",
|
|
57
|
+
"@zwave-js/shared": "14.3.7",
|
|
58
58
|
"alcalzone-shared": "^5.0.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@alcalzone/esm2cjs": "^1.4.
|
|
62
|
-
"@microsoft/api-extractor": "^7.
|
|
61
|
+
"@alcalzone/esm2cjs": "^1.4.1",
|
|
62
|
+
"@microsoft/api-extractor": "^7.48.0",
|
|
63
63
|
"@types/node": "^18.19.63",
|
|
64
64
|
"del-cli": "^6.0.0",
|
|
65
65
|
"typescript": "5.6.2"
|
|
66
|
-
}
|
|
67
|
-
"stableVersion": "14.3.3"
|
|
66
|
+
}
|
|
68
67
|
}
|