ochre-sdk 1.3.9 → 1.3.10

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/errors.d.mts CHANGED
@@ -20,4 +20,5 @@ export declare function getErrorOutput(error: unknown, fallbackMessage: string):
20
20
  * @internal
21
21
  */
22
22
  export declare function createSchemaValidationError(message: string, issues: ReadonlyArray<SchemaValidationIssue>): Error;
23
- //#endregion
23
+ //#endregion
24
+ export {};
@@ -32,4 +32,5 @@ export declare function fetchItemChildren<const TCategory extends ItemCategoryOp
32
32
  category: TCategory;
33
33
  containedItemCategory?: TContainedItemCategory;
34
34
  }): FetchItemChildrenResult<Array<Item<TChildCategory, ContainedItemCategoryFromOption<TChildCategory, TContainedItemCategory>, FetchLanguages<TLanguages>, ItemChildrenPayloadKind<ItemCategoryFromOption<TCategory>>>>>;
35
- //#endregion
35
+ //#endregion
36
+ export {};
@@ -44,4 +44,5 @@ export declare function fetchItem<const TCategory extends ItemCategoryOption, co
44
44
  containedItemCategory?: TContainedItemCategory;
45
45
  shouldOmitEmbeddedItems: true;
46
46
  }): FetchItemResult<ItemWithoutEmbeddedItems<Extract<ItemCategoryFromOption<TCategory>, ItemCategoryWithEmbeddedItems>, ContainedItemCategoryFromOption<Extract<ItemCategoryFromOption<TCategory>, ItemCategoryWithEmbeddedItems>, TContainedItemCategory>, FetchLanguages<TLanguages>> | Item<Exclude<ItemCategoryFromOption<TCategory>, ItemCategoryWithEmbeddedItems>, never, FetchLanguages<TLanguages>>>;
47
- //#endregion
47
+ //#endregion
48
+ export {};
@@ -38,4 +38,5 @@ export declare function fetchSetItems<const TContainedItemCategories extends Rea
38
38
  error: string;
39
39
  detailedError: string;
40
40
  }>;
41
- //#endregion
41
+ //#endregion
42
+ export {};
@@ -50,4 +50,5 @@ export declare function fetchTreeItems<const TContainedItemCategories extends Re
50
50
  error: string;
51
51
  detailedError: string;
52
52
  }>;
53
- //#endregion
53
+ //#endregion
54
+ export {};
@@ -135,4 +135,5 @@ export declare function isPropertyMatchingFilter<T extends LanguageCodes = Langu
135
135
  variableLabel: string;
136
136
  value: PropertyValueContent<T>;
137
137
  }, options?: PropertyOptions): boolean;
138
- //#endregion
138
+ //#endregion
139
+ export {};
@@ -9,4 +9,5 @@ type FlattenedItem<U, T extends LanguageCodes> = Omit<U, "properties"> & {
9
9
  * @returns The item with the properties flattened
10
10
  */
11
11
  export declare function flattenItemProperties<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes, W extends ItemPayloadKind = "topLevel">(item: Item<U, V, T, W>): FlattenedItem<Item<U, V, T, W>, T>;
12
- //#endregion
12
+ //#endregion
13
+ export {};
@@ -310,4 +310,5 @@ export declare class MultilingualString<T extends ReadonlyArray<string> = Readon
310
310
  */
311
311
  toJSON(): MultilingualStringJSON<T>;
312
312
  }
313
- //#endregion
313
+ //#endregion
314
+ export {};
@@ -31,4 +31,5 @@ export declare function readPropertyValueText(value: PropertyValueTextSource, re
31
31
  export declare function readPropertyValueUuid(value: {
32
32
  uuid?: string;
33
33
  } | undefined): string | null;
34
- //#endregion
34
+ //#endregion
35
+ export {};
@@ -88,4 +88,5 @@ export declare function parseWebTitle<T extends ReadonlyArray<string>>(propertie
88
88
  * @returns Parsed WebElement object
89
89
  */
90
90
  export declare function parseWebElement<T extends ReadonlyArray<string>>(elementResource: XMLWebsiteResource, options: ParserOptions<T>, pageSlugs: WebsitePageSlugs | undefined): WebElement<T>;
91
- //#endregion
91
+ //#endregion
92
+ export {};
@@ -124,15 +124,27 @@ function parse3dViewerComponent(parameters) {
124
124
  isControlsDisplayed
125
125
  };
126
126
  }
127
+ const ADVANCED_SEARCH_FILTER_DEFAULTS = {
128
+ sidebarSort: "default",
129
+ isSidebarHelpTooltipsDisplayed: false,
130
+ isSidebarResultCountsDisplayed: false
131
+ };
127
132
  function parseAdvancedSearchComponent(parameters) {
128
133
  const { componentProperty, componentReader, elementResource, options, pageSlugs } = parameters;
129
134
  const boundElementPropertyUuid = componentReader.uuid("bound-element");
130
135
  const href = parseWebsiteLinkTarget(componentReader.valueNode("link-to"), pageSlugs);
131
136
  if (boundElementPropertyUuid == null && href == null) throw new Error(formatComponentError("Bound element or href not found", "advanced-search", elementResource), { cause: componentProperty });
137
+ const filter = { ...ADVANCED_SEARCH_FILTER_DEFAULTS };
138
+ componentReader.readAll(filter, {
139
+ sidebarSort: "filter-sidebar-sort",
140
+ isSidebarHelpTooltipsDisplayed: "filter-sidebar-help-tooltips-displayed",
141
+ isSidebarResultCountsDisplayed: "filter-sidebar-result-counts-displayed"
142
+ });
132
143
  return {
133
144
  component: "advanced-search",
134
145
  boundElementUuid: boundElementPropertyUuid,
135
146
  href,
147
+ filter,
136
148
  options: parseWebsiteOptions(elementResource.options, options)
137
149
  };
138
150
  }
@@ -255,7 +267,8 @@ const COLLECTION_FILTER_DEFAULTS = {
255
267
  isLimitedToLeafPropertyValues: false,
256
268
  isSidebarDisplayed: false,
257
269
  sidebarSort: "default",
258
- isSidebarHelpTooltipsDisplayed: false
270
+ isSidebarHelpTooltipsDisplayed: false,
271
+ isSidebarResultCountsDisplayed: false
259
272
  };
260
273
  function parseCollectionComponent(parameters) {
261
274
  const { componentProperty, componentReader, elementResource, websiteLinks, options } = parameters;
@@ -270,7 +283,8 @@ function parseCollectionComponent(parameters) {
270
283
  isLimitedToLeafPropertyValues: "filter-limit-to-leaf-property-values",
271
284
  isSidebarDisplayed: "filter-sidebar-displayed",
272
285
  sidebarSort: "filter-sidebar-sort",
273
- isSidebarHelpTooltipsDisplayed: "filter-sidebar-help-tooltips-displayed"
286
+ isSidebarHelpTooltipsDisplayed: "filter-sidebar-help-tooltips-displayed",
287
+ isSidebarResultCountsDisplayed: "filter-sidebar-result-counts-displayed"
274
288
  });
275
289
  const componentOptions = parseWebsiteOptions(elementResource.options, options);
276
290
  const propertyOverrides = parseCollectionPropertyOverrides(componentReader);
@@ -413,7 +427,8 @@ const MAP_COMPONENT_DEFAULTS = {
413
427
  isClustered: false,
414
428
  isUsingPins: false,
415
429
  isControlsDisplayed: false,
416
- isFullHeight: false
430
+ isFullHeight: false,
431
+ isMapCenterSortOptionDisplayed: false
417
432
  };
418
433
  function parseMapComponent(parameters) {
419
434
  const { componentProperty, componentReader, elementResource, websiteLinks } = parameters;
@@ -425,9 +440,9 @@ function parseMapComponent(parameters) {
425
440
  isClustered: "is-clustered",
426
441
  isUsingPins: "is-using-pins",
427
442
  isControlsDisplayed: "controls-displayed",
428
- isFullHeight: "is-full-height"
443
+ isFullHeight: "is-full-height",
444
+ isMapCenterSortOptionDisplayed: "map-center-sort-option-displayed"
429
445
  });
430
- const { isInteractive, isClustered, isUsingPins, isControlsDisplayed, isFullHeight } = properties;
431
446
  const customBasemap = componentReader.value("custom-basemap");
432
447
  let initialBounds = null;
433
448
  const initialBoundsProperty = componentReader.value("initial-bounds");
@@ -442,11 +457,7 @@ function parseMapComponent(parameters) {
442
457
  customBasemap,
443
458
  initialBounds,
444
459
  maximumBounds,
445
- isInteractive,
446
- isClustered,
447
- isUsingPins,
448
- isControlsDisplayed,
449
- isFullHeight
460
+ ...properties
450
461
  };
451
462
  }
452
463
  function parseQueryItemQueries(propertyVariables, queryLanguage, elementResource) {
@@ -74,4 +74,5 @@ export declare class WebsitePresentationReader<T extends LanguageCodes> {
74
74
  get size(): number;
75
75
  }
76
76
  export declare function websitePresentationReader<T extends LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>): WebsitePresentationReader<T>;
77
- //#endregion
77
+ //#endregion
78
+ export {};
package/dist/query.d.mts CHANGED
@@ -111,4 +111,5 @@ export declare function getPropertyFacetSelectors(queries: Query | null): Array<
111
111
  uuid: string;
112
112
  relation: PropertyRelation | null;
113
113
  }>;
114
- //#endregion
114
+ //#endregion
115
+ export {};
@@ -986,4 +986,5 @@ export type ItemProperty<T extends LanguageCodes = LanguageCodes> = Property<T>
986
986
  */
987
987
  export type RecursiveItemCategory = Exclude<ItemCategory, "tree" | "person" | "propertyVariable" | "propertyValue" | "set">;
988
988
  export type TopLevelItem<U extends ItemCategory = ItemCategory, V extends ContainedItemCategory<U> = ContainedItemCategory<U>, T extends LanguageCodes = LanguageCodes> = Item<U, V, T, "topLevel">;
989
- //#endregion
989
+ //#endregion
990
+ export {};
@@ -297,6 +297,11 @@ export type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
297
297
  component: "advanced-search";
298
298
  boundElementUuid: string | null;
299
299
  href: string | null;
300
+ filter: {
301
+ sidebarSort: "default" | "alphabetical";
302
+ isSidebarHelpTooltipsDisplayed: boolean;
303
+ isSidebarResultCountsDisplayed: boolean;
304
+ };
300
305
  options: WebOptions<T>;
301
306
  } | {
302
307
  component: "annotated-document";
@@ -372,6 +377,7 @@ export type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
372
377
  isLimitedToLeafPropertyValues: boolean;
373
378
  sidebarSort: "default" | "alphabetical";
374
379
  isSidebarHelpTooltipsDisplayed: boolean;
380
+ isSidebarResultCountsDisplayed: boolean;
375
381
  };
376
382
  options: WebOptions<T>;
377
383
  } | {
@@ -424,6 +430,7 @@ export type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
424
430
  isClustered: boolean;
425
431
  isUsingPins: boolean;
426
432
  isFullHeight: boolean;
433
+ isMapCenterSortOptionDisplayed: boolean;
427
434
  } | {
428
435
  component: "query";
429
436
  linkUuids: Array<string>;
@@ -1,4 +1,4 @@
1
- import { XMLBibliography, XMLData as XMLData$1, XMLDataItem as XMLDataItem$1, XMLItemLinksData as XMLItemLinksData$1, XMLLink as XMLLink$1, XMLPeriod, XMLPerson, XMLProperty, XMLResource, XMLSetItemsData as XMLSetItemsData$1, XMLString, XMLWebsiteResource, XMLWebsiteResourceItem, types_d_exports } from "./types.mjs";
1
+ import { XMLBibliography, XMLData as XMLData$1, XMLDataItem as XMLDataItem$1, XMLItemLinksData as XMLItemLinksData$1, XMLLink as XMLLink$1, XMLPeriod, XMLPerson, XMLProperty, XMLResource, XMLSetItemsData as XMLSetItemsData$1, XMLString, XMLWebsiteResource, XMLWebsiteResourceItem } from "./types.mjs";
2
2
  import * as v from "valibot";
3
3
  //#region src/xml/schemas.d.ts
4
4
  export declare const XMLLink: v.GenericSchema<unknown, XMLLink$1>;
@@ -1,6 +1,4 @@
1
- declare namespace types_d_exports {
2
- export { XMLBaseItem, XMLBibliography, XMLConcept, XMLContent, XMLContext, XMLContextGroup, XMLContextItem, XMLContextValue, XMLCoordinate, XMLCoordinates, XMLCoordinatesSource, XMLData, XMLDataItem, XMLDictionaryUnit, XMLEmptyContext, XMLEvent, XMLGallery, XMLGalleryData, XMLHeading, XMLHeadingItemCategory, XMLIdentification, XMLImage, XMLImageMap, XMLImageMapArea, XMLInterpretation, XMLItemCategory, XMLItemLinks, XMLItemLinksData, XMLLicense, XMLLink, XMLLinkedBaseItem, XMLLinkedBibliography, XMLLinkedConcept, XMLLinkedPeriod, XMLLinkedPerson, XMLLinkedPropertyValue, XMLLinkedPropertyVariable, XMLLinkedResource, XMLLinkedSet, XMLLinkedSpatialUnit, XMLLinkedText, XMLLinkedTree, XMLMetadata, XMLNote, XMLObservation, XMLPeriod, XMLPerson, XMLProperty, XMLPropertyRelation, XMLPropertyValue, XMLPropertyVariable, XMLRecursiveItemCategory, XMLResource, XMLRichTextEnvelope, XMLSection, XMLSet, XMLSetItemLocation, XMLSetItemLocationsData, XMLSetItems, XMLSetItemsData, XMLSetStyle, XMLSimplifiedProperty, XMLSpatialUnit, XMLString, XMLText, XMLTree, XMLWebsiteContext, XMLWebsiteContextItem, XMLWebsiteContextLevel, XMLWebsiteData, XMLWebsiteFilterContext, XMLWebsiteFilterContextItem, XMLWebsiteOptions, XMLWebsiteProperties, XMLWebsiteResource, XMLWebsiteResourceGroup, XMLWebsiteResourceItem, XMLWebsiteScope, XMLWebsiteSegment, XMLWebsiteStyle, XMLWebsiteTree };
3
- }
1
+ //#region src/xml/types.d.ts
4
2
  export type XMLItemCategory = "tree" | "bibliography" | "spatialUnit" | "concept" | "period" | "person" | "propertyVariable" | "variable" | "propertyValue" | "value" | "text" | "resource" | "set";
5
3
  export type XMLRecursiveItemCategory = Exclude<XMLItemCategory, "tree" | "person" | "propertyVariable" | "propertyValue" | "set">;
6
4
  /**
@@ -936,5 +934,4 @@ export type XMLWebsiteData = {
936
934
  };
937
935
  };
938
936
  export type XMLHeadingItemCategory = Exclude<XMLItemCategory, "tree" | "bibliography" | "spatialUnit" | "concept" | "period">;
939
- //#endregion
940
- export { types_d_exports };
937
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
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",
@@ -45,23 +45,23 @@
45
45
  "dist"
46
46
  ],
47
47
  "dependencies": {
48
- "fast-equals": "^6.1.0",
48
+ "fast-equals": "^6.1.1",
49
49
  "fast-xml-parser": "^5.11.2",
50
50
  "valibot": "^1.5.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@antfu/eslint-config": "^9.5.1",
54
- "@types/node": "^24.19.1",
54
+ "@types/node": "^24.19.2",
55
55
  "bumpp": "^12.3.0",
56
56
  "eslint": "^10.12.0",
57
57
  "eslint-plugin-erasable-syntax-only": "^0.7.2",
58
58
  "eslint-plugin-slop": "^0.1.3",
59
59
  "eslint-plugin-sonarjs": "^4.2.2",
60
- "knip": "^6.40.0",
61
- "oxfmt": "^0.72.0",
62
- "tsdown": "^0.23.0",
60
+ "knip": "^6.41.0",
61
+ "oxfmt": "^0.73.0",
62
+ "tsdown": "^0.23.1",
63
63
  "typescript": "^6.0.3",
64
- "vitest": "^5.0.3"
64
+ "vitest": "^5.0.4"
65
65
  },
66
66
  "scripts": {
67
67
  "dev": "tsdown src/index.ts --watch",
@@ -1,13 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
- return target;
11
- };
12
- //#endregion
13
- export { __exportAll };