@plitzi/sdk-shared 0.38.19 → 0.38.21
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/CHANGELOG.md +170 -0
- package/dist/actions/access.d.ts +5 -0
- package/dist/actions/access.mjs +11 -2
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.mjs +10 -9
- package/dist/actions/jobs.d.ts +10 -0
- package/dist/actions/jobs.mjs +17 -0
- package/dist/actions/validateDocument.mjs +56 -56
- package/dist/dataSource/globalSources.d.ts +1 -1
- package/dist/navigation/routes.mjs +38 -37
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +4 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +70 -68
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.d.ts +10 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +4 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +2 -0
- package/dist/network/graphql/builder/Queries/index.mjs +16 -14
- package/dist/realtime/index.d.ts +1 -1
- package/dist/realtime/index.mjs +4 -4
- package/dist/realtime/topics.d.ts +5 -0
- package/dist/realtime/topics.mjs +11 -11
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.mjs +12 -11
- package/dist/schema/pageAccess.d.ts +41 -0
- package/dist/schema/pageAccess.mjs +54 -0
- package/dist/store/storeHooks.d.ts +33 -33
- package/dist/store/tracing/tracingCollector.d.ts +1 -1
- package/dist/types/ActionTypes.d.ts +0 -204
- package/dist/types/FunctionTypes.d.ts +66 -0
- package/dist/types/JobTypes.d.ts +327 -0
- package/dist/types/JobTypes.mjs +0 -0
- package/dist/types/ServerTypes.d.ts +13 -3
- package/dist/types/SpaceTypes.d.ts +5 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/vite.config.ts +9 -7
- package/dist/helpers/twigWrapper/bench.bench.d.ts +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { accessRefusal as e } from "../actions/access.mjs";
|
|
2
|
+
//#region src/schema/pageAccess.ts
|
|
3
|
+
var t = (e) => {
|
|
4
|
+
let t = e?.access;
|
|
5
|
+
if (typeof t != "object" || !t || !("permissions" in t)) return;
|
|
6
|
+
let { permissions: n } = t;
|
|
7
|
+
if (!Array.isArray(n)) return;
|
|
8
|
+
let r = n.filter((e) => typeof e == "string" && e !== "");
|
|
9
|
+
return r.length > 0 ? { permissions: r } : void 0;
|
|
10
|
+
}, n = (t, n) => t ? e({
|
|
11
|
+
mode: "role",
|
|
12
|
+
permissions: t.permissions
|
|
13
|
+
}, n) : void 0, r = "withheld", i = (e) => {
|
|
14
|
+
let t = e?.[r];
|
|
15
|
+
return t === "unauthenticated" || t === "forbidden" ? t : void 0;
|
|
16
|
+
}, a = (e, i) => {
|
|
17
|
+
let a = /* @__PURE__ */ new Map(), o = [];
|
|
18
|
+
for (let r of e.pages) {
|
|
19
|
+
let s = t(e.flat[r]?.attributes);
|
|
20
|
+
if (!s) continue;
|
|
21
|
+
let c = n(s, i);
|
|
22
|
+
c ? a.set(r, c) : o.push(s);
|
|
23
|
+
}
|
|
24
|
+
if (a.size === 0) return {
|
|
25
|
+
schema: e,
|
|
26
|
+
withheld: [],
|
|
27
|
+
kept: o
|
|
28
|
+
};
|
|
29
|
+
let s = {};
|
|
30
|
+
for (let [t, n] of Object.entries(e.flat)) {
|
|
31
|
+
let e = a.get(t);
|
|
32
|
+
e ? s[t] = {
|
|
33
|
+
...n,
|
|
34
|
+
attributes: {
|
|
35
|
+
...n.attributes,
|
|
36
|
+
[r]: e
|
|
37
|
+
},
|
|
38
|
+
definition: {
|
|
39
|
+
...n.definition,
|
|
40
|
+
items: []
|
|
41
|
+
}
|
|
42
|
+
} : t !== n.definition.rootId && a.has(n.definition.rootId) || (s[t] = n);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
schema: {
|
|
46
|
+
...e,
|
|
47
|
+
flat: s
|
|
48
|
+
},
|
|
49
|
+
withheld: [...a.keys()],
|
|
50
|
+
kept: o
|
|
51
|
+
};
|
|
52
|
+
}, o = (e, t) => e.every((e) => n(e, t) === void 0);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { r as WITHHELD_ATTRIBUTE, o as mayReceive, t as pageAccessOf, n as pageAccessRefusal, i as pageWithheldOf, a as withholdPages };
|