ochre-sdk 1.3.21 → 1.3.23

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,6 +1,6 @@
1
1
  import { MultilingualOptions, MultilingualString, MultilingualStringEntries, MultilingualStringEntry, MultilingualStringInput, MultilingualStringJSON, MultilingualStringObject, MultilingualStringText } from "./parsers/multilingual.mjs";
2
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
- 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";
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, PartialDate, PartialDateBound, PartialDateQualifier, PartialDateSeason, PartialDateValue, 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";
6
6
  import { fetchItemChildren } from "./fetchers/item-children.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 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 };
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 PartialDate, type PartialDateBound, type PartialDateQualifier, type PartialDateSeason, type PartialDateValue, 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 };
@@ -6,6 +6,7 @@ import { readPropertyValueText } from "./property-token.mjs";
6
6
  import { parseXMLString, transformPermanentIdentificationUrl } from "./string.mjs";
7
7
  import { getParserOptions, multilingualFromText, parseContentLike, parseContentLikeText, parseLicense, parseRequiredContentLike, parseStringLike } from "./helpers.mjs";
8
8
  import { parseMetadataLanguages, resolveDefaultLanguage, resolveLanguages } from "./languages.mjs";
9
+ import { parsePartialDate } from "./partial-date.mjs";
9
10
  import * as v from "valibot";
10
11
  // src/parsers/index.ts
11
12
  function isXMLContextGroup(context) {
@@ -188,6 +189,7 @@ function parseEvent(rawEvent, options) {
188
189
  start: startDate,
189
190
  end: endDate
190
191
  },
192
+ partialDate: parsePartialDate(rawEvent.partialDates),
191
193
  label: parseRequiredContentLike(rawEvent.label, options),
192
194
  comment: parseContentLike(rawEvent.comment, options),
193
195
  agent: parseEventReference(rawEvent.agent, options),
@@ -195,8 +197,10 @@ function parseEvent(rawEvent, options) {
195
197
  other: rawEvent.other == null ? null : {
196
198
  uuid: rawEvent.other.uuid ?? null,
197
199
  category: normalizeItemCategory(rawEvent.other.category),
198
- label: parseRequiredContentLike(rawEvent.other, options)
199
- }
200
+ label: parseRequiredContentLike(rawEvent.other, options),
201
+ publicationDateTime: rawEvent.other.publicationDateTime ?? null
202
+ },
203
+ period: parseEventReference(rawEvent.period, options)
200
204
  };
201
205
  }
202
206
  function parseBaseItem(category, rawItem, options) {
@@ -322,7 +326,8 @@ function parseDownloadOptions(rawDownloadOptions) {
322
326
  return Array.from(rawDownloadOptions?.option ?? [], (option) => ({
323
327
  type: option.type,
324
328
  href: transformPermanentIdentificationUrl(option.href),
325
- fileFormat: option.fileFormat
329
+ fileFormat: option.fileFormat,
330
+ fileSize: option.fileSize ?? null
326
331
  }));
327
332
  }
328
333
  function parseHref(href) {
@@ -0,0 +1,16 @@
1
+ import { PartialDate } from "../types/index.mjs";
2
+ import { XMLPartialDates } from "../xml/types.mjs";
3
+ /**
4
+ * Parse the partial dates of an event
5
+ *
6
+ * Reads the year, month and day fields rather than the EDTF text OCHRE
7
+ * writes alongside them, which leaves out every field that is not a plain
8
+ * four-digit year. An end identical to the start is a single date. The EDTF
9
+ * string is only set for what EDTF can express: no qualifier on a year with
10
+ * unspecified digits or on a season, no season in a range, and no range
11
+ * whose end begins before its start.
12
+ * @param rawPartialDates - The raw partialDates element
13
+ * @returns The parsed partial dates, or null when every field is empty
14
+ * @internal
15
+ */
16
+ export declare function parsePartialDate(rawPartialDates: XMLPartialDates | undefined): PartialDate | null;
@@ -0,0 +1,229 @@
1
+ // src/parsers/partial-date.ts
2
+ const YEAR_REGEX = /^([?~%])?(\d[\dX]{3})([?~%])?$/i;
3
+ const MONTH_NAMES = [
4
+ "january",
5
+ "february",
6
+ "march",
7
+ "april",
8
+ "may",
9
+ "june",
10
+ "july",
11
+ "august",
12
+ "september",
13
+ "october",
14
+ "november",
15
+ "december"
16
+ ];
17
+ const SEASONS = {
18
+ spring: "spring",
19
+ summer: "summer",
20
+ autumn: "autumn",
21
+ fall: "autumn",
22
+ winter: "winter"
23
+ };
24
+ const SEASON_CODES = {
25
+ spring: 21,
26
+ summer: 22,
27
+ autumn: 23,
28
+ winter: 24
29
+ };
30
+ const QUALIFIER_SYMBOLS = {
31
+ uncertain: "?",
32
+ approximate: "~",
33
+ uncertainAndApproximate: "%"
34
+ };
35
+ function parseQualifier(symbols) {
36
+ const isUncertain = symbols.some((symbol) => symbol === "?" || symbol === "%");
37
+ const isApproximate = symbols.some((symbol) => symbol === "~" || symbol === "%");
38
+ if (isUncertain && isApproximate) return "uncertainAndApproximate";
39
+ if (isUncertain) return "uncertain";
40
+ if (isApproximate) return "approximate";
41
+ return null;
42
+ }
43
+ function parseYear(value) {
44
+ const match = YEAR_REGEX.exec(value);
45
+ if (match == null) return null;
46
+ const [, prefix, year, suffix] = match;
47
+ const symbols = [];
48
+ for (const symbol of [prefix, suffix]) if (symbol != null) symbols.push(symbol);
49
+ return {
50
+ year: year.toUpperCase(),
51
+ qualifier: parseQualifier(symbols)
52
+ };
53
+ }
54
+ function parseMonthOrSeason(value) {
55
+ if (/^\d{1,2}$/.test(value)) {
56
+ const month = Number(value);
57
+ return month >= 1 && month <= 12 ? {
58
+ month,
59
+ season: null
60
+ } : null;
61
+ }
62
+ const name = value.toLowerCase();
63
+ const season = SEASONS[name];
64
+ if (season != null) return {
65
+ month: null,
66
+ season
67
+ };
68
+ const index = MONTH_NAMES.findIndex((monthName) => monthName === name || monthName.slice(0, 3) === name);
69
+ return index === -1 ? null : {
70
+ month: index + 1,
71
+ season: null
72
+ };
73
+ }
74
+ function getDaysInMonth(year, month) {
75
+ if (month === 2) {
76
+ if (year.includes("X")) return 29;
77
+ const yearNumber = Number(year);
78
+ return yearNumber % 4 === 0 && (yearNumber % 100 !== 0 || yearNumber % 400 === 0) ? 29 : 28;
79
+ }
80
+ return [
81
+ 4,
82
+ 6,
83
+ 9,
84
+ 11
85
+ ].includes(month) ? 30 : 31;
86
+ }
87
+ function parseDay(value, year, month) {
88
+ if (!/^\d{1,2}$/.test(value)) return null;
89
+ const day = Number(value);
90
+ return day >= 1 && day <= getDaysInMonth(year, month) ? day : null;
91
+ }
92
+ function parseOneOf(year) {
93
+ const values = [];
94
+ for (const part of year.split("/")) {
95
+ const parsedYear = parseYear(part.trim());
96
+ if (parsedYear == null) return null;
97
+ values.push({
98
+ ...parsedYear,
99
+ month: null,
100
+ season: null,
101
+ day: null
102
+ });
103
+ }
104
+ return values;
105
+ }
106
+ function parseDate(year, month, day) {
107
+ const parsedYear = parseYear(year);
108
+ const parsedMonth = month === "" ? {
109
+ month: null,
110
+ season: null
111
+ } : parseMonthOrSeason(month);
112
+ if (parsedYear == null || parsedMonth == null) return null;
113
+ if (day === "") return {
114
+ ...parsedYear,
115
+ ...parsedMonth,
116
+ day: null
117
+ };
118
+ const parsedDay = parsedMonth.month == null ? null : parseDay(day, parsedYear.year, parsedMonth.month);
119
+ return parsedDay == null ? null : {
120
+ ...parsedYear,
121
+ ...parsedMonth,
122
+ day: parsedDay
123
+ };
124
+ }
125
+ function parseBound(rawYear, rawMonth, rawDay) {
126
+ const year = rawYear?.trim() ?? "";
127
+ const month = rawMonth?.trim() ?? "";
128
+ const day = rawDay?.trim() ?? "";
129
+ if (year === "" && month === "" && day === "") return null;
130
+ if (year.includes("/")) {
131
+ const values = month === "" && day === "" ? parseOneOf(year) : null;
132
+ if (values != null) return {
133
+ kind: "oneOf",
134
+ values
135
+ };
136
+ } else {
137
+ const value = parseDate(year, month, day);
138
+ if (value != null) return {
139
+ kind: "date",
140
+ value
141
+ };
142
+ }
143
+ return {
144
+ kind: "unparsed",
145
+ year: year === "" ? null : year,
146
+ month: month === "" ? null : month,
147
+ day: day === "" ? null : day
148
+ };
149
+ }
150
+ function isBefore(start, end) {
151
+ const startParts = [
152
+ Number(start.year.replaceAll("X", "0")),
153
+ start.month ?? 1,
154
+ start.day ?? 1
155
+ ];
156
+ const endParts = [
157
+ Number(end.year.replaceAll("X", "0")),
158
+ end.month ?? 1,
159
+ end.day ?? 1
160
+ ];
161
+ for (const [index, startPart] of startParts.entries()) {
162
+ const endPart = endParts[index];
163
+ if (startPart !== endPart) return startPart < endPart;
164
+ }
165
+ return false;
166
+ }
167
+ function formatEdtfValue(value) {
168
+ if (value.qualifier != null && (value.year.includes("X") || value.season != null)) return null;
169
+ let edtf = value.year;
170
+ if (value.qualifier != null) edtf += QUALIFIER_SYMBOLS[value.qualifier];
171
+ if (value.month != null) edtf += `-${value.month.toString().padStart(2, "0")}`;
172
+ if (value.season != null) edtf += `-${SEASON_CODES[value.season]}`;
173
+ if (value.day != null) edtf += `-${value.day.toString().padStart(2, "0")}`;
174
+ return edtf;
175
+ }
176
+ function formatEdtfRangeValue(value) {
177
+ return value.season == null ? formatEdtfValue(value) : null;
178
+ }
179
+ function formatEdtfSet(values) {
180
+ const members = [];
181
+ for (const value of values) {
182
+ const member = value.qualifier == null ? formatEdtfValue(value) : null;
183
+ if (member == null) return null;
184
+ members.push(member);
185
+ }
186
+ return `[${members.join(",")}]`;
187
+ }
188
+ function formatEdtf(start, end) {
189
+ if (start == null) {
190
+ if (end?.kind !== "date") return null;
191
+ const endEdtf = formatEdtfRangeValue(end.value);
192
+ return endEdtf == null ? null : `../${endEdtf}`;
193
+ }
194
+ if (end == null) switch (start.kind) {
195
+ case "date": return formatEdtfValue(start.value);
196
+ case "oneOf": return formatEdtfSet(start.values);
197
+ case "unparsed": return null;
198
+ }
199
+ if (start.kind !== "date" || end.kind !== "date" || !isBefore(start.value, end.value)) return null;
200
+ const startEdtf = formatEdtfRangeValue(start.value);
201
+ const endEdtf = formatEdtfRangeValue(end.value);
202
+ return startEdtf == null || endEdtf == null ? null : `${startEdtf}/${endEdtf}`;
203
+ }
204
+ /**
205
+ * Parse the partial dates of an event
206
+ *
207
+ * Reads the year, month and day fields rather than the EDTF text OCHRE
208
+ * writes alongside them, which leaves out every field that is not a plain
209
+ * four-digit year. An end identical to the start is a single date. The EDTF
210
+ * string is only set for what EDTF can express: no qualifier on a year with
211
+ * unspecified digits or on a season, no season in a range, and no range
212
+ * whose end begins before its start.
213
+ * @param rawPartialDates - The raw partialDates element
214
+ * @returns The parsed partial dates, or null when every field is empty
215
+ * @internal
216
+ */
217
+ function parsePartialDate(rawPartialDates) {
218
+ if (rawPartialDates == null) return null;
219
+ const { year, month, day, endYear, endMonth, endDay } = rawPartialDates;
220
+ const start = parseBound(year, month, day);
221
+ const end = (year?.trim() ?? "") === (endYear?.trim() ?? "") && (month?.trim() ?? "") === (endMonth?.trim() ?? "") && (day?.trim() ?? "") === (endDay?.trim() ?? "") ? null : parseBound(endYear, endMonth, endDay);
222
+ if (start == null && end == null) return null;
223
+ return {
224
+ start,
225
+ end,
226
+ edtf: formatEdtf(start, end)
227
+ };
228
+ }
229
+ export { parsePartialDate };
@@ -138,6 +138,57 @@ export type Context<U extends ContextItemCategory = ContextItemCategory> = {
138
138
  nodes: Array<ContextNode<U>>;
139
139
  displayPath: string;
140
140
  };
141
+ /**
142
+ * Qualifier of a partial date, the EDTF `?`, `~` and `%`
143
+ */
144
+ export type PartialDateQualifier = "uncertain" | "approximate" | "uncertainAndApproximate";
145
+ /**
146
+ * Season of a partial date, the EDTF months 21 to 24
147
+ */
148
+ export type PartialDateSeason = "spring" | "summer" | "autumn" | "winter";
149
+ /**
150
+ * Partial date in OCHRE
151
+ *
152
+ * `year` has four characters, each a digit or `X` for an unspecified digit,
153
+ * as in `1941` or `194X`. A date has a month or a season, never both, and a
154
+ * day only with a month.
155
+ */
156
+ export type PartialDateValue = {
157
+ year: string;
158
+ month: number | null;
159
+ season: PartialDateSeason | null;
160
+ day: number | null;
161
+ qualifier: PartialDateQualifier | null;
162
+ };
163
+ /**
164
+ * Start or end of a partial date range in OCHRE
165
+ *
166
+ * `oneOf` is a year field that lists alternative years, as in `1951/1952`.
167
+ * `unparsed` keeps the fields as entered when they are not a partial date.
168
+ */
169
+ export type PartialDateBound = {
170
+ kind: "date";
171
+ value: PartialDateValue;
172
+ } | {
173
+ kind: "oneOf";
174
+ values: Array<PartialDateValue>;
175
+ } | {
176
+ kind: "unparsed";
177
+ year: string | null;
178
+ month: string | null;
179
+ day: string | null;
180
+ };
181
+ /**
182
+ * Partial dates of an event in OCHRE
183
+ *
184
+ * `edtf` is the range as an Extended Date/Time Format string, or `null` when
185
+ * EDTF cannot express it
186
+ */
187
+ export type PartialDate = {
188
+ start: PartialDateBound | null;
189
+ end: PartialDateBound | null;
190
+ edtf: string | null;
191
+ };
141
192
  /**
142
193
  * Event in OCHRE
143
194
  */
@@ -146,6 +197,7 @@ export type Event<T extends LanguageCodes = LanguageCodes> = {
146
197
  start: Date;
147
198
  end: Date;
148
199
  } | null;
200
+ partialDate: PartialDate | null;
149
201
  label: MultilingualString<T>;
150
202
  comment: MultilingualString<T> | null;
151
203
  agent: {
@@ -160,8 +212,14 @@ export type Event<T extends LanguageCodes = LanguageCodes> = {
160
212
  } | null;
161
213
  other: {
162
214
  uuid: string | null;
163
- category: string | null;
215
+ category: ItemCategory | null;
164
216
  label: MultilingualString<T>;
217
+ publicationDateTime: Date | null;
218
+ } | null;
219
+ period: {
220
+ uuid: string;
221
+ label: MultilingualString<T>;
222
+ publicationDateTime: Date | null;
165
223
  } | null;
166
224
  };
167
225
  /**
@@ -232,6 +290,7 @@ export type DownloadOption = {
232
290
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
233
291
  href: string;
234
292
  fileFormat: string;
293
+ fileSize: number | null;
235
294
  };
236
295
  /**
237
296
  * Area of an image map in OCHRE
@@ -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<{
@@ -2134,6 +2156,15 @@ export declare const XMLGalleryData: v.ObjectSchema<{
2134
2156
  readonly event: v.ArraySchema<v.ObjectSchema<{
2135
2157
  readonly dateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2136
2158
  readonly endDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2159
+ readonly partialDates: v.OptionalSchema<v.ObjectSchema<{
2160
+ readonly year: v.OptionalSchema<v.StringSchema<"XMLPartialDates: year is string and optional">, undefined>;
2161
+ readonly month: v.OptionalSchema<v.StringSchema<"XMLPartialDates: month is string and optional">, undefined>;
2162
+ readonly day: v.OptionalSchema<v.StringSchema<"XMLPartialDates: day is string and optional">, undefined>;
2163
+ readonly endYear: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endYear is string and optional">, undefined>;
2164
+ readonly endMonth: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endMonth is string and optional">, undefined>;
2165
+ readonly endDay: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endDay is string and optional">, undefined>;
2166
+ readonly payload: v.OptionalSchema<v.StringSchema<"XMLPartialDates: payload is string and optional">, undefined>;
2167
+ }, "XMLPartialDates: Shape error">, undefined>;
2137
2168
  readonly agent: v.OptionalSchema<v.ObjectSchema<{
2138
2169
  readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
2139
2170
  readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
@@ -2275,6 +2306,7 @@ export declare const XMLGalleryData: v.ObjectSchema<{
2275
2306
  readonly other: v.OptionalSchema<v.ObjectSchema<{
2276
2307
  readonly uuid: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and optional">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>, undefined>;
2277
2308
  readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["tree", "bibliography", "spatialUnit", "concept", "period", "person", "propertyVariable", "variable", "propertyValue", "value", "resource", "text", "set"], undefined>, undefined>;
2309
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2278
2310
  readonly content: v.ArraySchema<v.ObjectSchema<{
2279
2311
  readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
2280
2312
  readonly properties: v.OptionalSchema<v.ObjectSchema<{
@@ -2296,6 +2328,31 @@ export declare const XMLGalleryData: v.ObjectSchema<{
2296
2328
  readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
2297
2329
  }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
2298
2330
  }, "XMLEvent: other is object">, undefined>;
2331
+ readonly period: v.OptionalSchema<v.ObjectSchema<{
2332
+ readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
2333
+ readonly rawValue: v.OptionalSchema<v.StringSchema<"XMLEvent: rawValue is string and optional">, undefined>;
2334
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2335
+ readonly content: v.ArraySchema<v.ObjectSchema<{
2336
+ readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
2337
+ readonly properties: v.OptionalSchema<v.ObjectSchema<{
2338
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
2339
+ }, undefined>, undefined>;
2340
+ readonly annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
2341
+ readonly string: v.ArraySchema<v.ObjectSchema<{
2342
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
2343
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
2344
+ properties: v.OptionalSchema<v.ObjectSchema<{
2345
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
2346
+ }, undefined>, undefined>;
2347
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
2348
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
2349
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
2350
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
2351
+ }, "XMLString: Shape error">, undefined>;
2352
+ readonly title: v.OptionalSchema<v.StringSchema<"XMLContent: title is string and optional">, undefined>;
2353
+ readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
2354
+ }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
2355
+ }, "XMLEvent: period is object with uuid">, undefined>;
2299
2356
  }, "XMLEvent: Shape error">, undefined>;
2300
2357
  }, "XMLBaseItem: events is object with event array of XMLEvent">, undefined>, undefined>;
2301
2358
  }, "XMLBibliography: Shape error">, undefined>;
@@ -2627,6 +2684,15 @@ export declare const XMLGalleryData: v.ObjectSchema<{
2627
2684
  readonly event: v.ArraySchema<v.ObjectSchema<{
2628
2685
  readonly dateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2629
2686
  readonly endDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2687
+ readonly partialDates: v.OptionalSchema<v.ObjectSchema<{
2688
+ readonly year: v.OptionalSchema<v.StringSchema<"XMLPartialDates: year is string and optional">, undefined>;
2689
+ readonly month: v.OptionalSchema<v.StringSchema<"XMLPartialDates: month is string and optional">, undefined>;
2690
+ readonly day: v.OptionalSchema<v.StringSchema<"XMLPartialDates: day is string and optional">, undefined>;
2691
+ readonly endYear: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endYear is string and optional">, undefined>;
2692
+ readonly endMonth: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endMonth is string and optional">, undefined>;
2693
+ readonly endDay: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endDay is string and optional">, undefined>;
2694
+ readonly payload: v.OptionalSchema<v.StringSchema<"XMLPartialDates: payload is string and optional">, undefined>;
2695
+ }, "XMLPartialDates: Shape error">, undefined>;
2630
2696
  readonly agent: v.OptionalSchema<v.ObjectSchema<{
2631
2697
  readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
2632
2698
  readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
@@ -2768,6 +2834,7 @@ export declare const XMLGalleryData: v.ObjectSchema<{
2768
2834
  readonly other: v.OptionalSchema<v.ObjectSchema<{
2769
2835
  readonly uuid: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and optional">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>, undefined>;
2770
2836
  readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["tree", "bibliography", "spatialUnit", "concept", "period", "person", "propertyVariable", "variable", "propertyValue", "value", "resource", "text", "set"], undefined>, undefined>;
2837
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2771
2838
  readonly content: v.ArraySchema<v.ObjectSchema<{
2772
2839
  readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
2773
2840
  readonly properties: v.OptionalSchema<v.ObjectSchema<{
@@ -2789,6 +2856,31 @@ export declare const XMLGalleryData: v.ObjectSchema<{
2789
2856
  readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
2790
2857
  }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
2791
2858
  }, "XMLEvent: other is object">, undefined>;
2859
+ readonly period: v.OptionalSchema<v.ObjectSchema<{
2860
+ readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
2861
+ readonly rawValue: v.OptionalSchema<v.StringSchema<"XMLEvent: rawValue is string and optional">, undefined>;
2862
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
2863
+ readonly content: v.ArraySchema<v.ObjectSchema<{
2864
+ readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
2865
+ readonly properties: v.OptionalSchema<v.ObjectSchema<{
2866
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
2867
+ }, undefined>, undefined>;
2868
+ readonly annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
2869
+ readonly string: v.ArraySchema<v.ObjectSchema<{
2870
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
2871
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
2872
+ properties: v.OptionalSchema<v.ObjectSchema<{
2873
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
2874
+ }, undefined>, undefined>;
2875
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
2876
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
2877
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
2878
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
2879
+ }, "XMLString: Shape error">, undefined>;
2880
+ readonly title: v.OptionalSchema<v.StringSchema<"XMLContent: title is string and optional">, undefined>;
2881
+ readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
2882
+ }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
2883
+ }, "XMLEvent: period is object with uuid">, undefined>;
2792
2884
  }, "XMLEvent: Shape error">, undefined>;
2793
2885
  }, "XMLBaseItem: events is object with event array of XMLEvent">, undefined>;
2794
2886
  }, "XMLPeriod: Shape error">, undefined>;
@@ -3000,7 +3092,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
3000
3092
  readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
3001
3093
  readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
3002
3094
  readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
3003
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
3095
+ readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
3096
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
3097
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
3098
+ properties: v.OptionalSchema<v.ObjectSchema<{
3099
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
3100
+ }, undefined>, undefined>;
3101
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
3102
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
3103
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
3104
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
3105
+ }, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
3106
+ }, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
3004
3107
  }, "XMLDownloadOptions: Shape error">, undefined>;
3005
3108
  readonly publicationInfo: v.OptionalSchema<v.ObjectSchema<{
3006
3109
  readonly publishers: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
@@ -3478,6 +3581,15 @@ export declare const XMLGalleryData: v.ObjectSchema<{
3478
3581
  readonly event: v.ArraySchema<v.ObjectSchema<{
3479
3582
  readonly dateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
3480
3583
  readonly endDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
3584
+ readonly partialDates: v.OptionalSchema<v.ObjectSchema<{
3585
+ readonly year: v.OptionalSchema<v.StringSchema<"XMLPartialDates: year is string and optional">, undefined>;
3586
+ readonly month: v.OptionalSchema<v.StringSchema<"XMLPartialDates: month is string and optional">, undefined>;
3587
+ readonly day: v.OptionalSchema<v.StringSchema<"XMLPartialDates: day is string and optional">, undefined>;
3588
+ readonly endYear: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endYear is string and optional">, undefined>;
3589
+ readonly endMonth: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endMonth is string and optional">, undefined>;
3590
+ readonly endDay: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endDay is string and optional">, undefined>;
3591
+ readonly payload: v.OptionalSchema<v.StringSchema<"XMLPartialDates: payload is string and optional">, undefined>;
3592
+ }, "XMLPartialDates: Shape error">, undefined>;
3481
3593
  readonly agent: v.OptionalSchema<v.ObjectSchema<{
3482
3594
  readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
3483
3595
  readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
@@ -3619,6 +3731,7 @@ export declare const XMLGalleryData: v.ObjectSchema<{
3619
3731
  readonly other: v.OptionalSchema<v.ObjectSchema<{
3620
3732
  readonly uuid: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and optional">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>, undefined>;
3621
3733
  readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["tree", "bibliography", "spatialUnit", "concept", "period", "person", "propertyVariable", "variable", "propertyValue", "value", "resource", "text", "set"], undefined>, undefined>;
3734
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
3622
3735
  readonly content: v.ArraySchema<v.ObjectSchema<{
3623
3736
  readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
3624
3737
  readonly properties: v.OptionalSchema<v.ObjectSchema<{
@@ -3640,6 +3753,31 @@ export declare const XMLGalleryData: v.ObjectSchema<{
3640
3753
  readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
3641
3754
  }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
3642
3755
  }, "XMLEvent: other is object">, undefined>;
3756
+ readonly period: v.OptionalSchema<v.ObjectSchema<{
3757
+ readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
3758
+ readonly rawValue: v.OptionalSchema<v.StringSchema<"XMLEvent: rawValue is string and optional">, undefined>;
3759
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
3760
+ readonly content: v.ArraySchema<v.ObjectSchema<{
3761
+ readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
3762
+ readonly properties: v.OptionalSchema<v.ObjectSchema<{
3763
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
3764
+ }, undefined>, undefined>;
3765
+ readonly annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
3766
+ readonly string: v.ArraySchema<v.ObjectSchema<{
3767
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
3768
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
3769
+ properties: v.OptionalSchema<v.ObjectSchema<{
3770
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
3771
+ }, undefined>, undefined>;
3772
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
3773
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
3774
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
3775
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
3776
+ }, "XMLString: Shape error">, undefined>;
3777
+ readonly title: v.OptionalSchema<v.StringSchema<"XMLContent: title is string and optional">, undefined>;
3778
+ readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
3779
+ }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
3780
+ }, "XMLEvent: period is object with uuid">, undefined>;
3643
3781
  }, "XMLEvent: Shape error">, undefined>;
3644
3782
  }, "XMLBaseItem: events is object with event array of XMLEvent">, undefined>, undefined>;
3645
3783
  }, "XMLBibliography: Shape error">, undefined>;
@@ -3964,6 +4102,15 @@ export declare const XMLGalleryData: v.ObjectSchema<{
3964
4102
  readonly event: v.ArraySchema<v.ObjectSchema<{
3965
4103
  readonly dateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
3966
4104
  readonly endDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
4105
+ readonly partialDates: v.OptionalSchema<v.ObjectSchema<{
4106
+ readonly year: v.OptionalSchema<v.StringSchema<"XMLPartialDates: year is string and optional">, undefined>;
4107
+ readonly month: v.OptionalSchema<v.StringSchema<"XMLPartialDates: month is string and optional">, undefined>;
4108
+ readonly day: v.OptionalSchema<v.StringSchema<"XMLPartialDates: day is string and optional">, undefined>;
4109
+ readonly endYear: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endYear is string and optional">, undefined>;
4110
+ readonly endMonth: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endMonth is string and optional">, undefined>;
4111
+ readonly endDay: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endDay is string and optional">, undefined>;
4112
+ readonly payload: v.OptionalSchema<v.StringSchema<"XMLPartialDates: payload is string and optional">, undefined>;
4113
+ }, "XMLPartialDates: Shape error">, undefined>;
3967
4114
  readonly agent: v.OptionalSchema<v.ObjectSchema<{
3968
4115
  readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
3969
4116
  readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
@@ -4105,6 +4252,7 @@ export declare const XMLGalleryData: v.ObjectSchema<{
4105
4252
  readonly other: v.OptionalSchema<v.ObjectSchema<{
4106
4253
  readonly uuid: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and optional">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>, undefined>;
4107
4254
  readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["tree", "bibliography", "spatialUnit", "concept", "period", "person", "propertyVariable", "variable", "propertyValue", "value", "resource", "text", "set"], undefined>, undefined>;
4255
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
4108
4256
  readonly content: v.ArraySchema<v.ObjectSchema<{
4109
4257
  readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
4110
4258
  readonly properties: v.OptionalSchema<v.ObjectSchema<{
@@ -4126,6 +4274,31 @@ export declare const XMLGalleryData: v.ObjectSchema<{
4126
4274
  readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
4127
4275
  }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
4128
4276
  }, "XMLEvent: other is object">, undefined>;
4277
+ readonly period: v.OptionalSchema<v.ObjectSchema<{
4278
+ readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
4279
+ readonly rawValue: v.OptionalSchema<v.StringSchema<"XMLEvent: rawValue is string and optional">, undefined>;
4280
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
4281
+ readonly content: v.ArraySchema<v.ObjectSchema<{
4282
+ readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
4283
+ readonly properties: v.OptionalSchema<v.ObjectSchema<{
4284
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
4285
+ }, undefined>, undefined>;
4286
+ readonly annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
4287
+ readonly string: v.ArraySchema<v.ObjectSchema<{
4288
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
4289
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
4290
+ properties: v.OptionalSchema<v.ObjectSchema<{
4291
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
4292
+ }, undefined>, undefined>;
4293
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
4294
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
4295
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
4296
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
4297
+ }, "XMLString: Shape error">, undefined>;
4298
+ readonly title: v.OptionalSchema<v.StringSchema<"XMLContent: title is string and optional">, undefined>;
4299
+ readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
4300
+ }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
4301
+ }, "XMLEvent: period is object with uuid">, undefined>;
4129
4302
  }, "XMLEvent: Shape error">, undefined>;
4130
4303
  }, "XMLBaseItem: events is object with event array of XMLEvent">, undefined>;
4131
4304
  }, "XMLResource: Shape error">, "XMLGallery: resource is array of XMLResource">, undefined>;
@@ -7611,6 +7784,15 @@ export declare const XMLWebsiteData: v.ObjectSchema<{
7611
7784
  readonly event: v.ArraySchema<v.ObjectSchema<{
7612
7785
  readonly dateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
7613
7786
  readonly endDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
7787
+ readonly partialDates: v.OptionalSchema<v.ObjectSchema<{
7788
+ readonly year: v.OptionalSchema<v.StringSchema<"XMLPartialDates: year is string and optional">, undefined>;
7789
+ readonly month: v.OptionalSchema<v.StringSchema<"XMLPartialDates: month is string and optional">, undefined>;
7790
+ readonly day: v.OptionalSchema<v.StringSchema<"XMLPartialDates: day is string and optional">, undefined>;
7791
+ readonly endYear: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endYear is string and optional">, undefined>;
7792
+ readonly endMonth: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endMonth is string and optional">, undefined>;
7793
+ readonly endDay: v.OptionalSchema<v.StringSchema<"XMLPartialDates: endDay is string and optional">, undefined>;
7794
+ readonly payload: v.OptionalSchema<v.StringSchema<"XMLPartialDates: payload is string and optional">, undefined>;
7795
+ }, "XMLPartialDates: Shape error">, undefined>;
7614
7796
  readonly agent: v.OptionalSchema<v.ObjectSchema<{
7615
7797
  readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
7616
7798
  readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
@@ -7752,6 +7934,7 @@ export declare const XMLWebsiteData: v.ObjectSchema<{
7752
7934
  readonly other: v.OptionalSchema<v.ObjectSchema<{
7753
7935
  readonly uuid: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and optional">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>, undefined>;
7754
7936
  readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["tree", "bibliography", "spatialUnit", "concept", "period", "person", "propertyVariable", "variable", "propertyValue", "value", "resource", "text", "set"], undefined>, undefined>;
7937
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
7755
7938
  readonly content: v.ArraySchema<v.ObjectSchema<{
7756
7939
  readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
7757
7940
  readonly properties: v.OptionalSchema<v.ObjectSchema<{
@@ -7773,6 +7956,31 @@ export declare const XMLWebsiteData: v.ObjectSchema<{
7773
7956
  readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
7774
7957
  }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
7775
7958
  }, "XMLEvent: other is object">, undefined>;
7959
+ readonly period: v.OptionalSchema<v.ObjectSchema<{
7960
+ readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<"XMLEvent: uuid is string and required">, v.CheckAction<string, "XMLEvent: uuid is not a valid pseudo-UUID">]>;
7961
+ readonly rawValue: v.OptionalSchema<v.StringSchema<"XMLEvent: rawValue is string and optional">, undefined>;
7962
+ readonly publicationDateTime: v.OptionalSchema<v.GenericSchema<unknown, Date>, undefined>;
7963
+ readonly content: v.ArraySchema<v.ObjectSchema<{
7964
+ readonly links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
7965
+ readonly properties: v.OptionalSchema<v.ObjectSchema<{
7966
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
7967
+ }, undefined>, undefined>;
7968
+ readonly annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
7969
+ readonly string: v.ArraySchema<v.ObjectSchema<{
7970
+ string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
7971
+ links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
7972
+ properties: v.OptionalSchema<v.ObjectSchema<{
7973
+ readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
7974
+ }, undefined>, undefined>;
7975
+ annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
7976
+ payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
7977
+ rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
7978
+ whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
7979
+ }, "XMLString: Shape error">, undefined>;
7980
+ readonly title: v.OptionalSchema<v.StringSchema<"XMLContent: title is string and optional">, undefined>;
7981
+ readonly lang: v.StringSchema<"XMLContent: lang is string and required">;
7982
+ }, undefined>, "XMLContent: content is array of object with string, title, and lang">;
7983
+ }, "XMLEvent: period is object with uuid">, undefined>;
7776
7984
  }, "XMLEvent: Shape error">, undefined>;
7777
7985
  }, "XMLBaseItem: events is object with event array of XMLEvent">, undefined>;
7778
7986
  }, "XMLWebsiteTree: Shape error">>, undefined>;
@@ -140,9 +140,19 @@ const XMLContextGroup = v.object({
140
140
  displayPath: v.string("XMLContextGroup: displayPath is string and required")
141
141
  }, "XMLContextGroup: Shape error");
142
142
  const XMLContext = v.array(v.union([XMLContextGroup, XMLEmptyContext], "XMLContext: item is XMLContextGroup or XMLEmptyContext"));
143
+ const XMLPartialDates = v.object({
144
+ year: v.optional(v.string("XMLPartialDates: year is string and optional")),
145
+ month: v.optional(v.string("XMLPartialDates: month is string and optional")),
146
+ day: v.optional(v.string("XMLPartialDates: day is string and optional")),
147
+ endYear: v.optional(v.string("XMLPartialDates: endYear is string and optional")),
148
+ endMonth: v.optional(v.string("XMLPartialDates: endMonth is string and optional")),
149
+ endDay: v.optional(v.string("XMLPartialDates: endDay is string and optional")),
150
+ payload: v.optional(v.string("XMLPartialDates: payload is string and optional"))
151
+ }, "XMLPartialDates: Shape error");
143
152
  const XMLEvent = v.object({
144
153
  dateTime: v.optional(customDateTime("XMLEvent: dateTime is not a valid datetime")),
145
154
  endDateTime: v.optional(customDateTime("XMLEvent: endDateTime is not a valid datetime")),
155
+ partialDates: v.optional(XMLPartialDates),
146
156
  agent: v.optional(v.object({
147
157
  ...XMLContent.entries,
148
158
  uuid: v.pipe(v.string("XMLEvent: uuid is string and required"), v.check(isPseudoUuid, "XMLEvent: uuid is not a valid pseudo-UUID")),
@@ -158,8 +168,15 @@ const XMLEvent = v.object({
158
168
  other: v.optional(v.object({
159
169
  ...XMLContent.entries,
160
170
  uuid: v.optional(v.pipe(v.string("XMLEvent: uuid is string and optional"), v.check(isPseudoUuid, "XMLEvent: uuid is not a valid pseudo-UUID"))),
161
- category: v.optional(XMLItemCategory)
162
- }, "XMLEvent: other is object"))
171
+ category: v.optional(XMLItemCategory),
172
+ publicationDateTime: v.optional(customDateTime("XMLEvent: publicationDateTime is not a valid datetime"))
173
+ }, "XMLEvent: other is object")),
174
+ period: v.optional(v.object({
175
+ ...XMLContent.entries,
176
+ uuid: v.pipe(v.string("XMLEvent: uuid is string and required"), v.check(isPseudoUuid, "XMLEvent: uuid is not a valid pseudo-UUID")),
177
+ rawValue: v.optional(v.string("XMLEvent: rawValue is string and optional")),
178
+ publicationDateTime: v.optional(customDateTime("XMLEvent: publicationDateTime is not a valid datetime"))
179
+ }, "XMLEvent: period is object with uuid"))
163
180
  }, "XMLEvent: Shape error");
164
181
  const XMLCoordinatesSourceLabel = v.object({
165
182
  ...XMLContent.entries,
@@ -231,8 +248,9 @@ const XMLDownloadOptions = v.object({ option: v.array(v.object({
231
248
  "alto"
232
249
  ], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto"),
233
250
  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");
251
+ fileFormat: v.string("XMLDownloadOptions: fileFormat is string and required"),
252
+ fileSize: XMLOptionalNumber
253
+ }, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize")) }, "XMLDownloadOptions: Shape error");
236
254
  const XMLImageMapArea = v.object({
237
255
  uuid: v.pipe(v.string("XMLImageMapArea: uuid is string and required"), v.check(isPseudoUuid, "XMLImageMapArea: uuid is not a valid pseudo-UUID")),
238
256
  publicationDateTime: v.optional(customDateTime("XMLImageMapArea: publicationDateTime is not a valid datetime")),
@@ -87,9 +87,19 @@ export type XMLContextGroup = {
87
87
  displayPath: string;
88
88
  };
89
89
  export type XMLContext = Array<XMLContextGroup | XMLEmptyContext>;
90
+ export type XMLPartialDates = {
91
+ year?: string;
92
+ month?: string;
93
+ day?: string;
94
+ endYear?: string;
95
+ endMonth?: string;
96
+ endDay?: string;
97
+ payload?: string;
98
+ };
90
99
  export type XMLEvent = {
91
100
  dateTime?: Date;
92
101
  endDateTime?: Date;
102
+ partialDates?: XMLPartialDates;
93
103
  agent?: XMLContent & {
94
104
  uuid: string;
95
105
  publicationDateTime?: Date;
@@ -103,6 +113,12 @@ export type XMLEvent = {
103
113
  other?: XMLContent & {
104
114
  uuid?: string;
105
115
  category?: XMLItemCategory;
116
+ publicationDateTime?: Date;
117
+ };
118
+ period?: XMLContent & {
119
+ uuid: string;
120
+ rawValue?: string;
121
+ publicationDateTime?: Date;
106
122
  };
107
123
  };
108
124
  export type XMLCoordinatesSource = {
@@ -171,6 +187,7 @@ export type XMLDownloadOptions = {
171
187
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
172
188
  href: string;
173
189
  fileFormat: string;
190
+ fileSize?: number;
174
191
  }>;
175
192
  };
176
193
  export type XMLImageMapArea = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.3.21",
3
+ "version": "1.3.23",
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",