miolo-cli 3.0.0-beta.203 → 3.0.0-beta.204

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miolo-cli",
3
- "version": "3.0.0-beta.203",
3
+ "version": "3.0.0-beta.204",
4
4
  "description": "cli utils for miolo",
5
5
  "author": "Donato Lorenzo <donato@afialapis.com>",
6
6
  "contributors": [
@@ -30,7 +30,7 @@
30
30
  "prepublishOnly": "npm run lint"
31
31
  },
32
32
  "dependencies": {
33
- "qs": "^6.15.1",
33
+ "qs": "^6.15.2",
34
34
  "socket.io-client": "^4.8.3"
35
35
  },
36
36
  "engines": {
package/src/index.mjs CHANGED
@@ -1,26 +1,29 @@
1
1
  import { init_catcher } from "./catcher/index.mjs"
2
2
  import { init_fetcher } from "./fetcher/index.mjs"
3
- // import {init_socket} from './socket/index.mjs'
3
+ import { init_socket } from "./socket/index.mjs"
4
4
 
5
5
  export function miolo_client(context) {
6
6
  const { config } = context
7
7
 
8
+ console.log(`[miolo-cli] init_fetcher`)
8
9
  const fetcher = init_fetcher(config)
9
10
 
10
11
  if (config?.catcher_url) {
12
+ console.log(`[miolo-cli] init_catcher at ${config?.catcher_url}`)
11
13
  init_catcher(config?.catcher_url, fetcher)
12
14
  }
13
15
 
14
- // let socket
15
- // if (config?.socket?.enabled===true) {
16
- // const domain = config?.socket?.domain
17
- // const options = config?.socket?.options
18
- // socket = init_socket(domain, options)
19
- // }
16
+ let socket
17
+ if (config?.socket?.enabled === true) {
18
+ console.log(`[miolo-cli] init_socket at ${config?.socket?.url || "default url"}`)
19
+ const url = config?.socket?.url
20
+ const options = config?.socket?.options
21
+ socket = init_socket(url, options)
22
+ }
20
23
 
21
24
  const miolo_obj = {
22
- fetcher
23
- //socket
25
+ fetcher,
26
+ socket
24
27
  }
25
28
 
26
29
  return miolo_obj
@@ -1,6 +1,6 @@
1
1
  import { io } from "socket.io-client"
2
2
 
3
- export function init_socket(domain, options) {
4
- const socket = io(domain, options)
3
+ export function init_socket(url, options) {
4
+ const socket = io(url, options)
5
5
  return socket
6
6
  }