@toa.io/core 0.20.0-dev.18 → 0.20.0-dev.19

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-dev.18",
3
+ "version": "0.20.0-dev.19",
4
4
  "description": "Toa Core",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -12,6 +12,7 @@
12
12
  "url": "https://github.com/toa-io/toa/issues"
13
13
  },
14
14
  "main": "src/index.js",
15
+ "types": "types/index.d.ts",
15
16
  "publishConfig": {
16
17
  "access": "public"
17
18
  },
@@ -20,10 +21,10 @@
20
21
  },
21
22
  "dependencies": {
22
23
  "@rsql/parser": "1.2.4",
23
- "@toa.io/console": "0.20.0-dev.18",
24
- "@toa.io/generic": "0.20.0-dev.18",
25
- "@toa.io/yaml": "0.20.0-dev.18",
24
+ "@toa.io/console": "0.20.0-dev.19",
25
+ "@toa.io/generic": "0.20.0-dev.19",
26
+ "@toa.io/yaml": "0.20.0-dev.19",
26
27
  "clone-deep": "4.0.1"
27
28
  },
28
- "gitHead": "24c2fccf1af324fc4b0e32d5e3e012786618f5bb"
29
+ "gitHead": "e10214f746cf4fc699af42dba90e099487177a43"
29
30
  }
package/test/call.test.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict'
2
2
 
3
+ jest.mock('../src/connector')
4
+
3
5
  const { Call } = require('../src/call')
4
6
  const fixtures = require('./call.fixtures')
5
7
 
6
- jest.mock('../src/connector')
7
-
8
8
  const { Connector } = require('../src/connector')
9
9
 
10
10
  let call
@@ -1,24 +1,18 @@
1
- declare namespace toa.core {
1
+ export class Connector {
2
+ public id: string
3
+ public connected: boolean
2
4
 
3
- interface Connector {
4
- id: string
5
- connected: boolean
5
+ public connect (): Promise<void>
6
6
 
7
- depends(connector: Connector): Connector
7
+ public disconnect (interrupt?: boolean): Promise<void>
8
8
 
9
- link(connector: Connector): void
9
+ protected depends (connector: Connector | Connector[]): Connector
10
10
 
11
- connect(): Promise<void>
11
+ link (connector: Connector): void
12
12
 
13
- disconnect(interrupt?: boolean): Promise<void>
13
+ protected open (): Promise<void>
14
14
 
15
- open(): Promise<void>
16
-
17
- close(): Promise<void>
18
-
19
- dispose(): Promise<void>
20
- }
15
+ protected close (): Promise<void>
21
16
 
17
+ protected dispose (): Promise<void>
22
18
  }
23
-
24
- export type Connector = toa.core.Connector
@@ -7,21 +7,21 @@ import * as _bindings from './bindings'
7
7
  declare namespace toa.core.extensions {
8
8
 
9
9
  interface Factory {
10
- tenant?(locator: _core.Locator, declaration: object): _core.Connector
10
+ tenant? (locator: _core.Locator, declaration: object): _core.Connector
11
11
 
12
- aspect?(locator: _core.Locator, declaration: object): Aspect | Aspect[]
12
+ aspect? (locator: _core.Locator, declaration: object): Aspect | Aspect[]
13
13
 
14
- service?(name?: string): _core.Connector
14
+ service? (name?: string): _core.Connector | null
15
15
 
16
- component?(component: _component.Component): _component.Component
16
+ component? (component: _component.Component): _component.Component
17
17
 
18
- context?(context: _context.Context): _context.Context
18
+ context? (context: _context.Context): _context.Context
19
19
 
20
- storage?(storage: _storages.Storage): _storages.Storage
20
+ storage? (storage: _storages.Storage): _storages.Storage
21
21
 
22
- emitter?(emitter: _bindings.Emitter, label: string): _bindings.Emitter
22
+ emitter? (emitter: _bindings.Emitter, label: string): _bindings.Emitter
23
23
 
24
- receiver?(receiver: _core.Receiver, locator: _core.Locator): _core.Receiver
24
+ receiver? (receiver: _core.Receiver, locator: _core.Locator): _core.Receiver
25
25
  }
26
26
 
27
27
  interface Aspect extends _core.Connector {
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * as bindings from './bindings'
2
2
  export * as extensions from './extensions'
3
3
  export * as storages from './storages'
4
4
  export * as bridges from './bridges'
5
+ export * as operations from './operations'
5
6
 
6
7
  export { Component } from './component'
7
8
  export { Connector } from './connector'
@@ -1,16 +1,12 @@
1
- declare namespace toa.core {
1
+ export class Locator {
2
+ public readonly name: string
3
+ public readonly namespace: string
2
4
 
3
- interface Locator {
4
- name: string
5
- namespace: string
5
+ public readonly id: string
6
+ public readonly label: string
7
+ public readonly uppercase: string
6
8
 
7
- id: string
8
- label: string
9
- uppercase: string
10
-
11
- hostname(type?: string): string
12
- }
9
+ constructor (name: string, namespace: string)
13
10
 
11
+ hostname (type?: string): string
14
12
  }
15
-
16
- export type Locator = toa.core.Locator
File without changes