@digitalculture/ochre-sdk 0.1.24 → 0.1.26

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
@@ -1002,6 +1002,9 @@ function parseBibliography(bibliography) {
1002
1002
  resource,
1003
1003
  documentUrl: bibliography.sourceDocument ? `https://ochre.lib.uchicago.edu/ochre?uuid=${bibliography.sourceDocument.uuid}&load` : null
1004
1004
  },
1005
+ periods: bibliography.periods ? parsePeriods(
1006
+ Array.isArray(bibliography.periods.period) ? bibliography.periods.period : [bibliography.periods.period]
1007
+ ) : [],
1005
1008
  authors: bibliography.authors ? parsePersons(
1006
1009
  Array.isArray(bibliography.authors.person) ? bibliography.authors.person : [bibliography.authors.person]
1007
1010
  ) : [],
@@ -1901,7 +1904,7 @@ async function fetchBibliography(uuid) {
1901
1904
  metadata: parseMetadata(dataRaw.ochre.metadata),
1902
1905
  item: bibliographyItem
1903
1906
  };
1904
- return { metadata: data.metadata, resource: data.item };
1907
+ return { metadata: data.metadata, bibliography: data.item };
1905
1908
  } catch (error) {
1906
1909
  console.error(error);
1907
1910
  return null;
@@ -2007,7 +2010,7 @@ async function fetchPeriod(uuid) {
2007
2010
  metadata: parseMetadata(dataRaw.ochre.metadata),
2008
2011
  item: periodItem
2009
2012
  };
2010
- return { metadata: data.metadata, resource: data.item };
2013
+ return { metadata: data.metadata, period: data.item };
2011
2014
  } catch (error) {
2012
2015
  console.error(error);
2013
2016
  return null;
package/dist/index.d.cts CHANGED
@@ -319,6 +319,7 @@ type Bibliography = {
319
319
  resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
320
320
  documentUrl: string | null;
321
321
  };
322
+ periods: Array<Period>;
322
323
  authors: Array<Person>;
323
324
  properties: Array<Property>;
324
325
  };
@@ -560,7 +561,7 @@ type Style = {
560
561
  */
561
562
  declare function fetchBibliography(uuid: string): Promise<{
562
563
  metadata: Metadata;
563
- resource: Bibliography;
564
+ bibliography: Bibliography;
564
565
  } | null>;
565
566
 
566
567
  /**
@@ -1030,6 +1031,7 @@ type OchreBibliography = {
1030
1031
  "uuid" | "type" | "publicationDateTime" | "identification"
1031
1032
  >;
1032
1033
  };
1034
+ periods?: { period: OchrePeriod | Array<OchrePeriod> };
1033
1035
  authors?: { person: OchrePerson | Array<OchrePerson> };
1034
1036
  properties?: { property: OchreProperty | Array<OchreProperty> };
1035
1037
  };
@@ -1213,7 +1215,7 @@ declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string,
1213
1215
  */
1214
1216
  declare function fetchPeriod(uuid: string): Promise<{
1215
1217
  metadata: Metadata;
1216
- resource: Period;
1218
+ period: Period;
1217
1219
  } | null>;
1218
1220
 
1219
1221
  /**
package/dist/index.d.ts CHANGED
@@ -319,6 +319,7 @@ type Bibliography = {
319
319
  resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
320
320
  documentUrl: string | null;
321
321
  };
322
+ periods: Array<Period>;
322
323
  authors: Array<Person>;
323
324
  properties: Array<Property>;
324
325
  };
@@ -560,7 +561,7 @@ type Style = {
560
561
  */
561
562
  declare function fetchBibliography(uuid: string): Promise<{
562
563
  metadata: Metadata;
563
- resource: Bibliography;
564
+ bibliography: Bibliography;
564
565
  } | null>;
565
566
 
566
567
  /**
@@ -1030,6 +1031,7 @@ type OchreBibliography = {
1030
1031
  "uuid" | "type" | "publicationDateTime" | "identification"
1031
1032
  >;
1032
1033
  };
1034
+ periods?: { period: OchrePeriod | Array<OchrePeriod> };
1033
1035
  authors?: { person: OchrePerson | Array<OchrePerson> };
1034
1036
  properties?: { property: OchreProperty | Array<OchreProperty> };
1035
1037
  };
@@ -1213,7 +1215,7 @@ declare function fetchByUuid(uuid: string): Promise<[null, OchreData] | [string,
1213
1215
  */
1214
1216
  declare function fetchPeriod(uuid: string): Promise<{
1215
1217
  metadata: Metadata;
1216
- resource: Period;
1218
+ period: Period;
1217
1219
  } | null>;
1218
1220
 
1219
1221
  /**
package/dist/index.js CHANGED
@@ -925,6 +925,9 @@ function parseBibliography(bibliography) {
925
925
  resource,
926
926
  documentUrl: bibliography.sourceDocument ? `https://ochre.lib.uchicago.edu/ochre?uuid=${bibliography.sourceDocument.uuid}&load` : null
927
927
  },
928
+ periods: bibliography.periods ? parsePeriods(
929
+ Array.isArray(bibliography.periods.period) ? bibliography.periods.period : [bibliography.periods.period]
930
+ ) : [],
928
931
  authors: bibliography.authors ? parsePersons(
929
932
  Array.isArray(bibliography.authors.person) ? bibliography.authors.person : [bibliography.authors.person]
930
933
  ) : [],
@@ -1824,7 +1827,7 @@ async function fetchBibliography(uuid) {
1824
1827
  metadata: parseMetadata(dataRaw.ochre.metadata),
1825
1828
  item: bibliographyItem
1826
1829
  };
1827
- return { metadata: data.metadata, resource: data.item };
1830
+ return { metadata: data.metadata, bibliography: data.item };
1828
1831
  } catch (error) {
1829
1832
  console.error(error);
1830
1833
  return null;
@@ -1930,7 +1933,7 @@ async function fetchPeriod(uuid) {
1930
1933
  metadata: parseMetadata(dataRaw.ochre.metadata),
1931
1934
  item: periodItem
1932
1935
  };
1933
- return { metadata: data.metadata, resource: data.item };
1936
+ return { metadata: data.metadata, period: data.item };
1934
1937
  } catch (error) {
1935
1938
  console.error(error);
1936
1939
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
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",