cruddl 3.0.2 → 3.0.3
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/SECURITY.md +15 -0
- package/dist/spec/dev/start.js +0 -2
- package/dist/spec/dev/start.js.map +1 -1
- package/dist/src/database/arangodb/aql-generator.js +64 -16
- package/dist/src/database/arangodb/aql-generator.js.map +1 -1
- package/dist/src/database/arangodb/aql.d.ts +3 -3
- package/dist/src/database/arangodb/aql.js.map +1 -1
- package/dist/src/database/arangodb/arangodb-adapter.js +2 -2
- package/dist/src/database/arangodb/arangodb-adapter.js.map +1 -1
- package/dist/src/schema/preparation/source-validation-modules/schema/schema.json +13 -2
- package/dist/src/schema/preparation/source-validation-modules/schema/validate-schema.d.ts +2 -2
- package/dist/src/schema/preparation/source-validation-modules/schema/validate-schema.js +1 -2707
- package/dist/src/schema/preparation/source-validation-modules/sidecar-schema.js +4 -4
- package/dist/src/schema/preparation/source-validation-modules/sidecar-schema.js.map +1 -1
- package/example/index.ts +2 -3
- package/example/package.json +4 -4
- package/package.json +2 -2
|
@@ -1,2707 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var ucs2length = require('ajv/lib/compile/ucs2length');
|
|
3
|
-
var equal = require('ajv/lib/compile/equal');
|
|
4
|
-
var validate = (function () {
|
|
5
|
-
var pattern0 = new RegExp('^[a-zA-Z0-9]+$');
|
|
6
|
-
var pattern1 = new RegExp('.+');
|
|
7
|
-
var pattern2 = new RegExp('^[a-zA-Z0-9_-]+$');
|
|
8
|
-
var pattern3 = new RegExp('^[a-zA-Z0-9_]+$');
|
|
9
|
-
var pattern4 = new RegExp('^([a-zA-Z0-9_-]|\\.)+$');
|
|
10
|
-
var refVal = [];
|
|
11
|
-
var refVal1 = (function () {
|
|
12
|
-
var pattern0 = new RegExp('^[a-zA-Z0-9]+$');
|
|
13
|
-
var pattern1 = new RegExp('.+');
|
|
14
|
-
var pattern2 = new RegExp('^[a-zA-Z0-9_-]+$');
|
|
15
|
-
var pattern3 = new RegExp('^[a-zA-Z0-9_]+$');
|
|
16
|
-
var pattern4 = new RegExp('^([a-zA-Z0-9_-]|\\.)+$');
|
|
17
|
-
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
|
18
|
-
'use strict';
|
|
19
|
-
var vErrors = null;
|
|
20
|
-
var errors = 0;
|
|
21
|
-
if (rootData === undefined) rootData = data;
|
|
22
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
23
|
-
var errs__0 = errors;
|
|
24
|
-
var valid1 = true;
|
|
25
|
-
for (var key0 in data) {
|
|
26
|
-
var isAdditional0 = !(false || key0 == 'permissions');
|
|
27
|
-
if (isAdditional0) {
|
|
28
|
-
valid1 = false;
|
|
29
|
-
var err = {
|
|
30
|
-
keyword: 'additionalProperties',
|
|
31
|
-
dataPath: (dataPath || '') + '',
|
|
32
|
-
schemaPath: '#/additionalProperties',
|
|
33
|
-
params: {
|
|
34
|
-
additionalProperty: '' + key0 + '',
|
|
35
|
-
},
|
|
36
|
-
message: 'should NOT have additional properties',
|
|
37
|
-
};
|
|
38
|
-
if (vErrors === null) vErrors = [err];
|
|
39
|
-
else vErrors.push(err);
|
|
40
|
-
errors++;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
var data1 = data.permissions;
|
|
44
|
-
if (data1 !== undefined) {
|
|
45
|
-
var errs_1 = errors;
|
|
46
|
-
if (Array.isArray(data1)) {
|
|
47
|
-
var errs__1 = errors;
|
|
48
|
-
var valid1;
|
|
49
|
-
for (var i1 = 0; i1 < data1.length; i1++) {
|
|
50
|
-
var errs_2 = errors;
|
|
51
|
-
if (
|
|
52
|
-
!refVal2(
|
|
53
|
-
data1[i1],
|
|
54
|
-
(dataPath || '') + '.permissions[' + i1 + ']',
|
|
55
|
-
data1,
|
|
56
|
-
i1,
|
|
57
|
-
rootData,
|
|
58
|
-
)
|
|
59
|
-
) {
|
|
60
|
-
if (vErrors === null) vErrors = refVal2.errors;
|
|
61
|
-
else vErrors = vErrors.concat(refVal2.errors);
|
|
62
|
-
errors = vErrors.length;
|
|
63
|
-
}
|
|
64
|
-
var valid2 = errors === errs_2;
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
var err = {
|
|
68
|
-
keyword: 'type',
|
|
69
|
-
dataPath: (dataPath || '') + '.permissions',
|
|
70
|
-
schemaPath: '#/properties/permissions/type',
|
|
71
|
-
params: {
|
|
72
|
-
type: 'array',
|
|
73
|
-
},
|
|
74
|
-
message: 'should be array',
|
|
75
|
-
};
|
|
76
|
-
if (vErrors === null) vErrors = [err];
|
|
77
|
-
else vErrors.push(err);
|
|
78
|
-
errors++;
|
|
79
|
-
}
|
|
80
|
-
var valid1 = errors === errs_1;
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
var err = {
|
|
84
|
-
keyword: 'type',
|
|
85
|
-
dataPath: (dataPath || '') + '',
|
|
86
|
-
schemaPath: '#/type',
|
|
87
|
-
params: {
|
|
88
|
-
type: 'object',
|
|
89
|
-
},
|
|
90
|
-
message: 'should be object',
|
|
91
|
-
};
|
|
92
|
-
if (vErrors === null) vErrors = [err];
|
|
93
|
-
else vErrors.push(err);
|
|
94
|
-
errors++;
|
|
95
|
-
}
|
|
96
|
-
validate.errors = vErrors;
|
|
97
|
-
return errors === 0;
|
|
98
|
-
};
|
|
99
|
-
})();
|
|
100
|
-
refVal1.schema = {
|
|
101
|
-
type: 'object',
|
|
102
|
-
additionalProperties: false,
|
|
103
|
-
properties: {
|
|
104
|
-
permissions: {
|
|
105
|
-
type: 'array',
|
|
106
|
-
items: {
|
|
107
|
-
$ref: '#/definitions/Permission',
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
refVal1.errors = null;
|
|
113
|
-
refVal[1] = refVal1;
|
|
114
|
-
var refVal2 = (function () {
|
|
115
|
-
var pattern0 = new RegExp('^[a-zA-Z0-9]+$');
|
|
116
|
-
var pattern1 = new RegExp('.+');
|
|
117
|
-
var pattern2 = new RegExp('^[a-zA-Z0-9_-]+$');
|
|
118
|
-
var pattern3 = new RegExp('^[a-zA-Z0-9_]+$');
|
|
119
|
-
var pattern4 = new RegExp('^([a-zA-Z0-9_-]|\\.)+$');
|
|
120
|
-
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
|
121
|
-
'use strict';
|
|
122
|
-
var vErrors = null;
|
|
123
|
-
var errors = 0;
|
|
124
|
-
if (rootData === undefined) rootData = data;
|
|
125
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
126
|
-
var errs__0 = errors;
|
|
127
|
-
var valid1 = true;
|
|
128
|
-
for (var key0 in data) {
|
|
129
|
-
var isAdditional0 = !(
|
|
130
|
-
false ||
|
|
131
|
-
key0 == 'roles' ||
|
|
132
|
-
key0 == 'access' ||
|
|
133
|
-
key0 == 'restrictToAccessGroups' ||
|
|
134
|
-
key0 == 'restrictions'
|
|
135
|
-
);
|
|
136
|
-
if (isAdditional0) {
|
|
137
|
-
valid1 = false;
|
|
138
|
-
var err = {
|
|
139
|
-
keyword: 'additionalProperties',
|
|
140
|
-
dataPath: (dataPath || '') + '',
|
|
141
|
-
schemaPath: '#/additionalProperties',
|
|
142
|
-
params: {
|
|
143
|
-
additionalProperty: '' + key0 + '',
|
|
144
|
-
},
|
|
145
|
-
message: 'should NOT have additional properties',
|
|
146
|
-
};
|
|
147
|
-
if (vErrors === null) vErrors = [err];
|
|
148
|
-
else vErrors.push(err);
|
|
149
|
-
errors++;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
var data1 = data.roles;
|
|
153
|
-
if (data1 === undefined) {
|
|
154
|
-
valid1 = false;
|
|
155
|
-
var err = {
|
|
156
|
-
keyword: 'required',
|
|
157
|
-
dataPath: (dataPath || '') + '',
|
|
158
|
-
schemaPath: '#/required',
|
|
159
|
-
params: {
|
|
160
|
-
missingProperty: 'roles',
|
|
161
|
-
},
|
|
162
|
-
message: "should have required property 'roles'",
|
|
163
|
-
};
|
|
164
|
-
if (vErrors === null) vErrors = [err];
|
|
165
|
-
else vErrors.push(err);
|
|
166
|
-
errors++;
|
|
167
|
-
} else {
|
|
168
|
-
var errs_1 = errors;
|
|
169
|
-
if (typeof data1 === 'string') {
|
|
170
|
-
if (ucs2length(data1) < 1) {
|
|
171
|
-
var err = {
|
|
172
|
-
keyword: 'minLength',
|
|
173
|
-
dataPath: (dataPath || '') + '.roles',
|
|
174
|
-
schemaPath: '#/properties/roles/minLength',
|
|
175
|
-
params: {
|
|
176
|
-
limit: 1,
|
|
177
|
-
},
|
|
178
|
-
message: 'should NOT be shorter than 1 characters',
|
|
179
|
-
};
|
|
180
|
-
if (vErrors === null) vErrors = [err];
|
|
181
|
-
else vErrors.push(err);
|
|
182
|
-
errors++;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (Array.isArray(data1)) {
|
|
186
|
-
var errs__1 = errors;
|
|
187
|
-
var valid1;
|
|
188
|
-
for (var i1 = 0; i1 < data1.length; i1++) {
|
|
189
|
-
var data2 = data1[i1];
|
|
190
|
-
var errs_2 = errors;
|
|
191
|
-
if (typeof data2 === 'string') {
|
|
192
|
-
if (!pattern1.test(data2)) {
|
|
193
|
-
var err = {
|
|
194
|
-
keyword: 'pattern',
|
|
195
|
-
dataPath: (dataPath || '') + '.roles[' + i1 + ']',
|
|
196
|
-
schemaPath: '#/properties/roles/items/pattern',
|
|
197
|
-
params: {
|
|
198
|
-
pattern: '.+',
|
|
199
|
-
},
|
|
200
|
-
message: 'should match pattern ".+"',
|
|
201
|
-
};
|
|
202
|
-
if (vErrors === null) vErrors = [err];
|
|
203
|
-
else vErrors.push(err);
|
|
204
|
-
errors++;
|
|
205
|
-
}
|
|
206
|
-
} else {
|
|
207
|
-
var err = {
|
|
208
|
-
keyword: 'type',
|
|
209
|
-
dataPath: (dataPath || '') + '.roles[' + i1 + ']',
|
|
210
|
-
schemaPath: '#/properties/roles/items/type',
|
|
211
|
-
params: {
|
|
212
|
-
type: 'string',
|
|
213
|
-
},
|
|
214
|
-
message: 'should be string',
|
|
215
|
-
};
|
|
216
|
-
if (vErrors === null) vErrors = [err];
|
|
217
|
-
else vErrors.push(err);
|
|
218
|
-
errors++;
|
|
219
|
-
}
|
|
220
|
-
var valid2 = errors === errs_2;
|
|
221
|
-
}
|
|
222
|
-
} else {
|
|
223
|
-
var err = {
|
|
224
|
-
keyword: 'type',
|
|
225
|
-
dataPath: (dataPath || '') + '.roles',
|
|
226
|
-
schemaPath: '#/properties/roles/type',
|
|
227
|
-
params: {
|
|
228
|
-
type: 'array',
|
|
229
|
-
},
|
|
230
|
-
message: 'should be array',
|
|
231
|
-
};
|
|
232
|
-
if (vErrors === null) vErrors = [err];
|
|
233
|
-
else vErrors.push(err);
|
|
234
|
-
errors++;
|
|
235
|
-
}
|
|
236
|
-
var valid1 = errors === errs_1;
|
|
237
|
-
}
|
|
238
|
-
var data1 = data.access;
|
|
239
|
-
if (data1 === undefined) {
|
|
240
|
-
valid1 = false;
|
|
241
|
-
var err = {
|
|
242
|
-
keyword: 'required',
|
|
243
|
-
dataPath: (dataPath || '') + '',
|
|
244
|
-
schemaPath: '#/required',
|
|
245
|
-
params: {
|
|
246
|
-
missingProperty: 'access',
|
|
247
|
-
},
|
|
248
|
-
message: "should have required property 'access'",
|
|
249
|
-
};
|
|
250
|
-
if (vErrors === null) vErrors = [err];
|
|
251
|
-
else vErrors.push(err);
|
|
252
|
-
errors++;
|
|
253
|
-
} else {
|
|
254
|
-
var errs_1 = errors;
|
|
255
|
-
var errs__1 = errors,
|
|
256
|
-
prevValid1 = false,
|
|
257
|
-
valid1 = false,
|
|
258
|
-
passingSchemas1 = null;
|
|
259
|
-
var errs_2 = errors;
|
|
260
|
-
if (typeof data1 !== 'string') {
|
|
261
|
-
var err = {
|
|
262
|
-
keyword: 'type',
|
|
263
|
-
dataPath: (dataPath || '') + '.access',
|
|
264
|
-
schemaPath: '#/properties/access/oneOf/0/type',
|
|
265
|
-
params: {
|
|
266
|
-
type: 'string',
|
|
267
|
-
},
|
|
268
|
-
message: 'should be string',
|
|
269
|
-
};
|
|
270
|
-
if (vErrors === null) vErrors = [err];
|
|
271
|
-
else vErrors.push(err);
|
|
272
|
-
errors++;
|
|
273
|
-
}
|
|
274
|
-
var schema2 = validate.schema.properties.access.oneOf[0].enum;
|
|
275
|
-
var valid2;
|
|
276
|
-
valid2 = false;
|
|
277
|
-
for (var i2 = 0; i2 < schema2.length; i2++)
|
|
278
|
-
if (equal(data1, schema2[i2])) {
|
|
279
|
-
valid2 = true;
|
|
280
|
-
break;
|
|
281
|
-
}
|
|
282
|
-
if (!valid2) {
|
|
283
|
-
var err = {
|
|
284
|
-
keyword: 'enum',
|
|
285
|
-
dataPath: (dataPath || '') + '.access',
|
|
286
|
-
schemaPath: '#/properties/access/oneOf/0/enum',
|
|
287
|
-
params: {
|
|
288
|
-
allowedValues: schema2,
|
|
289
|
-
},
|
|
290
|
-
message: 'should be equal to one of the allowed values',
|
|
291
|
-
};
|
|
292
|
-
if (vErrors === null) vErrors = [err];
|
|
293
|
-
else vErrors.push(err);
|
|
294
|
-
errors++;
|
|
295
|
-
}
|
|
296
|
-
var valid2 = errors === errs_2;
|
|
297
|
-
if (valid2) {
|
|
298
|
-
valid1 = prevValid1 = true;
|
|
299
|
-
passingSchemas1 = 0;
|
|
300
|
-
}
|
|
301
|
-
var errs_2 = errors;
|
|
302
|
-
if (Array.isArray(data1)) {
|
|
303
|
-
if (data1.length < 1) {
|
|
304
|
-
var err = {
|
|
305
|
-
keyword: 'minItems',
|
|
306
|
-
dataPath: (dataPath || '') + '.access',
|
|
307
|
-
schemaPath: '#/properties/access/oneOf/1/minItems',
|
|
308
|
-
params: {
|
|
309
|
-
limit: 1,
|
|
310
|
-
},
|
|
311
|
-
message: 'should NOT have fewer than 1 items',
|
|
312
|
-
};
|
|
313
|
-
if (vErrors === null) vErrors = [err];
|
|
314
|
-
else vErrors.push(err);
|
|
315
|
-
errors++;
|
|
316
|
-
}
|
|
317
|
-
var errs__2 = errors;
|
|
318
|
-
var valid2;
|
|
319
|
-
for (var i2 = 0; i2 < data1.length; i2++) {
|
|
320
|
-
var data2 = data1[i2];
|
|
321
|
-
var errs_3 = errors;
|
|
322
|
-
if (typeof data2 !== 'string') {
|
|
323
|
-
var err = {
|
|
324
|
-
keyword: 'type',
|
|
325
|
-
dataPath: (dataPath || '') + '.access[' + i2 + ']',
|
|
326
|
-
schemaPath: '#/properties/access/oneOf/1/items/type',
|
|
327
|
-
params: {
|
|
328
|
-
type: 'string',
|
|
329
|
-
},
|
|
330
|
-
message: 'should be string',
|
|
331
|
-
};
|
|
332
|
-
if (vErrors === null) vErrors = [err];
|
|
333
|
-
else vErrors.push(err);
|
|
334
|
-
errors++;
|
|
335
|
-
}
|
|
336
|
-
var schema3 = validate.schema.properties.access.oneOf[1].items.enum;
|
|
337
|
-
var valid3;
|
|
338
|
-
valid3 = false;
|
|
339
|
-
for (var i3 = 0; i3 < schema3.length; i3++)
|
|
340
|
-
if (equal(data2, schema3[i3])) {
|
|
341
|
-
valid3 = true;
|
|
342
|
-
break;
|
|
343
|
-
}
|
|
344
|
-
if (!valid3) {
|
|
345
|
-
var err = {
|
|
346
|
-
keyword: 'enum',
|
|
347
|
-
dataPath: (dataPath || '') + '.access[' + i2 + ']',
|
|
348
|
-
schemaPath: '#/properties/access/oneOf/1/items/enum',
|
|
349
|
-
params: {
|
|
350
|
-
allowedValues: schema3,
|
|
351
|
-
},
|
|
352
|
-
message: 'should be equal to one of the allowed values',
|
|
353
|
-
};
|
|
354
|
-
if (vErrors === null) vErrors = [err];
|
|
355
|
-
else vErrors.push(err);
|
|
356
|
-
errors++;
|
|
357
|
-
}
|
|
358
|
-
var valid3 = errors === errs_3;
|
|
359
|
-
}
|
|
360
|
-
} else {
|
|
361
|
-
var err = {
|
|
362
|
-
keyword: 'type',
|
|
363
|
-
dataPath: (dataPath || '') + '.access',
|
|
364
|
-
schemaPath: '#/properties/access/oneOf/1/type',
|
|
365
|
-
params: {
|
|
366
|
-
type: 'array',
|
|
367
|
-
},
|
|
368
|
-
message: 'should be array',
|
|
369
|
-
};
|
|
370
|
-
if (vErrors === null) vErrors = [err];
|
|
371
|
-
else vErrors.push(err);
|
|
372
|
-
errors++;
|
|
373
|
-
}
|
|
374
|
-
var valid2 = errors === errs_2;
|
|
375
|
-
if (valid2 && prevValid1) {
|
|
376
|
-
valid1 = false;
|
|
377
|
-
passingSchemas1 = [passingSchemas1, 1];
|
|
378
|
-
} else {
|
|
379
|
-
if (valid2) {
|
|
380
|
-
valid1 = prevValid1 = true;
|
|
381
|
-
passingSchemas1 = 1;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
if (!valid1) {
|
|
385
|
-
var err = {
|
|
386
|
-
keyword: 'oneOf',
|
|
387
|
-
dataPath: (dataPath || '') + '.access',
|
|
388
|
-
schemaPath: '#/properties/access/oneOf',
|
|
389
|
-
params: {
|
|
390
|
-
passingSchemas: passingSchemas1,
|
|
391
|
-
},
|
|
392
|
-
message: 'should match exactly one schema in oneOf',
|
|
393
|
-
};
|
|
394
|
-
if (vErrors === null) vErrors = [err];
|
|
395
|
-
else vErrors.push(err);
|
|
396
|
-
errors++;
|
|
397
|
-
} else {
|
|
398
|
-
errors = errs__1;
|
|
399
|
-
if (vErrors !== null) {
|
|
400
|
-
if (errs__1) vErrors.length = errs__1;
|
|
401
|
-
else vErrors = null;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
var valid1 = errors === errs_1;
|
|
405
|
-
}
|
|
406
|
-
var data1 = data.restrictToAccessGroups;
|
|
407
|
-
if (data1 !== undefined) {
|
|
408
|
-
var errs_1 = errors;
|
|
409
|
-
if (typeof data1 === 'string') {
|
|
410
|
-
if (ucs2length(data1) < 1) {
|
|
411
|
-
var err = {
|
|
412
|
-
keyword: 'minLength',
|
|
413
|
-
dataPath: (dataPath || '') + '.restrictToAccessGroups',
|
|
414
|
-
schemaPath: '#/properties/restrictToAccessGroups/minLength',
|
|
415
|
-
params: {
|
|
416
|
-
limit: 1,
|
|
417
|
-
},
|
|
418
|
-
message: 'should NOT be shorter than 1 characters',
|
|
419
|
-
};
|
|
420
|
-
if (vErrors === null) vErrors = [err];
|
|
421
|
-
else vErrors.push(err);
|
|
422
|
-
errors++;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
if (Array.isArray(data1)) {
|
|
426
|
-
var errs__1 = errors;
|
|
427
|
-
var valid1;
|
|
428
|
-
for (var i1 = 0; i1 < data1.length; i1++) {
|
|
429
|
-
var data2 = data1[i1];
|
|
430
|
-
var errs_2 = errors;
|
|
431
|
-
if (typeof data2 === 'string') {
|
|
432
|
-
if (!pattern1.test(data2)) {
|
|
433
|
-
var err = {
|
|
434
|
-
keyword: 'pattern',
|
|
435
|
-
dataPath:
|
|
436
|
-
(dataPath || '') +
|
|
437
|
-
'.restrictToAccessGroups[' +
|
|
438
|
-
i1 +
|
|
439
|
-
']',
|
|
440
|
-
schemaPath:
|
|
441
|
-
'#/properties/restrictToAccessGroups/items/pattern',
|
|
442
|
-
params: {
|
|
443
|
-
pattern: '.+',
|
|
444
|
-
},
|
|
445
|
-
message: 'should match pattern ".+"',
|
|
446
|
-
};
|
|
447
|
-
if (vErrors === null) vErrors = [err];
|
|
448
|
-
else vErrors.push(err);
|
|
449
|
-
errors++;
|
|
450
|
-
}
|
|
451
|
-
} else {
|
|
452
|
-
var err = {
|
|
453
|
-
keyword: 'type',
|
|
454
|
-
dataPath:
|
|
455
|
-
(dataPath || '') + '.restrictToAccessGroups[' + i1 + ']',
|
|
456
|
-
schemaPath: '#/properties/restrictToAccessGroups/items/type',
|
|
457
|
-
params: {
|
|
458
|
-
type: 'string',
|
|
459
|
-
},
|
|
460
|
-
message: 'should be string',
|
|
461
|
-
};
|
|
462
|
-
if (vErrors === null) vErrors = [err];
|
|
463
|
-
else vErrors.push(err);
|
|
464
|
-
errors++;
|
|
465
|
-
}
|
|
466
|
-
var valid2 = errors === errs_2;
|
|
467
|
-
}
|
|
468
|
-
} else {
|
|
469
|
-
var err = {
|
|
470
|
-
keyword: 'type',
|
|
471
|
-
dataPath: (dataPath || '') + '.restrictToAccessGroups',
|
|
472
|
-
schemaPath: '#/properties/restrictToAccessGroups/type',
|
|
473
|
-
params: {
|
|
474
|
-
type: 'array',
|
|
475
|
-
},
|
|
476
|
-
message: 'should be array',
|
|
477
|
-
};
|
|
478
|
-
if (vErrors === null) vErrors = [err];
|
|
479
|
-
else vErrors.push(err);
|
|
480
|
-
errors++;
|
|
481
|
-
}
|
|
482
|
-
var valid1 = errors === errs_1;
|
|
483
|
-
}
|
|
484
|
-
var data1 = data.restrictions;
|
|
485
|
-
if (data1 !== undefined) {
|
|
486
|
-
var errs_1 = errors;
|
|
487
|
-
if (Array.isArray(data1)) {
|
|
488
|
-
var errs__1 = errors;
|
|
489
|
-
var valid1;
|
|
490
|
-
for (var i1 = 0; i1 < data1.length; i1++) {
|
|
491
|
-
var errs_2 = errors;
|
|
492
|
-
if (
|
|
493
|
-
!refVal3(
|
|
494
|
-
data1[i1],
|
|
495
|
-
(dataPath || '') + '.restrictions[' + i1 + ']',
|
|
496
|
-
data1,
|
|
497
|
-
i1,
|
|
498
|
-
rootData,
|
|
499
|
-
)
|
|
500
|
-
) {
|
|
501
|
-
if (vErrors === null) vErrors = refVal3.errors;
|
|
502
|
-
else vErrors = vErrors.concat(refVal3.errors);
|
|
503
|
-
errors = vErrors.length;
|
|
504
|
-
}
|
|
505
|
-
var valid2 = errors === errs_2;
|
|
506
|
-
}
|
|
507
|
-
} else {
|
|
508
|
-
var err = {
|
|
509
|
-
keyword: 'type',
|
|
510
|
-
dataPath: (dataPath || '') + '.restrictions',
|
|
511
|
-
schemaPath: '#/properties/restrictions/type',
|
|
512
|
-
params: {
|
|
513
|
-
type: 'array',
|
|
514
|
-
},
|
|
515
|
-
message: 'should be array',
|
|
516
|
-
};
|
|
517
|
-
if (vErrors === null) vErrors = [err];
|
|
518
|
-
else vErrors.push(err);
|
|
519
|
-
errors++;
|
|
520
|
-
}
|
|
521
|
-
var valid1 = errors === errs_1;
|
|
522
|
-
}
|
|
523
|
-
} else {
|
|
524
|
-
var err = {
|
|
525
|
-
keyword: 'type',
|
|
526
|
-
dataPath: (dataPath || '') + '',
|
|
527
|
-
schemaPath: '#/type',
|
|
528
|
-
params: {
|
|
529
|
-
type: 'object',
|
|
530
|
-
},
|
|
531
|
-
message: 'should be object',
|
|
532
|
-
};
|
|
533
|
-
if (vErrors === null) vErrors = [err];
|
|
534
|
-
else vErrors.push(err);
|
|
535
|
-
errors++;
|
|
536
|
-
}
|
|
537
|
-
validate.errors = vErrors;
|
|
538
|
-
return errors === 0;
|
|
539
|
-
};
|
|
540
|
-
})();
|
|
541
|
-
refVal2.schema = {
|
|
542
|
-
type: 'object',
|
|
543
|
-
required: ['roles', 'access'],
|
|
544
|
-
additionalProperties: false,
|
|
545
|
-
properties: {
|
|
546
|
-
roles: {
|
|
547
|
-
type: 'array',
|
|
548
|
-
minLength: 1,
|
|
549
|
-
items: {
|
|
550
|
-
type: 'string',
|
|
551
|
-
pattern: '.+',
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
access: {
|
|
555
|
-
oneOf: [
|
|
556
|
-
{
|
|
557
|
-
type: 'string',
|
|
558
|
-
enum: ['read', 'readWrite', 'create', 'update', 'delete'],
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
type: 'array',
|
|
562
|
-
items: {
|
|
563
|
-
type: 'string',
|
|
564
|
-
enum: ['read', 'readWrite', 'create', 'update', 'delete'],
|
|
565
|
-
},
|
|
566
|
-
minItems: 1,
|
|
567
|
-
},
|
|
568
|
-
],
|
|
569
|
-
},
|
|
570
|
-
restrictToAccessGroups: {
|
|
571
|
-
type: 'array',
|
|
572
|
-
minLength: 1,
|
|
573
|
-
items: {
|
|
574
|
-
type: 'string',
|
|
575
|
-
pattern: '.+',
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
|
-
restrictions: {
|
|
579
|
-
type: 'array',
|
|
580
|
-
items: {
|
|
581
|
-
$ref: '#/definitions/PermissionRestriction',
|
|
582
|
-
},
|
|
583
|
-
},
|
|
584
|
-
},
|
|
585
|
-
};
|
|
586
|
-
refVal2.errors = null;
|
|
587
|
-
refVal[2] = refVal2;
|
|
588
|
-
var refVal3 = (function () {
|
|
589
|
-
var pattern0 = new RegExp('^[a-zA-Z0-9]+$');
|
|
590
|
-
var pattern1 = new RegExp('.+');
|
|
591
|
-
var pattern2 = new RegExp('^[a-zA-Z0-9_-]+$');
|
|
592
|
-
var pattern3 = new RegExp('^[a-zA-Z0-9_]+$');
|
|
593
|
-
var pattern4 = new RegExp('^([a-zA-Z0-9_-]|\\.)+$');
|
|
594
|
-
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
|
595
|
-
'use strict';
|
|
596
|
-
var vErrors = null;
|
|
597
|
-
var errors = 0;
|
|
598
|
-
if (rootData === undefined) rootData = data;
|
|
599
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
600
|
-
var errs__0 = errors;
|
|
601
|
-
var valid1 = true;
|
|
602
|
-
if (data.field === undefined) {
|
|
603
|
-
valid1 = false;
|
|
604
|
-
var err = {
|
|
605
|
-
keyword: 'required',
|
|
606
|
-
dataPath: (dataPath || '') + '',
|
|
607
|
-
schemaPath: '#/required',
|
|
608
|
-
params: {
|
|
609
|
-
missingProperty: 'field',
|
|
610
|
-
},
|
|
611
|
-
message: "should have required property 'field'",
|
|
612
|
-
};
|
|
613
|
-
if (vErrors === null) vErrors = [err];
|
|
614
|
-
else vErrors.push(err);
|
|
615
|
-
errors++;
|
|
616
|
-
} else {
|
|
617
|
-
var errs_1 = errors;
|
|
618
|
-
if (typeof data.field !== 'string') {
|
|
619
|
-
var err = {
|
|
620
|
-
keyword: 'type',
|
|
621
|
-
dataPath: (dataPath || '') + '.field',
|
|
622
|
-
schemaPath: '#/properties/field/type',
|
|
623
|
-
params: {
|
|
624
|
-
type: 'string',
|
|
625
|
-
},
|
|
626
|
-
message: 'should be string',
|
|
627
|
-
};
|
|
628
|
-
if (vErrors === null) vErrors = [err];
|
|
629
|
-
else vErrors.push(err);
|
|
630
|
-
errors++;
|
|
631
|
-
}
|
|
632
|
-
var valid1 = errors === errs_1;
|
|
633
|
-
}
|
|
634
|
-
} else {
|
|
635
|
-
var err = {
|
|
636
|
-
keyword: 'type',
|
|
637
|
-
dataPath: (dataPath || '') + '',
|
|
638
|
-
schemaPath: '#/type',
|
|
639
|
-
params: {
|
|
640
|
-
type: 'object',
|
|
641
|
-
},
|
|
642
|
-
message: 'should be object',
|
|
643
|
-
};
|
|
644
|
-
if (vErrors === null) vErrors = [err];
|
|
645
|
-
else vErrors.push(err);
|
|
646
|
-
errors++;
|
|
647
|
-
}
|
|
648
|
-
var errs__0 = errors,
|
|
649
|
-
prevValid0 = false,
|
|
650
|
-
valid0 = false,
|
|
651
|
-
passingSchemas0 = null;
|
|
652
|
-
var errs_1 = errors;
|
|
653
|
-
var errs_2 = errors;
|
|
654
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
655
|
-
if (data.value === undefined) {
|
|
656
|
-
var err = {
|
|
657
|
-
keyword: 'required',
|
|
658
|
-
dataPath: (dataPath || '') + '',
|
|
659
|
-
schemaPath: '#/definitions/PermissionRestrictionWithValue/required',
|
|
660
|
-
params: {
|
|
661
|
-
missingProperty: 'value',
|
|
662
|
-
},
|
|
663
|
-
message: "should have required property 'value'",
|
|
664
|
-
};
|
|
665
|
-
if (vErrors === null) vErrors = [err];
|
|
666
|
-
else vErrors.push(err);
|
|
667
|
-
errors++;
|
|
668
|
-
}
|
|
669
|
-
var errs__2 = errors;
|
|
670
|
-
var valid3 = true;
|
|
671
|
-
}
|
|
672
|
-
var valid2 = errors === errs_2;
|
|
673
|
-
var valid1 = errors === errs_1;
|
|
674
|
-
if (valid1) {
|
|
675
|
-
valid0 = prevValid0 = true;
|
|
676
|
-
passingSchemas0 = 0;
|
|
677
|
-
}
|
|
678
|
-
var errs_1 = errors;
|
|
679
|
-
var errs_2 = errors;
|
|
680
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
681
|
-
var errs__2 = errors;
|
|
682
|
-
var valid3 = true;
|
|
683
|
-
if (data.valueTemplate === undefined) {
|
|
684
|
-
valid3 = false;
|
|
685
|
-
var err = {
|
|
686
|
-
keyword: 'required',
|
|
687
|
-
dataPath: (dataPath || '') + '',
|
|
688
|
-
schemaPath: '#/definitions/PermissionRestrictionWithValueTemplate/required',
|
|
689
|
-
params: {
|
|
690
|
-
missingProperty: 'valueTemplate',
|
|
691
|
-
},
|
|
692
|
-
message: "should have required property 'valueTemplate'",
|
|
693
|
-
};
|
|
694
|
-
if (vErrors === null) vErrors = [err];
|
|
695
|
-
else vErrors.push(err);
|
|
696
|
-
errors++;
|
|
697
|
-
} else {
|
|
698
|
-
var errs_3 = errors;
|
|
699
|
-
if (typeof data.valueTemplate !== 'string') {
|
|
700
|
-
var err = {
|
|
701
|
-
keyword: 'type',
|
|
702
|
-
dataPath: (dataPath || '') + '.valueTemplate',
|
|
703
|
-
schemaPath:
|
|
704
|
-
'#/definitions/PermissionRestrictionWithValueTemplate/properties/valueTemplate/type',
|
|
705
|
-
params: {
|
|
706
|
-
type: 'string',
|
|
707
|
-
},
|
|
708
|
-
message: 'should be string',
|
|
709
|
-
};
|
|
710
|
-
if (vErrors === null) vErrors = [err];
|
|
711
|
-
else vErrors.push(err);
|
|
712
|
-
errors++;
|
|
713
|
-
}
|
|
714
|
-
var valid3 = errors === errs_3;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
var valid2 = errors === errs_2;
|
|
718
|
-
var valid1 = errors === errs_1;
|
|
719
|
-
if (valid1 && prevValid0) {
|
|
720
|
-
valid0 = false;
|
|
721
|
-
passingSchemas0 = [passingSchemas0, 1];
|
|
722
|
-
} else {
|
|
723
|
-
if (valid1) {
|
|
724
|
-
valid0 = prevValid0 = true;
|
|
725
|
-
passingSchemas0 = 1;
|
|
726
|
-
}
|
|
727
|
-
var errs_1 = errors;
|
|
728
|
-
var errs_2 = errors;
|
|
729
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
730
|
-
var errs__2 = errors;
|
|
731
|
-
var valid3 = true;
|
|
732
|
-
var data1 = data.claim;
|
|
733
|
-
if (data1 === undefined) {
|
|
734
|
-
valid3 = false;
|
|
735
|
-
var err = {
|
|
736
|
-
keyword: 'required',
|
|
737
|
-
dataPath: (dataPath || '') + '',
|
|
738
|
-
schemaPath: '#/definitions/PermissionRestrictionWithClaim/required',
|
|
739
|
-
params: {
|
|
740
|
-
missingProperty: 'claim',
|
|
741
|
-
},
|
|
742
|
-
message: "should have required property 'claim'",
|
|
743
|
-
};
|
|
744
|
-
if (vErrors === null) vErrors = [err];
|
|
745
|
-
else vErrors.push(err);
|
|
746
|
-
errors++;
|
|
747
|
-
} else {
|
|
748
|
-
var errs_3 = errors;
|
|
749
|
-
if (typeof data1 === 'string') {
|
|
750
|
-
if (ucs2length(data1) < 1) {
|
|
751
|
-
var err = {
|
|
752
|
-
keyword: 'minLength',
|
|
753
|
-
dataPath: (dataPath || '') + '.claim',
|
|
754
|
-
schemaPath:
|
|
755
|
-
'#/definitions/PermissionRestrictionWithClaim/properties/claim/minLength',
|
|
756
|
-
params: {
|
|
757
|
-
limit: 1,
|
|
758
|
-
},
|
|
759
|
-
message: 'should NOT be shorter than 1 characters',
|
|
760
|
-
};
|
|
761
|
-
if (vErrors === null) vErrors = [err];
|
|
762
|
-
else vErrors.push(err);
|
|
763
|
-
errors++;
|
|
764
|
-
}
|
|
765
|
-
} else {
|
|
766
|
-
var err = {
|
|
767
|
-
keyword: 'type',
|
|
768
|
-
dataPath: (dataPath || '') + '.claim',
|
|
769
|
-
schemaPath:
|
|
770
|
-
'#/definitions/PermissionRestrictionWithClaim/properties/claim/type',
|
|
771
|
-
params: {
|
|
772
|
-
type: 'string',
|
|
773
|
-
},
|
|
774
|
-
message: 'should be string',
|
|
775
|
-
};
|
|
776
|
-
if (vErrors === null) vErrors = [err];
|
|
777
|
-
else vErrors.push(err);
|
|
778
|
-
errors++;
|
|
779
|
-
}
|
|
780
|
-
var valid3 = errors === errs_3;
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
var valid2 = errors === errs_2;
|
|
784
|
-
var valid1 = errors === errs_1;
|
|
785
|
-
if (valid1 && prevValid0) {
|
|
786
|
-
valid0 = false;
|
|
787
|
-
passingSchemas0 = [passingSchemas0, 2];
|
|
788
|
-
} else {
|
|
789
|
-
if (valid1) {
|
|
790
|
-
valid0 = prevValid0 = true;
|
|
791
|
-
passingSchemas0 = 2;
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
if (!valid0) {
|
|
796
|
-
var err = {
|
|
797
|
-
keyword: 'oneOf',
|
|
798
|
-
dataPath: (dataPath || '') + '',
|
|
799
|
-
schemaPath: '#/oneOf',
|
|
800
|
-
params: {
|
|
801
|
-
passingSchemas: passingSchemas0,
|
|
802
|
-
},
|
|
803
|
-
message: 'should match exactly one schema in oneOf',
|
|
804
|
-
};
|
|
805
|
-
if (vErrors === null) vErrors = [err];
|
|
806
|
-
else vErrors.push(err);
|
|
807
|
-
errors++;
|
|
808
|
-
} else {
|
|
809
|
-
errors = errs__0;
|
|
810
|
-
if (vErrors !== null) {
|
|
811
|
-
if (errs__0) vErrors.length = errs__0;
|
|
812
|
-
else vErrors = null;
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
validate.errors = vErrors;
|
|
816
|
-
return errors === 0;
|
|
817
|
-
};
|
|
818
|
-
})();
|
|
819
|
-
refVal3.schema = {
|
|
820
|
-
type: 'object',
|
|
821
|
-
required: ['field'],
|
|
822
|
-
properties: {
|
|
823
|
-
field: {
|
|
824
|
-
type: 'string',
|
|
825
|
-
},
|
|
826
|
-
},
|
|
827
|
-
oneOf: [
|
|
828
|
-
{
|
|
829
|
-
$ref: '#/definitions/PermissionRestrictionWithValue',
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
$ref: '#/definitions/PermissionRestrictionWithValueTemplate',
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
$ref: '#/definitions/PermissionRestrictionWithClaim',
|
|
836
|
-
},
|
|
837
|
-
],
|
|
838
|
-
};
|
|
839
|
-
refVal3.errors = null;
|
|
840
|
-
refVal[3] = refVal3;
|
|
841
|
-
var refVal4 = {
|
|
842
|
-
required: ['value'],
|
|
843
|
-
properties: {
|
|
844
|
-
value: {},
|
|
845
|
-
},
|
|
846
|
-
};
|
|
847
|
-
refVal[4] = refVal4;
|
|
848
|
-
var refVal5 = {
|
|
849
|
-
required: ['valueTemplate'],
|
|
850
|
-
properties: {
|
|
851
|
-
valueTemplate: {
|
|
852
|
-
type: 'string',
|
|
853
|
-
},
|
|
854
|
-
},
|
|
855
|
-
};
|
|
856
|
-
refVal[5] = refVal5;
|
|
857
|
-
var refVal6 = {
|
|
858
|
-
required: ['claim'],
|
|
859
|
-
properties: {
|
|
860
|
-
claim: {
|
|
861
|
-
type: 'string',
|
|
862
|
-
minLength: 1,
|
|
863
|
-
},
|
|
864
|
-
},
|
|
865
|
-
};
|
|
866
|
-
refVal[6] = refVal6;
|
|
867
|
-
var refVal7 = (function () {
|
|
868
|
-
var pattern0 = new RegExp('^[a-zA-Z0-9]+$');
|
|
869
|
-
var pattern1 = new RegExp('.+');
|
|
870
|
-
var pattern2 = new RegExp('^[a-zA-Z0-9_-]+$');
|
|
871
|
-
var pattern3 = new RegExp('^[a-zA-Z0-9_]+$');
|
|
872
|
-
var pattern4 = new RegExp('^([a-zA-Z0-9_-]|\\.)+$');
|
|
873
|
-
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
|
874
|
-
'use strict';
|
|
875
|
-
var vErrors = null;
|
|
876
|
-
var errors = 0;
|
|
877
|
-
if (rootData === undefined) rootData = data;
|
|
878
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
879
|
-
var errs__0 = errors;
|
|
880
|
-
var valid1 = true;
|
|
881
|
-
for (var key0 in data) {
|
|
882
|
-
var isAdditional0 = !(false || key0 == 'types' || key0 == 'fields');
|
|
883
|
-
if (isAdditional0) {
|
|
884
|
-
valid1 = false;
|
|
885
|
-
var err = {
|
|
886
|
-
keyword: 'additionalProperties',
|
|
887
|
-
dataPath: (dataPath || '') + '',
|
|
888
|
-
schemaPath: '#/additionalProperties',
|
|
889
|
-
params: {
|
|
890
|
-
additionalProperty: '' + key0 + '',
|
|
891
|
-
},
|
|
892
|
-
message: 'should NOT have additional properties',
|
|
893
|
-
};
|
|
894
|
-
if (vErrors === null) vErrors = [err];
|
|
895
|
-
else vErrors.push(err);
|
|
896
|
-
errors++;
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
var data1 = data.types;
|
|
900
|
-
if (data1 !== undefined) {
|
|
901
|
-
var errs_1 = errors;
|
|
902
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
903
|
-
var errs__1 = errors;
|
|
904
|
-
var valid2 = true;
|
|
905
|
-
for (var key1 in data1) {
|
|
906
|
-
if (pattern3.test(key1)) {
|
|
907
|
-
var errs_2 = errors;
|
|
908
|
-
if (
|
|
909
|
-
!refVal8(
|
|
910
|
-
data1[key1],
|
|
911
|
-
(dataPath || '') + ".types['" + key1 + "']",
|
|
912
|
-
data1,
|
|
913
|
-
key1,
|
|
914
|
-
rootData,
|
|
915
|
-
)
|
|
916
|
-
) {
|
|
917
|
-
if (vErrors === null) vErrors = refVal8.errors;
|
|
918
|
-
else vErrors = vErrors.concat(refVal8.errors);
|
|
919
|
-
errors = vErrors.length;
|
|
920
|
-
}
|
|
921
|
-
var valid2 = errors === errs_2;
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
var valid1 = errors === errs_1;
|
|
926
|
-
}
|
|
927
|
-
var data1 = data.fields;
|
|
928
|
-
if (data1 !== undefined) {
|
|
929
|
-
var errs_1 = errors;
|
|
930
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
931
|
-
var errs__1 = errors;
|
|
932
|
-
var valid2 = true;
|
|
933
|
-
for (var key1 in data1) {
|
|
934
|
-
if (pattern3.test(key1)) {
|
|
935
|
-
var data2 = data1[key1];
|
|
936
|
-
var errs_2 = errors;
|
|
937
|
-
var errs__2 = errors;
|
|
938
|
-
var valid2 = false;
|
|
939
|
-
var errs_3 = errors;
|
|
940
|
-
var errs_4 = errors;
|
|
941
|
-
if (data2 && typeof data2 === 'object' && !Array.isArray(data2)) {
|
|
942
|
-
var errs__4 = errors;
|
|
943
|
-
var valid5 = true;
|
|
944
|
-
if (data2.label !== undefined) {
|
|
945
|
-
var errs_5 = errors;
|
|
946
|
-
if (typeof data2.label !== 'string') {
|
|
947
|
-
var err = {
|
|
948
|
-
keyword: 'type',
|
|
949
|
-
dataPath:
|
|
950
|
-
(dataPath || '') +
|
|
951
|
-
".fields['" +
|
|
952
|
-
key1 +
|
|
953
|
-
"'].label",
|
|
954
|
-
schemaPath:
|
|
955
|
-
'#/definitions/FieldLocalization/properties/label/type',
|
|
956
|
-
params: {
|
|
957
|
-
type: 'string',
|
|
958
|
-
},
|
|
959
|
-
message: 'should be string',
|
|
960
|
-
};
|
|
961
|
-
if (vErrors === null) vErrors = [err];
|
|
962
|
-
else vErrors.push(err);
|
|
963
|
-
errors++;
|
|
964
|
-
}
|
|
965
|
-
var valid5 = errors === errs_5;
|
|
966
|
-
}
|
|
967
|
-
if (data2.hint !== undefined) {
|
|
968
|
-
var errs_5 = errors;
|
|
969
|
-
if (typeof data2.hint !== 'string') {
|
|
970
|
-
var err = {
|
|
971
|
-
keyword: 'type',
|
|
972
|
-
dataPath:
|
|
973
|
-
(dataPath || '') +
|
|
974
|
-
".fields['" +
|
|
975
|
-
key1 +
|
|
976
|
-
"'].hint",
|
|
977
|
-
schemaPath:
|
|
978
|
-
'#/definitions/FieldLocalization/properties/hint/type',
|
|
979
|
-
params: {
|
|
980
|
-
type: 'string',
|
|
981
|
-
},
|
|
982
|
-
message: 'should be string',
|
|
983
|
-
};
|
|
984
|
-
if (vErrors === null) vErrors = [err];
|
|
985
|
-
else vErrors.push(err);
|
|
986
|
-
errors++;
|
|
987
|
-
}
|
|
988
|
-
var valid5 = errors === errs_5;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
var valid4 = errors === errs_4;
|
|
992
|
-
var valid3 = errors === errs_3;
|
|
993
|
-
valid2 = valid2 || valid3;
|
|
994
|
-
if (!valid2) {
|
|
995
|
-
var errs_3 = errors;
|
|
996
|
-
if (typeof data2 !== 'string') {
|
|
997
|
-
var err = {
|
|
998
|
-
keyword: 'type',
|
|
999
|
-
dataPath: (dataPath || '') + ".fields['" + key1 + "']",
|
|
1000
|
-
schemaPath:
|
|
1001
|
-
'#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf/1/type',
|
|
1002
|
-
params: {
|
|
1003
|
-
type: 'string',
|
|
1004
|
-
},
|
|
1005
|
-
message: 'should be string',
|
|
1006
|
-
};
|
|
1007
|
-
if (vErrors === null) vErrors = [err];
|
|
1008
|
-
else vErrors.push(err);
|
|
1009
|
-
errors++;
|
|
1010
|
-
}
|
|
1011
|
-
var valid3 = errors === errs_3;
|
|
1012
|
-
valid2 = valid2 || valid3;
|
|
1013
|
-
if (!valid2) {
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
if (!valid2) {
|
|
1017
|
-
var err = {
|
|
1018
|
-
keyword: 'anyOf',
|
|
1019
|
-
dataPath: (dataPath || '') + ".fields['" + key1 + "']",
|
|
1020
|
-
schemaPath:
|
|
1021
|
-
'#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf',
|
|
1022
|
-
params: {},
|
|
1023
|
-
message: 'should match some schema in anyOf',
|
|
1024
|
-
};
|
|
1025
|
-
if (vErrors === null) vErrors = [err];
|
|
1026
|
-
else vErrors.push(err);
|
|
1027
|
-
errors++;
|
|
1028
|
-
} else {
|
|
1029
|
-
errors = errs__2;
|
|
1030
|
-
if (vErrors !== null) {
|
|
1031
|
-
if (errs__2) vErrors.length = errs__2;
|
|
1032
|
-
else vErrors = null;
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
var valid2 = errors === errs_2;
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
var valid1 = errors === errs_1;
|
|
1040
|
-
}
|
|
1041
|
-
} else {
|
|
1042
|
-
var err = {
|
|
1043
|
-
keyword: 'type',
|
|
1044
|
-
dataPath: (dataPath || '') + '',
|
|
1045
|
-
schemaPath: '#/type',
|
|
1046
|
-
params: {
|
|
1047
|
-
type: 'object',
|
|
1048
|
-
},
|
|
1049
|
-
message: 'should be object',
|
|
1050
|
-
};
|
|
1051
|
-
if (vErrors === null) vErrors = [err];
|
|
1052
|
-
else vErrors.push(err);
|
|
1053
|
-
errors++;
|
|
1054
|
-
}
|
|
1055
|
-
validate.errors = vErrors;
|
|
1056
|
-
return errors === 0;
|
|
1057
|
-
};
|
|
1058
|
-
})();
|
|
1059
|
-
refVal7.schema = {
|
|
1060
|
-
type: 'object',
|
|
1061
|
-
additionalProperties: false,
|
|
1062
|
-
properties: {
|
|
1063
|
-
types: {
|
|
1064
|
-
patternProperties: {
|
|
1065
|
-
'^[a-zA-Z0-9_]+$': {
|
|
1066
|
-
$ref: '#/definitions/TypeLocalization',
|
|
1067
|
-
},
|
|
1068
|
-
},
|
|
1069
|
-
},
|
|
1070
|
-
fields: {
|
|
1071
|
-
patternProperties: {
|
|
1072
|
-
'^[a-zA-Z0-9_]+$': {
|
|
1073
|
-
anyOf: [
|
|
1074
|
-
{
|
|
1075
|
-
$ref: '#/definitions/FieldLocalization',
|
|
1076
|
-
},
|
|
1077
|
-
{
|
|
1078
|
-
type: 'string',
|
|
1079
|
-
},
|
|
1080
|
-
],
|
|
1081
|
-
},
|
|
1082
|
-
},
|
|
1083
|
-
},
|
|
1084
|
-
},
|
|
1085
|
-
};
|
|
1086
|
-
refVal7.errors = null;
|
|
1087
|
-
refVal[7] = refVal7;
|
|
1088
|
-
var refVal8 = (function () {
|
|
1089
|
-
var pattern0 = new RegExp('^[a-zA-Z0-9]+$');
|
|
1090
|
-
var pattern1 = new RegExp('.+');
|
|
1091
|
-
var pattern2 = new RegExp('^[a-zA-Z0-9_-]+$');
|
|
1092
|
-
var pattern3 = new RegExp('^[a-zA-Z0-9_]+$');
|
|
1093
|
-
var pattern4 = new RegExp('^([a-zA-Z0-9_-]|\\.)+$');
|
|
1094
|
-
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
|
1095
|
-
'use strict';
|
|
1096
|
-
var vErrors = null;
|
|
1097
|
-
var errors = 0;
|
|
1098
|
-
if (rootData === undefined) rootData = data;
|
|
1099
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
1100
|
-
var errs__0 = errors;
|
|
1101
|
-
var valid1 = true;
|
|
1102
|
-
for (var key0 in data) {
|
|
1103
|
-
var isAdditional0 = !(
|
|
1104
|
-
false ||
|
|
1105
|
-
key0 == 'fields' ||
|
|
1106
|
-
key0 == 'values' ||
|
|
1107
|
-
key0 == 'label' ||
|
|
1108
|
-
key0 == 'labelPlural' ||
|
|
1109
|
-
key0 == 'hint'
|
|
1110
|
-
);
|
|
1111
|
-
if (isAdditional0) {
|
|
1112
|
-
valid1 = false;
|
|
1113
|
-
var err = {
|
|
1114
|
-
keyword: 'additionalProperties',
|
|
1115
|
-
dataPath: (dataPath || '') + '',
|
|
1116
|
-
schemaPath: '#/additionalProperties',
|
|
1117
|
-
params: {
|
|
1118
|
-
additionalProperty: '' + key0 + '',
|
|
1119
|
-
},
|
|
1120
|
-
message: 'should NOT have additional properties',
|
|
1121
|
-
};
|
|
1122
|
-
if (vErrors === null) vErrors = [err];
|
|
1123
|
-
else vErrors.push(err);
|
|
1124
|
-
errors++;
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
var data1 = data.fields;
|
|
1128
|
-
if (data1 !== undefined) {
|
|
1129
|
-
var errs_1 = errors;
|
|
1130
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
1131
|
-
var errs__1 = errors;
|
|
1132
|
-
var valid2 = true;
|
|
1133
|
-
for (var key1 in data1) {
|
|
1134
|
-
if (pattern3.test(key1)) {
|
|
1135
|
-
var data2 = data1[key1];
|
|
1136
|
-
var errs_2 = errors;
|
|
1137
|
-
var errs__2 = errors;
|
|
1138
|
-
var valid2 = false;
|
|
1139
|
-
var errs_3 = errors;
|
|
1140
|
-
var errs_4 = errors;
|
|
1141
|
-
if (data2 && typeof data2 === 'object' && !Array.isArray(data2)) {
|
|
1142
|
-
var errs__4 = errors;
|
|
1143
|
-
var valid5 = true;
|
|
1144
|
-
if (data2.label !== undefined) {
|
|
1145
|
-
var errs_5 = errors;
|
|
1146
|
-
if (typeof data2.label !== 'string') {
|
|
1147
|
-
var err = {
|
|
1148
|
-
keyword: 'type',
|
|
1149
|
-
dataPath:
|
|
1150
|
-
(dataPath || '') +
|
|
1151
|
-
".fields['" +
|
|
1152
|
-
key1 +
|
|
1153
|
-
"'].label",
|
|
1154
|
-
schemaPath:
|
|
1155
|
-
'#/definitions/FieldLocalization/properties/label/type',
|
|
1156
|
-
params: {
|
|
1157
|
-
type: 'string',
|
|
1158
|
-
},
|
|
1159
|
-
message: 'should be string',
|
|
1160
|
-
};
|
|
1161
|
-
if (vErrors === null) vErrors = [err];
|
|
1162
|
-
else vErrors.push(err);
|
|
1163
|
-
errors++;
|
|
1164
|
-
}
|
|
1165
|
-
var valid5 = errors === errs_5;
|
|
1166
|
-
}
|
|
1167
|
-
if (data2.hint !== undefined) {
|
|
1168
|
-
var errs_5 = errors;
|
|
1169
|
-
if (typeof data2.hint !== 'string') {
|
|
1170
|
-
var err = {
|
|
1171
|
-
keyword: 'type',
|
|
1172
|
-
dataPath:
|
|
1173
|
-
(dataPath || '') +
|
|
1174
|
-
".fields['" +
|
|
1175
|
-
key1 +
|
|
1176
|
-
"'].hint",
|
|
1177
|
-
schemaPath:
|
|
1178
|
-
'#/definitions/FieldLocalization/properties/hint/type',
|
|
1179
|
-
params: {
|
|
1180
|
-
type: 'string',
|
|
1181
|
-
},
|
|
1182
|
-
message: 'should be string',
|
|
1183
|
-
};
|
|
1184
|
-
if (vErrors === null) vErrors = [err];
|
|
1185
|
-
else vErrors.push(err);
|
|
1186
|
-
errors++;
|
|
1187
|
-
}
|
|
1188
|
-
var valid5 = errors === errs_5;
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
var valid4 = errors === errs_4;
|
|
1192
|
-
var valid3 = errors === errs_3;
|
|
1193
|
-
valid2 = valid2 || valid3;
|
|
1194
|
-
if (!valid2) {
|
|
1195
|
-
var errs_3 = errors;
|
|
1196
|
-
if (typeof data2 !== 'string') {
|
|
1197
|
-
var err = {
|
|
1198
|
-
keyword: 'type',
|
|
1199
|
-
dataPath: (dataPath || '') + ".fields['" + key1 + "']",
|
|
1200
|
-
schemaPath:
|
|
1201
|
-
'#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf/1/type',
|
|
1202
|
-
params: {
|
|
1203
|
-
type: 'string',
|
|
1204
|
-
},
|
|
1205
|
-
message: 'should be string',
|
|
1206
|
-
};
|
|
1207
|
-
if (vErrors === null) vErrors = [err];
|
|
1208
|
-
else vErrors.push(err);
|
|
1209
|
-
errors++;
|
|
1210
|
-
}
|
|
1211
|
-
var valid3 = errors === errs_3;
|
|
1212
|
-
valid2 = valid2 || valid3;
|
|
1213
|
-
if (!valid2) {
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
if (!valid2) {
|
|
1217
|
-
var err = {
|
|
1218
|
-
keyword: 'anyOf',
|
|
1219
|
-
dataPath: (dataPath || '') + ".fields['" + key1 + "']",
|
|
1220
|
-
schemaPath:
|
|
1221
|
-
'#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf',
|
|
1222
|
-
params: {},
|
|
1223
|
-
message: 'should match some schema in anyOf',
|
|
1224
|
-
};
|
|
1225
|
-
if (vErrors === null) vErrors = [err];
|
|
1226
|
-
else vErrors.push(err);
|
|
1227
|
-
errors++;
|
|
1228
|
-
} else {
|
|
1229
|
-
errors = errs__2;
|
|
1230
|
-
if (vErrors !== null) {
|
|
1231
|
-
if (errs__2) vErrors.length = errs__2;
|
|
1232
|
-
else vErrors = null;
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
var valid2 = errors === errs_2;
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
var valid1 = errors === errs_1;
|
|
1240
|
-
}
|
|
1241
|
-
var data1 = data.values;
|
|
1242
|
-
if (data1 !== undefined) {
|
|
1243
|
-
var errs_1 = errors;
|
|
1244
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
1245
|
-
var errs__1 = errors;
|
|
1246
|
-
var valid2 = true;
|
|
1247
|
-
for (var key1 in data1) {
|
|
1248
|
-
if (pattern3.test(key1)) {
|
|
1249
|
-
var data2 = data1[key1];
|
|
1250
|
-
var errs_2 = errors;
|
|
1251
|
-
var errs__2 = errors;
|
|
1252
|
-
var valid2 = false;
|
|
1253
|
-
var errs_3 = errors;
|
|
1254
|
-
var errs_4 = errors;
|
|
1255
|
-
if (data2 && typeof data2 === 'object' && !Array.isArray(data2)) {
|
|
1256
|
-
var errs__4 = errors;
|
|
1257
|
-
var valid5 = true;
|
|
1258
|
-
if (data2.label !== undefined) {
|
|
1259
|
-
var errs_5 = errors;
|
|
1260
|
-
if (typeof data2.label !== 'string') {
|
|
1261
|
-
var err = {
|
|
1262
|
-
keyword: 'type',
|
|
1263
|
-
dataPath:
|
|
1264
|
-
(dataPath || '') +
|
|
1265
|
-
".values['" +
|
|
1266
|
-
key1 +
|
|
1267
|
-
"'].label",
|
|
1268
|
-
schemaPath:
|
|
1269
|
-
'#/definitions/EnumValueLocalization/properties/label/type',
|
|
1270
|
-
params: {
|
|
1271
|
-
type: 'string',
|
|
1272
|
-
},
|
|
1273
|
-
message: 'should be string',
|
|
1274
|
-
};
|
|
1275
|
-
if (vErrors === null) vErrors = [err];
|
|
1276
|
-
else vErrors.push(err);
|
|
1277
|
-
errors++;
|
|
1278
|
-
}
|
|
1279
|
-
var valid5 = errors === errs_5;
|
|
1280
|
-
}
|
|
1281
|
-
if (data2.hint !== undefined) {
|
|
1282
|
-
var errs_5 = errors;
|
|
1283
|
-
if (typeof data2.hint !== 'string') {
|
|
1284
|
-
var err = {
|
|
1285
|
-
keyword: 'type',
|
|
1286
|
-
dataPath:
|
|
1287
|
-
(dataPath || '') +
|
|
1288
|
-
".values['" +
|
|
1289
|
-
key1 +
|
|
1290
|
-
"'].hint",
|
|
1291
|
-
schemaPath:
|
|
1292
|
-
'#/definitions/EnumValueLocalization/properties/hint/type',
|
|
1293
|
-
params: {
|
|
1294
|
-
type: 'string',
|
|
1295
|
-
},
|
|
1296
|
-
message: 'should be string',
|
|
1297
|
-
};
|
|
1298
|
-
if (vErrors === null) vErrors = [err];
|
|
1299
|
-
else vErrors.push(err);
|
|
1300
|
-
errors++;
|
|
1301
|
-
}
|
|
1302
|
-
var valid5 = errors === errs_5;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
var valid4 = errors === errs_4;
|
|
1306
|
-
var valid3 = errors === errs_3;
|
|
1307
|
-
valid2 = valid2 || valid3;
|
|
1308
|
-
if (!valid2) {
|
|
1309
|
-
var errs_3 = errors;
|
|
1310
|
-
if (typeof data2 !== 'string') {
|
|
1311
|
-
var err = {
|
|
1312
|
-
keyword: 'type',
|
|
1313
|
-
dataPath: (dataPath || '') + ".values['" + key1 + "']",
|
|
1314
|
-
schemaPath:
|
|
1315
|
-
'#/properties/values/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf/1/type',
|
|
1316
|
-
params: {
|
|
1317
|
-
type: 'string',
|
|
1318
|
-
},
|
|
1319
|
-
message: 'should be string',
|
|
1320
|
-
};
|
|
1321
|
-
if (vErrors === null) vErrors = [err];
|
|
1322
|
-
else vErrors.push(err);
|
|
1323
|
-
errors++;
|
|
1324
|
-
}
|
|
1325
|
-
var valid3 = errors === errs_3;
|
|
1326
|
-
valid2 = valid2 || valid3;
|
|
1327
|
-
if (!valid2) {
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
if (!valid2) {
|
|
1331
|
-
var err = {
|
|
1332
|
-
keyword: 'anyOf',
|
|
1333
|
-
dataPath: (dataPath || '') + ".values['" + key1 + "']",
|
|
1334
|
-
schemaPath:
|
|
1335
|
-
'#/properties/values/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf',
|
|
1336
|
-
params: {},
|
|
1337
|
-
message: 'should match some schema in anyOf',
|
|
1338
|
-
};
|
|
1339
|
-
if (vErrors === null) vErrors = [err];
|
|
1340
|
-
else vErrors.push(err);
|
|
1341
|
-
errors++;
|
|
1342
|
-
} else {
|
|
1343
|
-
errors = errs__2;
|
|
1344
|
-
if (vErrors !== null) {
|
|
1345
|
-
if (errs__2) vErrors.length = errs__2;
|
|
1346
|
-
else vErrors = null;
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
var valid2 = errors === errs_2;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
var valid1 = errors === errs_1;
|
|
1354
|
-
}
|
|
1355
|
-
if (data.label !== undefined) {
|
|
1356
|
-
var errs_1 = errors;
|
|
1357
|
-
if (typeof data.label !== 'string') {
|
|
1358
|
-
var err = {
|
|
1359
|
-
keyword: 'type',
|
|
1360
|
-
dataPath: (dataPath || '') + '.label',
|
|
1361
|
-
schemaPath: '#/properties/label/type',
|
|
1362
|
-
params: {
|
|
1363
|
-
type: 'string',
|
|
1364
|
-
},
|
|
1365
|
-
message: 'should be string',
|
|
1366
|
-
};
|
|
1367
|
-
if (vErrors === null) vErrors = [err];
|
|
1368
|
-
else vErrors.push(err);
|
|
1369
|
-
errors++;
|
|
1370
|
-
}
|
|
1371
|
-
var valid1 = errors === errs_1;
|
|
1372
|
-
}
|
|
1373
|
-
if (data.labelPlural !== undefined) {
|
|
1374
|
-
var errs_1 = errors;
|
|
1375
|
-
if (typeof data.labelPlural !== 'string') {
|
|
1376
|
-
var err = {
|
|
1377
|
-
keyword: 'type',
|
|
1378
|
-
dataPath: (dataPath || '') + '.labelPlural',
|
|
1379
|
-
schemaPath: '#/properties/labelPlural/type',
|
|
1380
|
-
params: {
|
|
1381
|
-
type: 'string',
|
|
1382
|
-
},
|
|
1383
|
-
message: 'should be string',
|
|
1384
|
-
};
|
|
1385
|
-
if (vErrors === null) vErrors = [err];
|
|
1386
|
-
else vErrors.push(err);
|
|
1387
|
-
errors++;
|
|
1388
|
-
}
|
|
1389
|
-
var valid1 = errors === errs_1;
|
|
1390
|
-
}
|
|
1391
|
-
if (data.hint !== undefined) {
|
|
1392
|
-
var errs_1 = errors;
|
|
1393
|
-
if (typeof data.hint !== 'string') {
|
|
1394
|
-
var err = {
|
|
1395
|
-
keyword: 'type',
|
|
1396
|
-
dataPath: (dataPath || '') + '.hint',
|
|
1397
|
-
schemaPath: '#/properties/hint/type',
|
|
1398
|
-
params: {
|
|
1399
|
-
type: 'string',
|
|
1400
|
-
},
|
|
1401
|
-
message: 'should be string',
|
|
1402
|
-
};
|
|
1403
|
-
if (vErrors === null) vErrors = [err];
|
|
1404
|
-
else vErrors.push(err);
|
|
1405
|
-
errors++;
|
|
1406
|
-
}
|
|
1407
|
-
var valid1 = errors === errs_1;
|
|
1408
|
-
}
|
|
1409
|
-
} else {
|
|
1410
|
-
var err = {
|
|
1411
|
-
keyword: 'type',
|
|
1412
|
-
dataPath: (dataPath || '') + '',
|
|
1413
|
-
schemaPath: '#/type',
|
|
1414
|
-
params: {
|
|
1415
|
-
type: 'object',
|
|
1416
|
-
},
|
|
1417
|
-
message: 'should be object',
|
|
1418
|
-
};
|
|
1419
|
-
if (vErrors === null) vErrors = [err];
|
|
1420
|
-
else vErrors.push(err);
|
|
1421
|
-
errors++;
|
|
1422
|
-
}
|
|
1423
|
-
validate.errors = vErrors;
|
|
1424
|
-
return errors === 0;
|
|
1425
|
-
};
|
|
1426
|
-
})();
|
|
1427
|
-
refVal8.schema = {
|
|
1428
|
-
type: 'object',
|
|
1429
|
-
additionalProperties: false,
|
|
1430
|
-
properties: {
|
|
1431
|
-
fields: {
|
|
1432
|
-
patternProperties: {
|
|
1433
|
-
'^[a-zA-Z0-9_]+$': {
|
|
1434
|
-
anyOf: [
|
|
1435
|
-
{
|
|
1436
|
-
$ref: '#/definitions/FieldLocalization',
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
type: 'string',
|
|
1440
|
-
},
|
|
1441
|
-
],
|
|
1442
|
-
},
|
|
1443
|
-
},
|
|
1444
|
-
},
|
|
1445
|
-
values: {
|
|
1446
|
-
patternProperties: {
|
|
1447
|
-
'^[a-zA-Z0-9_]+$': {
|
|
1448
|
-
anyOf: [
|
|
1449
|
-
{
|
|
1450
|
-
$ref: '#/definitions/EnumValueLocalization',
|
|
1451
|
-
},
|
|
1452
|
-
{
|
|
1453
|
-
type: 'string',
|
|
1454
|
-
},
|
|
1455
|
-
],
|
|
1456
|
-
},
|
|
1457
|
-
},
|
|
1458
|
-
},
|
|
1459
|
-
label: {
|
|
1460
|
-
type: 'string',
|
|
1461
|
-
},
|
|
1462
|
-
labelPlural: {
|
|
1463
|
-
type: 'string',
|
|
1464
|
-
},
|
|
1465
|
-
hint: {
|
|
1466
|
-
type: 'string',
|
|
1467
|
-
},
|
|
1468
|
-
},
|
|
1469
|
-
};
|
|
1470
|
-
refVal8.errors = null;
|
|
1471
|
-
refVal[8] = refVal8;
|
|
1472
|
-
var refVal9 = {
|
|
1473
|
-
properties: {
|
|
1474
|
-
label: {
|
|
1475
|
-
type: 'string',
|
|
1476
|
-
},
|
|
1477
|
-
hint: {
|
|
1478
|
-
type: 'string',
|
|
1479
|
-
},
|
|
1480
|
-
},
|
|
1481
|
-
};
|
|
1482
|
-
refVal[9] = refVal9;
|
|
1483
|
-
var refVal10 = {
|
|
1484
|
-
properties: {
|
|
1485
|
-
label: {
|
|
1486
|
-
type: 'string',
|
|
1487
|
-
},
|
|
1488
|
-
hint: {
|
|
1489
|
-
type: 'string',
|
|
1490
|
-
},
|
|
1491
|
-
},
|
|
1492
|
-
};
|
|
1493
|
-
refVal[10] = refVal10;
|
|
1494
|
-
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
|
1495
|
-
'use strict';
|
|
1496
|
-
var vErrors = null;
|
|
1497
|
-
var errors = 0;
|
|
1498
|
-
if (rootData === undefined) rootData = data;
|
|
1499
|
-
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
1500
|
-
if (Object.keys(data).length < 1) {
|
|
1501
|
-
var err = {
|
|
1502
|
-
keyword: 'minProperties',
|
|
1503
|
-
dataPath: (dataPath || '') + '',
|
|
1504
|
-
schemaPath: '#/minProperties',
|
|
1505
|
-
params: {
|
|
1506
|
-
limit: 1,
|
|
1507
|
-
},
|
|
1508
|
-
message: 'should NOT have fewer than 1 properties',
|
|
1509
|
-
};
|
|
1510
|
-
if (vErrors === null) vErrors = [err];
|
|
1511
|
-
else vErrors.push(err);
|
|
1512
|
-
errors++;
|
|
1513
|
-
}
|
|
1514
|
-
var errs__0 = errors;
|
|
1515
|
-
var valid1 = true;
|
|
1516
|
-
for (var key0 in data) {
|
|
1517
|
-
var isAdditional0 = !(
|
|
1518
|
-
false ||
|
|
1519
|
-
key0 == 'permissionProfiles' ||
|
|
1520
|
-
key0 == 'i18n' ||
|
|
1521
|
-
key0 == 'billing' ||
|
|
1522
|
-
key0 == 'timeToLive'
|
|
1523
|
-
);
|
|
1524
|
-
if (isAdditional0) {
|
|
1525
|
-
valid1 = false;
|
|
1526
|
-
var err = {
|
|
1527
|
-
keyword: 'additionalProperties',
|
|
1528
|
-
dataPath: (dataPath || '') + '',
|
|
1529
|
-
schemaPath: '#/additionalProperties',
|
|
1530
|
-
params: {
|
|
1531
|
-
additionalProperty: '' + key0 + '',
|
|
1532
|
-
},
|
|
1533
|
-
message: 'should NOT have additional properties',
|
|
1534
|
-
};
|
|
1535
|
-
if (vErrors === null) vErrors = [err];
|
|
1536
|
-
else vErrors.push(err);
|
|
1537
|
-
errors++;
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
var data1 = data.permissionProfiles;
|
|
1541
|
-
if (data1 !== undefined) {
|
|
1542
|
-
var errs_1 = errors;
|
|
1543
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
1544
|
-
var errs__1 = errors;
|
|
1545
|
-
var valid2 = true;
|
|
1546
|
-
for (var key1 in data1) {
|
|
1547
|
-
var isAdditional1 = !(false || pattern0.test(key1));
|
|
1548
|
-
if (isAdditional1) {
|
|
1549
|
-
valid2 = false;
|
|
1550
|
-
var err = {
|
|
1551
|
-
keyword: 'additionalProperties',
|
|
1552
|
-
dataPath: (dataPath || '') + '.permissionProfiles',
|
|
1553
|
-
schemaPath: '#/properties/permissionProfiles/additionalProperties',
|
|
1554
|
-
params: {
|
|
1555
|
-
additionalProperty: '' + key1 + '',
|
|
1556
|
-
},
|
|
1557
|
-
message: 'should NOT have additional properties',
|
|
1558
|
-
};
|
|
1559
|
-
if (vErrors === null) vErrors = [err];
|
|
1560
|
-
else vErrors.push(err);
|
|
1561
|
-
errors++;
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
for (var key1 in data1) {
|
|
1565
|
-
if (pattern0.test(key1)) {
|
|
1566
|
-
var errs_2 = errors;
|
|
1567
|
-
if (
|
|
1568
|
-
!refVal1(
|
|
1569
|
-
data1[key1],
|
|
1570
|
-
(dataPath || '') + ".permissionProfiles['" + key1 + "']",
|
|
1571
|
-
data1,
|
|
1572
|
-
key1,
|
|
1573
|
-
rootData,
|
|
1574
|
-
)
|
|
1575
|
-
) {
|
|
1576
|
-
if (vErrors === null) vErrors = refVal1.errors;
|
|
1577
|
-
else vErrors = vErrors.concat(refVal1.errors);
|
|
1578
|
-
errors = vErrors.length;
|
|
1579
|
-
}
|
|
1580
|
-
var valid2 = errors === errs_2;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
} else {
|
|
1584
|
-
var err = {
|
|
1585
|
-
keyword: 'type',
|
|
1586
|
-
dataPath: (dataPath || '') + '.permissionProfiles',
|
|
1587
|
-
schemaPath: '#/properties/permissionProfiles/type',
|
|
1588
|
-
params: {
|
|
1589
|
-
type: 'object',
|
|
1590
|
-
},
|
|
1591
|
-
message: 'should be object',
|
|
1592
|
-
};
|
|
1593
|
-
if (vErrors === null) vErrors = [err];
|
|
1594
|
-
else vErrors.push(err);
|
|
1595
|
-
errors++;
|
|
1596
|
-
}
|
|
1597
|
-
var valid1 = errors === errs_1;
|
|
1598
|
-
}
|
|
1599
|
-
var data1 = data.i18n;
|
|
1600
|
-
if (data1 !== undefined) {
|
|
1601
|
-
var errs_1 = errors;
|
|
1602
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
1603
|
-
var errs__1 = errors;
|
|
1604
|
-
var valid2 = true;
|
|
1605
|
-
for (var key1 in data1) {
|
|
1606
|
-
var isAdditional1 = !(false || pattern2.test(key1));
|
|
1607
|
-
if (isAdditional1) {
|
|
1608
|
-
valid2 = false;
|
|
1609
|
-
var err = {
|
|
1610
|
-
keyword: 'additionalProperties',
|
|
1611
|
-
dataPath: (dataPath || '') + '.i18n',
|
|
1612
|
-
schemaPath: '#/properties/i18n/additionalProperties',
|
|
1613
|
-
params: {
|
|
1614
|
-
additionalProperty: '' + key1 + '',
|
|
1615
|
-
},
|
|
1616
|
-
message: 'should NOT have additional properties',
|
|
1617
|
-
};
|
|
1618
|
-
if (vErrors === null) vErrors = [err];
|
|
1619
|
-
else vErrors.push(err);
|
|
1620
|
-
errors++;
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
for (var key1 in data1) {
|
|
1624
|
-
if (pattern2.test(key1)) {
|
|
1625
|
-
var errs_2 = errors;
|
|
1626
|
-
if (
|
|
1627
|
-
!refVal7(
|
|
1628
|
-
data1[key1],
|
|
1629
|
-
(dataPath || '') + ".i18n['" + key1 + "']",
|
|
1630
|
-
data1,
|
|
1631
|
-
key1,
|
|
1632
|
-
rootData,
|
|
1633
|
-
)
|
|
1634
|
-
) {
|
|
1635
|
-
if (vErrors === null) vErrors = refVal7.errors;
|
|
1636
|
-
else vErrors = vErrors.concat(refVal7.errors);
|
|
1637
|
-
errors = vErrors.length;
|
|
1638
|
-
}
|
|
1639
|
-
var valid2 = errors === errs_2;
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
} else {
|
|
1643
|
-
var err = {
|
|
1644
|
-
keyword: 'type',
|
|
1645
|
-
dataPath: (dataPath || '') + '.i18n',
|
|
1646
|
-
schemaPath: '#/properties/i18n/type',
|
|
1647
|
-
params: {
|
|
1648
|
-
type: 'object',
|
|
1649
|
-
},
|
|
1650
|
-
message: 'should be object',
|
|
1651
|
-
};
|
|
1652
|
-
if (vErrors === null) vErrors = [err];
|
|
1653
|
-
else vErrors.push(err);
|
|
1654
|
-
errors++;
|
|
1655
|
-
}
|
|
1656
|
-
var valid1 = errors === errs_1;
|
|
1657
|
-
}
|
|
1658
|
-
var data1 = data.billing;
|
|
1659
|
-
if (data1 !== undefined) {
|
|
1660
|
-
var errs_1 = errors;
|
|
1661
|
-
if (data1 && typeof data1 === 'object' && !Array.isArray(data1)) {
|
|
1662
|
-
var errs__1 = errors;
|
|
1663
|
-
var valid2 = true;
|
|
1664
|
-
for (var key1 in data1) {
|
|
1665
|
-
var isAdditional1 = !(false || key1 == 'billingEntities');
|
|
1666
|
-
if (isAdditional1) {
|
|
1667
|
-
valid2 = false;
|
|
1668
|
-
var err = {
|
|
1669
|
-
keyword: 'additionalProperties',
|
|
1670
|
-
dataPath: (dataPath || '') + '.billing',
|
|
1671
|
-
schemaPath: '#/properties/billing/additionalProperties',
|
|
1672
|
-
params: {
|
|
1673
|
-
additionalProperty: '' + key1 + '',
|
|
1674
|
-
},
|
|
1675
|
-
message: 'should NOT have additional properties',
|
|
1676
|
-
};
|
|
1677
|
-
if (vErrors === null) vErrors = [err];
|
|
1678
|
-
else vErrors.push(err);
|
|
1679
|
-
errors++;
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
var data2 = data1.billingEntities;
|
|
1683
|
-
if (data2 !== undefined) {
|
|
1684
|
-
var errs_2 = errors;
|
|
1685
|
-
if (Array.isArray(data2)) {
|
|
1686
|
-
var errs__2 = errors;
|
|
1687
|
-
var valid2;
|
|
1688
|
-
for (var i2 = 0; i2 < data2.length; i2++) {
|
|
1689
|
-
var data3 = data2[i2];
|
|
1690
|
-
var errs_3 = errors;
|
|
1691
|
-
if (data3 && typeof data3 === 'object' && !Array.isArray(data3)) {
|
|
1692
|
-
var errs__3 = errors;
|
|
1693
|
-
var valid4 = true;
|
|
1694
|
-
for (var key3 in data3) {
|
|
1695
|
-
var isAdditional3 = !(
|
|
1696
|
-
false ||
|
|
1697
|
-
key3 == 'typeName' ||
|
|
1698
|
-
key3 == 'keyFieldName' ||
|
|
1699
|
-
key3 == 'quantityFieldName' ||
|
|
1700
|
-
key3 == 'category' ||
|
|
1701
|
-
key3 == 'categoryMapping'
|
|
1702
|
-
);
|
|
1703
|
-
if (isAdditional3) {
|
|
1704
|
-
valid4 = false;
|
|
1705
|
-
var err = {
|
|
1706
|
-
keyword: 'additionalProperties',
|
|
1707
|
-
dataPath:
|
|
1708
|
-
(dataPath || '') +
|
|
1709
|
-
'.billing.billingEntities[' +
|
|
1710
|
-
i2 +
|
|
1711
|
-
']',
|
|
1712
|
-
schemaPath:
|
|
1713
|
-
'#/properties/billing/properties/billingEntities/items/additionalProperties',
|
|
1714
|
-
params: {
|
|
1715
|
-
additionalProperty: '' + key3 + '',
|
|
1716
|
-
},
|
|
1717
|
-
message: 'should NOT have additional properties',
|
|
1718
|
-
};
|
|
1719
|
-
if (vErrors === null) vErrors = [err];
|
|
1720
|
-
else vErrors.push(err);
|
|
1721
|
-
errors++;
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
var data4 = data3.typeName;
|
|
1725
|
-
if (data4 === undefined) {
|
|
1726
|
-
valid4 = false;
|
|
1727
|
-
var err = {
|
|
1728
|
-
keyword: 'required',
|
|
1729
|
-
dataPath:
|
|
1730
|
-
(dataPath || '') +
|
|
1731
|
-
'.billing.billingEntities[' +
|
|
1732
|
-
i2 +
|
|
1733
|
-
']',
|
|
1734
|
-
schemaPath:
|
|
1735
|
-
'#/properties/billing/properties/billingEntities/items/required',
|
|
1736
|
-
params: {
|
|
1737
|
-
missingProperty: 'typeName',
|
|
1738
|
-
},
|
|
1739
|
-
message: "should have required property 'typeName'",
|
|
1740
|
-
};
|
|
1741
|
-
if (vErrors === null) vErrors = [err];
|
|
1742
|
-
else vErrors.push(err);
|
|
1743
|
-
errors++;
|
|
1744
|
-
} else {
|
|
1745
|
-
var errs_4 = errors;
|
|
1746
|
-
if (typeof data4 === 'string') {
|
|
1747
|
-
if (!pattern2.test(data4)) {
|
|
1748
|
-
var err = {
|
|
1749
|
-
keyword: 'pattern',
|
|
1750
|
-
dataPath:
|
|
1751
|
-
(dataPath || '') +
|
|
1752
|
-
'.billing.billingEntities[' +
|
|
1753
|
-
i2 +
|
|
1754
|
-
'].typeName',
|
|
1755
|
-
schemaPath:
|
|
1756
|
-
'#/properties/billing/properties/billingEntities/items/properties/typeName/pattern',
|
|
1757
|
-
params: {
|
|
1758
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
1759
|
-
},
|
|
1760
|
-
message:
|
|
1761
|
-
'should match pattern "^[a-zA-Z0-9_-]+$"',
|
|
1762
|
-
};
|
|
1763
|
-
if (vErrors === null) vErrors = [err];
|
|
1764
|
-
else vErrors.push(err);
|
|
1765
|
-
errors++;
|
|
1766
|
-
}
|
|
1767
|
-
} else {
|
|
1768
|
-
var err = {
|
|
1769
|
-
keyword: 'type',
|
|
1770
|
-
dataPath:
|
|
1771
|
-
(dataPath || '') +
|
|
1772
|
-
'.billing.billingEntities[' +
|
|
1773
|
-
i2 +
|
|
1774
|
-
'].typeName',
|
|
1775
|
-
schemaPath:
|
|
1776
|
-
'#/properties/billing/properties/billingEntities/items/properties/typeName/type',
|
|
1777
|
-
params: {
|
|
1778
|
-
type: 'string',
|
|
1779
|
-
},
|
|
1780
|
-
message: 'should be string',
|
|
1781
|
-
};
|
|
1782
|
-
if (vErrors === null) vErrors = [err];
|
|
1783
|
-
else vErrors.push(err);
|
|
1784
|
-
errors++;
|
|
1785
|
-
}
|
|
1786
|
-
var valid4 = errors === errs_4;
|
|
1787
|
-
}
|
|
1788
|
-
var data4 = data3.keyFieldName;
|
|
1789
|
-
if (data4 !== undefined) {
|
|
1790
|
-
var errs_4 = errors;
|
|
1791
|
-
if (typeof data4 === 'string') {
|
|
1792
|
-
if (!pattern2.test(data4)) {
|
|
1793
|
-
var err = {
|
|
1794
|
-
keyword: 'pattern',
|
|
1795
|
-
dataPath:
|
|
1796
|
-
(dataPath || '') +
|
|
1797
|
-
'.billing.billingEntities[' +
|
|
1798
|
-
i2 +
|
|
1799
|
-
'].keyFieldName',
|
|
1800
|
-
schemaPath:
|
|
1801
|
-
'#/properties/billing/properties/billingEntities/items/properties/keyFieldName/pattern',
|
|
1802
|
-
params: {
|
|
1803
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
1804
|
-
},
|
|
1805
|
-
message:
|
|
1806
|
-
'should match pattern "^[a-zA-Z0-9_-]+$"',
|
|
1807
|
-
};
|
|
1808
|
-
if (vErrors === null) vErrors = [err];
|
|
1809
|
-
else vErrors.push(err);
|
|
1810
|
-
errors++;
|
|
1811
|
-
}
|
|
1812
|
-
} else {
|
|
1813
|
-
var err = {
|
|
1814
|
-
keyword: 'type',
|
|
1815
|
-
dataPath:
|
|
1816
|
-
(dataPath || '') +
|
|
1817
|
-
'.billing.billingEntities[' +
|
|
1818
|
-
i2 +
|
|
1819
|
-
'].keyFieldName',
|
|
1820
|
-
schemaPath:
|
|
1821
|
-
'#/properties/billing/properties/billingEntities/items/properties/keyFieldName/type',
|
|
1822
|
-
params: {
|
|
1823
|
-
type: 'string',
|
|
1824
|
-
},
|
|
1825
|
-
message: 'should be string',
|
|
1826
|
-
};
|
|
1827
|
-
if (vErrors === null) vErrors = [err];
|
|
1828
|
-
else vErrors.push(err);
|
|
1829
|
-
errors++;
|
|
1830
|
-
}
|
|
1831
|
-
var valid4 = errors === errs_4;
|
|
1832
|
-
}
|
|
1833
|
-
if (data3.quantityFieldName !== undefined) {
|
|
1834
|
-
var errs_4 = errors;
|
|
1835
|
-
if (typeof data3.quantityFieldName !== 'string') {
|
|
1836
|
-
var err = {
|
|
1837
|
-
keyword: 'type',
|
|
1838
|
-
dataPath:
|
|
1839
|
-
(dataPath || '') +
|
|
1840
|
-
'.billing.billingEntities[' +
|
|
1841
|
-
i2 +
|
|
1842
|
-
'].quantityFieldName',
|
|
1843
|
-
schemaPath:
|
|
1844
|
-
'#/properties/billing/properties/billingEntities/items/properties/quantityFieldName/type',
|
|
1845
|
-
params: {
|
|
1846
|
-
type: 'string',
|
|
1847
|
-
},
|
|
1848
|
-
message: 'should be string',
|
|
1849
|
-
};
|
|
1850
|
-
if (vErrors === null) vErrors = [err];
|
|
1851
|
-
else vErrors.push(err);
|
|
1852
|
-
errors++;
|
|
1853
|
-
}
|
|
1854
|
-
var valid4 = errors === errs_4;
|
|
1855
|
-
}
|
|
1856
|
-
if (data3.category !== undefined) {
|
|
1857
|
-
var errs_4 = errors;
|
|
1858
|
-
if (typeof data3.category !== 'string') {
|
|
1859
|
-
var err = {
|
|
1860
|
-
keyword: 'type',
|
|
1861
|
-
dataPath:
|
|
1862
|
-
(dataPath || '') +
|
|
1863
|
-
'.billing.billingEntities[' +
|
|
1864
|
-
i2 +
|
|
1865
|
-
'].category',
|
|
1866
|
-
schemaPath:
|
|
1867
|
-
'#/properties/billing/properties/billingEntities/items/properties/category/type',
|
|
1868
|
-
params: {
|
|
1869
|
-
type: 'string',
|
|
1870
|
-
},
|
|
1871
|
-
message: 'should be string',
|
|
1872
|
-
};
|
|
1873
|
-
if (vErrors === null) vErrors = [err];
|
|
1874
|
-
else vErrors.push(err);
|
|
1875
|
-
errors++;
|
|
1876
|
-
}
|
|
1877
|
-
var valid4 = errors === errs_4;
|
|
1878
|
-
}
|
|
1879
|
-
var data4 = data3.categoryMapping;
|
|
1880
|
-
if (data4 !== undefined) {
|
|
1881
|
-
var errs_4 = errors;
|
|
1882
|
-
if (
|
|
1883
|
-
data4 &&
|
|
1884
|
-
typeof data4 === 'object' &&
|
|
1885
|
-
!Array.isArray(data4)
|
|
1886
|
-
) {
|
|
1887
|
-
var errs__4 = errors;
|
|
1888
|
-
var valid5 = true;
|
|
1889
|
-
for (var key4 in data4) {
|
|
1890
|
-
var isAdditional4 = !(
|
|
1891
|
-
false ||
|
|
1892
|
-
key4 == 'fieldName' ||
|
|
1893
|
-
key4 == 'defaultValue' ||
|
|
1894
|
-
key4 == 'values'
|
|
1895
|
-
);
|
|
1896
|
-
if (isAdditional4) {
|
|
1897
|
-
valid5 = false;
|
|
1898
|
-
var err = {
|
|
1899
|
-
keyword: 'additionalProperties',
|
|
1900
|
-
dataPath:
|
|
1901
|
-
(dataPath || '') +
|
|
1902
|
-
'.billing.billingEntities[' +
|
|
1903
|
-
i2 +
|
|
1904
|
-
'].categoryMapping',
|
|
1905
|
-
schemaPath:
|
|
1906
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/additionalProperties',
|
|
1907
|
-
params: {
|
|
1908
|
-
additionalProperty: '' + key4 + '',
|
|
1909
|
-
},
|
|
1910
|
-
message:
|
|
1911
|
-
'should NOT have additional properties',
|
|
1912
|
-
};
|
|
1913
|
-
if (vErrors === null) vErrors = [err];
|
|
1914
|
-
else vErrors.push(err);
|
|
1915
|
-
errors++;
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
if (data4.fieldName === undefined) {
|
|
1919
|
-
valid5 = false;
|
|
1920
|
-
var err = {
|
|
1921
|
-
keyword: 'required',
|
|
1922
|
-
dataPath:
|
|
1923
|
-
(dataPath || '') +
|
|
1924
|
-
'.billing.billingEntities[' +
|
|
1925
|
-
i2 +
|
|
1926
|
-
'].categoryMapping',
|
|
1927
|
-
schemaPath:
|
|
1928
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/required',
|
|
1929
|
-
params: {
|
|
1930
|
-
missingProperty: 'fieldName',
|
|
1931
|
-
},
|
|
1932
|
-
message:
|
|
1933
|
-
"should have required property 'fieldName'",
|
|
1934
|
-
};
|
|
1935
|
-
if (vErrors === null) vErrors = [err];
|
|
1936
|
-
else vErrors.push(err);
|
|
1937
|
-
errors++;
|
|
1938
|
-
} else {
|
|
1939
|
-
var errs_5 = errors;
|
|
1940
|
-
if (typeof data4.fieldName !== 'string') {
|
|
1941
|
-
var err = {
|
|
1942
|
-
keyword: 'type',
|
|
1943
|
-
dataPath:
|
|
1944
|
-
(dataPath || '') +
|
|
1945
|
-
'.billing.billingEntities[' +
|
|
1946
|
-
i2 +
|
|
1947
|
-
'].categoryMapping.fieldName',
|
|
1948
|
-
schemaPath:
|
|
1949
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/fieldName/type',
|
|
1950
|
-
params: {
|
|
1951
|
-
type: 'string',
|
|
1952
|
-
},
|
|
1953
|
-
message: 'should be string',
|
|
1954
|
-
};
|
|
1955
|
-
if (vErrors === null) vErrors = [err];
|
|
1956
|
-
else vErrors.push(err);
|
|
1957
|
-
errors++;
|
|
1958
|
-
}
|
|
1959
|
-
var valid5 = errors === errs_5;
|
|
1960
|
-
}
|
|
1961
|
-
var data5 = data4.defaultValue;
|
|
1962
|
-
if (data5 === undefined) {
|
|
1963
|
-
valid5 = false;
|
|
1964
|
-
var err = {
|
|
1965
|
-
keyword: 'required',
|
|
1966
|
-
dataPath:
|
|
1967
|
-
(dataPath || '') +
|
|
1968
|
-
'.billing.billingEntities[' +
|
|
1969
|
-
i2 +
|
|
1970
|
-
'].categoryMapping',
|
|
1971
|
-
schemaPath:
|
|
1972
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/required',
|
|
1973
|
-
params: {
|
|
1974
|
-
missingProperty: 'defaultValue',
|
|
1975
|
-
},
|
|
1976
|
-
message:
|
|
1977
|
-
"should have required property 'defaultValue'",
|
|
1978
|
-
};
|
|
1979
|
-
if (vErrors === null) vErrors = [err];
|
|
1980
|
-
else vErrors.push(err);
|
|
1981
|
-
errors++;
|
|
1982
|
-
} else {
|
|
1983
|
-
var errs_5 = errors;
|
|
1984
|
-
if (typeof data5 === 'string') {
|
|
1985
|
-
if (!pattern2.test(data5)) {
|
|
1986
|
-
var err = {
|
|
1987
|
-
keyword: 'pattern',
|
|
1988
|
-
dataPath:
|
|
1989
|
-
(dataPath || '') +
|
|
1990
|
-
'.billing.billingEntities[' +
|
|
1991
|
-
i2 +
|
|
1992
|
-
'].categoryMapping.defaultValue',
|
|
1993
|
-
schemaPath:
|
|
1994
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/defaultValue/pattern',
|
|
1995
|
-
params: {
|
|
1996
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
1997
|
-
},
|
|
1998
|
-
message:
|
|
1999
|
-
'should match pattern "^[a-zA-Z0-9_-]+$"',
|
|
2000
|
-
};
|
|
2001
|
-
if (vErrors === null) vErrors = [err];
|
|
2002
|
-
else vErrors.push(err);
|
|
2003
|
-
errors++;
|
|
2004
|
-
}
|
|
2005
|
-
} else {
|
|
2006
|
-
var err = {
|
|
2007
|
-
keyword: 'type',
|
|
2008
|
-
dataPath:
|
|
2009
|
-
(dataPath || '') +
|
|
2010
|
-
'.billing.billingEntities[' +
|
|
2011
|
-
i2 +
|
|
2012
|
-
'].categoryMapping.defaultValue',
|
|
2013
|
-
schemaPath:
|
|
2014
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/defaultValue/type',
|
|
2015
|
-
params: {
|
|
2016
|
-
type: 'string',
|
|
2017
|
-
},
|
|
2018
|
-
message: 'should be string',
|
|
2019
|
-
};
|
|
2020
|
-
if (vErrors === null) vErrors = [err];
|
|
2021
|
-
else vErrors.push(err);
|
|
2022
|
-
errors++;
|
|
2023
|
-
}
|
|
2024
|
-
var valid5 = errors === errs_5;
|
|
2025
|
-
}
|
|
2026
|
-
var data5 = data4.values;
|
|
2027
|
-
if (data5 === undefined) {
|
|
2028
|
-
valid5 = false;
|
|
2029
|
-
var err = {
|
|
2030
|
-
keyword: 'required',
|
|
2031
|
-
dataPath:
|
|
2032
|
-
(dataPath || '') +
|
|
2033
|
-
'.billing.billingEntities[' +
|
|
2034
|
-
i2 +
|
|
2035
|
-
'].categoryMapping',
|
|
2036
|
-
schemaPath:
|
|
2037
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/required',
|
|
2038
|
-
params: {
|
|
2039
|
-
missingProperty: 'values',
|
|
2040
|
-
},
|
|
2041
|
-
message:
|
|
2042
|
-
"should have required property 'values'",
|
|
2043
|
-
};
|
|
2044
|
-
if (vErrors === null) vErrors = [err];
|
|
2045
|
-
else vErrors.push(err);
|
|
2046
|
-
errors++;
|
|
2047
|
-
} else {
|
|
2048
|
-
var errs_5 = errors;
|
|
2049
|
-
if (
|
|
2050
|
-
data5 &&
|
|
2051
|
-
typeof data5 === 'object' &&
|
|
2052
|
-
!Array.isArray(data5)
|
|
2053
|
-
) {
|
|
2054
|
-
var errs__5 = errors;
|
|
2055
|
-
var valid6 = true;
|
|
2056
|
-
for (var key5 in data5) {
|
|
2057
|
-
var errs_6 = errors;
|
|
2058
|
-
if (typeof data5[key5] !== 'string') {
|
|
2059
|
-
var err = {
|
|
2060
|
-
keyword: 'type',
|
|
2061
|
-
dataPath:
|
|
2062
|
-
(dataPath || '') +
|
|
2063
|
-
'.billing.billingEntities[' +
|
|
2064
|
-
i2 +
|
|
2065
|
-
"].categoryMapping.values['" +
|
|
2066
|
-
key5 +
|
|
2067
|
-
"']",
|
|
2068
|
-
schemaPath:
|
|
2069
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/values/additionalProperties/type',
|
|
2070
|
-
params: {
|
|
2071
|
-
type: 'string',
|
|
2072
|
-
},
|
|
2073
|
-
message: 'should be string',
|
|
2074
|
-
};
|
|
2075
|
-
if (vErrors === null) vErrors = [err];
|
|
2076
|
-
else vErrors.push(err);
|
|
2077
|
-
errors++;
|
|
2078
|
-
}
|
|
2079
|
-
var valid6 = errors === errs_6;
|
|
2080
|
-
}
|
|
2081
|
-
} else {
|
|
2082
|
-
var err = {
|
|
2083
|
-
keyword: 'type',
|
|
2084
|
-
dataPath:
|
|
2085
|
-
(dataPath || '') +
|
|
2086
|
-
'.billing.billingEntities[' +
|
|
2087
|
-
i2 +
|
|
2088
|
-
'].categoryMapping.values',
|
|
2089
|
-
schemaPath:
|
|
2090
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/values/type',
|
|
2091
|
-
params: {
|
|
2092
|
-
type: 'object',
|
|
2093
|
-
},
|
|
2094
|
-
message: 'should be object',
|
|
2095
|
-
};
|
|
2096
|
-
if (vErrors === null) vErrors = [err];
|
|
2097
|
-
else vErrors.push(err);
|
|
2098
|
-
errors++;
|
|
2099
|
-
}
|
|
2100
|
-
var valid5 = errors === errs_5;
|
|
2101
|
-
}
|
|
2102
|
-
} else {
|
|
2103
|
-
var err = {
|
|
2104
|
-
keyword: 'type',
|
|
2105
|
-
dataPath:
|
|
2106
|
-
(dataPath || '') +
|
|
2107
|
-
'.billing.billingEntities[' +
|
|
2108
|
-
i2 +
|
|
2109
|
-
'].categoryMapping',
|
|
2110
|
-
schemaPath:
|
|
2111
|
-
'#/properties/billing/properties/billingEntities/items/properties/categoryMapping/type',
|
|
2112
|
-
params: {
|
|
2113
|
-
type: 'object',
|
|
2114
|
-
},
|
|
2115
|
-
message: 'should be object',
|
|
2116
|
-
};
|
|
2117
|
-
if (vErrors === null) vErrors = [err];
|
|
2118
|
-
else vErrors.push(err);
|
|
2119
|
-
errors++;
|
|
2120
|
-
}
|
|
2121
|
-
var valid4 = errors === errs_4;
|
|
2122
|
-
}
|
|
2123
|
-
} else {
|
|
2124
|
-
var err = {
|
|
2125
|
-
keyword: 'type',
|
|
2126
|
-
dataPath:
|
|
2127
|
-
(dataPath || '') +
|
|
2128
|
-
'.billing.billingEntities[' +
|
|
2129
|
-
i2 +
|
|
2130
|
-
']',
|
|
2131
|
-
schemaPath:
|
|
2132
|
-
'#/properties/billing/properties/billingEntities/items/type',
|
|
2133
|
-
params: {
|
|
2134
|
-
type: 'object',
|
|
2135
|
-
},
|
|
2136
|
-
message: 'should be object',
|
|
2137
|
-
};
|
|
2138
|
-
if (vErrors === null) vErrors = [err];
|
|
2139
|
-
else vErrors.push(err);
|
|
2140
|
-
errors++;
|
|
2141
|
-
}
|
|
2142
|
-
var valid3 = errors === errs_3;
|
|
2143
|
-
}
|
|
2144
|
-
} else {
|
|
2145
|
-
var err = {
|
|
2146
|
-
keyword: 'type',
|
|
2147
|
-
dataPath: (dataPath || '') + '.billing.billingEntities',
|
|
2148
|
-
schemaPath: '#/properties/billing/properties/billingEntities/type',
|
|
2149
|
-
params: {
|
|
2150
|
-
type: 'array',
|
|
2151
|
-
},
|
|
2152
|
-
message: 'should be array',
|
|
2153
|
-
};
|
|
2154
|
-
if (vErrors === null) vErrors = [err];
|
|
2155
|
-
else vErrors.push(err);
|
|
2156
|
-
errors++;
|
|
2157
|
-
}
|
|
2158
|
-
var valid2 = errors === errs_2;
|
|
2159
|
-
}
|
|
2160
|
-
} else {
|
|
2161
|
-
var err = {
|
|
2162
|
-
keyword: 'type',
|
|
2163
|
-
dataPath: (dataPath || '') + '.billing',
|
|
2164
|
-
schemaPath: '#/properties/billing/type',
|
|
2165
|
-
params: {
|
|
2166
|
-
type: 'object',
|
|
2167
|
-
},
|
|
2168
|
-
message: 'should be object',
|
|
2169
|
-
};
|
|
2170
|
-
if (vErrors === null) vErrors = [err];
|
|
2171
|
-
else vErrors.push(err);
|
|
2172
|
-
errors++;
|
|
2173
|
-
}
|
|
2174
|
-
var valid1 = errors === errs_1;
|
|
2175
|
-
}
|
|
2176
|
-
var data1 = data.timeToLive;
|
|
2177
|
-
if (data1 !== undefined) {
|
|
2178
|
-
var errs_1 = errors;
|
|
2179
|
-
if (Array.isArray(data1)) {
|
|
2180
|
-
var errs__1 = errors;
|
|
2181
|
-
var valid1;
|
|
2182
|
-
for (var i1 = 0; i1 < data1.length; i1++) {
|
|
2183
|
-
var data2 = data1[i1];
|
|
2184
|
-
var errs_2 = errors;
|
|
2185
|
-
if (data2 && typeof data2 === 'object' && !Array.isArray(data2)) {
|
|
2186
|
-
if (data2.typeName === undefined) {
|
|
2187
|
-
var err = {
|
|
2188
|
-
keyword: 'required',
|
|
2189
|
-
dataPath: (dataPath || '') + '.timeToLive[' + i1 + ']',
|
|
2190
|
-
schemaPath: '#/properties/timeToLive/items/required',
|
|
2191
|
-
params: {
|
|
2192
|
-
missingProperty: 'typeName',
|
|
2193
|
-
},
|
|
2194
|
-
message: "should have required property 'typeName'",
|
|
2195
|
-
};
|
|
2196
|
-
if (vErrors === null) vErrors = [err];
|
|
2197
|
-
else vErrors.push(err);
|
|
2198
|
-
errors++;
|
|
2199
|
-
}
|
|
2200
|
-
if (data2.dateField === undefined) {
|
|
2201
|
-
var err = {
|
|
2202
|
-
keyword: 'required',
|
|
2203
|
-
dataPath: (dataPath || '') + '.timeToLive[' + i1 + ']',
|
|
2204
|
-
schemaPath: '#/properties/timeToLive/items/required',
|
|
2205
|
-
params: {
|
|
2206
|
-
missingProperty: 'dateField',
|
|
2207
|
-
},
|
|
2208
|
-
message: "should have required property 'dateField'",
|
|
2209
|
-
};
|
|
2210
|
-
if (vErrors === null) vErrors = [err];
|
|
2211
|
-
else vErrors.push(err);
|
|
2212
|
-
errors++;
|
|
2213
|
-
}
|
|
2214
|
-
var errs__2 = errors;
|
|
2215
|
-
var valid3 = true;
|
|
2216
|
-
var data3 = data2['typeName:'];
|
|
2217
|
-
if (data3 !== undefined) {
|
|
2218
|
-
var errs_3 = errors;
|
|
2219
|
-
if (typeof data3 === 'string') {
|
|
2220
|
-
if (!pattern2.test(data3)) {
|
|
2221
|
-
var err = {
|
|
2222
|
-
keyword: 'pattern',
|
|
2223
|
-
dataPath:
|
|
2224
|
-
(dataPath || '') +
|
|
2225
|
-
'.timeToLive[' +
|
|
2226
|
-
i1 +
|
|
2227
|
-
"]['typeName:']",
|
|
2228
|
-
schemaPath:
|
|
2229
|
-
'#/properties/timeToLive/items/properties/typeName%3A/pattern',
|
|
2230
|
-
params: {
|
|
2231
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
2232
|
-
},
|
|
2233
|
-
message: 'should match pattern "^[a-zA-Z0-9_-]+$"',
|
|
2234
|
-
};
|
|
2235
|
-
if (vErrors === null) vErrors = [err];
|
|
2236
|
-
else vErrors.push(err);
|
|
2237
|
-
errors++;
|
|
2238
|
-
}
|
|
2239
|
-
} else {
|
|
2240
|
-
var err = {
|
|
2241
|
-
keyword: 'type',
|
|
2242
|
-
dataPath:
|
|
2243
|
-
(dataPath || '') +
|
|
2244
|
-
'.timeToLive[' +
|
|
2245
|
-
i1 +
|
|
2246
|
-
"]['typeName:']",
|
|
2247
|
-
schemaPath:
|
|
2248
|
-
'#/properties/timeToLive/items/properties/typeName%3A/type',
|
|
2249
|
-
params: {
|
|
2250
|
-
type: 'string',
|
|
2251
|
-
},
|
|
2252
|
-
message: 'should be string',
|
|
2253
|
-
};
|
|
2254
|
-
if (vErrors === null) vErrors = [err];
|
|
2255
|
-
else vErrors.push(err);
|
|
2256
|
-
errors++;
|
|
2257
|
-
}
|
|
2258
|
-
var valid3 = errors === errs_3;
|
|
2259
|
-
}
|
|
2260
|
-
var data3 = data2['dateField:'];
|
|
2261
|
-
if (data3 !== undefined) {
|
|
2262
|
-
var errs_3 = errors;
|
|
2263
|
-
if (typeof data3 === 'string') {
|
|
2264
|
-
if (!pattern4.test(data3)) {
|
|
2265
|
-
var err = {
|
|
2266
|
-
keyword: 'pattern',
|
|
2267
|
-
dataPath:
|
|
2268
|
-
(dataPath || '') +
|
|
2269
|
-
'.timeToLive[' +
|
|
2270
|
-
i1 +
|
|
2271
|
-
"]['dateField:']",
|
|
2272
|
-
schemaPath:
|
|
2273
|
-
'#/properties/timeToLive/items/properties/dateField%3A/pattern',
|
|
2274
|
-
params: {
|
|
2275
|
-
pattern: '^([a-zA-Z0-9_-]|\\.)+$',
|
|
2276
|
-
},
|
|
2277
|
-
message:
|
|
2278
|
-
'should match pattern "^([a-zA-Z0-9_-]|\\.)+$"',
|
|
2279
|
-
};
|
|
2280
|
-
if (vErrors === null) vErrors = [err];
|
|
2281
|
-
else vErrors.push(err);
|
|
2282
|
-
errors++;
|
|
2283
|
-
}
|
|
2284
|
-
} else {
|
|
2285
|
-
var err = {
|
|
2286
|
-
keyword: 'type',
|
|
2287
|
-
dataPath:
|
|
2288
|
-
(dataPath || '') +
|
|
2289
|
-
'.timeToLive[' +
|
|
2290
|
-
i1 +
|
|
2291
|
-
"]['dateField:']",
|
|
2292
|
-
schemaPath:
|
|
2293
|
-
'#/properties/timeToLive/items/properties/dateField%3A/type',
|
|
2294
|
-
params: {
|
|
2295
|
-
type: 'string',
|
|
2296
|
-
},
|
|
2297
|
-
message: 'should be string',
|
|
2298
|
-
};
|
|
2299
|
-
if (vErrors === null) vErrors = [err];
|
|
2300
|
-
else vErrors.push(err);
|
|
2301
|
-
errors++;
|
|
2302
|
-
}
|
|
2303
|
-
var valid3 = errors === errs_3;
|
|
2304
|
-
}
|
|
2305
|
-
var data3 = data2.expireAfterDays;
|
|
2306
|
-
if (data3 === undefined) {
|
|
2307
|
-
valid3 = false;
|
|
2308
|
-
var err = {
|
|
2309
|
-
keyword: 'required',
|
|
2310
|
-
dataPath: (dataPath || '') + '.timeToLive[' + i1 + ']',
|
|
2311
|
-
schemaPath: '#/properties/timeToLive/items/required',
|
|
2312
|
-
params: {
|
|
2313
|
-
missingProperty: 'expireAfterDays',
|
|
2314
|
-
},
|
|
2315
|
-
message: "should have required property 'expireAfterDays'",
|
|
2316
|
-
};
|
|
2317
|
-
if (vErrors === null) vErrors = [err];
|
|
2318
|
-
else vErrors.push(err);
|
|
2319
|
-
errors++;
|
|
2320
|
-
} else {
|
|
2321
|
-
var errs_3 = errors;
|
|
2322
|
-
if (typeof data3 !== 'number' || data3 % 1 || data3 !== data3) {
|
|
2323
|
-
var err = {
|
|
2324
|
-
keyword: 'type',
|
|
2325
|
-
dataPath:
|
|
2326
|
-
(dataPath || '') +
|
|
2327
|
-
'.timeToLive[' +
|
|
2328
|
-
i1 +
|
|
2329
|
-
'].expireAfterDays',
|
|
2330
|
-
schemaPath:
|
|
2331
|
-
'#/properties/timeToLive/items/properties/expireAfterDays/type',
|
|
2332
|
-
params: {
|
|
2333
|
-
type: 'integer',
|
|
2334
|
-
},
|
|
2335
|
-
message: 'should be integer',
|
|
2336
|
-
};
|
|
2337
|
-
if (vErrors === null) vErrors = [err];
|
|
2338
|
-
else vErrors.push(err);
|
|
2339
|
-
errors++;
|
|
2340
|
-
}
|
|
2341
|
-
if (typeof data3 === 'number') {
|
|
2342
|
-
if (data3 < 1 || data3 !== data3) {
|
|
2343
|
-
var err = {
|
|
2344
|
-
keyword: 'minimum',
|
|
2345
|
-
dataPath:
|
|
2346
|
-
(dataPath || '') +
|
|
2347
|
-
'.timeToLive[' +
|
|
2348
|
-
i1 +
|
|
2349
|
-
'].expireAfterDays',
|
|
2350
|
-
schemaPath:
|
|
2351
|
-
'#/properties/timeToLive/items/properties/expireAfterDays/minimum',
|
|
2352
|
-
params: {
|
|
2353
|
-
comparison: '>=',
|
|
2354
|
-
limit: 1,
|
|
2355
|
-
exclusive: false,
|
|
2356
|
-
},
|
|
2357
|
-
message: 'should be >= 1',
|
|
2358
|
-
};
|
|
2359
|
-
if (vErrors === null) vErrors = [err];
|
|
2360
|
-
else vErrors.push(err);
|
|
2361
|
-
errors++;
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
var valid3 = errors === errs_3;
|
|
2365
|
-
}
|
|
2366
|
-
} else {
|
|
2367
|
-
var err = {
|
|
2368
|
-
keyword: 'type',
|
|
2369
|
-
dataPath: (dataPath || '') + '.timeToLive[' + i1 + ']',
|
|
2370
|
-
schemaPath: '#/properties/timeToLive/items/type',
|
|
2371
|
-
params: {
|
|
2372
|
-
type: 'object',
|
|
2373
|
-
},
|
|
2374
|
-
message: 'should be object',
|
|
2375
|
-
};
|
|
2376
|
-
if (vErrors === null) vErrors = [err];
|
|
2377
|
-
else vErrors.push(err);
|
|
2378
|
-
errors++;
|
|
2379
|
-
}
|
|
2380
|
-
var valid2 = errors === errs_2;
|
|
2381
|
-
}
|
|
2382
|
-
} else {
|
|
2383
|
-
var err = {
|
|
2384
|
-
keyword: 'type',
|
|
2385
|
-
dataPath: (dataPath || '') + '.timeToLive',
|
|
2386
|
-
schemaPath: '#/properties/timeToLive/type',
|
|
2387
|
-
params: {
|
|
2388
|
-
type: 'array',
|
|
2389
|
-
},
|
|
2390
|
-
message: 'should be array',
|
|
2391
|
-
};
|
|
2392
|
-
if (vErrors === null) vErrors = [err];
|
|
2393
|
-
else vErrors.push(err);
|
|
2394
|
-
errors++;
|
|
2395
|
-
}
|
|
2396
|
-
var valid1 = errors === errs_1;
|
|
2397
|
-
}
|
|
2398
|
-
} else {
|
|
2399
|
-
var err = {
|
|
2400
|
-
keyword: 'type',
|
|
2401
|
-
dataPath: (dataPath || '') + '',
|
|
2402
|
-
schemaPath: '#/type',
|
|
2403
|
-
params: {
|
|
2404
|
-
type: 'object',
|
|
2405
|
-
},
|
|
2406
|
-
message: 'should be object',
|
|
2407
|
-
};
|
|
2408
|
-
if (vErrors === null) vErrors = [err];
|
|
2409
|
-
else vErrors.push(err);
|
|
2410
|
-
errors++;
|
|
2411
|
-
}
|
|
2412
|
-
validate.errors = vErrors;
|
|
2413
|
-
return errors === 0;
|
|
2414
|
-
};
|
|
2415
|
-
})();
|
|
2416
|
-
validate.schema = {
|
|
2417
|
-
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
2418
|
-
description: 'Sidecar file for schema definitions',
|
|
2419
|
-
type: 'object',
|
|
2420
|
-
minProperties: 1,
|
|
2421
|
-
additionalProperties: false,
|
|
2422
|
-
properties: {
|
|
2423
|
-
permissionProfiles: {
|
|
2424
|
-
type: 'object',
|
|
2425
|
-
additionalProperties: false,
|
|
2426
|
-
patternProperties: {
|
|
2427
|
-
'^[a-zA-Z0-9]+$': {
|
|
2428
|
-
$ref: '#/definitions/PermissionProfile',
|
|
2429
|
-
},
|
|
2430
|
-
},
|
|
2431
|
-
},
|
|
2432
|
-
i18n: {
|
|
2433
|
-
type: 'object',
|
|
2434
|
-
additionalProperties: false,
|
|
2435
|
-
patternProperties: {
|
|
2436
|
-
'^[a-zA-Z0-9_-]+$': {
|
|
2437
|
-
$ref: '#/definitions/NamespaceLocalization',
|
|
2438
|
-
},
|
|
2439
|
-
},
|
|
2440
|
-
},
|
|
2441
|
-
billing: {
|
|
2442
|
-
type: 'object',
|
|
2443
|
-
properties: {
|
|
2444
|
-
billingEntities: {
|
|
2445
|
-
type: 'array',
|
|
2446
|
-
items: {
|
|
2447
|
-
type: 'object',
|
|
2448
|
-
properties: {
|
|
2449
|
-
typeName: {
|
|
2450
|
-
type: 'string',
|
|
2451
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
2452
|
-
},
|
|
2453
|
-
keyFieldName: {
|
|
2454
|
-
type: 'string',
|
|
2455
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
2456
|
-
},
|
|
2457
|
-
quantityFieldName: {
|
|
2458
|
-
type: 'string',
|
|
2459
|
-
},
|
|
2460
|
-
category: {
|
|
2461
|
-
type: 'string',
|
|
2462
|
-
},
|
|
2463
|
-
categoryMapping: {
|
|
2464
|
-
type: 'object',
|
|
2465
|
-
properties: {
|
|
2466
|
-
fieldName: {
|
|
2467
|
-
type: 'string',
|
|
2468
|
-
},
|
|
2469
|
-
defaultValue: {
|
|
2470
|
-
type: 'string',
|
|
2471
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
2472
|
-
},
|
|
2473
|
-
values: {
|
|
2474
|
-
type: 'object',
|
|
2475
|
-
additionalProperties: {
|
|
2476
|
-
type: 'string',
|
|
2477
|
-
},
|
|
2478
|
-
},
|
|
2479
|
-
},
|
|
2480
|
-
additionalProperties: false,
|
|
2481
|
-
required: ['fieldName', 'defaultValue', 'values'],
|
|
2482
|
-
},
|
|
2483
|
-
},
|
|
2484
|
-
required: ['typeName'],
|
|
2485
|
-
additionalProperties: false,
|
|
2486
|
-
},
|
|
2487
|
-
},
|
|
2488
|
-
},
|
|
2489
|
-
additionalProperties: false,
|
|
2490
|
-
},
|
|
2491
|
-
timeToLive: {
|
|
2492
|
-
type: 'array',
|
|
2493
|
-
items: {
|
|
2494
|
-
type: 'object',
|
|
2495
|
-
properties: {
|
|
2496
|
-
'typeName:': {
|
|
2497
|
-
type: 'string',
|
|
2498
|
-
pattern: '^[a-zA-Z0-9_-]+$',
|
|
2499
|
-
},
|
|
2500
|
-
'dateField:': {
|
|
2501
|
-
type: 'string',
|
|
2502
|
-
pattern: '^([a-zA-Z0-9_-]|\\.)+$',
|
|
2503
|
-
},
|
|
2504
|
-
expireAfterDays: {
|
|
2505
|
-
type: 'integer',
|
|
2506
|
-
minimum: 1,
|
|
2507
|
-
},
|
|
2508
|
-
},
|
|
2509
|
-
required: ['typeName', 'dateField', 'expireAfterDays'],
|
|
2510
|
-
},
|
|
2511
|
-
},
|
|
2512
|
-
},
|
|
2513
|
-
definitions: {
|
|
2514
|
-
PermissionProfile: {
|
|
2515
|
-
type: 'object',
|
|
2516
|
-
additionalProperties: false,
|
|
2517
|
-
properties: {
|
|
2518
|
-
permissions: {
|
|
2519
|
-
type: 'array',
|
|
2520
|
-
items: {
|
|
2521
|
-
$ref: '#/definitions/Permission',
|
|
2522
|
-
},
|
|
2523
|
-
},
|
|
2524
|
-
},
|
|
2525
|
-
},
|
|
2526
|
-
Permission: {
|
|
2527
|
-
type: 'object',
|
|
2528
|
-
required: ['roles', 'access'],
|
|
2529
|
-
additionalProperties: false,
|
|
2530
|
-
properties: {
|
|
2531
|
-
roles: {
|
|
2532
|
-
type: 'array',
|
|
2533
|
-
minLength: 1,
|
|
2534
|
-
items: {
|
|
2535
|
-
type: 'string',
|
|
2536
|
-
pattern: '.+',
|
|
2537
|
-
},
|
|
2538
|
-
},
|
|
2539
|
-
access: {
|
|
2540
|
-
oneOf: [
|
|
2541
|
-
{
|
|
2542
|
-
type: 'string',
|
|
2543
|
-
enum: ['read', 'readWrite', 'create', 'update', 'delete'],
|
|
2544
|
-
},
|
|
2545
|
-
{
|
|
2546
|
-
type: 'array',
|
|
2547
|
-
items: {
|
|
2548
|
-
type: 'string',
|
|
2549
|
-
enum: ['read', 'readWrite', 'create', 'update', 'delete'],
|
|
2550
|
-
},
|
|
2551
|
-
minItems: 1,
|
|
2552
|
-
},
|
|
2553
|
-
],
|
|
2554
|
-
},
|
|
2555
|
-
restrictToAccessGroups: {
|
|
2556
|
-
type: 'array',
|
|
2557
|
-
minLength: 1,
|
|
2558
|
-
items: {
|
|
2559
|
-
type: 'string',
|
|
2560
|
-
pattern: '.+',
|
|
2561
|
-
},
|
|
2562
|
-
},
|
|
2563
|
-
restrictions: {
|
|
2564
|
-
type: 'array',
|
|
2565
|
-
items: {
|
|
2566
|
-
$ref: '#/definitions/PermissionRestriction',
|
|
2567
|
-
},
|
|
2568
|
-
},
|
|
2569
|
-
},
|
|
2570
|
-
},
|
|
2571
|
-
PermissionRestriction: {
|
|
2572
|
-
type: 'object',
|
|
2573
|
-
required: ['field'],
|
|
2574
|
-
properties: {
|
|
2575
|
-
field: {
|
|
2576
|
-
type: 'string',
|
|
2577
|
-
},
|
|
2578
|
-
},
|
|
2579
|
-
oneOf: [
|
|
2580
|
-
{
|
|
2581
|
-
$ref: '#/definitions/PermissionRestrictionWithValue',
|
|
2582
|
-
},
|
|
2583
|
-
{
|
|
2584
|
-
$ref: '#/definitions/PermissionRestrictionWithValueTemplate',
|
|
2585
|
-
},
|
|
2586
|
-
{
|
|
2587
|
-
$ref: '#/definitions/PermissionRestrictionWithClaim',
|
|
2588
|
-
},
|
|
2589
|
-
],
|
|
2590
|
-
},
|
|
2591
|
-
PermissionRestrictionWithValue: {
|
|
2592
|
-
required: ['value'],
|
|
2593
|
-
properties: {
|
|
2594
|
-
value: {},
|
|
2595
|
-
},
|
|
2596
|
-
},
|
|
2597
|
-
PermissionRestrictionWithValueTemplate: {
|
|
2598
|
-
required: ['valueTemplate'],
|
|
2599
|
-
properties: {
|
|
2600
|
-
valueTemplate: {
|
|
2601
|
-
type: 'string',
|
|
2602
|
-
},
|
|
2603
|
-
},
|
|
2604
|
-
},
|
|
2605
|
-
PermissionRestrictionWithClaim: {
|
|
2606
|
-
required: ['claim'],
|
|
2607
|
-
properties: {
|
|
2608
|
-
claim: {
|
|
2609
|
-
type: 'string',
|
|
2610
|
-
minLength: 1,
|
|
2611
|
-
},
|
|
2612
|
-
},
|
|
2613
|
-
},
|
|
2614
|
-
NamespaceLocalization: {
|
|
2615
|
-
type: 'object',
|
|
2616
|
-
additionalProperties: false,
|
|
2617
|
-
properties: {
|
|
2618
|
-
types: {
|
|
2619
|
-
patternProperties: {
|
|
2620
|
-
'^[a-zA-Z0-9_]+$': {
|
|
2621
|
-
$ref: '#/definitions/TypeLocalization',
|
|
2622
|
-
},
|
|
2623
|
-
},
|
|
2624
|
-
},
|
|
2625
|
-
fields: {
|
|
2626
|
-
patternProperties: {
|
|
2627
|
-
'^[a-zA-Z0-9_]+$': {
|
|
2628
|
-
anyOf: [
|
|
2629
|
-
{
|
|
2630
|
-
$ref: '#/definitions/FieldLocalization',
|
|
2631
|
-
},
|
|
2632
|
-
{
|
|
2633
|
-
type: 'string',
|
|
2634
|
-
},
|
|
2635
|
-
],
|
|
2636
|
-
},
|
|
2637
|
-
},
|
|
2638
|
-
},
|
|
2639
|
-
},
|
|
2640
|
-
},
|
|
2641
|
-
TypeLocalization: {
|
|
2642
|
-
type: 'object',
|
|
2643
|
-
additionalProperties: false,
|
|
2644
|
-
properties: {
|
|
2645
|
-
fields: {
|
|
2646
|
-
patternProperties: {
|
|
2647
|
-
'^[a-zA-Z0-9_]+$': {
|
|
2648
|
-
anyOf: [
|
|
2649
|
-
{
|
|
2650
|
-
$ref: '#/definitions/FieldLocalization',
|
|
2651
|
-
},
|
|
2652
|
-
{
|
|
2653
|
-
type: 'string',
|
|
2654
|
-
},
|
|
2655
|
-
],
|
|
2656
|
-
},
|
|
2657
|
-
},
|
|
2658
|
-
},
|
|
2659
|
-
values: {
|
|
2660
|
-
patternProperties: {
|
|
2661
|
-
'^[a-zA-Z0-9_]+$': {
|
|
2662
|
-
anyOf: [
|
|
2663
|
-
{
|
|
2664
|
-
$ref: '#/definitions/EnumValueLocalization',
|
|
2665
|
-
},
|
|
2666
|
-
{
|
|
2667
|
-
type: 'string',
|
|
2668
|
-
},
|
|
2669
|
-
],
|
|
2670
|
-
},
|
|
2671
|
-
},
|
|
2672
|
-
},
|
|
2673
|
-
label: {
|
|
2674
|
-
type: 'string',
|
|
2675
|
-
},
|
|
2676
|
-
labelPlural: {
|
|
2677
|
-
type: 'string',
|
|
2678
|
-
},
|
|
2679
|
-
hint: {
|
|
2680
|
-
type: 'string',
|
|
2681
|
-
},
|
|
2682
|
-
},
|
|
2683
|
-
},
|
|
2684
|
-
FieldLocalization: {
|
|
2685
|
-
properties: {
|
|
2686
|
-
label: {
|
|
2687
|
-
type: 'string',
|
|
2688
|
-
},
|
|
2689
|
-
hint: {
|
|
2690
|
-
type: 'string',
|
|
2691
|
-
},
|
|
2692
|
-
},
|
|
2693
|
-
},
|
|
2694
|
-
EnumValueLocalization: {
|
|
2695
|
-
properties: {
|
|
2696
|
-
label: {
|
|
2697
|
-
type: 'string',
|
|
2698
|
-
},
|
|
2699
|
-
hint: {
|
|
2700
|
-
type: 'string',
|
|
2701
|
-
},
|
|
2702
|
-
},
|
|
2703
|
-
},
|
|
2704
|
-
},
|
|
2705
|
-
};
|
|
2706
|
-
validate.errors = null;
|
|
2707
|
-
module.exports = validate;
|
|
1
|
+
"use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$schema":"http://json-schema.org/draft-07/schema#","description":"Sidecar file for schema definitions","type":"object","minProperties":1,"additionalProperties":false,"properties":{"permissionProfiles":{"type":"object","additionalProperties":false,"patternProperties":{"^[a-zA-Z0-9]+$":{"$ref":"#/definitions/PermissionProfile"}}},"i18n":{"type":"object","additionalProperties":false,"patternProperties":{"^[a-zA-Z0-9_-]+$":{"$ref":"#/definitions/NamespaceLocalization"}}},"billing":{"type":"object","properties":{"billingEntities":{"type":"array","items":{"type":"object","properties":{"typeName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$"},"keyFieldName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$"},"quantityFieldName":{"type":"string"},"category":{"type":"string"},"categoryMapping":{"type":"object","properties":{"fieldName":{"type":"string"},"defaultValue":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":false,"required":["fieldName","defaultValue","values"]}},"required":["typeName"],"additionalProperties":false}}},"additionalProperties":false},"timeToLive":{"type":"array","items":{"type":"object","properties":{"typeName:":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$"},"dateField:":{"type":"string","pattern":"^([a-zA-Z0-9_-]|\\.)+$"},"expireAfterDays":{"type":"integer","minimum":1}},"required":["typeName","dateField","expireAfterDays"]}}},"definitions":{"PermissionProfile":{"type":"object","additionalProperties":false,"properties":{"permissions":{"type":"array","items":{"$ref":"#/definitions/Permission"}}}},"Permission":{"type":"object","required":["roles","access"],"additionalProperties":false,"properties":{"roles":{"type":"array","minItems":1,"items":{"type":"string","pattern":".+"}},"access":{"oneOf":[{"type":"string","enum":["read","readWrite","create","update","delete"]},{"type":"array","items":{"type":"string","enum":["read","readWrite","create","update","delete"]},"minItems":1}]},"restrictToAccessGroups":{"type":"array","minItems":1,"items":{"type":"string","pattern":".+"}},"restrictions":{"type":"array","items":{"$ref":"#/definitions/PermissionRestriction"}}}},"PermissionRestriction":{"type":"object","required":["field"],"properties":{"field":{"type":"string"}},"oneOf":[{"$ref":"#/definitions/PermissionRestrictionWithValue"},{"$ref":"#/definitions/PermissionRestrictionWithValueTemplate"},{"$ref":"#/definitions/PermissionRestrictionWithClaim"}]},"PermissionRestrictionWithValue":{"type":"object","required":["value"],"properties":{"value":{}}},"PermissionRestrictionWithValueTemplate":{"type":"object","required":["valueTemplate"],"properties":{"valueTemplate":{"type":"string"}}},"PermissionRestrictionWithClaim":{"type":"object","required":["claim"],"properties":{"claim":{"type":"string","minLength":1}}},"NamespaceLocalization":{"type":"object","additionalProperties":false,"properties":{"types":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"$ref":"#/definitions/TypeLocalization"}}},"fields":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"anyOf":[{"$ref":"#/definitions/FieldLocalization"},{"type":"string"}]}}}}},"TypeLocalization":{"type":"object","additionalProperties":false,"properties":{"fields":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"anyOf":[{"$ref":"#/definitions/FieldLocalization"},{"type":"string"}]}}},"values":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"anyOf":[{"$ref":"#/definitions/EnumValueLocalization"},{"type":"string"}]}}},"label":{"type":"string"},"labelPlural":{"type":"string"},"hint":{"type":"string"}}},"FieldLocalization":{"type":"object","additionalProperties":false,"properties":{"label":{"type":"string"},"hint":{"type":"string"}}},"EnumValueLocalization":{"type":"object","additionalProperties":false,"properties":{"label":{"type":"string"},"hint":{"type":"string"}}}}};const pattern0 = new RegExp("^[a-zA-Z0-9]+$", "u");const pattern4 = new RegExp("^[a-zA-Z0-9_-]+$", "u");const pattern14 = new RegExp("^([a-zA-Z0-9_-]|\\.)+$", "u");const schema23 = {"type":"object","additionalProperties":false,"properties":{"permissions":{"type":"array","items":{"$ref":"#/definitions/Permission"}}}};const schema24 = {"type":"object","required":["roles","access"],"additionalProperties":false,"properties":{"roles":{"type":"array","minItems":1,"items":{"type":"string","pattern":".+"}},"access":{"oneOf":[{"type":"string","enum":["read","readWrite","create","update","delete"]},{"type":"array","items":{"type":"string","enum":["read","readWrite","create","update","delete"]},"minItems":1}]},"restrictToAccessGroups":{"type":"array","minItems":1,"items":{"type":"string","pattern":".+"}},"restrictions":{"type":"array","items":{"$ref":"#/definitions/PermissionRestriction"}}}};const pattern2 = new RegExp(".+", "u");const schema25 = {"type":"object","required":["field"],"properties":{"field":{"type":"string"}},"oneOf":[{"$ref":"#/definitions/PermissionRestrictionWithValue"},{"$ref":"#/definitions/PermissionRestrictionWithValueTemplate"},{"$ref":"#/definitions/PermissionRestrictionWithClaim"}]};const schema26 = {"type":"object","required":["value"],"properties":{"value":{}}};const schema27 = {"type":"object","required":["valueTemplate"],"properties":{"valueTemplate":{"type":"string"}}};const schema28 = {"type":"object","required":["claim"],"properties":{"claim":{"type":"string","minLength":1}}};const func4 = require("ajv/dist/runtime/ucs2length").default;function validate23(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = false;let passing0 = null;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.value === undefined){const err0 = {instancePath,schemaPath:"#/definitions/PermissionRestrictionWithValue/required",keyword:"required",params:{missingProperty: "value"},message:"must have required property '"+"value"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/definitions/PermissionRestrictionWithValue/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs2 === errors;if(_valid0){valid0 = true;passing0 = 0;}const _errs5 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.valueTemplate === undefined){const err2 = {instancePath,schemaPath:"#/definitions/PermissionRestrictionWithValueTemplate/required",keyword:"required",params:{missingProperty: "valueTemplate"},message:"must have required property '"+"valueTemplate"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.valueTemplate !== undefined){if(typeof data.valueTemplate !== "string"){const err3 = {instancePath:instancePath+"/valueTemplate",schemaPath:"#/definitions/PermissionRestrictionWithValueTemplate/properties/valueTemplate/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:"#/definitions/PermissionRestrictionWithValueTemplate/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs5 === errors;if(_valid0 && valid0){valid0 = false;passing0 = [passing0, 1];}else {if(_valid0){valid0 = true;passing0 = 1;}const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.claim === undefined){const err5 = {instancePath,schemaPath:"#/definitions/PermissionRestrictionWithClaim/required",keyword:"required",params:{missingProperty: "claim"},message:"must have required property '"+"claim"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.claim !== undefined){let data1 = data.claim;if(typeof data1 === "string"){if(func4(data1) < 1){const err6 = {instancePath:instancePath+"/claim",schemaPath:"#/definitions/PermissionRestrictionWithClaim/properties/claim/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/claim",schemaPath:"#/definitions/PermissionRestrictionWithClaim/properties/claim/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/definitions/PermissionRestrictionWithClaim/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}var _valid0 = _errs10 === errors;if(_valid0 && valid0){valid0 = false;passing0 = [passing0, 2];}else {if(_valid0){valid0 = true;passing0 = 2;}}}if(!valid0){const err9 = {instancePath,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}else {errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.field === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.field !== undefined){if(typeof data.field !== "string"){const err11 = {instancePath:instancePath+"/field",schemaPath:"#/properties/field/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate23.errors = vErrors;return errors === 0;}function validate22(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.roles === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "roles"},message:"must have required property '"+"roles"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.access === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "access"},message:"must have required property '"+"access"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((key0 === "roles") || (key0 === "access")) || (key0 === "restrictToAccessGroups")) || (key0 === "restrictions"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.roles !== undefined){let data0 = data.roles;if(Array.isArray(data0)){if(data0.length < 1){const err3 = {instancePath:instancePath+"/roles",schemaPath:"#/properties/roles/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){let data1 = data0[i0];if(typeof data1 === "string"){if(!pattern2.test(data1)){const err4 = {instancePath:instancePath+"/roles/" + i0,schemaPath:"#/properties/roles/items/pattern",keyword:"pattern",params:{pattern: ".+"},message:"must match pattern \""+".+"+"\""};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/roles/" + i0,schemaPath:"#/properties/roles/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath:instancePath+"/roles",schemaPath:"#/properties/roles/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.access !== undefined){let data2 = data.access;const _errs7 = errors;let valid3 = false;let passing0 = null;const _errs8 = errors;if(typeof data2 !== "string"){const err7 = {instancePath:instancePath+"/access",schemaPath:"#/properties/access/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(!(((((data2 === "read") || (data2 === "readWrite")) || (data2 === "create")) || (data2 === "update")) || (data2 === "delete"))){const err8 = {instancePath:instancePath+"/access",schemaPath:"#/properties/access/oneOf/0/enum",keyword:"enum",params:{allowedValues: schema24.properties.access.oneOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}var _valid0 = _errs8 === errors;if(_valid0){valid3 = true;passing0 = 0;}const _errs10 = errors;if(Array.isArray(data2)){if(data2.length < 1){const err9 = {instancePath:instancePath+"/access",schemaPath:"#/properties/access/oneOf/1/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len1 = data2.length;for(let i1=0; i1<len1; i1++){let data3 = data2[i1];if(typeof data3 !== "string"){const err10 = {instancePath:instancePath+"/access/" + i1,schemaPath:"#/properties/access/oneOf/1/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(!(((((data3 === "read") || (data3 === "readWrite")) || (data3 === "create")) || (data3 === "update")) || (data3 === "delete"))){const err11 = {instancePath:instancePath+"/access/" + i1,schemaPath:"#/properties/access/oneOf/1/items/enum",keyword:"enum",params:{allowedValues: schema24.properties.access.oneOf[1].items.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath:instancePath+"/access",schemaPath:"#/properties/access/oneOf/1/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid0 = _errs10 === errors;if(_valid0 && valid3){valid3 = false;passing0 = [passing0, 1];}else {if(_valid0){valid3 = true;passing0 = 1;}}if(!valid3){const err13 = {instancePath:instancePath+"/access",schemaPath:"#/properties/access/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}}if(data.restrictToAccessGroups !== undefined){let data4 = data.restrictToAccessGroups;if(Array.isArray(data4)){if(data4.length < 1){const err14 = {instancePath:instancePath+"/restrictToAccessGroups",schemaPath:"#/properties/restrictToAccessGroups/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}const len2 = data4.length;for(let i2=0; i2<len2; i2++){let data5 = data4[i2];if(typeof data5 === "string"){if(!pattern2.test(data5)){const err15 = {instancePath:instancePath+"/restrictToAccessGroups/" + i2,schemaPath:"#/properties/restrictToAccessGroups/items/pattern",keyword:"pattern",params:{pattern: ".+"},message:"must match pattern \""+".+"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/restrictToAccessGroups/" + i2,schemaPath:"#/properties/restrictToAccessGroups/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+"/restrictToAccessGroups",schemaPath:"#/properties/restrictToAccessGroups/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.restrictions !== undefined){let data6 = data.restrictions;if(Array.isArray(data6)){const len3 = data6.length;for(let i3=0; i3<len3; i3++){if(!(validate23(data6[i3], {instancePath:instancePath+"/restrictions/" + i3,parentData:data6,parentDataProperty:i3,rootData}))){vErrors = vErrors === null ? validate23.errors : vErrors.concat(validate23.errors);errors = vErrors.length;}}}else {const err18 = {instancePath:instancePath+"/restrictions",schemaPath:"#/properties/restrictions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate22.errors = vErrors;return errors === 0;}function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){for(const key0 in data){if(!(key0 === "permissions")){const err0 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.permissions !== undefined){let data0 = data.permissions;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate22(data0[i0], {instancePath:instancePath+"/permissions/" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}}else {const err1 = {instancePath:instancePath+"/permissions",schemaPath:"#/properties/permissions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate21.errors = vErrors;return errors === 0;}const schema29 = {"type":"object","additionalProperties":false,"properties":{"types":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"$ref":"#/definitions/TypeLocalization"}}},"fields":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"anyOf":[{"$ref":"#/definitions/FieldLocalization"},{"type":"string"}]}}}}};const schema31 = {"type":"object","additionalProperties":false,"properties":{"label":{"type":"string"},"hint":{"type":"string"}}};const pattern6 = new RegExp("^[a-zA-Z0-9_]+$", "u");const schema30 = {"type":"object","additionalProperties":false,"properties":{"fields":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"anyOf":[{"$ref":"#/definitions/FieldLocalization"},{"type":"string"}]}}},"values":{"type":"object","patternProperties":{"^[a-zA-Z0-9_]+$":{"anyOf":[{"$ref":"#/definitions/EnumValueLocalization"},{"type":"string"}]}}},"label":{"type":"string"},"labelPlural":{"type":"string"},"hint":{"type":"string"}}};const schema32 = {"type":"object","additionalProperties":false,"properties":{"label":{"type":"string"},"hint":{"type":"string"}}};function validate28(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){for(const key0 in data){if(!(((((key0 === "fields") || (key0 === "values")) || (key0 === "label")) || (key0 === "labelPlural")) || (key0 === "hint"))){const err0 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.fields !== undefined){let data0 = data.fields;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){for(const key1 in data0){if(pattern6.test(key1)){let data1 = data0[key1];const _errs5 = errors;let valid2 = false;const _errs6 = errors;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){for(const key2 in data1){if(!((key2 === "label") || (key2 === "hint"))){const err1 = {instancePath:instancePath+"/fields/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/FieldLocalization/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data1.label !== undefined){if(typeof data1.label !== "string"){const err2 = {instancePath:instancePath+"/fields/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/label",schemaPath:"#/definitions/FieldLocalization/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data1.hint !== undefined){if(typeof data1.hint !== "string"){const err3 = {instancePath:instancePath+"/fields/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/hint",schemaPath:"#/definitions/FieldLocalization/properties/hint/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath:instancePath+"/fields/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/FieldLocalization/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs6 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs14 = errors;if(typeof data1 !== "string"){const err5 = {instancePath:instancePath+"/fields/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs14 === errors;valid2 = valid2 || _valid0;}if(!valid2){const err6 = {instancePath:instancePath+"/fields/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}}}}else {const err7 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.values !== undefined){let data4 = data.values;if(data4 && typeof data4 == "object" && !Array.isArray(data4)){for(const key3 in data4){if(pattern6.test(key3)){let data5 = data4[key3];const _errs19 = errors;let valid6 = false;const _errs20 = errors;if(data5 && typeof data5 == "object" && !Array.isArray(data5)){for(const key4 in data5){if(!((key4 === "label") || (key4 === "hint"))){const err8 = {instancePath:instancePath+"/values/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/EnumValueLocalization/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data5.label !== undefined){if(typeof data5.label !== "string"){const err9 = {instancePath:instancePath+"/values/" + key3.replace(/~/g, "~0").replace(/\//g, "~1")+"/label",schemaPath:"#/definitions/EnumValueLocalization/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data5.hint !== undefined){if(typeof data5.hint !== "string"){const err10 = {instancePath:instancePath+"/values/" + key3.replace(/~/g, "~0").replace(/\//g, "~1")+"/hint",schemaPath:"#/definitions/EnumValueLocalization/properties/hint/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath:instancePath+"/values/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/EnumValueLocalization/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs20 === errors;valid6 = valid6 || _valid1;if(!valid6){const _errs28 = errors;if(typeof data5 !== "string"){const err12 = {instancePath:instancePath+"/values/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/values/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs28 === errors;valid6 = valid6 || _valid1;}if(!valid6){const err13 = {instancePath:instancePath+"/values/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/values/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs19;if(vErrors !== null){if(_errs19){vErrors.length = _errs19;}else {vErrors = null;}}}}}}else {const err14 = {instancePath:instancePath+"/values",schemaPath:"#/properties/values/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.label !== undefined){if(typeof data.label !== "string"){const err15 = {instancePath:instancePath+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.labelPlural !== undefined){if(typeof data.labelPlural !== "string"){const err16 = {instancePath:instancePath+"/labelPlural",schemaPath:"#/properties/labelPlural/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.hint !== undefined){if(typeof data.hint !== "string"){const err17 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}validate28.errors = vErrors;return errors === 0;}function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){for(const key0 in data){if(!((key0 === "types") || (key0 === "fields"))){const err0 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.types !== undefined){let data0 = data.types;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){for(const key1 in data0){if(pattern6.test(key1)){if(!(validate28(data0[key1], {instancePath:instancePath+"/types/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data0,parentDataProperty:key1,rootData}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}}}else {const err1 = {instancePath:instancePath+"/types",schemaPath:"#/properties/types/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.fields !== undefined){let data2 = data.fields;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){for(const key2 in data2){if(pattern6.test(key2)){let data3 = data2[key2];const _errs8 = errors;let valid3 = false;const _errs9 = errors;if(data3 && typeof data3 == "object" && !Array.isArray(data3)){for(const key3 in data3){if(!((key3 === "label") || (key3 === "hint"))){const err2 = {instancePath:instancePath+"/fields/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/FieldLocalization/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data3.label !== undefined){if(typeof data3.label !== "string"){const err3 = {instancePath:instancePath+"/fields/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/label",schemaPath:"#/definitions/FieldLocalization/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data3.hint !== undefined){if(typeof data3.hint !== "string"){const err4 = {instancePath:instancePath+"/fields/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/hint",schemaPath:"#/definitions/FieldLocalization/properties/hint/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath:instancePath+"/fields/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/FieldLocalization/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs9 === errors;valid3 = valid3 || _valid0;if(!valid3){const _errs17 = errors;if(typeof data3 !== "string"){const err6 = {instancePath:instancePath+"/fields/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs17 === errors;valid3 = valid3 || _valid0;}if(!valid3){const err7 = {instancePath:instancePath+"/fields/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/fields/patternProperties/%5E%5Ba-zA-Z0-9_%5D%2B%24/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}}}}else {const err8 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate27.errors = vErrors;return errors === 0;}function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "permissionProfiles") || (key0 === "i18n")) || (key0 === "billing")) || (key0 === "timeToLive"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.permissionProfiles !== undefined){let data0 = data.permissionProfiles;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){for(const key1 in data0){if(!(pattern0.test(key1))){const err2 = {instancePath:instancePath+"/permissionProfiles",schemaPath:"#/properties/permissionProfiles/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}for(const key2 in data0){if(pattern0.test(key2)){if(!(validate21(data0[key2], {instancePath:instancePath+"/permissionProfiles/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data0,parentDataProperty:key2,rootData}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}}}}else {const err3 = {instancePath:instancePath+"/permissionProfiles",schemaPath:"#/properties/permissionProfiles/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.i18n !== undefined){let data2 = data.i18n;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){for(const key3 in data2){if(!(pattern4.test(key3))){const err4 = {instancePath:instancePath+"/i18n",schemaPath:"#/properties/i18n/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}for(const key4 in data2){if(pattern4.test(key4)){if(!(validate27(data2[key4], {instancePath:instancePath+"/i18n/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data2,parentDataProperty:key4,rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}}}else {const err5 = {instancePath:instancePath+"/i18n",schemaPath:"#/properties/i18n/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.billing !== undefined){let data4 = data.billing;if(data4 && typeof data4 == "object" && !Array.isArray(data4)){for(const key5 in data4){if(!(key5 === "billingEntities")){const err6 = {instancePath:instancePath+"/billing",schemaPath:"#/properties/billing/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data4.billingEntities !== undefined){let data5 = data4.billingEntities;if(Array.isArray(data5)){const len0 = data5.length;for(let i0=0; i0<len0; i0++){let data6 = data5[i0];if(data6 && typeof data6 == "object" && !Array.isArray(data6)){if(data6.typeName === undefined){const err7 = {instancePath:instancePath+"/billing/billingEntities/" + i0,schemaPath:"#/properties/billing/properties/billingEntities/items/required",keyword:"required",params:{missingProperty: "typeName"},message:"must have required property '"+"typeName"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key6 in data6){if(!(((((key6 === "typeName") || (key6 === "keyFieldName")) || (key6 === "quantityFieldName")) || (key6 === "category")) || (key6 === "categoryMapping"))){const err8 = {instancePath:instancePath+"/billing/billingEntities/" + i0,schemaPath:"#/properties/billing/properties/billingEntities/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data6.typeName !== undefined){let data7 = data6.typeName;if(typeof data7 === "string"){if(!pattern4.test(data7)){const err9 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/typeName",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/typeName/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z0-9_-]+$"},message:"must match pattern \""+"^[a-zA-Z0-9_-]+$"+"\""};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/typeName",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/typeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data6.keyFieldName !== undefined){let data8 = data6.keyFieldName;if(typeof data8 === "string"){if(!pattern4.test(data8)){const err11 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/keyFieldName",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/keyFieldName/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z0-9_-]+$"},message:"must match pattern \""+"^[a-zA-Z0-9_-]+$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/keyFieldName",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/keyFieldName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data6.quantityFieldName !== undefined){if(typeof data6.quantityFieldName !== "string"){const err13 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/quantityFieldName",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/quantityFieldName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data6.category !== undefined){if(typeof data6.category !== "string"){const err14 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/category",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/category/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data6.categoryMapping !== undefined){let data11 = data6.categoryMapping;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.fieldName === undefined){const err15 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/required",keyword:"required",params:{missingProperty: "fieldName"},message:"must have required property '"+"fieldName"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data11.defaultValue === undefined){const err16 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/required",keyword:"required",params:{missingProperty: "defaultValue"},message:"must have required property '"+"defaultValue"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data11.values === undefined){const err17 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/required",keyword:"required",params:{missingProperty: "values"},message:"must have required property '"+"values"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}for(const key7 in data11){if(!(((key7 === "fieldName") || (key7 === "defaultValue")) || (key7 === "values"))){const err18 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data11.fieldName !== undefined){if(typeof data11.fieldName !== "string"){const err19 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping/fieldName",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/fieldName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data11.defaultValue !== undefined){let data13 = data11.defaultValue;if(typeof data13 === "string"){if(!pattern4.test(data13)){const err20 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping/defaultValue",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/defaultValue/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z0-9_-]+$"},message:"must match pattern \""+"^[a-zA-Z0-9_-]+$"+"\""};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping/defaultValue",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/defaultValue/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data11.values !== undefined){let data14 = data11.values;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){for(const key8 in data14){if(typeof data14[key8] !== "string"){const err22 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping/values/" + key8.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/values/additionalProperties/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}else {const err23 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping/values",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/properties/values/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}}else {const err24 = {instancePath:instancePath+"/billing/billingEntities/" + i0+"/categoryMapping",schemaPath:"#/properties/billing/properties/billingEntities/items/properties/categoryMapping/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+"/billing/billingEntities/" + i0,schemaPath:"#/properties/billing/properties/billingEntities/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+"/billing/billingEntities",schemaPath:"#/properties/billing/properties/billingEntities/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}else {const err27 = {instancePath:instancePath+"/billing",schemaPath:"#/properties/billing/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.timeToLive !== undefined){let data16 = data.timeToLive;if(Array.isArray(data16)){const len1 = data16.length;for(let i1=0; i1<len1; i1++){let data17 = data16[i1];if(data17 && typeof data17 == "object" && !Array.isArray(data17)){if(data17.typeName === undefined){const err28 = {instancePath:instancePath+"/timeToLive/" + i1,schemaPath:"#/properties/timeToLive/items/required",keyword:"required",params:{missingProperty: "typeName"},message:"must have required property '"+"typeName"+"'"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(data17.dateField === undefined){const err29 = {instancePath:instancePath+"/timeToLive/" + i1,schemaPath:"#/properties/timeToLive/items/required",keyword:"required",params:{missingProperty: "dateField"},message:"must have required property '"+"dateField"+"'"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(data17.expireAfterDays === undefined){const err30 = {instancePath:instancePath+"/timeToLive/" + i1,schemaPath:"#/properties/timeToLive/items/required",keyword:"required",params:{missingProperty: "expireAfterDays"},message:"must have required property '"+"expireAfterDays"+"'"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(data17["typeName:"] !== undefined){let data18 = data17["typeName:"];if(typeof data18 === "string"){if(!pattern4.test(data18)){const err31 = {instancePath:instancePath+"/timeToLive/" + i1+"/typeName:",schemaPath:"#/properties/timeToLive/items/properties/typeName%3A/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z0-9_-]+$"},message:"must match pattern \""+"^[a-zA-Z0-9_-]+$"+"\""};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/timeToLive/" + i1+"/typeName:",schemaPath:"#/properties/timeToLive/items/properties/typeName%3A/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data17["dateField:"] !== undefined){let data19 = data17["dateField:"];if(typeof data19 === "string"){if(!pattern14.test(data19)){const err33 = {instancePath:instancePath+"/timeToLive/" + i1+"/dateField:",schemaPath:"#/properties/timeToLive/items/properties/dateField%3A/pattern",keyword:"pattern",params:{pattern: "^([a-zA-Z0-9_-]|\\.)+$"},message:"must match pattern \""+"^([a-zA-Z0-9_-]|\\.)+$"+"\""};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}else {const err34 = {instancePath:instancePath+"/timeToLive/" + i1+"/dateField:",schemaPath:"#/properties/timeToLive/items/properties/dateField%3A/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data17.expireAfterDays !== undefined){let data20 = data17.expireAfterDays;if(!(((typeof data20 == "number") && (!(data20 % 1) && !isNaN(data20))) && (isFinite(data20)))){const err35 = {instancePath:instancePath+"/timeToLive/" + i1+"/expireAfterDays",schemaPath:"#/properties/timeToLive/items/properties/expireAfterDays/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if((typeof data20 == "number") && (isFinite(data20))){if(data20 < 1 || isNaN(data20)){const err36 = {instancePath:instancePath+"/timeToLive/" + i1+"/expireAfterDays",schemaPath:"#/properties/timeToLive/items/properties/expireAfterDays/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}}}else {const err37 = {instancePath:instancePath+"/timeToLive/" + i1,schemaPath:"#/properties/timeToLive/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}}else {const err38 = {instancePath:instancePath+"/timeToLive",schemaPath:"#/properties/timeToLive/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}else {const err39 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}validate20.errors = vErrors;return errors === 0;}
|