ochre-sdk 1.0.75 → 1.0.77
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 +2 -2
- package/dist/parsers/website/index.mjs +6 -3
- package/dist/types/website.d.mts +25 -27
- package/dist/xml/schemas.mjs +13 -5
- package/dist/xml/types.d.mts +2 -0
- package/package.json +7 -7
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, ContextTreeLevel, ContextTreeLevelItem, ProtectedWebsite, Scope, Style, StylesheetCategory, StylesheetItem, WebAccordionItem, WebBlock, WebBlockByLayout, WebBlockItem, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebSidebar, WebTitle, Webpage, Website, WebsiteMetadata, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType } from "./types/website.mjs";
|
|
2
|
+
import { AccordionWebBlock, ContextTree, ContextTreeFilterLevel, ContextTreeFilterVariant, ContextTreeLevel, ContextTreeLevelItem, ProtectedWebsite, Scope, Style, StylesheetCategory, StylesheetItem, WebAccordionItem, WebBlock, WebBlockByLayout, WebBlockItem, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebOptions, WebSidebar, WebTitle, Webpage, Website, WebsiteMetadata, 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, 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, ItemPayloadKind, ItemProperty, ItemWithoutEmbeddedItems, LanguageCodes, License, Metadata, Note, Observation, OcrString, Period, PeriodItemLink, Person, PersonItemLink, Prettify, 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, SetTree, SimplifiedProperty, SpatialUnit, SpatialUnitItemLink, Text, TextItemLink, TopLevelItem, Tree, TreeItemCategory, TreeItemLink } from "./types/index.mjs";
|
|
4
4
|
import { fetchGallery } from "./fetchers/gallery.mjs";
|
|
5
5
|
import { fetchItemChildren } from "./fetchers/item-children.mjs";
|
|
@@ -12,4 +12,4 @@ import { fetchWebsiteMetadata } from "./fetchers/website-metadata.mjs";
|
|
|
12
12
|
import { fetchWebsite } from "./fetchers/website.mjs";
|
|
13
13
|
import { PropertyOptions, filterProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels } from "./getters.mjs";
|
|
14
14
|
import { DEFAULT_PAGE_SIZE, flattenItemProperties } from "./helpers.mjs";
|
|
15
|
-
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 ContextTreeLevel, type ContextTreeLevelItem, type Coordinates, type CoordinatesSource, DEFAULT_PAGE_SIZE, type DictionaryUnitItemLink, 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 ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, type Observation, type OcrString, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Prettify, type Property, type PropertyLike, PropertyOptions, type PropertyRelation, 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 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 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 WebImage, type WebSidebar, type WebTitle, type Webpage, type Website, type WebsiteMetadata, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemOcrData, fetchSetItems, fetchSetPropertyValues, fetchWebsite, fetchWebsiteMetadata, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels, withLanguages };
|
|
15
|
+
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 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 ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, type Observation, type OcrString, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Prettify, type Property, type PropertyLike, PropertyOptions, type PropertyRelation, 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 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 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 WebImage, type WebOptions, type WebSidebar, type WebTitle, type Webpage, type Website, type WebsiteMetadata, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemOcrData, fetchSetItems, fetchSetPropertyValues, fetchWebsite, fetchWebsiteMetadata, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByVariableLabel, getPropertyByVariableLabelAndValue, getPropertyByVariableLabelAndValueContent, getPropertyByVariableLabelAndValueContents, getPropertyByVariableLabelAndValues, getPropertyByVariableUuid, getPropertyValueByVariableLabel, getPropertyValueByVariableUuid, getPropertyValueContentByVariableLabel, getPropertyValueContentByVariableUuid, getPropertyValueContentsByVariableUuid, getPropertyValuesByVariableLabel, getPropertyValuesByVariableUuid, getUniqueProperties, getUniquePropertyVariableLabels, withLanguages };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { componentSchema } from "../../schemas.mjs";
|
|
2
2
|
import { parseXMLContent } from "../string.mjs";
|
|
3
|
-
import { cleanObject, parseLicense, parseStringContent } from "../helpers.mjs";
|
|
3
|
+
import { cleanObject, parseContentLike, parseLicense, parseStringContent } from "../helpers.mjs";
|
|
4
4
|
import { parseBibliographyList, parseIdentification, parseLinks, parseMetadata, parseMetadataLanguages, parseNotes, parsePersonList, parseSimplifiedProperties, resolveDefaultLanguage, resolveLanguages } from "../index.mjs";
|
|
5
5
|
import { websitePresentationReader } from "./reader.mjs";
|
|
6
6
|
import * as v from "valibot";
|
|
@@ -351,7 +351,8 @@ function parseWebElementProperties(componentProperty, elementResource, options,
|
|
|
351
351
|
properties = {
|
|
352
352
|
component: "advanced-search",
|
|
353
353
|
boundElementUuid: boundElementPropertyUuid,
|
|
354
|
-
href
|
|
354
|
+
href,
|
|
355
|
+
options: parseWebsiteOptions(elementResource.options, options)
|
|
355
356
|
};
|
|
356
357
|
break;
|
|
357
358
|
}
|
|
@@ -1316,7 +1317,8 @@ function parseContextItem(contextItemToParse, options) {
|
|
|
1316
1317
|
return {
|
|
1317
1318
|
context: levels,
|
|
1318
1319
|
type,
|
|
1319
|
-
identification: parseIdentification(contextItemToParse.identification, options)
|
|
1320
|
+
identification: parseIdentification(contextItemToParse.identification, options),
|
|
1321
|
+
description: parseContentLike(contextItemToParse.description, options)
|
|
1320
1322
|
};
|
|
1321
1323
|
}
|
|
1322
1324
|
function parseFilterContextDisplay(filterOption) {
|
|
@@ -1363,6 +1365,7 @@ function parseFilterContexts(filterContextLevels, options) {
|
|
|
1363
1365
|
for (const filterContextLevel of filterContextLevels) for (const contextItemToParse of filterContextLevel.context) filterContextTreeLevels.push({
|
|
1364
1366
|
...parseContextItem(contextItemToParse, options),
|
|
1365
1367
|
filterType: contextItemToParse.filterType ?? "property",
|
|
1368
|
+
filterVariant: contextItemToParse.filterVariant ?? null,
|
|
1366
1369
|
...parseFilterContextDisplay(contextItemToParse.filterOption)
|
|
1367
1370
|
});
|
|
1368
1371
|
return filterContextTreeLevels;
|
package/dist/types/website.d.mts
CHANGED
|
@@ -14,20 +14,23 @@ type ContextTreeLevelItem = {
|
|
|
14
14
|
type ContextTreeLevel<T extends LanguageCodes = LanguageCodes> = {
|
|
15
15
|
context: Array<ContextTreeLevelItem>;
|
|
16
16
|
identification: Identification<T>;
|
|
17
|
+
description: MultilingualString<T> | null;
|
|
17
18
|
type: string;
|
|
18
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Represents the input control a filter context level is rendered with
|
|
22
|
+
*/
|
|
23
|
+
type ContextTreeFilterVariant = "checkbox" | "chip" | "range" | "tile" | "toggle";
|
|
19
24
|
/**
|
|
20
25
|
* Represents a filter context tree level with a context item
|
|
21
26
|
*/
|
|
22
|
-
type ContextTreeFilterLevel<T extends LanguageCodes = LanguageCodes> = {
|
|
23
|
-
context: Array<ContextTreeLevelItem>;
|
|
24
|
-
identification: Identification<T>;
|
|
25
|
-
type: string;
|
|
27
|
+
type ContextTreeFilterLevel<T extends LanguageCodes = LanguageCodes> = Prettify<ContextTreeLevel<T> & {
|
|
26
28
|
filterType: "property" | "coordinates" | "bibliography" | "period";
|
|
29
|
+
filterVariant: ContextTreeFilterVariant | null;
|
|
27
30
|
isInlineDisplayed: boolean;
|
|
28
31
|
isSidebarDisplayed: boolean;
|
|
29
32
|
isSidebarOpen: boolean;
|
|
30
|
-
}
|
|
33
|
+
}>;
|
|
31
34
|
/**
|
|
32
35
|
* Represents a context tree with levels grouped by behavior
|
|
33
36
|
*/
|
|
@@ -49,6 +52,17 @@ type Scope<T extends LanguageCodes = LanguageCodes> = {
|
|
|
49
52
|
type: string;
|
|
50
53
|
identification: Identification<T>;
|
|
51
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* Represents the parsed OCHRE "options" block shared by the website itself and
|
|
57
|
+
* by every web element component that supports it
|
|
58
|
+
*/
|
|
59
|
+
type WebOptions<T extends LanguageCodes = LanguageCodes> = {
|
|
60
|
+
scopes: Array<Scope<T>> | null;
|
|
61
|
+
contextTree: ContextTree<T> | null;
|
|
62
|
+
labels: {
|
|
63
|
+
title: MultilingualString<T> | null;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
52
66
|
/**
|
|
53
67
|
* Represents a stylesheet item with its UUID and category
|
|
54
68
|
*/
|
|
@@ -188,16 +202,11 @@ type Website<T extends LanguageCodes = LanguageCodes> = {
|
|
|
188
202
|
isPersistentIdentifierDisplayed: boolean;
|
|
189
203
|
iiifViewer: "universal-viewer" | "clover";
|
|
190
204
|
};
|
|
191
|
-
options: {
|
|
192
|
-
contextTree: ContextTree<T> | null;
|
|
193
|
-
scopes: Array<Scope<T>> | null;
|
|
194
|
-
labels: {
|
|
195
|
-
title: MultilingualString<T> | null;
|
|
196
|
-
};
|
|
205
|
+
options: Prettify<WebOptions<T> & {
|
|
197
206
|
stylesheets: {
|
|
198
207
|
properties: Array<StylesheetItem>;
|
|
199
208
|
};
|
|
200
|
-
}
|
|
209
|
+
}>;
|
|
201
210
|
};
|
|
202
211
|
};
|
|
203
212
|
type WebsiteSegment<T extends LanguageCodes = LanguageCodes> = Website<T> & {
|
|
@@ -285,6 +294,7 @@ type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
|
|
|
285
294
|
component: "advanced-search";
|
|
286
295
|
boundElementUuid: string | null;
|
|
287
296
|
href: string | null;
|
|
297
|
+
options: WebOptions<T>;
|
|
288
298
|
} | {
|
|
289
299
|
component: "annotated-document";
|
|
290
300
|
linkUuid: string;
|
|
@@ -353,13 +363,7 @@ type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
|
|
|
353
363
|
isLimitedToLeafPropertyValues: boolean;
|
|
354
364
|
sidebarSort: "default" | "alphabetical";
|
|
355
365
|
};
|
|
356
|
-
options:
|
|
357
|
-
scopes: Array<Scope<T>> | null;
|
|
358
|
-
contextTree: ContextTree<T> | null;
|
|
359
|
-
labels: {
|
|
360
|
-
title: MultilingualString<T> | null;
|
|
361
|
-
};
|
|
362
|
-
};
|
|
366
|
+
options: WebOptions<T>;
|
|
363
367
|
} | {
|
|
364
368
|
component: "empty-space";
|
|
365
369
|
height: string | null;
|
|
@@ -418,13 +422,7 @@ type WebElementComponent<T extends LanguageCodes = LanguageCodes> = {
|
|
|
418
422
|
startIcon: string | null;
|
|
419
423
|
endIcon: string | null;
|
|
420
424
|
}>;
|
|
421
|
-
options:
|
|
422
|
-
scopes: Array<Scope<T>> | null;
|
|
423
|
-
contextTree: ContextTree<T> | null;
|
|
424
|
-
labels: {
|
|
425
|
-
title: MultilingualString<T> | null;
|
|
426
|
-
};
|
|
427
|
-
};
|
|
425
|
+
options: WebOptions<T>;
|
|
428
426
|
collectionProperties: Prettify<Partial<Omit<Extract<WebElementComponent<T>, {
|
|
429
427
|
component: "collection";
|
|
430
428
|
}>, "component" | "linkUuids" | "options" | "image"> & {
|
|
@@ -563,4 +561,4 @@ type ProtectedWebsite<T extends LanguageCodes = LanguageCodes> = {
|
|
|
563
561
|
};
|
|
564
562
|
};
|
|
565
563
|
//#endregion
|
|
566
|
-
export { AccordionWebBlock, ContextTree, ContextTreeFilterLevel, ContextTreeLevel, ContextTreeLevelItem, ProtectedWebsite, Scope, Style, StylesheetCategory, StylesheetItem, WebAccordionItem, WebBlock, WebBlockByLayout, WebBlockItem, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebSidebar, WebTitle, Webpage, Website, WebsiteMetadata, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType };
|
|
564
|
+
export { AccordionWebBlock, ContextTree, ContextTreeFilterLevel, ContextTreeFilterVariant, ContextTreeLevel, ContextTreeLevelItem, ProtectedWebsite, Scope, Style, StylesheetCategory, StylesheetItem, WebAccordionItem, WebBlock, WebBlockByLayout, WebBlockItem, WebBlockLayout, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebImage, WebOptions, WebSidebar, WebTitle, Webpage, Website, WebsiteMetadata, WebsitePropertyQuery, WebsitePropertyQueryNode, WebsiteSegment, WebsiteType };
|
package/dist/xml/schemas.mjs
CHANGED
|
@@ -717,13 +717,14 @@ const XMLWebsiteContextLevel = v.intersect([XMLString, v.object({
|
|
|
717
717
|
payload: v.string("XMLWebsiteContextLevel: payload is required"),
|
|
718
718
|
dataType: v.optional(v.string("XMLWebsiteContextLevel: dataType is optional string"))
|
|
719
719
|
}, "XMLWebsiteContextLevel: Shape error")]);
|
|
720
|
-
const
|
|
720
|
+
const XMLWebsiteContextItemEntries = {
|
|
721
721
|
identification: XMLIdentification,
|
|
722
|
+
description: v.optional(XMLContent),
|
|
722
723
|
levels: v.optional(v.object({ level: v.array(XMLWebsiteContextLevel) }, "XMLWebsiteContextItem: levels is object with level"))
|
|
723
|
-
}
|
|
724
|
+
};
|
|
725
|
+
const XMLWebsiteContextItem = v.object(XMLWebsiteContextItemEntries, "XMLWebsiteContextItem: Shape error");
|
|
724
726
|
const XMLWebsiteFilterContextItem = v.object({
|
|
725
|
-
|
|
726
|
-
levels: v.optional(v.object({ level: v.array(XMLWebsiteContextLevel) }, "XMLWebsiteFilterContextItem: levels is object with level")),
|
|
727
|
+
...XMLWebsiteContextItemEntries,
|
|
727
728
|
filterType: v.optional(v.picklist([
|
|
728
729
|
"property",
|
|
729
730
|
"coordinates",
|
|
@@ -737,7 +738,14 @@ const XMLWebsiteFilterContextItem = v.object({
|
|
|
737
738
|
"sidebar-displayed-closed",
|
|
738
739
|
"sidebar-displayed-open",
|
|
739
740
|
"inline-sidebar-hidden"
|
|
740
|
-
], "XMLWebsiteFilterContextItem: filterOption is invalid"))
|
|
741
|
+
], "XMLWebsiteFilterContextItem: filterOption is invalid")),
|
|
742
|
+
filterVariant: v.optional(v.picklist([
|
|
743
|
+
"checkbox",
|
|
744
|
+
"chip",
|
|
745
|
+
"range",
|
|
746
|
+
"tile",
|
|
747
|
+
"toggle"
|
|
748
|
+
], "XMLWebsiteFilterContextItem: filterVariant is invalid"))
|
|
741
749
|
}, "XMLWebsiteFilterContextItem: Shape error");
|
|
742
750
|
const XMLWebsiteContext = v.object({ context: v.array(XMLWebsiteContextItem) }, "XMLWebsiteContext: Shape error");
|
|
743
751
|
const XMLWebsiteFilterContext = v.object({ context: v.array(XMLWebsiteFilterContextItem) }, "XMLWebsiteFilterContext: Shape error");
|
package/dist/xml/types.d.mts
CHANGED
|
@@ -683,6 +683,7 @@ type XMLWebsiteContextLevel = XMLString & {
|
|
|
683
683
|
};
|
|
684
684
|
type XMLWebsiteContextItem = {
|
|
685
685
|
identification: XMLIdentification;
|
|
686
|
+
description?: XMLContent;
|
|
686
687
|
levels?: {
|
|
687
688
|
level: Array<XMLWebsiteContextLevel>;
|
|
688
689
|
};
|
|
@@ -690,6 +691,7 @@ type XMLWebsiteContextItem = {
|
|
|
690
691
|
type XMLWebsiteFilterContextItem = XMLWebsiteContextItem & {
|
|
691
692
|
filterType?: "property" | "coordinates" | "bibliography" | "period";
|
|
692
693
|
filterOption?: "inline-displayed" | "inline-sidebar-displayed-closed" | "inline-sidebar-displayed-open" | "sidebar-displayed-closed" | "sidebar-displayed-open" | "inline-sidebar-hidden";
|
|
694
|
+
filterVariant?: "checkbox" | "chip" | "range" | "tile" | "toggle";
|
|
693
695
|
};
|
|
694
696
|
type XMLWebsiteContext = {
|
|
695
697
|
context: Array<XMLWebsiteContextItem>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ochre-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.77",
|
|
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",
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"date-fns": "^4.4.0",
|
|
49
49
|
"fast-equals": "^6.0.2",
|
|
50
|
-
"fast-xml-parser": "^5.
|
|
50
|
+
"fast-xml-parser": "^5.11.0",
|
|
51
51
|
"valibot": "^1.4.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@antfu/eslint-config": "^9.3.0",
|
|
55
55
|
"@types/node": "^24.13.3",
|
|
56
|
-
"bumpp": "^12.2.
|
|
57
|
-
"eslint": "^10.8.
|
|
56
|
+
"bumpp": "^12.2.1",
|
|
57
|
+
"eslint": "^10.8.1",
|
|
58
58
|
"eslint-plugin-erasable-syntax-only": "^0.4.2",
|
|
59
|
-
"knip": "^6.32.
|
|
60
|
-
"oxfmt": "^0.
|
|
59
|
+
"knip": "^6.32.2",
|
|
60
|
+
"oxfmt": "^0.64.0",
|
|
61
61
|
"tsdown": "^0.22.14",
|
|
62
62
|
"typescript": "^6.0.3",
|
|
63
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.11"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"dev": "tsdown src/index.ts --watch",
|