iosignal-cli 1.4.0 → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Lee Taeo <taeo.mocha@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/bin/io-client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { IO, IOCongSocket, ENC_MODE, serverOption } from 'iosignal'
3
+ import { IOWS, IOCongSocket, ENC_MODE, serverOption } from 'iosignal'
4
4
  import { EventEmitter } from 'events'
5
5
  import readline from 'readline'
6
6
  import tty from 'tty'
@@ -123,7 +123,7 @@ if (connectUrl.indexOf('cong') === 0) {
123
123
  if (!connectUrl.match(/\w+:\/\/.*$/i)) {
124
124
  connectUrl = `ws://${connectUrl}`
125
125
  }
126
- io = new IO(connectUrl)
126
+ io = new IOWS(connectUrl)
127
127
  }
128
128
 
129
129
  if (options.id && options.key) {
package/bin/io-keygen.js CHANGED
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
-
3
- import { RAND } from 'iosignal'
2
+ import { Boho } from 'iosignal'
4
3
 
5
4
  // base64 from random n-byte
6
5
  function rand_b64(srcByteSize) {
7
- return RAND(srcByteSize).toString('base64')
6
+ return Boho.RAND(srcByteSize).toString('base64')
8
7
  }
9
8
 
10
9
  // accept 1 ~ 12
@@ -14,7 +13,7 @@ function rand_number_string(len) {
14
13
  let bigNumberBuffer, n, nString;
15
14
  const cropFrom = 1;
16
15
  do {
17
- bigNumberBuffer = RAND(8);
16
+ bigNumberBuffer = Boho.RAND(8);
18
17
  n = bigNumberBuffer.readBigUInt64LE(0);
19
18
  nString = n.toString()
20
19
  // console.log('>', n )
@@ -26,6 +25,7 @@ function rand_number_string(len) {
26
25
 
27
26
 
28
27
  let key20 = rand_b64(15)
28
+ let key40 = rand_b64(30)
29
29
  let did4 = rand_b64(3)
30
30
  let did8 = rand_b64(6)
31
31
  let randNumber4 = rand_number_string(4)
@@ -35,11 +35,13 @@ let randNumber8 = rand_number_string(8)
35
35
  // console.log('random 3bytes as base64 4chars: ', did )
36
36
 
37
37
  console.log('\n random values')
38
- console.log('+------------------------------------+')
39
- console.log('| ID:', did4, ' KEY:', key20)
40
- console.log('+------------------------------------+')
38
+ console.log('+----------------------------------------------------+')
39
+ console.log('| ID:', did4, ' KEY L20:', key20)
40
+ console.log('+----------------------------------------------------+')
41
41
  console.log('| ID_KEY: ', did4 + '.' + key20)
42
- console.log('+------------------------------------+')
42
+ console.log('+----------------------------------------------------+')
43
43
  console.log('| numbers: ', randNumber4, randNumber8)
44
- console.log('+------------------------------------+')
44
+ console.log('+----------------------------------------------------+')
45
+ console.log('| b64_L40: ', key40)
46
+ console.log('+----------------------------------------------------+')
45
47
  console.log('')
package/bin/io-server.js CHANGED
@@ -97,8 +97,8 @@ if (options.showOptions) {
97
97
  console.log('server api list', server.apiNames)
98
98
  }
99
99
 
100
- console.log( serverInfo( serverOption.port , serverOption.congPort ))
100
+ console.log(serverInfo(serverOption.port, serverOption.congPort))
101
101
 
102
- if( !serverOption.port && !serverOption.congPort ){
102
+ if (!serverOption.port && !serverOption.congPort) {
103
103
  process.exit()
104
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iosignal-cli",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "IOSignal server and client CLI program.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,17 +12,17 @@
12
12
  "io-keygen": "./bin/io-keygen.js"
13
13
  },
14
14
  "author": {
15
- "name": "Lee Dongeun",
16
- "email": "sixgen@gmail.com"
15
+ "name": "Lee Taeo",
16
+ "email": "taeo.mocha@gmail.com"
17
17
  },
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "boxen": "^7.1.1",
20
+ "boxen": "^8.0.1",
21
21
  "chalk": "^5.3.0",
22
- "commander": "^11.1.0",
23
- "iosignal": "^1.3.2",
24
- "meta-buffer-pack": "^1.4.0",
25
- "redis": "^4.6.12"
22
+ "commander": "^12.1.0",
23
+ "iosignal": "^2.0.0",
24
+ "meta-buffer-pack": "^2.0.2",
25
+ "redis": "^4.7.0"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "homepage": "https://iosignal.net",
32
32
  "keywords": [
33
- "io",
33
+ "websocket",
34
34
  "pubsub",
35
35
  "arduino",
36
36
  "iot",