@zwave-js/host 9.3.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/FileSystem.d.ts +11 -0
- package/build/FileSystem.d.ts.map +1 -0
- package/build/FileSystem.js +3 -0
- package/build/FileSystem.js.map +1 -0
- package/build/ZWaveEndpointBase.d.ts +10 -0
- package/build/ZWaveEndpointBase.d.ts.map +1 -0
- package/build/ZWaveEndpointBase.js +3 -0
- package/build/ZWaveEndpointBase.js.map +1 -0
- package/build/ZWaveHost.d.ts +54 -0
- package/build/ZWaveHost.d.ts.map +1 -0
- package/build/ZWaveHost.js +3 -0
- package/build/ZWaveHost.js.map +1 -0
- package/build/ZWaveNodeBase.d.ts +16 -0
- package/build/ZWaveNodeBase.d.ts.map +1 -0
- package/build/ZWaveNodeBase.js +3 -0
- package/build/ZWaveNodeBase.js.map +1 -0
- package/build/index.d.ts +5 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +21 -0
- package/build/index.js.map +1 -0
- package/build/index_safe.d.ts +5 -0
- package/build/index_safe.d.ts.map +1 -0
- package/build/index_safe.js +22 -0
- package/build/index_safe.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/** Defines which methods must be supported by a replacement filesystem */
|
|
3
|
+
export interface FileSystem {
|
|
4
|
+
ensureDir(path: string): Promise<void>;
|
|
5
|
+
writeFile(file: string, data: string | Buffer, options?: {
|
|
6
|
+
encoding: string;
|
|
7
|
+
} | string): Promise<void>;
|
|
8
|
+
readFile(file: string, encoding: string): Promise<string>;
|
|
9
|
+
pathExists(path: string): Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=FileSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IAC1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,SAAS,CACR,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,OAAO,CAAC,EACL;QACA,QAAQ,EAAE,MAAM,CAAC;KAChB,GACD,MAAM,GACP,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandClasses } from "@zwave-js/core";
|
|
2
|
+
export interface ZWaveEndpointBase {
|
|
3
|
+
readonly nodeId: number;
|
|
4
|
+
readonly index: number;
|
|
5
|
+
getCCVersion(cc: CommandClasses): number;
|
|
6
|
+
supportsCC(cc: CommandClasses): boolean;
|
|
7
|
+
controlsCC(cc: CommandClasses): boolean;
|
|
8
|
+
isCCSecure(cc: CommandClasses): boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ZWaveEndpointBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZWaveEndpointBase.d.ts","sourceRoot":"","sources":["../src/ZWaveEndpointBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZWaveEndpointBase.js","sourceRoot":"","sources":["../src/ZWaveEndpointBase.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ConfigManager } from "@zwave-js/config";
|
|
2
|
+
import type { CommandClasses, ControllerLogger, SecurityManager, SecurityManager2, ValueDB } from "@zwave-js/core";
|
|
3
|
+
import type { ReadonlyThrowingMap } from "@zwave-js/shared";
|
|
4
|
+
import type { ZWaveNodeBase } from "./ZWaveNodeBase";
|
|
5
|
+
export interface ZWaveHostOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Some Command Classes support reporting that a value is unknown.
|
|
8
|
+
* When this flag is `false`, unknown values are exposed as `undefined`.
|
|
9
|
+
* When it is `true`, unknown values are exposed as the literal string "unknown" (even if the value is normally numeric).
|
|
10
|
+
* Default: `false`
|
|
11
|
+
*/
|
|
12
|
+
preserveUnknownValues?: boolean;
|
|
13
|
+
attempts: {
|
|
14
|
+
/** How often the driver should try communication with the controller before giving up */
|
|
15
|
+
controller: number;
|
|
16
|
+
/** How often the driver should try sending SendData commands before giving up */
|
|
17
|
+
sendData: number;
|
|
18
|
+
/**
|
|
19
|
+
* How many attempts should be made for each node interview before giving up
|
|
20
|
+
*/
|
|
21
|
+
nodeInterview: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Host application abstractions to be used in Serial API and CC implemenations */
|
|
25
|
+
export interface ZWaveHost {
|
|
26
|
+
controllerLog: ControllerLogger;
|
|
27
|
+
/** Gives access to the configuration files */
|
|
28
|
+
configManager: ConfigManager;
|
|
29
|
+
/** Management of Security S0 keys and nonces */
|
|
30
|
+
securityManager: SecurityManager | undefined;
|
|
31
|
+
/** Management of Security S2 keys and nonces */
|
|
32
|
+
securityManager2: SecurityManager2 | undefined;
|
|
33
|
+
/** The ID of this node in the current network */
|
|
34
|
+
ownNodeId: number;
|
|
35
|
+
/** The Home ID of the current network */
|
|
36
|
+
homeId: number;
|
|
37
|
+
/** Readonly access to all node instances known to the host */
|
|
38
|
+
nodes: ReadonlyThrowingMap<number, ZWaveNodeBase>;
|
|
39
|
+
options: ZWaveHostOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the maximum version of a command class that can be used to communicate with a node.
|
|
42
|
+
* Returns 1 if the node claims that it does not support a CC.
|
|
43
|
+
* Throws if the CC is not implemented in this library yet.
|
|
44
|
+
*/
|
|
45
|
+
getSafeCCVersionForNode(cc: CommandClasses, nodeId: number, endpointIndex?: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the next callback ID. Callback IDs are used to correllate requests
|
|
48
|
+
* to the controller/nodes with its response
|
|
49
|
+
*/
|
|
50
|
+
getNextCallbackId(): number;
|
|
51
|
+
/** Returns the value DB which belongs to the node with the given ID */
|
|
52
|
+
getValueDB(nodeId: number): ValueDB;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ZWaveHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZWaveHost.d.ts","sourceRoot":"","sources":["../src/ZWaveHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,QAAQ,EAAE;QAOT,yFAAyF;QACzF,UAAU,EAAE,MAAM,CAAC;QAEnB,iFAAiF;QACjF,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,aAAa,EAAE,MAAM,CAAC;KACtB,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,WAAW,SAAS;IAEzB,aAAa,EAAE,gBAAgB,CAAC;IAEhC,8CAA8C;IAC9C,aAAa,EAAE,aAAa,CAAC;IAE7B,gDAAgD;IAChD,eAAe,EAAE,eAAe,GAAG,SAAS,CAAC;IAC7C,gDAAgD;IAChD,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAE/C,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IAEf,8DAA8D;IAC9D,KAAK,EAAE,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAElD,OAAO,EAAE,gBAAgB,CAAC;IAE1B;;;;OAIG;IACH,uBAAuB,CACtB,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,GACpB,MAAM,CAAC;IAEV;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAC;IAE5B,uEAAuE;IACvE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZWaveHost.js","sourceRoot":"","sources":["../src/ZWaveHost.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DeviceConfig } from "@zwave-js/config";
|
|
2
|
+
import type { FLiRS, InterviewStage, Maybe, NodeStatus, SecurityClassOwner } from "@zwave-js/core";
|
|
3
|
+
import type { ZWaveEndpointBase } from "./ZWaveEndpointBase";
|
|
4
|
+
export interface ZWaveNodeBase extends ZWaveEndpointBase, SecurityClassOwner {
|
|
5
|
+
readonly id: number;
|
|
6
|
+
isListening: boolean | undefined;
|
|
7
|
+
isFrequentListening: FLiRS | undefined;
|
|
8
|
+
readonly canSleep: boolean | undefined;
|
|
9
|
+
readonly status: NodeStatus;
|
|
10
|
+
interviewStage: InterviewStage;
|
|
11
|
+
deviceConfig?: DeviceConfig;
|
|
12
|
+
getEndpoint(index: 0): ZWaveEndpointBase;
|
|
13
|
+
getEndpoint(index: number): ZWaveEndpointBase | undefined;
|
|
14
|
+
readonly isSecure: Maybe<boolean>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ZWaveNodeBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZWaveNodeBase.d.ts","sourceRoot":"","sources":["../src/ZWaveNodeBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EACX,KAAK,EACL,cAAc,EACd,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,kBAAkB;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,mBAAmB,EAAE,KAAK,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,WAAW,CAAC,KAAK,EAAE,CAAC,GAAG,iBAAiB,CAAC;IACzC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZWaveNodeBase.js","sourceRoot":"","sources":["../src/ZWaveNodeBase.ts"],"names":[],"mappings":""}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./FileSystem"), exports);
|
|
18
|
+
__exportStar(require("./ZWaveEndpointBase"), exports);
|
|
19
|
+
__exportStar(require("./ZWaveHost"), exports);
|
|
20
|
+
__exportStar(require("./ZWaveNodeBase"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,sDAAoC;AACpC,8CAA4B;AAC5B,kDAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index_safe.d.ts","sourceRoot":"","sources":["../src/index_safe.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* @noExternalImports */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./FileSystem"), exports);
|
|
19
|
+
__exportStar(require("./ZWaveEndpointBase"), exports);
|
|
20
|
+
__exportStar(require("./ZWaveHost"), exports);
|
|
21
|
+
__exportStar(require("./ZWaveNodeBase"), exports);
|
|
22
|
+
//# sourceMappingURL=index_safe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index_safe.js","sourceRoot":"","sources":["../src/index_safe.ts"],"names":[],"mappings":";AAAA,wBAAwB;;;;;;;;;;;;;;;;AAExB,+CAA6B;AAC7B,sDAAoC;AACpC,8CAA4B;AAC5B,kDAAgC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zwave-js/host",
|
|
3
|
+
"version": "9.3.0",
|
|
4
|
+
"description": "zwave-js: Host abstractions",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"main": "build/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./build/index.js",
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
"./safe": "./build/index_safe.js"
|
|
14
|
+
},
|
|
15
|
+
"types": "build/index.d.ts",
|
|
16
|
+
"typesVersions": {
|
|
17
|
+
"*": {
|
|
18
|
+
"safe": [
|
|
19
|
+
"build/index_safe.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"build/**/*.{js,d.ts,map}"
|
|
25
|
+
],
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "AlCalzone",
|
|
28
|
+
"email": "d.griesel@gmx.net"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"homepage": "https://github.com/AlCalzone/node-zwave-js#readme",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/AlCalzone/node-zwave-js.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/AlCalzone/node-zwave-js/issues"
|
|
38
|
+
},
|
|
39
|
+
"funding": {
|
|
40
|
+
"url": "https://github.com/sponsors/AlCalzone/"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=12.22.2 <13 || >=14.13.0 <15 || >= 16 <16.9.0 || >16.9.0"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc -b tsconfig.build.json --verbose",
|
|
47
|
+
"clean": "yarn run build --clean",
|
|
48
|
+
"watch": "yarn run build --watch --pretty"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@zwave-js/core": "9.3.0",
|
|
52
|
+
"@zwave-js/shared": "9.3.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/jest": "^27.4.1",
|
|
56
|
+
"@types/node": "^14.18.16",
|
|
57
|
+
"jest-extended": "^2.0.0",
|
|
58
|
+
"typescript": "4.6.4"
|
|
59
|
+
}
|
|
60
|
+
}
|