@toa.io/norm 0.24.0-alpha.21 → 0.24.0-alpha.23
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 +7 -7
- package/src/.component/merge.js +7 -1
- package/src/shortcuts.js +1 -0
- package/types/component.d.ts +2 -4
- package/types/context.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/norm",
|
|
3
|
-
"version": "0.24.0-alpha.
|
|
3
|
+
"version": "0.24.0-alpha.23",
|
|
4
4
|
"description": "Toa declarations normalization and validation",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@toa.io/core": "0.24.0-alpha.
|
|
24
|
-
"@toa.io/generic": "0.24.0-alpha.
|
|
25
|
-
"@toa.io/schema": "0.24.0-alpha.
|
|
26
|
-
"@toa.io/schemas": "0.24.0-alpha.
|
|
27
|
-
"@toa.io/yaml": "0.24.0-alpha.
|
|
23
|
+
"@toa.io/core": "0.24.0-alpha.23",
|
|
24
|
+
"@toa.io/generic": "0.24.0-alpha.23",
|
|
25
|
+
"@toa.io/schema": "0.24.0-alpha.23",
|
|
26
|
+
"@toa.io/schemas": "0.24.0-alpha.23",
|
|
27
|
+
"@toa.io/yaml": "0.24.0-alpha.23"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "df9de3cbb530e8f985a660bca0bf65bd027dbb01"
|
|
30
30
|
}
|
package/src/.component/merge.js
CHANGED
|
@@ -28,6 +28,10 @@ const define = async (root, manifest, property) => {
|
|
|
28
28
|
|
|
29
29
|
// default bridge
|
|
30
30
|
const definition = await scan(manifest.bridge, root, property)
|
|
31
|
+
|
|
32
|
+
if (definition === undefined)
|
|
33
|
+
return
|
|
34
|
+
|
|
31
35
|
const items = Object.entries(definition)
|
|
32
36
|
|
|
33
37
|
if (items.length) {
|
|
@@ -49,7 +53,9 @@ const define = async (root, manifest, property) => {
|
|
|
49
53
|
const scan = async (bridge, root, property) => {
|
|
50
54
|
const { define } = require(bridge)
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
if (property in define)
|
|
57
|
+
return define[property](root)
|
|
58
|
+
else return undefined
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
exports.merge = bridge
|
package/src/shortcuts.js
CHANGED
|
@@ -41,6 +41,7 @@ const recognize = (shortcuts, object, group) => {
|
|
|
41
41
|
const SHORTCUTS = {
|
|
42
42
|
amqp: '@toa.io/bindings.amqp',
|
|
43
43
|
node: '@toa.io/bridges.node',
|
|
44
|
+
bash: '@toa.io/bridges.bash',
|
|
44
45
|
mongodb: '@toa.io/storages.mongodb',
|
|
45
46
|
sql: '@toa.io/storages.sql',
|
|
46
47
|
queues: '@toa.io/storages.queues',
|
package/types/component.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ type Map = {
|
|
|
4
4
|
[id: string]: Component
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
type Operation = {
|
|
7
|
+
export type Operation = {
|
|
8
8
|
type: operations.type
|
|
9
9
|
scope?: operations.scope
|
|
10
10
|
bindings?: string[]
|
|
@@ -14,9 +14,7 @@ type Operation = {
|
|
|
14
14
|
query?: boolean
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
type Operations =
|
|
18
|
-
[key: string]: Operation
|
|
19
|
-
}
|
|
17
|
+
export type Operations = Record<string, Operation>
|
|
20
18
|
|
|
21
19
|
type Event = {
|
|
22
20
|
binding: string
|
package/types/context.d.ts
CHANGED