ochre-sdk 1.1.5 → 1.1.6

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, WebElement, WebElementComponent, WebElementComponentName, WebElementComponentOf, WebElementOf, WebIiifViewer, WebImage, WebLoadingVariant, WebOptions, 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, 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, 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";
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, 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";
@@ -15,4 +15,4 @@ import { fetchWebsite } from "./fetchers/website.mjs";
15
15
  import { PropertyOptions, PropertySelector, getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel } from "./getters.mjs";
16
16
  import { flattenItemProperties } from "./helpers.mjs";
17
17
  import { defineLanguages } from "./parsers/languages.mjs";
18
- 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 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 SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebAccordionItem, type WebBlock, type WebBlockByLayout, type WebBlockItem, type WebBlockLayout, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebIiifViewer, type WebImage, type WebLoadingVariant, type WebOptions, type 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, fetchItemOcrData, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel };
18
+ 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 Property, type PropertyLike, type PropertyOptions, type PropertyRelation, type PropertySelector, type PropertyValue, type PropertyValueContent, type PropertyValueDataType, type PropertyValueItemLink, type PropertyValueQueryItem, type PropertyVariable, type PropertyVariableItemLink, type ProtectedWebsite, type Query, type QueryGroup, type QueryLeaf, type QueryablePropertyValueDataType, type RecursiveItemCategory, type Resource, type ResourceItemLink, type ResponsiveStyles, type Scope, type Section, type Set, type SetAttributeValueQueryItem, type SetBibliography, type SetConcept, type SetItem, type SetItemCategory, type SetItemLink, type SetItemProperty, type SetItemSimplifiedProperty, type SetItemsSort, type SetItemsSortDirection, type SetPeriod, type SetResource, type SetSpatialUnit, type SetStyle, type SetStyleProperty, type SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebAccordionItem, type WebBlock, type WebBlockByLayout, type WebBlockItem, type WebBlockLayout, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebIiifViewer, type WebImage, type WebLoadingVariant, type WebOptions, type 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, fetchItemOcrData, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel };
@@ -844,6 +844,33 @@ function parseTree(rawTree, options) {
844
844
  items
845
845
  };
846
846
  }
847
+ function parseSetStyleProperty(rawProperty, options) {
848
+ const declarations = rawProperty.styleProperties?.payload.split(";") ?? [];
849
+ const styles = [];
850
+ for (const declaration of declarations) {
851
+ const separatorIndex = declaration.indexOf("=");
852
+ const label = (separatorIndex === -1 ? declaration : declaration.slice(0, separatorIndex)).trim();
853
+ if (label === "") continue;
854
+ styles.push({
855
+ label,
856
+ value: separatorIndex === -1 ? "" : declaration.slice(separatorIndex + 1).trim()
857
+ });
858
+ }
859
+ return {
860
+ ...parseProperty(rawProperty, options),
861
+ properties: Array.from(rawProperty.property ?? [], (property) => parseSetStyleProperty(property, options)),
862
+ styles
863
+ };
864
+ }
865
+ function parseSetStyle(rawStyle, options) {
866
+ return {
867
+ date: rawStyle.date ?? null,
868
+ title: parseNoteTitle(rawStyle, options),
869
+ content: rawStyle.content == null ? null : parseRequiredContentLike(rawStyle, options),
870
+ authors: Array.from(rawStyle.authors?.author ?? [], (author) => parsePerson(author, options)),
871
+ properties: Array.from(rawStyle.properties?.property ?? [], (property) => parseSetStyleProperty(property, options))
872
+ };
873
+ }
847
874
  function parseSet(rawSet, options) {
848
875
  const childOptions = getParserOptions(options);
849
876
  const containedItemCategories = normalizeSetItemCategories(options.containedItemCategory) ?? inferItemCategories(rawSet.items);
@@ -856,6 +883,7 @@ function parseSet(rawSet, options) {
856
883
  reverseLinks: parseReverseLinks(rawSet.reverseLinks, childOptions),
857
884
  notes: parseNotes(rawSet.notes, childOptions),
858
885
  properties: parseProperties(rawSet.properties, childOptions),
886
+ styles: Array.from(rawSet.styles?.style ?? [], (style) => parseSetStyle(style, childOptions)),
859
887
  items: parseSetItemHierarchy(rawSet.items, childOptions, containedItemCategories)
860
888
  };
861
889
  }
@@ -1,6 +1,6 @@
1
1
  import { MultilingualString } from "../parsers/multilingual.mjs";
2
2
  import { Prettify } from "./utilities.mjs";
3
- import { Webpage } from "./website.mjs";
3
+ import { Style, Webpage } from "./website.mjs";
4
4
  //#region src/types/index.d.ts
5
5
  /**
6
6
  * Language-code tuple or array used by OCHRE multilingual fields.
@@ -518,6 +518,23 @@ export type Tree<U extends TreeItemCategory = TreeItemCategory, T extends Langua
518
518
  bibliographies: Array<Bibliography<T, "embedded">>;
519
519
  items: U extends HeadingItemCategory ? Array<Heading<U, T> | Item<U, never, T, "embedded">> : Array<Item<U, never, T, "embedded">>;
520
520
  }>;
521
+ /**
522
+ * Property of a Set style in OCHRE, with the look its values take
523
+ */
524
+ export type SetStyleProperty<T extends LanguageCodes = LanguageCodes> = Prettify<Omit<Property<T>, "properties"> & {
525
+ properties: Array<SetStyleProperty<T>>;
526
+ styles: Array<Style>;
527
+ }>;
528
+ /**
529
+ * Style of a Set in OCHRE
530
+ */
531
+ export type SetStyle<T extends LanguageCodes = LanguageCodes> = {
532
+ date: Date | null;
533
+ title: MultilingualString<T> | null;
534
+ content: MultilingualString<T> | null;
535
+ authors: Array<Person<T, "embedded">>;
536
+ properties: Array<SetStyleProperty<T>>;
537
+ };
521
538
  /**
522
539
  * Set in OCHRE
523
540
  */
@@ -529,6 +546,7 @@ export type Set<U extends SetItemCategory = SetItemCategory, T extends LanguageC
529
546
  reverseLinks: ItemLinks<T>;
530
547
  notes: Array<Note<T>>;
531
548
  properties: Array<Property<T>>;
549
+ styles: Array<SetStyle<T>>;
532
550
  items: Array<SetItem<U, T>>;
533
551
  }>;
534
552
  export type SetBibliography<T extends LanguageCodes = LanguageCodes> = Bibliography<T, "embedded"> extends (infer U) ? U extends {
@@ -268,6 +268,7 @@ const XMLProperty = v.lazy(() => v.object({
268
268
  payload: v.optional(v.string("XMLProperty: payload is string and optional"))
269
269
  }), "XMLProperty: value is array of objects with payload")),
270
270
  comment: v.optional(XMLContent),
271
+ styleProperties: v.optional(v.object({ payload: v.string("XMLProperty: styleProperties payload is string and required") }, "XMLProperty: styleProperties is object with payload")),
271
272
  property: v.optional(v.array(XMLProperty, "XMLProperty: property is array of XMLProperty"))
272
273
  }, "XMLProperty: Shape error"));
273
274
  /**
@@ -433,6 +434,12 @@ const XMLTree = v.object({
433
434
  set: v.optional(v.array(v.lazy(() => XMLSet)))
434
435
  }))
435
436
  }, "XMLTree: Shape error");
437
+ const XMLSetStyle = v.object({
438
+ content: v.optional(XMLContent.entries.content),
439
+ date: v.optional(customDateTime("XMLSetStyle: date is not a valid datetime")),
440
+ authors: v.optional(v.object({ author: v.array(v.lazy(() => XMLPerson)) }, "XMLSetStyle: authors is object with author array of XMLPerson")),
441
+ properties: v.optional(v.object({ property: v.array(XMLProperty) }, "XMLSetStyle: properties is object with property array of XMLProperty"))
442
+ }, "XMLSetStyle: Shape error");
436
443
  const XMLSet = v.object({
437
444
  ...XMLBaseItem.entries,
438
445
  type: v.optional(v.string("XMLSet: type is string and optional")),
@@ -446,6 +453,7 @@ const XMLSet = v.object({
446
453
  ])),
447
454
  notes: v.optional(v.object({ note: v.array(XMLNote) })),
448
455
  properties: v.optional(v.object({ property: v.array(XMLProperty) })),
456
+ styles: v.optional(v.object({ style: v.array(XMLSetStyle) }, "XMLSet: styles is object with style array of XMLSetStyle")),
449
457
  items: v.optional(v.object({
450
458
  tree: v.optional(v.array(v.lazy(() => XMLTree))),
451
459
  bibliography: v.optional(v.array(v.lazy(() => XMLBibliography))),
@@ -1,5 +1,5 @@
1
1
  declare namespace types_d_exports {
2
- export { XMLBaseItem, XMLBibliography, XMLConcept, XMLContent, XMLContext, XMLContextGroup, XMLContextItem, XMLContextValue, XMLCoordinate, XMLCoordinates, XMLCoordinatesSource, XMLData, XMLDataItem, XMLDictionaryUnit, XMLEmptyContext, XMLEvent, XMLGallery, XMLGalleryData, XMLHeading, XMLHeadingItemCategory, XMLIdentification, XMLImage, XMLImageMap, XMLImageMapArea, XMLInterpretation, XMLItemCategory, XMLItemLinks, XMLItemLinksData, XMLLicense, XMLLink, XMLLinkedBaseItem, XMLLinkedBibliography, XMLLinkedConcept, XMLLinkedPeriod, XMLLinkedPerson, XMLLinkedPropertyValue, XMLLinkedPropertyVariable, XMLLinkedResource, XMLLinkedSet, XMLLinkedSpatialUnit, XMLLinkedText, XMLLinkedTree, XMLMetadata, XMLNote, XMLObservation, XMLPeriod, XMLPerson, XMLProperty, XMLPropertyRelation, XMLPropertyValue, XMLPropertyVariable, XMLRecursiveItemCategory, XMLResource, XMLRichTextEnvelope, XMLSection, XMLSet, XMLSetItems, XMLSetItemsData, XMLSimplifiedProperty, XMLSpatialUnit, XMLString, XMLText, XMLTree, XMLWebsiteContext, XMLWebsiteContextItem, XMLWebsiteContextLevel, XMLWebsiteData, XMLWebsiteFilterContext, XMLWebsiteFilterContextItem, XMLWebsiteOptions, XMLWebsiteProperties, XMLWebsiteResource, XMLWebsiteResourceGroup, XMLWebsiteResourceItem, XMLWebsiteScope, XMLWebsiteSegment, XMLWebsiteStyle, XMLWebsiteTree };
2
+ export { XMLBaseItem, XMLBibliography, XMLConcept, XMLContent, XMLContext, XMLContextGroup, XMLContextItem, XMLContextValue, XMLCoordinate, XMLCoordinates, XMLCoordinatesSource, XMLData, XMLDataItem, XMLDictionaryUnit, XMLEmptyContext, XMLEvent, XMLGallery, XMLGalleryData, XMLHeading, XMLHeadingItemCategory, XMLIdentification, XMLImage, XMLImageMap, XMLImageMapArea, XMLInterpretation, XMLItemCategory, XMLItemLinks, XMLItemLinksData, XMLLicense, XMLLink, XMLLinkedBaseItem, XMLLinkedBibliography, XMLLinkedConcept, XMLLinkedPeriod, XMLLinkedPerson, XMLLinkedPropertyValue, XMLLinkedPropertyVariable, XMLLinkedResource, XMLLinkedSet, XMLLinkedSpatialUnit, XMLLinkedText, XMLLinkedTree, XMLMetadata, XMLNote, XMLObservation, XMLPeriod, XMLPerson, XMLProperty, XMLPropertyRelation, XMLPropertyValue, XMLPropertyVariable, XMLRecursiveItemCategory, XMLResource, XMLRichTextEnvelope, XMLSection, XMLSet, XMLSetItems, XMLSetItemsData, XMLSetStyle, XMLSimplifiedProperty, XMLSpatialUnit, XMLString, XMLText, XMLTree, XMLWebsiteContext, XMLWebsiteContextItem, XMLWebsiteContextLevel, XMLWebsiteData, XMLWebsiteFilterContext, XMLWebsiteFilterContextItem, XMLWebsiteOptions, XMLWebsiteProperties, XMLWebsiteResource, XMLWebsiteResourceGroup, XMLWebsiteResourceItem, XMLWebsiteScope, XMLWebsiteSegment, XMLWebsiteStyle, XMLWebsiteTree };
3
3
  }
4
4
  export type XMLItemCategory = "tree" | "bibliography" | "spatialUnit" | "concept" | "period" | "person" | "propertyVariable" | "variable" | "propertyValue" | "value" | "text" | "resource" | "set";
5
5
  export type XMLRecursiveItemCategory = Exclude<XMLItemCategory, "tree" | "person" | "propertyVariable" | "propertyValue" | "set">;
@@ -215,6 +215,9 @@ export type XMLProperty = {
215
215
  payload?: string;
216
216
  }>;
217
217
  comment?: XMLContent;
218
+ styleProperties?: {
219
+ payload: string;
220
+ };
218
221
  property?: Array<XMLProperty>;
219
222
  };
220
223
  /**
@@ -741,6 +744,15 @@ export type XMLWebsiteTree = Omit<XMLTree, "items" | "properties"> & {
741
744
  resource?: Array<XMLWebsiteResourceItem>;
742
745
  };
743
746
  };
747
+ export type XMLSetStyle = Partial<XMLContent> & {
748
+ date?: Date;
749
+ authors?: {
750
+ author: Array<XMLPerson>;
751
+ };
752
+ properties?: {
753
+ property: Array<XMLProperty>;
754
+ };
755
+ };
744
756
  export type XMLSet = XMLBaseItem & {
745
757
  type?: string;
746
758
  suppressBlanks?: boolean;
@@ -753,6 +765,9 @@ export type XMLSet = XMLBaseItem & {
753
765
  properties?: {
754
766
  property: Array<XMLProperty>;
755
767
  };
768
+ styles?: {
769
+ style: Array<XMLSetStyle>;
770
+ };
756
771
  items?: {
757
772
  tree?: Array<XMLTree>;
758
773
  bibliography?: Array<XMLBibliography>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
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",
@@ -46,7 +46,7 @@
46
46
  ],
47
47
  "dependencies": {
48
48
  "fast-equals": "^6.0.4",
49
- "fast-xml-parser": "^5.11.1",
49
+ "fast-xml-parser": "^5.11.2",
50
50
  "valibot": "^1.5.0"
51
51
  },
52
52
  "devDependencies": {
@@ -56,12 +56,12 @@
56
56
  "eslint": "^10.11.0",
57
57
  "eslint-plugin-erasable-syntax-only": "^0.7.2",
58
58
  "eslint-plugin-slop": "^0.1.3",
59
- "eslint-plugin-sonarjs": "^4.2.1",
60
- "knip": "^6.38.0",
61
- "oxfmt": "^0.70.0",
59
+ "eslint-plugin-sonarjs": "^4.2.2",
60
+ "knip": "^6.39.0",
61
+ "oxfmt": "^0.71.0",
62
62
  "tsdown": "^0.23.0",
63
63
  "typescript": "^6.0.3",
64
- "vitest": "^5.0.2"
64
+ "vitest": "^5.0.3"
65
65
  },
66
66
  "scripts": {
67
67
  "dev": "tsdown src/index.ts --watch",