@digitalculture/ochre-sdk 0.5.12 → 0.5.14

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
@@ -1027,10 +1027,16 @@ function parsePropertyValue(propertyValue) {
1027
1027
  category: "propertyValue",
1028
1028
  n: propertyValue.n,
1029
1029
  publicationDateTime: propertyValue.publicationDateTime ? new Date(propertyValue.publicationDateTime) : null,
1030
+ context: propertyValue.context ? parseContext(propertyValue.context) : null,
1031
+ availability: propertyValue.availability ? parseLicense(propertyValue.availability) : null,
1030
1032
  identification: parseIdentification(propertyValue.identification),
1031
- description: ["string", "number", "boolean"].includes(
1033
+ date: propertyValue.date ? new Date(propertyValue.date) : null,
1034
+ creators: propertyValue.creators ? parsePersons(
1035
+ Array.isArray(propertyValue.creators.creator) ? propertyValue.creators.creator : [propertyValue.creators.creator]
1036
+ ) : [],
1037
+ description: propertyValue.description ? ["string", "number", "boolean"].includes(
1032
1038
  typeof propertyValue.description
1033
- ) ? parseFakeString(propertyValue.description) : parseStringContent(propertyValue.description),
1039
+ ) ? parseFakeString(propertyValue.description) : parseStringContent(propertyValue.description) : "",
1034
1040
  notes: propertyValue.notes ? parseNotes(
1035
1041
  Array.isArray(propertyValue.notes.note) ? propertyValue.notes.note : [propertyValue.notes.note]
1036
1042
  ) : [],
package/dist/index.d.cts CHANGED
@@ -351,7 +351,11 @@ type PropertyValue = {
351
351
  category: "propertyValue";
352
352
  n: number;
353
353
  publicationDateTime: Date | null;
354
+ context: Context | null;
355
+ availability: License | null;
354
356
  identification: Identification;
357
+ date: Date | null;
358
+ creators: Array<Person>;
355
359
  description: string;
356
360
  notes: Array<Note>;
357
361
  links: Array<Link>;
@@ -1285,10 +1289,14 @@ type OchreInterpretation = {
1285
1289
  */
1286
1290
  type OchrePropertyValue = {
1287
1291
  uuid: string;
1292
+ publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1288
1293
  n: number;
1289
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ss
1294
+ context?: OchreContext;
1295
+ availability?: OchreLicense;
1290
1296
  identification: OchreIdentification;
1291
- description: OchreStringContent | FakeString;
1297
+ date?: string; // YYYY-MM-DD
1298
+ creators?: { creator: OchrePerson | Array<OchrePerson> };
1299
+ description?: OchreStringContent | FakeString;
1292
1300
  notes?: { note: OchreNote | Array<OchreNote> };
1293
1301
  links?: OchreLink | Array<OchreLink>;
1294
1302
  };
package/dist/index.d.ts CHANGED
@@ -351,7 +351,11 @@ type PropertyValue = {
351
351
  category: "propertyValue";
352
352
  n: number;
353
353
  publicationDateTime: Date | null;
354
+ context: Context | null;
355
+ availability: License | null;
354
356
  identification: Identification;
357
+ date: Date | null;
358
+ creators: Array<Person>;
355
359
  description: string;
356
360
  notes: Array<Note>;
357
361
  links: Array<Link>;
@@ -1285,10 +1289,14 @@ type OchreInterpretation = {
1285
1289
  */
1286
1290
  type OchrePropertyValue = {
1287
1291
  uuid: string;
1292
+ publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
1288
1293
  n: number;
1289
- publicationDateTime?: string; // YYYY-MM-DDThh:mm:ss
1294
+ context?: OchreContext;
1295
+ availability?: OchreLicense;
1290
1296
  identification: OchreIdentification;
1291
- description: OchreStringContent | FakeString;
1297
+ date?: string; // YYYY-MM-DD
1298
+ creators?: { creator: OchrePerson | Array<OchrePerson> };
1299
+ description?: OchreStringContent | FakeString;
1292
1300
  notes?: { note: OchreNote | Array<OchreNote> };
1293
1301
  links?: OchreLink | Array<OchreLink>;
1294
1302
  };
package/dist/index.js CHANGED
@@ -947,10 +947,16 @@ function parsePropertyValue(propertyValue) {
947
947
  category: "propertyValue",
948
948
  n: propertyValue.n,
949
949
  publicationDateTime: propertyValue.publicationDateTime ? new Date(propertyValue.publicationDateTime) : null,
950
+ context: propertyValue.context ? parseContext(propertyValue.context) : null,
951
+ availability: propertyValue.availability ? parseLicense(propertyValue.availability) : null,
950
952
  identification: parseIdentification(propertyValue.identification),
951
- description: ["string", "number", "boolean"].includes(
953
+ date: propertyValue.date ? new Date(propertyValue.date) : null,
954
+ creators: propertyValue.creators ? parsePersons(
955
+ Array.isArray(propertyValue.creators.creator) ? propertyValue.creators.creator : [propertyValue.creators.creator]
956
+ ) : [],
957
+ description: propertyValue.description ? ["string", "number", "boolean"].includes(
952
958
  typeof propertyValue.description
953
- ) ? parseFakeString(propertyValue.description) : parseStringContent(propertyValue.description),
959
+ ) ? parseFakeString(propertyValue.description) : parseStringContent(propertyValue.description) : "",
954
960
  notes: propertyValue.notes ? parseNotes(
955
961
  Array.isArray(propertyValue.notes.note) ? propertyValue.notes.note : [propertyValue.notes.note]
956
962
  ) : [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.5.12",
3
+ "version": "0.5.14",
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",