@toa.io/core 1.0.0-alpha.30 → 1.0.0-alpha.31

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/receiver.js +5 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/core",
3
- "version": "1.0.0-alpha.30",
3
+ "version": "1.0.0-alpha.31",
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,13 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@rsql/parser": "1.2.4",
24
- "@toa.io/console": "1.0.0-alpha.30",
25
- "@toa.io/generic": "1.0.0-alpha.30",
26
- "@toa.io/yaml": "1.0.0-alpha.30",
24
+ "@toa.io/console": "1.0.0-alpha.31",
25
+ "@toa.io/generic": "1.0.0-alpha.31",
26
+ "@toa.io/yaml": "1.0.0-alpha.31",
27
27
  "error-value": "0.3.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "clone-deep": "4.0.1"
31
31
  },
32
- "gitHead": "29cc19358f35fbe9229dced979724f7a26538013"
32
+ "gitHead": "91839a488176853a0731f49abc70dc7103ed7cca"
33
33
  }
package/src/receiver.js CHANGED
@@ -16,18 +16,13 @@ class Receiver extends Connector {
16
16
  /** @type {string} */
17
17
  #endpoint
18
18
 
19
- /** @type {toa.core.Component} */
19
+ /** @type {unknown[]} */
20
+ #arguments
21
+
20
22
  #local
21
23
 
22
- /** @type {toa.core.bridges.Receiver} */
23
24
  #bridge
24
25
 
25
- /**
26
- *
27
- * @param {toa.norm.component.Receiver} definition
28
- * @param {toa.core.Component} local
29
- * @param {toa.core.bridges.Receiver} bridge
30
- */
31
26
  constructor (definition, local, bridge) {
32
27
  super()
33
28
 
@@ -36,6 +31,7 @@ class Receiver extends Connector {
36
31
  this.#conditioned = conditioned
37
32
  this.#adaptive = adaptive
38
33
  this.#endpoint = operation
34
+ this.#arguments = definition.arguments
39
35
 
40
36
  this.#local = local
41
37
  this.#bridge = bridge
@@ -58,7 +54,7 @@ class Receiver extends Connector {
58
54
  }
59
55
 
60
56
  async #request (payload) {
61
- return this.#adaptive ? await this.#bridge.request(payload) : { input: payload }
57
+ return this.#adaptive ? await this.#bridge.request(payload, ...(this.#arguments ?? [])) : { input: payload }
62
58
  }
63
59
  }
64
60