@toa.io/core 0.20.0-alpha.1 → 0.20.0-alpha.2

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": "0.20.0-alpha.1",
3
+ "version": "0.20.0-alpha.2",
4
4
  "description": "Toa Core",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -24,10 +24,10 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@rsql/parser": "1.2.4",
27
- "@toa.io/console": "0.20.0-alpha.1",
28
- "@toa.io/generic": "0.20.0-alpha.1",
29
- "@toa.io/yaml": "0.20.0-alpha.1",
27
+ "@toa.io/console": "0.20.0-alpha.2",
28
+ "@toa.io/generic": "0.20.0-alpha.2",
29
+ "@toa.io/yaml": "0.20.0-alpha.2",
30
30
  "clone-deep": "4.0.1"
31
31
  },
32
- "gitHead": "d1a5369c0ee4ee423f792b83e9753fd2fd943cce"
32
+ "gitHead": "d6e8c5bdae26e2beb66f4d7f37f71a3494fe9fcb"
33
33
  }
package/src/call.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { Connector } = require('./connector')
4
4
  const { Nope } = require('nopeable')
5
+ const { Readable } = require('stream')
5
6
 
6
7
  class Call extends Connector {
7
8
  #transmitter
@@ -25,6 +26,7 @@ class Call extends Connector {
25
26
  const reply = await this.#transmitter.request(request)
26
27
 
27
28
  if (reply === null) return null
29
+ else if (reply instanceof Readable) return reply
28
30
  else {
29
31
  if (reply.exception !== undefined)
30
32
  throw reply.exception
package/src/context.js CHANGED
@@ -38,7 +38,7 @@ class Context extends Connector {
38
38
  async #remote (namespace, name) {
39
39
  const key = namespace + '.' + name
40
40
 
41
- if (this.#remotes[key] === undefined) this.#remotes[key] = this.#connect(namespace, name)
41
+ this.#remotes[key] ??= this.#connect(namespace, name)
42
42
 
43
43
  return this.#remotes[key]
44
44
  }
package/src/operation.js CHANGED
@@ -53,7 +53,7 @@ class Operation extends Connector {
53
53
  const { request, state } = store
54
54
  const reply = await this.#cascade.run(request.input, state) || {}
55
55
 
56
- this.#contracts.reply.fit(reply)
56
+ // this.#contracts.reply.fit(reply)
57
57
 
58
58
  store.reply = reply
59
59
  }
package/src/transition.js CHANGED
@@ -50,7 +50,6 @@ class Transition extends Operation {
50
50
  }
51
51
  }
52
52
 
53
- /** @type {toa.generic.retry.Options} */
54
53
  const RETRY = {
55
54
  base: 10,
56
55
  max: 5000,
@@ -1,7 +1,6 @@
1
1
  import { Connector } from './connector'
2
2
  import { Locator } from './locator'
3
3
  import { Request } from './request'
4
- import { type Nopeable } from 'nopeable'
5
4
 
6
5
  export interface Component extends Connector {
7
6
  locator: Locator
@@ -1,9 +1,3 @@
1
- declare namespace toa.core {
2
-
3
- type Message = {
4
- payload: Object
5
- }
6
-
1
+ export interface Message<T = any> {
2
+ payload: T
7
3
  }
8
-
9
- export type Message = toa.core.Message