@digitalculture/ochre-sdk 0.12.1 → 0.12.2
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.mjs +2 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { writeFileSync } from "node:fs";
|
|
3
2
|
|
|
4
3
|
//#region src/schemas.ts
|
|
5
4
|
/**
|
|
@@ -2670,7 +2669,7 @@ function parseContexts(contexts) {
|
|
|
2670
2669
|
}
|
|
2671
2670
|
return contextsParsed;
|
|
2672
2671
|
}
|
|
2673
|
-
function parseWebsite(websiteTree, projectName, website
|
|
2672
|
+
function parseWebsite(websiteTree, projectName, website, { isVersion2 = false } = {}) {
|
|
2674
2673
|
if (!websiteTree.properties) throw new Error("Website properties not found");
|
|
2675
2674
|
const properties = parseWebsiteProperties(Array.isArray(websiteTree.properties.property) ? websiteTree.properties.property : [websiteTree.properties.property]);
|
|
2676
2675
|
if (typeof websiteTree.items === "string" || !("resource" in websiteTree.items)) throw new Error("Website pages not found");
|
|
@@ -2684,7 +2683,7 @@ function parseWebsite(websiteTree, projectName, website$1, { isVersion2 = false
|
|
|
2684
2683
|
identification: parseIdentification(websiteTree.identification),
|
|
2685
2684
|
project: {
|
|
2686
2685
|
name: parseFakeString(projectName),
|
|
2687
|
-
website: website
|
|
2686
|
+
website: website !== null ? parseFakeString(website) : null
|
|
2688
2687
|
},
|
|
2689
2688
|
creators: websiteTree.creators ? parsePersons(Array.isArray(websiteTree.creators.creator) ? websiteTree.creators.creator : [websiteTree.creators.creator]) : [],
|
|
2690
2689
|
license: parseLicense(websiteTree.availability),
|
|
@@ -3153,8 +3152,6 @@ async function fetchWebsite(abbreviation, options) {
|
|
|
3153
3152
|
return [error instanceof Error ? error.message : "Unknown error", null];
|
|
3154
3153
|
}
|
|
3155
3154
|
}
|
|
3156
|
-
const [_, website] = await fetchWebsite("bengali-song");
|
|
3157
|
-
writeFileSync("website.json", JSON.stringify(website, null, 2));
|
|
3158
3155
|
|
|
3159
3156
|
//#endregion
|
|
3160
3157
|
export { fetchByUuidMetadata, fetchGallery, fetchItem, fetchPropertyQuery, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
|
package/package.json
CHANGED