@spacefast/common 0.0.26 → 0.2.1
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/dist/agents/connect-targets.d.ts +6 -146
- package/dist/agents/connect-targets.js +63 -295
- package/dist/agents/private-key-oauth.d.ts +31 -1
- package/dist/agents/private-key-oauth.js +124 -33
- package/dist/agents/registry/core.d.ts +292 -0
- package/dist/agents/registry/core.js +1388 -0
- package/dist/agents/registry/deeplink-probes.d.ts +23 -0
- package/dist/agents/registry/deeplink-probes.js +18 -0
- package/dist/agents/registry/node.d.ts +56 -0
- package/dist/agents/registry/node.js +339 -0
- package/dist/brand-assets-build.js +1 -2
- package/dist/brand-assets.js +4 -7
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +55 -28
- package/dist/config/domains.js +85 -41
- package/dist/config/index.js +1 -2
- package/dist/contracts/abuse.js +9 -24
- package/dist/contracts/access-profiles.d.ts +86 -0
- package/dist/contracts/access-profiles.js +89 -0
- package/dist/contracts/access.d.ts +21 -27
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +70 -26
- package/dist/contracts/analytics.js +8 -10
- package/dist/contracts/api-keys.d.ts +77 -52
- package/dist/contracts/api-keys.js +44 -24
- package/dist/contracts/application-journal.d.ts +216 -0
- package/dist/contracts/application-journal.js +167 -0
- package/dist/contracts/auth.d.ts +90 -17
- package/dist/contracts/auth.js +86 -17
- package/dist/contracts/beta.d.ts +9 -4
- package/dist/contracts/beta.js +20 -16
- package/dist/contracts/billing.js +7 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +186 -7
- package/dist/contracts/builds.js +75 -21
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +25 -9
- package/dist/contracts/cli.d.ts +7 -0
- package/dist/contracts/cli.js +6 -0
- package/dist/contracts/collab-public.d.ts +1 -1
- package/dist/contracts/collab-public.js +5 -8
- package/dist/contracts/comments.d.ts +45 -35
- package/dist/contracts/comments.js +107 -77
- package/dist/contracts/commerce.d.ts +165 -0
- package/dist/contracts/commerce.js +146 -0
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/common.js +18 -29
- package/dist/contracts/content-contract-verification.d.ts +521 -0
- package/dist/contracts/content-contract-verification.js +320 -0
- package/dist/contracts/content-platform-fixture.d.ts +1278 -0
- package/dist/contracts/content-platform-fixture.js +44 -0
- package/dist/contracts/content-program.d.ts +994 -0
- package/dist/contracts/content-program.js +658 -0
- package/dist/contracts/content-sync.d.ts +290 -0
- package/dist/contracts/content-sync.js +167 -0
- package/dist/contracts/content.d.ts +432 -0
- package/dist/contracts/content.js +303 -0
- package/dist/contracts/continuation.d.ts +17 -1
- package/dist/contracts/continuation.js +23 -23
- package/dist/contracts/countries.js +3 -4
- package/dist/contracts/crons.d.ts +17 -0
- package/dist/contracts/crons.js +33 -15
- package/dist/contracts/dashboard-prefs.d.ts +56 -0
- package/dist/contracts/dashboard-prefs.js +51 -0
- package/dist/contracts/device-auth.d.ts +234 -37
- package/dist/contracts/device-auth.js +267 -53
- package/dist/contracts/docs.d.ts +6 -10
- package/dist/contracts/docs.js +5 -13
- package/dist/contracts/domains.d.ts +499 -102
- package/dist/contracts/domains.js +169 -58
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +26 -26
- package/dist/contracts/enums.js +61 -54
- package/dist/contracts/error-code-meta.d.ts +269 -7
- package/dist/contracts/error-code-meta.js +80 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +78 -16
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +47 -66
- package/dist/contracts/execution.js +51 -64
- package/dist/contracts/feature-lifecycle.d.ts +70 -14
- package/dist/contracts/feature-lifecycle.js +86 -15
- package/dist/contracts/features.d.ts +100 -37
- package/dist/contracts/features.js +21 -27
- package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
- package/dist/contracts/frame-session.d.ts +192 -0
- package/dist/contracts/frame-session.js +164 -0
- package/dist/contracts/functions.d.ts +218 -211
- package/dist/contracts/functions.js +273 -260
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +64 -56
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +4 -1
- package/dist/contracts/internal.d.ts +5 -4
- package/dist/contracts/internal.js +12 -3
- package/dist/contracts/mcp.d.ts +17 -0
- package/dist/contracts/mcp.js +23 -0
- package/dist/contracts/me.d.ts +6 -1
- package/dist/contracts/me.js +12 -6
- package/dist/contracts/notifications.d.ts +27 -29
- package/dist/contracts/notifications.js +9 -4
- package/dist/contracts/oauth-resources.d.ts +112 -10
- package/dist/contracts/oauth-resources.js +116 -11
- package/dist/contracts/oauth-scope-actions.d.ts +90 -0
- package/dist/contracts/oauth-scope-actions.js +126 -0
- package/dist/contracts/operations.d.ts +27 -4
- package/dist/contracts/operations.js +11 -5
- package/dist/contracts/pages.d.ts +29 -5
- package/dist/contracts/pages.js +22 -5
- package/dist/contracts/partner-notifications.d.ts +3 -0
- package/dist/contracts/partner-notifications.js +65 -0
- package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
- package/dist/contracts/{platform.js → partner.js} +27 -40
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/principal-assertion.d.ts +43 -0
- package/dist/contracts/principal-assertion.js +67 -0
- package/dist/contracts/principals.d.ts +73 -0
- package/dist/contracts/principals.js +59 -0
- package/dist/contracts/privacy.d.ts +11 -0
- package/dist/contracts/privacy.js +17 -0
- package/dist/contracts/problem-document.js +3 -4
- package/dist/contracts/publish-archive.d.ts +116 -18
- package/dist/contracts/publish-archive.js +6 -3
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.js +3 -3
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/repository-connections.js +6 -2
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +145 -21
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +112 -35
- package/dist/contracts/runtime-api.js +86 -66
- package/dist/contracts/runtime-app.d.ts +11 -21
- package/dist/contracts/runtime-app.js +39 -24
- package/dist/contracts/runtime-components.d.ts +143 -0
- package/dist/contracts/runtime-components.js +199 -0
- package/dist/contracts/runtime-db.d.ts +45 -19
- package/dist/contracts/runtime-db.js +85 -20
- package/dist/contracts/runtime-purge.js +3 -5
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +14 -14
- package/dist/contracts/runtime-storage.js +28 -13
- package/dist/contracts/sf-config-v1.d.ts +14 -18
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +235 -28
- package/dist/contracts/space-config.js +246 -91
- package/dist/contracts/spaces.d.ts +360 -255
- package/dist/contracts/spaces.js +190 -122
- package/dist/contracts/superadmin-activity.d.ts +3 -43
- package/dist/contracts/superadmin-activity.js +6 -30
- package/dist/contracts/superadmin-emails.d.ts +1 -0
- package/dist/contracts/superadmin-emails.js +17 -1
- package/dist/contracts/superadmin-runtime.d.ts +199 -0
- package/dist/contracts/superadmin-runtime.js +141 -0
- package/dist/contracts/superadmin-search.d.ts +22 -2
- package/dist/contracts/superadmin-search.js +14 -6
- package/dist/contracts/superadmin-spaces.d.ts +435 -186
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +3 -0
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -6
- package/dist/contracts/superadmin-tenants.js +32 -7
- package/dist/contracts/superadmin.d.ts +98 -16
- package/dist/contracts/superadmin.js +63 -10
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +44 -34
- package/dist/contracts/teams.d.ts +72 -9
- package/dist/contracts/teams.js +84 -25
- package/dist/contracts/tenants.d.ts +135 -0
- package/dist/contracts/tenants.js +120 -0
- package/dist/contracts/test-triggers.d.ts +70 -0
- package/dist/contracts/test-triggers.js +116 -0
- package/dist/contracts/theme-json.js +3 -8
- package/dist/contracts/transfers.d.ts +1 -0
- package/dist/contracts/transfers.js +1 -0
- package/dist/contracts/usage.d.ts +209 -0
- package/dist/contracts/usage.js +124 -12
- package/dist/contracts/variables.d.ts +2 -2
- package/dist/contracts/variables.js +9 -13
- package/dist/contracts/webhooks.d.ts +13 -5
- package/dist/contracts/webhooks.js +3 -1
- package/dist/contracts/zero.d.ts +57 -64
- package/dist/contracts/zero.js +68 -66
- package/dist/dashboard-paths/index.d.ts +24 -21
- package/dist/dashboard-paths/index.js +35 -47
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
- package/dist/dashboard-paths/route-reservations.generated.js +36 -0
- package/dist/docs/agent-arrival.d.ts +92 -0
- package/dist/docs/agent-arrival.js +227 -0
- package/dist/docs/agent-output-policy.d.ts +6 -0
- package/dist/docs/agent-output-policy.js +22 -0
- package/dist/docs/agent-prose.d.ts +11 -17
- package/dist/docs/agent-prose.js +62 -37
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +336 -436
- package/dist/docs/catalog.d.ts +147 -89
- package/dist/docs/catalog.js +157 -42
- package/dist/docs/error-docs.d.ts +2098 -1
- package/dist/docs/error-docs.js +281 -16
- package/dist/docs/index-build.d.ts +0 -1
- package/dist/docs/index-build.js +2 -3
- package/dist/docs/page-context-prompt.d.ts +77 -0
- package/dist/docs/page-context-prompt.js +131 -0
- package/dist/docs/reference-urls.d.ts +46 -0
- package/dist/docs/reference-urls.js +79 -0
- package/dist/docs/search.d.ts +6 -8
- package/dist/docs/search.js +10 -13
- package/dist/docs/skill-distribution.d.ts +4 -1
- package/dist/docs/skill-distribution.js +10 -5
- package/dist/docs/skills.d.ts +117 -117
- package/dist/docs/skills.js +120 -72
- package/dist/docs/start-prompts.d.ts +45 -0
- package/dist/docs/start-prompts.js +62 -0
- package/dist/domain-exploration.js +9 -13
- package/dist/og-template.d.ts +56 -0
- package/dist/og-template.js +56 -0
- package/dist/slug-policy/index.js +5 -11
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +16 -0
- package/dist/utils/build-settings.js +63 -17
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +3 -5
- package/dist/utils/cast-transport.d.ts +5 -17
- package/dist/utils/cast-transport.js +6 -19
- package/dist/utils/claim-token.js +1 -2
- package/dist/utils/comment-avatars.js +4 -6
- package/dist/utils/concurrency.js +2 -3
- package/dist/utils/content-type.d.ts +7 -6
- package/dist/utils/content-type.js +73 -51
- package/dist/utils/credential-policy.d.ts +50 -6
- package/dist/utils/credential-policy.js +123 -57
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +4 -7
- package/dist/utils/gravatar.d.ts +2 -4
- package/dist/utils/gravatar.js +6 -12
- package/dist/utils/id-hints.js +14 -23
- package/dist/utils/idempotency.d.ts +3 -3
- package/dist/utils/idempotency.js +6 -7
- package/dist/utils/local-space-state.d.ts +15 -15
- package/dist/utils/local-space-state.js +34 -23
- package/dist/utils/oauth-signed-query.d.ts +3 -5
- package/dist/utils/oauth-signed-query.js +6 -9
- package/dist/utils/one-shot-replay.d.ts +3 -5
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +4 -10
- package/dist/utils/page-colors.js +11 -35
- package/dist/utils/page-fonts.js +6 -11
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +22 -11
- package/dist/utils/pages.js +70 -30
- package/dist/utils/privacy-regions.d.ts +19 -0
- package/dist/utils/privacy-regions.js +91 -0
- package/dist/utils/publish-form-data.d.ts +4 -5
- package/dist/utils/publish-form-data.js +2 -3
- package/dist/utils/publish-policy.d.ts +10 -23
- package/dist/utils/publish-policy.js +63 -116
- package/dist/utils/query-client.d.ts +2 -0
- package/dist/utils/query-client.js +10 -1
- package/dist/utils/runtime-paths.d.ts +4 -4
- package/dist/utils/runtime-paths.js +6 -8
- package/dist/utils/runtime-upload.d.ts +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +18 -24
- package/dist/utils/space-config.d.ts +11 -14
- package/dist/utils/space-config.js +10 -16
- package/dist/utils/static-runtime-policy.d.ts +5 -8
- package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
- package/dist/utils/static-runtime-policy.generated.js +70 -0
- package/dist/utils/static-runtime-policy.js +17 -84
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.js +8 -14
- package/dist/utils/version-path.js +11 -19
- package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
- package/dist/utils/wpcom-auth-redirects.js +1 -4
- package/dist/vocabulary.d.ts +7 -7
- package/dist/vocabulary.js +30 -16
- package/package.json +14 -2
- package/dist/agents/client-registry.d.ts +0 -22
- package/dist/agents/client-registry.js +0 -41
- package/dist/docs/agent-handoff-document.d.ts +0 -15
- package/dist/docs/agent-handoff-document.js +0 -180
- package/dist/docs/agent-solutions.d.ts +0 -110
- package/dist/docs/agent-solutions.js +0 -183
- package/dist/utils/query-keys.d.ts +0 -84
- package/dist/utils/query-keys.js +0 -108
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { serviceOrigin } from "../config/domains.js";
|
|
3
|
-
import {
|
|
3
|
+
import { normalizeSlug } from "../utils/slug.js";
|
|
4
|
+
import { defaultPlanNameSchema, planCatalogSchema } from "./commerce.js";
|
|
5
|
+
import { GRANT_RESOURCE_PATTERN_LIMIT, identityConnectionPublicKeySchema, normalizeGrantResourcePattern, } from "./grants.js";
|
|
4
6
|
export const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
|
|
5
7
|
export const SPACE_CONFIG_ALIAS_FILES = [
|
|
6
8
|
"spacefast.jsonc",
|
|
@@ -15,18 +17,15 @@ export const SPACE_CONFIG_ACCEPTED_FILES = [
|
|
|
15
17
|
...SPACE_CONFIG_ALIAS_FILES,
|
|
16
18
|
];
|
|
17
19
|
/**
|
|
18
|
-
* Accepted config filenames in read precedence order, highest first.
|
|
19
|
-
* step with the finalizer's `CONFIG_ACCEPTED_FILES`
|
|
20
|
-
* protocol.rs)
|
|
21
|
-
* read choosing a different file than the publish serves is a split brain.
|
|
20
|
+
* Accepted config filenames in read precedence order, highest first. Must stay
|
|
21
|
+
* in step with the finalizer's `CONFIG_ACCEPTED_FILES`
|
|
22
|
+
* (crates/stattic-runtime-core protocol.rs), which is the selection authority.
|
|
22
23
|
*/
|
|
23
24
|
export const SPACE_CONFIG_PRECEDENCE = SPACE_CONFIG_ACCEPTED_FILES;
|
|
24
25
|
export const SPACE_CONFIG_PRIVATE_FILES = [...SPACE_CONFIG_ACCEPTED_FILES];
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
// validation for the API `config` overlay. Plan policy may LOWER these caps,
|
|
29
|
-
// never raise them.
|
|
26
|
+
// Parser-safety caps, enforced by ONE shared validator at every intake seam:
|
|
27
|
+
// finalize for the `sf.jsonc` file, request validation for the API `config`
|
|
28
|
+
// overlay. Plan policy may LOWER these caps, never raise them.
|
|
30
29
|
export const SPACE_CONFIG_CAPS = {
|
|
31
30
|
/** Max raw `sf.jsonc` size in bytes. */
|
|
32
31
|
fileBytes: 256 * 1024,
|
|
@@ -56,13 +55,48 @@ export const SPACE_CONFIG_CAPS = {
|
|
|
56
55
|
crons: 8,
|
|
57
56
|
/** Max `crons[].path` length. */
|
|
58
57
|
cronPathChars: 512,
|
|
58
|
+
// `system` manifest (Partner API): the control-plane-only section a tenant's
|
|
59
|
+
// designated system space publishes. Every string is bounded and every URL is
|
|
60
|
+
// https; these caps are the enforcing authority (the Rust crate only passes
|
|
61
|
+
// the section through — it never validates it).
|
|
62
|
+
/** Max `system.presentation.name` display-name length. */
|
|
63
|
+
systemNameChars: 255,
|
|
64
|
+
/** Max length of any https URL or origin in the `system` manifest. */
|
|
65
|
+
systemUrlChars: 2048,
|
|
66
|
+
/** Max `system.hostnames.apex` length (a DNS name never exceeds 253). */
|
|
67
|
+
systemHostnameChars: 253,
|
|
68
|
+
/** Max `system.presentation.contacts` entries. */
|
|
69
|
+
systemContacts: 32,
|
|
70
|
+
/** Max length of a `system.presentation.contacts` key. */
|
|
71
|
+
systemContactKeyChars: 64,
|
|
72
|
+
/** Max length of a `system.presentation.contacts` value. */
|
|
73
|
+
systemContactValueChars: 2048,
|
|
74
|
+
/** Max `system.api.allowedOrigins` entries. */
|
|
75
|
+
systemApiAllowedOrigins: 32,
|
|
76
|
+
/** Max `system.tokenIssuers` entries. */
|
|
77
|
+
systemTokenIssuers: 16,
|
|
78
|
+
/** Max `system.tokenIssuers[].issuer` length. */
|
|
79
|
+
systemIssuerChars: 512,
|
|
80
|
+
/** Max `system.tokenIssuers[].keys` entries. */
|
|
81
|
+
systemIssuerKeys: 16,
|
|
82
|
+
/** Max `system.tokenIssuers[].keys[].kid` length. */
|
|
83
|
+
systemKeyIdChars: 64,
|
|
84
|
+
/** Exact raw Ed25519 public-key length after base64url encoding. */
|
|
85
|
+
systemPublicKeyChars: 43,
|
|
86
|
+
/** Max `system.tokenIssuers[].proof` length. */
|
|
87
|
+
systemProofChars: 4096,
|
|
88
|
+
/** Max `system.subscriptions` entries. */
|
|
89
|
+
systemSubscriptions: 32,
|
|
90
|
+
/** Max `system.subscriptions[].events` entries. */
|
|
91
|
+
systemSubscriptionEvents: 64,
|
|
92
|
+
/** Max length of a `system.subscriptions[].events` name. */
|
|
93
|
+
systemEventChars: 128,
|
|
59
94
|
};
|
|
60
95
|
/** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
|
|
61
96
|
export const SPACE_CONFIG_SCHEMA_URL = `${serviceOrigin("www", "prod")}/schemas/sf.json`;
|
|
62
|
-
// Pages theme tokens:
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// named), categorically rejecting anything that could escape a style context.
|
|
97
|
+
// Pages theme tokens: presentation only, never layout, behavior, or protocol.
|
|
98
|
+
// The color grammar accepts hex, rgb(a), hsl(a), and named CSS colors, and
|
|
99
|
+
// rejects anything that could escape a style context.
|
|
66
100
|
const PAGES_COLOR_PATTERN = new RegExp([
|
|
67
101
|
"^(?:",
|
|
68
102
|
"#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})",
|
|
@@ -117,10 +151,7 @@ export const spacePageThemeSchema = z
|
|
|
117
151
|
.describe("Theme tokens for Spacefast-authored pages.");
|
|
118
152
|
// WordPress-compatible `theme.json` is an inference input, not configuration.
|
|
119
153
|
// Only `settings.color.palette` and `settings.typography.fontFamilies` infer
|
|
120
|
-
// Pages tokens; every other
|
|
121
|
-
// WP theme.json key is accepted-and-ignored (this is not a full WP_Theme_JSON
|
|
122
|
-
// reimplementation, just the safe subset that reaches presentation-only gate
|
|
123
|
-
// pages.
|
|
154
|
+
// Pages tokens; every other WP key is accepted and ignored.
|
|
124
155
|
export const THEME_JSON_FILE = "theme.json";
|
|
125
156
|
export const spaceBuildSettingsSchema = z
|
|
126
157
|
.object({
|
|
@@ -138,9 +169,8 @@ export const spaceBuildSettingsSchema = z
|
|
|
138
169
|
.strict()
|
|
139
170
|
.describe("Remote build settings used by repository builds.");
|
|
140
171
|
// Every space gets its own site, so there is nothing to place between: no mode,
|
|
141
|
-
// no region knob. `burstable`
|
|
142
|
-
//
|
|
143
|
-
// creation, and never changes.
|
|
172
|
+
// no region knob. `burstable` says whether the space's site may burst provider
|
|
173
|
+
// PHP workers. Data location is chosen once, at creation, and never changes.
|
|
144
174
|
export const spacePlacementConfigSchema = z
|
|
145
175
|
.object({
|
|
146
176
|
burstable: z.boolean().optional(),
|
|
@@ -354,11 +384,9 @@ function refineDefaultDataSource(config, ctx) {
|
|
|
354
384
|
});
|
|
355
385
|
}
|
|
356
386
|
}
|
|
357
|
-
// Shared SpaceConfig fields
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
-
// Meta caps are the spec parser-safety numbers (title 300, description 1000,
|
|
361
|
-
// image 2000); plan policy may lower them but never raise them.
|
|
387
|
+
// Shared SpaceConfig fields: the declarative serving config also accepted by
|
|
388
|
+
// `sf.jsonc`. Cloud-only overlay fields such as pre-build data sources are
|
|
389
|
+
// added to `spaceConfigSchema` below.
|
|
362
390
|
const spaceConfigBaseSchema = z.object({
|
|
363
391
|
index: z
|
|
364
392
|
.union([z.string().min(1), z.literal(false)])
|
|
@@ -456,13 +484,12 @@ const spaceConfigBaseSchema = z.object({
|
|
|
456
484
|
.boolean()
|
|
457
485
|
.optional()
|
|
458
486
|
.describe("Accepted serving flag; runtime enforcement ships separately."),
|
|
459
|
-
//
|
|
460
|
-
// build pipeline
|
|
461
|
-
// diagnostics; absent/false keeps today's behavior byte-for-byte.
|
|
487
|
+
// Undescribed on purpose (hidden, experimental): enables the finalize-time
|
|
488
|
+
// build pipeline. Accepted without diagnostics.
|
|
462
489
|
experimental_gutenberg: z.boolean().optional(),
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
//
|
|
490
|
+
// Hidden, experimental: static HTML snippets, honored only when
|
|
491
|
+
// `experimental_gutenberg` is true. Byte caps are enforced by the shared
|
|
492
|
+
// validator (inject_snippet_too_large / inject_invalid).
|
|
466
493
|
inject: z
|
|
467
494
|
.object({
|
|
468
495
|
head: z.array(z.string()).max(SPACE_CONFIG_CAPS.injectSnippets).optional(),
|
|
@@ -497,12 +524,10 @@ export function spaceSuperpowersEnabled(config) {
|
|
|
497
524
|
const superpowers = config?.superpowers;
|
|
498
525
|
return superpowers?.enabled !== false && superpowers?.disable_all_injection !== true;
|
|
499
526
|
}
|
|
500
|
-
// The `sf.jsonc` FILE shape
|
|
501
|
-
//
|
|
502
|
-
//
|
|
503
|
-
//
|
|
504
|
-
// to the routing compiler, not to this shape: it resolves serving, they compile
|
|
505
|
-
// into the canonical rules and merge behind `_redirects`/`_headers`.
|
|
527
|
+
// The `sf.jsonc` FILE shape: SpaceConfig plus the editor `$schema` pointer and
|
|
528
|
+
// the optional `space` link (slug or `spc_` id). Routing rules
|
|
529
|
+
// (`redirects`/`rewrites`/`headers`) are sf.jsonc keys too, but they belong to
|
|
530
|
+
// the routing compiler and merge behind `_redirects`/`_headers`.
|
|
506
531
|
const spaceConfigPublicPatternSchema = z
|
|
507
532
|
.string()
|
|
508
533
|
.min(1)
|
|
@@ -564,10 +589,10 @@ export const spaceConfigFileAccessSchema = z
|
|
|
564
589
|
/**
|
|
565
590
|
* Zero: a transactional app with its own database.
|
|
566
591
|
*
|
|
567
|
-
* Both entries are required because Zero is never inferred
|
|
568
|
-
* a database must not spring into existence from a directory shape
|
|
569
|
-
*
|
|
570
|
-
*
|
|
592
|
+
* Both entries are required because Zero is never inferred: a runtime that owns
|
|
593
|
+
* a database must not spring into existence from a directory shape. Once
|
|
594
|
+
* declared, a server or client that cannot be resolved fails the publish rather
|
|
595
|
+
* than degrading to static files.
|
|
571
596
|
*/
|
|
572
597
|
export const spaceRuntimeZeroSchema = z
|
|
573
598
|
.object({
|
|
@@ -588,10 +613,8 @@ export const spaceRuntimeZeroSchema = z
|
|
|
588
613
|
* Functions: the worker `sf publish` compiles.
|
|
589
614
|
*
|
|
590
615
|
* Every field beyond `kind` is optional because the normal case is detection: a
|
|
591
|
-
* project with `handler.ts` or an OpenNext build needs no configuration
|
|
592
|
-
*
|
|
593
|
-
* unusual, or a compatibility date the author wants pinned rather than
|
|
594
|
-
* defaulted.
|
|
616
|
+
* project with `handler.ts` or an OpenNext build needs no configuration. These
|
|
617
|
+
* exist for the layouts detection cannot guess.
|
|
595
618
|
*/
|
|
596
619
|
export const spaceRuntimeFunctionsSchema = z
|
|
597
620
|
.object({
|
|
@@ -605,37 +628,33 @@ export const spaceRuntimeFunctionsSchema = z
|
|
|
605
628
|
.boolean()
|
|
606
629
|
.default(false)
|
|
607
630
|
.describe("Give the worker `env.DB`, a D1-shaped binding to this space's database. " +
|
|
608
|
-
"
|
|
631
|
+
"Declared, not detected: a capability an author did not request is authority they cannot see. Defaults to off."),
|
|
609
632
|
fetch: z
|
|
610
633
|
.boolean()
|
|
611
634
|
.optional()
|
|
612
635
|
.describe("Give the worker `ctx.fetch`, brokered outbound HTTP through the relay. " +
|
|
613
|
-
"Declared, not detected,
|
|
636
|
+
"Declared, not detected, like `database`. There is no schema default: a Next build gets egress unless this says false, because SSR fetches while rendering, while a hand-written worker reaches nothing until it says so."),
|
|
614
637
|
compatibilityDate: z
|
|
615
638
|
.string()
|
|
616
639
|
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
617
640
|
.optional()
|
|
618
|
-
.describe("Runtime compatibility date this worker was written against. Pinning it
|
|
641
|
+
.describe("Runtime compatibility date this worker was written against. Pinning it means promoting an old version restores the semantics it was built with."),
|
|
619
642
|
})
|
|
620
643
|
.describe("Functions: a worker compiled at publish time.");
|
|
621
644
|
/**
|
|
622
|
-
* The one runtime declaration, discriminated on `kind`.
|
|
645
|
+
* The one runtime declaration, discriminated on `kind`. A version cannot
|
|
646
|
+
* express two runtimes at once.
|
|
623
647
|
*
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
* back with the version instead of being set through the API config overlay.
|
|
648
|
+
* File-only on purpose: a runtime is a fact about the content of a version, so
|
|
649
|
+
* it rolls forward and back with the version instead of being set through the
|
|
650
|
+
* API config overlay.
|
|
628
651
|
*/
|
|
629
652
|
export const spaceRuntimeSchema = z
|
|
630
653
|
.discriminatedUnion("kind", [spaceRuntimeZeroSchema, spaceRuntimeFunctionsSchema])
|
|
631
654
|
.describe("Runtime this version's code runs on. Omit it when the space does not run code. Functions is also detected from the published directory when it is not stated.");
|
|
632
655
|
/**
|
|
633
656
|
* Scheduled requests: the provider crontab asks this space for these paths on
|
|
634
|
-
* these schedules.
|
|
635
|
-
*
|
|
636
|
-
* File-only for the same reason `runtime` is: what runs on a schedule is a fact
|
|
637
|
-
* about the content of a version, so it rolls forward and back with the version
|
|
638
|
-
* instead of being set through the API config overlay.
|
|
657
|
+
* these schedules. File-only for the same reason `runtime` is.
|
|
639
658
|
*
|
|
640
659
|
* The Rust config compiler is the selection authority for both fields; this
|
|
641
660
|
* schema exists so an editor and an agent get the same answer before publish.
|
|
@@ -704,8 +723,8 @@ function cronFieldIsValid(field, [min, max]) {
|
|
|
704
723
|
}
|
|
705
724
|
/**
|
|
706
725
|
* The wp.cloud schedule grammar: a named interval, an `Nh`/`Nd`/`Nw` count, or
|
|
707
|
-
* a five-field crontab expression. No `@daily` macros and no month/day names
|
|
708
|
-
*
|
|
726
|
+
* a five-field crontab expression. No `@daily` macros and no month/day names.
|
|
727
|
+
* The provider does not accept them either.
|
|
709
728
|
*/
|
|
710
729
|
export function isSpaceCronSchedule(schedule) {
|
|
711
730
|
if (SPACE_CRON_NAMED_SCHEDULES.some((named) => named === schedule))
|
|
@@ -724,16 +743,12 @@ export function isSpaceCronSchedule(schedule) {
|
|
|
724
743
|
}));
|
|
725
744
|
}
|
|
726
745
|
/**
|
|
727
|
-
* The artifact key for a cron path
|
|
728
|
-
*
|
|
729
|
-
*
|
|
746
|
+
* The artifact key for a cron path — the shared slug normalizer, so an accented
|
|
747
|
+
* path folds the same way it does everywhere else. Two paths that produce one
|
|
748
|
+
* key are rejected, so a key names exactly one schedule.
|
|
730
749
|
*/
|
|
731
750
|
export function spaceCronKey(path) {
|
|
732
|
-
return path
|
|
733
|
-
.replace(/^\/+/, "")
|
|
734
|
-
.toLowerCase()
|
|
735
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
736
|
-
.replace(/^-+|-+$/g, "");
|
|
751
|
+
return normalizeSlug(path);
|
|
737
752
|
}
|
|
738
753
|
/** Generated runtime file the serving engine reads, written only when a version declares a cron. */
|
|
739
754
|
export const SPACE_CRONS_ARTIFACT_PATH = "__spacefast/crons.json";
|
|
@@ -754,9 +769,8 @@ export const spaceCronsSchema = z
|
|
|
754
769
|
.array(spaceCronSchema)
|
|
755
770
|
.max(SPACE_CONFIG_CAPS.crons)
|
|
756
771
|
.superRefine((entries, context) => {
|
|
757
|
-
//
|
|
758
|
-
//
|
|
759
|
-
// one key — which would give two schedules one identity downstream.
|
|
772
|
+
// Keying on the slug catches both defects: a path written twice, and two
|
|
773
|
+
// paths that slug to one key.
|
|
760
774
|
const seenByKey = new Map();
|
|
761
775
|
entries.forEach((entry, index) => {
|
|
762
776
|
const key = spaceCronKey(entry.path);
|
|
@@ -776,6 +790,146 @@ export const spaceCronsSchema = z
|
|
|
776
790
|
});
|
|
777
791
|
})
|
|
778
792
|
.describe(`Scheduled requests Spacefast issues against this space's own paths; at most ${SPACE_CONFIG_CAPS.crons} entries.`);
|
|
793
|
+
/**
|
|
794
|
+
* The `system` manifest: the control-plane-only section a tenant's designated
|
|
795
|
+
* system space publishes to declare its partner-facing surface (presentation,
|
|
796
|
+
* white-label hostnames, API origins, trusted token issuers, event
|
|
797
|
+
* subscriptions).
|
|
798
|
+
*
|
|
799
|
+
* No serving behavior derives from it. The control plane freezes it at finalize
|
|
800
|
+
* and reconciles it into materialized state; other spaces' manifests are
|
|
801
|
+
* ignored. File-only, like `runtime` and `crons`: what a partner exposes is a
|
|
802
|
+
* fact about the live version, so it rolls forward and back with the version
|
|
803
|
+
* instead of living in the mutable API overlay.
|
|
804
|
+
*
|
|
805
|
+
* This zod contract is the validation authority: every string is bounded and
|
|
806
|
+
* every URL is https, with no HTML/CSS anywhere. The Rust config crate only
|
|
807
|
+
* recognizes the key and passes the section through verbatim — it never
|
|
808
|
+
* validates it and it never reaches the runtime effective-config lane.
|
|
809
|
+
*/
|
|
810
|
+
// `*` is excluded deliberately, not for hygiene: `system.api.allowedOrigins`
|
|
811
|
+
// feeds the CORS allow-list, whose matcher treats `*` as a wildcard. A partner
|
|
812
|
+
// could otherwise publish `https://*` and have the control plane reflect any
|
|
813
|
+
// requesting origin back with credentials.
|
|
814
|
+
const SYSTEM_HTTPS_URL_PATTERN = /^https:\/\/[^\s"'<>\\*]+$/;
|
|
815
|
+
const SYSTEM_HOSTNAME_PATTERN = /^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)+$/;
|
|
816
|
+
const systemHttpsUrlSchema = z
|
|
817
|
+
.string()
|
|
818
|
+
.trim()
|
|
819
|
+
.min(1)
|
|
820
|
+
.max(SPACE_CONFIG_CAPS.systemUrlChars)
|
|
821
|
+
.regex(SYSTEM_HTTPS_URL_PATTERN, "must be an https:// URL");
|
|
822
|
+
export const systemPresentationSchema = z
|
|
823
|
+
.object({
|
|
824
|
+
name: z.string().trim().min(1).max(SPACE_CONFIG_CAPS.systemNameChars).optional(),
|
|
825
|
+
logo: systemHttpsUrlSchema.optional(),
|
|
826
|
+
supportUrl: systemHttpsUrlSchema.optional(),
|
|
827
|
+
claimOrigin: systemHttpsUrlSchema.optional(),
|
|
828
|
+
accessHandoffOrigin: systemHttpsUrlSchema.optional(),
|
|
829
|
+
problemDocsBaseUrl: systemHttpsUrlSchema.optional(),
|
|
830
|
+
contacts: z
|
|
831
|
+
.record(z.string().trim().min(1).max(SPACE_CONFIG_CAPS.systemContactKeyChars), z.string().trim().min(1).max(SPACE_CONFIG_CAPS.systemContactValueChars))
|
|
832
|
+
.refine((contacts) => Object.keys(contacts).length <= SPACE_CONFIG_CAPS.systemContacts, `at most ${SPACE_CONFIG_CAPS.systemContacts} contacts`)
|
|
833
|
+
.optional()
|
|
834
|
+
.describe("Named contact URLs or addresses shown to claimants and partners."),
|
|
835
|
+
})
|
|
836
|
+
.strict()
|
|
837
|
+
.describe("Partner-facing branding and links for the white-label surface.");
|
|
838
|
+
export const systemHostnamesSchema = z
|
|
839
|
+
.object({
|
|
840
|
+
apex: z
|
|
841
|
+
.string()
|
|
842
|
+
.trim()
|
|
843
|
+
.min(1)
|
|
844
|
+
.max(SPACE_CONFIG_CAPS.systemHostnameChars)
|
|
845
|
+
.regex(SYSTEM_HOSTNAME_PATTERN, "must be a bare hostname (no scheme or path)")
|
|
846
|
+
.optional()
|
|
847
|
+
.describe("Apex hostname for the white-label surface."),
|
|
848
|
+
})
|
|
849
|
+
.strict();
|
|
850
|
+
export const systemApiSchema = z
|
|
851
|
+
.object({
|
|
852
|
+
origin: systemHttpsUrlSchema
|
|
853
|
+
.optional()
|
|
854
|
+
.describe("https origin the partner API is served from."),
|
|
855
|
+
allowedOrigins: z
|
|
856
|
+
.array(systemHttpsUrlSchema)
|
|
857
|
+
.max(SPACE_CONFIG_CAPS.systemApiAllowedOrigins)
|
|
858
|
+
.optional()
|
|
859
|
+
.describe("https origins permitted to call the partner API (CORS)."),
|
|
860
|
+
})
|
|
861
|
+
.strict();
|
|
862
|
+
export const systemTokenIssuerSchema = z
|
|
863
|
+
.object({
|
|
864
|
+
issuer: z
|
|
865
|
+
.string()
|
|
866
|
+
.trim()
|
|
867
|
+
.min(1)
|
|
868
|
+
.max(SPACE_CONFIG_CAPS.systemIssuerChars)
|
|
869
|
+
.describe("Issuer identifier (the iss claim tokens must carry)."),
|
|
870
|
+
keys: z
|
|
871
|
+
.array(identityConnectionPublicKeySchema)
|
|
872
|
+
.min(1)
|
|
873
|
+
.max(SPACE_CONFIG_CAPS.systemIssuerKeys)
|
|
874
|
+
.describe("Public verification keys, addressed by key id."),
|
|
875
|
+
proof: z
|
|
876
|
+
.string()
|
|
877
|
+
.trim()
|
|
878
|
+
.min(1)
|
|
879
|
+
.max(SPACE_CONFIG_CAPS.systemProofChars)
|
|
880
|
+
.optional()
|
|
881
|
+
.describe("Ownership proof that completes the two-publish issuer activation."),
|
|
882
|
+
})
|
|
883
|
+
.strict();
|
|
884
|
+
export const systemSubscriptionSchema = z
|
|
885
|
+
.object({
|
|
886
|
+
url: systemHttpsUrlSchema.describe("https endpoint events are delivered to."),
|
|
887
|
+
events: z
|
|
888
|
+
.array(z.string().trim().min(1).max(SPACE_CONFIG_CAPS.systemEventChars))
|
|
889
|
+
.min(1)
|
|
890
|
+
.max(SPACE_CONFIG_CAPS.systemSubscriptionEvents)
|
|
891
|
+
.describe("Event names delivered to this subscription."),
|
|
892
|
+
})
|
|
893
|
+
.strict();
|
|
894
|
+
export const spaceSystemManifestSchema = z
|
|
895
|
+
.object({
|
|
896
|
+
presentation: systemPresentationSchema.optional(),
|
|
897
|
+
hostnames: systemHostnamesSchema.optional(),
|
|
898
|
+
api: systemApiSchema.optional(),
|
|
899
|
+
tokenIssuers: z
|
|
900
|
+
.array(systemTokenIssuerSchema)
|
|
901
|
+
.max(SPACE_CONFIG_CAPS.systemTokenIssuers)
|
|
902
|
+
.optional()
|
|
903
|
+
.describe("Trusted token issuers registered for the tenant."),
|
|
904
|
+
subscriptions: z
|
|
905
|
+
.array(systemSubscriptionSchema)
|
|
906
|
+
.max(SPACE_CONFIG_CAPS.systemSubscriptions)
|
|
907
|
+
.optional()
|
|
908
|
+
.describe("Event subscriptions (webhooks) the tenant declares."),
|
|
909
|
+
plans: planCatalogSchema
|
|
910
|
+
.optional()
|
|
911
|
+
.describe("Per-tenant plan catalog: plan name → { features, quotas.spaces, quotaPolicy }. Feature keys validated against the live vocabulary; plan names are arbitrary."),
|
|
912
|
+
defaultPlan: defaultPlanNameSchema
|
|
913
|
+
.optional()
|
|
914
|
+
.describe("Plan unassigned principals fall back to. Must be a key in `plans`."),
|
|
915
|
+
})
|
|
916
|
+
.strict()
|
|
917
|
+
.superRefine((manifest, ctx) => {
|
|
918
|
+
if (manifest.defaultPlan === undefined) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
// A defaultPlan is only meaningful against a declared catalog: it must name a
|
|
922
|
+
// plan the same manifest declares, or gate resolution would fall back to a
|
|
923
|
+
// plan that does not exist.
|
|
924
|
+
if (manifest.plans === undefined || !(manifest.defaultPlan in manifest.plans)) {
|
|
925
|
+
ctx.addIssue({
|
|
926
|
+
code: z.ZodIssueCode.custom,
|
|
927
|
+
path: ["defaultPlan"],
|
|
928
|
+
message: "defaultPlan must be one of the plan names declared in `plans`.",
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
})
|
|
932
|
+
.describe("Control-plane manifest for a tenant's designated system space. Parsed and reconciled by the control plane; ignored by other spaces.");
|
|
779
933
|
export const spaceConfigFileSchema = spaceConfigBaseSchema.extend({
|
|
780
934
|
$schema: z
|
|
781
935
|
.string()
|
|
@@ -798,6 +952,9 @@ export const spaceConfigFileSchema = spaceConfigBaseSchema.extend({
|
|
|
798
952
|
access: spaceConfigFileAccessSchema.optional(),
|
|
799
953
|
runtime: spaceRuntimeSchema.optional(),
|
|
800
954
|
crons: spaceCronsSchema.optional(),
|
|
955
|
+
system: spaceSystemManifestSchema
|
|
956
|
+
.optional()
|
|
957
|
+
.describe("Control-plane system-space manifest. Honored only for a tenant's designated system space; other spaces' declarations are ignored."),
|
|
801
958
|
});
|
|
802
959
|
/**
|
|
803
960
|
* The published JSON Schema artifact for `sf.jsonc`, generated from the
|
|
@@ -810,11 +967,10 @@ export function spaceConfigJsonSchema() {
|
|
|
810
967
|
$id: SPACE_CONFIG_SCHEMA_URL,
|
|
811
968
|
title: "Spacefast space configuration (sf.jsonc)",
|
|
812
969
|
});
|
|
813
|
-
// `redirects`, `rewrites` and `headers` are real sf.jsonc keys
|
|
814
|
-
// compiler
|
|
815
|
-
//
|
|
816
|
-
//
|
|
817
|
-
// examples read as unknown keys.
|
|
970
|
+
// `redirects`, `rewrites` and `headers` are real sf.jsonc keys owned by the
|
|
971
|
+
// routing compiler, not by the serving shape above, so they are described
|
|
972
|
+
// here. Without them an editor reads the documented routing examples as
|
|
973
|
+
// unknown keys.
|
|
818
974
|
return {
|
|
819
975
|
...schema,
|
|
820
976
|
properties: {
|
|
@@ -824,11 +980,11 @@ export function spaceConfigJsonSchema() {
|
|
|
824
980
|
};
|
|
825
981
|
}
|
|
826
982
|
// The `!` and `name=:capture` of a `_redirects` line, shared by both rule
|
|
827
|
-
// sections
|
|
983
|
+
// sections and by `config::strict::public_json_schema`.
|
|
828
984
|
const SPACE_CONFIG_ROUTING_FORCE_SCHEMA = {
|
|
829
985
|
type: "boolean",
|
|
830
986
|
default: false,
|
|
831
|
-
description: "Answer even when the request path resolves to a committed file
|
|
987
|
+
description: "Answer even when the request path resolves to a committed file, the ! of a _redirects rule.",
|
|
832
988
|
};
|
|
833
989
|
const SPACE_CONFIG_ROUTING_QUERY_SCHEMA = {
|
|
834
990
|
type: "object",
|
|
@@ -890,7 +1046,7 @@ const SPACE_CONFIG_ROUTING_SCHEMA_PROPERTIES = {
|
|
|
890
1046
|
notFound: {
|
|
891
1047
|
type: "boolean",
|
|
892
1048
|
default: false,
|
|
893
|
-
description: "Serve the destination with status 404
|
|
1049
|
+
description: "Serve the destination with status 404, the 404 of a _redirects rule. The destination must be a path.",
|
|
894
1050
|
},
|
|
895
1051
|
},
|
|
896
1052
|
required: ["source", "destination"],
|
|
@@ -924,7 +1080,7 @@ const SPACE_CONFIG_ROUTING_SCHEMA_PROPERTIES = {
|
|
|
924
1080
|
key: { type: "string", minLength: 1 },
|
|
925
1081
|
remove: {
|
|
926
1082
|
const: true,
|
|
927
|
-
description: "Remove this header instead of setting it
|
|
1083
|
+
description: "Remove this header instead of setting it, the !Name line of a _headers block.",
|
|
928
1084
|
},
|
|
929
1085
|
},
|
|
930
1086
|
required: ["key", "remove"],
|
|
@@ -940,16 +1096,15 @@ const SPACE_CONFIG_ROUTING_SCHEMA_PROPERTIES = {
|
|
|
940
1096
|
},
|
|
941
1097
|
};
|
|
942
1098
|
/*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
*
|
|
950
|
-
*
|
|
951
|
-
*
|
|
952
|
-
* static-placement shape so unrelated properties of the same name survive.
|
|
1099
|
+
* `experimental_gutenberg` and its `inject` companion are ACCEPTED by the parser
|
|
1100
|
+
* but never published: the bare key names alone would document the feature to
|
|
1101
|
+
* every editor and agent reading a schema artifact. Every generator that derives
|
|
1102
|
+
* a public artifact from the SpaceConfig zod shape (the sf.jsonc JSON Schema,
|
|
1103
|
+
* the www publish-spec, the SDK OpenAPI documents) must run it through this
|
|
1104
|
+
* stripper. The published schemas set no additionalProperties constraint, so
|
|
1105
|
+
* configs using the hidden keys still validate. `inject` is removed only when it
|
|
1106
|
+
* carries the SpaceConfig static-placement shape, so unrelated properties of the
|
|
1107
|
+
* same name survive.
|
|
953
1108
|
*/
|
|
954
1109
|
export function stripHiddenSpaceConfigKeys(schema) {
|
|
955
1110
|
if (Array.isArray(schema)) {
|