@digitalculture/ochre-sdk 0.13.3 → 0.13.5
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/dist/index.d.mts +10 -14
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -100,7 +100,7 @@ type Person = {
|
|
|
100
100
|
state: string | null;
|
|
101
101
|
} | null;
|
|
102
102
|
description: string | null;
|
|
103
|
-
coordinates:
|
|
103
|
+
coordinates: Array<Coordinate>;
|
|
104
104
|
content: string | null;
|
|
105
105
|
notes: Array<Note>;
|
|
106
106
|
links: Array<Link>;
|
|
@@ -177,9 +177,9 @@ type ImageMap = {
|
|
|
177
177
|
height: number;
|
|
178
178
|
};
|
|
179
179
|
/**
|
|
180
|
-
* Geographic
|
|
180
|
+
* Geographic coordinate with optional type and label
|
|
181
181
|
*/
|
|
182
|
-
type
|
|
182
|
+
type Coordinate = {
|
|
183
183
|
type: "point";
|
|
184
184
|
latitude: number;
|
|
185
185
|
longitude: number;
|
|
@@ -231,10 +231,6 @@ type CoordinatesItem = {
|
|
|
231
231
|
label: string;
|
|
232
232
|
} | null;
|
|
233
233
|
};
|
|
234
|
-
/**
|
|
235
|
-
* Geographic coordinates with optional type and label
|
|
236
|
-
*/
|
|
237
|
-
type Coordinates = Array<CoordinatesItem>;
|
|
238
234
|
/**
|
|
239
235
|
* Represents an observation with notes, links and properties
|
|
240
236
|
*/
|
|
@@ -294,7 +290,7 @@ type Resource = {
|
|
|
294
290
|
creators: Array<Person>;
|
|
295
291
|
notes: Array<Note>;
|
|
296
292
|
description: string;
|
|
297
|
-
coordinates:
|
|
293
|
+
coordinates: Array<Coordinate>;
|
|
298
294
|
document: string | null;
|
|
299
295
|
href: string | null;
|
|
300
296
|
fileFormat: string | null;
|
|
@@ -321,7 +317,7 @@ type SpatialUnit = {
|
|
|
321
317
|
identification: Identification;
|
|
322
318
|
image: Image | null;
|
|
323
319
|
description: string | null;
|
|
324
|
-
coordinates:
|
|
320
|
+
coordinates: Array<Coordinate>;
|
|
325
321
|
mapData: {
|
|
326
322
|
geoJSON: {
|
|
327
323
|
multiPolygon: string;
|
|
@@ -354,7 +350,7 @@ type Concept = {
|
|
|
354
350
|
/**
|
|
355
351
|
* Represents a set that can contain resources, spatial units and concepts
|
|
356
352
|
*/
|
|
357
|
-
type Set<U extends DataCategory> = {
|
|
353
|
+
type Set<U extends DataCategory = DataCategory> = {
|
|
358
354
|
uuid: string;
|
|
359
355
|
category: "set";
|
|
360
356
|
metadata: Metadata | null;
|
|
@@ -368,7 +364,7 @@ type Set<U extends DataCategory> = {
|
|
|
368
364
|
isSuppressingBlanks: boolean;
|
|
369
365
|
description: string;
|
|
370
366
|
creators: Array<Person>;
|
|
371
|
-
items: U extends "resource" ? Array<Resource> : U extends "spatialUnit" ? Array<SpatialUnit> : U extends "concept" ? Array<Concept> : U extends "period" ? Array<Period> : U extends "bibliography" ? Array<Bibliography> : U extends "person" ? Array<Person> : U extends "propertyValue" ? Array<PropertyValue> : U extends "tree" ? Array<Tree<Exclude<DataCategory, "tree">>> : U extends "set" ? Array<Set<DataCategory>> :
|
|
367
|
+
items: [DataCategory] extends [U] ? Array<Item> : U extends "resource" ? Array<Resource> : U extends "spatialUnit" ? Array<SpatialUnit> : U extends "concept" ? Array<Concept> : U extends "period" ? Array<Period> : U extends "bibliography" ? Array<Bibliography> : U extends "person" ? Array<Person> : U extends "propertyValue" ? Array<PropertyValue> : U extends "tree" ? Array<Tree<Exclude<DataCategory, "tree">>> : U extends "set" ? Array<Set<DataCategory>> : Array<Item>;
|
|
372
368
|
};
|
|
373
369
|
/**
|
|
374
370
|
* Represents a bibliography entry with citation and publication information
|
|
@@ -467,7 +463,7 @@ type Property<T extends PropertyValueContentType = PropertyValueContentType> = {
|
|
|
467
463
|
/**
|
|
468
464
|
* Represents a tree structure containing resources, spatial units and concepts
|
|
469
465
|
*/
|
|
470
|
-
type Tree<U extends Exclude<DataCategory, "tree">> = {
|
|
466
|
+
type Tree<U extends Exclude<DataCategory, "tree"> = Exclude<DataCategory, "tree">> = {
|
|
471
467
|
uuid: string;
|
|
472
468
|
category: "tree";
|
|
473
469
|
metadata: Metadata | null;
|
|
@@ -479,7 +475,7 @@ type Tree<U extends Exclude<DataCategory, "tree">> = {
|
|
|
479
475
|
identification: Identification;
|
|
480
476
|
creators: Array<Person>;
|
|
481
477
|
properties: Array<Property>;
|
|
482
|
-
items: U extends "resource" ? Array<Resource> : U extends "spatialUnit" ? Array<SpatialUnit> : U extends "concept" ? Array<Concept> : U extends "period" ? Array<Period> : U extends "bibliography" ? Array<Bibliography> : U extends "person" ? Array<Person> : U extends "propertyValue" ? Array<PropertyValue> : U extends "set" ? Array<Set<DataCategory>> :
|
|
478
|
+
items: [Exclude<DataCategory, "tree">] extends [U] ? Array<Item> : U extends "resource" ? Array<Resource> : U extends "spatialUnit" ? Array<SpatialUnit> : U extends "concept" ? Array<Concept> : U extends "period" ? Array<Period> : U extends "bibliography" ? Array<Bibliography> : U extends "person" ? Array<Person> : U extends "propertyValue" ? Array<PropertyValue> : U extends "set" ? Array<Set<DataCategory>> : Array<Item>;
|
|
483
479
|
};
|
|
484
480
|
/**
|
|
485
481
|
* Represents a gallery with its identification, project identification, resources and max length
|
|
@@ -1240,4 +1236,4 @@ declare function filterProperties(property: Property, filter: {
|
|
|
1240
1236
|
value: string | number | boolean | Date;
|
|
1241
1237
|
}, options?: PropertyOptions): boolean;
|
|
1242
1238
|
//#endregion
|
|
1243
|
-
export { Bibliography, Concept, Context, ContextItem, ContextNode,
|
|
1239
|
+
export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyQueryItem, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, UuidMetadata, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebTitle, Webpage, Website, fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
|
package/dist/index.mjs
CHANGED
|
@@ -1022,10 +1022,10 @@ function parseNotes(notes, language = "eng") {
|
|
|
1022
1022
|
return returnNotes;
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
|
-
* Parses raw coordinates data into a standardized
|
|
1025
|
+
* Parses raw coordinates data into a standardized array of Coordinate structures
|
|
1026
1026
|
*
|
|
1027
1027
|
* @param coordinates - Raw coordinates data in OCHRE format
|
|
1028
|
-
* @returns Parsed
|
|
1028
|
+
* @returns Parsed array of Coordinate objects
|
|
1029
1029
|
*/
|
|
1030
1030
|
function parseCoordinates(coordinates) {
|
|
1031
1031
|
if (coordinates == null) return [];
|
package/package.json
CHANGED