@piveau/dpi 0.1.0-beta.40 → 0.1.0-beta.42

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.
@@ -1,11 +1,11 @@
1
1
  import "axios";
2
- import { asSomeArray as ot } from "../../composables/useDpiSimpleLoader.js";
2
+ import { asSomeArray as lt } from "../../composables/useDpiSimpleLoader.js";
3
3
  let e = { distribution: [], dataset: {}, meta: {} };
4
- function lt(t) {
4
+ function pt(t) {
5
5
  return t.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
6
6
  }
7
- async function ut(t, g, s, p) {
8
- var A, v, f, k, D, O, j, R, w, S, x, I, B, L, C, P, T, U, M, G, $, F, X, N, q, z, W, E, H, Y, _, J, K, Q, Z, m, V, tt, it, dt, et, at;
7
+ async function At(t, g, s, p) {
8
+ var A, v, f, k, D, O, j, R, w, S, I, x, L, B, U, C, P, T, M, G, $, F, X, N, q, z, W, E, H, Y, _, J, K, Q, Z, m, V, tt, it, dt, et, at, nt, ct;
9
9
  const u = g.specification.prefixes;
10
10
  let r = [];
11
11
  const o = Object.keys(t);
@@ -14,7 +14,7 @@ async function ut(t, g, s, p) {
14
14
  r.push(crypto.randomUUID()), e.dataset["dcat:distribution"].push({
15
15
  "@id": `https://piveau.io/set/distribution/${r[c]}`
16
16
  });
17
- const st = new URLSearchParams(window.location.search).get("edit");
17
+ const rt = new URLSearchParams(window.location.search).get("edit");
18
18
  let y = "";
19
19
  try {
20
20
  for (let c = 0; c < o.length; c++) {
@@ -33,9 +33,9 @@ async function ut(t, g, s, p) {
33
33
  if (o[c] === "BasicInfos") {
34
34
  e.dataset["dpi:isDPIv3"] = !0;
35
35
  for (let i = 0; i < Object.keys(t.BasicInfos).length; i++)
36
- Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = lt(
36
+ Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = pt(
37
37
  t.BasicInfos["dct:title"][0]["@value"]
38
- ), st === "true" && (y = t.BasicInfos.datasetID)), Object.keys(t.BasicInfos)[i] === "dct:description" && (e.dataset["dct:description"] = t.BasicInfos["dct:description"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:modified" && (e.dataset["dct:modified"] = t.BasicInfos["dct:modified"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:publisher" && (e.dataset["dct:publisher"] = t.BasicInfos["dct:publisher"][0] || "", e.dataset["dct:publisher"]["@type"] = "foaf:Agent"), Object.keys(t.BasicInfos)[i] === "dcat:contactPoint" && (e.dataset["dcat:contactPoint"] = t.BasicInfos["dcat:contactPoint"][0] || ""), e.dataset["@type"] = "dcat:Dataset", e.meta["dcat:catalog"] = s.permissions[0].rsname, e.meta["@type"] = "dcat:CatalogRecord";
38
+ ), rt === "true" && (y = t.BasicInfos.datasetID)), Object.keys(t.BasicInfos)[i] === "dct:description" && (e.dataset["dct:description"] = t.BasicInfos["dct:description"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:modified" && (e.dataset["dct:modified"] = t.BasicInfos["dct:modified"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:publisher" && (e.dataset["dct:publisher"] = t.BasicInfos["dct:publisher"][0] || "", e.dataset["dct:publisher"]["@type"] = "foaf:Agent"), Object.keys(t.BasicInfos)[i] === "dcat:contactPoint" && (e.dataset["dcat:contactPoint"] = t.BasicInfos["dcat:contactPoint"][0] || ""), e.dataset["@type"] = "dcat:Dataset", e.meta["dcat:catalog"] = s.permissions[0].rsname, e.meta["@type"] = "dcat:CatalogRecord";
39
39
  }
40
40
  if (o[c] === "Covering" && Object.keys(t.Covering).length > 1)
41
41
  for (let i = 0; i < Object.keys(t.Covering).length; i++) {
@@ -93,20 +93,20 @@ async function ut(t, g, s, p) {
93
93
  "@id": t.DistributionSimple["dcat:distribution"][i].policyItems[a]["dcat:downloadURL"]
94
94
  };
95
95
  }
96
- let d = (I = (x = t.DistributionSimple) == null ? void 0 : x["dct:license"]) == null ? void 0 : I[0];
97
- d === void 0 && (d = (P = (C = (L = (B = t.DistributionSimple) == null ? void 0 : B["dcat:distribution"]) == null ? void 0 : L[0]) == null ? void 0 : C["dct:license"]) == null ? void 0 : P[0]), e.distribution[i]["dct:license"] = {
96
+ let d = (x = (I = t.DistributionSimple) == null ? void 0 : I["dct:license"]) == null ? void 0 : x[0];
97
+ d === void 0 && (d = (C = (U = (B = (L = t.DistributionSimple) == null ? void 0 : L["dcat:distribution"]) == null ? void 0 : B[0]) == null ? void 0 : U["dct:license"]) == null ? void 0 : C[0]), e.distribution[i]["dct:license"] = {
98
98
  "@id": (d == null ? void 0 : d.uri) || ""
99
99
  }, e.distribution[i]["dcatde:licenseAttributionByText"] = {
100
100
  "@language": "de",
101
101
  "@value": (d == null ? void 0 : d.attribution) || ""
102
102
  };
103
- const b = (M = (U = (T = t.DistributionSimple) == null ? void 0 : T["dcat:distribution"]) == null ? void 0 : U[i]) == null ? void 0 : M["dct:format"];
103
+ const b = (M = (T = (P = t.DistributionSimple) == null ? void 0 : P["dcat:distribution"]) == null ? void 0 : T[i]) == null ? void 0 : M["dct:format"];
104
104
  b && (e.distribution[i]["dct:format"] = {
105
105
  "@id": (b == null ? void 0 : b.uri) || ""
106
106
  }), ((F = ($ = (G = t.DistributionSimple) == null ? void 0 : G["dcat:distribution"]) == null ? void 0 : $[i]) == null ? void 0 : F["dcatap:applicableLegislation"]) != null && (e.distribution[i]["dct:format"] = (q = (N = (X = t.DistributionSimple) == null ? void 0 : X["dcat:distribution"]) == null ? void 0 : N[i]) == null ? void 0 : q["dcatap:applicableLegislation"]["@id"]);
107
- const nt = ((E = (W = (z = t.DistributionSimple) == null ? void 0 : z["dcat:distribution"]) == null ? void 0 : W[i]) == null ? void 0 : E.conformsToItems) || [];
108
- if (nt && (e.distribution[i]["dct:conformsTo"] = ot(
109
- nt
107
+ const ot = ((E = (W = (z = t.DistributionSimple) == null ? void 0 : z["dcat:distribution"]) == null ? void 0 : W[i]) == null ? void 0 : E.conformsToItems) || [];
108
+ if (ot && (e.distribution[i]["dct:conformsTo"] = lt(
109
+ ot
110
110
  ).filter(
111
111
  (a) => a && (a["dcat:downloadURL"] || a["dct:title"])
112
112
  ).map((a) => ({
@@ -170,8 +170,11 @@ async function ut(t, g, s, p) {
170
170
  "@id": t.DistributionSimple["dcat:distribution"][i]["dct:language"][a].uri
171
171
  };
172
172
  }
173
- const ct = ((_ = (Y = (H = t.DistributionSimple) == null ? void 0 : H["dcat:distribution"]) == null ? void 0 : Y[i]) == null ? void 0 : _.accessServices) || [];
174
- ct && (e.distribution[i]["dcat:accessService"] = (J = ot(ct)) == null ? void 0 : J.filter(
173
+ t.DistributionSimple["dcat:distribution"][i]["adms:status"].uri !== "" && (e.distribution[i]["adms:status"] = {
174
+ "@id": t.DistributionSimple["dcat:distribution"][i]["adms:status"].uri || ""
175
+ });
176
+ const st = ((_ = (Y = (H = t.DistributionSimple) == null ? void 0 : H["dcat:distribution"]) == null ? void 0 : Y[i]) == null ? void 0 : _.accessServices) || [];
177
+ st && (e.distribution[i]["dcat:accessService"] = (J = lt(st)) == null ? void 0 : J.filter(
175
178
  (a) => a && (a["dct:title"] || a["dct:description"] || a["dcat:downloadURL"] || a["dcat:endpointURL"])
176
179
  ).map((a) => {
177
180
  const n = {
@@ -464,7 +467,7 @@ async function ut(t, g, s, p) {
464
467
  "foaf:homepage": t.Additionals["dct:contributor"][d]["foaf:homepage"]
465
468
  });
466
469
  }
467
- Object.keys(t.Additionals)[i] === "owl:versionInfo" && (e.dataset["owl:versionInfo"] = {
470
+ if (Object.keys(t.Additionals)[i] === "owl:versionInfo" && (e.dataset["owl:versionInfo"] = {
468
471
  "@value": t.Additionals["owl:versionInfo"][0]["@value"]
469
472
  }), Object.keys(t.Additionals)[i] === "dcatde:contributorID" && (e.dataset["dcatde:contributorID"] = {
470
473
  "@id": t.Additionals["dcatde:contributorID"][0].uri
@@ -480,7 +483,11 @@ async function ut(t, g, s, p) {
480
483
  }), Object.keys(t.Additionals)[i] === "dcat:temporalResolution" && (e.dataset["dcat:temporalResolution"] = {
481
484
  "@type": "http://www.w3.org/2001/XMLSchema#duration",
482
485
  "@value": `P${t.Additionals["dcat:temporalResolution"][0].Year}Y${t.Additionals["dcat:temporalResolution"][0].Month}M${t.Additionals["dcat:temporalResolution"][0].Day}D${t.Additionals["dcat:temporalResolution"][0].Hour}H${t.Additionals["dcat:temporalResolution"][0].Minute}M${t.Additionals["dcat:temporalResolution"][0].Second}S`
483
- });
486
+ }), Object.keys(t.Additionals)[i] === "dcatde:politicalGeocodingLevelURI")
487
+ for (let d = 0; d < t.Additionals["dcatde:politicalGeocodingLevelURI"].length; d++)
488
+ e.dataset["dcatde:politicalGeocodingLevelURI"] === void 0 && (e.dataset["dcatde:politicalGeocodingLevelURI"] = []), e.dataset["dcatde:politicalGeocodingLevelURI"].push({
489
+ "@id": ((ct = (nt = t.Additionals["dcatde:politicalGeocodingLevelURI"]) == null ? void 0 : nt[d]) == null ? void 0 : ct.uri) || ""
490
+ });
484
491
  }
485
492
  } catch (i) {
486
493
  throw console.error("Validation Error:", i.message), i;
@@ -489,7 +496,7 @@ async function ut(t, g, s, p) {
489
496
  } catch (c) {
490
497
  console.log(c);
491
498
  }
492
- let h = rt(e, u);
499
+ let h = bt(e, u);
493
500
  return { actionParams: {
494
501
  id: y,
495
502
  catalog: s.permissions[0].rsname,
@@ -498,7 +505,7 @@ async function ut(t, g, s, p) {
498
505
  description: e.dataset["dct:description"]["@value"]
499
506
  }, body: h };
500
507
  }
501
- function rt(t, g) {
508
+ function bt(t, g) {
502
509
  const s = {}, p = Object.keys(t);
503
510
  for (let o = 0; o < p.length; o++)
504
511
  p[o], s[p[o]] = t[p[o]];
@@ -518,5 +525,5 @@ function rt(t, g) {
518
525
  return console.log(r), r;
519
526
  }
520
527
  export {
521
- ut as default
528
+ At as default
522
529
  };
@@ -62,10 +62,6 @@ const a = {
62
62
  $formkit: "hvdPage",
63
63
  name: "hvdPage"
64
64
  },
65
- visibility: {
66
- $formkit: "visibilityPage",
67
- name: "visibilityPage"
68
- },
69
65
  overview: {
70
66
  $cmp: "OverviewPage",
71
67
  props: {
@@ -75,11 +71,24 @@ const a = {
75
71
  // Dcatap.de Properties #### Start ####
76
72
  politicalGeocodingLevelURI: {
77
73
  identifier: "politicalGeocodingLevelURI",
78
- $formkit: "auto",
79
74
  name: "dcatde:politicalGeocodingLevelURI",
80
- class: "property",
75
+ $formkit: "repeatable",
81
76
  voc: "political-geocoding-level",
82
- multiple: !0
77
+ children: [
78
+ {
79
+ identifier: "politicalGeocodingLevelURI",
80
+ name: "dcatde:politicalGeocodingLevelURI",
81
+ $formkit: "group",
82
+ children: [
83
+ {
84
+ name: "dcatde:politicalGeocodingLevelURI",
85
+ identifier: "politicalGeocodingLevelURI",
86
+ class: "property",
87
+ $formkit: "auto"
88
+ }
89
+ ]
90
+ }
91
+ ]
83
92
  },
84
93
  politicalGeocodingURI: {
85
94
  identifier: "politicalGeocodingURI",
@@ -894,9 +903,9 @@ const a = {
894
903
  identifier: "language",
895
904
  children: [
896
905
  {
897
- identifier: "languageURI",
898
- $formkit: "auto",
899
- name: "@id"
906
+ name: "dct:language",
907
+ identifier: "language",
908
+ $formkit: "auto"
900
909
  }
901
910
  ]
902
911
  }
@@ -1,7 +1,7 @@
1
1
  const e = {
2
2
  datasets: {
3
3
  Landing: ["landingpage"],
4
- Discoverability: ["discoverabilitypage", "hvd", "visibility"],
4
+ Discoverability: ["discoverabilitypage", "hvd"],
5
5
  BasicInfos: [
6
6
  "titelpage",
7
7
  "descriptionV3",