@toa.io/norm 0.20.0-dev.8 → 0.20.0-dev.9
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/norm",
|
|
3
|
-
"version": "0.20.0-dev.
|
|
3
|
+
"version": "0.20.0-dev.9",
|
|
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,11 +19,11 @@
|
|
|
19
19
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@toa.io/core": "0.20.0-dev.
|
|
23
|
-
"@toa.io/generic": "0.20.0-dev.
|
|
24
|
-
"@toa.io/schema": "0.20.0-dev.
|
|
25
|
-
"@toa.io/schemas": "0.20.0-dev.
|
|
26
|
-
"@toa.io/yaml": "0.20.0-dev.
|
|
22
|
+
"@toa.io/core": "0.20.0-dev.9",
|
|
23
|
+
"@toa.io/generic": "0.20.0-dev.9",
|
|
24
|
+
"@toa.io/schema": "0.20.0-dev.9",
|
|
25
|
+
"@toa.io/schemas": "0.20.0-dev.9",
|
|
26
|
+
"@toa.io/yaml": "0.20.0-dev.9"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "4e503ffe4fe6dfab1165e795832d3d4fba711582"
|
|
29
29
|
}
|
|
@@ -39,14 +39,15 @@ properties:
|
|
|
39
39
|
label:
|
|
40
40
|
$ref: 'definitions#/definitions/label'
|
|
41
41
|
|
|
42
|
+
name:
|
|
43
|
+
$ref: 'definitions#/definitions/token'
|
|
44
|
+
|
|
42
45
|
namespace:
|
|
43
46
|
$ref: 'definitions#/definitions/token'
|
|
44
47
|
default: 'default'
|
|
45
48
|
not:
|
|
46
49
|
oneOf:
|
|
47
50
|
- const: 'system'
|
|
48
|
-
name:
|
|
49
|
-
$ref: 'definitions#/definitions/token'
|
|
50
51
|
|
|
51
52
|
version:
|
|
52
53
|
$ref: 'definitions#/definitions/version'
|
|
@@ -68,11 +69,11 @@ properties:
|
|
|
68
69
|
propertyNames:
|
|
69
70
|
oneOf:
|
|
70
71
|
- $ref: 'definitions#/definitions/token'
|
|
71
|
-
- enum: [
|
|
72
|
+
- enum: [_version]
|
|
72
73
|
initialized:
|
|
73
74
|
type: boolean
|
|
74
75
|
default: false
|
|
75
|
-
required: [
|
|
76
|
+
required: [schema]
|
|
76
77
|
additionalProperties: false
|
|
77
78
|
|
|
78
79
|
bindings:
|
|
@@ -94,11 +95,11 @@ properties:
|
|
|
94
95
|
type: object
|
|
95
96
|
properties:
|
|
96
97
|
type:
|
|
97
|
-
enum: [
|
|
98
|
+
enum: [transition, observation, assignment, computation, effect]
|
|
98
99
|
scope:
|
|
99
|
-
enum: [
|
|
100
|
+
enum: [object, objects, changeset, none]
|
|
100
101
|
concurrency:
|
|
101
|
-
enum: [
|
|
102
|
+
enum: [none, retry]
|
|
102
103
|
forward:
|
|
103
104
|
$ref: 'definitions#/definitions/token'
|
|
104
105
|
bridge:
|
|
@@ -111,7 +112,7 @@ properties:
|
|
|
111
112
|
$ref: 'definitions#/definitions/schema'
|
|
112
113
|
query:
|
|
113
114
|
type: boolean
|
|
114
|
-
required: [
|
|
115
|
+
required: [type, scope, bindings]
|
|
115
116
|
allOf:
|
|
116
117
|
- if: # transition
|
|
117
118
|
properties:
|
|
@@ -120,15 +121,15 @@ properties:
|
|
|
120
121
|
then:
|
|
121
122
|
properties:
|
|
122
123
|
scope:
|
|
123
|
-
enum: [
|
|
124
|
+
enum: [object]
|
|
124
125
|
if: # transition query: false
|
|
125
126
|
not:
|
|
126
127
|
properties:
|
|
127
128
|
query:
|
|
128
129
|
const: false
|
|
129
|
-
required: [
|
|
130
|
+
required: [query]
|
|
130
131
|
then:
|
|
131
|
-
required: [
|
|
132
|
+
required: [concurrency]
|
|
132
133
|
- if: # not transition
|
|
133
134
|
not:
|
|
134
135
|
properties:
|
|
@@ -145,7 +146,7 @@ properties:
|
|
|
145
146
|
then:
|
|
146
147
|
properties:
|
|
147
148
|
scope:
|
|
148
|
-
enum: [
|
|
149
|
+
enum: [object, objects, none]
|
|
149
150
|
query:
|
|
150
151
|
not:
|
|
151
152
|
const: false
|
|
@@ -156,7 +157,7 @@ properties:
|
|
|
156
157
|
then:
|
|
157
158
|
properties:
|
|
158
159
|
scope:
|
|
159
|
-
enum: [
|
|
160
|
+
enum: [changeset]
|
|
160
161
|
- if: # computation
|
|
161
162
|
properties:
|
|
162
163
|
type:
|
|
@@ -198,7 +199,7 @@ properties:
|
|
|
198
199
|
subjective:
|
|
199
200
|
type: boolean
|
|
200
201
|
default: false
|
|
201
|
-
required: [
|
|
202
|
+
required: [bridge, path]
|
|
202
203
|
additionalProperties: false
|
|
203
204
|
|
|
204
205
|
receivers:
|
|
@@ -223,7 +224,7 @@ properties:
|
|
|
223
224
|
adaptive:
|
|
224
225
|
type: boolean
|
|
225
226
|
default: false
|
|
226
|
-
required: [
|
|
227
|
+
required: [operation]
|
|
227
228
|
additionalProperties: false
|
|
228
229
|
|
|
229
230
|
extensions:
|
|
@@ -37,14 +37,14 @@ describe('namespace', () => {
|
|
|
37
37
|
manifest.namespace = 'foo_'
|
|
38
38
|
expect(() => validate(manifest)).toThrow(/must match pattern/)
|
|
39
39
|
|
|
40
|
-
manifest.namespace = '
|
|
40
|
+
manifest.namespace = 'foo_bar'
|
|
41
41
|
expect(() => validate(manifest)).toThrow(/must match pattern/)
|
|
42
42
|
|
|
43
|
-
manifest.namespace = 'foo-
|
|
44
|
-
expect(() => validate(manifest)).
|
|
43
|
+
manifest.namespace = 'foo-'
|
|
44
|
+
expect(() => validate(manifest)).toThrow(/must match pattern/)
|
|
45
45
|
|
|
46
|
-
manifest.namespace = '
|
|
47
|
-
expect(() => validate(manifest)).
|
|
46
|
+
manifest.namespace = 'foo-bar'
|
|
47
|
+
expect(() => validate(manifest)).toThrow('must match pattern')
|
|
48
48
|
|
|
49
49
|
manifest.namespace = 'FooBar12'
|
|
50
50
|
expect(() => validate(manifest)).not.toThrow()
|
|
@@ -230,7 +230,7 @@ describe('operations', () => {
|
|
|
230
230
|
|
|
231
231
|
describe('receivers', () => {
|
|
232
232
|
it('should throw if transition points to undefined operation', () => {
|
|
233
|
-
manifest.receivers['foo.bar.happened'].operation = '
|
|
233
|
+
manifest.receivers['foo.bar.happened'].operation = 'notExists'
|
|
234
234
|
|
|
235
235
|
expect(() => validate(manifest)).toThrow(/refers to undefined operation/)
|
|
236
236
|
})
|