@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
|
@@ -22,6 +22,9 @@ export declare const styleSheetHref: (hash: string) => string;
|
|
|
22
22
|
export declare const styleSheetLinkable: (cache: string) => boolean;
|
|
23
23
|
/**
|
|
24
24
|
* The stylesheet's text: the cache in the runtime layer, with the layers' order said first — the file may be the first
|
|
25
|
-
* thing on the page to name them, and a plugin's stylesheet arriving later would otherwise take a layer above it
|
|
25
|
+
* thing on the page to name them, and a plugin's stylesheet arriving later would otherwise take a layer above it — and
|
|
26
|
+
* the space's custom CSS after it, in the order the page drew them: the same on every page and for every visitor, it
|
|
27
|
+
* was most of what a page carried inline (44 KB of Plitzi's website's every page) and is kept by the browser with the
|
|
28
|
+
* rest. The page then carries the variables alone, which a request resolves.
|
|
26
29
|
*/
|
|
27
|
-
export declare const styleSheetCss: (cache: string) => string;
|
|
30
|
+
export declare const styleSheetCss: (cache: string, customCss?: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PLUGIN_CSS_LAYER as e, RUNTIME_CSS_LAYER as t } from "./cssLayers.mjs";
|
|
2
2
|
// src/style/runtimeStyle.ts
|
|
3
|
-
var n = "plitzi-runtime-style", r = "plitzi-style", i = "/_plitzi/style/", a = (e) => `${i}${e}.css`, o = (e) => e !== "" && !e.includes("{{"), s = (n) => `@layer ${e}, ${t};@layer ${t}{${n}}`;
|
|
3
|
+
var n = "plitzi-runtime-style", r = "plitzi-style", i = "/_plitzi/style/", a = (e) => `${i}${e}.css`, o = (e) => e !== "" && !e.includes("{{"), s = (n, r = "") => `@layer ${e}, ${t};@layer ${t}{${r ? `${n}\n${r}` : n}}`;
|
|
4
4
|
export { n as RUNTIME_STYLE_ID, r as STYLE_SHEET_ID, i as STYLE_SHEET_PATH, s as styleSheetCss, a as styleSheetHref, o as styleSheetLinkable };
|
|
@@ -375,6 +375,8 @@ export type ActionRejectRecord = {
|
|
|
375
375
|
*/
|
|
376
376
|
export type ActionRunRecord = {
|
|
377
377
|
runId: string;
|
|
378
|
+
/** The W3C trace the run was part of (`sdk-kernel/trace`): every line it logged, on every process, names it. */
|
|
379
|
+
traceId?: string;
|
|
378
380
|
actionId: string;
|
|
379
381
|
spaceId: number;
|
|
380
382
|
environment: Environment;
|
|
@@ -103,6 +103,11 @@ export type AuthContextValue = {
|
|
|
103
103
|
* chose to leave, and sent back to it they were only ever sent to sign in again.
|
|
104
104
|
*/
|
|
105
105
|
signedOutHere?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* The visitor changed their session on this page — signed in, signed out, or did either in another tab — rather than
|
|
108
|
+
* arriving with it. What the page was sent for its first visitor may not be what it would send them now.
|
|
109
|
+
*/
|
|
110
|
+
sessionChangedHere?: boolean;
|
|
106
111
|
user?: {
|
|
107
112
|
details?: {
|
|
108
113
|
id: number;
|
|
@@ -4,6 +4,7 @@ import { SnippetStyle } from './SnippetTypes';
|
|
|
4
4
|
import { SpaceTests } from './TestTypes';
|
|
5
5
|
import { BuiltinParam } from '../authoring/paramSpec';
|
|
6
6
|
import { RuleGroup } from '../conditions/types';
|
|
7
|
+
import { AiCrawlerKind } from '../schema/aiCrawlers';
|
|
7
8
|
import { ElementMotion } from '../schema/motion';
|
|
8
9
|
/** The `when` guard a binding, a flag rule and a sub-value are written with: part of the document, so exported with it. */
|
|
9
10
|
export type { RuleGroup };
|
|
@@ -261,11 +262,25 @@ export type Schema = {
|
|
|
261
262
|
*/
|
|
262
263
|
robotsTxt?: string;
|
|
263
264
|
/**
|
|
264
|
-
*
|
|
265
|
-
* the
|
|
266
|
-
*
|
|
265
|
+
* The site's `/.well-known/security.txt` (RFC 9116), as a researcher who found a flaw reads it: where to write
|
|
266
|
+
* (`Contact:`), until when the text holds (`Expires:`), and anything else the RFC names. Left out, the address answers
|
|
267
|
+
* 404 — a site that says nothing is not given words it did not write.
|
|
267
268
|
*/
|
|
268
|
-
|
|
269
|
+
securityTxt?: string;
|
|
270
|
+
/**
|
|
271
|
+
* The space's `/llms.txt` (llmstxt.org), as an assistant reads it to find its way around: the site's name, what it
|
|
272
|
+
* is, and a link to each page with what it is for. Left out, the server writes one from the pages the sitemap lists
|
|
273
|
+
* — each page's SEO title and description. A space that keeps `assistants` out (`blockAiCrawlers`) answers 404:
|
|
274
|
+
* an index for them would invite what the site refuses.
|
|
275
|
+
*/
|
|
276
|
+
llmsTxt?: string;
|
|
277
|
+
/**
|
|
278
|
+
* The kinds of AI crawler kept out of the whole site, each its owner's to decide (`AI_CRAWLERS`): `training` (GPTBot,
|
|
279
|
+
* ClaudeBot, Google-Extended…), `assistants` fetching a page for a person (ChatGPT-User, Claude-User…) and AI
|
|
280
|
+
* `search` indexes (OAI-SearchBot, PerplexityBot…). `/robots.txt` says `Disallow: /` to each agent of each kind named,
|
|
281
|
+
* after whatever `robotsTxt` says. Search engines keep reading it. Left out, nobody is kept out.
|
|
282
|
+
*/
|
|
283
|
+
blockAiCrawlers?: AiCrawlerKind[];
|
|
269
284
|
/**
|
|
270
285
|
* A move from page to page drawn as one view becoming the next (the browser's view transitions): the pages cross-fade,
|
|
271
286
|
* and an element named the same on both by CSS — `view-transition-name: fighter-portrait` — moves from where it was
|
|
@@ -283,6 +298,11 @@ export type Schema = {
|
|
|
283
298
|
* yours" there, as on any page. Left out, the platform's few words. A page with an `access` of its own cannot be it.
|
|
284
299
|
*/
|
|
285
300
|
withheldPage?: string;
|
|
301
|
+
/**
|
|
302
|
+
* Sends the whole space with every page instead of in parts — the page's own elements and its layouts', the rest
|
|
303
|
+
* fetched as a link to it is followed. For a space whose pages read each other's elements at run time.
|
|
304
|
+
*/
|
|
305
|
+
wholeDocument?: boolean;
|
|
286
306
|
/** The language its pages are written in, as a language tag (`en`, `es-MX`): `<html lang>` and `og:locale`. */
|
|
287
307
|
language?: string;
|
|
288
308
|
/** The tab's icon: a file of the site (`/favicon.svg`) or an address (`https://…`). Left out, Plitzi's. */
|
|
@@ -378,6 +398,13 @@ export type Schema = {
|
|
|
378
398
|
pages: Element['id'][];
|
|
379
399
|
pageFolders: PageFolder[];
|
|
380
400
|
components: Record<SpaceComponent['id'], SpaceComponent>;
|
|
401
|
+
/**
|
|
402
|
+
* Only in a document a page server sends in parts (`splitSchema`): the roots — pages and layouts — whose elements are
|
|
403
|
+
* not in `flat` yet, each by the name of the part that holds them, fetched before a page that needs it is drawn; `''`
|
|
404
|
+
* for one this visitor is not sent, which only the server can draw. Absent, the document is whole: the SDK alone, the
|
|
405
|
+
* builder, the MCP and a static deploy never see it.
|
|
406
|
+
*/
|
|
407
|
+
parts?: Record<string, string>;
|
|
381
408
|
};
|
|
382
409
|
export type SchemaContextValue = {
|
|
383
410
|
definition?: {
|
|
@@ -3,6 +3,12 @@ export type SSRRenderResult = {
|
|
|
3
3
|
status?: number;
|
|
4
4
|
redirect?: string;
|
|
5
5
|
headers?: Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* What the page's elements need done as soon as the page is parsed, before it paints and before React is there —
|
|
8
|
+
* by name, each an expression of plain JavaScript the page runs once (`usePrePaint`). What only the browser knows (the
|
|
9
|
+
* address's hash, the window's size) cannot be drawn by the server: an element that draws by it says so here.
|
|
10
|
+
*/
|
|
11
|
+
prePaint?: Record<string, string>;
|
|
6
12
|
};
|
|
7
13
|
/**
|
|
8
14
|
* How a plugin's build reaches the page.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActionDocument } from './ActionTypes';
|
|
2
2
|
import { Environment } from './CommonTypes';
|
|
3
3
|
import { ConnectorManifestDraft } from './ConnectorTypes';
|
|
4
|
-
export type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom' | 'smtp';
|
|
4
|
+
export type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom' | 'smtp' | 'github' | 'cloudflare' | 'netlify' | 'vercel' | 'ftp';
|
|
5
5
|
/**
|
|
6
6
|
* A connector manifest as the builder sees it.
|
|
7
7
|
*
|
|
@@ -107,15 +107,193 @@ export type SpaceDeployment = {
|
|
|
107
107
|
domain: string;
|
|
108
108
|
isVerified: boolean;
|
|
109
109
|
default: boolean;
|
|
110
|
-
/**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
provider: 'ssr' | 's3' | 'r2';
|
|
110
|
+
/** What serves it: Plitzi's page servers (`ssr`), or the provider holding a copy of the site. */
|
|
111
|
+
provider: 'ssr' | DeployProviderId;
|
|
112
|
+
/** How it serves the space. */
|
|
113
|
+
mode: DeployMode;
|
|
115
114
|
credential: SpaceCredential | null;
|
|
115
|
+
/** The deploy a publish or rollback queued, on a target holding a copy of the site. */
|
|
116
|
+
deployId?: number | null;
|
|
116
117
|
createdAt: number;
|
|
117
118
|
updatedAt: number;
|
|
118
119
|
};
|
|
120
|
+
/** How a domain serves its space: Plitzi's page servers, an SPA, every page prerendered, or a server of
|
|
121
|
+
* the owner's own. */
|
|
122
|
+
export type DeployMode = 'ssr' | 'spa' | 'static' | 'selfHosted';
|
|
123
|
+
/** The providers a copy of the site may be deployed to — the server's `deploys/providers`. */
|
|
124
|
+
export type DeployProviderId = 'github' | 's3' | 'amplify' | 'r2' | 'cloudflarePages' | 'netlify' | 'vercel' | 'ftp' | 'download' | 'selfHosted';
|
|
125
|
+
export type DeployStatus = 'queued' | 'building' | 'uploading' | 'succeeded' | 'failed' | 'canceled';
|
|
126
|
+
/** One deploy as a list says it. */
|
|
127
|
+
export type SpaceDeploySummary = {
|
|
128
|
+
id: number;
|
|
129
|
+
domain: string;
|
|
130
|
+
kind: 'deploy' | 'redeploy' | 'rollback';
|
|
131
|
+
status: DeployStatus;
|
|
132
|
+
environment: Environment;
|
|
133
|
+
revision: number;
|
|
134
|
+
mode: DeployMode;
|
|
135
|
+
provider: DeployProviderId;
|
|
136
|
+
error: string | null;
|
|
137
|
+
url: string | null;
|
|
138
|
+
reference: string | null;
|
|
139
|
+
files: number | null;
|
|
140
|
+
bytes: number | null;
|
|
141
|
+
/** Kept: downloadable, and shipped again by a rollback without rebuilding. */
|
|
142
|
+
kept: boolean;
|
|
143
|
+
by: {
|
|
144
|
+
id: number;
|
|
145
|
+
username: string;
|
|
146
|
+
} | null;
|
|
147
|
+
/** UTC seconds. */
|
|
148
|
+
createdAt: number;
|
|
149
|
+
startedAt: number | null;
|
|
150
|
+
finishedAt: number | null;
|
|
151
|
+
};
|
|
152
|
+
/** The SDK, React and `@plitzi/sdk-server` a build runs. */
|
|
153
|
+
export type DeployVersions = {
|
|
154
|
+
sdk: string;
|
|
155
|
+
react: string;
|
|
156
|
+
sdkServer: string;
|
|
157
|
+
};
|
|
158
|
+
/** One deploy with what it said as it ran. */
|
|
159
|
+
export type SpaceDeployDetail = SpaceDeploySummary & {
|
|
160
|
+
log: {
|
|
161
|
+
at: number;
|
|
162
|
+
level: 'info' | 'warn' | 'error';
|
|
163
|
+
line: string;
|
|
164
|
+
}[];
|
|
165
|
+
versions: DeployVersions | null;
|
|
166
|
+
};
|
|
167
|
+
/** A setting of a provider, or of every target holding a copy (`targetFields`). */
|
|
168
|
+
export type DeployProviderField = {
|
|
169
|
+
key: string;
|
|
170
|
+
label: string;
|
|
171
|
+
required: boolean;
|
|
172
|
+
hint?: string;
|
|
173
|
+
example?: string;
|
|
174
|
+
};
|
|
175
|
+
/** A provider as the console and the builder offer it. */
|
|
176
|
+
export type DeployProviderInfo = {
|
|
177
|
+
id: DeployProviderId;
|
|
178
|
+
label: string;
|
|
179
|
+
description: string;
|
|
180
|
+
modes: DeployMode[];
|
|
181
|
+
signIn: {
|
|
182
|
+
kind: 'credential';
|
|
183
|
+
credential: string;
|
|
184
|
+
fields: string[];
|
|
185
|
+
} | {
|
|
186
|
+
kind: 'bucket';
|
|
187
|
+
cdn: 's3' | 'r2';
|
|
188
|
+
} | {
|
|
189
|
+
kind: 'none';
|
|
190
|
+
};
|
|
191
|
+
atomic: boolean;
|
|
192
|
+
fields: DeployProviderField[];
|
|
193
|
+
};
|
|
194
|
+
/** One domain of a space as a target: how it serves the space and where it stands. */
|
|
195
|
+
export type SpaceTarget = {
|
|
196
|
+
id: number;
|
|
197
|
+
domain: string;
|
|
198
|
+
verified: boolean;
|
|
199
|
+
/** A host of Plitzi's own (the space's address, or one of the platform's): always served by its page servers. */
|
|
200
|
+
plitziOwned: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* The space's own address (`<space>.plitzi.app`): it shows the draft as it is saved, always — what is published on
|
|
203
|
+
* it is never what it serves, so it is no place to publish a version to (a domain of the space's own is).
|
|
204
|
+
*/
|
|
205
|
+
ownAddress: boolean;
|
|
206
|
+
mode: DeployMode;
|
|
207
|
+
provider: 'ssr' | DeployProviderId;
|
|
208
|
+
providerLabel: string;
|
|
209
|
+
atomic: boolean;
|
|
210
|
+
environment: Environment;
|
|
211
|
+
/** Pinned; none follows its environment's latest. */
|
|
212
|
+
revision: number | null;
|
|
213
|
+
/** What it serves, and what rolling it back would put back. */
|
|
214
|
+
serves: SpaceServedVersion | null;
|
|
215
|
+
rollback: SpaceServedVersion | null;
|
|
216
|
+
/** Its provider's settings and every target's (`basePath`, `staticPaths`), as kept. */
|
|
217
|
+
config: Record<string, unknown> | null;
|
|
218
|
+
credential: {
|
|
219
|
+
identifier: string;
|
|
220
|
+
name: string;
|
|
221
|
+
} | null;
|
|
222
|
+
bucket: {
|
|
223
|
+
identifier: string;
|
|
224
|
+
name: string;
|
|
225
|
+
cdn: {
|
|
226
|
+
identifier: string;
|
|
227
|
+
name: string;
|
|
228
|
+
};
|
|
229
|
+
} | null;
|
|
230
|
+
protected: boolean;
|
|
231
|
+
hook: boolean;
|
|
232
|
+
lastDeploy: SpaceDeploySummary | null;
|
|
233
|
+
running: SpaceDeploySummary | null;
|
|
234
|
+
/** Newer versions than it runs, said. */
|
|
235
|
+
update: {
|
|
236
|
+
words: string;
|
|
237
|
+
runs: DeployVersions;
|
|
238
|
+
newest: DeployVersions;
|
|
239
|
+
} | null;
|
|
240
|
+
/** Its plan no longer includes its kind of deploy. */
|
|
241
|
+
locked: {
|
|
242
|
+
error: string;
|
|
243
|
+
requires: string;
|
|
244
|
+
upgradeUrl: string;
|
|
245
|
+
} | null;
|
|
246
|
+
/** A server of the owner's own past the oldest version Plitzi answers: rebuilt before it is served again. */
|
|
247
|
+
required: string | null;
|
|
248
|
+
};
|
|
249
|
+
export type SpaceTargets = {
|
|
250
|
+
targets: SpaceTarget[];
|
|
251
|
+
providers: DeployProviderInfo[];
|
|
252
|
+
targetFields: (DeployProviderField & {
|
|
253
|
+
modes: DeployMode[];
|
|
254
|
+
})[];
|
|
255
|
+
limits: {
|
|
256
|
+
deployTargets: number;
|
|
257
|
+
keptArtifacts: number;
|
|
258
|
+
deployMinutesPerMonth: number | null;
|
|
259
|
+
};
|
|
260
|
+
deployMinutes: {
|
|
261
|
+
used: number;
|
|
262
|
+
limit: number | null;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
/** A publish set for later: published when due, as whoever set it — or why it was not. */
|
|
266
|
+
export type SpaceScheduledPublish = {
|
|
267
|
+
id: number;
|
|
268
|
+
domain: string;
|
|
269
|
+
environment: Environment;
|
|
270
|
+
revision: number;
|
|
271
|
+
/** UTC seconds. */
|
|
272
|
+
at: number;
|
|
273
|
+
status: 'pending' | 'published' | 'failed' | 'canceled';
|
|
274
|
+
error: string | null;
|
|
275
|
+
by: {
|
|
276
|
+
id: number;
|
|
277
|
+
username: string;
|
|
278
|
+
} | null;
|
|
279
|
+
};
|
|
280
|
+
/** What publishing a revision on a domain would do, before it does. */
|
|
281
|
+
export type SpacePublishCheck = {
|
|
282
|
+
domain: string;
|
|
283
|
+
mode: DeployMode;
|
|
284
|
+
revision: number;
|
|
285
|
+
deploy: {
|
|
286
|
+
needed: boolean;
|
|
287
|
+
reasons: string[];
|
|
288
|
+
};
|
|
289
|
+
/** What of the revision runs on a server: on Plitzi for an SPA, impossible for a prerendered site. */
|
|
290
|
+
serverFeatures: string[];
|
|
291
|
+
locked: {
|
|
292
|
+
error: string;
|
|
293
|
+
requires: string;
|
|
294
|
+
upgradeUrl: string;
|
|
295
|
+
} | null;
|
|
296
|
+
};
|
|
119
297
|
/**
|
|
120
298
|
* What one version of a space is made of: the draft (`main`) a snapshot would freeze, or a snapshot as it was frozen.
|
|
121
299
|
* Counts and names, never contents — what the builder shows before a snapshot is made, and what `plitzi create --from`
|
|
@@ -152,3 +330,96 @@ export type SpaceVersionContents = {
|
|
|
152
330
|
source: boolean;
|
|
153
331
|
} | null;
|
|
154
332
|
};
|
|
333
|
+
/** One snapshot as the publish sheet lists it: its words, its moment, who made it and the domains serving it now. */
|
|
334
|
+
export type SpaceSnapshot = {
|
|
335
|
+
environment: Environment;
|
|
336
|
+
revision: number;
|
|
337
|
+
description: string;
|
|
338
|
+
/** ISO 8601, UTC. */
|
|
339
|
+
publishedAt: string;
|
|
340
|
+
/** None for a snapshot made before its author was kept. */
|
|
341
|
+
by: {
|
|
342
|
+
id: number;
|
|
343
|
+
username: string;
|
|
344
|
+
} | null;
|
|
345
|
+
domains: string[];
|
|
346
|
+
/** Where a member looks at it before any domain serves it: its own address, never for search. */
|
|
347
|
+
previewUrl: string;
|
|
348
|
+
};
|
|
349
|
+
/** A version as a domain serves it: an environment and a revision of it, 0 for the draft. */
|
|
350
|
+
export type SpaceServedVersion = {
|
|
351
|
+
environment: Environment;
|
|
352
|
+
revision: number;
|
|
353
|
+
};
|
|
354
|
+
/** One move of a domain: what it serves from then on, what it served before, who and why. */
|
|
355
|
+
export type SpaceRelease = {
|
|
356
|
+
id: number;
|
|
357
|
+
domain: string;
|
|
358
|
+
environment: Environment;
|
|
359
|
+
revision: number;
|
|
360
|
+
followsLatest: boolean;
|
|
361
|
+
previous: SpaceServedVersion | null;
|
|
362
|
+
kind: 'publish' | 'rollback';
|
|
363
|
+
/** The deploy that shipped it, on a target holding a copy of the site. */
|
|
364
|
+
deployId: number | null;
|
|
365
|
+
by: {
|
|
366
|
+
id: number;
|
|
367
|
+
username: string;
|
|
368
|
+
} | null;
|
|
369
|
+
/** Unix seconds. */
|
|
370
|
+
at: number;
|
|
371
|
+
};
|
|
372
|
+
/** A domain's releases, newest first, and what rolling it back would serve — none when there is nothing before. */
|
|
373
|
+
export type SpaceReleases = {
|
|
374
|
+
releases: SpaceRelease[];
|
|
375
|
+
rollback: SpaceServedVersion | null;
|
|
376
|
+
};
|
|
377
|
+
/** A space's domain as its releases read it: what it serves now, and what a rollback would put back. */
|
|
378
|
+
export type SpaceDomainRelease = {
|
|
379
|
+
domain: string;
|
|
380
|
+
verified: boolean;
|
|
381
|
+
serves: SpaceServedVersion | null;
|
|
382
|
+
followsLatest: boolean;
|
|
383
|
+
rollback: SpaceServedVersion | null;
|
|
384
|
+
/** Where its site is: `Plitzi`, or a copy on a provider (`GitHub Pages · SPA`). */
|
|
385
|
+
where?: string;
|
|
386
|
+
/** What it asks of a publisher, when anything: a deploy that failed, newer versions out, a plan that dropped it. */
|
|
387
|
+
asks?: string;
|
|
388
|
+
};
|
|
389
|
+
/** How a publish or a rollback went: the release it recorded, or the platform's refusal in its own words. */
|
|
390
|
+
export type SpaceReleaseOutcome = {
|
|
391
|
+
done: true;
|
|
392
|
+
release: SpaceRelease;
|
|
393
|
+
/** The deploy it queued, on a domain whose site a provider holds. */ deployId?: number;
|
|
394
|
+
} | {
|
|
395
|
+
done: false;
|
|
396
|
+
reason: string;
|
|
397
|
+
code?: string;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* What changes going from one version of a space to another — the draft against a snapshot (what a snapshot would
|
|
401
|
+
* freeze), a snapshot against what a domain serves (what a publish would change): pages by name, the rest counted.
|
|
402
|
+
*/
|
|
403
|
+
export type SpaceVersionChanges = {
|
|
404
|
+
pages: {
|
|
405
|
+
added: string[];
|
|
406
|
+
removed: string[];
|
|
407
|
+
changed: string[];
|
|
408
|
+
};
|
|
409
|
+
layouts: number;
|
|
410
|
+
components: number;
|
|
411
|
+
styles: boolean;
|
|
412
|
+
fonts: boolean;
|
|
413
|
+
settings: boolean;
|
|
414
|
+
plugins: {
|
|
415
|
+
added: string[];
|
|
416
|
+
removed: string[];
|
|
417
|
+
changed: string[];
|
|
418
|
+
};
|
|
419
|
+
actions: number;
|
|
420
|
+
connectors: number;
|
|
421
|
+
functions: boolean;
|
|
422
|
+
runtime: boolean;
|
|
423
|
+
/** How many of these differ: 0 is the same version twice. */
|
|
424
|
+
total: number;
|
|
425
|
+
};
|
|
@@ -121,6 +121,11 @@ export type CommonState = {
|
|
|
121
121
|
href: string;
|
|
122
122
|
currentPageId: string;
|
|
123
123
|
navigate: (url: string, how?: NavigateHow) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Gets ready what following a link to `url` will need — the parts of the space its page is drawn from, when the
|
|
126
|
+
* space is sent in parts — so the navigation does not wait for them. Nothing when there is nothing to get.
|
|
127
|
+
*/
|
|
128
|
+
prefetch?: (url: string) => void;
|
|
124
129
|
/**
|
|
125
130
|
* Where a navigation is going while it waits for the destination's server data — `''` when none is. A link to a
|
|
126
131
|
* page resolved on the server asks for that page's data before it goes, and the page on screen stays until then:
|
|
@@ -302,6 +307,12 @@ export type BuilderState = CommonState & {
|
|
|
302
307
|
* editing — a journey that met a guarded page passed on the server and failed here. Editor-only and never published.
|
|
303
308
|
*/
|
|
304
309
|
journeyOnCanvas?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* The canvas shown to a guest — chosen in the State Manager's Visitor tab: the page as a visitor with no session sees
|
|
312
|
+
* it, where it otherwise shows the editor's own. A test account is laid over it as `runtime.testAccount` instead.
|
|
313
|
+
* Editor-only and never published; a journey on the canvas decides its own visitor.
|
|
314
|
+
*/
|
|
315
|
+
canvasGuest?: boolean;
|
|
305
316
|
displayMode: DisplayMode;
|
|
306
317
|
selector?: string;
|
|
307
318
|
styleSelector?: string;
|