@toa.io/boot 1.0.0-alpha.227 → 1.0.0-alpha.228

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/boot",
3
- "version": "1.0.0-alpha.227",
3
+ "version": "1.0.0-alpha.228",
4
4
  "description": "Toa Boot",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -20,14 +20,14 @@
20
20
  "test": "echo \"Error: run tests from root\" && exit 1"
21
21
  },
22
22
  "dependencies": {
23
- "@toa.io/core": "1.0.0-alpha.226",
23
+ "@toa.io/core": "1.0.0-alpha.228",
24
24
  "@toa.io/filesystem": "1.0.0-alpha.225",
25
25
  "@toa.io/generic": "1.0.0-alpha.225",
26
- "@toa.io/norm": "1.0.0-alpha.226",
26
+ "@toa.io/norm": "1.0.0-alpha.228",
27
27
  "@toa.io/schemas": "1.0.0-alpha.225",
28
28
  "clone-deep": "4.0.1",
29
29
  "dotenv": "16.1.1",
30
30
  "openspan": "1.0.0-alpha.173"
31
31
  },
32
- "gitHead": "1f6038e5c57f190cd1c04db7590f13651b909fb1"
32
+ "gitHead": "2c5ad2211fc9bbf411a812cb8b240d8f1d9484e0"
33
33
  }
package/src/cascade.js CHANGED
@@ -4,7 +4,7 @@ const { Cascade } = require('@toa.io/core')
4
4
 
5
5
  const boot = require('./index')
6
6
 
7
- async function cascade (manifest, endpoint, definition, context) {
7
+ async function cascade (manifest, endpoint, definition, context, rc) {
8
8
  const bridges = []
9
9
 
10
10
  if (definition.forward) endpoint = definition.forward
@@ -27,7 +27,7 @@ async function cascade (manifest, endpoint, definition, context) {
27
27
  bridges.unshift(bridge)
28
28
  }
29
29
 
30
- return new Cascade(bridges)
30
+ return new Cascade(bridges, rc)
31
31
  }
32
32
 
33
33
  exports.cascade = cascade
package/src/component.js CHANGED
@@ -23,25 +23,24 @@ const component = async (manifest) => {
23
23
  state = new State(storage, entity, emission, manifest.entity.associated)
24
24
  }
25
25
 
26
- const operations = await bootOperations(manifest, context, state)
27
26
  const rc = await boot.rc(manifest, context)
27
+ const operations = await bootOperations(manifest, context, state, rc)
28
28
  const component = new Component(locator, operations)
29
29
 
30
- if (rc) component.depends(rc)
31
30
  if (storage) component.depends(storage)
32
31
  if (emission) component.depends(emission)
33
32
 
34
33
  return boot.extensions.component(component)
35
34
  }
36
35
 
37
- async function bootOperations (manifest, context, state) {
36
+ async function bootOperations (manifest, context, state, rc) {
38
37
  if (manifest.operations === undefined)
39
38
  return {}
40
39
 
41
40
  const operations = {}
42
41
 
43
42
  for (const [endpoint, definition] of Object.entries(manifest.operations))
44
- operations[endpoint] = await boot.operation(manifest, endpoint, definition, context, state)
43
+ operations[endpoint] = await boot.operation(manifest, endpoint, definition, context, state, rc)
45
44
 
46
45
  return operations
47
46
  }
package/src/operation.js CHANGED
@@ -12,8 +12,8 @@ const {
12
12
 
13
13
  const boot = require('./index')
14
14
 
15
- async function operation (manifest, endpoint, definition, context, scope) {
16
- const cascade = await boot.cascade(manifest, endpoint, definition, context)
15
+ async function operation (manifest, endpoint, definition, context, scope, rc) {
16
+ const cascade = await boot.cascade(manifest, endpoint, definition, context, rc)
17
17
  const reply = boot.contract.reply(definition.output, definition.error)
18
18
  const input = definition.input
19
19
  const request = boot.contract.request({ input }, manifest.entity)