@toa.io/norm 0.10.0-dev.0 → 0.10.0-dev.2

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.10.0-dev.0",
3
+ "version": "0.10.0-dev.2",
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.6-dev.0"
22
+ "@toa.io/mock": "0.7.6-dev.2"
23
23
  },
24
24
  "dependencies": {
25
- "@toa.io/core": "0.8.0",
26
- "@toa.io/generic": "0.8.0",
27
- "@toa.io/schema": "0.7.2",
28
- "@toa.io/schemas": "0.8.0",
29
- "@toa.io/yaml": "0.7.2"
25
+ "@toa.io/core": "0.8.1-dev.0",
26
+ "@toa.io/generic": "0.9.0-dev.0",
27
+ "@toa.io/schema": "0.7.3-dev.1",
28
+ "@toa.io/schemas": "0.8.1-dev.1",
29
+ "@toa.io/yaml": "0.7.3-dev.0"
30
30
  },
31
- "gitHead": "b3bf7cf661b21e8f767fe07689991ee93e885b44"
31
+ "gitHead": "8b2892693c2a83597fe450d66bc616ba7c63a61e"
32
32
  }
@@ -63,19 +63,16 @@ properties:
63
63
  type:
64
64
  default: object
65
65
  const: object
66
- additionalProperties:
67
- default: false
68
- const: false
69
66
  properties:
70
67
  type: object
71
68
  propertyNames:
72
69
  oneOf:
73
70
  - $ref: 'definitions#/definitions/token'
74
- - enum: [_version]
71
+ - enum: [ _version ]
75
72
  initialized:
76
73
  type: boolean
77
74
  default: false
78
- required: [schema]
75
+ required: [ schema ]
79
76
  additionalProperties: false
80
77
 
81
78
  bindings:
@@ -97,11 +94,11 @@ properties:
97
94
  type: object
98
95
  properties:
99
96
  type:
100
- enum: [transition, observation, assignment, computation, effect]
97
+ enum: [ transition, observation, assignment, computation, effect ]
101
98
  scope:
102
- enum: [object, objects, changeset, none]
99
+ enum: [ object, objects, changeset, none ]
103
100
  concurrency:
104
- enum: [none, retry]
101
+ enum: [ none, retry ]
105
102
  forward:
106
103
  $ref: 'definitions#/definitions/token'
107
104
  bridge:
@@ -110,16 +107,11 @@ properties:
110
107
  $ref: '#/properties/bindings'
111
108
  input:
112
109
  $ref: 'definitions#/definitions/schema'
113
- not:
114
- properties:
115
- additionalProperties:
116
- const: true
117
- required: [additionalProperties]
118
110
  output:
119
111
  $ref: 'definitions#/definitions/schema'
120
112
  query:
121
113
  type: boolean
122
- required: [type, scope, bindings]
114
+ required: [ type, scope, bindings ]
123
115
  allOf:
124
116
  - if: # transition
125
117
  properties:
@@ -128,15 +120,15 @@ properties:
128
120
  then:
129
121
  properties:
130
122
  scope:
131
- enum: [object]
123
+ enum: [ object ]
132
124
  if: # transition query: false
133
125
  not:
134
126
  properties:
135
127
  query:
136
128
  const: false
137
- required: [query]
129
+ required: [ query ]
138
130
  then:
139
- required: [concurrency]
131
+ required: [ concurrency ]
140
132
  - if: # not transition
141
133
  not:
142
134
  properties:
@@ -153,7 +145,7 @@ properties:
153
145
  then:
154
146
  properties:
155
147
  scope:
156
- enum: [object, objects, none]
148
+ enum: [ object, objects, none ]
157
149
  query:
158
150
  not:
159
151
  const: false
@@ -164,7 +156,7 @@ properties:
164
156
  then:
165
157
  properties:
166
158
  scope:
167
- enum: [changeset]
159
+ enum: [ changeset ]
168
160
  - if: # computation
169
161
  properties:
170
162
  type:
@@ -206,7 +198,7 @@ properties:
206
198
  subjective:
207
199
  type: boolean
208
200
  default: false
209
- required: [bridge, path]
201
+ required: [ bridge, path ]
210
202
  additionalProperties: false
211
203
 
212
204
  receivers:
@@ -231,7 +223,7 @@ properties:
231
223
  adaptive:
232
224
  type: boolean
233
225
  default: false
234
- required: [transition, bridge, path]
226
+ required: [ transition, bridge, path ]
235
227
  additionalProperties: false
236
228
 
237
229
  extensions:
@@ -106,15 +106,6 @@ describe('entity', () => {
106
106
  expect(manifest.entity.schema.type).toBe('object')
107
107
  })
108
108
 
109
- it('should forbid additional properties', () => {
110
- manifest.entity.schema = { additionalProperties: true }
111
- expect(() => validate(manifest)).toThrow(/must be equal to constant 'false'/)
112
-
113
- manifest.entity.schema = {}
114
- validate(manifest)
115
- expect(manifest.entity.schema.additionalProperties).toBe(false)
116
- })
117
-
118
109
  it('should have property names matching token pattern', () => {
119
110
  manifest.entity.schema.properties._foo = { type: 'string' }
120
111
  expect(() => validate(manifest)).toThrow(/pattern/)