@lionweb/validation 0.8.0-beta.7 → 0.8.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/CHANGELOG.md +2 -3
- package/dist/languages/LanguageRegistry.d.ts +1 -1
- package/dist/languages/LanguageRegistry.d.ts.map +1 -1
- package/dist/languages/LanguageRegistry.js +3 -0
- package/dist/languages/LanguageRegistry.js.map +1 -1
- package/dist/languages/LanguageUtils.d.ts.map +1 -1
- package/dist/languages/LanguageUtils.js +2 -4
- package/dist/languages/LanguageUtils.js.map +1 -1
- package/dist/validators/LionWebReferenceValidator.d.ts +3 -1
- package/dist/validators/LionWebReferenceValidator.d.ts.map +1 -1
- package/dist/validators/LionWebReferenceValidator.js +27 -8
- package/dist/validators/LionWebReferenceValidator.js.map +1 -1
- package/dist/validators/definitions/AdminRequestDefinitions.d.ts +3 -0
- package/dist/validators/definitions/AdminRequestDefinitions.d.ts.map +1 -0
- package/dist/validators/definitions/AdminRequestDefinitions.js +155 -0
- package/dist/validators/definitions/AdminRequestDefinitions.js.map +1 -0
- package/dist/validators/definitions/AdminResponseDefinitions.d.ts +3 -0
- package/dist/validators/definitions/AdminResponseDefinitions.d.ts.map +1 -0
- package/dist/validators/definitions/AdminResponseDefinitions.js +169 -0
- package/dist/validators/definitions/AdminResponseDefinitions.js.map +1 -0
- package/dist/validators/definitions/AdminTypesDefinitions.d.ts +3 -0
- package/dist/validators/definitions/AdminTypesDefinitions.d.ts.map +1 -0
- package/dist/validators/definitions/AdminTypesDefinitions.js +33 -0
- package/dist/validators/definitions/AdminTypesDefinitions.js.map +1 -0
- package/dist/validators/definitions/ChunksDefinitions.d.ts +1 -1
- package/dist/validators/definitions/ChunksDefinitions.d.ts.map +1 -1
- package/dist/validators/definitions/CommandDefinitions.d.ts +1 -1
- package/dist/validators/definitions/CommandDefinitions.d.ts.map +1 -1
- package/dist/validators/definitions/CommandDefinitions.js +130 -64
- package/dist/validators/definitions/CommandDefinitions.js.map +1 -1
- package/dist/validators/definitions/DeltaTypesDefinitions.d.ts +1 -1
- package/dist/validators/definitions/DeltaTypesDefinitions.d.ts.map +1 -1
- package/dist/validators/definitions/DeltaTypesDefinitions.js +8 -1
- package/dist/validators/definitions/DeltaTypesDefinitions.js.map +1 -1
- package/dist/validators/definitions/EventDefinitions.d.ts +1 -1
- package/dist/validators/definitions/EventDefinitions.d.ts.map +1 -1
- package/dist/validators/definitions/EventDefinitions.js +324 -244
- package/dist/validators/definitions/EventDefinitions.js.map +1 -1
- package/dist/validators/definitions/RequestDefinitions.d.ts +1 -1
- package/dist/validators/definitions/RequestDefinitions.d.ts.map +1 -1
- package/dist/validators/definitions/RequestDefinitions.js +114 -74
- package/dist/validators/definitions/RequestDefinitions.js.map +1 -1
- package/dist/validators/definitions/ResponseDefinitions.d.ts +1 -1
- package/dist/validators/definitions/ResponseDefinitions.d.ts.map +1 -1
- package/dist/validators/definitions/ResponseDefinitions.js +126 -60
- package/dist/validators/definitions/ResponseDefinitions.js.map +1 -1
- package/dist/validators/definitions/index.d.ts +3 -0
- package/dist/validators/definitions/index.d.ts.map +1 -1
- package/dist/validators/definitions/index.js +3 -0
- package/dist/validators/definitions/index.js.map +1 -1
- package/dist/validators/generic/schema/SyntaxDefinition.d.ts +23 -0
- package/dist/validators/generic/schema/SyntaxDefinition.d.ts.map +1 -1
- package/dist/validators/generic/schema/SyntaxDefinition.js +12 -0
- package/dist/validators/generic/schema/SyntaxDefinition.js.map +1 -1
- package/package.json +6 -6
- package/src/languages/LanguageRegistry.ts +4 -1
- package/src/languages/LanguageUtils.ts +2 -6
- package/src/validators/LionWebReferenceValidator.ts +27 -8
- package/src/validators/definitions/AdminRequestDefinitions.ts +156 -0
- package/src/validators/definitions/AdminResponseDefinitions.ts +170 -0
- package/src/validators/definitions/AdminTypesDefinitions.ts +34 -0
- package/src/validators/definitions/ChunksDefinitions.ts +1 -1
- package/src/validators/definitions/CommandDefinitions.ts +131 -65
- package/src/validators/definitions/DeltaTypesDefinitions.ts +9 -2
- package/src/validators/definitions/EventDefinitions.ts +325 -245
- package/src/validators/definitions/RequestDefinitions.ts +115 -75
- package/src/validators/definitions/ResponseDefinitions.ts +127 -61
- package/src/validators/definitions/index.ts +3 -0
- package/src/validators/generic/schema/SyntaxDefinition.ts +24 -1
|
@@ -3,23 +3,23 @@ export const ResponseDefinitions = {
|
|
|
3
3
|
taggedUnionProperty: "messageKind",
|
|
4
4
|
sharedProperties: [
|
|
5
5
|
{
|
|
6
|
-
name: "
|
|
7
|
-
type: "
|
|
6
|
+
name: "queryId",
|
|
7
|
+
type: "QueryId",
|
|
8
8
|
isList: false,
|
|
9
9
|
isOptional: false,
|
|
10
10
|
mayBeNull: false,
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
name: "
|
|
14
|
-
type: "
|
|
15
|
-
isList:
|
|
13
|
+
name: "messageKind",
|
|
14
|
+
type: "String",
|
|
15
|
+
isList: false,
|
|
16
16
|
isOptional: false,
|
|
17
17
|
mayBeNull: false,
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
name: "
|
|
21
|
-
type: "
|
|
22
|
-
isList:
|
|
20
|
+
name: "additionalInfos",
|
|
21
|
+
type: "AdditionalInfo",
|
|
22
|
+
isList: true,
|
|
23
23
|
isOptional: false,
|
|
24
24
|
mayBeNull: false,
|
|
25
25
|
},
|
|
@@ -28,6 +28,13 @@ export const ResponseDefinitions = {
|
|
|
28
28
|
{
|
|
29
29
|
name: "SubscribeToChangingPartitionsResponse",
|
|
30
30
|
properties: [
|
|
31
|
+
{
|
|
32
|
+
name: "queryId",
|
|
33
|
+
type: "QueryId",
|
|
34
|
+
isList: false,
|
|
35
|
+
isOptional: false,
|
|
36
|
+
mayBeNull: false,
|
|
37
|
+
},
|
|
31
38
|
{
|
|
32
39
|
name: "messageKind",
|
|
33
40
|
type: "String",
|
|
@@ -36,12 +43,17 @@ export const ResponseDefinitions = {
|
|
|
36
43
|
mayBeNull: false,
|
|
37
44
|
},
|
|
38
45
|
{
|
|
39
|
-
name: "
|
|
40
|
-
type: "
|
|
46
|
+
name: "additionalInfos",
|
|
47
|
+
type: "AdditionalInfo",
|
|
41
48
|
isList: true,
|
|
42
49
|
isOptional: false,
|
|
43
50
|
mayBeNull: false,
|
|
44
51
|
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "InformAboutChangingPartitionsResponse",
|
|
56
|
+
properties: [
|
|
45
57
|
{
|
|
46
58
|
name: "queryId",
|
|
47
59
|
type: "QueryId",
|
|
@@ -49,6 +61,20 @@ export const ResponseDefinitions = {
|
|
|
49
61
|
isOptional: false,
|
|
50
62
|
mayBeNull: false,
|
|
51
63
|
},
|
|
64
|
+
{
|
|
65
|
+
name: "messageKind",
|
|
66
|
+
type: "String",
|
|
67
|
+
isList: false,
|
|
68
|
+
isOptional: false,
|
|
69
|
+
mayBeNull: false,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "additionalInfos",
|
|
73
|
+
type: "AdditionalInfo",
|
|
74
|
+
isList: true,
|
|
75
|
+
isOptional: false,
|
|
76
|
+
mayBeNull: false,
|
|
77
|
+
},
|
|
52
78
|
],
|
|
53
79
|
},
|
|
54
80
|
{
|
|
@@ -62,23 +88,23 @@ export const ResponseDefinitions = {
|
|
|
62
88
|
mayBeNull: false,
|
|
63
89
|
},
|
|
64
90
|
{
|
|
65
|
-
name: "
|
|
66
|
-
type: "
|
|
91
|
+
name: "queryId",
|
|
92
|
+
type: "QueryId",
|
|
67
93
|
isList: false,
|
|
68
94
|
isOptional: false,
|
|
69
95
|
mayBeNull: false,
|
|
70
96
|
},
|
|
71
97
|
{
|
|
72
|
-
name: "
|
|
73
|
-
type: "
|
|
74
|
-
isList:
|
|
98
|
+
name: "messageKind",
|
|
99
|
+
type: "String",
|
|
100
|
+
isList: false,
|
|
75
101
|
isOptional: false,
|
|
76
102
|
mayBeNull: false,
|
|
77
103
|
},
|
|
78
104
|
{
|
|
79
|
-
name: "
|
|
80
|
-
type: "
|
|
81
|
-
isList:
|
|
105
|
+
name: "additionalInfos",
|
|
106
|
+
type: "AdditionalInfo",
|
|
107
|
+
isList: true,
|
|
82
108
|
isOptional: false,
|
|
83
109
|
mayBeNull: false,
|
|
84
110
|
},
|
|
@@ -88,23 +114,23 @@ export const ResponseDefinitions = {
|
|
|
88
114
|
name: "UnsubscribeFromPartitionContentsResponse",
|
|
89
115
|
properties: [
|
|
90
116
|
{
|
|
91
|
-
name: "
|
|
92
|
-
type: "
|
|
117
|
+
name: "queryId",
|
|
118
|
+
type: "QueryId",
|
|
93
119
|
isList: false,
|
|
94
120
|
isOptional: false,
|
|
95
121
|
mayBeNull: false,
|
|
96
122
|
},
|
|
97
123
|
{
|
|
98
|
-
name: "
|
|
99
|
-
type: "
|
|
100
|
-
isList:
|
|
124
|
+
name: "messageKind",
|
|
125
|
+
type: "String",
|
|
126
|
+
isList: false,
|
|
101
127
|
isOptional: false,
|
|
102
128
|
mayBeNull: false,
|
|
103
129
|
},
|
|
104
130
|
{
|
|
105
|
-
name: "
|
|
106
|
-
type: "
|
|
107
|
-
isList:
|
|
131
|
+
name: "additionalInfos",
|
|
132
|
+
type: "AdditionalInfo",
|
|
133
|
+
isList: true,
|
|
108
134
|
isOptional: false,
|
|
109
135
|
mayBeNull: false,
|
|
110
136
|
},
|
|
@@ -121,23 +147,23 @@ export const ResponseDefinitions = {
|
|
|
121
147
|
mayBeNull: false,
|
|
122
148
|
},
|
|
123
149
|
{
|
|
124
|
-
name: "
|
|
125
|
-
type: "
|
|
150
|
+
name: "queryId",
|
|
151
|
+
type: "QueryId",
|
|
126
152
|
isList: false,
|
|
127
153
|
isOptional: false,
|
|
128
154
|
mayBeNull: false,
|
|
129
155
|
},
|
|
130
156
|
{
|
|
131
|
-
name: "
|
|
132
|
-
type: "
|
|
133
|
-
isList:
|
|
157
|
+
name: "messageKind",
|
|
158
|
+
type: "String",
|
|
159
|
+
isList: false,
|
|
134
160
|
isOptional: false,
|
|
135
161
|
mayBeNull: false,
|
|
136
162
|
},
|
|
137
163
|
{
|
|
138
|
-
name: "
|
|
139
|
-
type: "
|
|
140
|
-
isList:
|
|
164
|
+
name: "additionalInfos",
|
|
165
|
+
type: "AdditionalInfo",
|
|
166
|
+
isList: true,
|
|
141
167
|
isOptional: false,
|
|
142
168
|
mayBeNull: false,
|
|
143
169
|
},
|
|
@@ -147,23 +173,23 @@ export const ResponseDefinitions = {
|
|
|
147
173
|
name: "SignOffResponse",
|
|
148
174
|
properties: [
|
|
149
175
|
{
|
|
150
|
-
name: "
|
|
151
|
-
type: "
|
|
176
|
+
name: "queryId",
|
|
177
|
+
type: "QueryId",
|
|
152
178
|
isList: false,
|
|
153
179
|
isOptional: false,
|
|
154
180
|
mayBeNull: false,
|
|
155
181
|
},
|
|
156
182
|
{
|
|
157
|
-
name: "
|
|
158
|
-
type: "
|
|
159
|
-
isList:
|
|
183
|
+
name: "messageKind",
|
|
184
|
+
type: "String",
|
|
185
|
+
isList: false,
|
|
160
186
|
isOptional: false,
|
|
161
187
|
mayBeNull: false,
|
|
162
188
|
},
|
|
163
189
|
{
|
|
164
|
-
name: "
|
|
165
|
-
type: "
|
|
166
|
-
isList:
|
|
190
|
+
name: "additionalInfos",
|
|
191
|
+
type: "AdditionalInfo",
|
|
192
|
+
isList: true,
|
|
167
193
|
isOptional: false,
|
|
168
194
|
mayBeNull: false,
|
|
169
195
|
},
|
|
@@ -180,23 +206,23 @@ export const ResponseDefinitions = {
|
|
|
180
206
|
mayBeNull: false,
|
|
181
207
|
},
|
|
182
208
|
{
|
|
183
|
-
name: "
|
|
184
|
-
type: "
|
|
209
|
+
name: "queryId",
|
|
210
|
+
type: "QueryId",
|
|
185
211
|
isList: false,
|
|
186
212
|
isOptional: false,
|
|
187
213
|
mayBeNull: false,
|
|
188
214
|
},
|
|
189
215
|
{
|
|
190
|
-
name: "
|
|
191
|
-
type: "
|
|
192
|
-
isList:
|
|
216
|
+
name: "messageKind",
|
|
217
|
+
type: "String",
|
|
218
|
+
isList: false,
|
|
193
219
|
isOptional: false,
|
|
194
220
|
mayBeNull: false,
|
|
195
221
|
},
|
|
196
222
|
{
|
|
197
|
-
name: "
|
|
198
|
-
type: "
|
|
199
|
-
isList:
|
|
223
|
+
name: "additionalInfos",
|
|
224
|
+
type: "AdditionalInfo",
|
|
225
|
+
isList: true,
|
|
200
226
|
isOptional: false,
|
|
201
227
|
mayBeNull: false,
|
|
202
228
|
},
|
|
@@ -213,23 +239,23 @@ export const ResponseDefinitions = {
|
|
|
213
239
|
mayBeNull: false,
|
|
214
240
|
},
|
|
215
241
|
{
|
|
216
|
-
name: "
|
|
217
|
-
type: "
|
|
242
|
+
name: "queryId",
|
|
243
|
+
type: "QueryId",
|
|
218
244
|
isList: false,
|
|
219
245
|
isOptional: false,
|
|
220
246
|
mayBeNull: false,
|
|
221
247
|
},
|
|
222
248
|
{
|
|
223
|
-
name: "
|
|
224
|
-
type: "
|
|
225
|
-
isList:
|
|
249
|
+
name: "messageKind",
|
|
250
|
+
type: "String",
|
|
251
|
+
isList: false,
|
|
226
252
|
isOptional: false,
|
|
227
253
|
mayBeNull: false,
|
|
228
254
|
},
|
|
229
255
|
{
|
|
230
|
-
name: "
|
|
231
|
-
type: "
|
|
232
|
-
isList:
|
|
256
|
+
name: "additionalInfos",
|
|
257
|
+
type: "AdditionalInfo",
|
|
258
|
+
isList: true,
|
|
233
259
|
isOptional: false,
|
|
234
260
|
mayBeNull: false,
|
|
235
261
|
},
|
|
@@ -245,6 +271,13 @@ export const ResponseDefinitions = {
|
|
|
245
271
|
isOptional: false,
|
|
246
272
|
mayBeNull: false,
|
|
247
273
|
},
|
|
274
|
+
{
|
|
275
|
+
name: "queryId",
|
|
276
|
+
type: "QueryId",
|
|
277
|
+
isList: false,
|
|
278
|
+
isOptional: false,
|
|
279
|
+
mayBeNull: false,
|
|
280
|
+
},
|
|
248
281
|
{
|
|
249
282
|
name: "messageKind",
|
|
250
283
|
type: "String",
|
|
@@ -253,12 +286,31 @@ export const ResponseDefinitions = {
|
|
|
253
286
|
mayBeNull: false,
|
|
254
287
|
},
|
|
255
288
|
{
|
|
256
|
-
name: "
|
|
257
|
-
type: "
|
|
289
|
+
name: "additionalInfos",
|
|
290
|
+
type: "AdditionalInfo",
|
|
258
291
|
isList: true,
|
|
259
292
|
isOptional: false,
|
|
260
293
|
mayBeNull: false,
|
|
261
294
|
},
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "ErrorResponse",
|
|
299
|
+
properties: [
|
|
300
|
+
{
|
|
301
|
+
name: "errorCode",
|
|
302
|
+
type: "String",
|
|
303
|
+
isList: false,
|
|
304
|
+
isOptional: false,
|
|
305
|
+
mayBeNull: false,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "message",
|
|
309
|
+
type: "String",
|
|
310
|
+
isList: false,
|
|
311
|
+
isOptional: false,
|
|
312
|
+
mayBeNull: false,
|
|
313
|
+
},
|
|
262
314
|
{
|
|
263
315
|
name: "queryId",
|
|
264
316
|
type: "QueryId",
|
|
@@ -266,6 +318,20 @@ export const ResponseDefinitions = {
|
|
|
266
318
|
isOptional: false,
|
|
267
319
|
mayBeNull: false,
|
|
268
320
|
},
|
|
321
|
+
{
|
|
322
|
+
name: "messageKind",
|
|
323
|
+
type: "String",
|
|
324
|
+
isList: false,
|
|
325
|
+
isOptional: false,
|
|
326
|
+
mayBeNull: false,
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: "additionalInfos",
|
|
330
|
+
type: "AdditionalInfo",
|
|
331
|
+
isList: true,
|
|
332
|
+
isOptional: false,
|
|
333
|
+
mayBeNull: false,
|
|
334
|
+
},
|
|
269
335
|
],
|
|
270
336
|
},
|
|
271
337
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseDefinitions.js","sourceRoot":"","sources":["../../../src/validators/definitions/ResponseDefinitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC7C,IAAI,EAAE,UAAU;IAChB,mBAAmB,EAAE,aAAa;IAClC,gBAAgB,EAAE;QACd;YACI,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"ResponseDefinitions.js","sourceRoot":"","sources":["../../../src/validators/definitions/ResponseDefinitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC7C,IAAI,EAAE,UAAU;IAChB,mBAAmB,EAAE,aAAa;IAClC,gBAAgB,EAAE;QACd;YACI,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,KAAK;SACnB;QACD;YACI,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,KAAK;SACnB;QACD;YACI,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,KAAK;SACnB;KACJ;IACD,QAAQ,EAAE;QACN;YACI,IAAI,EAAE,uCAAuC;YAC7C,UAAU,EAAE;gBACR;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,KAAK;oBACb,UAAU,EAAE,KAAK;oBACjB,SAAS,EAAE,KAAK;iBACnB;gBACD;oBACI,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,KAAK;oBACb,UAAU,EAAE,KAAK;oBACjB,SAAS,EAAE,KAAK;iBACnB;gBACD;oBACI,IAAI,EAAE,iBAAiB;oBACvB,IAAI,EAAE,gBAAgB;oBACtB,MAAM,EAAE,IAAI;oBACZ,UAAU,EAAE,KAAK;oBACjB,SAAS,EAAE,KAAK;iBACnB;aACJ;SACJ;QACD;YAC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jB,SAAS,EAAE,KAAK;iBACnB;gBACD;oBACI,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,KAAK;oBACb,UAAU,EAAE,KAAK;oBACjB,SAAS,EAAE,KAAK;iBACnB;gBACD;oBACI,IAAI,EAAE,iBAAiB;oBACvB,IAAI,EAAE,gBAAgB;oBACtB,MAAM,EAAE,IAAI;oBACZ,UAAU,EAAE,KAAK;oBACjB,SAAS,EAAE,KAAK;iBACnB;aACJ;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -5,4 +5,7 @@ export * from "./EventDefinitions.js";
|
|
|
5
5
|
export * from "./QueryDefinitions.js";
|
|
6
6
|
export * from "./RequestDefinitions.js";
|
|
7
7
|
export * from "./ResponseDefinitions.js";
|
|
8
|
+
export * from "./AdminRequestDefinitions.js";
|
|
9
|
+
export * from "./AdminResponseDefinitions.js";
|
|
10
|
+
export * from "./AdminTypesDefinitions.js";
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validators/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validators/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA"}
|
|
@@ -5,4 +5,7 @@ export * from "./EventDefinitions.js";
|
|
|
5
5
|
export * from "./QueryDefinitions.js";
|
|
6
6
|
export * from "./RequestDefinitions.js";
|
|
7
7
|
export * from "./ResponseDefinitions.js";
|
|
8
|
+
export * from "./AdminRequestDefinitions.js";
|
|
9
|
+
export * from "./AdminResponseDefinitions.js";
|
|
10
|
+
export * from "./AdminTypesDefinitions.js";
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validators/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validators/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA"}
|
|
@@ -3,7 +3,14 @@ import { ValidationResult } from "../ValidationResult.js";
|
|
|
3
3
|
export type UnknownObjectType = {
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Type representing a function that validates a primitive value.
|
|
8
|
+
*/
|
|
6
9
|
export type PrimitiveValidatorFunction = <T>(obj: T, result: ValidationResult, ctx: JsonContext) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Represents a group of message beloning to the same group.
|
|
12
|
+
* Used for representing message groups in the delta protocol.
|
|
13
|
+
*/
|
|
7
14
|
export type MessageGroup = {
|
|
8
15
|
name: string;
|
|
9
16
|
taggedUnionProperty: string;
|
|
@@ -21,6 +28,10 @@ export type StructuredType = {
|
|
|
21
28
|
name: string;
|
|
22
29
|
properties: PropertyDefinition[];
|
|
23
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Represents a group of type definitions.
|
|
33
|
+
* Used for both the bulk and the delta protocol.
|
|
34
|
+
*/
|
|
24
35
|
export type TypeGroup = {
|
|
25
36
|
name: string;
|
|
26
37
|
primitiveTypes: PrimitiveType[];
|
|
@@ -30,12 +41,24 @@ export type PrimitiveType = {
|
|
|
30
41
|
name: string;
|
|
31
42
|
primitiveType: string;
|
|
32
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* A `SyntaxDefinition` represents a collection of message- or type-groups that should be validated
|
|
46
|
+
* as a whole.
|
|
47
|
+
*/
|
|
33
48
|
export declare class SyntaxDefinition {
|
|
34
49
|
allPrimitiveTypes: Map<string, PrimitiveType>;
|
|
35
50
|
allStructuredTypes: Map<string, StructuredType>;
|
|
36
51
|
allMessageGroups: Map<string, MessageGroup>;
|
|
52
|
+
/**
|
|
53
|
+
* Map from a primitive type-name to the function used to validate values of that type.
|
|
54
|
+
*/
|
|
37
55
|
validateFunctions: Map<string, PrimitiveValidatorFunction>;
|
|
38
56
|
constructor(messageGroups: MessageGroup[], typeGroups: TypeGroup[]);
|
|
57
|
+
/**
|
|
58
|
+
* Add `validate` as the function to validate values of type `primitiveTypeName`.
|
|
59
|
+
* @param primitiveTypeName The type to be validated.
|
|
60
|
+
* @param validate The function performing the validation.
|
|
61
|
+
*/
|
|
39
62
|
addValidator(primitiveTypeName: string, validate: PrimitiveValidatorFunction): void;
|
|
40
63
|
getValidator(primitiveTypeName: string): PrimitiveValidatorFunction | undefined;
|
|
41
64
|
getPrimitiveType(name: string): PrimitiveType | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntaxDefinition.d.ts","sourceRoot":"","sources":["../../../../src/validators/generic/schema/SyntaxDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAA;AAE1D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,WAAW,KAAK,IAAI,CAAA;AAExG,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;IACvC,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC9B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,kBAAkB,EAAE,CAAC;CACpC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,eAAe,EAAG,cAAc,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"SyntaxDefinition.d.ts","sourceRoot":"","sources":["../../../../src/validators/generic/schema/SyntaxDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM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nF,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAkC;IAE7E;;OAEG;IACH,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAgD;gBAE9F,aAAa,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;IAiBlE;;;;OAIG;IACH,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,GAAG,IAAI;IAInF,YAAY,CAAC,iBAAiB,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;IAI/E,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIzD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI3D,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;CAG1D"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `SyntaxDefinition` represents a collection of message- or type-groups that should be validated
|
|
3
|
+
* as a whole.
|
|
4
|
+
*/
|
|
1
5
|
export class SyntaxDefinition {
|
|
2
6
|
constructor(messageGroups, typeGroups) {
|
|
3
7
|
// Maps to make searching easier and faster
|
|
4
8
|
this.allPrimitiveTypes = new Map();
|
|
5
9
|
this.allStructuredTypes = new Map();
|
|
6
10
|
this.allMessageGroups = new Map();
|
|
11
|
+
/**
|
|
12
|
+
* Map from a primitive type-name to the function used to validate values of that type.
|
|
13
|
+
*/
|
|
7
14
|
this.validateFunctions = new Map();
|
|
8
15
|
typeGroups.forEach(typeGroup => {
|
|
9
16
|
typeGroup.primitiveTypes.forEach(primitiveType => {
|
|
@@ -20,6 +27,11 @@ export class SyntaxDefinition {
|
|
|
20
27
|
});
|
|
21
28
|
});
|
|
22
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Add `validate` as the function to validate values of type `primitiveTypeName`.
|
|
32
|
+
* @param primitiveTypeName The type to be validated.
|
|
33
|
+
* @param validate The function performing the validation.
|
|
34
|
+
*/
|
|
23
35
|
addValidator(primitiveTypeName, validate) {
|
|
24
36
|
this.validateFunctions.set(primitiveTypeName, validate);
|
|
25
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntaxDefinition.js","sourceRoot":"","sources":["../../../../src/validators/generic/schema/SyntaxDefinition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SyntaxDefinition.js","sourceRoot":"","sources":["../../../../src/validators/generic/schema/SyntaxDefinition.ts"],"names":[],"mappings":"AAiDA;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAWzB,YAAY,aAA6B,EAAE,UAAuB;QAVlE,2CAA2C;QAC3C,sBAAiB,GAA+B,IAAI,GAAG,EAAyB,CAAA;QAChF,uBAAkB,GAAgC,IAAI,GAAG,EAA0B,CAAA;QACnF,qBAAgB,GAA8B,IAAI,GAAG,EAAwB,CAAA;QAE7E;;WAEG;QACH,sBAAiB,GAA4C,IAAI,GAAG,EAAsC,CAAA;QAGtG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YAC3B,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;gBAC7C,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;YACjE,CAAC,CAAC,CAAA;YACF,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;gBAC3C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;YAC5D,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;QACF,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACjC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;YAC1D,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAChC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;YAC9C,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACN,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,iBAAyB,EAAE,QAAoC;QACxE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;IAC3D,CAAC;IAED,YAAY,CAAC,iBAAyB;QAClC,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACxD,CAAC;IAED,gBAAgB,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC3C,CAAC;IAED,iBAAiB,CAAC,IAAY;QAC1B,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAED,eAAe,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC1C,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lionweb/validation",
|
|
3
|
-
"version": "0.8.0
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"license": "Apache 2.0",
|
|
5
5
|
"description": "LionWeb Serialization validation",
|
|
6
6
|
"author": "jos.warmer@openmodeling.nl",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"testInvalid": "node dist/runners/RunCheckFolder.js ../test/testset/invalid",
|
|
32
32
|
"testInvalidWithLanguage": "node dist/runners/RunCheckFolderWithLanguage.js ../test/testset/withLanguage/invalid/ ../test/testset/withLanguage/myLang.language.json",
|
|
33
33
|
"testValidWithLanguage": "node dist/runners/RunCheckFolderWithLanguage.js ../test/testset/withLanguage/valid/ ../test/testset/withLanguage/myLang.language.json",
|
|
34
|
-
"publish-local": "npm publish --registry http://localhost:4873",
|
|
34
|
+
"publish-local": "npm publish --registry http://localhost:4873 --tag local",
|
|
35
35
|
"unpublish-local": "npm unpublish --force --registry http://localhost:4873",
|
|
36
|
-
"republish-local": "
|
|
36
|
+
"republish-local": "npm unpublish-local && npm publish-local"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lionweb/json": "0.8.0
|
|
40
|
-
"@lionweb/ts-utils": "0.8.0
|
|
41
|
-
"@lionweb/json-utils": "0.8.0
|
|
39
|
+
"@lionweb/json": "0.8.0",
|
|
40
|
+
"@lionweb/ts-utils": "0.8.0",
|
|
41
|
+
"@lionweb/json-utils": "0.8.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -30,7 +30,10 @@ export class LanguageRegistry {
|
|
|
30
30
|
return this.languages.getNodeByMetaPointer(metaPointer)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
findNode(nodeId: LionWebId) {
|
|
33
|
+
findNode(nodeId: LionWebId | undefined | null) {
|
|
34
|
+
if (nodeId === undefined || nodeId === null ) {
|
|
35
|
+
return undefined
|
|
36
|
+
}
|
|
34
37
|
for (const chunk of this.languages.languages) {
|
|
35
38
|
const node = chunk.getNode(nodeId)
|
|
36
39
|
if (node !== undefined) {
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { isEqualMetaPointer, LionWebJsonChunk, LionWebJsonNode } from "@lionweb/json"
|
|
2
2
|
import { LION_CORE_M3_KEY, MetaPointers } from "@lionweb/json-utils"
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const require = createRequire(import.meta.url)
|
|
7
|
-
const LionCore_M3 = require("./LionCore-M3.json")
|
|
8
|
-
const LionCore_builtins = require("./LionCore-builtins.json")
|
|
3
|
+
import LionCore_M3 from "./LionCore-M3.json" with { type: "json" }
|
|
4
|
+
import LionCore_builtins from "./LionCore-builtins.json" with { type: "json" }
|
|
9
5
|
|
|
10
6
|
export const LionCore_M3_Json = LionCore_M3 as LionWebJsonChunk
|
|
11
7
|
export const LionCore_builtins_Json = LionCore_builtins as LionWebJsonChunk
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LionWebId, LionWebJsonChunk, LionWebJsonContainment, LionWebJsonMetaPointer, LionWebJsonNode, LionWebJsonUsedLanguage } from "@lionweb/json"
|
|
2
2
|
import { ChunkUtils, JsonContext, LionWebJsonChunkWrapper } from "@lionweb/json-utils"
|
|
3
|
+
import { GenericIssue } from "../issues/index.js"
|
|
3
4
|
import {
|
|
4
5
|
Duplicates_Issue,
|
|
5
6
|
Reference_ChildMissingInParent_Issue,
|
|
@@ -15,6 +16,7 @@ import { ValidationResult } from "./generic/ValidationResult.js"
|
|
|
15
16
|
* as far as they do not need the used language definition.
|
|
16
17
|
*/
|
|
17
18
|
export class LionWebReferenceValidator {
|
|
19
|
+
mustBeProperTree: boolean = false
|
|
18
20
|
validationResult: ValidationResult
|
|
19
21
|
nodesIdMap: Map<string, LionWebJsonNode> = new Map<string, LionWebJsonNode>()
|
|
20
22
|
|
|
@@ -38,25 +40,28 @@ export class LionWebReferenceValidator {
|
|
|
38
40
|
})
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
validate(
|
|
43
|
+
validate(chunkWrapper: LionWebJsonChunkWrapper): void {
|
|
42
44
|
const rootCtx = new JsonContext(null, ["$"])
|
|
43
|
-
this.checkDuplicateUsedLanguage(
|
|
44
|
-
this.validateNodeIds(
|
|
45
|
-
|
|
45
|
+
this.checkDuplicateUsedLanguage(chunkWrapper.jsonChunk.languages, rootCtx)
|
|
46
|
+
this.validateNodeIds(chunkWrapper.jsonChunk, rootCtx)
|
|
47
|
+
chunkWrapper.jsonChunk.nodes.forEach((node, nodeIndex) => {
|
|
46
48
|
const context = rootCtx.concat(`node`, nodeIndex)
|
|
47
49
|
const parentNode = node.parent
|
|
48
50
|
if (parentNode !== null) {
|
|
49
51
|
this.validateExistsAsChild(context, this.nodesIdMap.get(parentNode), node)
|
|
50
52
|
}
|
|
51
|
-
this.validateLanguageReference(
|
|
53
|
+
this.validateLanguageReference(chunkWrapper, node.classifier, context)
|
|
52
54
|
this.checkParentCircular(node, context)
|
|
53
55
|
this.checkDuplicate(node.annotations, rootCtx.concat("node", nodeIndex, "annotations"))
|
|
54
56
|
this.validateChildrenHaveCorrectParent(node, rootCtx.concat("node", nodeIndex))
|
|
57
|
+
if (this.mustBeProperTree) {
|
|
58
|
+
this.validateProperTree(context, chunkWrapper)
|
|
59
|
+
}
|
|
55
60
|
node.properties.forEach((prop, propertyIndex) => {
|
|
56
|
-
this.validateLanguageReference(
|
|
61
|
+
this.validateLanguageReference(chunkWrapper, prop.property, rootCtx.concat("node", nodeIndex, "property", propertyIndex))
|
|
57
62
|
})
|
|
58
63
|
node.containments.forEach((containment, childIndex) => {
|
|
59
|
-
this.validateLanguageReference(
|
|
64
|
+
this.validateLanguageReference(chunkWrapper, containment.containment, rootCtx.concat("node", nodeIndex, "containments", childIndex))
|
|
60
65
|
this.checkDuplicate(containment.children, rootCtx.concat("node", nodeIndex, "containments", childIndex))
|
|
61
66
|
containment.children.forEach(childId => {
|
|
62
67
|
const childNode = this.nodesIdMap.get(childId)
|
|
@@ -68,6 +73,8 @@ export class LionWebReferenceValidator {
|
|
|
68
73
|
if (childNode.parent === null || childNode.parent === undefined) {
|
|
69
74
|
// TODO this.validationResult.error(`Child "${childId}" of node "${node.id}" has different parent "${childNode.parent}"`);
|
|
70
75
|
}
|
|
76
|
+
} else if (this.mustBeProperTree) {
|
|
77
|
+
this.validationResult.issue(new GenericIssue(context, `child '${childId}' of ${node.id} is missing.`))
|
|
71
78
|
}
|
|
72
79
|
})
|
|
73
80
|
})
|
|
@@ -84,13 +91,25 @@ export class LionWebReferenceValidator {
|
|
|
84
91
|
}
|
|
85
92
|
})
|
|
86
93
|
node.references.forEach((ref, refIndex) => {
|
|
87
|
-
this.validateLanguageReference(
|
|
94
|
+
this.validateLanguageReference(chunkWrapper, ref.reference, rootCtx.concat("node", nodeIndex, "references", refIndex))
|
|
88
95
|
// TODO Check for duplicate targets?
|
|
89
96
|
// If so, what to check because there can be either or both a `resolveInfo` and a `reference`
|
|
90
97
|
})
|
|
91
98
|
})
|
|
92
99
|
}
|
|
93
100
|
|
|
101
|
+
validateProperTree(context: JsonContext, chunk: LionWebJsonChunkWrapper): void {
|
|
102
|
+
const nodesWithoutParentInChunk: LionWebJsonNode[] = []
|
|
103
|
+
chunk.jsonChunk.nodes.forEach(node => {
|
|
104
|
+
if (node.parent === null || chunk.getNode(node.parent) === undefined) {
|
|
105
|
+
nodesWithoutParentInChunk.push(node)
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
if (nodesWithoutParentInChunk.length > 1) {
|
|
109
|
+
this.validationResult.issue(new GenericIssue(context,
|
|
110
|
+
`Chunk not a proper subtree, there are multiple nodes (${nodesWithoutParentInChunk.map(n => n.id)} without parent in the chunk`))
|
|
111
|
+
}
|
|
112
|
+
}
|
|
94
113
|
/**
|
|
95
114
|
* Check whether the metapointer refers to a language defined in the usedLanguages of chunk.
|
|
96
115
|
* @param chunk
|