@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.
Files changed (62) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/clients/index.d.ts +2 -1
  3. package/dist/clients/index.mjs +24 -15
  4. package/dist/credentials/index.d.ts +4 -0
  5. package/dist/credentials/index.mjs +3 -0
  6. package/dist/credentials/kinds.d.ts +54 -0
  7. package/dist/credentials/kinds.mjs +326 -0
  8. package/dist/credentials/problems.d.ts +14 -0
  9. package/dist/credentials/problems.mjs +43 -0
  10. package/dist/helpers/twigWrapper/charClass.mjs +21 -16
  11. package/dist/hooks/index.d.ts +2 -1
  12. package/dist/hooks/index.mjs +3 -2
  13. package/dist/hooks/usePrePaint.d.ts +12 -0
  14. package/dist/hooks/usePrePaint.mjs +8 -0
  15. package/dist/navigation/index.d.ts +1 -0
  16. package/dist/navigation/index.mjs +4 -3
  17. package/dist/navigation/notFoundPages.d.ts +25 -0
  18. package/dist/navigation/notFoundPages.mjs +11 -0
  19. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelDeployMutation.d.ts +7 -0
  20. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelDeployMutation.mjs +3 -0
  21. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelScheduledPublishMutation.d.ts +6 -0
  22. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelScheduledPublishMutation.mjs +3 -0
  23. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.d.ts +1 -1
  24. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -1
  25. package/dist/network/graphql/builder/Mutations/Space/SpaceRedeployMutation.d.ts +5 -0
  26. package/dist/network/graphql/builder/Mutations/Space/SpaceRedeployMutation.mjs +3 -0
  27. package/dist/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.d.ts +5 -0
  28. package/dist/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.mjs +3 -0
  29. package/dist/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.d.ts +5 -0
  30. package/dist/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.mjs +3 -0
  31. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.d.ts +10 -0
  32. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.mjs +3 -0
  33. package/dist/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.d.ts +11 -0
  34. package/dist/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.mjs +3 -0
  35. package/dist/network/graphql/builder/Mutations/index.d.ts +14 -0
  36. package/dist/network/graphql/builder/Mutations/index.mjs +88 -74
  37. package/dist/network/graphql/builder/Queries/Space/SpaceDeployDetailQuery.d.ts +7 -0
  38. package/dist/network/graphql/builder/Queries/Space/SpaceDeployDetailQuery.mjs +3 -0
  39. package/dist/network/graphql/builder/Queries/Space/SpacePublishCheckQuery.d.ts +7 -0
  40. package/dist/network/graphql/builder/Queries/Space/SpacePublishCheckQuery.mjs +3 -0
  41. package/dist/network/graphql/builder/Queries/Space/SpaceReleasesQuery.d.ts +7 -0
  42. package/dist/network/graphql/builder/Queries/Space/SpaceReleasesQuery.mjs +3 -0
  43. package/dist/network/graphql/builder/Queries/Space/SpaceScheduledPublishesQuery.d.ts +7 -0
  44. package/dist/network/graphql/builder/Queries/Space/SpaceScheduledPublishesQuery.mjs +3 -0
  45. package/dist/network/graphql/builder/Queries/Space/SpaceSnapshotsQuery.d.ts +7 -0
  46. package/dist/network/graphql/builder/Queries/Space/SpaceSnapshotsQuery.mjs +3 -0
  47. package/dist/network/graphql/builder/Queries/Space/SpaceTargetsQuery.d.ts +7 -0
  48. package/dist/network/graphql/builder/Queries/Space/SpaceTargetsQuery.mjs +3 -0
  49. package/dist/network/graphql/builder/Queries/Space/SpaceVersionChangesQuery.d.ts +7 -0
  50. package/dist/network/graphql/builder/Queries/Space/SpaceVersionChangesQuery.mjs +3 -0
  51. package/dist/network/graphql/builder/Queries/index.d.ts +14 -0
  52. package/dist/network/graphql/builder/Queries/index.mjs +38 -24
  53. package/dist/schema/index.mjs +2 -2
  54. package/dist/schema/pageAccess.d.ts +6 -0
  55. package/dist/schema/pageAccess.mjs +23 -23
  56. package/dist/store/runtimeStatePersist.mjs +8 -8
  57. package/dist/store/storeHooks.d.ts +45 -45
  58. package/dist/types/JobTypes.d.ts +7 -1
  59. package/dist/types/ServerTypes.d.ts +6 -0
  60. package/dist/types/SpaceTypes.d.ts +277 -6
  61. package/dist/types/StoreTypes.d.ts +6 -0
  62. package/package.json +9 -13
@@ -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, withheldPageOf as Ve, withholdPages as He } 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, 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, Ve as withheldPageOf, He as withholdPages };
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, a = "withheld", o = (e) => {
14
- let t = e?.[a];
13
+ }, n) : void 0, o = "withheld", s = (e) => {
14
+ let t = e?.[o];
15
15
  return t === "unauthenticated" || t === "forbidden" ? t : void 0;
16
- }, s = (e) => {
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
- }, c = (e, t) => {
22
- let a = /* @__PURE__ */ new Map(), o = [];
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 = r(c) ?? (c?.accessLevel === "authenticated" ? { permissions: [] } : void 0);
24
+ let c = e.flat[s]?.attributes, l = n(c), u = i(c);
25
25
  if (!u) continue;
26
- let d = i(u, t);
27
- d ? a.set(s, l ? "hidden" : d) : o.push(u);
26
+ let d = a(u, t);
27
+ d ? r.set(s, l ? "hidden" : d) : o.push(u);
28
28
  }
29
- return a.size === 0 ? {
29
+ return r.size === 0 ? {
30
30
  schema: e,
31
31
  withheld: [],
32
32
  kept: o
33
33
  } : {
34
- schema: d(e, a),
35
- withheld: [...a.keys()],
34
+ schema: f(e, r),
35
+ withheld: [...r.keys()],
36
36
  kept: o
37
37
  };
38
- }, l = /* @__PURE__ */ new WeakMap(), u = 16, d = (e, t) => {
39
- let n = [...t].map(([e, t]) => `${e}:${t}`).join("\n"), r = l.get(e) ?? /* @__PURE__ */ new Map();
40
- l.set(e, r);
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 o = {};
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 ? o[n] = {
46
+ e !== "hidden" && (e ? a[n] = {
47
47
  ...r,
48
48
  attributes: {
49
49
  ...r.attributes,
50
- [a]: e
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) || (o[n] = r));
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: o,
60
+ flat: a,
61
61
  ...s.length > 0 ? { pages: e.pages.filter((e) => !s.includes(e)) } : {}
62
62
  };
63
- return r.size >= u && r.delete(r.keys().next().value ?? ""), r.set(n, c), c;
64
- }, f = (e, t) => e.every((e) => i(e, t) === void 0);
65
- export { t as NOT_FOUND_WHEN_REFUSED, a as WITHHELD_ATTRIBUTE, f as mayReceive, n as notFoundWhenRefused, r as pageAccessOf, i as pageAccessRefusal, o as pageWithheldOf, s as withheldPageOf, c as withholdPages };
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 o = n(i), s = i.getState().runtime?.state, c = f(i.getState()), l = C(i, e), u = E(i, e);
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
- ...o,
156
+ ...s,
157
157
  onChange: (e) => {
158
- let n = c, d = f(i.getState());
159
- if (d !== void 0 && (c = d), n?.kind === "account" && d !== void 0 && p(d) !== p(n)) {
160
- let e = _(i.getState()), n = b(i.getState().runtime?.state, (t) => r(e).has(t)), o = t(s) ? g(s, a(e)) : s, c = Object.keys(n).length > 0 ? {
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", c);
164
+ i.setState("runtime.state", s);
165
165
  }
166
- o?.onChange?.(e), l(), u();
166
+ s?.onChange?.(e), u(), d();
167
167
  }
168
168
  };
169
169
  };