@digitalculture/ochre-sdk 0.12.3 → 0.12.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 CHANGED
@@ -654,7 +654,7 @@ type WebElementComponent = {
654
654
  image: WebImage | null;
655
655
  } | {
656
656
  component: "collection";
657
- collectionId: string;
657
+ collectionIds: Array<string>;
658
658
  variant: "full" | "highlights";
659
659
  itemVariant: "detailed" | "card" | "tile";
660
660
  paginationVariant: "default" | "numeric";
@@ -742,6 +742,11 @@ type WebElementComponent = {
742
742
  startIcon: string | null;
743
743
  endIcon: string | null;
744
744
  }>;
745
+ scopes: Array<{
746
+ uuid: string;
747
+ type: string;
748
+ identification: Identification;
749
+ }>;
745
750
  } | {
746
751
  component: "search-bar";
747
752
  variant: "default" | "full";
package/dist/index.mjs CHANGED
@@ -1783,8 +1783,8 @@ function parseWebElementProperties(componentProperty, elementResource) {
1783
1783
  break;
1784
1784
  }
1785
1785
  case "collection": {
1786
- const collectionLink = links.find((link) => link.category === "set");
1787
- if (!collectionLink) throw new Error(`Collection link not found for the following component: “${componentName}”`);
1786
+ const collectionLinks = links.filter((link) => link.category === "set");
1787
+ if (collectionLinks.length === 0) throw new Error(`Collection links not found for the following component: “${componentName}”`);
1788
1788
  let variant = getPropertyValueByLabel(componentProperty.properties, "variant");
1789
1789
  variant ??= "full";
1790
1790
  let itemVariant = getPropertyValueByLabel(componentProperty.properties, "item-variant");
@@ -1845,7 +1845,7 @@ function parseWebElementProperties(componentProperty, elementResource) {
1845
1845
  prominent: parseContexts(prominentContextsRaw)
1846
1846
  };
1847
1847
  }
1848
- properties.collectionId = collectionLink.uuid;
1848
+ properties.collectionIds = collectionLinks.map((link) => link.uuid);
1849
1849
  properties.variant = variant;
1850
1850
  properties.itemVariant = itemVariant;
1851
1851
  properties.paginationVariant = paginationVariant;
@@ -2038,7 +2038,13 @@ function parseWebElementProperties(componentProperty, elementResource) {
2038
2038
  endIcon: endIcon !== null ? String(endIcon) : null
2039
2039
  });
2040
2040
  }
2041
+ const scopes = elementResource.options?.scopes != null ? (Array.isArray(elementResource.options.scopes.scope) ? elementResource.options.scopes.scope : [elementResource.options.scopes.scope]).map((scope) => ({
2042
+ uuid: scope.uuid.content,
2043
+ type: scope.uuid.type,
2044
+ identification: parseIdentification(scope.identification)
2045
+ })) : [];
2041
2046
  properties.queries = queries;
2047
+ properties.scopes = scopes;
2042
2048
  break;
2043
2049
  }
2044
2050
  case "table": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
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",
@@ -49,7 +49,7 @@
49
49
  "eslint": "^9.39.1",
50
50
  "prettier": "^3.6.2",
51
51
  "terser": "^5.44.1",
52
- "tsdown": "^0.16.1",
52
+ "tsdown": "^0.16.2",
53
53
  "typescript": "^5.9.3",
54
54
  "vitest": "^4.0.8"
55
55
  },