@data-fair/catalog-data-fair 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,806 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+
4
+ "use strict";
5
+ export const validate = validate14;
6
+ export default validate14;
7
+ const schema16 = {"$id":"https://github.com/data-fair/catalog-data-fair/import-config","x-exports":["types","validate","schema"],"title":"Configuration de l'import","type":"object","additionalProperties":false,"properties":{"fields":{"type":"array","default":[],"title":"Colonnes du jeu de données","description":"La liste des colonnes à importer. Si ce champ est vide, toutes les colonnes seront importées.","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false","itemTitle":"item.label","itemKey":"item.key"}}},"filters":{"$ref":"#/$defs/filters"}},"$defs":{"filters":{"title":"Filtres prédéfinis","type":"array","default":[],"items":{"type":"object","default":{"type":"in"},"required":["type"],"oneOf":[{"title":"Restreindre à des valeurs précises","required":["field","values","type"],"properties":{"type":{"const":"in"},"field":{"$ref":"#/$defs/filterField"},"values":{"type":"array","title":"Valeurs","description":"Importe seulement des lignes où la valeur du champ indiqué est égale à l'une des valeurs renseignées.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","items":{"type":"string"},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true"},"props":{"clearable":true}},"default":[]}}},{"title":"Exclure des valeurs","required":["field","values","type"],"properties":{"type":{"const":"nin"},"field":{"$ref":"#/$defs/filterField"},"values":{"type":"array","title":"Valeurs à exclure","description":"Importe seulement des lignes où la valeur du champ indiqué est différente des valeurs renseignées.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","items":{"type":"string"},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true"},"props":{"clearable":true}},"default":[]}}},{"title":"Supérieur à une valeur","required":["field","value","type"],"properties":{"type":{"const":"gte"},"field":{"$ref":"#/$defs/filterField"},"value":{"type":"string","title":"Valeur minimale","description":"Importe seulement des lignes où la valeur du champ indiqué est supérieur ou égale à la valeur renseignée. La valeur peut être un nombre, une chaîne de caractère (*ordre alphanumérique*), une date.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","layout":{"comp":"combobox","getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true&sort=asc"}}}}},{"title":"Inférieur à une valeur","required":["field","value","type"],"properties":{"type":{"const":"lte"},"field":{"$ref":"#/$defs/filterField"},"value":{"type":"string","title":"Valeur maximale","description":"Importe seulement les lignes où la valeur du champ indiqué est inférieur à la valeur renseignée. La valeur peut être un nombre, une chaîne de caractère (*ordre alphanumérique*), une date.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","layout":{"comp":"combobox","getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true&sort=asc"}}}}},{"title":"Commence par les caractères","required":["field","value","type"],"properties":{"type":{"const":"starts"},"field":{"$ref":"#/$defs/filterFieldString"},"value":{"type":"string","description":"Importe seulement les lignes où le champ (colonne) indiqué commence par une chaîne de caractères précise. La chaîne de caractères est sensible à la casse.<br>Seuls les champs (colonnes) ayant pour valeurs des chaînes de caractères sont acceptées.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","title":"Commence par les caractères","layout":{"comp":"combobox","getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true"}}}}}]}},"filterField":{"type":"object","title":"Colonne de filtre","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false","itemTitle":"item.label","itemKey":"item.key"}}},"filterFieldString":{"type":"object","title":"Colonne de filtre","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false&type=string","itemTitle":"item.label","itemKey":"item.key"}}}}};
8
+ const schema17 = {"title":"Filtres prédéfinis","type":"array","default":[],"items":{"type":"object","default":{"type":"in"},"required":["type"],"oneOf":[{"title":"Restreindre à des valeurs précises","required":["field","values","type"],"properties":{"type":{"const":"in"},"field":{"$ref":"#/$defs/filterField"},"values":{"type":"array","title":"Valeurs","description":"Importe seulement des lignes où la valeur du champ indiqué est égale à l'une des valeurs renseignées.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","items":{"type":"string"},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true"},"props":{"clearable":true}},"default":[]}}},{"title":"Exclure des valeurs","required":["field","values","type"],"properties":{"type":{"const":"nin"},"field":{"$ref":"#/$defs/filterField"},"values":{"type":"array","title":"Valeurs à exclure","description":"Importe seulement des lignes où la valeur du champ indiqué est différente des valeurs renseignées.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","items":{"type":"string"},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true"},"props":{"clearable":true}},"default":[]}}},{"title":"Supérieur à une valeur","required":["field","value","type"],"properties":{"type":{"const":"gte"},"field":{"$ref":"#/$defs/filterField"},"value":{"type":"string","title":"Valeur minimale","description":"Importe seulement des lignes où la valeur du champ indiqué est supérieur ou égale à la valeur renseignée. La valeur peut être un nombre, une chaîne de caractère (*ordre alphanumérique*), une date.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","layout":{"comp":"combobox","getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true&sort=asc"}}}}},{"title":"Inférieur à une valeur","required":["field","value","type"],"properties":{"type":{"const":"lte"},"field":{"$ref":"#/$defs/filterField"},"value":{"type":"string","title":"Valeur maximale","description":"Importe seulement les lignes où la valeur du champ indiqué est inférieur à la valeur renseignée. La valeur peut être un nombre, une chaîne de caractère (*ordre alphanumérique*), une date.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","layout":{"comp":"combobox","getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true&sort=asc"}}}}},{"title":"Commence par les caractères","required":["field","value","type"],"properties":{"type":{"const":"starts"},"field":{"$ref":"#/$defs/filterFieldString"},"value":{"type":"string","description":"Importe seulement les lignes où le champ (colonne) indiqué commence par une chaîne de caractères précise. La chaîne de caractères est sensible à la casse.<br>Seuls les champs (colonnes) ayant pour valeurs des chaînes de caractères sont acceptées.<br>*Toutes les valeurs peuvent ne pas être affichées, écrivez pour rechercher un champ particulier.*","title":"Commence par les caractères","layout":{"comp":"combobox","getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/values/${parent.data.field.key}?q={q}&q_mode=complete&size=100&stringify=true"}}}}}]}};
9
+ const schema18 = {"type":"object","title":"Colonne de filtre","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false","itemTitle":"item.label","itemKey":"item.key"}}};
10
+ const schema22 = {"type":"object","title":"Colonne de filtre","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"layout":{"getItems":{"url":"${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false&type=string","itemTitle":"item.label","itemKey":"item.key"}}};
11
+
12
+ function validate15(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
13
+ let vErrors = null;
14
+ let errors = 0;
15
+ if(Array.isArray(data)){
16
+ const len0 = data.length;
17
+ for(let i0=0; i0<len0; i0++){
18
+ let data0 = data[i0];
19
+ const _errs3 = errors;
20
+ let valid2 = false;
21
+ let passing0 = null;
22
+ const _errs4 = errors;
23
+ if(data0 && typeof data0 == "object" && !Array.isArray(data0)){
24
+ if(data0.field === undefined){
25
+ const err0 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/0/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};
26
+ if(vErrors === null){
27
+ vErrors = [err0];
28
+ }
29
+ else {
30
+ vErrors.push(err0);
31
+ }
32
+ errors++;
33
+ }
34
+ if(data0.values === undefined){
35
+ const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/0/required",keyword:"required",params:{missingProperty: "values"},message:"must have required property '"+"values"+"'"};
36
+ if(vErrors === null){
37
+ vErrors = [err1];
38
+ }
39
+ else {
40
+ vErrors.push(err1);
41
+ }
42
+ errors++;
43
+ }
44
+ if(data0.type === undefined){
45
+ const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/0/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
46
+ if(vErrors === null){
47
+ vErrors = [err2];
48
+ }
49
+ else {
50
+ vErrors.push(err2);
51
+ }
52
+ errors++;
53
+ }
54
+ if(data0.type !== undefined){
55
+ if("in" !== data0.type){
56
+ const err3 = {instancePath:instancePath+"/" + i0+"/type",schemaPath:"#/items/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue: "in"},message:"must be equal to constant"};
57
+ if(vErrors === null){
58
+ vErrors = [err3];
59
+ }
60
+ else {
61
+ vErrors.push(err3);
62
+ }
63
+ errors++;
64
+ }
65
+ }
66
+ if(data0.field !== undefined){
67
+ let data2 = data0.field;
68
+ if(data2 && typeof data2 == "object" && !Array.isArray(data2)){
69
+ if(data2.key !== undefined){
70
+ if(typeof data2.key !== "string"){
71
+ const err4 = {instancePath:instancePath+"/" + i0+"/field/key",schemaPath:"#/$defs/filterField/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
72
+ if(vErrors === null){
73
+ vErrors = [err4];
74
+ }
75
+ else {
76
+ vErrors.push(err4);
77
+ }
78
+ errors++;
79
+ }
80
+ }
81
+ if(data2.label !== undefined){
82
+ if(typeof data2.label !== "string"){
83
+ const err5 = {instancePath:instancePath+"/" + i0+"/field/label",schemaPath:"#/$defs/filterField/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};
84
+ if(vErrors === null){
85
+ vErrors = [err5];
86
+ }
87
+ else {
88
+ vErrors.push(err5);
89
+ }
90
+ errors++;
91
+ }
92
+ }
93
+ if(data2.type !== undefined){
94
+ if(typeof data2.type !== "string"){
95
+ const err6 = {instancePath:instancePath+"/" + i0+"/field/type",schemaPath:"#/$defs/filterField/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
96
+ if(vErrors === null){
97
+ vErrors = [err6];
98
+ }
99
+ else {
100
+ vErrors.push(err6);
101
+ }
102
+ errors++;
103
+ }
104
+ }
105
+ }
106
+ else {
107
+ const err7 = {instancePath:instancePath+"/" + i0+"/field",schemaPath:"#/$defs/filterField/type",keyword:"type",params:{type: "object"},message:"must be object"};
108
+ if(vErrors === null){
109
+ vErrors = [err7];
110
+ }
111
+ else {
112
+ vErrors.push(err7);
113
+ }
114
+ errors++;
115
+ }
116
+ }
117
+ if(data0.values !== undefined){
118
+ let data6 = data0.values;
119
+ if(Array.isArray(data6)){
120
+ const len1 = data6.length;
121
+ for(let i1=0; i1<len1; i1++){
122
+ if(typeof data6[i1] !== "string"){
123
+ const err8 = {instancePath:instancePath+"/" + i0+"/values/" + i1,schemaPath:"#/items/oneOf/0/properties/values/items/type",keyword:"type",params:{type: "string"},message:"must be string"};
124
+ if(vErrors === null){
125
+ vErrors = [err8];
126
+ }
127
+ else {
128
+ vErrors.push(err8);
129
+ }
130
+ errors++;
131
+ }
132
+ }
133
+ }
134
+ else {
135
+ const err9 = {instancePath:instancePath+"/" + i0+"/values",schemaPath:"#/items/oneOf/0/properties/values/type",keyword:"type",params:{type: "array"},message:"must be array"};
136
+ if(vErrors === null){
137
+ vErrors = [err9];
138
+ }
139
+ else {
140
+ vErrors.push(err9);
141
+ }
142
+ errors++;
143
+ }
144
+ }
145
+ }
146
+ var _valid0 = _errs4 === errors;
147
+ if(_valid0){
148
+ valid2 = true;
149
+ passing0 = 0;
150
+ }
151
+ const _errs19 = errors;
152
+ if(data0 && typeof data0 == "object" && !Array.isArray(data0)){
153
+ if(data0.field === undefined){
154
+ const err10 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/1/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};
155
+ if(vErrors === null){
156
+ vErrors = [err10];
157
+ }
158
+ else {
159
+ vErrors.push(err10);
160
+ }
161
+ errors++;
162
+ }
163
+ if(data0.values === undefined){
164
+ const err11 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/1/required",keyword:"required",params:{missingProperty: "values"},message:"must have required property '"+"values"+"'"};
165
+ if(vErrors === null){
166
+ vErrors = [err11];
167
+ }
168
+ else {
169
+ vErrors.push(err11);
170
+ }
171
+ errors++;
172
+ }
173
+ if(data0.type === undefined){
174
+ const err12 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/1/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
175
+ if(vErrors === null){
176
+ vErrors = [err12];
177
+ }
178
+ else {
179
+ vErrors.push(err12);
180
+ }
181
+ errors++;
182
+ }
183
+ if(data0.type !== undefined){
184
+ if("nin" !== data0.type){
185
+ const err13 = {instancePath:instancePath+"/" + i0+"/type",schemaPath:"#/items/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue: "nin"},message:"must be equal to constant"};
186
+ if(vErrors === null){
187
+ vErrors = [err13];
188
+ }
189
+ else {
190
+ vErrors.push(err13);
191
+ }
192
+ errors++;
193
+ }
194
+ }
195
+ if(data0.field !== undefined){
196
+ let data9 = data0.field;
197
+ if(data9 && typeof data9 == "object" && !Array.isArray(data9)){
198
+ if(data9.key !== undefined){
199
+ if(typeof data9.key !== "string"){
200
+ const err14 = {instancePath:instancePath+"/" + i0+"/field/key",schemaPath:"#/$defs/filterField/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
201
+ if(vErrors === null){
202
+ vErrors = [err14];
203
+ }
204
+ else {
205
+ vErrors.push(err14);
206
+ }
207
+ errors++;
208
+ }
209
+ }
210
+ if(data9.label !== undefined){
211
+ if(typeof data9.label !== "string"){
212
+ const err15 = {instancePath:instancePath+"/" + i0+"/field/label",schemaPath:"#/$defs/filterField/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};
213
+ if(vErrors === null){
214
+ vErrors = [err15];
215
+ }
216
+ else {
217
+ vErrors.push(err15);
218
+ }
219
+ errors++;
220
+ }
221
+ }
222
+ if(data9.type !== undefined){
223
+ if(typeof data9.type !== "string"){
224
+ const err16 = {instancePath:instancePath+"/" + i0+"/field/type",schemaPath:"#/$defs/filterField/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
225
+ if(vErrors === null){
226
+ vErrors = [err16];
227
+ }
228
+ else {
229
+ vErrors.push(err16);
230
+ }
231
+ errors++;
232
+ }
233
+ }
234
+ }
235
+ else {
236
+ const err17 = {instancePath:instancePath+"/" + i0+"/field",schemaPath:"#/$defs/filterField/type",keyword:"type",params:{type: "object"},message:"must be object"};
237
+ if(vErrors === null){
238
+ vErrors = [err17];
239
+ }
240
+ else {
241
+ vErrors.push(err17);
242
+ }
243
+ errors++;
244
+ }
245
+ }
246
+ if(data0.values !== undefined){
247
+ let data13 = data0.values;
248
+ if(Array.isArray(data13)){
249
+ const len2 = data13.length;
250
+ for(let i2=0; i2<len2; i2++){
251
+ if(typeof data13[i2] !== "string"){
252
+ const err18 = {instancePath:instancePath+"/" + i0+"/values/" + i2,schemaPath:"#/items/oneOf/1/properties/values/items/type",keyword:"type",params:{type: "string"},message:"must be string"};
253
+ if(vErrors === null){
254
+ vErrors = [err18];
255
+ }
256
+ else {
257
+ vErrors.push(err18);
258
+ }
259
+ errors++;
260
+ }
261
+ }
262
+ }
263
+ else {
264
+ const err19 = {instancePath:instancePath+"/" + i0+"/values",schemaPath:"#/items/oneOf/1/properties/values/type",keyword:"type",params:{type: "array"},message:"must be array"};
265
+ if(vErrors === null){
266
+ vErrors = [err19];
267
+ }
268
+ else {
269
+ vErrors.push(err19);
270
+ }
271
+ errors++;
272
+ }
273
+ }
274
+ }
275
+ var _valid0 = _errs19 === errors;
276
+ if(_valid0 && valid2){
277
+ valid2 = false;
278
+ passing0 = [passing0, 1];
279
+ }
280
+ else {
281
+ if(_valid0){
282
+ valid2 = true;
283
+ passing0 = 1;
284
+ }
285
+ const _errs34 = errors;
286
+ if(data0 && typeof data0 == "object" && !Array.isArray(data0)){
287
+ if(data0.field === undefined){
288
+ const err20 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/2/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};
289
+ if(vErrors === null){
290
+ vErrors = [err20];
291
+ }
292
+ else {
293
+ vErrors.push(err20);
294
+ }
295
+ errors++;
296
+ }
297
+ if(data0.value === undefined){
298
+ const err21 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/2/required",keyword:"required",params:{missingProperty: "value"},message:"must have required property '"+"value"+"'"};
299
+ if(vErrors === null){
300
+ vErrors = [err21];
301
+ }
302
+ else {
303
+ vErrors.push(err21);
304
+ }
305
+ errors++;
306
+ }
307
+ if(data0.type === undefined){
308
+ const err22 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/2/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
309
+ if(vErrors === null){
310
+ vErrors = [err22];
311
+ }
312
+ else {
313
+ vErrors.push(err22);
314
+ }
315
+ errors++;
316
+ }
317
+ if(data0.type !== undefined){
318
+ if("gte" !== data0.type){
319
+ const err23 = {instancePath:instancePath+"/" + i0+"/type",schemaPath:"#/items/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue: "gte"},message:"must be equal to constant"};
320
+ if(vErrors === null){
321
+ vErrors = [err23];
322
+ }
323
+ else {
324
+ vErrors.push(err23);
325
+ }
326
+ errors++;
327
+ }
328
+ }
329
+ if(data0.field !== undefined){
330
+ let data16 = data0.field;
331
+ if(data16 && typeof data16 == "object" && !Array.isArray(data16)){
332
+ if(data16.key !== undefined){
333
+ if(typeof data16.key !== "string"){
334
+ const err24 = {instancePath:instancePath+"/" + i0+"/field/key",schemaPath:"#/$defs/filterField/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
335
+ if(vErrors === null){
336
+ vErrors = [err24];
337
+ }
338
+ else {
339
+ vErrors.push(err24);
340
+ }
341
+ errors++;
342
+ }
343
+ }
344
+ if(data16.label !== undefined){
345
+ if(typeof data16.label !== "string"){
346
+ const err25 = {instancePath:instancePath+"/" + i0+"/field/label",schemaPath:"#/$defs/filterField/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};
347
+ if(vErrors === null){
348
+ vErrors = [err25];
349
+ }
350
+ else {
351
+ vErrors.push(err25);
352
+ }
353
+ errors++;
354
+ }
355
+ }
356
+ if(data16.type !== undefined){
357
+ if(typeof data16.type !== "string"){
358
+ const err26 = {instancePath:instancePath+"/" + i0+"/field/type",schemaPath:"#/$defs/filterField/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
359
+ if(vErrors === null){
360
+ vErrors = [err26];
361
+ }
362
+ else {
363
+ vErrors.push(err26);
364
+ }
365
+ errors++;
366
+ }
367
+ }
368
+ }
369
+ else {
370
+ const err27 = {instancePath:instancePath+"/" + i0+"/field",schemaPath:"#/$defs/filterField/type",keyword:"type",params:{type: "object"},message:"must be object"};
371
+ if(vErrors === null){
372
+ vErrors = [err27];
373
+ }
374
+ else {
375
+ vErrors.push(err27);
376
+ }
377
+ errors++;
378
+ }
379
+ }
380
+ if(data0.value !== undefined){
381
+ if(typeof data0.value !== "string"){
382
+ const err28 = {instancePath:instancePath+"/" + i0+"/value",schemaPath:"#/items/oneOf/2/properties/value/type",keyword:"type",params:{type: "string"},message:"must be string"};
383
+ if(vErrors === null){
384
+ vErrors = [err28];
385
+ }
386
+ else {
387
+ vErrors.push(err28);
388
+ }
389
+ errors++;
390
+ }
391
+ }
392
+ }
393
+ var _valid0 = _errs34 === errors;
394
+ if(_valid0 && valid2){
395
+ valid2 = false;
396
+ passing0 = [passing0, 2];
397
+ }
398
+ else {
399
+ if(_valid0){
400
+ valid2 = true;
401
+ passing0 = 2;
402
+ }
403
+ const _errs47 = errors;
404
+ if(data0 && typeof data0 == "object" && !Array.isArray(data0)){
405
+ if(data0.field === undefined){
406
+ const err29 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/3/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};
407
+ if(vErrors === null){
408
+ vErrors = [err29];
409
+ }
410
+ else {
411
+ vErrors.push(err29);
412
+ }
413
+ errors++;
414
+ }
415
+ if(data0.value === undefined){
416
+ const err30 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/3/required",keyword:"required",params:{missingProperty: "value"},message:"must have required property '"+"value"+"'"};
417
+ if(vErrors === null){
418
+ vErrors = [err30];
419
+ }
420
+ else {
421
+ vErrors.push(err30);
422
+ }
423
+ errors++;
424
+ }
425
+ if(data0.type === undefined){
426
+ const err31 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/3/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
427
+ if(vErrors === null){
428
+ vErrors = [err31];
429
+ }
430
+ else {
431
+ vErrors.push(err31);
432
+ }
433
+ errors++;
434
+ }
435
+ if(data0.type !== undefined){
436
+ if("lte" !== data0.type){
437
+ const err32 = {instancePath:instancePath+"/" + i0+"/type",schemaPath:"#/items/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue: "lte"},message:"must be equal to constant"};
438
+ if(vErrors === null){
439
+ vErrors = [err32];
440
+ }
441
+ else {
442
+ vErrors.push(err32);
443
+ }
444
+ errors++;
445
+ }
446
+ }
447
+ if(data0.field !== undefined){
448
+ let data22 = data0.field;
449
+ if(data22 && typeof data22 == "object" && !Array.isArray(data22)){
450
+ if(data22.key !== undefined){
451
+ if(typeof data22.key !== "string"){
452
+ const err33 = {instancePath:instancePath+"/" + i0+"/field/key",schemaPath:"#/$defs/filterField/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
453
+ if(vErrors === null){
454
+ vErrors = [err33];
455
+ }
456
+ else {
457
+ vErrors.push(err33);
458
+ }
459
+ errors++;
460
+ }
461
+ }
462
+ if(data22.label !== undefined){
463
+ if(typeof data22.label !== "string"){
464
+ const err34 = {instancePath:instancePath+"/" + i0+"/field/label",schemaPath:"#/$defs/filterField/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};
465
+ if(vErrors === null){
466
+ vErrors = [err34];
467
+ }
468
+ else {
469
+ vErrors.push(err34);
470
+ }
471
+ errors++;
472
+ }
473
+ }
474
+ if(data22.type !== undefined){
475
+ if(typeof data22.type !== "string"){
476
+ const err35 = {instancePath:instancePath+"/" + i0+"/field/type",schemaPath:"#/$defs/filterField/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
477
+ if(vErrors === null){
478
+ vErrors = [err35];
479
+ }
480
+ else {
481
+ vErrors.push(err35);
482
+ }
483
+ errors++;
484
+ }
485
+ }
486
+ }
487
+ else {
488
+ const err36 = {instancePath:instancePath+"/" + i0+"/field",schemaPath:"#/$defs/filterField/type",keyword:"type",params:{type: "object"},message:"must be object"};
489
+ if(vErrors === null){
490
+ vErrors = [err36];
491
+ }
492
+ else {
493
+ vErrors.push(err36);
494
+ }
495
+ errors++;
496
+ }
497
+ }
498
+ if(data0.value !== undefined){
499
+ if(typeof data0.value !== "string"){
500
+ const err37 = {instancePath:instancePath+"/" + i0+"/value",schemaPath:"#/items/oneOf/3/properties/value/type",keyword:"type",params:{type: "string"},message:"must be string"};
501
+ if(vErrors === null){
502
+ vErrors = [err37];
503
+ }
504
+ else {
505
+ vErrors.push(err37);
506
+ }
507
+ errors++;
508
+ }
509
+ }
510
+ }
511
+ var _valid0 = _errs47 === errors;
512
+ if(_valid0 && valid2){
513
+ valid2 = false;
514
+ passing0 = [passing0, 3];
515
+ }
516
+ else {
517
+ if(_valid0){
518
+ valid2 = true;
519
+ passing0 = 3;
520
+ }
521
+ const _errs60 = errors;
522
+ if(data0 && typeof data0 == "object" && !Array.isArray(data0)){
523
+ if(data0.field === undefined){
524
+ const err38 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/4/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};
525
+ if(vErrors === null){
526
+ vErrors = [err38];
527
+ }
528
+ else {
529
+ vErrors.push(err38);
530
+ }
531
+ errors++;
532
+ }
533
+ if(data0.value === undefined){
534
+ const err39 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/4/required",keyword:"required",params:{missingProperty: "value"},message:"must have required property '"+"value"+"'"};
535
+ if(vErrors === null){
536
+ vErrors = [err39];
537
+ }
538
+ else {
539
+ vErrors.push(err39);
540
+ }
541
+ errors++;
542
+ }
543
+ if(data0.type === undefined){
544
+ const err40 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf/4/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
545
+ if(vErrors === null){
546
+ vErrors = [err40];
547
+ }
548
+ else {
549
+ vErrors.push(err40);
550
+ }
551
+ errors++;
552
+ }
553
+ if(data0.type !== undefined){
554
+ if("starts" !== data0.type){
555
+ const err41 = {instancePath:instancePath+"/" + i0+"/type",schemaPath:"#/items/oneOf/4/properties/type/const",keyword:"const",params:{allowedValue: "starts"},message:"must be equal to constant"};
556
+ if(vErrors === null){
557
+ vErrors = [err41];
558
+ }
559
+ else {
560
+ vErrors.push(err41);
561
+ }
562
+ errors++;
563
+ }
564
+ }
565
+ if(data0.field !== undefined){
566
+ let data28 = data0.field;
567
+ if(data28 && typeof data28 == "object" && !Array.isArray(data28)){
568
+ if(data28.key !== undefined){
569
+ if(typeof data28.key !== "string"){
570
+ const err42 = {instancePath:instancePath+"/" + i0+"/field/key",schemaPath:"#/$defs/filterFieldString/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
571
+ if(vErrors === null){
572
+ vErrors = [err42];
573
+ }
574
+ else {
575
+ vErrors.push(err42);
576
+ }
577
+ errors++;
578
+ }
579
+ }
580
+ if(data28.label !== undefined){
581
+ if(typeof data28.label !== "string"){
582
+ const err43 = {instancePath:instancePath+"/" + i0+"/field/label",schemaPath:"#/$defs/filterFieldString/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};
583
+ if(vErrors === null){
584
+ vErrors = [err43];
585
+ }
586
+ else {
587
+ vErrors.push(err43);
588
+ }
589
+ errors++;
590
+ }
591
+ }
592
+ if(data28.type !== undefined){
593
+ if(typeof data28.type !== "string"){
594
+ const err44 = {instancePath:instancePath+"/" + i0+"/field/type",schemaPath:"#/$defs/filterFieldString/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
595
+ if(vErrors === null){
596
+ vErrors = [err44];
597
+ }
598
+ else {
599
+ vErrors.push(err44);
600
+ }
601
+ errors++;
602
+ }
603
+ }
604
+ }
605
+ else {
606
+ const err45 = {instancePath:instancePath+"/" + i0+"/field",schemaPath:"#/$defs/filterFieldString/type",keyword:"type",params:{type: "object"},message:"must be object"};
607
+ if(vErrors === null){
608
+ vErrors = [err45];
609
+ }
610
+ else {
611
+ vErrors.push(err45);
612
+ }
613
+ errors++;
614
+ }
615
+ }
616
+ if(data0.value !== undefined){
617
+ if(typeof data0.value !== "string"){
618
+ const err46 = {instancePath:instancePath+"/" + i0+"/value",schemaPath:"#/items/oneOf/4/properties/value/type",keyword:"type",params:{type: "string"},message:"must be string"};
619
+ if(vErrors === null){
620
+ vErrors = [err46];
621
+ }
622
+ else {
623
+ vErrors.push(err46);
624
+ }
625
+ errors++;
626
+ }
627
+ }
628
+ }
629
+ var _valid0 = _errs60 === errors;
630
+ if(_valid0 && valid2){
631
+ valid2 = false;
632
+ passing0 = [passing0, 4];
633
+ }
634
+ else {
635
+ if(_valid0){
636
+ valid2 = true;
637
+ passing0 = 4;
638
+ }
639
+ }
640
+ }
641
+ }
642
+ }
643
+ if(!valid2){
644
+ const err47 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};
645
+ if(vErrors === null){
646
+ vErrors = [err47];
647
+ }
648
+ else {
649
+ vErrors.push(err47);
650
+ }
651
+ errors++;
652
+ }
653
+ else {
654
+ errors = _errs3;
655
+ if(vErrors !== null){
656
+ if(_errs3){
657
+ vErrors.length = _errs3;
658
+ }
659
+ else {
660
+ vErrors = null;
661
+ }
662
+ }
663
+ }
664
+ if(data0 && typeof data0 == "object" && !Array.isArray(data0)){
665
+ if(data0.type === undefined){
666
+ const err48 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
667
+ if(vErrors === null){
668
+ vErrors = [err48];
669
+ }
670
+ else {
671
+ vErrors.push(err48);
672
+ }
673
+ errors++;
674
+ }
675
+ }
676
+ else {
677
+ const err49 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};
678
+ if(vErrors === null){
679
+ vErrors = [err49];
680
+ }
681
+ else {
682
+ vErrors.push(err49);
683
+ }
684
+ errors++;
685
+ }
686
+ }
687
+ }
688
+ else {
689
+ const err50 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};
690
+ if(vErrors === null){
691
+ vErrors = [err50];
692
+ }
693
+ else {
694
+ vErrors.push(err50);
695
+ }
696
+ errors++;
697
+ }
698
+ validate15.errors = vErrors;
699
+ return errors === 0;
700
+ }
701
+
702
+
703
+ function validate14(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
704
+ /*# sourceURL="https://github.com/data-fair/catalog-data-fair/import-config" */;
705
+ let vErrors = null;
706
+ let errors = 0;
707
+ if(data && typeof data == "object" && !Array.isArray(data)){
708
+ for(const key0 in data){
709
+ if(!((key0 === "fields") || (key0 === "filters"))){
710
+ const err0 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};
711
+ if(vErrors === null){
712
+ vErrors = [err0];
713
+ }
714
+ else {
715
+ vErrors.push(err0);
716
+ }
717
+ errors++;
718
+ }
719
+ }
720
+ if(data.fields !== undefined){
721
+ let data0 = data.fields;
722
+ if(Array.isArray(data0)){
723
+ const len0 = data0.length;
724
+ for(let i0=0; i0<len0; i0++){
725
+ let data1 = data0[i0];
726
+ if(data1 && typeof data1 == "object" && !Array.isArray(data1)){
727
+ if(data1.key !== undefined){
728
+ if(typeof data1.key !== "string"){
729
+ const err1 = {instancePath:instancePath+"/fields/" + i0+"/key",schemaPath:"#/properties/fields/items/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
730
+ if(vErrors === null){
731
+ vErrors = [err1];
732
+ }
733
+ else {
734
+ vErrors.push(err1);
735
+ }
736
+ errors++;
737
+ }
738
+ }
739
+ if(data1.label !== undefined){
740
+ if(typeof data1.label !== "string"){
741
+ const err2 = {instancePath:instancePath+"/fields/" + i0+"/label",schemaPath:"#/properties/fields/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};
742
+ if(vErrors === null){
743
+ vErrors = [err2];
744
+ }
745
+ else {
746
+ vErrors.push(err2);
747
+ }
748
+ errors++;
749
+ }
750
+ }
751
+ if(data1.type !== undefined){
752
+ if(typeof data1.type !== "string"){
753
+ const err3 = {instancePath:instancePath+"/fields/" + i0+"/type",schemaPath:"#/properties/fields/items/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
754
+ if(vErrors === null){
755
+ vErrors = [err3];
756
+ }
757
+ else {
758
+ vErrors.push(err3);
759
+ }
760
+ errors++;
761
+ }
762
+ }
763
+ }
764
+ else {
765
+ const err4 = {instancePath:instancePath+"/fields/" + i0,schemaPath:"#/properties/fields/items/type",keyword:"type",params:{type: "object"},message:"must be object"};
766
+ if(vErrors === null){
767
+ vErrors = [err4];
768
+ }
769
+ else {
770
+ vErrors.push(err4);
771
+ }
772
+ errors++;
773
+ }
774
+ }
775
+ }
776
+ else {
777
+ const err5 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type: "array"},message:"must be array"};
778
+ if(vErrors === null){
779
+ vErrors = [err5];
780
+ }
781
+ else {
782
+ vErrors.push(err5);
783
+ }
784
+ errors++;
785
+ }
786
+ }
787
+ if(data.filters !== undefined){
788
+ if(!(validate15(data.filters, {instancePath:instancePath+"/filters",parentData:data,parentDataProperty:"filters",rootData}))){
789
+ vErrors = vErrors === null ? validate15.errors : vErrors.concat(validate15.errors);
790
+ errors = vErrors.length;
791
+ }
792
+ }
793
+ }
794
+ else {
795
+ const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};
796
+ if(vErrors === null){
797
+ vErrors = [err6];
798
+ }
799
+ else {
800
+ vErrors.push(err6);
801
+ }
802
+ errors++;
803
+ }
804
+ validate14.errors = vErrors;
805
+ return errors === 0;
806
+ }