@plitzi/sdk-shared 0.39.3 → 0.39.6
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 +60 -0
- package/dist/clients/index.mjs +47 -0
- package/dist/conditions/types.d.ts +1 -1
- 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/csrf/csrf.d.ts +36 -0
- package/dist/csrf/csrf.mjs +62 -0
- package/dist/csrf/index.d.ts +2 -0
- package/dist/csrf/index.mjs +1 -0
- package/dist/helpers/deepEqual/deepEqual.mjs +3 -2
- package/dist/helpers/lodash/cloneDeep.d.ts +3 -3
- package/dist/helpers/lodash/cloneDeep.mjs +24 -27
- package/dist/helpers/lodash/has.d.ts +2 -1
- package/dist/helpers/lodash/has.mjs +8 -8
- package/dist/helpers/lodash/index.d.ts +1 -1
- package/dist/helpers/lodash/omit.mjs +2 -2
- package/dist/helpers/twigWrapper/charClass.mjs +21 -16
- package/dist/helpers/twigWrapper/filters/arrays.mjs +43 -42
- package/dist/helpers/twigWrapper/filters/filters.mjs +3 -3
- package/dist/helpers/twigWrapper/filters/index.mjs +4 -4
- package/dist/helpers/twigWrapper/filters/misc.mjs +14 -13
- package/dist/helpers/twigWrapper/filters/objects.mjs +50 -49
- package/dist/helpers/twigWrapper/filters/strings.mjs +41 -40
- package/dist/helpers/twigWrapper/filters/types.d.ts +4 -0
- package/dist/helpers/twigWrapper/filters/types.mjs +2 -2
- 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 +2 -1
- package/dist/navigation/index.mjs +4 -3
- package/dist/navigation/notFoundPages.d.ts +25 -0
- package/dist/navigation/notFoundPages.mjs +11 -0
- package/dist/navigation/routes.d.ts +2 -0
- package/dist/navigation/routes.mjs +2 -1
- package/dist/navigation/sitemap.d.ts +8 -0
- package/dist/navigation/sitemap.mjs +7 -4
- 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/react/index.d.ts +1 -1
- package/dist/refusals/index.d.ts +112 -0
- package/dist/refusals/index.mjs +94 -0
- package/dist/schema/aiCrawlers.d.ts +25 -0
- package/dist/schema/aiCrawlers.mjs +34 -0
- package/dist/schema/documentParts.d.ts +45 -0
- package/dist/schema/documentParts.mjs +73 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.mjs +21 -18
- package/dist/schema/pageAccess.d.ts +6 -0
- package/dist/schema/pageAccess.mjs +23 -23
- package/dist/schema/plitziMark.d.ts +9 -0
- package/dist/schema/plitziMark.mjs +3 -0
- package/dist/schema/schemaSettings.d.ts +1 -1
- package/dist/schema/schemaSettings.mjs +1 -1
- package/dist/schema/serverElements.d.ts +5 -0
- package/dist/store/runtimeStatePersist.mjs +10 -10
- package/dist/store/storeHooks.d.ts +45 -45
- package/dist/style/runtimeStyle.d.ts +5 -2
- package/dist/style/runtimeStyle.mjs +1 -1
- package/dist/types/ActionTypes.d.ts +2 -0
- package/dist/types/AuthTypes.d.ts +5 -0
- package/dist/types/SchemaTypes.d.ts +31 -4
- package/dist/types/ServerTypes.d.ts +6 -0
- package/dist/types/SpaceTypes.d.ts +277 -6
- package/dist/types/StoreTypes.d.ts +11 -0
- package/eslint.config.mjs +123 -100
- package/package.json +9 -13
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { wrapRaw as e } from "./raw.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { isList as t } from "./types.mjs";
|
|
3
|
+
import { isEmpty as n, toJson as r, toStr as i } from "./values.mjs";
|
|
3
4
|
// src/helpers/twigWrapper/filters/strings.ts
|
|
4
|
-
var
|
|
5
|
-
to_json: (e) =>
|
|
6
|
-
json_encode: (e) =>
|
|
5
|
+
var a = { raw: (t) => e(t) }, o = {
|
|
6
|
+
to_json: (e) => r(e),
|
|
7
|
+
json_encode: (e) => r(e),
|
|
7
8
|
object_as_json: (e) => typeof e == "object" && e ? JSON.stringify(e) : e
|
|
8
|
-
},
|
|
9
|
+
}, s = { default: (e, t) => n(e) ? t[0] : e }, c = {
|
|
9
10
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
10
11
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
11
12
|
trim: (e) => typeof e == "string" ? e.trim() : e,
|
|
@@ -18,21 +19,21 @@ var i = { raw: (t) => e(t) }, a = {
|
|
|
18
19
|
rtrim: (e) => typeof e == "string" ? e.trimEnd() : e,
|
|
19
20
|
pad: (e, t) => {
|
|
20
21
|
if (typeof e != "string") return e;
|
|
21
|
-
let n = Number(t[0]) || 0,
|
|
22
|
-
if (
|
|
22
|
+
let n = Number(t[0]) || 0, r = t.length > 1 ? i(t[1]) : " ";
|
|
23
|
+
if (r === "") return e;
|
|
23
24
|
let a = n - e.length;
|
|
24
25
|
if (a <= 0) return e;
|
|
25
|
-
let o = Math.ceil(a /
|
|
26
|
-
return
|
|
26
|
+
let o = Math.ceil(a / r.length);
|
|
27
|
+
return r.repeat(o).slice(0, a) + e;
|
|
27
28
|
},
|
|
28
29
|
padRight: (e, t) => {
|
|
29
30
|
if (typeof e != "string") return e;
|
|
30
|
-
let n = Number(t[0]) || 0,
|
|
31
|
-
if (
|
|
31
|
+
let n = Number(t[0]) || 0, r = t.length > 1 ? i(t[1]) : " ";
|
|
32
|
+
if (r === "") return e;
|
|
32
33
|
let a = n - e.length;
|
|
33
34
|
if (a <= 0) return e;
|
|
34
|
-
let o = Math.ceil(a /
|
|
35
|
-
return e +
|
|
35
|
+
let o = Math.ceil(a / r.length);
|
|
36
|
+
return e + r.repeat(o).slice(0, a);
|
|
36
37
|
},
|
|
37
38
|
number: (e, t) => {
|
|
38
39
|
if (typeof e == "number") {
|
|
@@ -43,36 +44,36 @@ var i = { raw: (t) => e(t) }, a = {
|
|
|
43
44
|
let n = e.match(/-?\d+(?:\.\d+)?/);
|
|
44
45
|
return n ? Number(n[0]) : 0;
|
|
45
46
|
}
|
|
46
|
-
},
|
|
47
|
-
replace: (e,
|
|
48
|
-
if (typeof e != "string" ||
|
|
49
|
-
let [
|
|
50
|
-
if (typeof
|
|
51
|
-
let t = new Map(Object.entries(
|
|
47
|
+
}, l = {
|
|
48
|
+
replace: (e, n) => {
|
|
49
|
+
if (typeof e != "string" || n.length === 0) return e;
|
|
50
|
+
let [r] = n;
|
|
51
|
+
if (typeof r == "object" && r && !t(r)) {
|
|
52
|
+
let t = new Map(Object.entries(r).filter(([e]) => e !== ""));
|
|
52
53
|
if (t.size === 0) return e;
|
|
53
|
-
let
|
|
54
|
-
return e.replace(a, (e) =>
|
|
54
|
+
let n = [...t.keys()].sort((e, t) => t.length - e.length), a = new RegExp(n.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), "g");
|
|
55
|
+
return e.replace(a, (e) => i(t.get(e)));
|
|
55
56
|
}
|
|
56
|
-
return e.split(r
|
|
57
|
+
return e.split(i(r)).join(i(n[1]));
|
|
57
58
|
},
|
|
58
|
-
slice: (e,
|
|
59
|
-
if (
|
|
60
|
-
let
|
|
61
|
-
return typeof e == "string" ||
|
|
59
|
+
slice: (e, n) => {
|
|
60
|
+
if (n.length === 0) return e;
|
|
61
|
+
let r = Number(n[0]) || 0, i = n.length > 1 && Number.isFinite(Number(n[1])) ? r + Number(n[1]) : void 0;
|
|
62
|
+
return typeof e == "string" || t(e) ? e.slice(r, i) : e;
|
|
62
63
|
},
|
|
63
|
-
split: (e, t) => typeof e == "string" && t.length > 0 ? e.split(
|
|
64
|
-
join: (e,
|
|
65
|
-
reverse: (e) => typeof e == "string" ? e.split("").reverse().join("") :
|
|
66
|
-
},
|
|
67
|
-
length: (e) => typeof e == "string" ||
|
|
68
|
-
first: (e) => typeof e == "string" ? e.length > 0 ? e[0] : "" :
|
|
69
|
-
last: (e) => typeof e == "string" ? e.length > 0 ? e[e.length - 1] : "" :
|
|
70
|
-
contains: (e,
|
|
71
|
-
if (
|
|
72
|
-
let
|
|
73
|
-
return typeof e == "string" ? e.includes(r
|
|
64
|
+
split: (e, t) => typeof e == "string" && t.length > 0 ? e.split(i(t[0])) : e,
|
|
65
|
+
join: (e, n) => t(e) ? e.join(n.length === 0 ? "" : i(n[0])) : e,
|
|
66
|
+
reverse: (e) => typeof e == "string" ? e.split("").reverse().join("") : t(e) ? [...e].reverse() : e
|
|
67
|
+
}, u = {
|
|
68
|
+
length: (e) => typeof e == "string" || t(e) ? e.length : typeof e == "number" ? i(e).length : typeof e == "object" && e ? Object.keys(e).length : 0,
|
|
69
|
+
first: (e) => typeof e == "string" ? e.length > 0 ? e[0] : "" : t(e) ? e.length > 0 ? e[0] : void 0 : e,
|
|
70
|
+
last: (e) => typeof e == "string" ? e.length > 0 ? e[e.length - 1] : "" : t(e) ? e.length > 0 ? e[e.length - 1] : void 0 : e,
|
|
71
|
+
contains: (e, n) => {
|
|
72
|
+
if (n.length === 0) return !1;
|
|
73
|
+
let r = n[0];
|
|
74
|
+
return typeof e == "string" ? e.includes(i(r)) : t(e) ? e.includes(r) : !1;
|
|
74
75
|
},
|
|
75
|
-
startswith: (e, t) => typeof e == "string" && t.length > 0 && e.startsWith(
|
|
76
|
-
endswith: (e, t) => typeof e == "string" && t.length > 0 && e.endsWith(
|
|
76
|
+
startswith: (e, t) => typeof e == "string" && t.length > 0 && e.startsWith(i(t[0])),
|
|
77
|
+
endswith: (e, t) => typeof e == "string" && t.length > 0 && e.endsWith(i(t[0]))
|
|
77
78
|
};
|
|
78
|
-
export {
|
|
79
|
+
export { s as defaultFilters, a as identityFilters, o as serialisationFilters, l as stringOperationFilters, u as stringQueryFilters, c as stringTransformFilters };
|
|
@@ -3,3 +3,7 @@ export declare const ARROW_PARAMS: unique symbol;
|
|
|
3
3
|
export type ArrowCallback = ((...args: unknown[]) => unknown) & {
|
|
4
4
|
[ARROW_PARAMS]?: number;
|
|
5
5
|
};
|
|
6
|
+
/** A piped value that is a list, typed as one whose items are not known yet: `Array.isArray` alone says `any[]`. */
|
|
7
|
+
export declare const isList: (value: unknown) => value is unknown[];
|
|
8
|
+
/** An argument that is an arrow the Evaluator made: what a filter calls with the items. */
|
|
9
|
+
export declare const isCallback: (value: unknown) => value is ArrowCallback;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/helpers/twigWrapper/filters/types.ts
|
|
2
|
-
var e = Symbol("twigArrowParams");
|
|
3
|
-
export { e as ARROW_PARAMS };
|
|
2
|
+
var e = Symbol("twigArrowParams"), t = (e) => Array.isArray(e), n = (e) => typeof e == "function";
|
|
3
|
+
export { e as ARROW_PARAMS, n as isCallback, t as isList };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as useFontHead } from './useFontHead';
|
|
2
2
|
import { default as useNetwork } from './useNetwork';
|
|
3
3
|
import { default as usePlitzi } from './usePlitzi';
|
|
4
|
+
import { default as usePrePaint } from './usePrePaint';
|
|
4
5
|
import { default as useStableValue } from './useStableValue';
|
|
5
6
|
export * from './useNetwork';
|
|
6
7
|
export * from './usePlitzi';
|
|
7
|
-
export { useFontHead, useNetwork, usePlitzi, useStableValue };
|
|
8
|
+
export { useFontHead, useNetwork, usePlitzi, usePrePaint, useStableValue };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import e from "./useFontHead.mjs";
|
|
2
2
|
import t from "./useNetwork.mjs";
|
|
3
3
|
import n, { PlitziContext as r, PlitziProvider as i } from "./usePlitzi.mjs";
|
|
4
|
-
import a from "./
|
|
5
|
-
|
|
4
|
+
import a from "./usePrePaint.mjs";
|
|
5
|
+
import o from "./useStableValue.mjs";
|
|
6
|
+
export { r as PlitziContext, i as PlitziProvider, e as useFontHead, t as useNetwork, n as usePlitzi, a as usePrePaint, o as useStableValue };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asks the page to run `script` as soon as it is parsed — before it paints, before React is there — for what an element
|
|
3
|
+
* draws by a fact only the browser knows (the address's hash): the server draws without it, and the page would show
|
|
4
|
+
* the server's drawing until hydration. Written into the server render's result (`SSRRenderResult.prePaint`), once per
|
|
5
|
+
* name however many elements ask, and run by the page with its own script policy. In the browser it does nothing: the
|
|
6
|
+
* element draws by the fact itself there, and must hydrate on what the script left in the document.
|
|
7
|
+
*
|
|
8
|
+
* `enabled` false asks for nothing — an element that needs it only as it is configured. `script` is a function of plain JavaScript that reads nothing but the document and the window — its source is what
|
|
9
|
+
* the page runs, so it may close over nothing.
|
|
10
|
+
*/
|
|
11
|
+
declare const usePrePaint: (name: string, script: () => void, enabled?: boolean) => void;
|
|
12
|
+
export default usePrePaint;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "../network/react/NetworkContext.mjs";
|
|
2
|
+
import { use as t } from "react";
|
|
3
|
+
// src/hooks/usePrePaint.ts
|
|
4
|
+
var n = (n, r, i = !0) => {
|
|
5
|
+
let { server: a } = t(e), o = a.ssr?.renderResult;
|
|
6
|
+
o && i && (o.prePaint ??= {}, o.prePaint[n] ??= `(${r.toString()})();`);
|
|
7
|
+
};
|
|
8
|
+
export { n as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { matchPath } from './matchPath';
|
|
2
|
-
export {
|
|
2
|
+
export { freeSlugFor, isNotFoundPage, notFoundPageIn, pageFolderOf, slugOfName } from './notFoundPages';
|
|
3
|
+
export { SITEMAP_EXCLUSION_WORDS, sitemapExclusion, sitemapPages, sitemapPaths } from './sitemap';
|
|
3
4
|
export { getPageFullPath, getPaths, isAbsoluteUrl, isPageAuthored, matchRoutePath, notFoundPageFor, getRouteParams, getSlugParams, navigationTarget, NOT_FOUND_SLUG } from './routes';
|
|
4
5
|
export type { PathMatch, PathPattern } from './matchPath';
|
|
5
6
|
export type { NavigationAccessLevel, NavigationAction, Path } from './routes';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { matchPath as e } from "./matchPath.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { freeSlugFor as t, isNotFoundPage as n, notFoundPageIn as r, pageFolderOf as i, slugOfName as a } from "./notFoundPages.mjs";
|
|
3
|
+
import { SITEMAP_EXCLUSION_WORDS as o, sitemapExclusion as s, sitemapPages as c, sitemapPaths as l } from "./sitemap.mjs";
|
|
4
|
+
import { NOT_FOUND_SLUG as u, getPageFullPath as d, getPaths as f, getRouteParams as p, getSlugParams as m, isAbsoluteUrl as h, isPageAuthored as g, matchRoutePath as _, navigationTarget as v, notFoundPageFor as y } from "./routes.mjs";
|
|
5
|
+
export { u as NOT_FOUND_SLUG, o as SITEMAP_EXCLUSION_WORDS, t as freeSlugFor, d as getPageFullPath, f as getPaths, p as getRouteParams, m as getSlugParams, h as isAbsoluteUrl, n as isNotFoundPage, g as isPageAuthored, e as matchPath, _ as matchRoutePath, v as navigationTarget, y as notFoundPageFor, r as notFoundPageIn, i as pageFolderOf, s as sitemapExclusion, c as sitemapPages, l as sitemapPaths, a as slugOfName };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Element } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* The pages for the addresses nothing answers, as an editor keeps them: one per place — the space, or one folder —, or
|
|
4
|
+
* the router would pick one of two and an address land on whichever it picked (authoring refuses it, `not-found-twice`).
|
|
5
|
+
* Whatever makes a page the 404 of a place — its slug typed `*`, a move into a folder, "use as 404 page" — asks here
|
|
6
|
+
* first which page already is.
|
|
7
|
+
*/
|
|
8
|
+
type Pages = {
|
|
9
|
+
flat: Record<string, Element | undefined>;
|
|
10
|
+
pages: readonly string[];
|
|
11
|
+
};
|
|
12
|
+
/** Whether a page is the one for the addresses nothing answers in its place: its slug is `*`. */
|
|
13
|
+
export declare const isNotFoundPage: (attributes: Record<string, unknown> | undefined) => boolean;
|
|
14
|
+
/** The folder a page sits in — `''`, the space's top level. */
|
|
15
|
+
export declare const pageFolderOf: (attributes: Record<string, unknown> | undefined) => string;
|
|
16
|
+
/** The page that already answers what nothing else does in `folder` (`''`, the space) — other than `except` — if one does. */
|
|
17
|
+
export declare const notFoundPageIn: ({ flat, pages }: Pages, folder: string, except?: string) => string | undefined;
|
|
18
|
+
/** A page's name as a slug: `Not found` → `not-found`. */
|
|
19
|
+
export declare const slugOfName: (name: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* A slug for a page that stops being its place's 404, from its name, that no other page in its folder has —
|
|
22
|
+
* `not-found`, `not-found-2` —, so it keeps an address of its own rather than none.
|
|
23
|
+
*/
|
|
24
|
+
export declare const freeSlugFor: ({ flat, pages }: Pages, pageId: string) => string;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./routes.mjs";
|
|
2
|
+
// src/navigation/notFoundPages.ts
|
|
3
|
+
var e = (e) => typeof e == "string" ? e : "", t = (e) => e?.slug === "*", n = (t) => e(t?.folder), r = ({ flat: e, pages: r }, i, a) => r.find((r) => {
|
|
4
|
+
let o = e[r]?.attributes;
|
|
5
|
+
return r !== a && t(o) && n(o) === i;
|
|
6
|
+
}), i = (e) => e.trim().toLowerCase().replaceAll(/\s+/g, "-").replaceAll(/[^a-z0-9-]/g, "").replaceAll(/-+/g, "-").replaceAll(/^-|-$/g, ""), a = ({ flat: t, pages: r }, a) => {
|
|
7
|
+
let o = t[a]?.attributes, s = n(o), c = i(e(o?.name)) || "page", l = new Set(r.filter((e) => e !== a && n(t[e]?.attributes) === s).map((n) => e(t[n]?.attributes.slug))), u = c;
|
|
8
|
+
for (let e = 2; l.has(u); e += 1) u = `${c}-${String(e)}`;
|
|
9
|
+
return u;
|
|
10
|
+
};
|
|
11
|
+
export { a as freeSlugFor, t as isNotFoundPage, r as notFoundPageIn, n as pageFolderOf, i as slugOfName };
|
|
@@ -47,6 +47,8 @@ declare const matchRoutePath: (paths: Path[], pathName: string, authenticated: b
|
|
|
47
47
|
};
|
|
48
48
|
pathMatch?: PathMatch;
|
|
49
49
|
pageId?: string;
|
|
50
|
+
/** The page that sends this visitor elsewhere, for a `redirect`: what its address was, before it redirected. */
|
|
51
|
+
redirectedFrom?: string;
|
|
50
52
|
};
|
|
51
53
|
/** The space's "not found" page for an address — its deepest folder's, or the space's — when it declares one. */
|
|
52
54
|
declare const notFoundPageFor: (paths: Path[], pathName: string) => string | undefined;
|
|
@@ -14,3 +14,11 @@ export declare const sitemapExclusion: (page: Element) => SitemapExclusion | und
|
|
|
14
14
|
* {@link sitemapExclusion}, at the path a link to each resolves to (its folders' slugs before its own).
|
|
15
15
|
*/
|
|
16
16
|
export declare const sitemapPaths: (schema: Pick<Schema, "flat" | "pages" | "pageFolders">) => string[];
|
|
17
|
+
/**
|
|
18
|
+
* The pages {@link sitemapPaths} lists, each with its id — what a reader that says more of a page than its address
|
|
19
|
+
* (`/llms.txt`: its title and description) reads. The first page at a path holds it, in the order the paths sort.
|
|
20
|
+
*/
|
|
21
|
+
export declare const sitemapPages: (schema: Pick<Schema, "flat" | "pages" | "pageFolders">) => {
|
|
22
|
+
pageId: string;
|
|
23
|
+
path: string;
|
|
24
|
+
}[];
|
|
@@ -17,8 +17,11 @@ var r = {
|
|
|
17
17
|
}, o = (e) => Object.fromEntries(e.pages.flatMap((t) => {
|
|
18
18
|
let n = e.flat[t];
|
|
19
19
|
return n ? [[t, n]] : [];
|
|
20
|
-
})), s = (t) => {
|
|
21
|
-
let n = o(t), r = t.pageFolders, i =
|
|
22
|
-
return
|
|
20
|
+
})), s = (e) => [...new Set(c(e).map((e) => e.path))], c = (t) => {
|
|
21
|
+
let n = o(t), r = t.pageFolders, i = /* @__PURE__ */ new Set();
|
|
22
|
+
return Object.entries(n).filter(([, e]) => !a(e)).map(([t]) => ({
|
|
23
|
+
pageId: t,
|
|
24
|
+
path: e(n, r, t, !0)
|
|
25
|
+
})).sort((e, t) => e.path.localeCompare(t.path)).filter((e) => !i.has(e.path) && (i.add(e.path), !0));
|
|
23
26
|
};
|
|
24
|
-
export { r as SITEMAP_EXCLUSION_WORDS, a as sitemapExclusion, s as sitemapPaths };
|
|
27
|
+
export { r as SITEMAP_EXCLUSION_WORDS, a as sitemapExclusion, c as sitemapPages, s as sitemapPaths };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type TSpaceCancelDeployMutation = {
|
|
2
|
+
canceled: boolean;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
/** Stops a deploy where it is; what it uploaded stays. */
|
|
6
|
+
declare const SpaceCancelDeployMutation = "\n mutation SpaceCancelDeployMutation($id: Int!) {\n SpaceCancelDeploy(id: $id)\n }\n";
|
|
7
|
+
export default SpaceCancelDeployMutation;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type TSpaceCancelScheduledPublishMutation = {
|
|
2
|
+
canceled: boolean;
|
|
3
|
+
};
|
|
4
|
+
/** A publish set for later, called off before it runs. */
|
|
5
|
+
declare const SpaceCancelScheduledPublishMutation = "\n mutation SpaceCancelScheduledPublishMutation($id: Int!) {\n SpaceCancelScheduledPublish(id: $id)\n }\n";
|
|
6
|
+
export default SpaceCancelScheduledPublishMutation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SpaceDeployment } from '../../../../../types';
|
|
2
2
|
export type TSpaceDeployMutation = SpaceDeployment;
|
|
3
|
-
declare const SpaceDeployMutation = "\n mutation SpaceDeployMutation($environment: String
|
|
3
|
+
declare const SpaceDeployMutation = "\n mutation SpaceDeployMutation(\n $environment: String!\n $domain: String!\n $revision: Int\n $credentialIdentifier: String\n $deploy: Boolean\n ) {\n SpaceDeploy(\n environment: $environment\n domain: $domain\n revision: $revision\n credentialIdentifier: $credentialIdentifier\n deploy: $deploy\n ) {\n id\n environment\n domain\n revision\n isVerified\n default\n mode\n provider\n deployId\n credential {\n identifier\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
4
4
|
export default SpaceDeployMutation;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/network/graphql/builder/Mutations/Space/SpaceDeployMutation.ts
|
|
2
|
-
var e = "\n mutation SpaceDeployMutation($environment: String
|
|
2
|
+
var e = "\n mutation SpaceDeployMutation(\n $environment: String!\n $domain: String!\n $revision: Int\n $credentialIdentifier: String\n $deploy: Boolean\n ) {\n SpaceDeploy(\n environment: $environment\n domain: $domain\n revision: $revision\n credentialIdentifier: $credentialIdentifier\n deploy: $deploy\n ) {\n id\n environment\n domain\n revision\n isVerified\n default\n mode\n provider\n deployId\n credential {\n identifier\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
3
3
|
export { e as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SpaceDeploySummary } from '../../../../../types';
|
|
2
|
+
export type TSpaceRedeployMutation = SpaceDeploySummary;
|
|
3
|
+
/** Deploys again what a target serves — `redeploy` brings it to the newest versions. */
|
|
4
|
+
declare const SpaceRedeployMutation = "\n mutation SpaceRedeployMutation($domain: String!, $kind: String) {\n SpaceRedeploy(domain: $domain, kind: $kind)\n }\n";
|
|
5
|
+
export default SpaceRedeployMutation;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SpaceDeployment } from '../../../../../types';
|
|
2
|
+
export type TSpaceRollbackMutation = SpaceDeployment;
|
|
3
|
+
/** Rolls a domain back: to what it served right before its latest release, or the version named. */
|
|
4
|
+
declare const SpaceRollbackMutation = "\n mutation SpaceRollbackMutation($domain: String!, $environment: String, $revision: Int) {\n SpaceRollback(domain: $domain, environment: $environment, revision: $revision) {\n id\n environment\n domain\n revision\n isVerified\n default\n mode\n provider\n deployId\n credential {\n identifier\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
5
|
+
export default SpaceRollbackMutation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.ts
|
|
2
|
+
var e = "\n mutation SpaceRollbackMutation($domain: String!, $environment: String, $revision: Int) {\n SpaceRollback(domain: $domain, environment: $environment, revision: $revision) {\n id\n environment\n domain\n revision\n isVerified\n default\n mode\n provider\n deployId\n credential {\n identifier\n }\n createdAt\n updatedAt\n }\n }\n";
|
|
3
|
+
export { e as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SpaceScheduledPublish } from '../../../../../types';
|
|
2
|
+
export type TSpaceSchedulePublishMutation = Pick<SpaceScheduledPublish, 'id' | 'at' | 'status'>;
|
|
3
|
+
/** A publish set for later: at `at` (UTC seconds), with its deploy when it needs one. */
|
|
4
|
+
declare const SpaceSchedulePublishMutation = "\n mutation SpaceSchedulePublishMutation($domain: String!, $environment: String!, $revision: Int!, $at: Int!) {\n SpaceSchedulePublish(domain: $domain, environment: $environment, revision: $revision, at: $at)\n }\n";
|
|
5
|
+
export default SpaceSchedulePublishMutation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.ts
|
|
2
|
+
var e = "\n mutation SpaceSchedulePublishMutation($domain: String!, $environment: String!, $revision: Int!, $at: Int!) {\n SpaceSchedulePublish(domain: $domain, environment: $environment, revision: $revision, at: $at)\n }\n";
|
|
3
|
+
export { e as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeployMode, DeployProviderId } from '../../../../../types';
|
|
2
|
+
export type TSpaceSetTargetMutation = {
|
|
3
|
+
domain: string;
|
|
4
|
+
mode: DeployMode;
|
|
5
|
+
provider: 'ssr' | DeployProviderId;
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
/** How a domain serves the space: Plitzi's page servers, or a copy of the site on a provider. */
|
|
9
|
+
declare const SpaceSetTargetMutation = "\n mutation SpaceSetTargetMutation(\n $domain: String!\n $mode: String!\n $provider: String\n $config: Json\n $credential: String\n $bucket: Json\n ) {\n SpaceSetTarget(\n domain: $domain\n mode: $mode\n provider: $provider\n config: $config\n credential: $credential\n bucket: $bucket\n )\n }\n";
|
|
10
|
+
export default SpaceSetTargetMutation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.ts
|
|
2
|
+
var e = "\n mutation SpaceSetTargetMutation(\n $domain: String!\n $mode: String!\n $provider: String\n $config: Json\n $credential: String\n $bucket: Json\n ) {\n SpaceSetTarget(\n domain: $domain\n mode: $mode\n provider: $provider\n config: $config\n credential: $credential\n bucket: $bucket\n )\n }\n";
|
|
3
|
+
export { e as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TSpaceTargetAutomationMutation = {
|
|
2
|
+
protected?: boolean;
|
|
3
|
+
hook?: {
|
|
4
|
+
url: string;
|
|
5
|
+
} | {
|
|
6
|
+
removed: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/** A target protected, and its deploy hook made — its address answered this once — or removed. */
|
|
10
|
+
declare const SpaceTargetAutomationMutation = "\n mutation SpaceTargetAutomationMutation($domain: String!, $protected: Boolean, $hook: String) {\n SpaceTargetAutomation(domain: $domain, protected: $protected, hook: $hook)\n }\n";
|
|
11
|
+
export default SpaceTargetAutomationMutation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.ts
|
|
2
|
+
var e = "\n mutation SpaceTargetAutomationMutation($domain: String!, $protected: Boolean, $hook: String) {\n SpaceTargetAutomation(domain: $domain, protected: $protected, hook: $hook)\n }\n";
|
|
3
|
+
export { e as default };
|
|
@@ -34,12 +34,19 @@ import { TSpaceAddResourceMutation } from './Space/resources/SpaceAddResourceMut
|
|
|
34
34
|
import { TSpaceMoveResourceMutation } from './Space/resources/SpaceMoveResourceMutation';
|
|
35
35
|
import { TSpaceRemoveResourceMutation } from './Space/resources/SpaceRemoveResourceMutation';
|
|
36
36
|
import { TSpaceAddPluginMutation } from './Space/SpaceAddPluginMutation';
|
|
37
|
+
import { TSpaceCancelDeployMutation } from './Space/SpaceCancelDeployMutation';
|
|
38
|
+
import { TSpaceCancelScheduledPublishMutation } from './Space/SpaceCancelScheduledPublishMutation';
|
|
37
39
|
import { TSpaceDeployMutation } from './Space/SpaceDeployMutation';
|
|
38
40
|
import { TSpaceFixIssuesMutation } from './Space/SpaceFixIssuesMutation';
|
|
39
41
|
import { TSpacePublishMutation } from './Space/SpacePublishMutation';
|
|
42
|
+
import { TSpaceRedeployMutation } from './Space/SpaceRedeployMutation';
|
|
40
43
|
import { TSpaceRenameElementMutation } from './Space/SpaceRenameElementMutation';
|
|
44
|
+
import { TSpaceRollbackMutation } from './Space/SpaceRollbackMutation';
|
|
41
45
|
import { TSpaceRunE2eTestsMutation } from './Space/SpaceRunE2eTestsMutation';
|
|
46
|
+
import { TSpaceSchedulePublishMutation } from './Space/SpaceSchedulePublishMutation';
|
|
47
|
+
import { TSpaceSetTargetMutation } from './Space/SpaceSetTargetMutation';
|
|
42
48
|
import { TSpaceSetTestsMutation } from './Space/SpaceSetTestsMutation';
|
|
49
|
+
import { TSpaceTargetAutomationMutation } from './Space/SpaceTargetAutomationMutation';
|
|
43
50
|
import { TSpaceUpdatePluginMutation } from './Space/SpaceUpdatePluginMutation';
|
|
44
51
|
export type BuilderMutationsMap = {
|
|
45
52
|
SpaceUpdate: unknown;
|
|
@@ -109,6 +116,13 @@ export type BuilderMutationsMap = {
|
|
|
109
116
|
SpacePublishFlags: TSpacePublishFlagsMutation;
|
|
110
117
|
SpaceFixIssues: TSpaceFixIssuesMutation;
|
|
111
118
|
SpaceDeploy: TSpaceDeployMutation;
|
|
119
|
+
SpaceRollback: TSpaceRollbackMutation;
|
|
120
|
+
SpaceRedeploy: TSpaceRedeployMutation;
|
|
121
|
+
SpaceCancelDeploy: TSpaceCancelDeployMutation;
|
|
122
|
+
SpaceSetTarget: TSpaceSetTargetMutation;
|
|
123
|
+
SpaceCancelScheduledPublish: TSpaceCancelScheduledPublishMutation;
|
|
124
|
+
SpaceSchedulePublish: TSpaceSchedulePublishMutation;
|
|
125
|
+
SpaceTargetAutomation: TSpaceTargetAutomationMutation;
|
|
112
126
|
SpaceUpdateSettings: unknown;
|
|
113
127
|
SpaceSetTests: TSpaceSetTestsMutation;
|
|
114
128
|
SpaceRunE2eTests: TSpaceRunE2eTestsMutation;
|