@data-fair/lib-common-types 1.16.0 → 1.16.2

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/catalog/schema.js CHANGED
@@ -1,13 +1,13 @@
1
1
  export default {
2
- $id: 'https://github.com/data-fair/lib/catalog',
3
- 'x-exports': ['types'],
4
- type: 'object',
5
- title: 'Catalogs common types',
6
- additionalProperties: false,
7
- $defs: {
8
- capability: {
9
- type: 'string',
10
- description: `The list of capabilities that a catalog can have.
2
+ $id: 'https://github.com/data-fair/lib/catalog',
3
+ 'x-exports': ['types'],
4
+ type: 'object',
5
+ title: 'Catalogs common types',
6
+ additionalProperties: false,
7
+ $defs: {
8
+ capability: {
9
+ type: 'string',
10
+ description: `The list of capabilities that a catalog can have.
11
11
  - import: The plugin can list some resources organized in folders and import them
12
12
  - search: The plugin can use the search param 'q' in the list method
13
13
  - pagination: The plugin can paginate the results of the list method
@@ -16,182 +16,182 @@ export default {
16
16
  - publishDataset: The plugin can publish a dataset
17
17
  - deletePublication: The plugin can delete a dataset or a resource published in a remote catalog
18
18
  - thumbnail: The plugin provides a thumbnail image`,
19
- enum: [
20
- 'import',
21
- 'search',
22
- 'pagination',
23
- 'additionalFilters',
24
- 'importConfig',
25
- 'publishDataset',
26
- 'deletePublication',
27
- 'thumbnail'
28
- ]
29
- },
30
- metadata: {
31
- type: 'object',
32
- description: 'The metadata of the catalog plugin',
33
- required: ['title', 'description', 'capabilities'],
34
- additionalProperties: false,
35
- properties: {
36
- title: {
37
- description: 'The title of the plugin to be displayed in the UI',
38
- type: 'string'
39
- },
40
- description: {
41
- description: 'The description of the plugin to be displayed in the UI',
42
- type: 'string'
43
- },
44
- capabilities: {
45
- description: 'The list of capabilities that a catalog can have.',
46
- type: 'array',
47
- items: {
48
- $ref: '#/$defs/capability'
49
- }
50
- },
51
- thumbnailPath: {
52
- description: 'Optional path of the thumbnail image from the root of the plugin to be displayed in the UI.',
53
- type: 'string',
54
- }
55
- }
56
- },
57
- folder: {
58
- type: 'object',
59
- required: ['id', 'title', 'type'],
60
- additionalProperties: false,
61
- properties: {
62
- id: {
63
- type: 'string'
64
- },
65
- title: {
66
- type: 'string'
67
- },
68
- type: {
69
- const: 'folder',
70
- }
71
- },
72
- },
73
- resource: {
74
- type: 'object',
75
- description: 'The normalized resource to import from a remote catalog to Data Fair',
76
- required: ['id', 'title', 'filePath', 'format'],
77
- additionalProperties: false,
78
- properties: {
79
- id: {
80
- type: 'string',
81
- description: 'The unique identifier of the resource, independent of the folder it is in'
82
- },
83
- title: {
84
- type: 'string',
85
- description: 'The title of the resource'
86
- },
87
- description: {
88
- type: 'string',
89
- },
90
- filePath: {
91
- type: 'string',
92
- description: 'The path to the downloaded resource file.',
93
- },
94
- format: {
95
- type: 'string',
96
- description: 'The format of the resource, e.g. csv, json, xml, etc. It is displayed in the UI of catalogs.',
97
- },
98
- // https://www.w3.org/TR/vocab-dcat-2/#Property:dataset_frequency and https://www.dublincore.org/specifications/dublin-core/collection-description/frequency/
99
- frequency: {
100
- type: 'string',
101
- description: 'The frequency of the resource updates, if available. It can be one of the following values: triennial, biennial, annual, semiannual, threeTimesAYear, quarterly, bimonthly, monthly, semimonthly, biweekly, threeTimesAMonth, weekly, semiweekly, threeTimesAWeek, daily, continuous or irregular.',
102
- enum: ['', 'triennial', 'biennial', 'annual', 'semiannual', 'threeTimesAYear', 'quarterly', 'bimonthly', 'monthly', 'semimonthly', 'biweekly', 'threeTimesAMonth', 'weekly', 'semiweekly', 'threeTimesAWeek', 'daily', 'continuous', 'irregular']
103
- },
104
- image: {
105
- type: 'string',
106
- description: 'The URL of the image representing the resource, if available'
107
- },
108
- license: {
109
- type: 'object',
110
- additionalProperties: false,
111
- required: ['title', 'href'],
112
- properties: {
113
- title: {
114
- type: 'string',
115
- description: 'Short title for the license'
116
- },
117
- href: {
118
- type: 'string',
119
- description: 'The URL where the license can be read'
19
+ enum: [
20
+ 'import',
21
+ 'search',
22
+ 'pagination',
23
+ 'additionalFilters',
24
+ 'importConfig',
25
+ 'publishDataset',
26
+ 'deletePublication',
27
+ 'thumbnail'
28
+ ]
29
+ },
30
+ metadata: {
31
+ type: 'object',
32
+ description: 'The metadata of the catalog plugin',
33
+ required: ['title', 'description', 'capabilities'],
34
+ additionalProperties: false,
35
+ properties: {
36
+ title: {
37
+ description: 'The title of the plugin to be displayed in the UI',
38
+ type: 'string'
39
+ },
40
+ description: {
41
+ description: 'The description of the plugin to be displayed in the UI',
42
+ type: 'string'
43
+ },
44
+ capabilities: {
45
+ description: 'The list of capabilities that a catalog can have.',
46
+ type: 'array',
47
+ items: {
48
+ $ref: '#/$defs/capability'
49
+ }
50
+ },
51
+ thumbnailPath: {
52
+ description: 'Optional path of the thumbnail image from the root of the plugin to be displayed in the UI.',
53
+ type: 'string',
54
+ }
120
55
  }
121
- }
122
- },
123
- keywords: {
124
- type: 'array',
125
- description: 'The list of keywords associated with the resource, if available',
126
- items: {
127
- type: 'string'
128
- }
129
- },
130
- mimeType: {
131
- type: 'string',
132
- description: 'The Mime type of the resource, if available'
133
- },
134
- origin: {
135
- type: 'string',
136
- description: 'The URL where the original data can be found'
137
- },
138
- schema: {
139
- type: 'object',
140
- additionalProperties: true,
141
- description: 'The schema of the resource, if available'
142
56
  },
143
- size: {
144
- type: 'number',
145
- description: 'The size of the resource in bytes, if available. It is displayed in the UI of catalogs.'
146
- }
147
- }
148
- },
149
- publication: {
150
- type: 'object',
151
- additionalProperties: false,
152
- description: 'A small object that contains the information needed to publish or update a dataset or a resource',
153
- properties: {
154
- remoteDataset: {
155
- type: 'object',
156
- required: ['id'],
157
- additionalProperties: false,
158
- description: 'Dataset from the remote catalog, used if a local dataset is published as a dataset on a remote catalog. If it is defined during publication, then the remote dataset must be updated.',
159
- properties: {
160
- id: {
161
- type: 'string',
162
- },
163
- title: {
164
- type: 'string',
57
+ folder: {
58
+ type: 'object',
59
+ required: ['id', 'title', 'type'],
60
+ additionalProperties: false,
61
+ properties: {
62
+ id: {
63
+ type: 'string'
64
+ },
65
+ title: {
66
+ type: 'string'
67
+ },
68
+ type: {
69
+ const: 'folder',
70
+ }
165
71
  },
166
- url: {
167
- type: 'string',
168
- description: 'URL to view the dataset in the remote catalog'
169
- }
170
- }
171
72
  },
172
- remoteResource: {
173
- type: 'object',
174
- required: ['id'],
175
- additionalProperties: false,
176
- description: 'Dataset\'s resource from the remote catalog, used if a local dataset is published as a resource on a remote catalog. If it is defined during publication, then the remote resource must be updated.',
177
- properties: {
178
- id: {
179
- type: 'string',
180
- },
181
- title: {
182
- type: 'string',
183
- },
184
- url: {
185
- type: 'string',
186
- description: 'URL to view the resource in the remote catalog'
73
+ resource: {
74
+ type: 'object',
75
+ description: 'The normalized resource to import from a remote catalog to Data Fair',
76
+ required: ['id', 'title', 'filePath', 'format'],
77
+ additionalProperties: false,
78
+ properties: {
79
+ id: {
80
+ type: 'string',
81
+ description: 'The unique identifier of the resource, independent of the folder it is in'
82
+ },
83
+ title: {
84
+ type: 'string',
85
+ description: 'The title of the resource'
86
+ },
87
+ description: {
88
+ type: 'string',
89
+ },
90
+ filePath: {
91
+ type: 'string',
92
+ description: 'The path to the downloaded resource file.',
93
+ },
94
+ format: {
95
+ type: 'string',
96
+ description: 'The format of the resource, e.g. csv, json, xml, etc. It is displayed in the UI of catalogs.',
97
+ },
98
+ // https://www.w3.org/TR/vocab-dcat-2/#Property:dataset_frequency and https://www.dublincore.org/specifications/dublin-core/collection-description/frequency/
99
+ frequency: {
100
+ type: 'string',
101
+ description: 'The frequency of the resource updates, if available. It can be one of the following values: triennial, biennial, annual, semiannual, threeTimesAYear, quarterly, bimonthly, monthly, semimonthly, biweekly, threeTimesAMonth, weekly, semiweekly, threeTimesAWeek, daily, continuous or irregular.',
102
+ enum: ['', 'triennial', 'biennial', 'annual', 'semiannual', 'threeTimesAYear', 'quarterly', 'bimonthly', 'monthly', 'semimonthly', 'biweekly', 'threeTimesAMonth', 'weekly', 'semiweekly', 'threeTimesAWeek', 'daily', 'continuous', 'irregular']
103
+ },
104
+ image: {
105
+ type: 'string',
106
+ description: 'The URL of the image representing the resource, if available'
107
+ },
108
+ license: {
109
+ type: 'object',
110
+ additionalProperties: false,
111
+ required: ['title', 'href'],
112
+ properties: {
113
+ title: {
114
+ type: 'string',
115
+ description: 'Short title for the license'
116
+ },
117
+ href: {
118
+ type: 'string',
119
+ description: 'The URL where the license can be read'
120
+ }
121
+ }
122
+ },
123
+ keywords: {
124
+ type: 'array',
125
+ description: 'The list of keywords associated with the resource, if available',
126
+ items: {
127
+ type: 'string'
128
+ }
129
+ },
130
+ mimeType: {
131
+ type: 'string',
132
+ description: 'The Mime type of the resource, if available'
133
+ },
134
+ origin: {
135
+ type: 'string',
136
+ description: 'The URL where the original data can be found'
137
+ },
138
+ schema: {
139
+ type: 'object',
140
+ additionalProperties: true,
141
+ description: 'The schema of the resource, if available'
142
+ },
143
+ size: {
144
+ type: 'number',
145
+ description: 'The size of the resource in bytes, if available. It is displayed in the UI of catalogs.'
146
+ }
187
147
  }
188
- }
189
148
  },
190
- isResource: {
191
- type: 'boolean',
192
- description: 'If true, the publication is for a resource, otherwise it is for a dataset'
149
+ publication: {
150
+ type: 'object',
151
+ additionalProperties: false,
152
+ description: 'A small object that contains the information needed to publish or update a dataset or a resource',
153
+ properties: {
154
+ remoteDataset: {
155
+ type: 'object',
156
+ required: ['id'],
157
+ additionalProperties: false,
158
+ description: 'Dataset from the remote catalog, used if a local dataset is published as a dataset on a remote catalog. If it is defined during publication, then the remote dataset must be updated.',
159
+ properties: {
160
+ id: {
161
+ type: 'string',
162
+ },
163
+ title: {
164
+ type: 'string',
165
+ },
166
+ url: {
167
+ type: 'string',
168
+ description: 'URL to view the dataset in the remote catalog'
169
+ }
170
+ }
171
+ },
172
+ remoteResource: {
173
+ type: 'object',
174
+ required: ['id'],
175
+ additionalProperties: false,
176
+ description: 'Dataset\'s resource from the remote catalog, used if a local dataset is published as a resource on a remote catalog. If it is defined during publication, then the remote resource must be updated.',
177
+ properties: {
178
+ id: {
179
+ type: 'string',
180
+ },
181
+ title: {
182
+ type: 'string',
183
+ },
184
+ url: {
185
+ type: 'string',
186
+ description: 'URL to view the resource in the remote catalog'
187
+ }
188
+ }
189
+ },
190
+ isResource: {
191
+ type: 'boolean',
192
+ description: 'If true, the publication is for a resource, otherwise it is for a dataset'
193
+ }
194
+ }
193
195
  }
194
- }
195
196
  }
196
- }
197
- }
197
+ };
package/event/index.js CHANGED
@@ -1 +1 @@
1
- export * from './.type/index.js'
1
+ export * from './.type/index.js';