@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.
- package/README.md +4 -0
- package/index.ts +36 -0
- package/lib/capabilities.ts +18 -0
- package/lib/download.ts +226 -0
- package/lib/imports.ts +58 -0
- package/lib/prepare.ts +23 -0
- package/lib/resources/thumbnail.svg +19 -0
- package/package.json +54 -0
- package/types/catalogConfig/.type/index.d.ts +20 -0
- package/types/catalogConfig/.type/index.js +53 -0
- package/types/catalogConfig/.type/validate.js +102 -0
- package/types/catalogConfig/index.ts +1 -0
- package/types/catalogConfig/schema.json +30 -0
- package/types/datafairSchemas/.type/index.d.ts +231 -0
- package/types/datafairSchemas/.type/index.js +7 -0
- package/types/datafairSchemas/index.ts +1 -0
- package/types/datafairSchemas/schema.json +378 -0
- package/types/importConfig/.type/index.d.ts +107 -0
- package/types/importConfig/.type/index.js +273 -0
- package/types/importConfig/.type/validate.js +806 -0
- package/types/importConfig/index.ts +1 -0
- package/types/importConfig/schema.json +252 -0
- package/types/index.ts +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './.type/index.js'
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://github.com/data-fair/catalog-data-fair/import-config",
|
|
3
|
+
"x-exports": [
|
|
4
|
+
"types",
|
|
5
|
+
"validate",
|
|
6
|
+
"schema"
|
|
7
|
+
],
|
|
8
|
+
"title": "Configuration de l'import",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"properties": {
|
|
12
|
+
"fields": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"default": [],
|
|
15
|
+
"title": "Colonnes du jeu de données",
|
|
16
|
+
"description": "La liste des colonnes à importer. Si ce champ est vide, toutes les colonnes seront importées.",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"key": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"label": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"type": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"layout": {
|
|
32
|
+
"getItems": {
|
|
33
|
+
"url": "${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false",
|
|
34
|
+
"itemTitle": "item.label",
|
|
35
|
+
"itemKey": "item.key"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"filters": {
|
|
40
|
+
"$ref": "#/$defs/filters"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"$defs": {
|
|
44
|
+
"filters": {
|
|
45
|
+
"title": "Filtres prédéfinis",
|
|
46
|
+
"type": "array",
|
|
47
|
+
"default": [],
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"default": {
|
|
51
|
+
"type": "in"
|
|
52
|
+
},
|
|
53
|
+
"required": [
|
|
54
|
+
"type"
|
|
55
|
+
],
|
|
56
|
+
"oneOf": [
|
|
57
|
+
{
|
|
58
|
+
"title": "Restreindre à des valeurs précises",
|
|
59
|
+
"required": [
|
|
60
|
+
"field",
|
|
61
|
+
"values",
|
|
62
|
+
"type"
|
|
63
|
+
],
|
|
64
|
+
"properties": {
|
|
65
|
+
"type": {
|
|
66
|
+
"const": "in"
|
|
67
|
+
},
|
|
68
|
+
"field": {
|
|
69
|
+
"$ref": "#/$defs/filterField"
|
|
70
|
+
},
|
|
71
|
+
"values": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"title": "Valeurs",
|
|
74
|
+
"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.*",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"layout": {
|
|
79
|
+
"getItems": {
|
|
80
|
+
"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"
|
|
81
|
+
},
|
|
82
|
+
"props": {
|
|
83
|
+
"clearable": true
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"default": []
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "Exclure des valeurs",
|
|
92
|
+
"required": [
|
|
93
|
+
"field",
|
|
94
|
+
"values",
|
|
95
|
+
"type"
|
|
96
|
+
],
|
|
97
|
+
"properties": {
|
|
98
|
+
"type": {
|
|
99
|
+
"const": "nin"
|
|
100
|
+
},
|
|
101
|
+
"field": {
|
|
102
|
+
"$ref": "#/$defs/filterField"
|
|
103
|
+
},
|
|
104
|
+
"values": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"title": "Valeurs à exclure",
|
|
107
|
+
"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.*",
|
|
108
|
+
"items": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
"layout": {
|
|
112
|
+
"getItems": {
|
|
113
|
+
"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"
|
|
114
|
+
},
|
|
115
|
+
"props": {
|
|
116
|
+
"clearable": true
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"default": []
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"title": "Supérieur à une valeur",
|
|
125
|
+
"required": [
|
|
126
|
+
"field",
|
|
127
|
+
"value",
|
|
128
|
+
"type"
|
|
129
|
+
],
|
|
130
|
+
"properties": {
|
|
131
|
+
"type": {
|
|
132
|
+
"const": "gte"
|
|
133
|
+
},
|
|
134
|
+
"field": {
|
|
135
|
+
"$ref": "#/$defs/filterField"
|
|
136
|
+
},
|
|
137
|
+
"value": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"title": "Valeur minimale",
|
|
140
|
+
"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.*",
|
|
141
|
+
"layout": {
|
|
142
|
+
"comp": "combobox",
|
|
143
|
+
"getItems": {
|
|
144
|
+
"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"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"title": "Inférieur à une valeur",
|
|
152
|
+
"required": [
|
|
153
|
+
"field",
|
|
154
|
+
"value",
|
|
155
|
+
"type"
|
|
156
|
+
],
|
|
157
|
+
"properties": {
|
|
158
|
+
"type": {
|
|
159
|
+
"const": "lte"
|
|
160
|
+
},
|
|
161
|
+
"field": {
|
|
162
|
+
"$ref": "#/$defs/filterField"
|
|
163
|
+
},
|
|
164
|
+
"value": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"title": "Valeur maximale",
|
|
167
|
+
"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.*",
|
|
168
|
+
"layout": {
|
|
169
|
+
"comp": "combobox",
|
|
170
|
+
"getItems": {
|
|
171
|
+
"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"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"title": "Commence par les caractères",
|
|
179
|
+
"required": [
|
|
180
|
+
"field",
|
|
181
|
+
"value",
|
|
182
|
+
"type"
|
|
183
|
+
],
|
|
184
|
+
"properties": {
|
|
185
|
+
"type": {
|
|
186
|
+
"const": "starts"
|
|
187
|
+
},
|
|
188
|
+
"field": {
|
|
189
|
+
"$ref": "#/$defs/filterFieldString"
|
|
190
|
+
},
|
|
191
|
+
"value": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"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.*",
|
|
194
|
+
"title": "Commence par les caractères",
|
|
195
|
+
"layout": {
|
|
196
|
+
"comp": "combobox",
|
|
197
|
+
"getItems": {
|
|
198
|
+
"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"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"filterField": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"title": "Colonne de filtre",
|
|
210
|
+
"properties": {
|
|
211
|
+
"key": {
|
|
212
|
+
"type": "string"
|
|
213
|
+
},
|
|
214
|
+
"label": {
|
|
215
|
+
"type": "string"
|
|
216
|
+
},
|
|
217
|
+
"type": {
|
|
218
|
+
"type": "string"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"layout": {
|
|
222
|
+
"getItems": {
|
|
223
|
+
"url": "${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false",
|
|
224
|
+
"itemTitle": "item.label",
|
|
225
|
+
"itemKey": "item.key"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"filterFieldString": {
|
|
230
|
+
"type": "object",
|
|
231
|
+
"title": "Colonne de filtre",
|
|
232
|
+
"properties": {
|
|
233
|
+
"key": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
},
|
|
236
|
+
"label": {
|
|
237
|
+
"type": "string"
|
|
238
|
+
},
|
|
239
|
+
"type": {
|
|
240
|
+
"type": "string"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"layout": {
|
|
244
|
+
"getItems": {
|
|
245
|
+
"url": "${context.catalogConfig.url}/data-fair/api/v1/datasets/${context.resourceId}/schema?calculated=false&type=string",
|
|
246
|
+
"itemTitle": "item.label",
|
|
247
|
+
"itemKey": "item.key"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
package/types/index.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { schema as configSchema, assertValid as assertConfigValid, type DataFairConfig } from './catalogConfig/index.ts'
|
|
2
|
+
export { schema as importConfigSchema, assertValid as assertImportConfigValid, type ConfigurationDeLImport as ImportConfig } from './importConfig/index.ts'
|
|
3
|
+
export type { DataFairCatalog, DataFairDataset } from './datafairSchemas/index.ts'
|