@toa.io/boot 0.20.0-dev.2 → 0.20.0-dev.21

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,10 +1,11 @@
1
1
  {
2
2
  "name": "@toa.io/boot",
3
- "version": "0.20.0-dev.2",
3
+ "version": "0.20.0-dev.21",
4
4
  "description": "Toa Boot",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
7
7
  "main": "src/index.js",
8
+ "types": "types/index.d.ts",
8
9
  "repository": {
9
10
  "type": "git",
10
11
  "url": "git+https://github.com/toa-io/toa.git"
@@ -19,13 +20,13 @@
19
20
  "test": "echo \"Error: run tests from root\" && exit 1"
20
21
  },
21
22
  "dependencies": {
22
- "@toa.io/core": "0.20.0-dev.2",
23
- "@toa.io/filesystem": "0.20.0-dev.2",
24
- "@toa.io/generic": "0.20.0-dev.2",
25
- "@toa.io/norm": "0.20.0-dev.2",
26
- "@toa.io/schema": "0.20.0-dev.2",
23
+ "@toa.io/core": "0.20.0-dev.21",
24
+ "@toa.io/filesystem": "0.20.0-dev.21",
25
+ "@toa.io/generic": "0.20.0-dev.21",
26
+ "@toa.io/norm": "0.20.0-dev.21",
27
+ "@toa.io/schema": "0.20.0-dev.21",
27
28
  "clone-deep": "4.0.1",
28
- "dotenv": "16.0.3"
29
+ "dotenv": "16.1.1"
29
30
  },
30
- "gitHead": "3e767a32bf4705bacee7b2e8312ed0b0805a5260"
31
+ "gitHead": "7dbe313e05e714e35401adb5f0507e140f3f1215"
31
32
  }
package/src/operation.js CHANGED
@@ -6,11 +6,14 @@ const boot = require('./index')
6
6
 
7
7
  const operation = (manifest, endpoint, definition, context, scope) => {
8
8
  const cascade = boot.cascade(manifest, endpoint, definition, context)
9
- const contract = boot.contract.reply(definition.output, definition.error)
9
+ const reply = boot.contract.reply(definition.output, definition.error)
10
+ const input = definition.input
11
+ const request = boot.contract.request({ input })
12
+ const contracts = { reply, request }
10
13
  const query = new Query(manifest.entity.schema.properties)
11
14
  const Type = TYPES[definition.type]
12
15
 
13
- return new Type(cascade, scope, contract, query, definition)
16
+ return new Type(cascade, scope, contracts, query, definition)
14
17
  }
15
18
 
16
19
  const TYPES = {
@@ -0,0 +1,3 @@
1
+ import type { bindings } from '@toa.io/core'
2
+
3
+ export function broadcast (name: string, group?: string, binding?: string): bindings.Broadcast
@@ -1,20 +1,5 @@
1
- import * as _core from '@toa.io/core/types'
2
-
3
- declare namespace toa.boot {
4
-
5
- namespace composition {
6
-
7
- type Options = {
8
- bindings?: string[]
9
- storage?: string
10
- extensions?: string[]
11
- }
12
-
13
- }
14
-
15
- type Composition = (paths: string[], options: composition.Options) => Promise<_core.Connector>
16
-
1
+ export type Options = {
2
+ bindings?: string[]
3
+ storage?: string
4
+ extensions?: string[]
17
5
  }
18
-
19
- export type Options = toa.boot.composition.Options
20
- export type Composition = toa.boot.Composition
package/types/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
- import { Composition } from './composition'
1
+ import * as core from '@toa.io/core'
2
+ import * as composition from './composition'
2
3
 
3
- export const composition: Composition
4
+ export * as bindings from './bindings'
5
+
6
+ export async function composition (paths: string[], options?: composition.Options): Promise<core.Connector>
7
+
8
+ export async function remote (locator: core.Locator): Promise<core.Component>