@toa.io/core 1.0.0-alpha.59 → 1.0.0-alpha.63

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": "@toa.io/core",
3
- "version": "1.0.0-alpha.59",
3
+ "version": "1.0.0-alpha.63",
4
4
  "description": "Toa Core",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -21,13 +21,10 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@rsql/parser": "1.2.4",
24
- "@toa.io/console": "1.0.0-alpha.59",
25
- "@toa.io/generic": "1.0.0-alpha.59",
26
- "@toa.io/yaml": "1.0.0-alpha.59",
27
- "error-value": "0.3.0"
24
+ "@toa.io/generic": "1.0.0-alpha.63",
25
+ "@toa.io/yaml": "1.0.0-alpha.63",
26
+ "error-value": "0.3.0",
27
+ "openspan": "1.0.0-alpha.63"
28
28
  },
29
- "devDependencies": {
30
- "clone-deep": "4.0.1"
31
- },
32
- "gitHead": "157e7fa2e26f4612bbb7848c420f4c21746e5bfd"
29
+ "gitHead": "9acf69d3135ea69bb9080c4f2f654d119f7b8a82"
33
30
  }
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { console } = require('@toa.io/console')
3
+ const { console } = require('openspan')
4
4
  const { Connector } = require('./connector')
5
5
 
6
6
  class Composition extends Connector {
package/src/connector.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { console } = require('@toa.io/console')
3
+ const { console } = require('openspan')
4
4
  const { newid } = require('@toa.io/generic')
5
5
 
6
6
  /**
@@ -86,8 +86,6 @@ class Connector {
86
86
 
87
87
  this.#disconnecting = undefined
88
88
 
89
- console.debug(`Connecting '${this.id}' with ${this.#dependencies.length} dependencies...`)
90
-
91
89
  this.#connecting = (async () => {
92
90
  await Promise.all(this.#dependencies.map((connector) => connector.connect()))
93
91
  await this.open()
@@ -100,8 +98,6 @@ class Connector {
100
98
  await this.disconnect(true)
101
99
  throw e
102
100
  }
103
-
104
- console.debug(`Connector '${this.id}' connected`)
105
101
  }
106
102
 
107
103
  /**
@@ -132,7 +128,8 @@ class Connector {
132
128
  const interval = setInterval(() => {
133
129
  const delay = +new Date() - start
134
130
 
135
- if (delay > DELAY) console.warn(`Connector ${this.id} still disconnecting (${delay})`)
131
+ if (delay > DELAY)
132
+ console.warn(`Connector ${this.id} still disconnecting (${delay})`)
136
133
  }, DELAY)
137
134
 
138
135
  if (interrupt !== true) await this.close()
@@ -145,8 +142,6 @@ class Connector {
145
142
  })()
146
143
 
147
144
  await this.#disconnecting
148
-
149
- console.debug(`Connector '${this.id}' disconnected`)
150
145
  }
151
146
 
152
147
  async reconnect () {
package/src/discovery.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { console } = require('@toa.io/console')
3
+ const { console } = require('openspan')
4
4
  const { Connector } = require('./connector')
5
5
 
6
6
  class Discovery extends Connector {
@@ -25,7 +25,7 @@ class Discovery extends Connector {
25
25
  this.depends(this.#lookups[id])
26
26
  }
27
27
 
28
- const warning = () => console.warn(`Waiting for lookup response from '${id}'...`)
28
+ const warning = () => console.warn(`Waiting for lookup response from %s...`, id)
29
29
  const timeout = setTimeout(warning, TIMEOUT)
30
30
 
31
31
  const output = await this.#lookups[id].invoke()
package/src/operation.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict'
2
2
 
3
+ const { console } = require('openspan')
3
4
  const { Connector } = require('./connector')
4
5
  const { SystemException, RequestContractException } = require('./exceptions')
5
6
  const { Readable } = require('node:stream')
@@ -41,7 +42,7 @@ class Operation extends Connector {
41
42
 
42
43
  return await this.process(store)
43
44
  } catch (e) {
44
- console.error(e)
45
+ console.error('Failed to execute operation', e)
45
46
 
46
47
  const exception = e instanceof Error ? new SystemException(e) : e
47
48
 
package/src/remote.js CHANGED
@@ -1,19 +1,9 @@
1
1
  'use strict'
2
2
 
3
- const { console } = require('@toa.io/console')
4
-
5
3
  const assert = require('node:assert')
6
4
  const { Component } = require('./component')
7
5
 
8
6
  class Remote extends Component {
9
- async open () {
10
- console.info(`Remote '${this.locator.id}' connected`)
11
- }
12
-
13
- async dispose () {
14
- console.info(`Remote '${this.locator.id}' disconnected`)
15
- }
16
-
17
7
  explain (endpoint) {
18
8
  assert.ok(endpoint in this.operations,
19
9
  `Endpoint '${endpoint}' is not provided by '${this.locator.id}'`)