@toa.io/core 0.6.0-dev.3 → 0.6.0

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.6.0-dev.3",
3
+ "version": "0.6.0",
4
4
  "description": "Toa Core",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@rsql/parser": "1.2.4",
23
- "@toa.io/console": "0.6.0-dev.1",
24
- "@toa.io/generic": "0.6.0-dev.1",
25
- "@toa.io/yaml": "0.6.0-dev.1",
23
+ "@toa.io/console": "0.6.0",
24
+ "@toa.io/generic": "0.6.0",
25
+ "@toa.io/yaml": "0.6.0",
26
26
  "clone-deep": "4.0.1"
27
27
  },
28
- "gitHead": "08ffb832d6593ec1b42bff71cfbfd8fcd871c501"
28
+ "gitHead": "a807d9906db194f5851613a1ead5450d277f4939"
29
29
  }
package/src/cascade.js CHANGED
@@ -18,7 +18,7 @@ class Cascade extends Connector {
18
18
  const reply = {}
19
19
 
20
20
  for (const bridge of this.#bridges) {
21
- const partial = await bridge.run(...args)
21
+ const partial = await bridge.execute(...args)
22
22
 
23
23
  if (partial.error) return { error: partial.error }
24
24
 
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const bridges = ['a', 'b', 'c'].map((index) => ({
4
- run: jest.fn((request) => {
4
+ execute: jest.fn((request) => {
5
5
  if (request?.error === index) return { error: index }
6
6
 
7
7
  return { output: { [index]: true } }
@@ -21,11 +21,11 @@ it('should depend on bridges', () => {
21
21
  expect(Connector.mock.instances[0].depends).toHaveBeenCalledWith(fixtures.bridges)
22
22
  })
23
23
 
24
- it('should call bridges.run', async () => {
24
+ it('should call bridges.execute', async () => {
25
25
  const args = [1, 2]
26
26
  await cascade.run(...args)
27
27
 
28
- for (const bridge of fixtures.bridges) expect(bridge.run).toHaveBeenCalledWith(...args)
28
+ for (const bridge of fixtures.bridges) expect(bridge.execute).toHaveBeenCalledWith(...args)
29
29
  })
30
30
 
31
31
  it('should merge output', async () => {
@@ -38,5 +38,5 @@ it('should interrupt on error', async () => {
38
38
  const reply = await cascade.run({ error: 'b' })
39
39
 
40
40
  expect(reply).toStrictEqual({ error: 'b' })
41
- expect(fixtures.bridges[2].run).not.toHaveBeenCalled()
41
+ expect(fixtures.bridges[2].execute).not.toHaveBeenCalled()
42
42
  })
@@ -6,7 +6,7 @@ import type * as connector from './connector'
6
6
  declare namespace toa.core.bridges {
7
7
 
8
8
  interface Algorithm extends connector.Connector {
9
- run(input: Object, state: Object | Object[]): Promise<reply.Reply>
9
+ execute(input?: any, scope?: object | object[]): Promise<reply.Reply>
10
10
  }
11
11
 
12
12
  interface Event {