@digitalculture/ochre-sdk 0.5.18 → 0.5.19

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.cjs CHANGED
@@ -589,23 +589,6 @@ var websiteSchema = import_zod3.z.object({
589
589
  { message: "Invalid website privacy" }
590
590
  )
591
591
  });
592
- var resourceTypeSchema = import_zod3.z.enum(
593
- [
594
- "audio",
595
- "document",
596
- "drawing",
597
- "FITS",
598
- "geospatial",
599
- "IIIF",
600
- "image",
601
- "model",
602
- "PTM",
603
- "TEI",
604
- "video",
605
- "webpage"
606
- ],
607
- { message: "Invalid resource type" }
608
- );
609
592
  var componentSchema = import_zod3.z.enum(
610
593
  [
611
594
  "annotated-document",
@@ -1040,13 +1023,10 @@ function parsePeriods(periods) {
1040
1023
  function parseBibliography(bibliography) {
1041
1024
  let resource = null;
1042
1025
  if (bibliography.source?.resource) {
1043
- const resourceType = resourceTypeSchema.parse(
1044
- bibliography.source.resource.type
1045
- );
1046
1026
  resource = {
1047
1027
  uuid: bibliography.source.resource.uuid,
1048
1028
  publicationDateTime: bibliography.source.resource.publicationDateTime ? new Date(bibliography.source.resource.publicationDateTime) : null,
1049
- type: resourceType,
1029
+ type: bibliography.source.resource.type,
1050
1030
  identification: parseIdentification(
1051
1031
  bibliography.source.resource.identification
1052
1032
  )
@@ -1289,12 +1269,11 @@ function parseSet(set) {
1289
1269
  };
1290
1270
  }
1291
1271
  function parseResource(resource, isNested = false) {
1292
- const resourceType = resourceTypeSchema.parse(resource.type);
1293
1272
  const returnResource = {
1294
1273
  uuid: resource.uuid,
1295
1274
  category: "resource",
1296
1275
  publicationDateTime: resource.publicationDateTime ? new Date(resource.publicationDateTime) : null,
1297
- type: resourceType,
1276
+ type: resource.type,
1298
1277
  number: resource.n,
1299
1278
  format: resource.format ?? null,
1300
1279
  context: "context" in resource && resource.context ? parseContext(resource.context) : null,
package/dist/index.d.cts CHANGED
@@ -199,10 +199,6 @@ type Footnote = {
199
199
  label: string;
200
200
  content: string;
201
201
  };
202
- /**
203
- * Represents the type of a resource
204
- */
205
- type ResourceType = "audio" | "document" | "drawing" | "FITS" | "geospatial" | "IIIF" | "image" | "model" | "PTM" | "TEI" | "video" | "webpage";
206
202
  /**
207
203
  * Represents a resource item with associated metadata, content and relationships
208
204
  */
@@ -210,7 +206,7 @@ type Resource = {
210
206
  uuid: string;
211
207
  category: "resource";
212
208
  publicationDateTime: Date | null;
213
- type: ResourceType;
209
+ type: string;
214
210
  number: number;
215
211
  context: Context | null;
216
212
  license: License | null;
@@ -1947,4 +1943,4 @@ declare function parseStringDocumentItem(item: OchreStringRichTextItem, footnote
1947
1943
  */
1948
1944
  declare function parseStringContent(content: OchreStringContent, language?: string): string;
1949
1945
 
1950
- export { type Bibliography, type Concept, type Context, type ContextItem, type ContextNode, type Coordinates, type Data, type Document, type Event, type Footnote, type Gallery, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type License, type Link, type Metadata, type NestedConcept, type NestedResource, type NestedSpatialUnit, type Note, type Observation, type Period, type Person, type Property, type PropertyValue, type PropertyValueContent, type PropertyValueContentType, type Resource, type ResourceType, type Set, type SpatialUnit, type Style, type Tree, type WebBlock, type WebElement, type WebElementComponent, type WebImage, type Webpage, type WebpageProperties, type Website, type WebsiteProperties, fetchBibliography, fetchByUuid, fetchConcept, fetchGallery, fetchPeriod, fetchPropertyValue, fetchResource, fetchSet, fetchSpatialUnit, fetchTree, fetchWebsite, filterProperties, getAllPropertyLabels, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
1946
+ export { type Bibliography, type Concept, type Context, type ContextItem, type ContextNode, type Coordinates, type Data, type Document, type Event, type Footnote, type Gallery, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type License, type Link, type Metadata, type NestedConcept, type NestedResource, type NestedSpatialUnit, type Note, type Observation, type Period, type Person, type Property, type PropertyValue, type PropertyValueContent, type PropertyValueContentType, type Resource, type Set, type SpatialUnit, type Style, type Tree, type WebBlock, type WebElement, type WebElementComponent, type WebImage, type Webpage, type WebpageProperties, type Website, type WebsiteProperties, fetchBibliography, fetchByUuid, fetchConcept, fetchGallery, fetchPeriod, fetchPropertyValue, fetchResource, fetchSet, fetchSpatialUnit, fetchTree, fetchWebsite, filterProperties, getAllPropertyLabels, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
package/dist/index.d.ts CHANGED
@@ -199,10 +199,6 @@ type Footnote = {
199
199
  label: string;
200
200
  content: string;
201
201
  };
202
- /**
203
- * Represents the type of a resource
204
- */
205
- type ResourceType = "audio" | "document" | "drawing" | "FITS" | "geospatial" | "IIIF" | "image" | "model" | "PTM" | "TEI" | "video" | "webpage";
206
202
  /**
207
203
  * Represents a resource item with associated metadata, content and relationships
208
204
  */
@@ -210,7 +206,7 @@ type Resource = {
210
206
  uuid: string;
211
207
  category: "resource";
212
208
  publicationDateTime: Date | null;
213
- type: ResourceType;
209
+ type: string;
214
210
  number: number;
215
211
  context: Context | null;
216
212
  license: License | null;
@@ -1947,4 +1943,4 @@ declare function parseStringDocumentItem(item: OchreStringRichTextItem, footnote
1947
1943
  */
1948
1944
  declare function parseStringContent(content: OchreStringContent, language?: string): string;
1949
1945
 
1950
- export { type Bibliography, type Concept, type Context, type ContextItem, type ContextNode, type Coordinates, type Data, type Document, type Event, type Footnote, type Gallery, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type License, type Link, type Metadata, type NestedConcept, type NestedResource, type NestedSpatialUnit, type Note, type Observation, type Period, type Person, type Property, type PropertyValue, type PropertyValueContent, type PropertyValueContentType, type Resource, type ResourceType, type Set, type SpatialUnit, type Style, type Tree, type WebBlock, type WebElement, type WebElementComponent, type WebImage, type Webpage, type WebpageProperties, type Website, type WebsiteProperties, fetchBibliography, fetchByUuid, fetchConcept, fetchGallery, fetchPeriod, fetchPropertyValue, fetchResource, fetchSet, fetchSpatialUnit, fetchTree, fetchWebsite, filterProperties, getAllPropertyLabels, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
1946
+ export { type Bibliography, type Concept, type Context, type ContextItem, type ContextNode, type Coordinates, type Data, type Document, type Event, type Footnote, type Gallery, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type License, type Link, type Metadata, type NestedConcept, type NestedResource, type NestedSpatialUnit, type Note, type Observation, type Period, type Person, type Property, type PropertyValue, type PropertyValueContent, type PropertyValueContentType, type Resource, type Set, type SpatialUnit, type Style, type Tree, type WebBlock, type WebElement, type WebElementComponent, type WebImage, type Webpage, type WebpageProperties, type Website, type WebsiteProperties, fetchBibliography, fetchByUuid, fetchConcept, fetchGallery, fetchPeriod, fetchPropertyValue, fetchResource, fetchSet, fetchSpatialUnit, fetchTree, fetchWebsite, filterProperties, getAllPropertyLabels, getPropertyByLabel, getPropertyValueByLabel, getPropertyValuesByLabel, parseBibliographies, parseBibliography, parseConcept, parseConcepts, parseContext, parseCoordinates, parseDocument, parseEmail, parseEvents, parseFakeString, parseIdentification, parseImage, parseImageMap, parseInterpretations, parseLanguages, parseLicense, parseLink, parseLinks, parseMetadata, parseNotes, parseObservation, parseObservations, parsePeriod, parsePeriods, parsePerson, parsePersons, parseProperties, parseProperty, parsePropertyValue, parsePropertyValues, parseResource, parseResources, parseSet, parseSpatialUnit, parseSpatialUnits, parseStringContent, parseStringDocumentItem, parseStringItem, parseTree, parseWebsite };
package/dist/index.js CHANGED
@@ -508,23 +508,6 @@ var websiteSchema = z3.object({
508
508
  { message: "Invalid website privacy" }
509
509
  )
510
510
  });
511
- var resourceTypeSchema = z3.enum(
512
- [
513
- "audio",
514
- "document",
515
- "drawing",
516
- "FITS",
517
- "geospatial",
518
- "IIIF",
519
- "image",
520
- "model",
521
- "PTM",
522
- "TEI",
523
- "video",
524
- "webpage"
525
- ],
526
- { message: "Invalid resource type" }
527
- );
528
511
  var componentSchema = z3.enum(
529
512
  [
530
513
  "annotated-document",
@@ -959,13 +942,10 @@ function parsePeriods(periods) {
959
942
  function parseBibliography(bibliography) {
960
943
  let resource = null;
961
944
  if (bibliography.source?.resource) {
962
- const resourceType = resourceTypeSchema.parse(
963
- bibliography.source.resource.type
964
- );
965
945
  resource = {
966
946
  uuid: bibliography.source.resource.uuid,
967
947
  publicationDateTime: bibliography.source.resource.publicationDateTime ? new Date(bibliography.source.resource.publicationDateTime) : null,
968
- type: resourceType,
948
+ type: bibliography.source.resource.type,
969
949
  identification: parseIdentification(
970
950
  bibliography.source.resource.identification
971
951
  )
@@ -1208,12 +1188,11 @@ function parseSet(set) {
1208
1188
  };
1209
1189
  }
1210
1190
  function parseResource(resource, isNested = false) {
1211
- const resourceType = resourceTypeSchema.parse(resource.type);
1212
1191
  const returnResource = {
1213
1192
  uuid: resource.uuid,
1214
1193
  category: "resource",
1215
1194
  publicationDateTime: resource.publicationDateTime ? new Date(resource.publicationDateTime) : null,
1216
- type: resourceType,
1195
+ type: resource.type,
1217
1196
  number: resource.n,
1218
1197
  format: resource.format ?? null,
1219
1198
  context: "context" in resource && resource.context ? parseContext(resource.context) : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
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",