@toa.io/norm 1.0.2-dev.8 → 1.1.0-canary.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 +8 -8
- package/src/.component/defaults.js +1 -9
- package/src/.context/schema.yaml +5 -4
- package/types/context.d.ts +12 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/norm",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0-canary.0",
|
|
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",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@toa.io/mock": "0.7.9-
|
|
22
|
+
"@toa.io/mock": "0.7.9-canary.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@toa.io/core": "1.1.0-
|
|
26
|
-
"@toa.io/generic": "0.11.0-
|
|
27
|
-
"@toa.io/schema": "0.7.6-
|
|
28
|
-
"@toa.io/schemas": "0.8.4-
|
|
29
|
-
"@toa.io/yaml": "0.7.6-
|
|
25
|
+
"@toa.io/core": "1.1.0-canary.0",
|
|
26
|
+
"@toa.io/generic": "0.11.0-canary.0",
|
|
27
|
+
"@toa.io/schema": "0.7.6-canary.0",
|
|
28
|
+
"@toa.io/schemas": "0.8.4-canary.0",
|
|
29
|
+
"@toa.io/yaml": "0.7.6-canary.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "0adb45e6d6d309b21b976d257ac0a4fc48d866b3"
|
|
32
32
|
}
|
|
@@ -3,15 +3,7 @@
|
|
|
3
3
|
// these defaults are required before validation
|
|
4
4
|
const defaults = (manifest) => {
|
|
5
5
|
if (manifest.prototype === undefined) manifest.prototype = '@toa.io/prototype'
|
|
6
|
-
|
|
7
|
-
if (manifest.bindings === undefined) {
|
|
8
|
-
const local = process.env.TOA_DEV === '1'
|
|
9
|
-
|
|
10
|
-
manifest.bindings = local
|
|
11
|
-
? ['@toa.io/bindings.amqp']
|
|
12
|
-
: ['@toa.io/bindings.http', '@toa.io/bindings.amqp']
|
|
13
|
-
}
|
|
14
|
-
|
|
6
|
+
if (manifest.bindings === undefined) manifest.bindings = ['@toa.io/bindings.amqp']
|
|
15
7
|
if (manifest.bridge === undefined) manifest.bridge = '@toa.io/bridges.node'
|
|
16
8
|
|
|
17
9
|
if (manifest.entity === null || manifest.entity === undefined) manifest.entity = { storage: null }
|
package/src/.context/schema.yaml
CHANGED
|
@@ -12,6 +12,7 @@ properties:
|
|
|
12
12
|
packages:
|
|
13
13
|
type: string
|
|
14
14
|
runtime:
|
|
15
|
+
type: object
|
|
15
16
|
properties:
|
|
16
17
|
version:
|
|
17
18
|
$ref: 'definitions#/definitions/version'
|
|
@@ -21,7 +22,7 @@ properties:
|
|
|
21
22
|
proxy:
|
|
22
23
|
type: string
|
|
23
24
|
format: uri
|
|
24
|
-
required: [version]
|
|
25
|
+
required: [ version ]
|
|
25
26
|
environment:
|
|
26
27
|
type: string
|
|
27
28
|
registry:
|
|
@@ -39,7 +40,7 @@ properties:
|
|
|
39
40
|
- linux/amd64
|
|
40
41
|
- linux/arm/v7
|
|
41
42
|
- linux/arm64
|
|
42
|
-
required: [base, platforms]
|
|
43
|
+
required: [ base, platforms ]
|
|
43
44
|
compositions:
|
|
44
45
|
type: array
|
|
45
46
|
minItems: 1
|
|
@@ -53,8 +54,8 @@ properties:
|
|
|
53
54
|
minItems: 1
|
|
54
55
|
items:
|
|
55
56
|
$ref: 'definitions#/definitions/locator'
|
|
56
|
-
required: [name, components]
|
|
57
|
+
required: [ name, components ]
|
|
57
58
|
annotations:
|
|
58
59
|
type: object
|
|
59
|
-
required: [runtime, name, packages, registry]
|
|
60
|
+
required: [ runtime, name, packages, registry ]
|
|
60
61
|
additionalProperties: false
|
package/types/context.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Component } from './component'
|
|
1
|
+
import * as _component from './component'
|
|
4
2
|
import { Locator } from '@toa.io/core/types'
|
|
5
3
|
|
|
6
4
|
declare namespace toa.norm {
|
|
@@ -14,13 +12,13 @@ declare namespace toa.norm {
|
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
interface Registry {
|
|
17
|
-
base
|
|
15
|
+
base?: string
|
|
18
16
|
platforms?: string[] | null
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
interface Composition {
|
|
22
20
|
name: string,
|
|
23
|
-
components: string[] | Component[]
|
|
21
|
+
components: string[] | _component.Component[]
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
namespace dependencies {
|
|
@@ -31,7 +29,7 @@ declare namespace toa.norm {
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
type References = {
|
|
34
|
-
[reference: string]: Component[]
|
|
32
|
+
[reference: string]: _component.Component[]
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
}
|
|
@@ -42,11 +40,11 @@ declare namespace toa.norm {
|
|
|
42
40
|
|
|
43
41
|
interface Declaration {
|
|
44
42
|
name: string
|
|
45
|
-
description
|
|
46
|
-
version
|
|
47
|
-
runtime
|
|
48
|
-
registry
|
|
49
|
-
packages
|
|
43
|
+
description?: string
|
|
44
|
+
version?: string
|
|
45
|
+
runtime?: Runtime | string
|
|
46
|
+
registry?: Registry | string
|
|
47
|
+
packages?: string
|
|
50
48
|
compositions?: Composition[]
|
|
51
49
|
annotations?: Record<string, object>
|
|
52
50
|
}
|
|
@@ -55,11 +53,10 @@ declare namespace toa.norm {
|
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
interface Context extends context.Declaration {
|
|
58
|
-
|
|
59
|
-
runtime: context.Runtime
|
|
56
|
+
runtime?: context.Runtime
|
|
60
57
|
environment?: string
|
|
61
|
-
registry
|
|
62
|
-
components
|
|
58
|
+
registry?: context.Registry
|
|
59
|
+
components?: _component.Component[]
|
|
63
60
|
dependencies?: context.Dependencies
|
|
64
61
|
}
|
|
65
62
|
|