@digitalculture/ochre-sdk 0.13.4 → 0.13.6

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 CHANGED
@@ -100,7 +100,7 @@ type Person = {
100
100
  state: string | null;
101
101
  } | null;
102
102
  description: string | null;
103
- coordinates: 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 coordinates item with optional type and label
180
+ * Geographic coordinate with optional type and label
181
181
  */
182
- type CoordinatesItem = {
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: 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: Coordinates;
320
+ coordinates: Array<Coordinate>;
325
321
  mapData: {
326
322
  geoJSON: {
327
323
  multiPolygon: string;
@@ -534,6 +530,19 @@ type LevelContext = {
534
530
  identification: Identification;
535
531
  type: string;
536
532
  };
533
+ /**
534
+ * Represents property contexts with its levels
535
+ */
536
+ type PropertyContexts = {
537
+ flatten: Array<LevelContext>;
538
+ suppress: Array<LevelContext>;
539
+ filter: Array<LevelContext>;
540
+ sort: Array<LevelContext>;
541
+ detail: Array<LevelContext>;
542
+ download: Array<LevelContext>;
543
+ label: Array<LevelContext>;
544
+ prominent: Array<LevelContext>;
545
+ };
537
546
  /**
538
547
  * Represents a website with its properties and elements
539
548
  */
@@ -581,16 +590,7 @@ type Website = {
581
590
  itemPage: {
582
591
  iiifViewer: "universal-viewer" | "clover";
583
592
  options: {
584
- contexts: {
585
- flatten: Array<LevelContext>;
586
- suppress: Array<LevelContext>;
587
- filter: Array<LevelContext>;
588
- sort: Array<LevelContext>;
589
- detail: Array<LevelContext>;
590
- download: Array<LevelContext>;
591
- label: Array<LevelContext>;
592
- prominent: Array<LevelContext>;
593
- };
593
+ contexts: PropertyContexts;
594
594
  };
595
595
  };
596
596
  };
@@ -718,16 +718,7 @@ type WebElementComponent = {
718
718
  type: string;
719
719
  identification: Identification;
720
720
  }>;
721
- contexts: {
722
- flatten: Array<LevelContext>;
723
- suppress: Array<LevelContext>;
724
- filter: Array<LevelContext>;
725
- sort: Array<LevelContext>;
726
- detail: Array<LevelContext>;
727
- download: Array<LevelContext>;
728
- label: Array<LevelContext>;
729
- prominent: Array<LevelContext>;
730
- };
721
+ contexts: PropertyContexts;
731
722
  };
732
723
  } | {
733
724
  component: "empty-space";
@@ -1240,4 +1231,4 @@ declare function filterProperties(property: Property, filter: {
1240
1231
  value: string | number | boolean | Date;
1241
1232
  }, options?: PropertyOptions): boolean;
1242
1233
  //#endregion
1243
- export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, CoordinatesItem, 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 };
1234
+ 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, PropertyContexts, 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 Coordinates structure
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 Coordinates object
1028
+ * @returns Parsed array of Coordinate objects
1029
1029
  */
1030
1030
  function parseCoordinates(coordinates) {
1031
1031
  if (coordinates == null) return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.13.4",
3
+ "version": "0.13.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",
@@ -43,13 +43,13 @@
43
43
  "zod": "^4.1.13"
44
44
  },
45
45
  "devDependencies": {
46
- "@antfu/eslint-config": "^6.3.0",
46
+ "@antfu/eslint-config": "^6.4.1",
47
47
  "@types/node": "^24.10.1",
48
48
  "bumpp": "^10.3.2",
49
49
  "eslint": "^9.39.1",
50
50
  "prettier": "^3.7.4",
51
51
  "terser": "^5.44.1",
52
- "tsdown": "^0.16.8",
52
+ "tsdown": "^0.17.0",
53
53
  "typescript": "^5.9.3",
54
54
  "vitest": "^4.0.15"
55
55
  },