@plitzi/sdk-shared 0.39.4 → 0.39.7
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 +18 -0
- package/dist/clients/index.d.ts +2 -1
- package/dist/clients/index.mjs +24 -15
- package/dist/credentials/index.d.ts +4 -0
- package/dist/credentials/index.mjs +3 -0
- package/dist/credentials/kinds.d.ts +54 -0
- package/dist/credentials/kinds.mjs +326 -0
- package/dist/credentials/problems.d.ts +14 -0
- package/dist/credentials/problems.mjs +43 -0
- package/dist/helpers/twigWrapper/charClass.mjs +21 -16
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.mjs +3 -2
- package/dist/hooks/usePrePaint.d.ts +12 -0
- package/dist/hooks/usePrePaint.mjs +8 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.mjs +4 -3
- package/dist/navigation/notFoundPages.d.ts +25 -0
- package/dist/navigation/notFoundPages.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceCancelDeployMutation.d.ts +7 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceCancelDeployMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceCancelScheduledPublishMutation.d.ts +6 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceCancelScheduledPublishMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.d.ts +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRedeployMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRedeployMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.d.ts +10 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.d.ts +11 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.mjs +3 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +14 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +88 -74
- package/dist/network/graphql/builder/Queries/Space/SpaceDeployDetailQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceDeployDetailQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/Space/SpacePublishCheckQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpacePublishCheckQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceReleasesQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceReleasesQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceScheduledPublishesQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceScheduledPublishesQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceSnapshotsQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceSnapshotsQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceTargetsQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceTargetsQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceVersionChangesQuery.d.ts +7 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceVersionChangesQuery.mjs +3 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +14 -0
- package/dist/network/graphql/builder/Queries/index.mjs +38 -24
- package/dist/schema/index.mjs +2 -2
- package/dist/schema/pageAccess.d.ts +6 -0
- package/dist/schema/pageAccess.mjs +23 -23
- package/dist/store/runtimeStatePersist.mjs +8 -8
- package/dist/store/storeHooks.d.ts +45 -45
- package/dist/types/JobTypes.d.ts +7 -1
- package/dist/types/ServerTypes.d.ts +6 -0
- package/dist/types/SpaceTypes.d.ts +277 -6
- package/dist/types/StoreTypes.d.ts +6 -0
- package/package.json +9 -13
package/dist/schema/index.mjs
CHANGED
|
@@ -17,5 +17,5 @@ import { revealOnView as De } from "./motionReveal.mjs";
|
|
|
17
17
|
import { elementFromWire as Oe, schemaFromWire as ke, schemaToWire as Ae } from "./wire.mjs";
|
|
18
18
|
import { pageElementTypes as je } from "./pageElements.mjs";
|
|
19
19
|
import { headingText as Me, markdownHeadings as Ne } from "./markdownHeadings.mjs";
|
|
20
|
-
import { NOT_FOUND_WHEN_REFUSED as Pe, WITHHELD_ATTRIBUTE as Fe, mayReceive as Ie, notFoundWhenRefused as Le, pageAccessOf as Re, pageAccessRefusal as ze, pageWithheldOf as Be,
|
|
21
|
-
export { e as AI_CRAWLERS, t as AI_CRAWLER_KINDS, n as AI_CRAWLER_KIND_LABEL, a as ANCHOR_PATTERN, l as COMPONENT_PROPS_SOURCE, U as DEFAULT_FAVICON, u as EMPTY_SCHEMA, ne as MOTION_DEFAULT_DURATION, re as MOTION_EASING_KEYWORDS, ie as MOTION_ENTERS, ae as MOTION_ENTER_EASING, oe as MOTION_ENTER_FRAMES, se as MOTION_ENTER_FROM, ce as MOTION_ENTER_TRAVEL, le as MOTION_LOOPS, ue as MOTION_LOOP_FRAMES, de as MOTION_MAX_DISTANCE, fe as MOTION_MAX_MS, pe as MOTION_PLAY_CSS, me as MOTION_SEEN_ATTRIBUTE, he as MOTION_SEEN_CSS, ge as MOTION_STILL_CSS, _e as MOTION_TRAVEL_PROPERTY, ve as MOTION_TRIGGERS, ye as MOTION_VIEW_SELECTOR, be as MOVING_SELECTOR, Pe as NOT_FOUND_WHEN_REFUSED, W as OG_TYPES, Z as PLITZI_MARK_DATA_URL, Q as PLITZI_MARK_SVG, y as RSC_FAILURE, $ as SCHEMA_SETTINGS, d as VARIABLE_REGEX, Fe as WITHHELD_ATTRIBUTE, G as absoluteAddress, o as anchorOf, r as blockedAiCrawlers, L as browserServerInput, b as collectServerElements, Oe as elementFromWire, f as findLayoutCycle, x as hasServerElements, Me as headingText, R as inputProviders, z as inputReadings, i as isAiCrawlerKind, s as isAnchor, k as isEmptyAnswer, K as isHeadAddress, xe as isMotion, Se as isMotionAnimation, Ce as isMotionEasing, q as isOgType, A as isRuleGroup, ee as isSchemaSetting, te as isSnippet, S as jsonForScript, Ne as markdownHeadings, Ie as mayReceive, m as missingParts, we as motionAttributes, Te as motionProblems, C as notFoundProvider, Le as notFoundWhenRefused, Re as pageAccessOf, ze as pageAccessRefusal, je as pageElementTypes, J as pageHeadTags, h as pageLayouts, w as pageNotFound, T as pageSeoText, E as pageServerContext, D as pageStructuredData, Be as pageWithheldOf, p as resolveLayoutChain, De as revealOnView, O as rscFailureOf, g as schemaForPage, ke as schemaFromWire, Ae as schemaToWire, B as serverInputOf, j as serverProviderSource, V as serverQueryOf, H as serverQueryProblem, M as serverWhenValues, Y as spaceIdentity, X as spaceIdentityProblems, _ as splitSchema, Ee as travelled, c as uniqueAnchor, N as whenOf, P as whenPaths, F as whenProviders, I as whenUnknownToServer, v as withParts,
|
|
20
|
+
import { NOT_FOUND_WHEN_REFUSED as Pe, WITHHELD_ATTRIBUTE as Fe, mayReceive as Ie, notFoundWhenRefused as Le, pageAccessOf as Re, pageAccessRefusal as ze, pageWithheldOf as Be, protectedAccessOf as Ve, withheldPageOf as He, withholdPages as Ue } from "./pageAccess.mjs";
|
|
21
|
+
export { e as AI_CRAWLERS, t as AI_CRAWLER_KINDS, n as AI_CRAWLER_KIND_LABEL, a as ANCHOR_PATTERN, l as COMPONENT_PROPS_SOURCE, U as DEFAULT_FAVICON, u as EMPTY_SCHEMA, ne as MOTION_DEFAULT_DURATION, re as MOTION_EASING_KEYWORDS, ie as MOTION_ENTERS, ae as MOTION_ENTER_EASING, oe as MOTION_ENTER_FRAMES, se as MOTION_ENTER_FROM, ce as MOTION_ENTER_TRAVEL, le as MOTION_LOOPS, ue as MOTION_LOOP_FRAMES, de as MOTION_MAX_DISTANCE, fe as MOTION_MAX_MS, pe as MOTION_PLAY_CSS, me as MOTION_SEEN_ATTRIBUTE, he as MOTION_SEEN_CSS, ge as MOTION_STILL_CSS, _e as MOTION_TRAVEL_PROPERTY, ve as MOTION_TRIGGERS, ye as MOTION_VIEW_SELECTOR, be as MOVING_SELECTOR, Pe as NOT_FOUND_WHEN_REFUSED, W as OG_TYPES, Z as PLITZI_MARK_DATA_URL, Q as PLITZI_MARK_SVG, y as RSC_FAILURE, $ as SCHEMA_SETTINGS, d as VARIABLE_REGEX, Fe as WITHHELD_ATTRIBUTE, G as absoluteAddress, o as anchorOf, r as blockedAiCrawlers, L as browserServerInput, b as collectServerElements, Oe as elementFromWire, f as findLayoutCycle, x as hasServerElements, Me as headingText, R as inputProviders, z as inputReadings, i as isAiCrawlerKind, s as isAnchor, k as isEmptyAnswer, K as isHeadAddress, xe as isMotion, Se as isMotionAnimation, Ce as isMotionEasing, q as isOgType, A as isRuleGroup, ee as isSchemaSetting, te as isSnippet, S as jsonForScript, Ne as markdownHeadings, Ie as mayReceive, m as missingParts, we as motionAttributes, Te as motionProblems, C as notFoundProvider, Le as notFoundWhenRefused, Re as pageAccessOf, ze as pageAccessRefusal, je as pageElementTypes, J as pageHeadTags, h as pageLayouts, w as pageNotFound, T as pageSeoText, E as pageServerContext, D as pageStructuredData, Be as pageWithheldOf, Ve as protectedAccessOf, p as resolveLayoutChain, De as revealOnView, O as rscFailureOf, g as schemaForPage, ke as schemaFromWire, Ae as schemaToWire, B as serverInputOf, j as serverProviderSource, V as serverQueryOf, H as serverQueryProblem, M as serverWhenValues, Y as spaceIdentity, X as spaceIdentityProblems, _ as splitSchema, Ee as travelled, c as uniqueAnchor, N as whenOf, P as whenPaths, F as whenProviders, I as whenUnknownToServer, v as withParts, He as withheldPageOf, Ue as withholdPages };
|
|
@@ -24,6 +24,12 @@ export declare const NOT_FOUND_WHEN_REFUSED = "notFound";
|
|
|
24
24
|
export declare const notFoundWhenRefused: (attributes: Record<string, unknown> | undefined) => boolean;
|
|
25
25
|
/** A page's access, when its attributes declare one — at least one permission, each a name — or nothing. */
|
|
26
26
|
export declare const pageAccessOf: (attributes: Record<string, unknown> | undefined) => PageAccess | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* What keeps a page from a visitor, or nothing for a page anybody may open: the permissions it declares (`access`) — or,
|
|
29
|
+
* for one only for signed-in visitors (`accessLevel: 'authenticated'`), a session and no permission. What the server
|
|
30
|
+
* withholds a page by (`withholdPages`), and what the builder marks a protected page and folder with.
|
|
31
|
+
*/
|
|
32
|
+
export declare const protectedAccessOf: (attributes: Record<string, unknown> | undefined) => PageAccess | undefined;
|
|
27
33
|
/** Why this visitor may not see a page that declares `access`, or nothing when they may — or when it declares none. */
|
|
28
34
|
export declare const pageAccessRefusal: (access: PageAccess | undefined, caller: AccessCaller) => "unauthenticated" | "forbidden" | undefined;
|
|
29
35
|
/** The attribute a withheld page carries in the space the browser is sent: why it was withheld. */
|
|
@@ -7,59 +7,59 @@ var t = "notFound", n = (e) => e?.unauthorizedBehaviour === t, r = (e) => {
|
|
|
7
7
|
if (!Array.isArray(n)) return;
|
|
8
8
|
let r = n.filter((e) => typeof e == "string" && e !== "");
|
|
9
9
|
return r.length > 0 ? { permissions: r } : void 0;
|
|
10
|
-
}, i = (t, n) => t ? e({
|
|
10
|
+
}, i = (e) => r(e) ?? (e?.accessLevel === "authenticated" ? { permissions: [] } : void 0), a = (t, n) => t ? e({
|
|
11
11
|
mode: "role",
|
|
12
12
|
permissions: t.permissions
|
|
13
|
-
}, n) : void 0,
|
|
14
|
-
let t = e?.[
|
|
13
|
+
}, n) : void 0, o = "withheld", s = (e) => {
|
|
14
|
+
let t = e?.[o];
|
|
15
15
|
return t === "unauthenticated" || t === "forbidden" ? t : void 0;
|
|
16
|
-
},
|
|
16
|
+
}, c = (e) => {
|
|
17
17
|
let t = e.settings?.withheldPage;
|
|
18
18
|
if (t === void 0 || !e.pages?.includes(t)) return;
|
|
19
19
|
let n = e.flat[t];
|
|
20
20
|
return n && !r(n.attributes) ? t : void 0;
|
|
21
|
-
},
|
|
22
|
-
let
|
|
21
|
+
}, l = (e, t) => {
|
|
22
|
+
let r = /* @__PURE__ */ new Map(), o = [];
|
|
23
23
|
for (let s of e.pages) {
|
|
24
|
-
let c = e.flat[s]?.attributes, l = n(c), u =
|
|
24
|
+
let c = e.flat[s]?.attributes, l = n(c), u = i(c);
|
|
25
25
|
if (!u) continue;
|
|
26
|
-
let d =
|
|
27
|
-
d ?
|
|
26
|
+
let d = a(u, t);
|
|
27
|
+
d ? r.set(s, l ? "hidden" : d) : o.push(u);
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return r.size === 0 ? {
|
|
30
30
|
schema: e,
|
|
31
31
|
withheld: [],
|
|
32
32
|
kept: o
|
|
33
33
|
} : {
|
|
34
|
-
schema:
|
|
35
|
-
withheld: [...
|
|
34
|
+
schema: f(e, r),
|
|
35
|
+
withheld: [...r.keys()],
|
|
36
36
|
kept: o
|
|
37
37
|
};
|
|
38
|
-
},
|
|
39
|
-
let n = [...t].map(([e, t]) => `${e}:${t}`).join("\n"), r =
|
|
40
|
-
|
|
38
|
+
}, u = /* @__PURE__ */ new WeakMap(), d = 16, f = (e, t) => {
|
|
39
|
+
let n = [...t].map(([e, t]) => `${e}:${t}`).join("\n"), r = u.get(e) ?? /* @__PURE__ */ new Map();
|
|
40
|
+
u.set(e, r);
|
|
41
41
|
let i = r.get(n);
|
|
42
42
|
if (i) return i;
|
|
43
|
-
let
|
|
43
|
+
let a = {};
|
|
44
44
|
for (let [n, r] of Object.entries(e.flat)) {
|
|
45
45
|
let e = t.get(n);
|
|
46
|
-
e !== "hidden" && (e ?
|
|
46
|
+
e !== "hidden" && (e ? a[n] = {
|
|
47
47
|
...r,
|
|
48
48
|
attributes: {
|
|
49
49
|
...r.attributes,
|
|
50
|
-
[
|
|
50
|
+
[o]: e
|
|
51
51
|
},
|
|
52
52
|
definition: {
|
|
53
53
|
...r.definition,
|
|
54
54
|
items: []
|
|
55
55
|
}
|
|
56
|
-
} : n !== r.definition.rootId && t.has(r.definition.rootId) || (
|
|
56
|
+
} : n !== r.definition.rootId && t.has(r.definition.rootId) || (a[n] = r));
|
|
57
57
|
}
|
|
58
58
|
let s = [...t].filter(([, e]) => e === "hidden").map(([e]) => e), c = {
|
|
59
59
|
...e,
|
|
60
|
-
flat:
|
|
60
|
+
flat: a,
|
|
61
61
|
...s.length > 0 ? { pages: e.pages.filter((e) => !s.includes(e)) } : {}
|
|
62
62
|
};
|
|
63
|
-
return r.size >=
|
|
64
|
-
},
|
|
65
|
-
export { t as NOT_FOUND_WHEN_REFUSED,
|
|
63
|
+
return r.size >= d && r.delete(r.keys().next().value ?? ""), r.set(n, c), c;
|
|
64
|
+
}, p = (e, t) => e.every((e) => a(e, t) === void 0);
|
|
65
|
+
export { t as NOT_FOUND_WHEN_REFUSED, o as WITHHELD_ATTRIBUTE, p as mayReceive, n as notFoundWhenRefused, r as pageAccessOf, a as pageAccessRefusal, s as pageWithheldOf, i as protectedAccessOf, c as withheldPageOf, l as withholdPages };
|
|
@@ -150,20 +150,20 @@ var d = /* @__PURE__ */ new Set([
|
|
|
150
150
|
return i ? m(i, p(r)) : !1;
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
|
-
return (i) => {
|
|
154
|
-
let
|
|
153
|
+
return (i, o) => {
|
|
154
|
+
let s = n(i, o), c = i.getState().runtime?.state, l = f(i.getState()), u = C(i, e), d = E(i, e);
|
|
155
155
|
return {
|
|
156
|
-
...
|
|
156
|
+
...s,
|
|
157
157
|
onChange: (e) => {
|
|
158
|
-
let n =
|
|
159
|
-
if (
|
|
160
|
-
let e = _(i.getState()), n = b(i.getState().runtime?.state, (t) => r(e).has(t)), o = t(
|
|
158
|
+
let n = l, o = f(i.getState());
|
|
159
|
+
if (o !== void 0 && (l = o), n?.kind === "account" && o !== void 0 && p(o) !== p(n)) {
|
|
160
|
+
let e = _(i.getState()), n = b(i.getState().runtime?.state, (t) => r(e).has(t)), o = t(c) ? g(c, a(e)) : c, s = Object.keys(n).length > 0 ? {
|
|
161
161
|
...t(o) ? o : {},
|
|
162
162
|
...n
|
|
163
163
|
} : o;
|
|
164
|
-
i.setState("runtime.state",
|
|
164
|
+
i.setState("runtime.state", s);
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
s?.onChange?.(e), u(), d();
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
};
|