Repository navigation
Expand file tree
/
Copy pathprocessing-config-schema.json
More file actions
518 lines (518 loc) · 27.1 KB
/
Copy pathprocessing-config-schema.json
File metadata and controls
518 lines (518 loc) · 27.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
{
"type": "object",
"layout": "tabs",
"required": ["datasetMode"],
"allOf": [
{
"title": "Dataset",
"x-i18n-title": { "fr": "Jeu de données" },
"default": { "datasetMode": "update" },
"oneOf": [
{
"title": "Dataset creation",
"x-i18n-title": { "fr": "Créer un jeu de données", "en": "Create a dataset" },
"required": ["datasetMode", "datasetTitle"],
"properties": {
"datasetMode": {
"type": "string",
"const": "create",
"title": "Action"
},
"datasetTitle": {
"type": "string",
"title": "Title of the dataset to create",
"x-i18n-title": { "fr": "Titre du jeu de données à créer" },
"description": "The dataset is created on the first run. This processing then switches automatically to the \"Update a dataset\" mode on the created dataset: the following runs update it instead of creating a new one.",
"x-i18n-description": { "fr": "Le jeu de données est créé à la première exécution. Ce traitement bascule ensuite automatiquement en mode « Mettre à jour un jeu de données » sur le jeu créé : les exécutions suivantes le mettent à jour au lieu d'en créer un nouveau." }
},
"editableCreate": {
"type": "boolean",
"default": false,
"title": "Editable dataset",
"x-i18n-title": { "fr": "Jeu de données éditable" },
"description": "Unchecked, a **file** dataset is created: data-fair infers the column types from the CSV, and each run replaces the whole file.\n\nChecked, an **editable** dataset is created with the columns of the mapping, all of type text: adjust the types and define a primary key in the dataset schema after the creation. The following runs add or modify the rows according to this key, or replace the data if the option is checked.",
"x-i18n-description": { "fr": "Décoché, un jeu de données **fichier** est créé : data-fair déduit les types des colonnes du CSV, et chaque exécution remplace le fichier entier.\n\nCoché, un jeu de données **éditable** est créé avec les colonnes du mapping, toutes de type texte : ajustez les types et définissez une clé primaire dans le schéma du jeu de données après la création. Les exécutions suivantes ajoutent ou modifient les lignes selon cette clé, ou remplacent les données si l'option est cochée." }
}
}
},
{
"title": "Dataset update",
"x-i18n-title": { "fr": "Mettre à jour un jeu de données", "en": "Update a dataset" },
"required": ["datasetMode", "dataset"],
"properties": {
"datasetMode": {
"type": "string",
"const": "update",
"title": "Action"
},
"dataset": {
"type": "object",
"title": "Dataset",
"x-i18n-title": { "fr": "Jeu de données" },
"description": "File or editable dataset. For an editable dataset, the columns of the mapping must already exist in its schema and a primary key must be defined.",
"x-i18n-description": { "fr": "Jeu de données fichier ou éditable. Pour un jeu éditable, les colonnes du mapping doivent déjà exister dans son schéma et une clé primaire doit être définie." },
"layout": {
"getItems": {
"url": "${context.dataFairUrl}/api/v1/datasets?select=id,title,isRest&size=50&${context.ownerFilter}&raw=true",
"qSearchParam": "q",
"itemsResults": "data.results",
"itemTitle": "item.title + (item.isRest ? ' (editable)' : '')",
"x-i18n-itemTitle": { "fr": "item.title + (item.isRest ? ' (éditable)' : '')" },
"itemKey": "item.id"
}
},
"properties": {
"id": {
"type": "string",
"title": "Identifier",
"x-i18n-title": { "fr": "Identifiant" }
},
"title": {
"type": "string",
"title": "Title",
"x-i18n-title": { "fr": "Titre" }
},
"isRest": { "type": "boolean", "layout": "none" }
}
},
"drop": {
"type": "boolean",
"default": false,
"title": "Replace the data",
"x-i18n-title": { "fr": "Remplacer les données" },
"description": "Deletes the existing rows that the API no longer returns, instead of keeping them. The replacement is atomic: if an error occurs, the previous data is kept.",
"x-i18n-description": { "fr": "Supprime les lignes existantes qui ne sont plus renvoyées par l'API, plutôt que de les conserver. Le remplacement est atomique : en cas d'erreur, les données précédentes sont conservées." },
"layout": { "if": "parent.data.dataset?.isRest" }
}
}
}
]
},
{
"title": "Data source",
"x-i18n-title": { "fr": "Source des données" },
"type": "object",
"required": ["apiURL", "auth"],
"properties": {
"apiURL": {
"title": "API URL",
"x-i18n-title": { "fr": "URL de l'API" },
"type": "string",
"description": "Full URL of the request, fixed parameters included (e.g. `https://api.example.com/v2/items?contract_id=1234`). The pagination parameters are added automatically. The response must be JSON.",
"x-i18n-description": { "fr": "URL complète de la requête, paramètres fixes compris (ex : `https://api.exemple.fr/v2/items?contract_id=1234`). Les paramètres de pagination y sont ajoutés automatiquement. La réponse doit être du JSON." }
},
"apiMethod": {
"title": "HTTP method",
"x-i18n-title": { "fr": "Méthode HTTP" },
"type": "string",
"description": "`GET` by default. Choose `POST` for APIs that expect their criteria in the request body.",
"x-i18n-description": { "fr": "`GET` par défaut. Choisissez `POST` pour les API qui attendent leurs critères dans le corps de la requête." },
"enum": ["GET", "POST"],
"default": "GET"
},
"apiBody": {
"title": "Request body (JSON)",
"x-i18n-title": { "fr": "Corps de la requête (JSON)" },
"type": "string",
"description": "JSON object sent as the body of the `POST` request, on every page.",
"x-i18n-description": { "fr": "Objet JSON envoyé comme corps de la requête `POST`, à chaque page." },
"layout": {
"comp": "textarea",
"if": "parent.data.apiMethod === 'POST'"
}
},
"auth": {
"type": "object",
"title": "Authentication method",
"x-i18n-title": { "fr": "Méthode d'authentification" },
"description": "The secrets (password, key, client secret) are stored apart from the configuration and masked once saved.",
"x-i18n-description": { "fr": "Les secrets (mot de passe, clé, secret client) sont stockés à part de la configuration et masqués après enregistrement." },
"default": { "authMethod": "noAuth" },
"oneOf": [
{
"title": "No authentication",
"x-i18n-title": { "fr": "Pas d'authentification" },
"properties": {
"authMethod": { "type": "string", "const": "noAuth" }
}
},
{
"title": "Basic auth",
"properties": {
"authMethod": { "type": "string", "const": "basicAuth" },
"username": {
"type": "string",
"title": "Username",
"x-i18n-title": { "fr": "Nom d'utilisateur" }
},
"password": {
"type": "string",
"title": "Password",
"x-i18n-title": { "fr": "Mot de passe" },
"layout": {
"props": { "type": "password", "autocomplete": "new-password" }
}
}
}
},
{
"title": "Bearer token",
"x-i18n-title": { "fr": "Jeton Bearer" },
"properties": {
"authMethod": { "type": "string", "const": "bearerAuth" },
"token": {
"type": "string",
"title": "Token",
"x-i18n-title": { "fr": "Jeton" },
"description": "Sent as is in the `Authorization: Bearer <token>` header. For a token that expires, prefer the \"Login then token\" method.",
"x-i18n-description": { "fr": "Envoyé tel quel dans l'en-tête `Authorization: Bearer <jeton>`. Pour un jeton qui expire, préférez la méthode « Connexion puis jeton »." }
}
}
},
{
"title": "API key in a header",
"x-i18n-title": { "fr": "Clé d'API dans un en-tête" },
"properties": {
"authMethod": { "type": "string", "const": "apiKey" },
"apiKeyHeader": {
"type": "string",
"title": "Header name",
"x-i18n-title": { "fr": "Nom de l'en-tête" },
"description": "E.g. `X-API-Key`",
"x-i18n-description": { "fr": "Ex : `X-API-Key`" }
},
"apiKeyValue": {
"type": "string",
"title": "Key value",
"x-i18n-title": { "fr": "Valeur de la clé" },
"layout": {
"props": { "type": "password", "autocomplete": "new-password" }
}
}
}
},
{
"title": "OAuth 2.0",
"required": ["grantType", "tokenURL", "clientId", "clientSecret"],
"properties": {
"authMethod": { "type": "string", "const": "oauth2" },
"grantType": {
"type": "string",
"title": "Grant type",
"x-i18n-title": { "fr": "Type de grant" },
"default": "client_credentials",
"oneOf": [
{
"title": "Client credentials",
"const": "client_credentials"
},
{
"title": "Password credentials",
"const": "password_credentials"
}
]
},
"tokenURL": {
"type": "string",
"title": "Token URL",
"x-i18n-title": { "fr": "URL d'obtention du jeton" },
"description": "`token` endpoint of the authorization server. The token obtained is sent in the `Authorization: Bearer` header.",
"x-i18n-description": { "fr": "Endpoint `token` du serveur d'autorisation. Le jeton obtenu est envoyé dans l'en-tête `Authorization: Bearer`." }
},
"clientId": { "type": "string", "title": "Client ID" },
"clientSecret": {
"type": "string",
"title": "Client secret",
"layout": {
"props": { "type": "password", "autocomplete": "new-password" }
}
},
"scope": {
"type": "string",
"title": "Scope",
"description": "Optional, depending on the API.",
"x-i18n-description": { "fr": "Optionnel, selon l'API." }
},
"username": {
"type": "string",
"title": "Username",
"x-i18n-title": { "fr": "Nom d'utilisateur" },
"layout": { "if": "parent.data.grantType === 'password_credentials'" }
},
"password": {
"type": "string",
"title": "Password",
"x-i18n-title": { "fr": "Mot de passe" },
"layout": {
"props": { "type": "password", "autocomplete": "new-password" },
"if": "parent.data.grantType === 'password_credentials'"
}
}
}
},
{
"title": "Login then token (session)",
"x-i18n-title": { "fr": "Connexion puis jeton (session)" },
"required": ["loginURL"],
"properties": {
"authMethod": { "type": "string", "const": "session" },
"loginURL": {
"type": "string",
"title": "Login URL",
"x-i18n-title": { "fr": "URL de connexion" },
"description": "Called once per run to get a token, then sent on every request in the header configured below. Suits custom APIs (Parkki, GLPI…) whose token expires.\n\nE.g. `https://client.parkki.io/v2.4/auth/app`, `https://glpi.example.com/apirest.php/initSession`",
"x-i18n-description": { "fr": "Appelée une fois par exécution pour obtenir un jeton, ensuite envoyé sur chaque requête dans l'en-tête configuré plus bas. Convient aux API « maison » (Parkki, GLPI…) dont le jeton expire.\n\nEx : `https://client.parkki.io/v2.4/auth/app`, `https://glpi.exemple.fr/apirest.php/initSession`" }
},
"loginMethod": {
"type": "string",
"title": "Login HTTP method",
"x-i18n-title": { "fr": "Méthode HTTP de connexion" },
"default": "GET",
"enum": ["GET", "POST"]
},
"username": {
"type": "string",
"title": "Identifier",
"x-i18n-title": { "fr": "Identifiant" },
"description": "Username, or application identifier (e.g. `app_id`).",
"x-i18n-description": { "fr": "Nom d'utilisateur, ou identifiant d'application (ex : `app_id`)." },
"default": ""
},
"password": {
"type": "string",
"title": "Secret",
"description": "Password, or API key of the application.",
"x-i18n-description": { "fr": "Mot de passe, ou clé d'API de l'application." },
"default": "",
"layout": {
"props": { "type": "password", "autocomplete": "new-password" }
}
},
"usernameField": {
"type": "string",
"title": "Name of the \"identifier\" field in the request body",
"x-i18n-title": { "fr": "Nom du champ « identifiant » dans le corps de la requête" },
"description": "Fill in both field names to send the credentials as JSON in the request body (e.g. `app_id` / `api_key`). Leave empty to send them with Basic auth (GLPI).",
"x-i18n-description": { "fr": "Renseignez les deux noms de champ pour envoyer les identifiants en JSON dans le corps de la requête (ex : `app_id` / `api_key`). Laissez vide pour les envoyer en Basic auth (GLPI)." },
"layout": { "if": "parent.data.loginMethod === 'POST'", "cols": 6 }
},
"passwordField": {
"type": "string",
"title": "Name of the \"secret\" field in the request body",
"x-i18n-title": { "fr": "Nom du champ « secret » dans le corps de la requête" },
"layout": { "if": "parent.data.loginMethod === 'POST'", "cols": 6 }
},
"tokenPath": {
"type": "string",
"title": "Token path in the response",
"x-i18n-title": { "fr": "Chemin du jeton dans la réponse" },
"description": "Dot notation (e.g. `session_token`, `access_token.token`).",
"x-i18n-description": { "fr": "Notation par points (ex : `session_token`, `access_token.token`)." },
"default": "session_token",
"layout": { "cols": 6 }
},
"tokenHeader": {
"type": "string",
"title": "Token header name",
"x-i18n-title": { "fr": "Nom de l'en-tête du jeton" },
"description": "Header added on the data requests (e.g. `Session-Token`, `X-Access-Token`).",
"x-i18n-description": { "fr": "En-tête ajouté sur les requêtes de données (ex : `Session-Token`, `X-Access-Token`)." },
"default": "Session-Token",
"layout": { "cols": 6 }
},
"tokenApp": {
"type": "string",
"title": "App-Token (GLPI)",
"description": "String provided by the GLPI configuration, sent in the `App-Token` header on every request.",
"x-i18n-description": { "fr": "Chaîne fournie par la configuration GLPI, envoyée dans l'en-tête `App-Token` sur toutes les requêtes." },
"default": ""
},
"tokenUser": {
"type": "string",
"title": "user_token (GLPI)",
"description": "Personal token defined in the preferences of the GLPI user, used instead of the identifier and the secret.",
"x-i18n-description": { "fr": "Jeton personnel défini dans les préférences de l'utilisateur GLPI, utilisé à la place de l'identifiant et du secret." },
"default": ""
}
}
}
]
},
"pagination": {
"title": "Pagination",
"type": "object",
"description": "If the API returns its results in pages, tell how to move to the next one. All the pages are read before the dataset is written.",
"x-i18n-description": { "fr": "Si l'API renvoie ses résultats par pages, indiquez comment passer à la suivante. Toutes les pages sont lues avant l'écriture du jeu de données." },
"default": { "method": "none" },
"oneOf": [
{
"title": "No pagination",
"x-i18n-title": { "fr": "Pas de pagination" },
"properties": {
"method": { "type": "string", "const": "none" }
}
},
{
"title": "Next page link in the response",
"x-i18n-title": { "fr": "Lien vers la page suivante dans la réponse" },
"required": ["nextPagePath"],
"properties": {
"method": { "type": "string", "const": "nextPageData" },
"nextPagePath": {
"type": "string",
"title": "Next page URL path",
"x-i18n-title": { "fr": "Chemin de l'URL de la page suivante" },
"description": "Dot notation in the JSON response (e.g. `next`, `links.next`). The pagination stops when this path is empty.",
"x-i18n-description": { "fr": "Notation par points dans la réponse JSON (ex : `next`, `links.next`). La pagination s'arrête quand ce chemin est vide." }
},
"limitKey": {
"type": "string",
"title": "Limit parameter",
"x-i18n-title": { "fr": "Paramètre « limit »" },
"description": "Optional. Name of the URL parameter setting the page size (e.g. `limit`, `size`), added to the first request only.",
"x-i18n-description": { "fr": "Optionnel. Nom du paramètre d'URL fixant la taille de page (ex : `limit`, `size`), ajouté à la première requête seulement." }
},
"limitValue": {
"type": "number",
"title": "Items per page",
"x-i18n-title": { "fr": "Éléments par page" },
"default": 1000
}
}
},
{
"title": "Offset / limit parameters in the URL",
"x-i18n-title": { "fr": "Paramètres offset / limit dans l'URL" },
"required": ["offsetKey"],
"properties": {
"method": { "type": "string", "const": "queryParams" },
"offsetKey": {
"type": "string",
"title": "Offset parameter",
"x-i18n-title": { "fr": "Paramètre « offset »" },
"description": "Name of the URL parameter incremented on each page (e.g. `offset`, `skip`, `page`).",
"x-i18n-description": { "fr": "Nom du paramètre d'URL incrémenté à chaque page (ex : `offset`, `skip`, `page`)." },
"default": "offset"
},
"offsetPages": {
"type": "boolean",
"title": "Offset as a page number",
"x-i18n-title": { "fr": "Offset en numéro de page" },
"description": "Increments the parameter by 1 on each page (`page=1`, `page=2`…) instead of by the number of rows already read.",
"x-i18n-description": { "fr": "Incrémente le paramètre de 1 à chaque page (`page=1`, `page=2`…) plutôt que du nombre de lignes déjà lues." },
"default": false
},
"limitKey": {
"type": "string",
"title": "Limit parameter",
"x-i18n-title": { "fr": "Paramètre « limit »" },
"description": "Name of the URL parameter setting the page size (e.g. `limit`, `take`). Without it, the pagination goes on as long as the API returns rows.",
"x-i18n-description": { "fr": "Nom du paramètre d'URL fixant la taille de page (ex : `limit`, `take`). Sans lui, la pagination continue tant que l'API renvoie des lignes." }
},
"limitValue": {
"type": "number",
"title": "Items per page",
"x-i18n-title": { "fr": "Éléments par page" },
"description": "A page shorter than this value marks the end of the pagination.",
"x-i18n-description": { "fr": "Une page plus courte que cette valeur marque la fin de la pagination." },
"default": 1000
}
}
}
]
}
}
},
{
"title": "Fields to retrieve",
"x-i18n-title": { "fr": "Champs à récupérer" },
"required": ["block"],
"properties": {
"resultsPath": {
"type": "string",
"title": "Results array path",
"x-i18n-title": { "fr": "Chemin du tableau de résultats" },
"description": "Dot notation to the array to go through in the JSON response (e.g. `displays`, `data.results`). Leave empty if the response is the array itself.",
"x-i18n-description": { "fr": "Notation par points vers le tableau à parcourir dans la réponse JSON (ex : `displays`, `data.results`). Laissez vide si la réponse est directement le tableau." },
"default": ""
},
"block": { "$ref": "#/definitions/block" },
"separator": {
"type": "string",
"title": "Multiple values separator",
"x-i18n-title": { "fr": "Séparateur des valeurs multiples" },
"description": "Used to join the values of a `[]` path into a single column.",
"x-i18n-description": { "fr": "Utilisé pour concaténer les valeurs d'un chemin `[]` dans une seule colonne." },
"default": ";"
}
}
}
],
"definitions": {
"block": {
"type": "object",
"properties": {
"mapping": {
"type": "array",
"title": "Columns",
"x-i18n-title": { "fr": "Colonnes" },
"description": "One row per column of the dataset, with the path of the value in each item of the results array.",
"x-i18n-description": { "fr": "Une ligne par colonne du jeu de données, avec le chemin de la valeur dans chaque élément du tableau de résultats." },
"layout": {
"listEditMode": "inline",
"messages": { "addItem": "Add a column" },
"x-i18n-messages": {
"fr": { "addItem": "Ajouter une colonne" }
}
},
"items": {
"type": "object",
"required": ["key", "path"],
"properties": {
"key": {
"type": "string",
"title": "Column key",
"x-i18n-title": { "fr": "Clé de la colonne" },
"description": "Identifier of the column in the dataset (e.g. `NOM_PR`).",
"x-i18n-description": { "fr": "Identifiant de la colonne dans le jeu de données (ex : `NOM_PR`)." },
"layout": { "cols": 6 }
},
"path": {
"type": "string",
"title": "Path in the JSON",
"x-i18n-title": { "fr": "Chemin dans le JSON" },
"description": "Dot notation from the current item, `[]` to extract all the values of an array.\n\n* `owner.name`: nested property.\n* `topics[].title`: all the titles of the array, joined with the separator.\n* `attributes.0` or `attributes.1.title`: a given item of an array, by its position (starting from 0, not `[0]`).",
"x-i18n-description": { "fr": "Notation par points depuis l'élément courant, `[]` pour extraire toutes les valeurs d'un tableau.\n\n* `owner.name` : propriété imbriquée.\n* `topics[].title` : tous les titres du tableau, concaténés avec le séparateur.\n* `attributes.0` ou `attributes.1.title` : un élément précis d'un tableau, par sa position (à partir de 0, pas `[0]`)." },
"layout": { "cols": 6 }
}
}
}
},
"expand": {
"title": "Nested array expansion",
"x-i18n-title": { "fr": "Développer un tableau imbriqué en plusieurs lignes", "en": "Expand a nested array into several rows" },
"type": "object",
"layout": "card",
"description": "Optional. Produces one row per item of the given array, repeating the columns of the upper level.",
"x-i18n-description": { "fr": "Optionnel. Produit une ligne par élément du tableau indiqué, en répétant les colonnes du niveau supérieur." },
"properties": {
"path": {
"type": "string",
"title": "Array path",
"x-i18n-title": { "fr": "Chemin du tableau" },
"description": "Dot notation from the current item (e.g. `children`).",
"x-i18n-description": { "fr": "Notation par points depuis l'élément courant (ex : `children`)." }
}
},
"dependencies": {
"path": {
"properties": {
"block": { "$ref": "#/definitions/block" }
}
}
}
}
}
}
}
}