hb-nb-tools 2.0.0-0 → 2.0.0-1

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,6 @@
5
5
  // Command line interface to Nuki bridge HTTP API.
6
6
  // Copyright © 2018-2024 Erik Baauw. All rights reserved.
7
7
 
8
- import { NbTool } from '../index.js'
8
+ import { NbTool } from 'hb-nb-tools/NbTool'
9
9
 
10
10
  new NbTool(import.meta.dirname).main()
package/lib/NbClient.js CHANGED
@@ -6,7 +6,10 @@
6
6
  import { createHash, randomInt } from 'node:crypto'
7
7
  import tweetnacl from 'tweetnacl'
8
8
 
9
- import { HttpClient, JsonFormatter, OptionParser, toHexString } from 'hb-lib-tools'
9
+ import { toHexString } from 'hb-lib-tools'
10
+ import { HttpClient } from 'hb-lib-tools/HttpClient'
11
+ import { JsonFormatter } from 'hb-lib-tools/JsonFormatter'
12
+ import { OptionParser } from 'hb-lib-tools/OptionParser'
10
13
 
11
14
  const { secretbox, randomBytes } = tweetnacl
12
15
 
@@ -3,7 +3,8 @@
3
3
  //
4
4
  // Homebridge NB Tools.
5
5
 
6
- import { HttpClient, OptionParser } from 'hb-lib-tools'
6
+ import { HttpClient } from 'hb-lib-tools/HttpClient'
7
+ import { OptionParser } from 'hb-lib-tools/OptionParser'
7
8
 
8
9
  class NbDiscovery extends HttpClient {
9
10
  constructor (params = {}) {
package/lib/NbListener.js CHANGED
@@ -6,9 +6,9 @@
6
6
  import { EventEmitter } from 'node:events'
7
7
  import { createServer } from 'node:http'
8
8
 
9
- import { OptionParser } from 'hb-lib-tools'
9
+ import { OptionParser } from 'hb-lib-tools/OptionParser'
10
10
 
11
- import { NbClient } from '../index.js'
11
+ import { NbClient } from 'hb-nb-tools/NbClient'
12
12
 
13
13
  class NbListener extends EventEmitter {
14
14
  constructor (port = 0) {
package/lib/NbTool.js CHANGED
@@ -3,11 +3,14 @@
3
3
  //
4
4
  // Command line interface to Nuki bridge HTTP API.
5
5
 
6
- import {
7
- CommandLineParser, CommandLineTool, JsonFormatter, OptionParser
8
- } from 'hb-lib-tools'
9
-
10
- import { NbClient, NbDiscovery, NbListener } from '../index.js'
6
+ import { CommandLineParser } from 'hb-lib-tools/CommandLineParser'
7
+ import { CommandLineTool } from 'hb-lib-tools/CommandLineTool'
8
+ import { JsonFormatter } from 'hb-lib-tools/JsonFormatter'
9
+ import { OptionParser } from 'hb-lib-tools/OptionParser'
10
+
11
+ import { NbClient } from 'hb-nb-tools/NbClient'
12
+ import { NbDiscovery } from 'hb-nb-tools/NbDiscovery'
13
+ import { NbListener } from 'hb-nb-tools/NbListener'
11
14
 
12
15
  const { b, u } = CommandLineTool
13
16
  const { UsageError } = CommandLineParser
package/package.json CHANGED
@@ -3,9 +3,11 @@
3
3
  "description": "Homebridge NB Tools",
4
4
  "author": "Erik Baauw",
5
5
  "license": "Apache-2.0",
6
- "version": "2.0.0-0",
6
+ "version": "2.0.0-1",
7
7
  "type": "module",
8
- "main": "index.js",
8
+ "exports": {
9
+ "./*": "./lib/*.js"
10
+ },
9
11
  "keywords": [
10
12
  "nuki",
11
13
  "smart-lock",
@@ -19,7 +21,7 @@
19
21
  "node": "^20||^18"
20
22
  },
21
23
  "dependencies": {
22
- "hb-lib-tools": "~2.0.0-0",
24
+ "hb-lib-tools": "~2.0.0-1",
23
25
  "tweetnacl": "~1.0.3"
24
26
  },
25
27
  "scripts": {
package/index.js DELETED
@@ -1,36 +0,0 @@
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 hbNbTools
9
- */
10
-
11
- /** Nuki bridge HTTP API client.
12
- * <br>See {@link NbClient}.
13
- * @name NbClient
14
- * @type {Class}
15
- * @memberof module:hbNbTools
16
- */
17
- export { NbClient } from './lib/NbClient.js'
18
-
19
- /** Parser and validator for command-line arguments.
20
- * <br>See {@link NbDiscovery}.
21
- * @name NbDiscovery
22
- * @type {Class}
23
- * @memberof module:hbNbTools
24
- */
25
- export { NbDiscovery } from './lib/NbDiscovery.js'
26
-
27
- /** Command-line tool.
28
- * <br>See {@link NbListener}.
29
- * @name NbListener
30
- * @type {Class}
31
- * @memberof module:hbNbTools
32
- */
33
- export { NbListener } from './lib/NbListener.js'
34
-
35
- // Command-line tools.
36
- export { NbTool } from './lib/NbTool.js'