@plitzi/sdk-server 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 +33 -0
- package/README.md +50 -8
- package/dist/adapters/cloudAdapters.d.ts +7 -0
- package/dist/adapters/space/index.d.ts +2 -0
- package/dist/adapters/space/resolvers.d.ts +14 -3
- package/dist/adapters/space/snapshotPreview.d.ts +45 -0
- package/dist/adapters/space/types.d.ts +4 -1
- package/dist/auth.d.ts +3 -2
- package/dist/auth.js +26 -107
- package/dist/cache.js +1 -1
- package/dist/chunks/{buildBody-W9D8ySNY.js → buildBody-Bm398uxH.js} +893 -114
- package/dist/chunks/{core-TlrWmT4B.js → core-CoKORAOg.js} +234 -26
- package/dist/chunks/{createServer-Bd_b7T3k.js → createServer-BSmQqzwb.js} +186 -639
- package/dist/chunks/{platform-DhdFYWm5.js → platform-BTssQQXp.js} +2 -2
- package/dist/chunks/sdkAssets-CXGoc_WE.js +60 -0
- package/dist/chunks/throttle-CRiZB6_A.js +330 -0
- package/dist/chunks/{token-B2uY9JzU.js → token-XEz1n4jp.js} +1 -1
- package/dist/chunks/views/template.ejs +12 -0
- package/dist/core/auth/api/context.d.ts +4 -4
- package/dist/core/auth/api/values.d.ts +6 -0
- package/dist/core/auth/createAuth.d.ts +1 -1
- package/dist/core/auth/throttle.d.ts +54 -4
- package/dist/core/createServer.d.ts +1 -1
- package/dist/core/platform.d.ts +1 -1
- package/dist/core/services/iconFaces.d.ts +3 -0
- package/dist/core/services/llmsTxt.d.ts +15 -0
- package/dist/core/services/robotsTxt.d.ts +5 -9
- package/dist/core/services/securityTxt.d.ts +10 -0
- package/dist/deploy/aws/s3.d.ts +51 -0
- package/dist/deploy/aws/sigv4.d.ts +33 -0
- package/dist/deploy/contentType.d.ts +2 -0
- package/dist/deploy/fingerprint.d.ts +18 -0
- package/dist/deploy/folder.d.ts +6 -0
- package/dist/deploy/ftp.d.ts +27 -0
- package/dist/deploy/sdkFiles.d.ts +11 -0
- package/dist/deploy/spaShell.d.ts +35 -0
- package/dist/deploy/staticSite.d.ts +44 -0
- package/dist/deploy/types.d.ts +58 -0
- package/dist/deploy/zip.d.ts +8 -0
- package/dist/deploy.d.ts +24 -0
- package/dist/deploy.js +938 -0
- package/dist/handlers.js +1 -1
- package/dist/helpers/documentParts.d.ts +10 -0
- package/dist/helpers/ownVersion.d.ts +1 -0
- package/dist/helpers/paintedCookie.d.ts +15 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/modules/icons/glyphs.d.ts +21 -0
- package/dist/modules/icons/handler.d.ts +11 -0
- package/dist/modules/icons/spaceIcons.d.ts +26 -0
- package/dist/modules/rsc/connectorRscData.d.ts +4 -2
- package/dist/modules/rsc/resolveRscData.d.ts +4 -1
- package/dist/modules/ssr/csrfHint.d.ts +12 -0
- package/dist/modules/ssr/defaultFavicon.d.ts +1 -1
- package/dist/modules/ssr/spaceDocument.d.ts +8 -1
- package/dist/oauth.js +1 -1
- package/dist/platform.d.ts +1 -1
- package/dist/platform.js +1 -1
- package/dist/project.js +3 -3
- package/dist/spaces.d.ts +2 -2
- package/dist/spaces.js +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +1 -1
- package/dist/types/config.d.ts +24 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +17 -13
- package/skills/plitzi-authoring/recipes/accordion.ts +3 -1
- package/skills/plitzi-authoring/recipes/carousel.ts +68 -63
- package/skills/plitzi-authoring/recipes/detail-page.ts +43 -33
- package/skills/plitzi-authoring/recipes/embed-and-svg.ts +16 -11
- package/skills/plitzi-authoring/recipes/every-few-seconds.ts +52 -42
- package/skills/plitzi-authoring/recipes/feature-flag.ts +7 -2
- package/skills/plitzi-authoring/recipes/filter-a-list.ts +39 -31
- package/skills/plitzi-authoring/recipes/forms-and-modals.ts +34 -28
- package/skills/plitzi-authoring/recipes/from-tailwind.ts +11 -6
- package/skills/plitzi-authoring/recipes/link-to-a-section.ts +11 -6
- package/skills/plitzi-authoring/recipes/link-with-data.ts +21 -16
- package/skills/plitzi-authoring/recipes/marquee.ts +17 -12
- package/skills/plitzi-authoring/recipes/plugin.ts +16 -10
- package/skills/plitzi-authoring/recipes/scroll-a-row.ts +30 -25
- package/skills/plitzi-authoring/recipes/server-data.ts +15 -10
- package/skills/plitzi-authoring/recipes/show-data.ts +32 -24
- package/skills/plitzi-authoring/recipes/style-a-page.ts +9 -4
- package/skills/plitzi-authoring/recipes/typed-data.ts +26 -21
- package/skills/plitzi-authoring/recipes/usable-without-sight.ts +16 -11
- package/skills/plitzi-authoring/reference/authoring-errors.md +11 -4
- package/skills/plitzi-authoring/reference/efficiency.md +3 -1
- package/skills/plitzi-authoring/reference/layouts.md +2 -1
- package/dist/chunks/throttle-BH7JLIOF.js +0 -108
package/dist/handlers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as authRoutes, n as renewForNavigation, r as applySessionOutcome, t as isDocumentNavigation } from "./chunks/renewal-D98v6-Jd.js";
|
|
2
|
-
import { a as handleRegister, b as protectedResourceMetadata, i as handleAuthorizeSubmit, l as sendErrorJson, n as handleToken, r as handleAuthorizeStart, t as handleRevoke, y as authorizationServerMetadata } from "./chunks/token-
|
|
2
|
+
import { a as handleRegister, b as protectedResourceMetadata, i as handleAuthorizeSubmit, l as sendErrorJson, n as handleToken, r as handleAuthorizeStart, t as handleRevoke, y as authorizationServerMetadata } from "./chunks/token-XEz1n4jp.js";
|
|
3
3
|
import { serverLog } from "@plitzi/sdk-kernel/log";
|
|
4
4
|
import { authFailureMessage, carrierOf, createAuthorizer, csrfFailureMessage } from "@plitzi/sdk-kernel/identity";
|
|
5
5
|
// src/core/handlers/authRouteHandlers.ts
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Whether this space is sent in parts: unless it asks for the whole (`settings.wholeDocument`), or has a single page —
|
|
4
|
+
* nothing to fetch later, so the shell would only be split for nothing.
|
|
5
|
+
*/
|
|
6
|
+
export declare const sentInParts: (schema: Schema) => boolean;
|
|
7
|
+
/** The schema a page is sent with: the shell, that page's part and its layouts' — the same object for every visit. */
|
|
8
|
+
export declare const pageSchemaOf: (schema: Schema, withheld: readonly string[], pageId: string) => Schema;
|
|
9
|
+
/** A part's text by its name, for this group of visitors; none for a name their shell does not give. */
|
|
10
|
+
export declare const partTextOf: (schema: Schema, withheld: readonly string[], name: string) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ownVersion: () => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { SSRPaintedDefaults } from '../types/config';
|
|
1
2
|
import { SSRRequest } from '@plitzi/sdk-kernel/types';
|
|
2
|
-
import { Schema } from '@plitzi/sdk-shared';
|
|
3
|
+
import { Environment, Schema } from '@plitzi/sdk-shared';
|
|
3
4
|
/**
|
|
4
5
|
* The name the painted state of a server-rendered page is kept under, for this request's host.
|
|
5
6
|
*
|
|
@@ -19,3 +20,16 @@ export declare const requestPaintedState: (req: Pick<SSRRequest, "headers" | "ho
|
|
|
19
20
|
keys: ReadonlySet<string>;
|
|
20
21
|
state: Record<string, unknown> | undefined;
|
|
21
22
|
};
|
|
23
|
+
type PaintedState = ReturnType<typeof requestPaintedState>;
|
|
24
|
+
/**
|
|
25
|
+
* `requestPaintedState` with the deployment's defaults (`paintedDefaults`) for the keys the cookie holds none of — for
|
|
26
|
+
* an account the request proved, never a guest: a guest's page is cached for every guest, and a default is an
|
|
27
|
+
* account's. Another account's entry holds nothing for this one (`paintedStateFor`), so after a change of account the
|
|
28
|
+
* defaults are this account's. A deployment that fails to answer is said in the log, and the page is drawn without.
|
|
29
|
+
*/
|
|
30
|
+
export declare const requestPaintedStateWithDefaults: (req: Pick<SSRRequest, "headers" | "hostname">, settings: Pick<Schema["settings"], "keepState" | "paintedState" | "browserState"> | undefined, scope: {
|
|
31
|
+
spaceId: number;
|
|
32
|
+
environment: Environment;
|
|
33
|
+
account: number | string | undefined;
|
|
34
|
+
}, defaults: SSRPaintedDefaults | undefined) => Promise<PaintedState>;
|
|
35
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ export type { PubSubAdapter, SSRRealtimeConfig } from '@plitzi/sdk-shared';
|
|
|
21
21
|
export type { ResolvedServices, ServerConfig } from './core/createServer';
|
|
22
22
|
export type { AuthoringHost, AuthoringHostConfig } from './hosts/authoringHost';
|
|
23
23
|
export type { PipelineExtensions, SSRContext } from './core/http/pageContext';
|
|
24
|
-
export type { CacheFilter, CacheManager, PluginRegistry, SSRCacheConfig, SSRFontsConfig, SSRImagesConfig, SSRPageServerConfig, SSRPlugin, SSRRenderLimitConfig, SSRRscConfig, SSRServer, SSRServerConfig, SSRSignInConfig, SSRTemplateFn, SSRVisitorCredentialsConfig, ServerServices, SharedPage, SharedPageFacts, SharedPageStore } from './types';
|
|
24
|
+
export type { CacheFilter, CacheManager, PluginRegistry, SSRCacheConfig, SSRFontsConfig, SSRImagesConfig, SSRPageServerConfig, SSRPaintedDefaults, SSRPaintedDefaultsContext, SSRPlugin, SSRRenderLimitConfig, SSRRscConfig, SSRServer, SSRServerConfig, SSRSignInConfig, SSRTemplateFn, SSRVisitorCredentialsConfig, ServerServices, SharedPage, SharedPageFacts, SharedPageStore } from './types';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as resolveRscData, t as createServer } from "./chunks/createServer-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as resolveRscData, t as createServer } from "./chunks/createServer-BSmQqzwb.js";
|
|
2
|
+
import { L as createCacheInvalidator, _ as createCloudAdapters, c as fixedSpace, d as verifiedDomain, dt as DEFAULT_IGNORED_QUERY_PARAMS, f as wildcardSubdomain, g as createJsonAdapters, h as createAuthAdapters, l as presentsCredential, m as refuse, n as createSpaceAdapters, p as createMemoryCache, s as authoringPreview, t as createRedisPageStore, u as renderGrant } from "./chunks/core-CoKORAOg.js";
|
|
3
|
+
import { E as takeDraftOverride, _ as resolveServices, w as createMemoryDraftStore } from "./chunks/buildBody-Bm398uxH.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { serverLog } from "@plitzi/sdk-kernel/log";
|
|
6
6
|
import { isRecord } from "@plitzi/sdk-shared/helpers";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** A face of the icon font, as the SDK's icon stylesheet declares it: the family, the weight and its file. */
|
|
2
|
+
export type IconFace = {
|
|
3
|
+
key: 'solid' | 'regular' | 'brands';
|
|
4
|
+
family: string;
|
|
5
|
+
weight: string;
|
|
6
|
+
file: string;
|
|
7
|
+
};
|
|
8
|
+
/** Every icon name the SDK's sheet draws, its glyph, and which names are the brands' face. */
|
|
9
|
+
export type IconGlyphs = {
|
|
10
|
+
codepoints: ReadonlyMap<string, number>;
|
|
11
|
+
brands: ReadonlySet<string>;
|
|
12
|
+
faces: IconFace[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The SDK's icon stylesheet read for what it draws: each name's glyph, the faces and their files. The sheet is Font
|
|
16
|
+
* Awesome's sheets one after another (`apps/sdk`'s `iconsPlugin`), the brands' last: a name declared after the brands'
|
|
17
|
+
* face is a brand.
|
|
18
|
+
*/
|
|
19
|
+
export declare const parseIconGlyphs: (css: string) => IconGlyphs;
|
|
20
|
+
/** The glyphs of the SDK installed at `sdkDir`, read once per process. */
|
|
21
|
+
export declare const iconGlyphsAt: (sdkDir: string) => IconGlyphs;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TtlCache } from '../../helpers/cache';
|
|
2
|
+
import { SSRPageServerConfig } from '../../types';
|
|
3
|
+
import { SSRRequest, SSRResponseHelpers } from '@plitzi/sdk-kernel/types';
|
|
4
|
+
import { OfflineDataRaw } from '@plitzi/sdk-shared';
|
|
5
|
+
/**
|
|
6
|
+
* A face of the icon font cut to the glyphs the space names (`spaceIconsOf`), linked by its pages' heads — answered by
|
|
7
|
+
* whichever replica the request reaches, from the space as the request resolves it, as the stylesheet is. The name is
|
|
8
|
+
* the glyphs': asked for by the name it has now, it is kept for good; by an older one, it answers the space's glyphs as
|
|
9
|
+
* they are, kept by nobody — a glyph either lacks is drawn from the whole font all the same.
|
|
10
|
+
*/
|
|
11
|
+
export declare const handleIconFace: (req: SSRRequest, res: SSRResponseHelpers, config: SSRPageServerConfig, sdkDir: string | undefined, offlineDataCache?: TtlCache<OfflineDataRaw>) => Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IconFace, IconGlyphs } from './glyphs';
|
|
2
|
+
import { OfflineDataRaw } from '@plitzi/sdk-shared';
|
|
3
|
+
/** Where a space's own icon faces are served: `/_plitzi/icons/<hash>-<face>.woff2`. */
|
|
4
|
+
export declare const ICONS_PATH = "/_plitzi/icons/";
|
|
5
|
+
/** One face cut to the glyphs a space names. */
|
|
6
|
+
export type SpaceIconFace = IconFace & {
|
|
7
|
+
codepoints: number[];
|
|
8
|
+
href: string;
|
|
9
|
+
};
|
|
10
|
+
/** The icons a space names, as faces of their own: what the page's head declares after the whole font's. */
|
|
11
|
+
export type SpaceIcons = {
|
|
12
|
+
hash: string;
|
|
13
|
+
faces: SpaceIconFace[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The glyphs a space names anywhere in its document — an attribute, a component's props, a binding's template, a flow's
|
|
17
|
+
* params: `'fas fa-check'` and both sides of `open ? 'fa-chevron-up' : 'fa-chevron-down'` alike. An icon named only by
|
|
18
|
+
* data the space reads at run time is not here, and needs nothing: the whole font is declared before these faces, so
|
|
19
|
+
* the browser draws a glyph these lack from it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const spaceIconsOf: (offlineData: OfflineDataRaw, glyphs: IconGlyphs) => SpaceIcons | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The faces as the head declares them. Declared after the whole font's, a face with a `unicode-range` is the one a
|
|
24
|
+
* glyph in its range is drawn from: the page fetches the space's few glyphs, not the whole font.
|
|
25
|
+
*/
|
|
26
|
+
export declare const iconFacesCss: (icons: SpaceIcons) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SSRVisitorCredentialsConfig } from '../../types';
|
|
1
|
+
import { SSRPaintedDefaults, SSRVisitorCredentialsConfig } from '../../types';
|
|
2
2
|
import { ProjectDataLookup } from '@plitzi/sdk-kernel/data';
|
|
3
3
|
import { RscElementResolver } from '@plitzi/sdk-kernel/engine';
|
|
4
4
|
import { OutboundOptions } from '@plitzi/sdk-kernel/outbound';
|
|
@@ -18,7 +18,7 @@ import { SSRAdapters } from '@plitzi/sdk-kernel/types';
|
|
|
18
18
|
*
|
|
19
19
|
* A deployment that resolves server elements some other way still supplies its own `getRscData`, and that one wins.
|
|
20
20
|
*/
|
|
21
|
-
export declare const connectorRscData: ({ engine, publicDir, data, elementTimeoutMs, sayFailures, outbound, visitorCredentials }: {
|
|
21
|
+
export declare const connectorRscData: ({ engine, publicDir, data, elementTimeoutMs, sayFailures, outbound, visitorCredentials, paintedDefaults }: {
|
|
22
22
|
/** The engine's resolver of an element that names an action or a connector (`PageEngine.resolveElement`). */
|
|
23
23
|
engine?: RscElementResolver;
|
|
24
24
|
/** Where the server's static files are: a provider whose `query` is one of them is read from disk. */
|
|
@@ -36,4 +36,6 @@ export declare const connectorRscData: ({ engine, publicDir, data, elementTimeou
|
|
|
36
36
|
outbound?: OutboundOptions;
|
|
37
37
|
/** The deployment's own APIs a provider may ask as the visitor, and from which spaces (`rsc.visitorCredentials`). */
|
|
38
38
|
visitorCredentials?: SSRVisitorCredentialsConfig;
|
|
39
|
+
/** What a painted key starts as for an account the cookie holds none of (`paintedDefaults`). */
|
|
40
|
+
paintedDefaults?: SSRPaintedDefaults;
|
|
39
41
|
}) => NonNullable<SSRAdapters["getRscData"]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SSRPaintedDefaults } from '../../types/config';
|
|
1
2
|
import { RscElementResolver } from '@plitzi/sdk-kernel/engine';
|
|
2
3
|
import { SSRRequest } from '@plitzi/sdk-kernel/types';
|
|
3
4
|
import { Environment, Schema, SSRRscData, SSRUser } from '@plitzi/sdk-shared';
|
|
@@ -24,6 +25,8 @@ export type ResolveRscDataOptions = {
|
|
|
24
25
|
signal?: AbortSignal;
|
|
25
26
|
/** While developing: a failed element says why in its data (`RSC_FAILURE`), where its provider shows it. */
|
|
26
27
|
sayFailures?: boolean;
|
|
28
|
+
/** What a painted key starts as for an account the cookie holds none of (`paintedDefaults`). */
|
|
29
|
+
paintedDefaults?: SSRPaintedDefaults;
|
|
27
30
|
};
|
|
28
31
|
/**
|
|
29
32
|
* Resolves the server-side data slices for the page addressed by `req`.
|
|
@@ -32,4 +35,4 @@ export type ResolveRscDataOptions = {
|
|
|
32
35
|
* and the route params are what the browser will see. Each `runtime: 'server'` element resolves independently:
|
|
33
36
|
* a provider that fails or hangs costs its own slice and nothing else.
|
|
34
37
|
*/
|
|
35
|
-
export declare const resolveRscData: ({ schema, req, spaceId, environment, user, ids, resolveElement, flagOverrides, timeoutMs, signal, sayFailures }: ResolveRscDataOptions) => Promise<SSRRscData>;
|
|
38
|
+
export declare const resolveRscData: ({ schema, req, spaceId, environment, user, ids, resolveElement, flagOverrides, timeoutMs, signal, sayFailures, paintedDefaults }: ResolveRscDataOptions) => Promise<SSRRscData>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SSRPageServerConfig } from '../../types';
|
|
2
|
+
import { Environment } from '@plitzi/sdk-shared';
|
|
3
|
+
/**
|
|
4
|
+
* What a page is told about the CSRF token its writes to the deployment's own APIs echo: those APIs, the cookie each
|
|
5
|
+
* keeps it in, and where a new one is handed out (`rsc.visitorCredentials`) — as JSON, for `<meta name="plitzi-csrf">`.
|
|
6
|
+
* Only on the pages of a space trusted to carry its visitors' sessions there; none where the deployment names no
|
|
7
|
+
* `csrfPath`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const csrfHintFor: (config: SSRPageServerConfig, space: {
|
|
10
|
+
spaceId: number;
|
|
11
|
+
environment: Environment;
|
|
12
|
+
}) => Promise<string | undefined>;
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* Kept as text rather than a file beside the module: the server's build moves its modules into chunks, and a deployment
|
|
8
8
|
* bundles them again (a project's server, `bundleProject`) — a string goes wherever its module goes.
|
|
9
9
|
*/
|
|
10
|
-
export declare const DEFAULT_FAVICON_SVG = "<svg
|
|
10
|
+
export declare const DEFAULT_FAVICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"512\" height=\"512\"><!-- The layers: Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0) Copyright 2026 Fonticons, Inc. --><rect width=\"512\" height=\"512\" rx=\"112\" fill=\"#5b3df5\"/><path fill=\"#ffffff\" transform=\"translate(102 102) scale(0.6)\" d=\"M232.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 149.8C5.4 145.8 0 137.3 0 128s5.4-17.9 13.9-21.8L232.5 5.2zM48.1 218.4l164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 277.8C5.4 273.8 0 265.3 0 256s5.4-17.9 13.9-21.8l34.1-15.8zM13.9 362.2l34.1-15.8 164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 405.8C5.4 401.8 0 393.3 0 384s5.4-17.9 13.9-21.8z\"/></svg>";
|
|
@@ -17,8 +17,15 @@ import { PageAccess } from '@plitzi/sdk-shared/schema';
|
|
|
17
17
|
export declare const SPACE_DOCUMENT_PATH = "/_plitzi/space/";
|
|
18
18
|
/** The space as it is now, for a page that renders it itself rather than one the server drew (`handleCurrentSpace`). */
|
|
19
19
|
export declare const CURRENT_SPACE_PATH = "/_plitzi/space.json";
|
|
20
|
+
/**
|
|
21
|
+
* The page a document of the space in parts is that page's: its shell and its own part. Named in its address so that a
|
|
22
|
+
* process that did not draw the page — another replica, a process restarted — answers the same document rather than
|
|
23
|
+
* the whole space (`documentNow`), which it did: a visitor whose page and document reached two processes downloaded
|
|
24
|
+
* every page of the space.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PAGE_PARAM = "page";
|
|
20
27
|
/** Where the page fetches `document` from — and the promise that this process can answer it. */
|
|
21
|
-
export declare const publishSpaceDocument: (spaceId: number, environment: Environment, document: SpaceDocument, kept?: PageAccess[]) => string;
|
|
28
|
+
export declare const publishSpaceDocument: (spaceId: number, environment: Environment, document: SpaceDocument, kept?: PageAccess[], pageId?: string) => string;
|
|
22
29
|
/**
|
|
23
30
|
* Answers `/_plitzi/space/<hash>.json` for the space this host serves, behind the same gates as its pages.
|
|
24
31
|
*
|
package/dist/oauth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as dropPending, D as putCode, E as getPending, O as putPending, S as scopesOf, T as getClient, a as handleRegister, b as protectedResourceMetadata, c as redirectWithError, d as randomId, f as verifyChallenge, g as REGISTER_PATH, h as PROTECTED_RESOURCE_PATH, i as handleAuthorizeSubmit, l as sendErrorJson, m as AUTHORIZE_PATH, n as handleToken, o as redirectToSignIn, p as AUTHORIZATION_SERVER_PATH, r as handleAuthorizeStart, s as redirectWithCode, t as handleRevoke, u as sendJson, v as TOKEN_PATH, w as getAccess, x as resourceMetadataUrl, y as authorizationServerMetadata } from "./chunks/token-
|
|
1
|
+
import { C as dropPending, D as putCode, E as getPending, O as putPending, S as scopesOf, T as getClient, a as handleRegister, b as protectedResourceMetadata, c as redirectWithError, d as randomId, f as verifyChallenge, g as REGISTER_PATH, h as PROTECTED_RESOURCE_PATH, i as handleAuthorizeSubmit, l as sendErrorJson, m as AUTHORIZE_PATH, n as handleToken, o as redirectToSignIn, p as AUTHORIZATION_SERVER_PATH, r as handleAuthorizeStart, s as redirectWithCode, t as handleRevoke, u as sendJson, v as TOKEN_PATH, w as getAccess, x as resourceMetadataUrl, y as authorizationServerMetadata } from "./chunks/token-XEz1n4jp.js";
|
|
2
2
|
import { readRawBody } from "@plitzi/sdk-kernel/http";
|
|
3
3
|
// src/core/oauth/challenge.ts
|
|
4
4
|
/** The credential on an MCP request. `Authorization: Bearer` is what RFC 6750 defines and what a remote host
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pages and actions in one process: `createPlatform` builds the actions engine and hands it to the page server (
|
|
2
|
+
* Pages and actions in one process: `createPlatform` builds the actions engine and hands it to the page server (docs/en/server-packages.md,
|
|
3
3
|
* D11). Its own entry so a page server deployed on its own never loads the engine to find out it has none.
|
|
4
4
|
*/
|
|
5
5
|
export { createPlatform } from './core/platform';
|
package/dist/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createPlatform } from "./chunks/platform-
|
|
1
|
+
export { t as createPlatform } from "./chunks/platform-BTssQQXp.js";
|
package/dist/project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as LIVE_PAGES_PATH } from "./chunks/createServer-
|
|
2
|
-
import {
|
|
3
|
-
import { t as createPlatform } from "./chunks/platform-
|
|
1
|
+
import { n as LIVE_PAGES_PATH } from "./chunks/createServer-BSmQqzwb.js";
|
|
2
|
+
import { _ as createCloudAdapters, b as escapeHtml, g as createJsonAdapters } from "./chunks/core-CoKORAOg.js";
|
|
3
|
+
import { t as createPlatform } from "./chunks/platform-BTssQQXp.js";
|
|
4
4
|
import { reachOwnServer } from "@plitzi/sdk-kernel/outbound";
|
|
5
5
|
import { EMPTY_SCHEMA } from "@plitzi/sdk-shared/schema";
|
|
6
6
|
import { mkdir, writeFile } from "node:fs/promises";
|
package/dist/spaces.d.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* keeps the answer: the resolution a page server renders with, apart from the renderer. A process that serves no pages
|
|
4
4
|
* (a worker, an API) resolves spaces through this and loads nothing of React or the SDK.
|
|
5
5
|
*/
|
|
6
|
-
export { authoringPreview, createMemoryCache, createSpaceAdapters, fixedSpace, presentsCredential, refuse, renderGrant, verifiedDomain, wildcardSubdomain } from './adapters/space';
|
|
7
|
-
export type { AuthoringPreviewOptions, DeploymentRow, RenderGrantOptions, SpaceAdapters, SpaceAdaptersConfig, SpaceCache, SpaceRefusal, SpaceResolution, SpaceResolver, WildcardSubdomainOptions } from './adapters/space';
|
|
6
|
+
export { authoringPreview, createMemoryCache, createSpaceAdapters, fixedSpace, parsePreviewLabel, presentsCredential, PREVIEW_KEY_LENGTH, previewLabel, refuse, renderGrant, snapshotPreview, verifiedDomain, wildcardSubdomain } from './adapters/space';
|
|
7
|
+
export type { AuthoringPreviewOptions, DeploymentRow, PreviewAddress, RenderGrantOptions, SnapshotPreviewOptions, SpaceAdapters, SpaceAdaptersConfig, SpaceCache, SpaceRefusal, SpaceResolution, SpaceResolver, WildcardSubdomainOptions } from './adapters/space';
|
package/dist/spaces.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as authoringPreview,
|
|
1
|
+
export { r as PREVIEW_KEY_LENGTH, s as authoringPreview, p as createMemoryCache, n as createSpaceAdapters, c as fixedSpace, i as parsePreviewLabel, l as presentsCredential, a as previewLabel, m as refuse, u as renderGrant, o as snapshotPreview, d as verifiedDomain, f as wildcardSubdomain } from "./chunks/core-CoKORAOg.js";
|
package/dist/ssr.d.ts
CHANGED
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
* an injected render stage needs. */
|
|
10
10
|
export { buildBody } from './modules/ssr/buildBody';
|
|
11
11
|
export { createMemoryDraftStore, takeDraftOverride } from './modules/ssr/preview';
|
|
12
|
-
export
|
|
12
|
+
export { PluginManager } from './plugins/manager';
|
|
13
13
|
export type { ServerCaches } from './helpers/cache';
|
|
14
14
|
export type { PipelineExtensions, SSRContext } from './core/http/pageContext';
|
package/dist/ssr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as buildBody,
|
|
1
|
+
export { S as PluginManager, t as buildBody, w as createMemoryDraftStore, E as takeDraftOverride } from "./chunks/buildBody-Bm398uxH.js";
|
package/dist/types/config.d.ts
CHANGED
|
@@ -64,6 +64,14 @@ export type SSRCacheConfig = {
|
|
|
64
64
|
/** The pages every replica shares. Without one, each process keeps its own. */
|
|
65
65
|
store?: SharedPageStore;
|
|
66
66
|
};
|
|
67
|
+
/** What `paintedDefaults` is asked with: the space being drawn, the account the request proved, the keys it lacks. */
|
|
68
|
+
export type SSRPaintedDefaultsContext = {
|
|
69
|
+
spaceId: number;
|
|
70
|
+
environment: Environment;
|
|
71
|
+
account: number | string;
|
|
72
|
+
keys: string[];
|
|
73
|
+
};
|
|
74
|
+
export type SSRPaintedDefaults = (context: SSRPaintedDefaultsContext) => Record<string, unknown> | undefined | Promise<Record<string, unknown> | undefined>;
|
|
67
75
|
export type SSRRscConfig = {
|
|
68
76
|
/** Whether the RSC endpoint is active. Defaults to true when adapters.getRscData is provided. */
|
|
69
77
|
enabled?: boolean;
|
|
@@ -119,6 +127,13 @@ export type SSRVisitorCredentialsConfig = {
|
|
|
119
127
|
spaceId: number;
|
|
120
128
|
environment: Environment;
|
|
121
129
|
}) => boolean | Promise<boolean>;
|
|
130
|
+
/**
|
|
131
|
+
* Where each of those APIs hands out a CSRF token (`'/auth/csrf'`, the kernel's flow). Given, the pages of the spaces
|
|
132
|
+
* above are told the APIs and the cookie each keeps the token in (`<meta name="plitzi-csrf">`), and every write they
|
|
133
|
+
* send there with the visitor's session echoes it (`@plitzi/sdk-shared/csrf`) — what an API that asks for it
|
|
134
|
+
* (`createCsrfMiddleware`) needs. Never told to a space not trusted to carry its visitors' sessions.
|
|
135
|
+
*/
|
|
136
|
+
csrfPath?: string;
|
|
122
137
|
};
|
|
123
138
|
export type SSRServerConfig = ServerBaseConfig & {
|
|
124
139
|
/**
|
|
@@ -198,6 +213,15 @@ export type SSRServerConfig = ServerBaseConfig & {
|
|
|
198
213
|
trustedTypes?: false | 'report-only';
|
|
199
214
|
/** RSC (React Server Components) endpoint configuration. */
|
|
200
215
|
rsc?: SSRRscConfig;
|
|
216
|
+
/**
|
|
217
|
+
* What a painted key (`settings.paintedState`) starts as for a signed-in visitor whose cookie holds none of it — the
|
|
218
|
+
* first visit after signing in, or after another account signed in on this browser (whose values are never drawn for
|
|
219
|
+
* this one). The page is drawn with it, its server providers ask with it, and the browser starts from it, as from a
|
|
220
|
+
* painted value — a dashboard knows its workspace on the first visit instead of learning it once the browser runs.
|
|
221
|
+
* Asked only for an account the request proved, once a request, for the keys it lacks; a key left out stays missing.
|
|
222
|
+
* The deployment's answer, never a space's: it reads the deployment's own records.
|
|
223
|
+
*/
|
|
224
|
+
paintedDefaults?: SSRPaintedDefaults;
|
|
201
225
|
/** Which request-handling services this server mounts: `ssr` on by default, `rsc` whenever
|
|
202
226
|
* `adapters.getRscData` exists. Stages a companion package contributes are deliberately NOT flags here —
|
|
203
227
|
* handing them over is the decision. Only createServer reads these as written; the surface factories pin what
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { SSRCacheConfig, SSRPageServerConfig, SSRRenderLimitConfig, SSRRscConfig, SSRServerConfig, SSRSignInConfig, SSRVisitorCredentialsConfig, SharedPage, SharedPageFacts, SharedPageStore } from './config';
|
|
1
|
+
export type { SSRCacheConfig, SSRPageServerConfig, SSRPaintedDefaults, SSRPaintedDefaultsContext, SSRRenderLimitConfig, SSRRscConfig, SSRServerConfig, SSRSignInConfig, SSRVisitorCredentialsConfig, SharedPage, SharedPageFacts, SharedPageStore } from './config';
|
|
2
2
|
export type { CacheFilter, CacheManager, PluginRegistry, SSRFontsConfig, SSRImagesConfig, SSRPlugin, SSRServer, SSRTemplateFn, ServerServices } from './server';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-server",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.6",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -70,6 +70,12 @@
|
|
|
70
70
|
"import": "./dist/bundle.js",
|
|
71
71
|
"default": "./dist/bundle.js"
|
|
72
72
|
},
|
|
73
|
+
"./deploy": {
|
|
74
|
+
"@plitzi/source": "./src/deploy.ts",
|
|
75
|
+
"types": "./dist/deploy.d.ts",
|
|
76
|
+
"import": "./dist/deploy.js",
|
|
77
|
+
"default": "./dist/deploy.js"
|
|
78
|
+
},
|
|
73
79
|
"./env": {
|
|
74
80
|
"@plitzi/source": "./src/env.ts",
|
|
75
81
|
"types": "./dist/env.d.ts",
|
|
@@ -89,34 +95,32 @@
|
|
|
89
95
|
"./dist/env.js"
|
|
90
96
|
],
|
|
91
97
|
"dependencies": {
|
|
92
|
-
"@plitzi/plitzi-sdk": "0.39.
|
|
93
|
-
"@plitzi/sdk-
|
|
94
|
-
"@plitzi/sdk-
|
|
98
|
+
"@plitzi/plitzi-sdk": "0.39.6",
|
|
99
|
+
"@plitzi/sdk-actions": "0.39.6",
|
|
100
|
+
"@plitzi/sdk-kernel": "0.39.6",
|
|
101
|
+
"@plitzi/sdk-shared": "0.39.6",
|
|
95
102
|
"ejs": "^7.0.2",
|
|
96
103
|
"esbuild": "^0.28.2",
|
|
97
|
-
"jsonwebtoken": "^9.0.3"
|
|
104
|
+
"jsonwebtoken": "^9.0.3",
|
|
105
|
+
"subset-font": "^2.9.0"
|
|
98
106
|
},
|
|
99
107
|
"peerDependencies": {
|
|
100
|
-
"@plitzi/sdk-actions": "^0.39.3",
|
|
101
108
|
"react": "^19",
|
|
102
109
|
"react-dom": "^19",
|
|
103
110
|
"sharp": "^0.34.0"
|
|
104
111
|
},
|
|
105
112
|
"peerDependenciesMeta": {
|
|
106
|
-
"@plitzi/sdk-actions": {
|
|
107
|
-
"optional": true
|
|
108
|
-
},
|
|
109
113
|
"sharp": {
|
|
110
114
|
"optional": true
|
|
111
115
|
}
|
|
112
116
|
},
|
|
113
117
|
"devDependencies": {
|
|
114
|
-
"@plitzi/sdk-
|
|
115
|
-
"@plitzi/sdk-runtime": "0.39.3",
|
|
118
|
+
"@plitzi/sdk-runtime": "0.39.6",
|
|
116
119
|
"@types/ejs": "^3.1.5",
|
|
117
120
|
"@types/jsonwebtoken": "^9.0.10",
|
|
118
121
|
"@types/node": "^26.6.6",
|
|
119
122
|
"@types/react": "^19.3.0",
|
|
123
|
+
"@types/subset-font": "^2.3.0",
|
|
120
124
|
"@types/ws": "^8.18.2",
|
|
121
125
|
"@vitejs/plugin-react": "^6.3.0",
|
|
122
126
|
"@vitest/coverage-v8": "^5.1.0",
|
|
@@ -128,10 +132,10 @@
|
|
|
128
132
|
"sharp": "^0.35.5",
|
|
129
133
|
"tsx": "^4.23.15",
|
|
130
134
|
"typescript": "^6.0.3",
|
|
131
|
-
"vite": "^8.3.
|
|
135
|
+
"vite": "^8.3.8",
|
|
132
136
|
"vite-plugin-dts": "^5.1.2",
|
|
133
137
|
"vitest": "^5.1.0",
|
|
134
|
-
"ws": "^8.
|
|
138
|
+
"ws": "^8.23.0"
|
|
135
139
|
},
|
|
136
140
|
"scripts": {
|
|
137
141
|
"prepack": "node scripts/copy-authoring-skill.mjs",
|
|
@@ -55,5 +55,7 @@ const faqItem = ({ id, question: words, answer: text }: (typeof QUESTIONS)[numbe
|
|
|
55
55
|
export const recipe: SpaceSpec = {
|
|
56
56
|
name: 'Questions',
|
|
57
57
|
permanentUrl: 'questions',
|
|
58
|
-
pages: [
|
|
58
|
+
pages: [
|
|
59
|
+
{ id: 'home', name: 'Home', slug: '', body: [container({ subType: 'main', children: QUESTIONS.flatMap(faqItem) })] }
|
|
60
|
+
]
|
|
59
61
|
};
|
|
@@ -63,75 +63,80 @@ export const recipe: SpaceSpec = {
|
|
|
63
63
|
name: 'Home',
|
|
64
64
|
slug: '',
|
|
65
65
|
body: [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
id: 'hero',
|
|
69
|
-
label: 'Featured',
|
|
70
|
-
items: SLIDES,
|
|
71
|
-
autoplay: 5000,
|
|
72
|
-
row: r =>
|
|
73
|
-
container({
|
|
74
|
-
class: slide,
|
|
75
|
-
children: [heading({ subType: 'h2', from: `${r.item}.title` }), text({ from: `${r.item}.lede` })]
|
|
76
|
-
}),
|
|
66
|
+
container({
|
|
67
|
+
subType: 'main',
|
|
77
68
|
children: [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
// One slide at a time, on its own every 5 s — held while the pointer or the keyboard is on it.
|
|
70
|
+
carousel({
|
|
71
|
+
id: 'hero',
|
|
72
|
+
label: 'Featured',
|
|
73
|
+
items: SLIDES,
|
|
74
|
+
autoplay: 5000,
|
|
84
75
|
row: r =>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
76
|
+
container({
|
|
77
|
+
class: slide,
|
|
78
|
+
children: [heading({ subType: 'h2', from: `${r.item}.title` }), text({ from: `${r.item}.lede` })]
|
|
79
|
+
}),
|
|
80
|
+
children: [
|
|
81
|
+
button({ content: '‹', title: 'Previous slide', flows: [[onClick(), carouselPrevious('hero')]] }),
|
|
82
|
+
button({ content: '›', title: 'Next slide', flows: [[onClick(), carouselNext('hero')]] }),
|
|
83
|
+
list({
|
|
84
|
+
id: 'hero-dots',
|
|
85
|
+
class: dots,
|
|
86
|
+
items: 'hero.items',
|
|
87
|
+
row: r =>
|
|
88
|
+
listItem({
|
|
89
|
+
children: [
|
|
90
|
+
button({
|
|
91
|
+
content: '',
|
|
92
|
+
class: dot,
|
|
93
|
+
bind: [
|
|
94
|
+
bindTemplate('title', r.index, 'Slide {{ source + 1 }}'),
|
|
95
|
+
activeWhen(dot, `{{ ${r.inTemplate.index} == carousel_hero.index }}`)
|
|
96
|
+
],
|
|
97
|
+
flows: [[onClick(), carouselGoTo('hero', `{{ ${r.inTemplate.index} }}`)]]
|
|
98
|
+
})
|
|
99
|
+
]
|
|
95
100
|
})
|
|
96
|
-
]
|
|
97
101
|
})
|
|
98
|
-
|
|
99
|
-
]
|
|
100
|
-
}),
|
|
101
|
-
// Scrolling past for ever at 40 px a second, still under the pointer.
|
|
102
|
-
carousel({
|
|
103
|
-
id: 'logos',
|
|
104
|
-
label: 'Brands we carry',
|
|
105
|
-
mode: 'marquee',
|
|
106
|
-
speed: 40,
|
|
107
|
-
items: ['Acme', 'Globex', 'Initech', 'Umbrella', 'Hooli'],
|
|
108
|
-
row: r => text({ from: r.item, css: { padding: '0px 24px', fontWeight: 600 } })
|
|
109
|
-
}),
|
|
110
|
-
// A row that swipes on a phone and snaps to each card; the arrows move it a page — as many cards as it shows —
|
|
111
|
-
// and each hides at its end.
|
|
112
|
-
carousel({
|
|
113
|
-
id: 'picks',
|
|
114
|
-
label: 'Picks',
|
|
115
|
-
mode: 'scroll',
|
|
116
|
-
class: cards,
|
|
117
|
-
items: SLIDES,
|
|
118
|
-
row: r => container({ class: slide, children: [text({ from: `${r.item}.title` })] }),
|
|
119
|
-
children: [
|
|
120
|
-
button({
|
|
121
|
-
content: '‹',
|
|
122
|
-
title: 'Earlier picks',
|
|
123
|
-
class: arrow,
|
|
124
|
-
bind: [activeWhen(arrow, '{{ carousel_picks.atStart }}', { variant: 'spent' })],
|
|
125
|
-
flows: [[onClick(), carouselPrevious('picks', 'page')]]
|
|
102
|
+
]
|
|
126
103
|
}),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
104
|
+
// Scrolling past for ever at 40 px a second, still under the pointer.
|
|
105
|
+
carousel({
|
|
106
|
+
id: 'logos',
|
|
107
|
+
label: 'Brands we carry',
|
|
108
|
+
mode: 'marquee',
|
|
109
|
+
speed: 40,
|
|
110
|
+
items: ['Acme', 'Globex', 'Initech', 'Umbrella', 'Hooli'],
|
|
111
|
+
row: r => text({ from: r.item, css: { padding: '0px 24px', fontWeight: 600 } })
|
|
133
112
|
}),
|
|
134
|
-
|
|
113
|
+
// A row that swipes on a phone and snaps to each card; the arrows move it a page — as many cards as it shows —
|
|
114
|
+
// and each hides at its end.
|
|
115
|
+
carousel({
|
|
116
|
+
id: 'picks',
|
|
117
|
+
label: 'Picks',
|
|
118
|
+
mode: 'scroll',
|
|
119
|
+
class: cards,
|
|
120
|
+
items: SLIDES,
|
|
121
|
+
row: r => container({ class: slide, children: [text({ from: `${r.item}.title` })] }),
|
|
122
|
+
children: [
|
|
123
|
+
button({
|
|
124
|
+
content: '‹',
|
|
125
|
+
title: 'Earlier picks',
|
|
126
|
+
class: arrow,
|
|
127
|
+
bind: [activeWhen(arrow, '{{ carousel_picks.atStart }}', { variant: 'spent' })],
|
|
128
|
+
flows: [[onClick(), carouselPrevious('picks', 'page')]]
|
|
129
|
+
}),
|
|
130
|
+
button({
|
|
131
|
+
content: '›',
|
|
132
|
+
title: 'More picks',
|
|
133
|
+
class: arrow,
|
|
134
|
+
bind: [activeWhen(arrow, '{{ carousel_picks.atEnd }}', { variant: 'spent' })],
|
|
135
|
+
flows: [[onClick(), carouselNext('picks', 'page')]]
|
|
136
|
+
}),
|
|
137
|
+
text({ from: 'picks.index', as: '{{ source + 1 }} of {{ carousel_picks.count }}' })
|
|
138
|
+
]
|
|
139
|
+
})
|
|
135
140
|
]
|
|
136
141
|
})
|
|
137
142
|
]
|