ochre-sdk 1.0.56 → 1.0.58
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/parsers/index.mjs
CHANGED
|
@@ -478,7 +478,7 @@ function parsePropertyValueContent(value, options) {
|
|
|
478
478
|
uuid: value.uuid == null || value.uuid === "" ? null : value.uuid,
|
|
479
479
|
publicationDateTime: value.publicationDateTime ?? null,
|
|
480
480
|
unit: value.unit ?? null,
|
|
481
|
-
href:
|
|
481
|
+
href: value.href ?? null,
|
|
482
482
|
height: value.height ?? null,
|
|
483
483
|
width: value.width ?? null,
|
|
484
484
|
fileSize: value.fileSize ?? null,
|
|
@@ -878,10 +878,22 @@ function parseWebpage(webpageResource, options, context, slugPrefix) {
|
|
|
878
878
|
returnWebpage.properties.isSidebarDisplayed = pageReader.valueOr("sidebar-displayed", true);
|
|
879
879
|
returnWebpage.properties.isBreadcrumbsDisplayed = pageReader.valueOr("breadcrumbs-displayed", false);
|
|
880
880
|
returnWebpage.properties.isNavbarSearchBarDisplayed = pageReader.valueOr("navbar-search-bar-displayed", true);
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
881
|
+
const redirectValue = pageReader.valueNode("redirect-to");
|
|
882
|
+
const redirectTarget = parseWebsiteLinkTarget(redirectValue, context);
|
|
883
|
+
if (redirectTarget != null) if (redirectValue?.href == null && redirectValue?.uuid != null) returnWebpage.properties.redirect = {
|
|
884
|
+
type: "page",
|
|
885
|
+
slug: redirectTarget,
|
|
886
|
+
uuid: redirectValue.uuid
|
|
887
|
+
};
|
|
888
|
+
else returnWebpage.properties.redirect = {
|
|
889
|
+
type: "url",
|
|
890
|
+
href: redirectTarget,
|
|
891
|
+
isExternal: redirectTarget.startsWith("http")
|
|
892
|
+
};
|
|
893
|
+
else if (redirectValue?.uuid != null) returnWebpage.properties.redirect = {
|
|
894
|
+
type: "item",
|
|
895
|
+
uuid: redirectValue.uuid,
|
|
896
|
+
pageType: "item"
|
|
885
897
|
};
|
|
886
898
|
}
|
|
887
899
|
if (imageLink != null) returnWebpage.properties.backgroundImage = {
|
package/dist/types/website.d.mts
CHANGED
|
@@ -203,8 +203,17 @@ type Webpage<T extends LanguageCodes = LanguageCodes> = {
|
|
|
203
203
|
isDisplayedInNavbar: boolean;
|
|
204
204
|
isNavbarSearchBarDisplayed: boolean;
|
|
205
205
|
redirect: {
|
|
206
|
+
type: "url";
|
|
206
207
|
href: string;
|
|
207
208
|
isExternal: boolean;
|
|
209
|
+
} | {
|
|
210
|
+
type: "page";
|
|
211
|
+
slug: string;
|
|
212
|
+
uuid: string;
|
|
213
|
+
} | {
|
|
214
|
+
type: "item";
|
|
215
|
+
uuid: string;
|
|
216
|
+
pageType: "item" | "entry";
|
|
208
217
|
} | null;
|
|
209
218
|
backgroundImage: WebImage<T> | null;
|
|
210
219
|
sidebar: WebSidebar<T> | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ochre-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
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",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"date-fns": "^4.4.0",
|
|
49
49
|
"fast-equals": "^6.0.0",
|
|
50
50
|
"fast-xml-parser": "^5.9.3",
|
|
51
|
-
"valibot": "^1.4.
|
|
51
|
+
"valibot": "^1.4.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@antfu/eslint-config": "^9.1.0",
|
|
55
55
|
"@types/node": "^24.13.2",
|
|
56
56
|
"bumpp": "^11.1.0",
|
|
57
|
-
"eslint": "^10.
|
|
58
|
-
"knip": "^6.
|
|
57
|
+
"eslint": "^10.6.0",
|
|
58
|
+
"knip": "^6.23.0",
|
|
59
59
|
"oxfmt": "^0.56.0",
|
|
60
60
|
"tsdown": "^0.22.3",
|
|
61
61
|
"typescript": "^6.0.3",
|