ochre-sdk 1.3.20 → 1.3.22

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
@@ -1,5 +1,5 @@
1
1
  import { MultilingualOptions, MultilingualString, MultilingualStringEntries, MultilingualStringEntry, MultilingualStringInput, MultilingualStringJSON, MultilingualStringObject, MultilingualStringText } from "./parsers/multilingual.mjs";
2
- import { AccordionWebBlock, ContextTree, ContextTreeFilterLevel, ContextTreeFilterVariant, ContextTreeLevel, ContextTreeLevelItem, ProtectedWebsite, ResponsiveStyles, Scope, Style, StylesheetCategory, StylesheetItem, WebAccordionItem, WebBlock, WebBlockByLayout, WebBlockItem, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebIiifViewer, WebImage, WebLoadingVariant, WebOptions, WebRelationVariant, WebSectionDisplay, WebSectionVariant, WebSidebar, WebTitle, Webpage, Website, WebsiteMetadata, WebsitePrivacy, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType } from "./types/website.mjs";
2
+ import { AccordionWebBlock, ContextTree, ContextTreeFilterLevel, ContextTreeFilterVariant, ContextTreeLevel, ContextTreeLevelItem, ProtectedWebsite, ResponsiveStyles, Scope, Style, StylesheetCategory, StylesheetItem, WebAccordionItem, WebBlock, WebBlockByLayout, WebBlockItem, WebBlockLayout, WebCollectionVariant, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebIiifViewer, WebImage, WebLoadingVariant, WebOptions, WebRelationVariant, WebSectionDisplay, WebSectionVariant, WebSidebar, WebTitle, Webpage, Website, WebsiteMetadata, WebsitePrivacy, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType } from "./types/website.mjs";
3
3
  import { AnyBibliography, AnyConcept, AnyItem, AnyPeriod, AnyPerson, AnyPropertyValue, AnyPropertyVariable, AnyResource, AnySet, AnySpatialUnit, AnyText, AnyTree, BaseItem, BaseItemLink, BelongsTo, Bibliography, BibliographyEntryInfo, BibliographyItemLink, BibliographySourceDocument, Concept, ConceptItemLink, ContainedItemCategory, ContainedItemCategoryFromOption, ContainedItemCategoryOption, Context, ContextItem, ContextItemCategory, ContextNode, Coordinates, CoordinatesSource, DictionaryUnitItemLink, DownloadOption, EmbeddedBibliography, EmbeddedConcept, EmbeddedItem, EmbeddedPeriod, EmbeddedPerson, EmbeddedPropertyValue, EmbeddedPropertyVariable, EmbeddedResource, EmbeddedSet, EmbeddedSpatialUnit, EmbeddedText, EmbeddedTree, Event, Gallery, Heading, HeadingItemCategory, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, ItemCategory, ItemCategoryFromOption, ItemCategoryOption, ItemCategoryWithEmbeddedItems, ItemContainerCategory, ItemLink, ItemLinkCategory, ItemLinks, ItemLocation, ItemPayloadKind, ItemProperty, ItemWithoutEmbeddedItems, LanguageCodes, License, MapLayer, Metadata, Note, Observation, OcrString, Period, PeriodItemLink, Person, PersonItemLink, Property, PropertyLike, PropertyRelation, PropertyValue, PropertyValueContent, PropertyValueDataType, PropertyValueItemLink, PropertyValueQueryItem, PropertyVariable, PropertyVariableItemLink, Query, QueryGroup, QueryLeaf, QueryablePropertyValueDataType, RecursiveItemCategory, Resource, ResourceItemLink, Section, Set, SetAttributeValueQueryItem, SetBibliography, SetConcept, SetItem, SetItemCategory, SetItemLink, SetItemProperty, SetItemSimplifiedProperty, SetItemsSort, SetItemsSortDirection, SetPeriod, SetResource, SetSpatialUnit, SetStyle, SetStyleProperty, SetTree, SimplifiedProperty, SpatialUnit, SpatialUnitItemLink, Text, TextItemLink, TopLevelItem, Tree, TreeItemCategory, TreeItemLink } from "./types/index.mjs";
4
4
  import { DEFAULT_PAGE_SIZE } from "./constants.mjs";
5
5
  import { fetchGallery } from "./fetchers/gallery.mjs";
@@ -18,4 +18,4 @@ import { PropertyOptions, PropertySelector, getLeafPropertyValues, getProperty,
18
18
  import { flattenItemProperties } from "./helpers.mjs";
19
19
  import { OCHRE_LANGUAGES, OchreLanguage, OchreLanguageCode, OchreLanguageKind, OchreLanguageStandard, getOchreLanguage, getOchreLanguageCode, isOchreLanguageCode } from "./languages.mjs";
20
20
  import { defineLanguages } from "./parsers/languages.mjs";
21
- export { type AccordionWebBlock, type AnyBibliography, type AnyConcept, type AnyItem, type AnyPeriod, type AnyPerson, type AnyPropertyValue, type AnyPropertyVariable, type AnyResource, type AnySet, type AnySpatialUnit, type AnyText, type AnyTree, type BaseItem, type BaseItemLink, type BelongsTo, type Bibliography, type BibliographyEntryInfo, type BibliographyItemLink, type BibliographySourceDocument, type Concept, type ConceptItemLink, type ContainedItemCategory, type ContainedItemCategoryFromOption, type ContainedItemCategoryOption, type Context, type ContextItem, type ContextItemCategory, type ContextNode, type ContextTree, type ContextTreeFilterLevel, type ContextTreeFilterVariant, type ContextTreeLevel, type ContextTreeLevelItem, type Coordinates, type CoordinatesSource, DEFAULT_PAGE_SIZE, type DictionaryUnitItemLink, type DownloadOption, type EmbeddedBibliography, type EmbeddedConcept, type EmbeddedItem, type EmbeddedPeriod, type EmbeddedPerson, type EmbeddedPropertyValue, type EmbeddedPropertyVariable, type EmbeddedResource, type EmbeddedSet, type EmbeddedSpatialUnit, type EmbeddedText, type EmbeddedTree, type Event, type Gallery, type Heading, type HeadingItemCategory, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type Item, type ItemCategory, type ItemCategoryFromOption, type ItemCategoryOption, type ItemCategoryWithEmbeddedItems, type ItemContainerCategory, type ItemLink, type ItemLinkCategory, type ItemLinks, type ItemLocation, type ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type MapLayer, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, OCHRE_LANGUAGES, type Observation, type OchreLanguage, type OchreLanguageCode, type OchreLanguageKind, type OchreLanguageStandard, type OcrString, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Property, type PropertyLike, type PropertyOptions, type PropertyRelation, type PropertySelector, type PropertyValue, type PropertyValueContent, type PropertyValueDataType, type PropertyValueItemLink, type PropertyValueQueryItem, type PropertyVariable, type PropertyVariableItemLink, type ProtectedWebsite, type Query, type QueryGroup, type QueryLeaf, type QueryablePropertyValueDataType, type RecursiveItemCategory, type Resource, type ResourceItemLink, type ResponsiveStyles, type Scope, type Section, type Set, type SetAttributeValueQueryItem, type SetBibliography, type SetConcept, type SetItem, type SetItemCategory, type SetItemLink, type SetItemProperty, type SetItemSimplifiedProperty, type SetItemsSort, type SetItemsSortDirection, type SetPeriod, type SetResource, type SetSpatialUnit, type SetStyle, type SetStyleProperty, type SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebAccordionItem, type WebBlock, type WebBlockByLayout, type WebBlockItem, type WebBlockLayout, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebIiifViewer, type WebImage, type WebLoadingVariant, type WebOptions, type WebRelationVariant, type WebSectionDisplay, type WebSectionVariant, type WebSidebar, type WebTitle, type Webpage, type Website, type WebsiteMetadata, type WebsitePrivacy, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemLocations, fetchItemOcrData, fetchMapLayers, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getOchreLanguage, getOchreLanguageCode, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isOchreLanguageCode, isPropertyMatchingFilter, normalizePropertyVariableLabel };
21
+ export { type AccordionWebBlock, type AnyBibliography, type AnyConcept, type AnyItem, type AnyPeriod, type AnyPerson, type AnyPropertyValue, type AnyPropertyVariable, type AnyResource, type AnySet, type AnySpatialUnit, type AnyText, type AnyTree, type BaseItem, type BaseItemLink, type BelongsTo, type Bibliography, type BibliographyEntryInfo, type BibliographyItemLink, type BibliographySourceDocument, type Concept, type ConceptItemLink, type ContainedItemCategory, type ContainedItemCategoryFromOption, type ContainedItemCategoryOption, type Context, type ContextItem, type ContextItemCategory, type ContextNode, type ContextTree, type ContextTreeFilterLevel, type ContextTreeFilterVariant, type ContextTreeLevel, type ContextTreeLevelItem, type Coordinates, type CoordinatesSource, DEFAULT_PAGE_SIZE, type DictionaryUnitItemLink, type DownloadOption, type EmbeddedBibliography, type EmbeddedConcept, type EmbeddedItem, type EmbeddedPeriod, type EmbeddedPerson, type EmbeddedPropertyValue, type EmbeddedPropertyVariable, type EmbeddedResource, type EmbeddedSet, type EmbeddedSpatialUnit, type EmbeddedText, type EmbeddedTree, type Event, type Gallery, type Heading, type HeadingItemCategory, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type Item, type ItemCategory, type ItemCategoryFromOption, type ItemCategoryOption, type ItemCategoryWithEmbeddedItems, type ItemContainerCategory, type ItemLink, type ItemLinkCategory, type ItemLinks, type ItemLocation, type ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type MapLayer, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, OCHRE_LANGUAGES, type Observation, type OchreLanguage, type OchreLanguageCode, type OchreLanguageKind, type OchreLanguageStandard, type OcrString, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Property, type PropertyLike, type PropertyOptions, type PropertyRelation, type PropertySelector, type PropertyValue, type PropertyValueContent, type PropertyValueDataType, type PropertyValueItemLink, type PropertyValueQueryItem, type PropertyVariable, type PropertyVariableItemLink, type ProtectedWebsite, type Query, type QueryGroup, type QueryLeaf, type QueryablePropertyValueDataType, type RecursiveItemCategory, type Resource, type ResourceItemLink, type ResponsiveStyles, type Scope, type Section, type Set, type SetAttributeValueQueryItem, type SetBibliography, type SetConcept, type SetItem, type SetItemCategory, type SetItemLink, type SetItemProperty, type SetItemSimplifiedProperty, type SetItemsSort, type SetItemsSortDirection, type SetPeriod, type SetResource, type SetSpatialUnit, type SetStyle, type SetStyleProperty, type SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebAccordionItem, type WebBlock, type WebBlockByLayout, type WebBlockItem, type WebBlockLayout, type WebCollectionVariant, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebIiifViewer, type WebImage, type WebLoadingVariant, type WebOptions, type WebRelationVariant, type WebSectionDisplay, type WebSectionVariant, type WebSidebar, type WebTitle, type Webpage, type Website, type WebsiteMetadata, type WebsitePrivacy, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemLocations, fetchItemOcrData, fetchMapLayers, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getOchreLanguage, getOchreLanguageCode, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isOchreLanguageCode, isPropertyMatchingFilter, normalizePropertyVariableLabel };
@@ -322,7 +322,8 @@ function parseDownloadOptions(rawDownloadOptions) {
322
322
  return Array.from(rawDownloadOptions?.option ?? [], (option) => ({
323
323
  type: option.type,
324
324
  href: transformPermanentIdentificationUrl(option.href),
325
- fileFormat: option.fileFormat
325
+ fileFormat: option.fileFormat,
326
+ fileSize: option.fileSize ?? null
326
327
  }));
327
328
  }
328
329
  function parseHref(href) {
@@ -1,5 +1,5 @@
1
1
  import { normalizeItemCategory } from "../../categories.mjs";
2
- import { componentSchema } from "../../schemas.mjs";
2
+ import { collectionVariantSchema, componentSchema } from "../../schemas.mjs";
3
3
  import { parseXMLContent, transformPermanentIdentificationUrlToItemLink } from "../string.mjs";
4
4
  import { parseStringContent } from "../helpers.mjs";
5
5
  import { parseBibliographyList, parseIdentification, parseLinks, parseSimplifiedProperties } from "../index.mjs";
@@ -17,7 +17,7 @@ import * as v from "valibot";
17
17
  * "collection" component and the "query" component's collection overrides.
18
18
  */
19
19
  const COLLECTION_PROPERTY_DEFAULTS = {
20
- variant: "slide",
20
+ variants: ["slide"],
21
21
  paginationVariant: "default",
22
22
  loadingVariant: "skeleton",
23
23
  minimumColumnCount: null,
@@ -39,6 +39,15 @@ const COLLECTION_IMAGE_DEFAULTS = {
39
39
  isPlaceholderDisplayed: true
40
40
  };
41
41
  /**
42
+ * Reads every "variant" value a collection accepts, in OCHRE order and without
43
+ * duplicates, skipping values the SDK does not know, so the first entry is the
44
+ * variant the collection opens with. Returns `null` when none are set.
45
+ */
46
+ function parseCollectionVariants(reader) {
47
+ const [defaultVariant, ...otherVariants] = [...new Set(reader.stringValues("variant").filter((value) => v.is(collectionVariantSchema, value)))];
48
+ return defaultVariant == null ? null : [defaultVariant, ...otherVariants];
49
+ }
50
+ /**
42
51
  * Reads the collection display properties explicitly set on a reader, omitting
43
52
  * any that are unset. The "collection" component merges these over
44
53
  * {@link COLLECTION_PROPERTY_DEFAULTS} and {@link COLLECTION_IMAGE_DEFAULTS},
@@ -56,7 +65,8 @@ function parseCollectionPropertyOverrides(reader) {
56
65
  const value = reader.value(label);
57
66
  if (value != null) imageOverrides[key] = value;
58
67
  }
59
- read("variant", "variant");
68
+ const variants = parseCollectionVariants(reader);
69
+ if (variants != null) overrides.variants = variants;
60
70
  read("paginationVariant", "pagination-variant");
61
71
  read("loadingVariant", "loading-variant");
62
72
  read("minimumColumnCount", "minimum-column-count");
@@ -25,6 +25,11 @@ export declare const ochreLanguageCodeSchema: v.SchemaWithPipe<readonly [v.Strin
25
25
  * @internal
26
26
  */
27
27
  export declare const componentSchema: v.PicklistSchema<readonly ["3d-viewer", "advanced-search", "annotated-document", "annotated-image", "audio-player", "bibliography", "button", "collection", "empty-space", "entries", "iframe", "iiif-viewer", "image", "image-gallery", "map", "query", "search-bar", "table", "text", "timeline", "video"], "Invalid/unknown web element component">;
28
+ /**
29
+ * Valid variants for the "collection" component
30
+ * @internal
31
+ */
32
+ export declare const collectionVariantSchema: v.PicklistSchema<readonly ["slide", "table", "card", "tile", "showcase"], undefined>;
28
33
  /**
29
34
  * Schema for validating gallery parameters
30
35
  * @internal
package/dist/schemas.mjs CHANGED
@@ -61,6 +61,17 @@ const componentSchema = v.picklist([
61
61
  "video"
62
62
  ], "Invalid/unknown web element component");
63
63
  /**
64
+ * Valid variants for the "collection" component
65
+ * @internal
66
+ */
67
+ const collectionVariantSchema = v.picklist([
68
+ "slide",
69
+ "table",
70
+ "card",
71
+ "tile",
72
+ "showcase"
73
+ ]);
74
+ /**
64
75
  * Schema for validating gallery parameters
65
76
  * @internal
66
77
  */
@@ -290,4 +301,4 @@ const treeItemsParametersSchema = v.object({
290
301
  treeScopeUuids: v.pipe(v.array(uuidSchema), v.minLength(1, "At least one tree scope UUID is required")),
291
302
  ...containerItemsParametersEntries
292
303
  });
293
- export { componentSchema, gallerySchema, isPseudoUuid, itemLocationsParametersSchema, itemOcrDataParametersSchema, ochreLanguageCodeSchema, renderOptionsSchema, setItemsParametersSchema, setPropertyValuesParametersSchema, treeItemsParametersSchema, uuidSchema };
304
+ export { collectionVariantSchema, componentSchema, gallerySchema, isPseudoUuid, itemLocationsParametersSchema, itemOcrDataParametersSchema, ochreLanguageCodeSchema, renderOptionsSchema, setItemsParametersSchema, setPropertyValuesParametersSchema, treeItemsParametersSchema, uuidSchema };
@@ -232,6 +232,7 @@ export type DownloadOption = {
232
232
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
233
233
  href: string;
234
234
  fileFormat: string;
235
+ fileSize: number | null;
235
236
  };
236
237
  /**
237
238
  * Area of an image map in OCHRE
@@ -78,6 +78,10 @@ export type WebSectionDisplay = {
78
78
  isDisplayed: boolean;
79
79
  isHeaderDisplayed: boolean;
80
80
  };
81
+ /**
82
+ * How a collection displays its items
83
+ */
84
+ export type WebCollectionVariant = "slide" | "table" | "card" | "tile" | "showcase";
81
85
  /**
82
86
  * How a website indicates that content is loading
83
87
  */
@@ -362,7 +366,8 @@ export type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
362
366
  label: MultilingualString<T> | null;
363
367
  variant: WebRelationVariant | null;
364
368
  }>;
365
- variant: "slide" | "table" | "card" | "tile" | "showcase";
369
+ /** The accepted variants in OCHRE order; the first is the default */
370
+ variants: [WebCollectionVariant, ...Array<WebCollectionVariant>];
366
371
  paginationVariant: "default" | "numeric";
367
372
  loadingVariant: WebLoadingVariant;
368
373
  image: {
@@ -452,7 +452,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
452
452
  readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
453
453
  readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
454
454
  readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
455
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
455
+ readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
456
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
457
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
458
+ properties: v.OptionalSchema<v.ObjectSchema<{
459
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
460
+ }, undefined>, undefined>;
461
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
462
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
463
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
464
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
465
+ }, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
466
+ }, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
456
467
  }, "XMLDownloadOptions: Shape error">, undefined>;
457
468
  readonly document: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.ObjectSchema<{
458
469
  readonly content: v.ArraySchema<v.ObjectSchema<{
@@ -1656,7 +1667,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
1656
1667
  readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
1657
1668
  readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
1658
1669
  readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
1659
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
1670
+ readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
1671
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
1672
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
1673
+ properties: v.OptionalSchema<v.ObjectSchema<{
1674
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
1675
+ }, undefined>, undefined>;
1676
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
1677
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
1678
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
1679
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
1680
+ }, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
1681
+ }, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
1660
1682
  }, "XMLDownloadOptions: Shape error">, undefined>;
1661
1683
  readonly publicationInfo: v.OptionalSchema<v.ObjectSchema<{
1662
1684
  readonly publishers: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
@@ -3000,7 +3022,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
3000
3022
  readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
3001
3023
  readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
3002
3024
  readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
3003
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
3025
+ readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
3026
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
3027
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
3028
+ properties: v.OptionalSchema<v.ObjectSchema<{
3029
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
3030
+ }, undefined>, undefined>;
3031
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
3032
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
3033
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
3034
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
3035
+ }, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
3036
+ }, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
3004
3037
  }, "XMLDownloadOptions: Shape error">, undefined>;
3005
3038
  readonly publicationInfo: v.OptionalSchema<v.ObjectSchema<{
3006
3039
  readonly publishers: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
@@ -231,8 +231,9 @@ const XMLDownloadOptions = v.object({ option: v.array(v.object({
231
231
  "alto"
232
232
  ], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto"),
233
233
  href: v.pipe(v.string("XMLDownloadOptions: href is string and required"), v.url("XMLDownloadOptions: href is not a valid URL")),
234
- fileFormat: v.string("XMLDownloadOptions: fileFormat is string and required")
235
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat")) }, "XMLDownloadOptions: Shape error");
234
+ fileFormat: v.string("XMLDownloadOptions: fileFormat is string and required"),
235
+ fileSize: XMLOptionalNumber
236
+ }, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize")) }, "XMLDownloadOptions: Shape error");
236
237
  const XMLImageMapArea = v.object({
237
238
  uuid: v.pipe(v.string("XMLImageMapArea: uuid is string and required"), v.check(isPseudoUuid, "XMLImageMapArea: uuid is not a valid pseudo-UUID")),
238
239
  publicationDateTime: v.optional(customDateTime("XMLImageMapArea: publicationDateTime is not a valid datetime")),
@@ -171,6 +171,7 @@ export type XMLDownloadOptions = {
171
171
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
172
172
  href: string;
173
173
  fileFormat: string;
174
+ fileSize?: number;
174
175
  }>;
175
176
  };
176
177
  export type XMLImageMapArea = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.3.20",
3
+ "version": "1.3.22",
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",