@piveau/dpi 0.2.0-alpha.14 → 0.2.0-alpha.16

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.
Files changed (70) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/AboutProject.vue.js +46 -48
  3. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/DPIHome.vue.js +48 -31
  4. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +107 -88
  5. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue.js +1 -1
  6. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js +86 -62
  7. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +36 -68
  8. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectDescriptionStep.vue.js +14 -14
  9. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectNameStep.vue.js +7 -4
  10. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectOrganisationStep.vue.js +2 -2
  11. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectOrganisationStep.vue2.js +26 -27
  12. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectStatusStep.vue.js +8 -8
  13. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataCollection/BasicInformationStep.vue.js +2 -2
  14. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataCollection/BasicInformationStep.vue2.js +19 -19
  15. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataProcessing/BasicInformationStep.vue.js +2 -2
  16. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataProcessing/BasicInformationStep.vue2.js +38 -39
  17. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataSimulation/BasicInformationStep.vue.js +2 -2
  18. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataSimulation/BasicInformationStep.vue2.js +72 -67
  19. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataVisualisation/BasicInformationStep.vue.js +1 -1
  20. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DataVisualisation/BasicInformationStep.vue2.js +84 -97
  21. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.js +103 -88
  22. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/ApplicationsStep.vue.js +2 -2
  23. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/ApplicationsStep.vue2.js +140 -116
  24. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/CategoriesStep.vue.js +2 -2
  25. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/CategoriesStep.vue2.js +36 -29
  26. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/DiscoverabilityStep.vue.js +11 -10
  27. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldDefinition.js +4 -3
  28. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldFormKit.vue.js +46 -40
  29. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/InputField.vue.js +144 -134
  30. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/OptionalDataStep/OptionalDataStep.vue.js +2 -2
  31. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/OptionalDataStep/OptionalDataStep.vue2.js +189 -155
  32. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/DatasetForm.vue.js +2 -2
  33. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/DatasetForm.vue2.js +44 -38
  34. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue.js +2 -2
  35. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue2.js +128 -123
  36. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/SoftwareForm.vue.js +2 -2
  37. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/SoftwareForm.vue2.js +50 -45
  38. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/utils.js +17 -17
  39. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +2 -2
  40. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +367 -379
  41. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +38 -71
  42. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue2.js +4 -0
  43. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +157 -141
  44. package/dist/packages/dpi/src/data-provider-interface/components/Spatial.vue.js +7 -0
  45. package/dist/packages/dpi/src/data-provider-interface/components/Spatial.vue2.js +172 -0
  46. package/dist/packages/dpi/src/data-provider-interface/components/SpatialPage.vue.js +7 -0
  47. package/dist/packages/dpi/src/data-provider-interface/components/SpatialPage.vue2.js +44 -0
  48. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +1 -1
  49. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +2 -2
  50. package/dist/packages/dpi/src/data-provider-interface/components/TheErrorDialog.vue.js +57 -46
  51. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/decodeProject.js +20 -20
  52. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/encodeProject.js +68 -70
  53. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiEditMode.js +61 -59
  54. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiSimpleLoader.js +185 -180
  55. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiStepper.js +60 -61
  56. package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +76 -46
  57. package/dist/packages/dpi/src/data-provider-interface/composables/useTwinbyHome.js +67 -34
  58. package/dist/packages/dpi/src/data-provider-interface/composables/useTwinbyUser.js +85 -0
  59. package/dist/packages/dpi/src/data-provider-interface/config/dcatapdeHappyFlow/converter.js +19 -19
  60. package/dist/packages/dpi/src/data-provider-interface/schema/projectLdSchema.js +98 -94
  61. package/dist/packages/dpi/src/data-provider-interface/views/InputPage.vue.js +333 -308
  62. package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +314 -307
  63. package/dist/packages/dpi/src/form/inputDefinitions.js +52 -53
  64. package/dist/packages/dpi/src/stories/components/PartnerCard.vue.js +2 -2
  65. package/dist/packages/dpi/src/stories/components/PartnerCard.vue2.js +14 -14
  66. package/dist/packages/dpi/src/stories/components/ScreenshotCard.vue.js +2 -2
  67. package/dist/packages/dpi/src/stories/components/ScreenshotCard.vue2.js +9 -8
  68. package/package.json +5 -5
  69. package/dist/packages/dpi/src/data-provider-interface/components/PolGeoUriPage.vue.js +0 -124
  70. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/__tests__/fixtures/theProjectForm.js +0 -281
@@ -1,35 +1,34 @@
1
- import { useStepper as G } from "@vueuse/core";
2
- import { ref as H, computed as i, provide as J } from "vue";
3
- import { dpiStepperKey as M } from "../utils/injectionKeys.js";
4
- import O from "../utils/useSteps.js";
5
- function Y(Q) {
6
- const { steps: p, activeStep: o, stepPlugin: B, visitedSteps: h, subSteps: A, triggerValidation: n, triggerValidationCurrentStep: u } = O(), s = H([]), e = G(s, o.value), r = () => {
7
- e.current.value && e.current.value !== o.value && (o.value = e.current.value);
8
- }, c = (t) => {
9
- s.value.includes(t) || (s.value.push(t), s.value.length === 1 && !o.value && (o.value = t, e.goTo(t)));
10
- }, v = () => {
11
- e.goToNext(), r();
1
+ import { useStepper as H } from "@vueuse/core";
2
+ import { ref as J, computed as r, provide as M } from "vue";
3
+ import { dpiStepperKey as O } from "../utils/injectionKeys.js";
4
+ import Q from "../utils/useSteps.js";
5
+ function Z(R) {
6
+ const { steps: p, activeStep: t, stepPlugin: y, visitedSteps: B, subSteps: A, triggerValidation: u, triggerValidationCurrentStep: n } = Q(), s = J([]), e = H(s, t.value), C = r(() => s.value[s.value.length - 1]), v = r(() => t.value === C.value), i = () => {
7
+ e.current.value && e.current.value !== t.value && (t.value = e.current.value);
8
+ }, c = (o) => {
9
+ s.value.includes(o) || (s.value.push(o), s.value.length === 1 && !t.value && (t.value = o, e.goTo(o)));
12
10
  }, a = () => {
13
- e.goToPrevious(), r();
14
- }, g = (t) => {
15
- e.goTo(t), r();
16
- }, C = (t) => {
17
- const y = e.at(t);
18
- y && (e.goTo(y), r());
19
- }, I = i(() => e.index.value), L = i(() => e.previous.value || ""), N = i(() => e.next.value || ""), {
20
- steps: V,
21
- stepNames: b,
22
- index: k,
23
- current: D,
24
- next: F,
25
- previous: K,
26
- isFirst: j,
27
- isLast: l,
28
- at: q,
29
- get: w,
11
+ e.goToNext(), i();
12
+ }, l = () => {
13
+ e.goToPrevious(), i();
14
+ }, g = (o) => {
15
+ e.goTo(o), i();
16
+ }, I = (o) => {
17
+ const h = e.at(o);
18
+ h && (e.goTo(h), i());
19
+ }, L = r(() => e.index.value), N = r(() => e.previous.value || ""), V = r(() => e.next.value || ""), {
20
+ steps: b,
21
+ stepNames: k,
22
+ index: D,
23
+ current: F,
24
+ next: K,
25
+ previous: j,
26
+ isFirst: q,
27
+ at: w,
28
+ get: z,
30
29
  goTo: S,
31
- goToNext: z,
32
- goToPrevious: E,
30
+ goToNext: E,
31
+ goToPrevious: G,
33
32
  goBackTo: T,
34
33
  isNext: f,
35
34
  isPrevious: x,
@@ -37,55 +36,55 @@ function Y(Q) {
37
36
  isBefore: m,
38
37
  isAfter: P
39
38
  } = e;
40
- return J(M, {
39
+ return M(O, {
41
40
  steps: p,
42
- activeStep: o,
41
+ activeStep: t,
43
42
  registerStep: c,
44
43
  goTo: S,
45
- goToNextStep: v,
46
- goToPreviousStep: a,
44
+ goToNextStep: a,
45
+ goToPreviousStep: l,
47
46
  goBackTo: T,
48
47
  isNext: f,
49
48
  isPrevious: x,
50
49
  isCurrent: d,
51
50
  isBefore: m,
52
51
  isAfter: P,
53
- triggerValidation: n,
54
- triggerValidationCurrentStep: u,
55
- isLast: l,
52
+ triggerValidation: u,
53
+ triggerValidationCurrentStep: n,
54
+ isLast: v,
56
55
  goToStep: g
57
56
  }), {
58
57
  // Original API for backward compatibility (form validation steps)
59
58
  steps: p,
60
59
  subSteps: A,
61
- activeStep: o,
62
- activeStepIndex: I,
63
- previousStep: L,
64
- nextStep: N,
65
- visitedSteps: h,
66
- stepPlugin: B,
60
+ activeStep: t,
61
+ activeStepIndex: L,
62
+ previousStep: N,
63
+ nextStep: V,
64
+ visitedSteps: B,
65
+ stepPlugin: y,
67
66
  stepList: s,
68
67
  registerStep: c,
69
- goToNextStep: v,
70
- goToPreviousStep: a,
68
+ goToNextStep: a,
69
+ goToPreviousStep: l,
71
70
  goToStep: g,
72
- goToStepByIndex: C,
73
- triggerValidation: n,
74
- triggerValidationCurrentStep: u,
71
+ goToStepByIndex: I,
72
+ triggerValidation: u,
73
+ triggerValidationCurrentStep: n,
75
74
  // Extended useStepper utilities
76
- stepperSteps: V,
77
- stepNames: b,
78
- index: k,
79
- current: D,
80
- next: F,
81
- previous: K,
82
- isFirst: j,
83
- isLast: l,
84
- at: q,
85
- get: w,
75
+ stepperSteps: b,
76
+ stepNames: k,
77
+ index: D,
78
+ current: F,
79
+ next: K,
80
+ previous: j,
81
+ isFirst: q,
82
+ isLast: v,
83
+ at: w,
84
+ get: z,
86
85
  goTo: S,
87
- goToNext: z,
88
- goToPrevious: E,
86
+ goToNext: E,
87
+ goToPrevious: G,
89
88
  goBackTo: T,
90
89
  isNext: f,
91
90
  isPrevious: x,
@@ -95,5 +94,5 @@ function Y(Q) {
95
94
  };
96
95
  }
97
96
  export {
98
- Y as useDpiStepper
97
+ Z as useDpiStepper
99
98
  };
@@ -1,65 +1,95 @@
1
- import { putResource as f } from "@piveau/sdk-core/hubRepo";
2
- import { useAsyncState as b } from "@vueuse/core";
3
- import { computed as g } from "vue";
4
- import { useStore as h } from "vuex";
5
- import { useRuntimeEnv as v } from "../../composables/useRuntimeEnv.js";
6
- import { slugify as y, encodeProject as k } from "./project-transformer/encodeProject.js";
7
- import { useEditModeInfo as I } from "./useDpiEditMode.js";
8
- import { useFormValues as E } from "./useDpiFormValues.js";
9
- async function S(m) {
10
- var l, e, a, p;
1
+ import { putResource as y } from "@piveau/sdk-core/hubRepo";
2
+ import { useAsyncState as E } from "@vueuse/core";
3
+ import { computed as I } from "vue";
4
+ import { useStore as $ } from "vuex";
5
+ import { useRuntimeEnv as j } from "../../composables/useRuntimeEnv.js";
6
+ import { slugify as S, encodeProject as U } from "./project-transformer/encodeProject.js";
7
+ import { useEditModeInfo as w } from "./useDpiEditMode.js";
8
+ import { useFormValues as P } from "./useDpiFormValues.js";
9
+ import { useErrorDialog as T } from "./useErrorDialog.js";
10
+ import { useTwinbyUser as D } from "./useTwinbyUser.js";
11
+ async function M(d) {
12
+ var r, t, i, f;
11
13
  const {
12
- baseUrl: o,
13
- formValues: t,
14
- isEditMode: s,
15
- editIdQuery: i,
16
- authToken: u,
17
- catalogId: n
18
- } = m, c = s ? i : y((e = (l = t.value) == null ? void 0 : l["Grundlegende Informationen/Name"]) == null ? void 0 : e.projectName), d = k(t.value, { language: "de" });
19
- let r = (p = (a = t.value) == null ? void 0 : a["Auffindbarkeit/Sichtbarkeit"]) == null ? void 0 : p.visibility;
20
- r || (r = "public"), await f({
21
- id: c,
14
+ baseUrl: u,
15
+ formValues: e,
16
+ isEditMode: m,
17
+ editIdQuery: p,
18
+ authToken: v,
19
+ catalogId: s
20
+ } = d, n = m ? p : S((t = (r = e.value) == null ? void 0 : r["Grundlegende Informationen/Name"]) == null ? void 0 : t.projectName), a = U(e.value, { language: "de" });
21
+ let o = (f = (i = e.value) == null ? void 0 : i["Auffindbarkeit/Sichtbarkeit"]) == null ? void 0 : f.visibility;
22
+ o || (o = "public"), await y({
23
+ id: n,
22
24
  // todo
23
25
  // publicationStatus: editFromDraft.value ? 'draft' : 'published',
24
26
  publicationStatus: "draft",
25
- baseUrl: o || "https://twin.bydata.de/api/hub/repo",
27
+ baseUrl: u || "https://twin.bydata.de/api/hub/repo",
26
28
  type: "project",
27
- data: d,
28
- accessLevel: r,
29
- catalogId: n || "catalog-1",
30
- authToken: u
29
+ data: a,
30
+ accessLevel: o,
31
+ catalogId: s || "catalog-1",
32
+ authToken: v
31
33
  });
32
34
  }
33
- function Q(m) {
34
- const o = h(), {
35
- onSuccess: t = () => {
36
- o.dispatch("snackbar/showSnackbar", {
35
+ function L(d) {
36
+ var b, g, h, k;
37
+ const u = $(), e = j(), { openErrorDialog: m } = T(), {
38
+ onSuccess: p = () => {
39
+ u.dispatch("snackbar/showSnackbar", {
37
40
  message: "Projekt erfolgreich gespeichert",
38
41
  variant: "success"
39
42
  });
40
43
  },
41
- onError: s
42
- } = {}, { formValues: i } = E(), u = g(() => {
43
- var e, a;
44
- return (a = (e = o.getters) == null ? void 0 : e["auth/getUserData"]) == null ? void 0 : a.authToken;
45
- }), { editIdQuery: n, isEditMode: c, catalogId: d } = I(), r = v();
44
+ onError: v
45
+ } = d || {}, { formValues: s } = P(), { organization: n, catalogProject: a } = D({
46
+ keycloak: ((g = (b = e.authentication) == null ? void 0 : b.keycloak) == null ? void 0 : g.url) || "https://keycloak.twin.bydata.de",
47
+ realm: ((k = (h = e.authentication) == null ? void 0 : h.keycloak) == null ? void 0 : k.realm) || "piveau",
48
+ audience: "piveau-hub-repo"
49
+ }), o = I(() => {
50
+ var c, l;
51
+ return (l = (c = u.getters) == null ? void 0 : c["auth/getUserData"]) == null ? void 0 : l.authToken;
52
+ }), { editIdQuery: r, isEditMode: t, catalogId: i } = w();
46
53
  return {
47
- submitDraft: b(async () => {
48
- await S({
49
- formValues: i,
50
- isEditMode: c.value,
51
- editIdQuery: n.value,
52
- authToken: u.value,
53
- baseUrl: r.api.hubUrl,
54
- catalogId: d.value
54
+ submitDraft: E(async () => {
55
+ await M({
56
+ formValues: s,
57
+ isEditMode: t.value,
58
+ editIdQuery: r.value,
59
+ authToken: o.value,
60
+ baseUrl: e.api.hubUrl,
61
+ catalogId: t.value ? i.value : a.value
55
62
  });
56
63
  }, null, {
57
64
  immediate: !1,
58
- onSuccess: t,
59
- onError: s
60
- })
65
+ onSuccess: p,
66
+ onError: (c) => {
67
+ const l = new Error(
68
+ `Fehler beim Speichern des Projekts: ${c}
69
+
70
+ ${JSON.stringify(s.value)}
71
+
72
+ authToken: ${o.value}
73
+
74
+ catalogId: ${i.value}
75
+
76
+ isEditMode: ${t.value}
77
+
78
+ editIdQuery: ${r.value}
79
+
80
+ baseUrl: ${e.api.hubUrl}
81
+
82
+ catalogProject: ${a.value}
83
+
84
+ organization: ${n.value}`
85
+ );
86
+ m(l);
87
+ }
88
+ }),
89
+ organization: n,
90
+ catalogProject: a
61
91
  };
62
92
  }
63
93
  export {
64
- Q as useProjectActions
94
+ L as useProjectActions
65
95
  };
@@ -1,50 +1,83 @@
1
- import { defineHubSearch as P, getTranslationFor as f } from "@piveau/sdk-vue";
2
- import * as i from "zod";
3
- import { schemaProject as C } from "../../utils/schema/schemaProject.js";
4
- function S(g) {
5
- const h = "project", b = P(
1
+ import { schemaDataset as D } from "@piveau/sdk-core";
2
+ import { defineHubSearch as P, dcatApDataset as x, getTranslationFor as _ } from "@piveau/sdk-vue";
3
+ import * as s from "zod";
4
+ import { schemaProject as v } from "../../utils/schema/schemaProject.js";
5
+ const d = s.object({
6
+ accessControlPermissions: s.array(s.enum(["view", "edit", "publish", "delete"])).optional(),
7
+ catalog_record: s.object({
8
+ modified: s.string().optional(),
9
+ status: s.string().optional(),
10
+ access_level: s.enum(["public", "restricted", "internal", "private"]).optional(),
11
+ publication_status: s.enum(["draft", "published"]).optional()
12
+ })
13
+ });
14
+ function y(f) {
15
+ const g = "project", a = P(
6
16
  {
7
- baseUrl: g,
17
+ baseUrl: f,
8
18
  index: "resource",
9
19
  indexDetails: "resources/project",
10
- schema: C.extend({
11
- accessControlPermissions: i.array(i.enum(["view", "edit", "publish", "delete"])).optional(),
12
- catalog_record: i.object({
13
- modified: i.string().optional(),
14
- status: i.string().optional(),
15
- access_level: i.enum(["public", "restricted", "internal", "private"]).optional(),
16
- publication_status: i.enum(["draft", "published"]).optional()
17
- })
18
- }),
20
+ schema: v.extend(d.shape),
19
21
  facets: ["theme"]
20
22
  },
21
- (s, _) => {
22
- var n, l, e, d, u, m, t, o;
23
- const { currentLocale: a } = _;
23
+ (i, b) => {
24
+ var l, o, e, u, c, m, r, h;
25
+ const { currentLocale: n } = b;
24
26
  return {
25
27
  ...{
26
- id: s.id,
27
- title: typeof (s == null ? void 0 : s.name) == "string" ? s.name : f(s.name, a),
28
- description: typeof (s == null ? void 0 : s.description) == "string" ? s.description : f(s.description, a),
29
- accessControlPermissions: s == null ? void 0 : s.accessControlPermissions,
30
- allowEdit: (n = s == null ? void 0 : s.accessControlPermissions) == null ? void 0 : n.includes("edit"),
31
- allowPublish: (l = s == null ? void 0 : s.accessControlPermissions) == null ? void 0 : l.includes("publish"),
32
- allowDelete: (e = s == null ? void 0 : s.accessControlPermissions) == null ? void 0 : e.includes("delete"),
33
- modified: s == null ? void 0 : s.modified,
34
- status: (d = s == null ? void 0 : s.catalog_record) == null ? void 0 : d.status,
35
- accessLevel: (u = s == null ? void 0 : s.catalog_record) == null ? void 0 : u.access_level,
36
- publicationStatus: (m = s == null ? void 0 : s.catalog_record) == null ? void 0 : m.publication_status,
37
- catalogId: (t = s == null ? void 0 : s.catalog) == null ? void 0 : t.id,
38
- superCatalogId: (o = s == null ? void 0 : s.catalog) == null ? void 0 : o.is_part_of
28
+ id: i.id,
29
+ title: typeof (i == null ? void 0 : i.name) == "string" ? i.name : _(i.name, n),
30
+ description: typeof (i == null ? void 0 : i.description) == "string" ? i.description : _(i.description, n),
31
+ accessControlPermissions: i == null ? void 0 : i.accessControlPermissions,
32
+ allowEdit: (l = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : l.includes("edit"),
33
+ allowPublish: (o = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : o.includes("publish"),
34
+ allowDelete: (e = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : e.includes("delete"),
35
+ modified: i == null ? void 0 : i.modified,
36
+ status: (u = i == null ? void 0 : i.catalog_record) == null ? void 0 : u.status,
37
+ accessLevel: (c = i == null ? void 0 : i.catalog_record) == null ? void 0 : c.access_level,
38
+ publicationStatus: (m = i == null ? void 0 : i.catalog_record) == null ? void 0 : m.publication_status,
39
+ catalogId: (r = i == null ? void 0 : i.catalog) == null ? void 0 : r.id,
40
+ superCatalogId: (h = i == null ? void 0 : i.catalog) == null ? void 0 : h.is_part_of
39
41
  }
40
42
  };
41
43
  }
42
44
  );
43
45
  return {
44
- resource: h,
45
- ...b
46
+ resource: g,
47
+ ...a
48
+ };
49
+ }
50
+ function E(f) {
51
+ const g = "dataset", a = P({
52
+ baseUrl: f,
53
+ index: g,
54
+ indexDetails: "datasets",
55
+ schema: D.extend(d.shape)
56
+ }, (i, b) => {
57
+ var l, o, e, u, c, m, r, h;
58
+ const n = x().setup(i, b);
59
+ return {
60
+ id: n.getId,
61
+ title: n.getTitle,
62
+ description: n.getDescription,
63
+ accessControlPermissions: i == null ? void 0 : i.accessControlPermissions,
64
+ allowEdit: (l = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : l.includes("edit"),
65
+ allowPublish: (o = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : o.includes("publish"),
66
+ allowDelete: (e = i == null ? void 0 : i.accessControlPermissions) == null ? void 0 : e.includes("delete"),
67
+ modified: (i == null ? void 0 : i.modified) || "",
68
+ status: (u = i == null ? void 0 : i.catalog_record) == null ? void 0 : u.status,
69
+ accessLevel: (c = i == null ? void 0 : i.catalog_record) == null ? void 0 : c.access_level,
70
+ publicationStatus: (m = i == null ? void 0 : i.catalog_record) == null ? void 0 : m.publication_status,
71
+ catalogId: (r = i == null ? void 0 : i.catalog) == null ? void 0 : r.id,
72
+ superCatalogId: (h = i == null ? void 0 : i.catalog) == null ? void 0 : h.is_part_of
73
+ };
74
+ });
75
+ return {
76
+ resource: g,
77
+ ...a
46
78
  };
47
79
  }
48
80
  export {
49
- S as useProjectSearch
81
+ E as useDatasetSearch,
82
+ y as useProjectSearch
50
83
  };
@@ -0,0 +1,85 @@
1
+ import { createGlobalState as x, useAsyncState as T } from "@vueuse/core";
2
+ import b from "axios";
3
+ import z from "qs";
4
+ import { computed as i, toValue as h, watch as y, onBeforeUnmount as A, ref as P } from "vue";
5
+ import { useStore as _ } from "vuex";
6
+ const S = x(() => {
7
+ const u = P([]), e = i(() => {
8
+ var t;
9
+ return ((t = u.value.find((o) => o.rsname.endsWith("-orga"))) == null ? void 0 : t.rsname) || "";
10
+ }), d = i(() => e.value ? e.value.replace("-orga", "-projects") : ""), p = i(() => e.value ? e.value.replace("-orga", "-datasets") : ""), r = i(() => {
11
+ var m;
12
+ if (!e.value)
13
+ return [];
14
+ const t = ((m = u.value.find((c) => c.rsname === e.value)) == null ? void 0 : m.scopes) || [], o = (c, l) => c.every((n) => l.includes(n)), s = [];
15
+ return o(["catalog:update", "catalog:create", "catalog:delete"], t) && s.push("organizationAdmin"), t.includes("dataset:view_published") && s.push("dataViewer"), o(["dataset:delete", "dataset:view_draft", "dataset:publish"], t) && s.push("dataPublisher"), o(["dataset:view_draft", "dataset:create", "dataset:update"], t) && s.push("dataExpert"), s;
16
+ }), v = i(() => r.value.includes("dataExpert") || r.value.includes("organizationAdmin"));
17
+ return {
18
+ permissions: u,
19
+ organization: e,
20
+ catalogProject: d,
21
+ catalogDataset: p,
22
+ userRoles: r,
23
+ allowedToCreate: v
24
+ };
25
+ });
26
+ function $(u) {
27
+ const {
28
+ keycloak: e,
29
+ realm: d,
30
+ audience: p
31
+ } = u, { permissions: r, organization: v, catalogProject: t, catalogDataset: o, userRoles: s, allowedToCreate: m } = S(), c = _(), l = i(() => {
32
+ var a, g;
33
+ return (g = (a = c.getters) == null ? void 0 : a["auth/getUserData"]) == null ? void 0 : g.authToken;
34
+ }), n = T(async () => (await b.post(
35
+ `${h(e)}/realms/${h(d)}/protocol/openid-connect/token`,
36
+ z.stringify({
37
+ grant_type: "urn:ietf:params:oauth:grant-type:uma-ticket",
38
+ audience: h(p),
39
+ response_mode: "permissions"
40
+ }),
41
+ {
42
+ headers: {
43
+ "Content-Type": "application/x-www-form-urlencoded",
44
+ Authorization: `Bearer ${l.value}`
45
+ }
46
+ }
47
+ )).data, void 0, {
48
+ immediate: !1
49
+ });
50
+ let f = null;
51
+ function k() {
52
+ f = y(() => h(l), (a, g) => {
53
+ a !== g && n.execute();
54
+ }, {
55
+ immediate: !0
56
+ });
57
+ }
58
+ function w() {
59
+ f == null || f();
60
+ }
61
+ return y(() => n.state.value, (a) => {
62
+ a && n.isReady.value && (r.value = a || []);
63
+ }, {
64
+ immediate: !0
65
+ }), A(() => {
66
+ w();
67
+ }), {
68
+ authToken: l,
69
+ keycloak: e,
70
+ realm: d,
71
+ audience: p,
72
+ fetchPermissions: n,
73
+ organization: v,
74
+ catalogProject: t,
75
+ catalogDataset: o,
76
+ userRoles: s,
77
+ startFetchPermissions: k,
78
+ stopFetchPermissions: w,
79
+ permissions: r,
80
+ allowedToCreate: m
81
+ };
82
+ }
83
+ export {
84
+ $ as useTwinbyUser
85
+ };
@@ -1,11 +1,11 @@
1
1
  import "axios";
2
- import { asSomeArray as ct } from "../../composables/useDpiSimpleLoader.js";
2
+ import { asSomeArray as ot } from "../../composables/useDpiSimpleLoader.js";
3
3
  let e = { distribution: [], dataset: {}, meta: {} };
4
- function st(t) {
4
+ function lt(t) {
5
5
  return t.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
6
6
  }
7
- async function yt(t, g, s, p) {
8
- var h, v, f, k, D, O, j, R, w, S, x, I, B, C, P, T, L, U, M, G, $, F, N, X, q, z, W, E, H, Y, J, K, _, Q, Z, m, V, tt, it, dt, et;
7
+ async function ut(t, g, s, p) {
8
+ var h, v, f, k, D, O, j, R, w, S, x, I, B, C, P, T, L, U, M, G, $, F, N, X, q, z, W, E, H, Y, J, K, _, Q, Z, m, V, tt, it, dt, et, at;
9
9
  const u = g.specification.prefixes;
10
10
  let r = [];
11
11
  const o = Object.keys(t);
@@ -14,7 +14,7 @@ async function yt(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 ot = new URLSearchParams(window.location.search).get("edit");
17
+ const st = 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 yt(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 = st(
36
+ Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = lt(
37
37
  t.BasicInfos["dct:title"][0]["@value"]
38
- ), ot === "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
+ ), 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";
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++) {
@@ -87,9 +87,9 @@ async function yt(t, g, s, p) {
87
87
  b && (e.distribution[i]["dct:format"] = {
88
88
  "@id": (b == null ? void 0 : b.uri) || ""
89
89
  }), (($ = (G = (M = t.DistributionSimple) == null ? void 0 : M["dcat:distribution"]) == null ? void 0 : G[i]) == null ? void 0 : $["dcatap:applicableLegislation"]) != null && (e.distribution[i]["dct:format"] = (X = (N = (F = t.DistributionSimple) == null ? void 0 : F["dcat:distribution"]) == null ? void 0 : N[i]) == null ? void 0 : X["dcatap:applicableLegislation"]["@id"]);
90
- const at = ((W = (z = (q = t.DistributionSimple) == null ? void 0 : q["dcat:distribution"]) == null ? void 0 : z[i]) == null ? void 0 : W.conformsToItems) || [];
91
- if (at && (e.distribution[i]["dct:conformsTo"] = ct(
92
- at
90
+ const nt = ((W = (z = (q = t.DistributionSimple) == null ? void 0 : q["dcat:distribution"]) == null ? void 0 : z[i]) == null ? void 0 : W.conformsToItems) || [];
91
+ if (nt && (e.distribution[i]["dct:conformsTo"] = ot(
92
+ nt
93
93
  ).filter(
94
94
  (a) => a && (a["dcat:downloadURL"] || a["dct:title"])
95
95
  ).map((a) => ({
@@ -153,8 +153,8 @@ async function yt(t, g, s, p) {
153
153
  "@id": t.DistributionSimple["dcat:distribution"][i]["dct:language"][a].uri
154
154
  };
155
155
  }
156
- const nt = ((Y = (H = (E = t.DistributionSimple) == null ? void 0 : E["dcat:distribution"]) == null ? void 0 : H[i]) == null ? void 0 : Y.accessServices) || [];
157
- nt && (e.distribution[i]["dcat:accessService"] = (J = ct(nt)) == null ? void 0 : J.filter(
156
+ const ct = ((Y = (H = (E = t.DistributionSimple) == null ? void 0 : E["dcat:distribution"]) == null ? void 0 : H[i]) == null ? void 0 : Y.accessServices) || [];
157
+ ct && (e.distribution[i]["dcat:accessService"] = (J = ot(ct)) == null ? void 0 : J.filter(
158
158
  (a) => a && (a["dct:title"] || a["dct:description"] || a["dcat:downloadURL"] || a["dcat:endpointURL"])
159
159
  ).map((a) => {
160
160
  const n = {
@@ -173,7 +173,7 @@ async function yt(t, g, s, p) {
173
173
  "@id": l
174
174
  }), n;
175
175
  })), e.distribution[i]["foaf:page"] || (e.distribution[i]["foaf:page"] = []);
176
- for (let a = 0; a < ((Q = (_ = (K = t.DistributionSimple) == null ? void 0 : K["dcat:distribution"]) == null ? void 0 : _[i]) == null ? void 0 : Q.documentations.length); a++) {
176
+ for (let a = 0; a < ((Z = (Q = (_ = (K = t.DistributionSimple) == null ? void 0 : K["dcat:distribution"]) == null ? void 0 : _[i]) == null ? void 0 : Q.documentations) == null ? void 0 : Z.length); a++) {
177
177
  const n = t.DistributionSimple["dcat:distribution"][i].documentations[a];
178
178
  if ((n == null ? void 0 : n["dct:title"]) !== void 0) {
179
179
  const l = {
@@ -220,7 +220,7 @@ async function yt(t, g, s, p) {
220
220
  for (let d = 0; d < t.Additionals["dcat:keyword"].length; d++)
221
221
  e.dataset["dcat:keyword"] === void 0 && (e.dataset["dcat:keyword"] = []), e.dataset["dcat:keyword"].push({
222
222
  "@value": t.Additionals["dcat:keyword"][d]["@value"],
223
- "@language": ((m = (Z = t.Additionals["dcat:keyword"]) == null ? void 0 : Z[d]) == null ? void 0 : m["@language"]) || "de"
223
+ "@language": ((V = (m = t.Additionals["dcat:keyword"]) == null ? void 0 : m[d]) == null ? void 0 : V["@language"]) || "de"
224
224
  });
225
225
  }
226
226
  if (Object.keys(t.Additionals)[i] === "dct:references") {
@@ -302,7 +302,7 @@ async function yt(t, g, s, p) {
302
302
  for (let d = 0; d < t.Additionals["dcatde:legalBasis"].length; d++)
303
303
  e.dataset["dcatde:legalBasis"] === void 0 && (e.dataset["dcatde:legalBasis"] = []), e.dataset["dcatde:legalBasis"].push({
304
304
  "@value": t.Additionals["dcatde:legalBasis"][d]["@value"],
305
- "@language": ((it = (tt = (V = t.Additionals) == null ? void 0 : V["dcatde:legalBasis"]) == null ? void 0 : tt[d]) == null ? void 0 : it["@language"]) || "de"
305
+ "@language": ((dt = (it = (tt = t.Additionals) == null ? void 0 : tt["dcatde:legalBasis"]) == null ? void 0 : it[d]) == null ? void 0 : dt["@language"]) || "de"
306
306
  });
307
307
  }
308
308
  if (Object.keys(t.Additionals)[i] === "dct:relation") {
@@ -427,7 +427,7 @@ async function yt(t, g, s, p) {
427
427
  for (let d = 0; d < t.Additionals["foaf:page"].length; d++)
428
428
  e.dataset["foaf:page"] === void 0 && (e.dataset["foaf:page"] = []), e.dataset["foaf:page"].push({
429
429
  "dct:format": {
430
- "@id": (et = (dt = t.Additionals["foaf:page"]) == null ? void 0 : dt[d]) == null ? void 0 : et.uri
430
+ "@id": (at = (et = t.Additionals["foaf:page"]) == null ? void 0 : et[d]) == null ? void 0 : at.uri
431
431
  },
432
432
  "dct:title": t.Additionals["foaf:page"][d]["dct:title"],
433
433
  "dct:description": t.Additionals["foaf:page"][d]["dct:description"],
@@ -469,7 +469,7 @@ async function yt(t, g, s, p) {
469
469
  } catch (c) {
470
470
  console.log(c);
471
471
  }
472
- let A = lt(e, u);
472
+ let A = rt(e, u);
473
473
  return { actionParams: {
474
474
  id: y,
475
475
  catalog: s.permissions[0].rsname,
@@ -478,7 +478,7 @@ async function yt(t, g, s, p) {
478
478
  description: e.dataset["dct:description"]["@value"]
479
479
  }, body: A };
480
480
  }
481
- function lt(t, g) {
481
+ function rt(t, g) {
482
482
  const s = {}, p = Object.keys(t);
483
483
  for (let o = 0; o < p.length; o++)
484
484
  p[o], s[p[o]] = t[p[o]];
@@ -498,5 +498,5 @@ function lt(t, g) {
498
498
  return console.log(r), r;
499
499
  }
500
500
  export {
501
- yt as default
501
+ ut as default
502
502
  };