@spacefast/common 0.0.2
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/README.md +42 -0
- package/dist/brand.d.ts +15 -0
- package/dist/brand.js +24 -0
- package/dist/config/domains.d.ts +30 -0
- package/dist/config/domains.js +75 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +3 -0
- package/dist/contracts/abuse.d.ts +93 -0
- package/dist/contracts/abuse.js +50 -0
- package/dist/contracts/access.d.ts +409 -0
- package/dist/contracts/access.js +396 -0
- package/dist/contracts/account.d.ts +28 -0
- package/dist/contracts/account.js +54 -0
- package/dist/contracts/activity.d.ts +118 -0
- package/dist/contracts/activity.js +180 -0
- package/dist/contracts/analytics.d.ts +56 -0
- package/dist/contracts/analytics.js +91 -0
- package/dist/contracts/annotations.d.ts +327 -0
- package/dist/contracts/annotations.js +234 -0
- package/dist/contracts/api-keys.d.ts +517 -0
- package/dist/contracts/api-keys.js +235 -0
- package/dist/contracts/archives.d.ts +332 -0
- package/dist/contracts/archives.js +120 -0
- package/dist/contracts/auth.d.ts +86 -0
- package/dist/contracts/auth.js +82 -0
- package/dist/contracts/beta.d.ts +106 -0
- package/dist/contracts/beta.js +104 -0
- package/dist/contracts/billing.d.ts +328 -0
- package/dist/contracts/billing.js +203 -0
- package/dist/contracts/builds.d.ts +504 -0
- package/dist/contracts/builds.js +248 -0
- package/dist/contracts/channels.d.ts +49 -0
- package/dist/contracts/channels.js +51 -0
- package/dist/contracts/common.d.ts +238 -0
- package/dist/contracts/common.js +175 -0
- package/dist/contracts/deployments.d.ts +574 -0
- package/dist/contracts/deployments.js +97 -0
- package/dist/contracts/device-auth.d.ts +194 -0
- package/dist/contracts/device-auth.js +162 -0
- package/dist/contracts/domains.d.ts +6115 -0
- package/dist/contracts/domains.js +1435 -0
- package/dist/contracts/enums.d.ts +196 -0
- package/dist/contracts/enums.js +211 -0
- package/dist/contracts/error-code-meta.d.ts +1560 -0
- package/dist/contracts/error-code-meta.js +400 -0
- package/dist/contracts/error-codes.d.ts +13 -0
- package/dist/contracts/error-codes.js +416 -0
- package/dist/contracts/events.d.ts +398 -0
- package/dist/contracts/events.js +320 -0
- package/dist/contracts/fast-domain-search.d.ts +19 -0
- package/dist/contracts/fast-domain-search.js +22 -0
- package/dist/contracts/features.d.ts +240 -0
- package/dist/contracts/features.js +406 -0
- package/dist/contracts/git.d.ts +288 -0
- package/dist/contracts/git.js +116 -0
- package/dist/contracts/ids.d.ts +35 -0
- package/dist/contracts/ids.js +45 -0
- package/dist/contracts/intercom.d.ts +6 -0
- package/dist/contracts/intercom.js +5 -0
- package/dist/contracts/internal.d.ts +103 -0
- package/dist/contracts/internal.js +92 -0
- package/dist/contracts/mcp.d.ts +788 -0
- package/dist/contracts/mcp.js +161 -0
- package/dist/contracts/me.d.ts +81 -0
- package/dist/contracts/me.js +104 -0
- package/dist/contracts/oauth-resources.d.ts +30 -0
- package/dist/contracts/oauth-resources.js +61 -0
- package/dist/contracts/operations.d.ts +54 -0
- package/dist/contracts/operations.js +14 -0
- package/dist/contracts/plan-policy.d.ts +85 -0
- package/dist/contracts/plan-policy.js +75 -0
- package/dist/contracts/platform.d.ts +359 -0
- package/dist/contracts/platform.js +216 -0
- package/dist/contracts/push-new.d.ts +156 -0
- package/dist/contracts/push-new.js +52 -0
- package/dist/contracts/quotas.d.ts +16 -0
- package/dist/contracts/quotas.js +36 -0
- package/dist/contracts/repository-connections.d.ts +231 -0
- package/dist/contracts/repository-connections.js +106 -0
- package/dist/contracts/resources.d.ts +529 -0
- package/dist/contracts/resources.js +209 -0
- package/dist/contracts/routes.d.ts +45 -0
- package/dist/contracts/routes.js +31 -0
- package/dist/contracts/runtime-api.d.ts +449 -0
- package/dist/contracts/runtime-api.js +513 -0
- package/dist/contracts/sites.d.ts +393 -0
- package/dist/contracts/sites.js +121 -0
- package/dist/contracts/slugs.d.ts +31 -0
- package/dist/contracts/slugs.js +47 -0
- package/dist/contracts/space-config.d.ts +216 -0
- package/dist/contracts/space-config.js +237 -0
- package/dist/contracts/space-theme.d.ts +25 -0
- package/dist/contracts/space-theme.js +49 -0
- package/dist/contracts/spaces.d.ts +2760 -0
- package/dist/contracts/spaces.js +589 -0
- package/dist/contracts/superadmin-activity.d.ts +205 -0
- package/dist/contracts/superadmin-activity.js +107 -0
- package/dist/contracts/superadmin-emails.d.ts +212 -0
- package/dist/contracts/superadmin-emails.js +112 -0
- package/dist/contracts/superadmin-queues.d.ts +414 -0
- package/dist/contracts/superadmin-queues.js +202 -0
- package/dist/contracts/superadmin-runtime.d.ts +27 -0
- package/dist/contracts/superadmin-runtime.js +38 -0
- package/dist/contracts/superadmin-spaces.d.ts +429 -0
- package/dist/contracts/superadmin-spaces.js +82 -0
- package/dist/contracts/superadmin-tenants.d.ts +180 -0
- package/dist/contracts/superadmin-tenants.js +117 -0
- package/dist/contracts/superadmin.d.ts +654 -0
- package/dist/contracts/superadmin.js +309 -0
- package/dist/contracts/tags.d.ts +1140 -0
- package/dist/contracts/tags.js +1050 -0
- package/dist/contracts/teams.d.ts +233 -0
- package/dist/contracts/teams.js +174 -0
- package/dist/contracts/telemetry.d.ts +2 -0
- package/dist/contracts/telemetry.js +1 -0
- package/dist/contracts/transfers.d.ts +105 -0
- package/dist/contracts/transfers.js +48 -0
- package/dist/contracts/variables.d.ts +189 -0
- package/dist/contracts/variables.js +82 -0
- package/dist/contracts/webhooks.d.ts +159 -0
- package/dist/contracts/webhooks.js +59 -0
- package/dist/contracts/zero.d.ts +1538 -0
- package/dist/contracts/zero.js +755 -0
- package/dist/docs/agent-prose.d.ts +35 -0
- package/dist/docs/agent-prose.js +153 -0
- package/dist/docs/agent-setup.d.ts +6 -0
- package/dist/docs/agent-setup.js +164 -0
- package/dist/docs/agent-solutions.d.ts +110 -0
- package/dist/docs/agent-solutions.js +181 -0
- package/dist/docs/error-docs.d.ts +12 -0
- package/dist/docs/error-docs.js +1601 -0
- package/dist/docs/skill-distribution.d.ts +12 -0
- package/dist/docs/skill-distribution.js +18 -0
- package/dist/domain-exploration.d.ts +108 -0
- package/dist/domain-exploration.js +488 -0
- package/dist/domain-normalize.d.ts +1 -0
- package/dist/domain-normalize.js +14 -0
- package/dist/domain-zones.d.ts +1 -0
- package/dist/domain-zones.js +5272 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/access-policy.d.ts +39 -0
- package/dist/utils/access-policy.js +232 -0
- package/dist/utils/api.d.ts +4 -0
- package/dist/utils/api.js +13 -0
- package/dist/utils/auth-redirect.d.ts +1 -0
- package/dist/utils/auth-redirect.js +48 -0
- package/dist/utils/auth.d.ts +5 -0
- package/dist/utils/auth.js +13 -0
- package/dist/utils/build-settings.d.ts +49 -0
- package/dist/utils/build-settings.js +366 -0
- package/dist/utils/claim-token.d.ts +1 -0
- package/dist/utils/claim-token.js +9 -0
- package/dist/utils/collections.d.ts +1 -0
- package/dist/utils/collections.js +5 -0
- package/dist/utils/concurrency.d.ts +1 -0
- package/dist/utils/concurrency.js +18 -0
- package/dist/utils/content-type.d.ts +10 -0
- package/dist/utils/content-type.js +145 -0
- package/dist/utils/error-display.d.ts +7 -0
- package/dist/utils/error-display.js +42 -0
- package/dist/utils/error.d.ts +1 -0
- package/dist/utils/error.js +3 -0
- package/dist/utils/generate-space-name.d.ts +14 -0
- package/dist/utils/generate-space-name.js +95 -0
- package/dist/utils/git-repository.d.ts +5 -0
- package/dist/utils/git-repository.js +99 -0
- package/dist/utils/guards.d.ts +1 -0
- package/dist/utils/guards.js +3 -0
- package/dist/utils/publish-detection.d.ts +10 -0
- package/dist/utils/publish-detection.js +118 -0
- package/dist/utils/publish-policy.d.ts +69 -0
- package/dist/utils/publish-policy.js +429 -0
- package/dist/utils/query-client.d.ts +7 -0
- package/dist/utils/query-client.js +21 -0
- package/dist/utils/query-keys.d.ts +75 -0
- package/dist/utils/query-keys.js +78 -0
- package/dist/utils/runtime-paths.d.ts +7 -0
- package/dist/utils/runtime-paths.js +28 -0
- package/dist/utils/runtime-upload.d.ts +19 -0
- package/dist/utils/runtime-upload.js +27 -0
- package/dist/utils/slug.d.ts +5 -0
- package/dist/utils/slug.js +13 -0
- package/dist/utils/space-config.d.ts +75 -0
- package/dist/utils/space-config.js +415 -0
- package/dist/utils/space-theme.d.ts +16 -0
- package/dist/utils/space-theme.js +89 -0
- package/dist/utils/static-runtime-policy.d.ts +17 -0
- package/dist/utils/static-runtime-policy.js +103 -0
- package/dist/utils/upload-session.d.ts +34 -0
- package/dist/utils/upload-session.js +69 -0
- package/dist/utils/urls.d.ts +2 -0
- package/dist/utils/urls.js +7 -0
- package/dist/utils/version-path.d.ts +6 -0
- package/dist/utils/version-path.js +51 -0
- package/dist/utils/wpcom-auth-redirects.d.ts +14 -0
- package/dist/utils/wpcom-auth-redirects.js +49 -0
- package/dist/utils/zero-realtime-signature.d.ts +12 -0
- package/dist/utils/zero-realtime-signature.js +45 -0
- package/dist/vocabulary.d.ts +230 -0
- package/dist/vocabulary.js +218 -0
- package/package.json +58 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
|
|
3
|
+
export declare const SPACE_CONFIG_ALIAS_FILES: readonly ["spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
|
|
4
|
+
export declare const SPACE_CONFIG_ACCEPTED_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
|
|
5
|
+
export declare const SPACE_CONFIG_RETIRED_FILES: readonly ["stattic.jsonc", "stattic.json"];
|
|
6
|
+
export declare const SPACE_CONFIG_PRIVATE_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json", "stattic.jsonc", "stattic.json"];
|
|
7
|
+
export declare const SPACE_CONFIG_CAPS: {
|
|
8
|
+
/** Max raw `sf.jsonc` size in bytes. */
|
|
9
|
+
readonly fileBytes: number;
|
|
10
|
+
/** Max stored/compiled space `config` overlay size in bytes (JSON-encoded). */
|
|
11
|
+
readonly overlayBytes: number;
|
|
12
|
+
/** Max `templates` entries. */
|
|
13
|
+
readonly templates: 100;
|
|
14
|
+
readonly metaTitleChars: 300;
|
|
15
|
+
readonly metaDescriptionChars: 1000;
|
|
16
|
+
readonly metaImageChars: 2000;
|
|
17
|
+
/** Max bytes per `inject` snippet. */
|
|
18
|
+
readonly injectSnippetBytes: number;
|
|
19
|
+
/** Max snippets per `inject` array. */
|
|
20
|
+
readonly injectSnippets: 16;
|
|
21
|
+
};
|
|
22
|
+
/** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
|
|
23
|
+
export declare const SPACE_CONFIG_SCHEMA_URL: string;
|
|
24
|
+
export declare const spaceBuildSettingsSchema: z.ZodObject<{
|
|
25
|
+
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
installCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
outputDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
frameworkPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
platformPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type SpaceBuildSettings = z.infer<typeof spaceBuildSettingsSchema>;
|
|
37
|
+
export declare const spaceConfigSchema: z.ZodObject<{
|
|
38
|
+
index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
39
|
+
fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
40
|
+
path: z.ZodString;
|
|
41
|
+
status: z.ZodNumber;
|
|
42
|
+
}, z.core.$strip>]>>;
|
|
43
|
+
listing: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
title: z.ZodOptional<z.ZodString>;
|
|
46
|
+
description: z.ZodOptional<z.ZodString>;
|
|
47
|
+
image: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
superpowers: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
disable_all_injection: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
googleAnalytics: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
measurementId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
googleTagManager: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
containerId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
javascriptTags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
id: z.ZodOptional<z.ZodString>;
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
code: z.ZodString;
|
|
65
|
+
}, z.core.$strip>>>;
|
|
66
|
+
tags: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
inheritance: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
inherited: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
tagId: z.ZodString;
|
|
71
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
81
|
+
slug: z.ZodString;
|
|
82
|
+
color: z.ZodString;
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
typography: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
fontSizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
+
slug: z.ZodString;
|
|
89
|
+
size: z.ZodString;
|
|
90
|
+
name: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
spacing: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
spacingScale: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
slug: z.ZodString;
|
|
97
|
+
size: z.ZodString;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
build: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
installCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
outputDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
+
frameworkPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
|
+
platformPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
inject: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
head: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
|
+
bodyStart: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
bodyEnd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
export type SpaceConfig = z.infer<typeof spaceConfigSchema>;
|
|
122
|
+
export declare function spaceSuperpowersEnabled(config: SpaceConfig | null | undefined): boolean;
|
|
123
|
+
export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
124
|
+
index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
125
|
+
fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
126
|
+
path: z.ZodString;
|
|
127
|
+
status: z.ZodNumber;
|
|
128
|
+
}, z.core.$strip>]>>;
|
|
129
|
+
listing: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
title: z.ZodOptional<z.ZodString>;
|
|
132
|
+
description: z.ZodOptional<z.ZodString>;
|
|
133
|
+
image: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
superpowers: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
disable_all_injection: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
googleAnalytics: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
measurementId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
googleTagManager: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
containerId: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
javascriptTags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
147
|
+
id: z.ZodOptional<z.ZodString>;
|
|
148
|
+
name: z.ZodOptional<z.ZodString>;
|
|
149
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
code: z.ZodString;
|
|
151
|
+
}, z.core.$strip>>>;
|
|
152
|
+
tags: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
inheritance: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
inherited: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
156
|
+
tagId: z.ZodString;
|
|
157
|
+
disabled: z.ZodDefault<z.ZodBoolean>;
|
|
158
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
159
|
+
}, z.core.$strip>>>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
167
|
+
slug: z.ZodString;
|
|
168
|
+
color: z.ZodString;
|
|
169
|
+
name: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>>>;
|
|
171
|
+
}, z.core.$strip>>;
|
|
172
|
+
typography: z.ZodOptional<z.ZodObject<{
|
|
173
|
+
fontSizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
174
|
+
slug: z.ZodString;
|
|
175
|
+
size: z.ZodString;
|
|
176
|
+
name: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>>>;
|
|
178
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
spacing: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
spacingScale: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
182
|
+
slug: z.ZodString;
|
|
183
|
+
size: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
build: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
|
+
installCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
outputDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
frameworkPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
platformPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
inject: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
head: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
|
+
bodyStart: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
203
|
+
bodyEnd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
204
|
+
noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
207
|
+
space: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
export type SpaceConfigFile = z.infer<typeof spaceConfigFileSchema>;
|
|
210
|
+
/**
|
|
211
|
+
* The published JSON Schema artifact for `sf.jsonc`, generated from the
|
|
212
|
+
* zod file schema. Served at SPACE_CONFIG_SCHEMA_URL so editors and agents get
|
|
213
|
+
* autocomplete and validation.
|
|
214
|
+
*/
|
|
215
|
+
export declare function spaceConfigJsonSchema(): Record<string, unknown>;
|
|
216
|
+
export declare function stripHiddenSpaceConfigKeys(schema: unknown): unknown;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BRAND } from "../brand.js";
|
|
3
|
+
import { spaceThemeSchema } from "./space-theme.js";
|
|
4
|
+
export const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
|
|
5
|
+
export const SPACE_CONFIG_ALIAS_FILES = [
|
|
6
|
+
"spacefast.jsonc",
|
|
7
|
+
"spacefast.json",
|
|
8
|
+
"sf.json",
|
|
9
|
+
".sf/sf.json",
|
|
10
|
+
".sf/config.jsonc",
|
|
11
|
+
".sf/config.json",
|
|
12
|
+
];
|
|
13
|
+
export const SPACE_CONFIG_ACCEPTED_FILES = [
|
|
14
|
+
SPACE_CONFIG_CANONICAL_FILE,
|
|
15
|
+
...SPACE_CONFIG_ALIAS_FILES,
|
|
16
|
+
];
|
|
17
|
+
export const SPACE_CONFIG_RETIRED_FILES = ["stattic.jsonc", "stattic.json"];
|
|
18
|
+
export const SPACE_CONFIG_PRIVATE_FILES = [
|
|
19
|
+
...SPACE_CONFIG_ACCEPTED_FILES,
|
|
20
|
+
...SPACE_CONFIG_RETIRED_FILES,
|
|
21
|
+
];
|
|
22
|
+
// Config compiler parser-safety caps (internal-docs/platform.md "Config
|
|
23
|
+
// compiler scale targets"): hard from launch, enforced by ONE shared validator
|
|
24
|
+
// at every intake seam — finalize for the `sf.jsonc` file, request
|
|
25
|
+
// validation for the API `config` overlay. Plan policy may LOWER these caps,
|
|
26
|
+
// never raise them.
|
|
27
|
+
export const SPACE_CONFIG_CAPS = {
|
|
28
|
+
/** Max raw `sf.jsonc` size in bytes. */
|
|
29
|
+
fileBytes: 256 * 1024,
|
|
30
|
+
/** Max stored/compiled space `config` overlay size in bytes (JSON-encoded). */
|
|
31
|
+
overlayBytes: 16 * 1024,
|
|
32
|
+
/** Max `templates` entries. */
|
|
33
|
+
templates: 100,
|
|
34
|
+
metaTitleChars: 300,
|
|
35
|
+
metaDescriptionChars: 1000,
|
|
36
|
+
metaImageChars: 2000,
|
|
37
|
+
/** Max bytes per `inject` snippet. */
|
|
38
|
+
injectSnippetBytes: 8 * 1024,
|
|
39
|
+
/** Max snippets per `inject` array. */
|
|
40
|
+
injectSnippets: 16,
|
|
41
|
+
};
|
|
42
|
+
/** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
|
|
43
|
+
export const SPACE_CONFIG_SCHEMA_URL = `${BRAND.websiteOrigin}/schemas/sf.json`;
|
|
44
|
+
export const spaceBuildSettingsSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
rootDirectory: z.string().trim().min(1).nullable().optional(),
|
|
47
|
+
installDirectory: z.string().trim().min(1).nullable().optional(),
|
|
48
|
+
installCommand: z.string().trim().min(1).nullable().optional(),
|
|
49
|
+
buildCommand: z.string().trim().min(1).nullable().optional(),
|
|
50
|
+
outputDirectory: z.string().trim().min(1).nullable().optional(),
|
|
51
|
+
ignoredBuildCommand: z.string().trim().min(1).nullable().optional(),
|
|
52
|
+
frameworkPreset: z.string().trim().min(1).nullable().optional(),
|
|
53
|
+
platformPreset: z.string().trim().min(1).nullable().optional(),
|
|
54
|
+
allowUnsupportedPlatformFeatures: z.boolean().optional(),
|
|
55
|
+
timeoutSeconds: z.number().int().min(60).max(7200).optional(),
|
|
56
|
+
})
|
|
57
|
+
.strict()
|
|
58
|
+
.describe("Remote build settings used by repository builds.");
|
|
59
|
+
// SpaceConfig (internal-docs/platform.md "SpaceConfig"): the declarative
|
|
60
|
+
// serving config — also the shape of `sf.jsonc` minus `$schema`/`space`.
|
|
61
|
+
// Meta caps are the spec parser-safety numbers (title 300, description 1000,
|
|
62
|
+
// image 2000); plan policy may lower them but never raise them.
|
|
63
|
+
export const spaceConfigSchema = z.object({
|
|
64
|
+
index: z
|
|
65
|
+
.union([z.string().min(1), z.literal(false)])
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Directory index file; false disables index resolution."),
|
|
68
|
+
fallback: z
|
|
69
|
+
.union([
|
|
70
|
+
z.string().min(1),
|
|
71
|
+
z.object({
|
|
72
|
+
path: z.string().min(1).describe("Committed file served when no exact route matches."),
|
|
73
|
+
status: z.number().int().min(100).max(599).describe("Response status for the fallback."),
|
|
74
|
+
}),
|
|
75
|
+
])
|
|
76
|
+
.optional()
|
|
77
|
+
.describe('Fallback document; "/index.html" means SPA. Default: nearest 404.html.'),
|
|
78
|
+
listing: z.boolean().optional().describe("Enable automatic directory listings."),
|
|
79
|
+
meta: z
|
|
80
|
+
.object({
|
|
81
|
+
title: z.string().min(1).max(SPACE_CONFIG_CAPS.metaTitleChars).optional(),
|
|
82
|
+
description: z.string().max(SPACE_CONFIG_CAPS.metaDescriptionChars).optional(),
|
|
83
|
+
image: z.string().max(SPACE_CONFIG_CAPS.metaImageChars).optional(),
|
|
84
|
+
})
|
|
85
|
+
.optional()
|
|
86
|
+
.describe("Listing/viewer/OG metadata."),
|
|
87
|
+
superpowers: z
|
|
88
|
+
.object({
|
|
89
|
+
enabled: z.boolean().optional().describe("Master switch for platform-managed injections."),
|
|
90
|
+
disable_all_injection: z
|
|
91
|
+
.boolean()
|
|
92
|
+
.optional()
|
|
93
|
+
.describe("When true, suppresses every platform-managed script/tag injection."),
|
|
94
|
+
googleAnalytics: z
|
|
95
|
+
.object({
|
|
96
|
+
enabled: z.boolean().optional(),
|
|
97
|
+
measurementId: z.string().trim().max(64).optional(),
|
|
98
|
+
})
|
|
99
|
+
.optional(),
|
|
100
|
+
googleTagManager: z
|
|
101
|
+
.object({
|
|
102
|
+
enabled: z.boolean().optional(),
|
|
103
|
+
containerId: z.string().trim().max(64).optional(),
|
|
104
|
+
})
|
|
105
|
+
.optional(),
|
|
106
|
+
javascriptTags: z
|
|
107
|
+
.array(z.object({
|
|
108
|
+
id: z.string().trim().max(128).optional(),
|
|
109
|
+
name: z.string().trim().max(160).optional(),
|
|
110
|
+
enabled: z.boolean().optional(),
|
|
111
|
+
code: z.string().max(SPACE_CONFIG_CAPS.injectSnippetBytes),
|
|
112
|
+
}))
|
|
113
|
+
.max(SPACE_CONFIG_CAPS.injectSnippets)
|
|
114
|
+
.optional(),
|
|
115
|
+
tags: z
|
|
116
|
+
.object({
|
|
117
|
+
inheritance: z
|
|
118
|
+
.object({
|
|
119
|
+
inherited: z.boolean().optional(),
|
|
120
|
+
overrides: z
|
|
121
|
+
.array(z.object({
|
|
122
|
+
tagId: z.string().trim().min(1),
|
|
123
|
+
disabled: z.boolean().default(false),
|
|
124
|
+
reason: z.string().trim().max(500).nullable().optional(),
|
|
125
|
+
}))
|
|
126
|
+
.max(128)
|
|
127
|
+
.optional(),
|
|
128
|
+
})
|
|
129
|
+
.optional(),
|
|
130
|
+
})
|
|
131
|
+
.optional(),
|
|
132
|
+
})
|
|
133
|
+
.optional()
|
|
134
|
+
.describe("Platform-managed built-ins and custom JavaScript snippets."),
|
|
135
|
+
templates: z
|
|
136
|
+
.array(z.string().min(1))
|
|
137
|
+
.max(SPACE_CONFIG_CAPS.templates)
|
|
138
|
+
.optional()
|
|
139
|
+
.describe("Files that receive {{ vars.NAME }} substitution at finalize."),
|
|
140
|
+
theme: spaceThemeSchema
|
|
141
|
+
.optional()
|
|
142
|
+
.describe("Platform-page theming: a validated preset subset of WordPress theme.json."),
|
|
143
|
+
build: spaceBuildSettingsSchema
|
|
144
|
+
.optional()
|
|
145
|
+
.describe("Default settings for remote repository builds."),
|
|
146
|
+
// Intentionally undescribed (hidden, experimental): enables the finalize-time
|
|
147
|
+
// build pipeline (internal-docs/build-pipeline-plan.md). Accepted without
|
|
148
|
+
// diagnostics; absent/false keeps today's behavior byte-for-byte.
|
|
149
|
+
experimental_gutenberg: z.boolean().optional(),
|
|
150
|
+
// Intentionally minimally described (hidden, experimental): static HTML
|
|
151
|
+
// snippets, honored only when `experimental_gutenberg` is true. Byte caps are
|
|
152
|
+
// enforced by the shared validator (inject_snippet_too_large / inject_invalid).
|
|
153
|
+
inject: z
|
|
154
|
+
.object({
|
|
155
|
+
head: z.array(z.string()).max(SPACE_CONFIG_CAPS.injectSnippets).optional(),
|
|
156
|
+
bodyStart: z.array(z.string()).max(SPACE_CONFIG_CAPS.injectSnippets).optional(),
|
|
157
|
+
bodyEnd: z.array(z.string()).max(SPACE_CONFIG_CAPS.injectSnippets).optional(),
|
|
158
|
+
noscript: z.array(z.string()).max(SPACE_CONFIG_CAPS.injectSnippets).optional(),
|
|
159
|
+
})
|
|
160
|
+
.optional(),
|
|
161
|
+
});
|
|
162
|
+
export function spaceSuperpowersEnabled(config) {
|
|
163
|
+
const superpowers = config?.superpowers;
|
|
164
|
+
return superpowers?.enabled !== false && superpowers?.disable_all_injection !== true;
|
|
165
|
+
}
|
|
166
|
+
// The `sf.jsonc` FILE shape (internal-docs/platform.md "Space
|
|
167
|
+
// Configuration Files"): SpaceConfig plus the editor `$schema` pointer and the
|
|
168
|
+
// optional `space` link (slug or `spc_` id) resolved by CLI/publish flows.
|
|
169
|
+
// Routing never lives here — redirects/rewrites/proxies/headers stay
|
|
170
|
+
// exclusively in `_redirects`/`_headers` (one way per concern).
|
|
171
|
+
export const spaceConfigFileSchema = spaceConfigSchema.extend({
|
|
172
|
+
$schema: z
|
|
173
|
+
.string()
|
|
174
|
+
.optional()
|
|
175
|
+
.describe(`JSON Schema pointer for editor/agent validation (${SPACE_CONFIG_SCHEMA_URL}).`),
|
|
176
|
+
space: z
|
|
177
|
+
.string()
|
|
178
|
+
.min(1)
|
|
179
|
+
.optional()
|
|
180
|
+
.describe("Optional space link: a space slug or spc_ id this project publishes to."),
|
|
181
|
+
});
|
|
182
|
+
/**
|
|
183
|
+
* The published JSON Schema artifact for `sf.jsonc`, generated from the
|
|
184
|
+
* zod file schema. Served at SPACE_CONFIG_SCHEMA_URL so editors and agents get
|
|
185
|
+
* autocomplete and validation.
|
|
186
|
+
*/
|
|
187
|
+
export function spaceConfigJsonSchema() {
|
|
188
|
+
return stripHiddenSpaceConfigKeys({
|
|
189
|
+
...z.toJSONSchema(spaceConfigFileSchema, { target: "draft-7", io: "input" }),
|
|
190
|
+
$id: SPACE_CONFIG_SCHEMA_URL,
|
|
191
|
+
title: "Spacefast space configuration (sf.jsonc)",
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/*
|
|
195
|
+
* Hidden-feature discipline (internal-docs/build-pipeline-plan.md): the
|
|
196
|
+
* `experimental_gutenberg` flag and its `inject` companion are ACCEPTED by the
|
|
197
|
+
* parser but never published — the bare key names alone would document the
|
|
198
|
+
* feature to every editor/agent reading a schema artifact. Every generator
|
|
199
|
+
* that derives a public artifact from the SpaceConfig zod shape (the
|
|
200
|
+
* sf.jsonc JSON Schema, the www publish-spec, the SDK OpenAPI documents)
|
|
201
|
+
* must run it through this stripper. The published schemas set no
|
|
202
|
+
* additionalProperties constraint, so configs that use the hidden keys still
|
|
203
|
+
* validate cleanly. `inject` is removed only when it carries the SpaceConfig
|
|
204
|
+
* static-placement shape so unrelated properties of the same name survive.
|
|
205
|
+
*/
|
|
206
|
+
export function stripHiddenSpaceConfigKeys(schema) {
|
|
207
|
+
if (Array.isArray(schema)) {
|
|
208
|
+
return schema.map(stripHiddenSpaceConfigKeys);
|
|
209
|
+
}
|
|
210
|
+
if (!schema || typeof schema !== "object") {
|
|
211
|
+
return schema;
|
|
212
|
+
}
|
|
213
|
+
return Object.fromEntries(Object.entries(schema).map(([key, entry]) => {
|
|
214
|
+
if (key === "properties" && entry && typeof entry === "object" && !Array.isArray(entry)) {
|
|
215
|
+
const kept = Object.fromEntries(Object.entries(entry).filter(([name, value]) => {
|
|
216
|
+
if (name === "experimental_gutenberg") {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
return !(name === "inject" && isHiddenInjectShape(value));
|
|
220
|
+
}));
|
|
221
|
+
return [key, stripHiddenSpaceConfigKeys(kept)];
|
|
222
|
+
}
|
|
223
|
+
return [key, stripHiddenSpaceConfigKeys(entry)];
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
function isHiddenInjectShape(value) {
|
|
227
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
const properties = value.properties;
|
|
231
|
+
if (!properties || typeof properties !== "object" || Array.isArray(properties)) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
const keys = Object.keys(properties);
|
|
235
|
+
return (keys.length > 0 &&
|
|
236
|
+
keys.every((key) => key === "head" || key === "bodyStart" || key === "bodyEnd" || key === "noscript"));
|
|
237
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const spaceThemeSchema: z.ZodObject<{
|
|
3
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5
|
+
slug: z.ZodString;
|
|
6
|
+
color: z.ZodString;
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>>>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
typography: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
fontSizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
+
slug: z.ZodString;
|
|
13
|
+
size: z.ZodString;
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>>;
|
|
16
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
spacing: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
spacingScale: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20
|
+
slug: z.ZodString;
|
|
21
|
+
size: z.ZodString;
|
|
22
|
+
}, z.core.$strip>>>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type SpaceTheme = z.infer<typeof spaceThemeSchema>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// SpaceTheme (internal-docs/platform.md "SpaceTheme"): a validated preset
|
|
3
|
+
// subset of WordPress theme.json. Presets only — no arbitrary CSS. The
|
|
4
|
+
// finalize-time compiler (wave B1) additionally validates every value against
|
|
5
|
+
// the safe-value grammar (no url()/@import/expression()/data: URIs) and drops
|
|
6
|
+
// invalid keys with a warning diagnostic.
|
|
7
|
+
const presetSlug = z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.max(64)
|
|
11
|
+
.regex(/^[a-z0-9-]+$/, { message: "Preset slugs are lowercase alphanumerics and dashes." });
|
|
12
|
+
export const spaceThemeSchema = z.object({
|
|
13
|
+
color: z
|
|
14
|
+
.object({
|
|
15
|
+
palette: z
|
|
16
|
+
.array(z.object({
|
|
17
|
+
slug: presetSlug,
|
|
18
|
+
color: z.string().min(1).max(128),
|
|
19
|
+
name: z.string().min(1).max(128).optional(),
|
|
20
|
+
}))
|
|
21
|
+
.max(64)
|
|
22
|
+
.optional(),
|
|
23
|
+
})
|
|
24
|
+
.optional(),
|
|
25
|
+
typography: z
|
|
26
|
+
.object({
|
|
27
|
+
fontSizes: z
|
|
28
|
+
.array(z.object({
|
|
29
|
+
slug: presetSlug,
|
|
30
|
+
size: z.string().min(1).max(64),
|
|
31
|
+
name: z.string().min(1).max(128).optional(),
|
|
32
|
+
}))
|
|
33
|
+
.max(64)
|
|
34
|
+
.optional(),
|
|
35
|
+
fontFamily: z.string().min(1).max(256).optional(),
|
|
36
|
+
})
|
|
37
|
+
.optional(),
|
|
38
|
+
spacing: z
|
|
39
|
+
.object({
|
|
40
|
+
spacingScale: z
|
|
41
|
+
.array(z.object({
|
|
42
|
+
slug: presetSlug,
|
|
43
|
+
size: z.string().min(1).max(64),
|
|
44
|
+
}))
|
|
45
|
+
.max(64)
|
|
46
|
+
.optional(),
|
|
47
|
+
})
|
|
48
|
+
.optional(),
|
|
49
|
+
});
|