@digitalculture/ochre-sdk 0.5.4 → 0.5.5
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 +2 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -714,7 +714,7 @@ function parsePersons(persons) {
|
|
|
714
714
|
return returnPersons;
|
|
715
715
|
}
|
|
716
716
|
function parseLink(linkRaw) {
|
|
717
|
-
const links = "resource" in linkRaw ? linkRaw.resource : "concept" in linkRaw ? linkRaw.concept : "set" in linkRaw ? linkRaw.set : "tree" in linkRaw ? linkRaw.tree : "person" in linkRaw ? linkRaw.person : "bibliography" in linkRaw ? linkRaw.bibliography : "epigraphicUnit" in linkRaw ? linkRaw.epigraphicUnit : null;
|
|
717
|
+
const links = "resource" in linkRaw ? linkRaw.resource : "spatialUnit" in linkRaw ? linkRaw.spatialUnit : "concept" in linkRaw ? linkRaw.concept : "set" in linkRaw ? linkRaw.set : "tree" in linkRaw ? linkRaw.tree : "person" in linkRaw ? linkRaw.person : "bibliography" in linkRaw ? linkRaw.bibliography : "epigraphicUnit" in linkRaw ? linkRaw.epigraphicUnit : null;
|
|
718
718
|
if (!links) {
|
|
719
719
|
throw new Error(
|
|
720
720
|
`Invalid link provided: ${JSON.stringify(linkRaw, null, 2)}`
|
|
@@ -724,7 +724,7 @@ function parseLink(linkRaw) {
|
|
|
724
724
|
const returnLinks = [];
|
|
725
725
|
for (const link of linksToParse) {
|
|
726
726
|
const returnLink = {
|
|
727
|
-
category: "resource" in linkRaw ? "resource" : "concept" in linkRaw ? "concept" : "set" in linkRaw ? "set" : "person" in linkRaw ? "person" : "tree" in linkRaw ? "tree" : "bibliography" in linkRaw ? "bibliography" : "epigraphicUnit" in linkRaw ? "epigraphicUnit" : null,
|
|
727
|
+
category: "resource" in linkRaw ? "resource" : "spatialUnit" in linkRaw ? "spatialUnit" : "concept" in linkRaw ? "concept" : "set" in linkRaw ? "set" : "person" in linkRaw ? "person" : "tree" in linkRaw ? "tree" : "bibliography" in linkRaw ? "bibliography" : "epigraphicUnit" in linkRaw ? "epigraphicUnit" : null,
|
|
728
728
|
content: "content" in link ? link.content != null ? parseFakeString(link.content) : null : null,
|
|
729
729
|
href: "href" in link && link.href != null ? link.href : null,
|
|
730
730
|
uuid: link.uuid,
|
package/dist/index.d.cts
CHANGED
|
@@ -112,7 +112,7 @@ type Link = {
|
|
|
112
112
|
uuid: string;
|
|
113
113
|
publicationDateTime: Date | null;
|
|
114
114
|
type: string | null;
|
|
115
|
-
category: "resource" | "concept" | "set" | "tree" | "person" | "bibliography" | "epigraphicUnit" | null;
|
|
115
|
+
category: "resource" | "spatialUnit" | "concept" | "set" | "tree" | "person" | "bibliography" | "epigraphicUnit" | null;
|
|
116
116
|
identification: Identification | null;
|
|
117
117
|
content: string | null;
|
|
118
118
|
href: string | null;
|
|
@@ -1043,6 +1043,7 @@ type OchreLinkItem = {
|
|
|
1043
1043
|
*/
|
|
1044
1044
|
type OchreLink =
|
|
1045
1045
|
| { resource: OchreLinkItem | Array<OchreLinkItem> }
|
|
1046
|
+
| { spatialUnit: OchreLinkItem | Array<OchreLinkItem> }
|
|
1046
1047
|
| { concept: OchreLinkItem | Array<OchreLinkItem> }
|
|
1047
1048
|
| { set: OchreLinkItem | Array<OchreLinkItem> }
|
|
1048
1049
|
| { tree: OchreLinkItem | Array<OchreLinkItem> }
|
package/dist/index.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ type Link = {
|
|
|
112
112
|
uuid: string;
|
|
113
113
|
publicationDateTime: Date | null;
|
|
114
114
|
type: string | null;
|
|
115
|
-
category: "resource" | "concept" | "set" | "tree" | "person" | "bibliography" | "epigraphicUnit" | null;
|
|
115
|
+
category: "resource" | "spatialUnit" | "concept" | "set" | "tree" | "person" | "bibliography" | "epigraphicUnit" | null;
|
|
116
116
|
identification: Identification | null;
|
|
117
117
|
content: string | null;
|
|
118
118
|
href: string | null;
|
|
@@ -1043,6 +1043,7 @@ type OchreLinkItem = {
|
|
|
1043
1043
|
*/
|
|
1044
1044
|
type OchreLink =
|
|
1045
1045
|
| { resource: OchreLinkItem | Array<OchreLinkItem> }
|
|
1046
|
+
| { spatialUnit: OchreLinkItem | Array<OchreLinkItem> }
|
|
1046
1047
|
| { concept: OchreLinkItem | Array<OchreLinkItem> }
|
|
1047
1048
|
| { set: OchreLinkItem | Array<OchreLinkItem> }
|
|
1048
1049
|
| { tree: OchreLinkItem | Array<OchreLinkItem> }
|
package/dist/index.js
CHANGED
|
@@ -637,7 +637,7 @@ function parsePersons(persons) {
|
|
|
637
637
|
return returnPersons;
|
|
638
638
|
}
|
|
639
639
|
function parseLink(linkRaw) {
|
|
640
|
-
const links = "resource" in linkRaw ? linkRaw.resource : "concept" in linkRaw ? linkRaw.concept : "set" in linkRaw ? linkRaw.set : "tree" in linkRaw ? linkRaw.tree : "person" in linkRaw ? linkRaw.person : "bibliography" in linkRaw ? linkRaw.bibliography : "epigraphicUnit" in linkRaw ? linkRaw.epigraphicUnit : null;
|
|
640
|
+
const links = "resource" in linkRaw ? linkRaw.resource : "spatialUnit" in linkRaw ? linkRaw.spatialUnit : "concept" in linkRaw ? linkRaw.concept : "set" in linkRaw ? linkRaw.set : "tree" in linkRaw ? linkRaw.tree : "person" in linkRaw ? linkRaw.person : "bibliography" in linkRaw ? linkRaw.bibliography : "epigraphicUnit" in linkRaw ? linkRaw.epigraphicUnit : null;
|
|
641
641
|
if (!links) {
|
|
642
642
|
throw new Error(
|
|
643
643
|
`Invalid link provided: ${JSON.stringify(linkRaw, null, 2)}`
|
|
@@ -647,7 +647,7 @@ function parseLink(linkRaw) {
|
|
|
647
647
|
const returnLinks = [];
|
|
648
648
|
for (const link of linksToParse) {
|
|
649
649
|
const returnLink = {
|
|
650
|
-
category: "resource" in linkRaw ? "resource" : "concept" in linkRaw ? "concept" : "set" in linkRaw ? "set" : "person" in linkRaw ? "person" : "tree" in linkRaw ? "tree" : "bibliography" in linkRaw ? "bibliography" : "epigraphicUnit" in linkRaw ? "epigraphicUnit" : null,
|
|
650
|
+
category: "resource" in linkRaw ? "resource" : "spatialUnit" in linkRaw ? "spatialUnit" : "concept" in linkRaw ? "concept" : "set" in linkRaw ? "set" : "person" in linkRaw ? "person" : "tree" in linkRaw ? "tree" : "bibliography" in linkRaw ? "bibliography" : "epigraphicUnit" in linkRaw ? "epigraphicUnit" : null,
|
|
651
651
|
content: "content" in link ? link.content != null ? parseFakeString(link.content) : null : null,
|
|
652
652
|
href: "href" in link && link.href != null ? link.href : null,
|
|
653
653
|
uuid: link.uuid,
|
package/package.json
CHANGED