@digitalculture/ochre-sdk 0.7.11 → 0.7.12
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 +0 -53
- package/dist/index.cjs +580 -7
- package/dist/index.d.cts +686 -596
- package/dist/index.d.ts +686 -596
- package/dist/index.js +580 -7
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,656 +1,660 @@
|
|
|
1
|
-
import { Language } from
|
|
1
|
+
import { Language } from "iso-639-3";
|
|
2
2
|
|
|
3
|
+
//#region src/types/main.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Represents the core data structure containing item information and metadata
|
|
6
|
+
*/
|
|
3
7
|
/**
|
|
4
8
|
* Represents the core data structure containing item information and metadata
|
|
5
9
|
*/
|
|
6
10
|
type Data<T extends DataCategory> = {
|
|
11
|
+
uuid: string;
|
|
12
|
+
belongsTo: {
|
|
7
13
|
uuid: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
metadata: Metadata;
|
|
14
|
-
item: Tree | Set<T> | Resource | SpatialUnit | Concept | Period | Bibliography | Person | PropertyValue;
|
|
14
|
+
abbreviation: string;
|
|
15
|
+
};
|
|
16
|
+
publicationDateTime: Date;
|
|
17
|
+
metadata: Metadata;
|
|
18
|
+
item: Tree | Set<T> | Resource | SpatialUnit | Concept | Period | Bibliography | Person | PropertyValue;
|
|
15
19
|
};
|
|
16
20
|
type DataCategory = "tree" | "set" | "resource" | "spatialUnit" | "concept" | "period" | "bibliography" | "person" | "propertyValue";
|
|
17
21
|
/**
|
|
18
22
|
* Basic identification information used across multiple types
|
|
19
23
|
*/
|
|
20
24
|
type Identification = {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
label: string;
|
|
26
|
+
abbreviation: string;
|
|
23
27
|
};
|
|
24
28
|
/**
|
|
25
29
|
* Metadata information for items including project, publisher and language details
|
|
26
30
|
*/
|
|
27
31
|
type Metadata = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
project: {
|
|
33
|
+
identification: Identification & {
|
|
34
|
+
website: string | null;
|
|
35
|
+
};
|
|
36
|
+
} | null;
|
|
37
|
+
item: {
|
|
38
|
+
identification: Identification;
|
|
39
|
+
category: string;
|
|
40
|
+
type: string;
|
|
41
|
+
maxLength: number | null;
|
|
42
|
+
} | null;
|
|
43
|
+
dataset: string;
|
|
44
|
+
publisher: string;
|
|
45
|
+
languages: Array<Language["iso6393"]>;
|
|
46
|
+
identifier: string;
|
|
47
|
+
description: string;
|
|
44
48
|
};
|
|
45
49
|
/**
|
|
46
50
|
* Represents a single item in a context hierarchy with its metadata
|
|
47
51
|
*/
|
|
48
52
|
type ContextItem = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
uuid: string;
|
|
54
|
+
publicationDateTime: Date | null;
|
|
55
|
+
number: number;
|
|
56
|
+
content: string;
|
|
53
57
|
};
|
|
54
58
|
/**
|
|
55
59
|
* Represents a node in the context tree containing tree, project and spatial unit information
|
|
56
60
|
*/
|
|
57
61
|
type ContextNode = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
tree: ContextItem;
|
|
63
|
+
project: ContextItem;
|
|
64
|
+
spatialUnit: Array<ContextItem>;
|
|
61
65
|
};
|
|
62
66
|
/**
|
|
63
67
|
* Contains the full context information including nodes and display path
|
|
64
68
|
*/
|
|
65
69
|
type Context = {
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
nodes: Array<ContextNode>;
|
|
71
|
+
displayPath: string;
|
|
68
72
|
};
|
|
69
73
|
/**
|
|
70
74
|
* License information for content items
|
|
71
75
|
*/
|
|
72
76
|
type License = {
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
content: string;
|
|
78
|
+
url: string;
|
|
75
79
|
};
|
|
76
80
|
/**
|
|
77
81
|
* Represents a person (author, creator, etc.) with their identification and metadata
|
|
78
82
|
*/
|
|
79
83
|
type Person = {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
uuid: string;
|
|
85
|
+
category: "person";
|
|
86
|
+
publicationDateTime: Date | null;
|
|
87
|
+
type: string | null;
|
|
88
|
+
number: number | null;
|
|
89
|
+
context: Context | null;
|
|
90
|
+
availability: License | null;
|
|
91
|
+
date: Date | null;
|
|
92
|
+
identification: Identification | null;
|
|
93
|
+
address: {
|
|
94
|
+
country: string | null;
|
|
95
|
+
city: string | null;
|
|
96
|
+
state: string | null;
|
|
97
|
+
} | null;
|
|
98
|
+
coordinates: Coordinates | null;
|
|
99
|
+
content: string | null;
|
|
100
|
+
events: Array<Event>;
|
|
101
|
+
properties: Array<Property>;
|
|
98
102
|
};
|
|
99
103
|
/**
|
|
100
104
|
* Represents a note with number, title and content
|
|
101
105
|
*/
|
|
102
106
|
type Note = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
number: number;
|
|
108
|
+
title: string | null;
|
|
109
|
+
content: string;
|
|
106
110
|
};
|
|
107
111
|
/**
|
|
108
112
|
* Represents an image with its metadata and content
|
|
109
113
|
*/
|
|
110
114
|
type Image = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
publicationDateTime: Date | null;
|
|
116
|
+
identification: Identification | null;
|
|
117
|
+
url: string | null;
|
|
118
|
+
htmlPrefix: string | null;
|
|
119
|
+
content: string | null;
|
|
120
|
+
widthPreview: number | null;
|
|
121
|
+
heightPreview: number | null;
|
|
122
|
+
width: number | null;
|
|
123
|
+
height: number | null;
|
|
120
124
|
};
|
|
121
125
|
/**
|
|
122
126
|
* Represents a link to another item with optional image and bibliographic references
|
|
123
127
|
*/
|
|
124
128
|
type Link = {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
129
|
+
uuid: string;
|
|
130
|
+
publicationDateTime: Date | null;
|
|
131
|
+
type: string | null;
|
|
132
|
+
category: string | null;
|
|
133
|
+
identification: Identification | null;
|
|
134
|
+
content: string | null;
|
|
135
|
+
href: string | null;
|
|
136
|
+
image: {
|
|
137
|
+
isInline: boolean;
|
|
138
|
+
isPrimary: boolean;
|
|
139
|
+
heightPreview: number;
|
|
140
|
+
widthPreview: number;
|
|
141
|
+
height: number;
|
|
142
|
+
width: number;
|
|
143
|
+
} | null;
|
|
144
|
+
bibliographies: Array<Bibliography> | null;
|
|
141
145
|
};
|
|
142
146
|
/**
|
|
143
147
|
* Represents a clickable/interactive area on an image map
|
|
144
148
|
*/
|
|
145
149
|
type ImageMapArea = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
uuid: string;
|
|
151
|
+
publicationDateTime: Date | null;
|
|
152
|
+
type: string;
|
|
153
|
+
title: string;
|
|
154
|
+
shape: "rectangle" | "polygon";
|
|
155
|
+
coords: Array<number>;
|
|
152
156
|
};
|
|
153
157
|
/**
|
|
154
158
|
* Contains image map areas and dimensions
|
|
155
159
|
*/
|
|
156
160
|
type ImageMap = {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
area: Array<ImageMapArea>;
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
160
164
|
};
|
|
161
165
|
/**
|
|
162
166
|
* Geographic coordinates with optional type and label
|
|
163
167
|
*/
|
|
164
168
|
type Coordinates = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
latitude: number;
|
|
170
|
+
longitude: number;
|
|
171
|
+
type: string | null;
|
|
172
|
+
label: string | null;
|
|
169
173
|
};
|
|
170
174
|
/**
|
|
171
175
|
* Represents an observation with notes, links and properties
|
|
172
176
|
*/
|
|
173
177
|
type Observation = {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
number: number;
|
|
179
|
+
date: Date | null;
|
|
180
|
+
observers: Array<string>;
|
|
181
|
+
notes: Array<Note>;
|
|
182
|
+
links: Array<Link>;
|
|
183
|
+
properties: Array<Property>;
|
|
180
184
|
};
|
|
181
185
|
/**
|
|
182
186
|
* Represents an event with date, label and optional agent
|
|
183
187
|
*/
|
|
184
188
|
type Event = {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
date: Date | null;
|
|
190
|
+
label: string;
|
|
191
|
+
agent: {
|
|
192
|
+
uuid: string;
|
|
193
|
+
content: string;
|
|
194
|
+
} | null;
|
|
191
195
|
};
|
|
192
196
|
/**
|
|
193
197
|
* Represents an interpretation with date and properties
|
|
194
198
|
*/
|
|
195
199
|
type Interpretation = {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
date: Date | null;
|
|
201
|
+
number: number;
|
|
202
|
+
properties: Array<Property>;
|
|
199
203
|
};
|
|
200
204
|
/**
|
|
201
205
|
* Represents a document with content and footnotes
|
|
202
206
|
*/
|
|
203
207
|
type Document = {
|
|
204
|
-
|
|
205
|
-
|
|
208
|
+
content: string;
|
|
209
|
+
footnotes: Array<Footnote>;
|
|
206
210
|
};
|
|
207
211
|
/**
|
|
208
212
|
* Represents a footnote in a document
|
|
209
213
|
*/
|
|
210
214
|
type Footnote = {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
uuid: string;
|
|
216
|
+
label: string;
|
|
217
|
+
content: string;
|
|
214
218
|
};
|
|
215
219
|
/**
|
|
216
220
|
* Represents a resource item with associated metadata, content and relationships
|
|
217
221
|
*/
|
|
218
222
|
type Resource = {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
223
|
+
uuid: string;
|
|
224
|
+
category: "resource";
|
|
225
|
+
publicationDateTime: Date | null;
|
|
226
|
+
type: string;
|
|
227
|
+
number: number;
|
|
228
|
+
context: Context | null;
|
|
229
|
+
license: License | null;
|
|
230
|
+
copyright: string | null;
|
|
231
|
+
identification: Identification;
|
|
232
|
+
date: Date | null;
|
|
233
|
+
image: Image | null;
|
|
234
|
+
creators: Array<Person>;
|
|
235
|
+
notes: Array<Note>;
|
|
236
|
+
description: string;
|
|
237
|
+
document: Document | null;
|
|
238
|
+
href: string | null;
|
|
239
|
+
imageMap: ImageMap | null;
|
|
240
|
+
periods: Array<Period>;
|
|
241
|
+
format: string | null;
|
|
242
|
+
links: Array<Link>;
|
|
243
|
+
reverseLinks: Array<Link>;
|
|
244
|
+
properties: Array<Property>;
|
|
245
|
+
citedBibliographies: Array<Bibliography>;
|
|
246
|
+
resources: Array<Resource>;
|
|
243
247
|
};
|
|
244
248
|
/**
|
|
245
249
|
* Represents a spatial unit with geographic coordinates and observations
|
|
246
250
|
*/
|
|
247
251
|
type SpatialUnit = {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
252
|
+
uuid: string;
|
|
253
|
+
category: "spatialUnit";
|
|
254
|
+
publicationDateTime: Date | null;
|
|
255
|
+
type: string;
|
|
256
|
+
number: number;
|
|
257
|
+
context: Context | null;
|
|
258
|
+
license: License | null;
|
|
259
|
+
identification: Identification;
|
|
260
|
+
image: Image | null;
|
|
261
|
+
description: string | null;
|
|
262
|
+
coordinates: Coordinates | null;
|
|
263
|
+
observations: Array<Observation>;
|
|
264
|
+
events: Array<Event>;
|
|
265
|
+
properties: Array<Property>;
|
|
262
266
|
};
|
|
263
267
|
/**
|
|
264
268
|
* Represents a concept with associated interpretations
|
|
265
269
|
*/
|
|
266
270
|
type Concept = {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
271
|
+
uuid: string;
|
|
272
|
+
category: "concept";
|
|
273
|
+
publicationDateTime: Date | null;
|
|
274
|
+
number: number;
|
|
275
|
+
license: License | null;
|
|
276
|
+
context: Context | null;
|
|
277
|
+
identification: Identification;
|
|
278
|
+
interpretations: Array<Interpretation>;
|
|
275
279
|
};
|
|
276
280
|
/**
|
|
277
281
|
* Represents a set that can contain resources, spatial units and concepts
|
|
278
282
|
*/
|
|
279
283
|
type Set<T extends DataCategory> = {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
284
|
+
uuid: string;
|
|
285
|
+
category: "set";
|
|
286
|
+
itemCategory: T;
|
|
287
|
+
publicationDateTime: Date | null;
|
|
288
|
+
type: string;
|
|
289
|
+
number: number;
|
|
290
|
+
date: Date | null;
|
|
291
|
+
license: License | null;
|
|
292
|
+
identification: Identification;
|
|
293
|
+
isSuppressingBlanks: boolean;
|
|
294
|
+
description: string;
|
|
295
|
+
creators: Array<Person>;
|
|
296
|
+
items: T extends "resource" ? Array<Resource> : T extends "spatialUnit" ? Array<SpatialUnit> : T extends "concept" ? Array<Concept> : T extends "period" ? Array<Period> : T extends "bibliography" ? Array<Bibliography> : T extends "person" ? Array<Person> : T extends "propertyValue" ? Array<PropertyValue> : never;
|
|
293
297
|
};
|
|
294
298
|
/**
|
|
295
299
|
* Represents a bibliography entry with citation and publication information
|
|
296
300
|
*/
|
|
297
301
|
type Bibliography = {
|
|
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
|
-
|
|
302
|
+
uuid: string;
|
|
303
|
+
category: "bibliography";
|
|
304
|
+
publicationDateTime: Date | null;
|
|
305
|
+
type: string | null;
|
|
306
|
+
number: number | null;
|
|
307
|
+
identification: Identification | null;
|
|
308
|
+
projectIdentification: Identification | null;
|
|
309
|
+
context: Context | null;
|
|
310
|
+
citation: {
|
|
311
|
+
format: string | null;
|
|
312
|
+
short: string | null;
|
|
313
|
+
long: string | null;
|
|
314
|
+
};
|
|
315
|
+
publicationInfo: {
|
|
316
|
+
publishers: Array<Person>;
|
|
317
|
+
startDate: Date | null;
|
|
318
|
+
};
|
|
319
|
+
entryInfo: {
|
|
320
|
+
startIssue: string;
|
|
321
|
+
startVolume: string;
|
|
322
|
+
} | null;
|
|
323
|
+
source: {
|
|
324
|
+
resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
|
|
325
|
+
documentUrl: string | null;
|
|
326
|
+
};
|
|
327
|
+
periods: Array<Period>;
|
|
328
|
+
authors: Array<Person>;
|
|
329
|
+
properties: Array<Property>;
|
|
326
330
|
};
|
|
327
331
|
/**
|
|
328
332
|
* Represents a time period with identification
|
|
329
333
|
*/
|
|
330
334
|
type Period = {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
335
|
+
uuid: string;
|
|
336
|
+
category: "period";
|
|
337
|
+
publicationDateTime: Date | null;
|
|
338
|
+
type: string | null;
|
|
339
|
+
number: number | null;
|
|
340
|
+
identification: Identification;
|
|
341
|
+
description: string | null;
|
|
338
342
|
};
|
|
339
343
|
/**
|
|
340
344
|
* Represents a property value with type information
|
|
341
345
|
*/
|
|
342
346
|
type PropertyValue = {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
347
|
+
uuid: string;
|
|
348
|
+
category: "propertyValue";
|
|
349
|
+
number: number;
|
|
350
|
+
publicationDateTime: Date | null;
|
|
351
|
+
context: Context | null;
|
|
352
|
+
availability: License | null;
|
|
353
|
+
identification: Identification;
|
|
354
|
+
date: Date | null;
|
|
355
|
+
creators: Array<Person>;
|
|
356
|
+
description: string;
|
|
357
|
+
notes: Array<Note>;
|
|
358
|
+
links: Array<Link>;
|
|
355
359
|
};
|
|
356
360
|
type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "date" | "dateTime" | "time" | "coordinate" | "IDREF";
|
|
357
361
|
/**
|
|
358
362
|
* Represents a property value with type information
|
|
359
363
|
*/
|
|
360
364
|
type PropertyValueContent = {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
content: string | number | boolean | Date | null;
|
|
366
|
+
booleanValue: boolean | null;
|
|
367
|
+
isUncertain: boolean;
|
|
368
|
+
type: PropertyValueContentType;
|
|
369
|
+
category: string;
|
|
370
|
+
uuid: string | null;
|
|
371
|
+
publicationDateTime: Date | null;
|
|
372
|
+
unit: string | null;
|
|
369
373
|
};
|
|
370
374
|
/**
|
|
371
375
|
* Represents a property with label, values and nested properties
|
|
372
376
|
*/
|
|
373
377
|
type Property = {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
378
|
+
uuid: string;
|
|
379
|
+
label: string;
|
|
380
|
+
values: Array<PropertyValueContent>;
|
|
381
|
+
comment: string | null;
|
|
382
|
+
properties: Array<Property>;
|
|
379
383
|
};
|
|
380
384
|
/**
|
|
381
385
|
* Represents a tree structure containing resources, spatial units and concepts
|
|
382
386
|
*/
|
|
383
387
|
type Tree = {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
388
|
+
uuid: string;
|
|
389
|
+
category: "tree";
|
|
390
|
+
publicationDateTime: Date | null;
|
|
391
|
+
type: string;
|
|
392
|
+
number: number;
|
|
393
|
+
date: Date | null;
|
|
394
|
+
license: License | null;
|
|
395
|
+
identification: Identification;
|
|
396
|
+
creators: Array<Person>;
|
|
397
|
+
items: {
|
|
398
|
+
resources: Array<Resource>;
|
|
399
|
+
spatialUnits: Array<SpatialUnit>;
|
|
400
|
+
concepts: Array<Concept>;
|
|
401
|
+
periods: Array<Period>;
|
|
402
|
+
bibliographies: Array<Bibliography>;
|
|
403
|
+
persons: Array<Person>;
|
|
404
|
+
propertyValues: Array<PropertyValue>;
|
|
405
|
+
};
|
|
406
|
+
properties: Array<Property>;
|
|
403
407
|
};
|
|
404
408
|
/**
|
|
405
409
|
* Represents a gallery with its identification, project identification, resources and max length
|
|
406
410
|
*/
|
|
407
411
|
type Gallery = {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
+
identification: Identification;
|
|
413
|
+
projectIdentification: Identification;
|
|
414
|
+
resources: Array<Resource>;
|
|
415
|
+
maxLength: number;
|
|
412
416
|
};
|
|
413
417
|
/**
|
|
414
418
|
* Represents a website with its properties and elements
|
|
415
419
|
*/
|
|
416
420
|
type Website = {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
421
|
+
uuid: string;
|
|
422
|
+
publicationDateTime: Date | null;
|
|
423
|
+
identification: Identification;
|
|
424
|
+
project: {
|
|
425
|
+
name: string;
|
|
426
|
+
website: string | null;
|
|
427
|
+
};
|
|
428
|
+
creators: Array<Person>;
|
|
429
|
+
license: License | null;
|
|
430
|
+
pages: Array<Webpage>;
|
|
431
|
+
sidebar: {
|
|
432
|
+
elements: Array<WebElement>;
|
|
433
|
+
title: WebElement["title"];
|
|
434
|
+
layout: "start" | "end";
|
|
435
|
+
mobileLayout: "default" | "inline";
|
|
436
|
+
cssStyles: Array<Style>;
|
|
437
|
+
cssStylesMobile: Array<Style>;
|
|
438
|
+
} | null;
|
|
439
|
+
properties: WebsiteProperties;
|
|
440
|
+
collectionOptions: {
|
|
441
|
+
uuids: Array<string>;
|
|
442
|
+
properties: {
|
|
443
|
+
metadataUuids: Array<string>;
|
|
444
|
+
searchUuids: Array<string>;
|
|
445
|
+
labelUuids: Array<string>;
|
|
423
446
|
};
|
|
424
|
-
|
|
425
|
-
license: License | null;
|
|
426
|
-
pages: Array<Webpage>;
|
|
427
|
-
sidebar: {
|
|
428
|
-
elements: Array<WebElement>;
|
|
429
|
-
title: WebElement["title"];
|
|
430
|
-
layout: "start" | "end";
|
|
431
|
-
mobileLayout: "default" | "inline";
|
|
432
|
-
cssStyles: Array<Style>;
|
|
433
|
-
cssStylesMobile: Array<Style>;
|
|
434
|
-
} | null;
|
|
435
|
-
properties: WebsiteProperties;
|
|
436
|
-
collectionOptions: {
|
|
437
|
-
uuids: Array<string>;
|
|
438
|
-
properties: {
|
|
439
|
-
metadataUuids: Array<string>;
|
|
440
|
-
searchUuids: Array<string>;
|
|
441
|
-
labelUuids: Array<string>;
|
|
442
|
-
};
|
|
443
|
-
} | null;
|
|
447
|
+
} | null;
|
|
444
448
|
};
|
|
445
449
|
/**
|
|
446
450
|
* Properties for configuring website display and styling
|
|
447
451
|
*/
|
|
448
452
|
type WebsiteProperties = {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
453
|
+
type: "traditional" | "digital-collection" | "plum" | "cedar" | "elm" | "maple" | "oak" | "palm";
|
|
454
|
+
privacy: "public" | "password" | "private";
|
|
455
|
+
status: "development" | "preview" | "production";
|
|
456
|
+
contact: {
|
|
457
|
+
name: string;
|
|
458
|
+
email: string | null;
|
|
459
|
+
} | null;
|
|
460
|
+
isHeaderDisplayed: boolean;
|
|
461
|
+
headerVariant: "default" | "floating" | "inline";
|
|
462
|
+
headerAlignment: "start" | "center" | "end";
|
|
463
|
+
isHeaderProjectDisplayed: boolean;
|
|
464
|
+
isFooterDisplayed: boolean;
|
|
465
|
+
isSidebarDisplayed: boolean;
|
|
466
|
+
supportsThemeToggle: boolean;
|
|
467
|
+
logoUrl: string | null;
|
|
464
468
|
};
|
|
465
469
|
type Webpage = {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
title: string;
|
|
471
|
+
slug: string;
|
|
472
|
+
properties: WebpageProperties;
|
|
473
|
+
items: Array<WebElement | WebBlock>;
|
|
474
|
+
webpages: Array<Webpage>;
|
|
471
475
|
};
|
|
472
476
|
/**
|
|
473
477
|
* Properties for configuring webpage display and styling
|
|
474
478
|
*/
|
|
475
479
|
type WebpageProperties = {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
displayedInHeader: boolean;
|
|
481
|
+
width: "full" | "large" | "narrow" | "default";
|
|
482
|
+
variant: "default" | "no-background";
|
|
483
|
+
backgroundImageUrl: string | null;
|
|
484
|
+
isSidebarDisplayed: boolean;
|
|
485
|
+
cssStyles: Array<Style>;
|
|
486
|
+
cssStylesMobile: Array<Style>;
|
|
483
487
|
};
|
|
484
488
|
/**
|
|
485
489
|
* Base properties for web elements
|
|
486
490
|
*/
|
|
487
491
|
type WebElement = {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
};
|
|
492
|
+
uuid: string;
|
|
493
|
+
type: "element";
|
|
494
|
+
title: {
|
|
495
|
+
label: string;
|
|
496
|
+
variant: "default" | "simple";
|
|
497
|
+
properties: {
|
|
498
|
+
isNameDisplayed: boolean;
|
|
499
|
+
isDescriptionDisplayed: boolean;
|
|
500
|
+
isDateDisplayed: boolean;
|
|
501
|
+
isCreatorsDisplayed: boolean;
|
|
499
502
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
+
};
|
|
504
|
+
isDisplayedInBlockSectionSidebar: boolean;
|
|
505
|
+
cssStyles: Array<Style>;
|
|
506
|
+
cssStylesMobile: Array<Style>;
|
|
503
507
|
} & WebElementComponent;
|
|
504
508
|
/**
|
|
505
509
|
* Union type of all possible web element components
|
|
506
510
|
*/
|
|
507
511
|
type WebElementComponent = {
|
|
508
|
-
|
|
509
|
-
|
|
512
|
+
component: "annotated-document";
|
|
513
|
+
document: Document;
|
|
510
514
|
} | {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
515
|
+
component: "annotated-image";
|
|
516
|
+
imageUuid: string;
|
|
517
|
+
isSearchable: boolean;
|
|
514
518
|
} | {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
519
|
+
component: "bibliography";
|
|
520
|
+
bibliographies: Array<Bibliography>;
|
|
521
|
+
layout: "long" | "short";
|
|
518
522
|
} | {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
+
component: "entries";
|
|
524
|
+
entriesId: string;
|
|
525
|
+
variant: "entry" | "item";
|
|
526
|
+
isSearchable: boolean;
|
|
523
527
|
} | {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
component: "button";
|
|
529
|
+
variant: "default" | "transparent";
|
|
530
|
+
href: string;
|
|
531
|
+
isExternal: boolean;
|
|
532
|
+
label: string;
|
|
533
|
+
icon: string | null;
|
|
530
534
|
} | {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
535
|
+
component: "collection";
|
|
536
|
+
collectionId: string;
|
|
537
|
+
variant: "full" | "highlights";
|
|
538
|
+
itemVariant: "default" | "card";
|
|
539
|
+
isSearchable: boolean;
|
|
540
|
+
showCount: boolean;
|
|
541
|
+
layout: "image-top" | "image-bottom" | "image-start" | "image-end";
|
|
538
542
|
} | {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
543
|
+
component: "empty-space";
|
|
544
|
+
height: string | null;
|
|
545
|
+
width: string | null;
|
|
542
546
|
} | {
|
|
543
|
-
|
|
544
|
-
|
|
547
|
+
component: "filter-categories";
|
|
548
|
+
filterId: string;
|
|
545
549
|
} | {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
component: "iframe";
|
|
551
|
+
href: string;
|
|
552
|
+
height: string | null;
|
|
553
|
+
width: string | null;
|
|
550
554
|
} | {
|
|
551
|
-
|
|
552
|
-
|
|
555
|
+
component: "iiif-viewer";
|
|
556
|
+
IIIFId: string;
|
|
553
557
|
} | {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
558
|
+
component: "image";
|
|
559
|
+
images: Array<WebImage>;
|
|
560
|
+
variant: "default" | "carousel";
|
|
561
|
+
width: number | null;
|
|
562
|
+
height: number | null;
|
|
563
|
+
isFullWidth: boolean;
|
|
564
|
+
isFullHeight: boolean;
|
|
565
|
+
imageQuality: "high" | "low";
|
|
566
|
+
captionSource: "name" | "abbreviation" | "description";
|
|
567
|
+
captionLayout: "top" | "bottom" | "inset" | "suppress";
|
|
568
|
+
altTextSource: "name" | "abbreviation" | "description";
|
|
569
|
+
isTransparentBackground: boolean;
|
|
570
|
+
isCover: boolean;
|
|
571
|
+
carouselOptions: {
|
|
572
|
+
secondsPerImage: number;
|
|
573
|
+
} | null;
|
|
570
574
|
} | {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
575
|
+
component: "image-gallery";
|
|
576
|
+
galleryId: string;
|
|
577
|
+
isSearchable: boolean;
|
|
574
578
|
} | {
|
|
575
|
-
|
|
576
|
-
|
|
579
|
+
component: "n-columns";
|
|
580
|
+
columns: Array<WebElement>;
|
|
577
581
|
} | {
|
|
578
|
-
|
|
579
|
-
|
|
582
|
+
component: "n-rows";
|
|
583
|
+
rows: Array<WebElement>;
|
|
580
584
|
} | {
|
|
581
|
-
|
|
585
|
+
component: "network-graph";
|
|
582
586
|
} | {
|
|
583
|
-
|
|
584
|
-
|
|
587
|
+
component: "search-bar";
|
|
588
|
+
variant: "default" | "full";
|
|
585
589
|
} | {
|
|
586
|
-
|
|
587
|
-
|
|
590
|
+
component: "table";
|
|
591
|
+
tableId: string;
|
|
588
592
|
} | {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
+
component: "text";
|
|
594
|
+
variant: "title" | "block" | "banner";
|
|
595
|
+
heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
596
|
+
content: string;
|
|
593
597
|
} | {
|
|
594
|
-
|
|
595
|
-
|
|
598
|
+
component: "timeline";
|
|
599
|
+
timelineId: string;
|
|
596
600
|
} | {
|
|
597
|
-
|
|
598
|
-
|
|
601
|
+
component: "video";
|
|
602
|
+
isChaptersDislayed: boolean;
|
|
599
603
|
};
|
|
600
604
|
/**
|
|
601
605
|
* Represents an image used in web elements
|
|
602
606
|
*/
|
|
603
607
|
type WebImage = {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
+
url: string;
|
|
609
|
+
label: string | null;
|
|
610
|
+
width: number;
|
|
611
|
+
height: number;
|
|
608
612
|
};
|
|
609
613
|
/**
|
|
610
614
|
* Represents a CSS style with label and value
|
|
611
615
|
*/
|
|
612
616
|
type Style = {
|
|
613
|
-
|
|
614
|
-
|
|
617
|
+
label: string;
|
|
618
|
+
value: string;
|
|
615
619
|
};
|
|
616
620
|
/**
|
|
617
621
|
* Represents a block of vertical or horizontal content alignment
|
|
618
622
|
*/
|
|
619
623
|
type WebBlock = {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
624
|
+
uuid: string;
|
|
625
|
+
type: "block";
|
|
626
|
+
layout: "vertical" | "horizontal" | "grid";
|
|
627
|
+
items: Array<WebElement | WebBlock>;
|
|
628
|
+
properties: {
|
|
629
|
+
/**
|
|
630
|
+
* valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
|
|
631
|
+
*/
|
|
632
|
+
spacing: string | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* `gap` CSS property value
|
|
635
|
+
*/
|
|
636
|
+
gap: string | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* `align-items` CSS property value
|
|
639
|
+
*/
|
|
640
|
+
alignItems: "stretch" | "start" | "center" | "end" | "space-between";
|
|
641
|
+
/**
|
|
642
|
+
* `justify-content` CSS property value
|
|
643
|
+
*/
|
|
644
|
+
justifyContent: "stretch" | "start" | "center" | "end" | "space-between";
|
|
645
|
+
sectionSidebarItems: Array<WebSectionSidebarItem> | null;
|
|
646
|
+
};
|
|
647
|
+
propertiesMobile: Record<string, string> | null;
|
|
648
|
+
cssStyles: Array<Style>;
|
|
649
|
+
cssStylesMobile: Array<Style>;
|
|
646
650
|
};
|
|
647
651
|
type WebSectionSidebarItem = {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
};
|
|
653
|
-
|
|
652
|
+
uuid: string;
|
|
653
|
+
type: "block" | "element";
|
|
654
|
+
name: string | null;
|
|
655
|
+
items: Array<WebSectionSidebarItem> | null;
|
|
656
|
+
}; //#endregion
|
|
657
|
+
//#region src/utils/fetchers/gallery.d.ts
|
|
654
658
|
/**
|
|
655
659
|
* Fetches and parses a gallery from the OCHRE API
|
|
656
660
|
*
|
|
@@ -678,13 +682,15 @@ type WebSectionSidebarItem = {
|
|
|
678
682
|
* - Resources (gallery items)
|
|
679
683
|
*/
|
|
680
684
|
declare function fetchGallery(uuid: string, filter: string, page: number, perPage: number): Promise<{
|
|
681
|
-
|
|
682
|
-
|
|
685
|
+
item: Gallery | null;
|
|
686
|
+
error: null;
|
|
683
687
|
} | {
|
|
684
|
-
|
|
685
|
-
|
|
688
|
+
item: null;
|
|
689
|
+
error: string;
|
|
686
690
|
}>;
|
|
687
691
|
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region src/utils/fetchers/item.d.ts
|
|
688
694
|
/**
|
|
689
695
|
* Fetches and parses an OCHRE item from the OCHRE API
|
|
690
696
|
*
|
|
@@ -719,27 +725,33 @@ declare function fetchGallery(uuid: string, filter: string, page: number, perPag
|
|
|
719
725
|
* If the fetch/parse fails, the returned object will have an `error` property.
|
|
720
726
|
*/
|
|
721
727
|
declare function fetchItem<T extends DataCategory, U extends DataCategory>(uuid: string, category?: T, setCategory?: T extends "set" ? U : never): Promise<{
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
728
|
+
error: null;
|
|
729
|
+
metadata: Metadata;
|
|
730
|
+
belongsTo: {
|
|
731
|
+
uuid: string;
|
|
732
|
+
abbreviation: string;
|
|
733
|
+
};
|
|
734
|
+
item: T extends "resource" ? Resource : T extends "spatialUnit" ? SpatialUnit : T extends "concept" ? Concept : T extends "period" ? Period : T extends "bibliography" ? Bibliography : T extends "person" ? Person : T extends "propertyValue" ? PropertyValue : T extends "set" ? Set<U> : T extends "tree" ? Tree : never;
|
|
735
|
+
category: T;
|
|
730
736
|
} | {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
737
|
+
error: string;
|
|
738
|
+
metadata: never;
|
|
739
|
+
belongsTo: never;
|
|
740
|
+
item: never;
|
|
741
|
+
category: never;
|
|
736
742
|
}>;
|
|
737
743
|
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/types/internal.raw.d.ts
|
|
738
746
|
/**
|
|
739
747
|
* Raw string value that can be a string, number, or boolean
|
|
740
748
|
*/
|
|
741
749
|
type FakeString = string | number | boolean;
|
|
742
750
|
|
|
751
|
+
/**
|
|
752
|
+
* Text rendering options for string content
|
|
753
|
+
*/
|
|
754
|
+
|
|
743
755
|
/**
|
|
744
756
|
* Raw content item with rendering and whitespace options
|
|
745
757
|
*/
|
|
@@ -753,10 +765,7 @@ type OchreStringItemContent = {
|
|
|
753
765
|
* Raw string item with language metadata
|
|
754
766
|
*/
|
|
755
767
|
type OchreStringItem = {
|
|
756
|
-
string:
|
|
757
|
-
| FakeString
|
|
758
|
-
| OchreStringItemContent
|
|
759
|
-
| Array<FakeString | OchreStringItemContent>;
|
|
768
|
+
string: FakeString | OchreStringItemContent | Array<FakeString | OchreStringItemContent>;
|
|
760
769
|
lang?: Language["iso6393"]; // 3 character code (zxx = "a.k.a.")
|
|
761
770
|
languages?: string; // 3 character codes, semicolon separated
|
|
762
771
|
};
|
|
@@ -791,19 +800,12 @@ type OchreStringRichTextItemAnnotation = {
|
|
|
791
800
|
/**
|
|
792
801
|
* Union type for different rich text item formats
|
|
793
802
|
*/
|
|
794
|
-
type OchreStringRichTextItem =
|
|
795
|
-
|
|
|
796
|
-
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
| Array<OchreStringRichTextItemAnnotation>;
|
|
801
|
-
whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
|
|
802
|
-
}
|
|
803
|
-
| {
|
|
804
|
-
whitespace: string; // "newline" | "trailing" | "leading" (space separated)
|
|
805
|
-
}
|
|
806
|
-
| OchreStringRichTextItemAnnotation;
|
|
803
|
+
type OchreStringRichTextItem = FakeString | OchreStringRichTextItemContent | {
|
|
804
|
+
string: OchreStringRichTextItemAnnotation | Array<OchreStringRichTextItemAnnotation>;
|
|
805
|
+
whitespace?: string; // "newline" | "trailing" | "leading" (space separated)
|
|
806
|
+
} | {
|
|
807
|
+
whitespace: string; // "newline" | "trailing" | "leading" (space separated)
|
|
808
|
+
} | OchreStringRichTextItemAnnotation;
|
|
807
809
|
|
|
808
810
|
/**
|
|
809
811
|
* Container for rich text content with language metadata
|
|
@@ -825,19 +827,31 @@ type OchreData = {
|
|
|
825
827
|
publicationDateTime: string; // YYYY-MM-DDThh:mm:ssZ
|
|
826
828
|
metadata: OchreMetadata;
|
|
827
829
|
languages?: string; // 3 character codes, semicolon separated
|
|
828
|
-
} & (
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
830
|
+
} & ({
|
|
831
|
+
tree: OchreTree;
|
|
832
|
+
} | {
|
|
833
|
+
set: OchreSet;
|
|
834
|
+
} | {
|
|
835
|
+
resource: OchreResource;
|
|
836
|
+
} | {
|
|
837
|
+
spatialUnit: OchreSpatialUnit;
|
|
838
|
+
} | {
|
|
839
|
+
concept: OchreConcept;
|
|
840
|
+
} | {
|
|
841
|
+
period: OchrePeriod;
|
|
842
|
+
} | {
|
|
843
|
+
bibliography: OchreBibliography;
|
|
844
|
+
} | {
|
|
845
|
+
person: OchrePerson;
|
|
846
|
+
} | {
|
|
847
|
+
propertyValue: OchrePropertyValue;
|
|
848
|
+
});
|
|
839
849
|
};
|
|
840
850
|
|
|
851
|
+
/**
|
|
852
|
+
* Raw data response structure from the OCHRE API
|
|
853
|
+
*/
|
|
854
|
+
|
|
841
855
|
/**
|
|
842
856
|
* Raw metadata structure corresponding to the parsed Metadata type
|
|
843
857
|
*/
|
|
@@ -853,10 +867,16 @@ type OchreMetadata = {
|
|
|
853
867
|
};
|
|
854
868
|
publisher: OchreStringContent;
|
|
855
869
|
dataset: OchreStringContent;
|
|
856
|
-
project?: {
|
|
870
|
+
project?: {
|
|
871
|
+
identification: OchreIdentification;
|
|
872
|
+
};
|
|
857
873
|
language?: OchreLanguage | Array<OchreLanguage>;
|
|
858
874
|
description: OchreStringContent;
|
|
859
875
|
};
|
|
876
|
+
type OchreTreeCollectionOption = {
|
|
877
|
+
type: "set" | "variable";
|
|
878
|
+
content: string; // UUID
|
|
879
|
+
};
|
|
860
880
|
|
|
861
881
|
/**
|
|
862
882
|
* Raw tree structure corresponding to the parsed Tree type
|
|
@@ -869,30 +889,38 @@ type OchreTree = {
|
|
|
869
889
|
availability: OchreLicense;
|
|
870
890
|
identification: OchreIdentification;
|
|
871
891
|
date?: string; // YYYY-MM-DD
|
|
872
|
-
creators?: {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
892
|
+
creators?: {
|
|
893
|
+
creator: OchrePerson | Array<OchrePerson>;
|
|
894
|
+
};
|
|
895
|
+
collectionOptions?: {
|
|
896
|
+
metadataUuids: {
|
|
897
|
+
uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
|
|
876
898
|
};
|
|
877
|
-
|
|
878
|
-
|
|
899
|
+
searchUuids: {
|
|
900
|
+
uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
|
|
879
901
|
};
|
|
880
|
-
|
|
881
|
-
|
|
902
|
+
labelUuids: {
|
|
903
|
+
uuid?: OchreTreeCollectionOption | Array<OchreTreeCollectionOption>;
|
|
882
904
|
};
|
|
883
905
|
};
|
|
884
|
-
items:
|
|
885
|
-
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
906
|
+
items: string | {
|
|
907
|
+
resource: OchreResource | Array<OchreResource>;
|
|
908
|
+
} | {
|
|
909
|
+
spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
|
|
910
|
+
} | {
|
|
911
|
+
concept: OchreConcept | Array<OchreConcept>;
|
|
912
|
+
} | {
|
|
913
|
+
period: OchrePeriod | Array<OchrePeriod>;
|
|
914
|
+
} | {
|
|
915
|
+
bibliography: OchreBibliography | Array<OchreBibliography>;
|
|
916
|
+
} | {
|
|
917
|
+
person: OchrePerson | Array<OchrePerson>;
|
|
918
|
+
} | {
|
|
919
|
+
propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
|
|
920
|
+
};
|
|
921
|
+
properties?: {
|
|
922
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
923
|
+
};
|
|
896
924
|
};
|
|
897
925
|
|
|
898
926
|
/**
|
|
@@ -908,16 +936,24 @@ type OchreSet = {
|
|
|
908
936
|
date?: string; // YYYY-MM-DD
|
|
909
937
|
suppressBlanks?: boolean;
|
|
910
938
|
description?: OchreStringContent | FakeString;
|
|
911
|
-
creators?: {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
939
|
+
creators?: {
|
|
940
|
+
creator: OchrePerson | Array<OchrePerson>;
|
|
941
|
+
};
|
|
942
|
+
items: string | {
|
|
943
|
+
resource: OchreResource | Array<OchreResource>;
|
|
944
|
+
} | {
|
|
945
|
+
spatialUnit: OchreSpatialUnit | Array<OchreSpatialUnit>;
|
|
946
|
+
} | {
|
|
947
|
+
concept: OchreConcept | Array<OchreConcept>;
|
|
948
|
+
} | {
|
|
949
|
+
period: OchrePeriod | Array<OchrePeriod>;
|
|
950
|
+
} | {
|
|
951
|
+
bibliography: OchreBibliography | Array<OchreBibliography>;
|
|
952
|
+
} | {
|
|
953
|
+
person: OchrePerson | Array<OchrePerson>;
|
|
954
|
+
} | {
|
|
955
|
+
propertyValue: OchrePropertyValue | Array<OchrePropertyValue>;
|
|
956
|
+
};
|
|
921
957
|
};
|
|
922
958
|
|
|
923
959
|
/**
|
|
@@ -938,18 +974,24 @@ type OchreResource = {
|
|
|
938
974
|
description?: OchreStringContent | FakeString;
|
|
939
975
|
date?: string; // YYYY-MM-DD
|
|
940
976
|
image?: OchreImage;
|
|
941
|
-
creators?: {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
977
|
+
creators?: {
|
|
978
|
+
creator: OchrePerson | Array<OchrePerson>;
|
|
979
|
+
};
|
|
980
|
+
notes?: {
|
|
981
|
+
note: OchreNote | Array<OchreNote>;
|
|
982
|
+
};
|
|
983
|
+
document?: {
|
|
984
|
+
content: OchreStringRichText | Array<OchreStringRichText>;
|
|
985
|
+
} | object;
|
|
948
986
|
imagemap?: OchreImageMap;
|
|
949
|
-
periods?: {
|
|
987
|
+
periods?: {
|
|
988
|
+
period: OchrePeriod | Array<OchrePeriod>;
|
|
989
|
+
};
|
|
950
990
|
links?: OchreLink | Array<OchreLink>;
|
|
951
991
|
reverseLinks?: OchreLink | Array<OchreLink>;
|
|
952
|
-
properties?: {
|
|
992
|
+
properties?: {
|
|
993
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
994
|
+
};
|
|
953
995
|
citedBibliography?: {
|
|
954
996
|
reference: OchreBibliography | Array<OchreBibliography>;
|
|
955
997
|
};
|
|
@@ -971,10 +1013,16 @@ type OchreSpatialUnit = {
|
|
|
971
1013
|
description?: OchreStringContent | FakeString;
|
|
972
1014
|
coordinate?: string; // "latitude, longitude"
|
|
973
1015
|
coordinates?: OchreCoordinates;
|
|
974
|
-
events?: {
|
|
975
|
-
|
|
1016
|
+
events?: {
|
|
1017
|
+
event: OchreEvent | Array<OchreEvent>;
|
|
1018
|
+
};
|
|
1019
|
+
observations?: {
|
|
1020
|
+
observation: OchreObservation | Array<OchreObservation>;
|
|
1021
|
+
};
|
|
976
1022
|
observation?: OchreObservation;
|
|
977
|
-
properties?: {
|
|
1023
|
+
properties?: {
|
|
1024
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
1025
|
+
};
|
|
978
1026
|
};
|
|
979
1027
|
|
|
980
1028
|
/**
|
|
@@ -1011,11 +1059,10 @@ type OchrePropertyValueContent = {
|
|
|
1011
1059
|
* Raw property structure corresponding to the parsed Property type
|
|
1012
1060
|
*/
|
|
1013
1061
|
type OchreProperty = {
|
|
1014
|
-
label: OchreStringContent & {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
| FakeString;
|
|
1062
|
+
label: OchreStringContent & {
|
|
1063
|
+
uuid: string;
|
|
1064
|
+
};
|
|
1065
|
+
value?: OchrePropertyValueContent | Array<OchrePropertyValueContent> | FakeString;
|
|
1019
1066
|
comment?: FakeString;
|
|
1020
1067
|
property?: OchreProperty | Array<OchreProperty>;
|
|
1021
1068
|
};
|
|
@@ -1039,7 +1086,10 @@ type OchreIdentification = {
|
|
|
1039
1086
|
* Raw license structure corresponding to the parsed License type
|
|
1040
1087
|
*/
|
|
1041
1088
|
type OchreLicense = {
|
|
1042
|
-
license: {
|
|
1089
|
+
license: {
|
|
1090
|
+
content: string;
|
|
1091
|
+
target: string;
|
|
1092
|
+
} | string;
|
|
1043
1093
|
};
|
|
1044
1094
|
|
|
1045
1095
|
/**
|
|
@@ -1071,16 +1121,25 @@ type OchreLinkItem = {
|
|
|
1071
1121
|
/**
|
|
1072
1122
|
* Raw link structure corresponding to the parsed Link type
|
|
1073
1123
|
*/
|
|
1074
|
-
type OchreLink =
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1124
|
+
type OchreLink = {
|
|
1125
|
+
resource: OchreLinkItem | Array<OchreLinkItem>;
|
|
1126
|
+
} | {
|
|
1127
|
+
spatialUnit: OchreLinkItem | Array<OchreLinkItem>;
|
|
1128
|
+
} | {
|
|
1129
|
+
concept: OchreLinkItem | Array<OchreLinkItem>;
|
|
1130
|
+
} | {
|
|
1131
|
+
set: OchreLinkItem | Array<OchreLinkItem>;
|
|
1132
|
+
} | {
|
|
1133
|
+
tree: OchreLinkItem | Array<OchreLinkItem>;
|
|
1134
|
+
} | {
|
|
1135
|
+
person: OchreLinkItem | Array<OchreLinkItem>;
|
|
1136
|
+
} | {
|
|
1137
|
+
epigraphicUnit: OchreLinkItem | Array<OchreLinkItem>;
|
|
1138
|
+
} | {
|
|
1139
|
+
bibliography: OchreBibliography | Array<OchreBibliography>;
|
|
1140
|
+
} | {
|
|
1141
|
+
propertyValue: OchreLinkItem | Array<OchreLinkItem>;
|
|
1142
|
+
};
|
|
1084
1143
|
|
|
1085
1144
|
/**
|
|
1086
1145
|
* Raw image structure corresponding to the parsed Image type
|
|
@@ -1106,14 +1165,20 @@ type OchreBibliography = {
|
|
|
1106
1165
|
type?: string;
|
|
1107
1166
|
n?: number;
|
|
1108
1167
|
identification?: OchreIdentification;
|
|
1109
|
-
project?: {
|
|
1168
|
+
project?: {
|
|
1169
|
+
identification: OchreIdentification;
|
|
1170
|
+
};
|
|
1110
1171
|
context?: OchreContext;
|
|
1111
1172
|
sourceDocument?: {
|
|
1112
1173
|
uuid: string;
|
|
1113
1174
|
content: FakeString;
|
|
1114
1175
|
};
|
|
1115
1176
|
publicationInfo?: {
|
|
1116
|
-
publishers?: {
|
|
1177
|
+
publishers?: {
|
|
1178
|
+
publishers: {
|
|
1179
|
+
person: OchrePerson | Array<OchrePerson>;
|
|
1180
|
+
};
|
|
1181
|
+
};
|
|
1117
1182
|
startDate?: {
|
|
1118
1183
|
month: number;
|
|
1119
1184
|
year: number;
|
|
@@ -1125,58 +1190,55 @@ type OchreBibliography = {
|
|
|
1125
1190
|
startVolume: FakeString;
|
|
1126
1191
|
};
|
|
1127
1192
|
citationFormat?: string;
|
|
1128
|
-
citationFormatSpan?:
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1193
|
+
citationFormatSpan?: {
|
|
1194
|
+
span: {
|
|
1195
|
+
content: FakeString;
|
|
1196
|
+
};
|
|
1197
|
+
} | {
|
|
1198
|
+
"default:span": {
|
|
1199
|
+
content: FakeString;
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1202
|
+
referenceFormatDiv?: {
|
|
1203
|
+
div: {
|
|
1204
|
+
div: {
|
|
1205
|
+
class: string;
|
|
1206
|
+
content: FakeString;
|
|
1138
1207
|
};
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
class: string;
|
|
1148
|
-
};
|
|
1149
|
-
}
|
|
1150
|
-
| {
|
|
1151
|
-
"default:div": {
|
|
1152
|
-
"default:div": {
|
|
1153
|
-
class: string;
|
|
1154
|
-
content: FakeString;
|
|
1155
|
-
};
|
|
1156
|
-
style: string;
|
|
1157
|
-
class: string;
|
|
1158
|
-
};
|
|
1208
|
+
style: string;
|
|
1209
|
+
class: string;
|
|
1210
|
+
};
|
|
1211
|
+
} | {
|
|
1212
|
+
"default:div": {
|
|
1213
|
+
"default:div": {
|
|
1214
|
+
class: string;
|
|
1215
|
+
content: FakeString;
|
|
1159
1216
|
};
|
|
1217
|
+
style: string;
|
|
1218
|
+
class: string;
|
|
1219
|
+
};
|
|
1220
|
+
};
|
|
1160
1221
|
source?: {
|
|
1161
|
-
resource: Pick<
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
>;
|
|
1222
|
+
resource: Pick<OchreResource, "uuid" | "type" | "publicationDateTime" | "identification">;
|
|
1223
|
+
};
|
|
1224
|
+
periods?: {
|
|
1225
|
+
period: OchrePeriod | Array<OchrePeriod>;
|
|
1226
|
+
};
|
|
1227
|
+
authors?: {
|
|
1228
|
+
person: OchrePerson | Array<OchrePerson>;
|
|
1229
|
+
};
|
|
1230
|
+
properties?: {
|
|
1231
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
1165
1232
|
};
|
|
1166
|
-
periods?: { period: OchrePeriod | Array<OchrePeriod> };
|
|
1167
|
-
authors?: { person: OchrePerson | Array<OchrePerson> };
|
|
1168
|
-
properties?: { property: OchreProperty | Array<OchreProperty> };
|
|
1169
1233
|
};
|
|
1170
1234
|
|
|
1171
1235
|
/**
|
|
1172
1236
|
* Raw note structure corresponding to the parsed Note type
|
|
1173
1237
|
*/
|
|
1174
|
-
type OchreNote =
|
|
1175
|
-
|
|
1176
|
-
|
|
|
1177
|
-
|
|
1178
|
-
content: OchreStringRichText | Array<OchreStringRichText>;
|
|
1179
|
-
};
|
|
1238
|
+
type OchreNote = string | {
|
|
1239
|
+
noteNo: number;
|
|
1240
|
+
content: OchreStringRichText | Array<OchreStringRichText>;
|
|
1241
|
+
};
|
|
1180
1242
|
|
|
1181
1243
|
/**
|
|
1182
1244
|
* Raw period structure corresponding to the parsed Period type
|
|
@@ -1258,8 +1320,12 @@ type OchrePerson = {
|
|
|
1258
1320
|
};
|
|
1259
1321
|
coordinates?: OchreCoordinates;
|
|
1260
1322
|
content?: FakeString | null;
|
|
1261
|
-
events?: {
|
|
1262
|
-
|
|
1323
|
+
events?: {
|
|
1324
|
+
event: OchreEvent | Array<OchreEvent>;
|
|
1325
|
+
};
|
|
1326
|
+
properties?: {
|
|
1327
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
1328
|
+
};
|
|
1263
1329
|
};
|
|
1264
1330
|
|
|
1265
1331
|
/**
|
|
@@ -1269,9 +1335,13 @@ type OchreObservation = {
|
|
|
1269
1335
|
observationNo: number;
|
|
1270
1336
|
date?: string; // YYYY-MM-DD
|
|
1271
1337
|
observers?: FakeString;
|
|
1272
|
-
notes?: {
|
|
1338
|
+
notes?: {
|
|
1339
|
+
note: OchreNote | Array<OchreNote>;
|
|
1340
|
+
};
|
|
1273
1341
|
links?: OchreLink | Array<OchreLink>;
|
|
1274
|
-
properties?: {
|
|
1342
|
+
properties?: {
|
|
1343
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
1344
|
+
};
|
|
1275
1345
|
};
|
|
1276
1346
|
|
|
1277
1347
|
/**
|
|
@@ -1311,7 +1381,9 @@ type OchreEvent = {
|
|
|
1311
1381
|
type OchreInterpretation = {
|
|
1312
1382
|
date: string; // YYYY-MM-DD
|
|
1313
1383
|
interpretationNo: number;
|
|
1314
|
-
properties?: {
|
|
1384
|
+
properties?: {
|
|
1385
|
+
property: OchreProperty | Array<OchreProperty>;
|
|
1386
|
+
};
|
|
1315
1387
|
};
|
|
1316
1388
|
|
|
1317
1389
|
/**
|
|
@@ -1325,12 +1397,21 @@ type OchrePropertyValue = {
|
|
|
1325
1397
|
availability?: OchreLicense;
|
|
1326
1398
|
identification: OchreIdentification;
|
|
1327
1399
|
date?: string; // YYYY-MM-DD
|
|
1328
|
-
creators?: {
|
|
1400
|
+
creators?: {
|
|
1401
|
+
creator: OchrePerson | Array<OchrePerson>;
|
|
1402
|
+
};
|
|
1329
1403
|
description?: OchreStringContent | FakeString;
|
|
1330
|
-
notes?: {
|
|
1404
|
+
notes?: {
|
|
1405
|
+
note: OchreNote | Array<OchreNote>;
|
|
1406
|
+
};
|
|
1331
1407
|
links?: OchreLink | Array<OchreLink>;
|
|
1332
1408
|
};
|
|
1333
1409
|
|
|
1410
|
+
//#endregion
|
|
1411
|
+
//#region src/utils/fetchers/uuid.d.ts
|
|
1412
|
+
/**
|
|
1413
|
+
* Raw gallery response structure
|
|
1414
|
+
*/
|
|
1334
1415
|
/**
|
|
1335
1416
|
* Fetches raw OCHRE data by UUID from the OCHRE API
|
|
1336
1417
|
*
|
|
@@ -1351,6 +1432,8 @@ type OchrePropertyValue = {
|
|
|
1351
1432
|
*/
|
|
1352
1433
|
declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string, null]>;
|
|
1353
1434
|
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region src/utils/fetchers/website.d.ts
|
|
1354
1437
|
/**
|
|
1355
1438
|
* Fetches and parses a website configuration from the OCHRE API
|
|
1356
1439
|
*
|
|
@@ -1382,12 +1465,14 @@ declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string,
|
|
|
1382
1465
|
*/
|
|
1383
1466
|
declare function fetchWebsite(abbreviation: string): Promise<Website | null>;
|
|
1384
1467
|
|
|
1468
|
+
//#endregion
|
|
1469
|
+
//#region src/utils/getters.d.ts
|
|
1385
1470
|
/**
|
|
1386
1471
|
* Options for property search operations
|
|
1387
1472
|
*/
|
|
1388
1473
|
type PropertyOptions = {
|
|
1389
|
-
|
|
1390
|
-
|
|
1474
|
+
/** Whether to recursively search through nested properties */
|
|
1475
|
+
includeNestedProperties: boolean;
|
|
1391
1476
|
};
|
|
1392
1477
|
/**
|
|
1393
1478
|
* Finds a property by its label in an array of properties
|
|
@@ -1478,10 +1563,12 @@ declare function getUniqueProperties(properties: Array<Property>, options?: Prop
|
|
|
1478
1563
|
* ```
|
|
1479
1564
|
*/
|
|
1480
1565
|
declare function filterProperties(property: Property, filter: {
|
|
1481
|
-
|
|
1482
|
-
|
|
1566
|
+
label: string;
|
|
1567
|
+
value: string | number | boolean | Date;
|
|
1483
1568
|
}, options?: PropertyOptions): boolean;
|
|
1484
1569
|
|
|
1570
|
+
//#endregion
|
|
1571
|
+
//#region src/utils/parse.d.ts
|
|
1485
1572
|
/**
|
|
1486
1573
|
* Parses raw identification data into the standardized Identification type
|
|
1487
1574
|
*
|
|
@@ -1719,6 +1806,8 @@ declare function parseConcept(concept: OchreConcept): Concept;
|
|
|
1719
1806
|
declare function parseConcepts(concepts: Array<OchreConcept>): Array<Concept>;
|
|
1720
1807
|
declare function parseWebsite(websiteTree: OchreTree, projectName: FakeString, website: FakeString | null): Promise<Website>;
|
|
1721
1808
|
|
|
1809
|
+
//#endregion
|
|
1810
|
+
//#region src/utils/string.d.ts
|
|
1722
1811
|
/**
|
|
1723
1812
|
* Parses email addresses in a string into HTML links
|
|
1724
1813
|
*
|
|
@@ -1770,4 +1859,5 @@ declare function parseStringDocumentItem(item: OchreStringRichTextItem, footnote
|
|
|
1770
1859
|
*/
|
|
1771
1860
|
declare function parseStringContent(content: OchreStringContent, language?: string): string;
|
|
1772
1861
|
|
|
1773
|
-
|
|
1862
|
+
//#endregion
|
|
1863
|
+
export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, Data, DataCategory, Document, Event, Footnote, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, WebBlock, WebElement, WebElementComponent, WebImage, WebSectionSidebarItem, Webpage, WebpageProperties, Website, WebsiteProperties, fetchByUuid, fetchGallery, fetchItem, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, getUniqueProperties, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
|