@digitalculture/ochre-sdk 0.5.13 → 0.5.15
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 +19 -7
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +19 -7
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1573,13 +1573,23 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1573
1573
|
break;
|
|
1574
1574
|
}
|
|
1575
1575
|
case "iframe": {
|
|
1576
|
-
const
|
|
1577
|
-
if (!
|
|
1576
|
+
const href = links.find((link) => link.type === "webpage")?.href;
|
|
1577
|
+
if (!href) {
|
|
1578
1578
|
throw new Error(
|
|
1579
1579
|
`URL not found for the following component: \u201C${componentName}\u201D`
|
|
1580
1580
|
);
|
|
1581
1581
|
}
|
|
1582
|
-
|
|
1582
|
+
const height = getPropertyValueByLabel(
|
|
1583
|
+
componentProperty.properties,
|
|
1584
|
+
"height"
|
|
1585
|
+
);
|
|
1586
|
+
const width = getPropertyValueByLabel(
|
|
1587
|
+
componentProperty.properties,
|
|
1588
|
+
"width"
|
|
1589
|
+
);
|
|
1590
|
+
properties.href = href;
|
|
1591
|
+
properties.height = height;
|
|
1592
|
+
properties.width = width;
|
|
1583
1593
|
break;
|
|
1584
1594
|
}
|
|
1585
1595
|
case "iiif-viewer": {
|
|
@@ -2312,7 +2322,7 @@ async function parseWebsite(websiteTree, projectName, website) {
|
|
|
2312
2322
|
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
2313
2323
|
) : [];
|
|
2314
2324
|
return resourceProperties.some(
|
|
2315
|
-
(property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0]
|
|
2325
|
+
(property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0].values[0]?.content === "sidebar"
|
|
2316
2326
|
);
|
|
2317
2327
|
});
|
|
2318
2328
|
if (sidebarResource) {
|
|
@@ -2556,10 +2566,12 @@ async function fetchPropertyValue(uuid) {
|
|
|
2556
2566
|
if (error !== null) {
|
|
2557
2567
|
throw new Error(error);
|
|
2558
2568
|
}
|
|
2559
|
-
if (!("
|
|
2560
|
-
throw new Error(
|
|
2569
|
+
if (!("propertyValue" in dataRaw.ochre)) {
|
|
2570
|
+
throw new Error(
|
|
2571
|
+
"Invalid OCHRE data: API response missing 'propertyValue' key"
|
|
2572
|
+
);
|
|
2561
2573
|
}
|
|
2562
|
-
const propertyValueItem = parsePropertyValue(dataRaw.ochre.
|
|
2574
|
+
const propertyValueItem = parsePropertyValue(dataRaw.ochre.propertyValue);
|
|
2563
2575
|
const data = {
|
|
2564
2576
|
uuid: parseFakeString(dataRaw.ochre.uuid),
|
|
2565
2577
|
publicationDateTime: new Date(dataRaw.ochre.publicationDateTime),
|
package/dist/index.d.cts
CHANGED
|
@@ -529,7 +529,9 @@ type WebElementComponent = {
|
|
|
529
529
|
width: string | null;
|
|
530
530
|
} | {
|
|
531
531
|
component: "iframe";
|
|
532
|
-
|
|
532
|
+
href: string;
|
|
533
|
+
height: string | null;
|
|
534
|
+
width: string | null;
|
|
533
535
|
} | {
|
|
534
536
|
component: "iiif-viewer";
|
|
535
537
|
IIIFId: string;
|
|
@@ -814,7 +816,7 @@ type OchreData = {
|
|
|
814
816
|
| { period: OchrePeriod }
|
|
815
817
|
| { bibliography: OchreBibliography }
|
|
816
818
|
| { person: OchrePerson }
|
|
817
|
-
| {
|
|
819
|
+
| { propertyValue: OchrePropertyValue }
|
|
818
820
|
);
|
|
819
821
|
};
|
|
820
822
|
|
package/dist/index.d.ts
CHANGED
|
@@ -529,7 +529,9 @@ type WebElementComponent = {
|
|
|
529
529
|
width: string | null;
|
|
530
530
|
} | {
|
|
531
531
|
component: "iframe";
|
|
532
|
-
|
|
532
|
+
href: string;
|
|
533
|
+
height: string | null;
|
|
534
|
+
width: string | null;
|
|
533
535
|
} | {
|
|
534
536
|
component: "iiif-viewer";
|
|
535
537
|
IIIFId: string;
|
|
@@ -814,7 +816,7 @@ type OchreData = {
|
|
|
814
816
|
| { period: OchrePeriod }
|
|
815
817
|
| { bibliography: OchreBibliography }
|
|
816
818
|
| { person: OchrePerson }
|
|
817
|
-
| {
|
|
819
|
+
| { propertyValue: OchrePropertyValue }
|
|
818
820
|
);
|
|
819
821
|
};
|
|
820
822
|
|
package/dist/index.js
CHANGED
|
@@ -1493,13 +1493,23 @@ async function parseWebElementProperties(componentProperty, elementResource) {
|
|
|
1493
1493
|
break;
|
|
1494
1494
|
}
|
|
1495
1495
|
case "iframe": {
|
|
1496
|
-
const
|
|
1497
|
-
if (!
|
|
1496
|
+
const href = links.find((link) => link.type === "webpage")?.href;
|
|
1497
|
+
if (!href) {
|
|
1498
1498
|
throw new Error(
|
|
1499
1499
|
`URL not found for the following component: \u201C${componentName}\u201D`
|
|
1500
1500
|
);
|
|
1501
1501
|
}
|
|
1502
|
-
|
|
1502
|
+
const height = getPropertyValueByLabel(
|
|
1503
|
+
componentProperty.properties,
|
|
1504
|
+
"height"
|
|
1505
|
+
);
|
|
1506
|
+
const width = getPropertyValueByLabel(
|
|
1507
|
+
componentProperty.properties,
|
|
1508
|
+
"width"
|
|
1509
|
+
);
|
|
1510
|
+
properties.href = href;
|
|
1511
|
+
properties.height = height;
|
|
1512
|
+
properties.width = width;
|
|
1503
1513
|
break;
|
|
1504
1514
|
}
|
|
1505
1515
|
case "iiif-viewer": {
|
|
@@ -2232,7 +2242,7 @@ async function parseWebsite(websiteTree, projectName, website) {
|
|
|
2232
2242
|
Array.isArray(resource.properties.property) ? resource.properties.property : [resource.properties.property]
|
|
2233
2243
|
) : [];
|
|
2234
2244
|
return resourceProperties.some(
|
|
2235
|
-
(property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0]
|
|
2245
|
+
(property) => property.label === "presentation" && property.values[0]?.content === "element" && property.properties[0]?.label === "component" && property.properties[0].values[0]?.content === "sidebar"
|
|
2236
2246
|
);
|
|
2237
2247
|
});
|
|
2238
2248
|
if (sidebarResource) {
|
|
@@ -2476,10 +2486,12 @@ async function fetchPropertyValue(uuid) {
|
|
|
2476
2486
|
if (error !== null) {
|
|
2477
2487
|
throw new Error(error);
|
|
2478
2488
|
}
|
|
2479
|
-
if (!("
|
|
2480
|
-
throw new Error(
|
|
2489
|
+
if (!("propertyValue" in dataRaw.ochre)) {
|
|
2490
|
+
throw new Error(
|
|
2491
|
+
"Invalid OCHRE data: API response missing 'propertyValue' key"
|
|
2492
|
+
);
|
|
2481
2493
|
}
|
|
2482
|
-
const propertyValueItem = parsePropertyValue(dataRaw.ochre.
|
|
2494
|
+
const propertyValueItem = parsePropertyValue(dataRaw.ochre.propertyValue);
|
|
2483
2495
|
const data = {
|
|
2484
2496
|
uuid: parseFakeString(dataRaw.ochre.uuid),
|
|
2485
2497
|
publicationDateTime: new Date(dataRaw.ochre.publicationDateTime),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalculture/ochre-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
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",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"zod": "^3.24.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@antfu/eslint-config": "^4.
|
|
47
|
+
"@antfu/eslint-config": "^4.12.0",
|
|
48
48
|
"@arethetypeswrong/cli": "^0.17.4",
|
|
49
|
-
"@changesets/cli": "^2.
|
|
49
|
+
"@changesets/cli": "^2.29.0",
|
|
50
50
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
51
|
-
"@types/node": "^22.14.
|
|
51
|
+
"@types/node": "^22.14.1",
|
|
52
52
|
"eslint": "^9.24.0",
|
|
53
53
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
54
54
|
"prettier": "^3.5.3",
|