hb-nb-tools 2.0.0-1 → 2.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/cli/nb.js CHANGED
@@ -5,6 +5,11 @@
5
5
  // Command line interface to Nuki bridge HTTP API.
6
6
  // Copyright © 2018-2024 Erik Baauw. All rights reserved.
7
7
 
8
+ import { createRequire } from 'node:module'
9
+
8
10
  import { NbTool } from 'hb-nb-tools/NbTool'
9
11
 
10
- new NbTool(import.meta.dirname).main()
12
+ const require = createRequire(import.meta.url)
13
+ const packageJson = require('../package.json')
14
+
15
+ new NbTool(packageJson).main()
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ // hb-nb-tools/index.js
2
+ //
3
+ // Homebridge NB Tools.
4
+ // Copyright © 2017-2024 Erik Baauw. All rights reserved.
5
+
6
+ /** Homebridge NB Tools.
7
+ *
8
+ * @module hb-nb-tools
9
+ */
package/jsdoc.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "plugins": [
3
+ "plugins/markdown"
4
+ ],
5
+ "rescurseDepth": 10,
6
+ "source": {
7
+ "include": [
8
+ "README.md",
9
+ "index.js",
10
+ "lib",
11
+ "cli",
12
+ "node_modules/hb-lib-tools/lib/HttpClient.js"
13
+ ]
14
+ },
15
+ "opts": {
16
+ "recurse": true
17
+ },
18
+ "templates": {
19
+ "monospaceLinks": true
20
+ }
21
+ }
package/lib/NbClient.js CHANGED
@@ -13,6 +13,19 @@ import { OptionParser } from 'hb-lib-tools/OptionParser'
13
13
 
14
14
  const { secretbox, randomBytes } = tweetnacl
15
15
 
16
+ /** Nuki bridge HTTP API client.
17
+ * <br>See {@link NbClient}.
18
+ * @name NbClient
19
+ * @type {Class}
20
+ * @memberof module:hb-nb-tools
21
+ */
22
+
23
+ /** Nuki bridge HTTP API client.
24
+ *
25
+ * See the [Nuki bridge HTTP API](https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4)
26
+ * documentation for a better understanding of the API.
27
+ * @extends HttpClient
28
+ */
16
29
  class NbClient extends HttpClient {
17
30
  static get DeviceTypes () {
18
31
  return {
@@ -6,6 +6,19 @@
6
6
  import { HttpClient } from 'hb-lib-tools/HttpClient'
7
7
  import { OptionParser } from 'hb-lib-tools/OptionParser'
8
8
 
9
+ /** Nuki bridge discovery.
10
+ * <br>See {@link NbDiscovery}.
11
+ * @name NbDiscovery
12
+ * @type {Class}
13
+ * @memberof module:hb-nb-tools
14
+ */
15
+
16
+ /** Class for discovery of Nuki bridges.
17
+ *
18
+ * See the [Nuki bridge HTTP API](https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4)
19
+ * documentation for a better understanding of the API.
20
+ * @extends HttpClient
21
+ */
9
22
  class NbDiscovery extends HttpClient {
10
23
  constructor (params = {}) {
11
24
  const config = {
package/lib/NbListener.js CHANGED
@@ -10,6 +10,19 @@ import { OptionParser } from 'hb-lib-tools/OptionParser'
10
10
 
11
11
  import { NbClient } from 'hb-nb-tools/NbClient'
12
12
 
13
+ /** Listerner for Nuki bridge callbacks.
14
+ * <br>See {@link NbListener}.
15
+ * @name NbListener
16
+ * @type {Class}
17
+ * @memberof module:hb-nb-tools
18
+ */
19
+
20
+ /** Class for listening to Nuki bridge callbacks.
21
+ *
22
+ * See the [Nuki bridge HTTP API](https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4)
23
+ * documentation for a better understanding of the API.
24
+ * @extends EventEmitter
25
+ */
13
26
  class NbListener extends EventEmitter {
14
27
  constructor (port = 0) {
15
28
  super()
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Homebridge NB Tools",
4
4
  "author": "Erik Baauw",
5
5
  "license": "Apache-2.0",
6
- "version": "2.0.0-1",
6
+ "version": "2.0.0",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  "./*": "./lib/*.js"
@@ -21,11 +21,11 @@
21
21
  "node": "^20||^18"
22
22
  },
23
23
  "dependencies": {
24
- "hb-lib-tools": "~2.0.0-1",
24
+ "hb-lib-tools": "~2.0.0",
25
25
  "tweetnacl": "~1.0.3"
26
26
  },
27
27
  "scripts": {
28
- "prepare": "standard",
28
+ "prepare": "standard && rm -rf out && jsdoc -c jsdoc.json",
29
29
  "test": "standard && echo \"Error: no test specified\" && exit 1"
30
30
  },
31
31
  "repository": {
@@ -35,5 +35,15 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/ebaauw/hb-nb-tools/issues"
37
37
  },
38
- "homepage": "https://github.com/ebaauw/hb-nb-tools#readme"
38
+ "homepage": "https://github.com/ebaauw/hb-nb-tools#readme",
39
+ "funding": [
40
+ {
41
+ "type": "github",
42
+ "url": "https://github.com/sponsors/ebaauw"
43
+ },
44
+ {
45
+ "type": "paypal",
46
+ "url": "https://www.paypal.me/ebaauw/EUR"
47
+ }
48
+ ]
39
49
  }