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