@digitalculture/ochre-sdk 0.1.27 → 0.1.29

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
@@ -1972,14 +1972,16 @@ async function fetchGallery(uuid, filter, page, perPage) {
1972
1972
  if (!("gallery" in data.result)) {
1973
1973
  throw new Error("Failed to fetch gallery");
1974
1974
  }
1975
- const galleryIdentification = parseIdentification(data.result.gallery.item);
1975
+ const galleryIdentification = parseIdentification(
1976
+ data.result.gallery.item.identification
1977
+ );
1976
1978
  const galleryProjectIdentification = parseIdentification(
1977
1979
  data.result.gallery.project.identification
1978
1980
  );
1979
1981
  const gallery = {
1980
1982
  identification: galleryIdentification,
1981
1983
  projectIdentification: galleryProjectIdentification,
1982
- resources: Array.isArray(data.result.gallery.resource) ? parseResources(data.result.gallery.resource) : [parseResource(data.result.gallery.resource)],
1984
+ resources: data.result.gallery.resource ? Array.isArray(data.result.gallery.resource) ? parseResources(data.result.gallery.resource) : [parseResource(data.result.gallery.resource)] : [],
1983
1985
  maxLength: data.result.gallery.maxLength
1984
1986
  };
1985
1987
  return gallery;
package/dist/index.js CHANGED
@@ -1895,14 +1895,16 @@ async function fetchGallery(uuid, filter, page, perPage) {
1895
1895
  if (!("gallery" in data.result)) {
1896
1896
  throw new Error("Failed to fetch gallery");
1897
1897
  }
1898
- const galleryIdentification = parseIdentification(data.result.gallery.item);
1898
+ const galleryIdentification = parseIdentification(
1899
+ data.result.gallery.item.identification
1900
+ );
1899
1901
  const galleryProjectIdentification = parseIdentification(
1900
1902
  data.result.gallery.project.identification
1901
1903
  );
1902
1904
  const gallery = {
1903
1905
  identification: galleryIdentification,
1904
1906
  projectIdentification: galleryProjectIdentification,
1905
- resources: Array.isArray(data.result.gallery.resource) ? parseResources(data.result.gallery.resource) : [parseResource(data.result.gallery.resource)],
1907
+ resources: data.result.gallery.resource ? Array.isArray(data.result.gallery.resource) ? parseResources(data.result.gallery.resource) : [parseResource(data.result.gallery.resource)] : [],
1906
1908
  maxLength: data.result.gallery.maxLength
1907
1909
  };
1908
1910
  return gallery;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
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",