@spacefast/common 0.0.8 → 0.0.10
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/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +11 -6
- package/dist/contracts/annotations.d.ts +2 -0
- package/dist/contracts/annotations.js +2 -1
- package/dist/contracts/api-keys.d.ts +4 -0
- package/dist/contracts/api-keys.js +4 -0
- package/dist/contracts/archives.d.ts +2 -8
- package/dist/contracts/archives.js +3 -8
- package/dist/contracts/builds.d.ts +1 -0
- package/dist/contracts/builds.js +5 -0
- package/dist/contracts/comments.d.ts +309 -0
- package/dist/contracts/comments.js +200 -0
- package/dist/contracts/device-auth.d.ts +221 -1
- package/dist/contracts/device-auth.js +106 -4
- package/dist/contracts/device-team-scope.d.ts +10 -0
- package/dist/contracts/device-team-scope.js +17 -0
- package/dist/contracts/error-code-meta.d.ts +52 -0
- package/dist/contracts/error-code-meta.js +13 -0
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +13 -0
- package/dist/contracts/features.d.ts +37 -38
- package/dist/contracts/features.js +51 -59
- package/dist/contracts/generated-feature-launch-entries.d.ts +2 -2
- package/dist/contracts/generated-feature-launch-entries.js +6 -6
- package/dist/contracts/ids.d.ts +1 -1
- package/dist/contracts/ids.js +1 -1
- package/dist/contracts/oauth-resources.d.ts +7 -0
- package/dist/contracts/oauth-resources.js +10 -2
- package/dist/contracts/operations.d.ts +1 -3
- package/dist/contracts/operations.js +5 -1
- package/dist/contracts/pages.d.ts +70 -0
- package/dist/contracts/pages.js +89 -0
- package/dist/contracts/publishes.d.ts +5 -0
- package/dist/contracts/publishes.js +25 -8
- package/dist/contracts/resources.d.ts +14 -62
- package/dist/contracts/runtime-api.d.ts +13 -15
- package/dist/contracts/runtime-api.js +12 -70
- package/dist/contracts/space-config.d.ts +32 -90
- package/dist/contracts/space-config.js +49 -54
- package/dist/contracts/spaces.d.ts +47 -187
- package/dist/contracts/spaces.js +19 -3
- package/dist/contracts/superadmin-spaces.d.ts +14 -62
- package/dist/contracts/superadmin-teams.d.ts +79 -0
- package/dist/contracts/superadmin-teams.js +36 -0
- package/dist/contracts/superadmin.d.ts +2 -0
- package/dist/contracts/superadmin.js +1 -0
- package/dist/contracts/teams.d.ts +1 -0
- package/dist/contracts/teams.js +8 -0
- package/dist/contracts/theme-json.js +4 -5
- package/dist/dashboard-paths/index.d.ts +31 -0
- package/dist/dashboard-paths/index.js +80 -0
- package/dist/docs/agent-handoff-document.d.ts +15 -0
- package/dist/docs/agent-handoff-document.js +179 -0
- package/dist/docs/agent-setup.d.ts +12 -1
- package/dist/docs/agent-setup.js +30 -16
- package/dist/docs/catalog.d.ts +2 -2
- package/dist/docs/catalog.js +2 -2
- package/dist/docs/error-docs.js +52 -0
- package/dist/utils/asset-fingerprint.d.ts +53 -0
- package/dist/utils/asset-fingerprint.js +574 -0
- package/dist/utils/credential-policy.d.ts +5 -0
- package/dist/utils/credential-policy.js +31 -8
- package/dist/utils/pages.d.ts +53 -0
- package/dist/utils/pages.js +274 -0
- package/dist/utils/query-keys.d.ts +4 -3
- package/dist/utils/query-keys.js +4 -3
- package/dist/utils/space-config.d.ts +2 -2
- package/dist/utils/space-config.js +1 -1
- package/dist/utils/wpcom-auth-redirects.d.ts +0 -4
- package/dist/utils/wpcom-auth-redirects.js +0 -6
- package/dist/vocabulary.d.ts +2 -2
- package/package.json +6 -1
- package/dist/contracts/space-theme.d.ts +0 -25
- package/dist/contracts/space-theme.js +0 -49
- package/dist/utils/gate-theme.d.ts +0 -61
- package/dist/utils/gate-theme.js +0 -217
- package/dist/utils/space-theme.d.ts +0 -18
- package/dist/utils/space-theme.js +0 -98
|
@@ -162,37 +162,13 @@ export declare const SpaceSchema: z.ZodObject<{
|
|
|
162
162
|
}, z.core.$strip>>;
|
|
163
163
|
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
164
|
theme: z.ZodOptional<z.ZodObject<{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
pages: z.ZodOptional<z.ZodObject<{
|
|
188
|
-
theme: z.ZodOptional<z.ZodObject<{
|
|
189
|
-
accent: z.ZodOptional<z.ZodString>;
|
|
190
|
-
background: z.ZodOptional<z.ZodString>;
|
|
191
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
192
|
-
name: z.ZodOptional<z.ZodString>;
|
|
193
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
194
|
-
}, z.core.$strip>>;
|
|
195
|
-
}, z.core.$strip>>;
|
|
165
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
166
|
+
background: z.ZodOptional<z.ZodString>;
|
|
167
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
168
|
+
name: z.ZodOptional<z.ZodString>;
|
|
169
|
+
font: z.ZodOptional<z.ZodString>;
|
|
170
|
+
hideSpacefastBranding: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strict>>;
|
|
196
172
|
build: z.ZodOptional<z.ZodObject<{
|
|
197
173
|
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
174
|
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -477,37 +453,13 @@ export declare const VersionSchema: z.ZodObject<{
|
|
|
477
453
|
}, z.core.$strip>>;
|
|
478
454
|
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
479
455
|
theme: z.ZodOptional<z.ZodObject<{
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
typography: z.ZodOptional<z.ZodObject<{
|
|
488
|
-
fontSizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
489
|
-
slug: z.ZodString;
|
|
490
|
-
size: z.ZodString;
|
|
491
|
-
name: z.ZodOptional<z.ZodString>;
|
|
492
|
-
}, z.core.$strip>>>;
|
|
493
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
494
|
-
}, z.core.$strip>>;
|
|
495
|
-
spacing: z.ZodOptional<z.ZodObject<{
|
|
496
|
-
spacingScale: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
497
|
-
slug: z.ZodString;
|
|
498
|
-
size: z.ZodString;
|
|
499
|
-
}, z.core.$strip>>>;
|
|
500
|
-
}, z.core.$strip>>;
|
|
501
|
-
}, z.core.$strip>>;
|
|
502
|
-
pages: z.ZodOptional<z.ZodObject<{
|
|
503
|
-
theme: z.ZodOptional<z.ZodObject<{
|
|
504
|
-
accent: z.ZodOptional<z.ZodString>;
|
|
505
|
-
background: z.ZodOptional<z.ZodString>;
|
|
506
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
507
|
-
name: z.ZodOptional<z.ZodString>;
|
|
508
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
509
|
-
}, z.core.$strip>>;
|
|
510
|
-
}, z.core.$strip>>;
|
|
456
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
457
|
+
background: z.ZodOptional<z.ZodString>;
|
|
458
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
459
|
+
name: z.ZodOptional<z.ZodString>;
|
|
460
|
+
font: z.ZodOptional<z.ZodString>;
|
|
461
|
+
hideSpacefastBranding: z.ZodOptional<z.ZodBoolean>;
|
|
462
|
+
}, z.core.$strict>>;
|
|
511
463
|
build: z.ZodOptional<z.ZodObject<{
|
|
512
464
|
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
513
465
|
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const RUNTIME_CHANGED_PATHS_MAX =
|
|
2
|
+
export declare const RUNTIME_CHANGED_PATHS_MAX = 900;
|
|
3
3
|
export declare const runtimeVersionCreateRequestSchema: z.ZodObject<{
|
|
4
4
|
version_id: z.ZodOptional<z.ZodString>;
|
|
5
5
|
files: z.ZodArray<z.ZodObject<{
|
|
@@ -75,11 +75,7 @@ export declare const runtimeVersionFinalizeRequestSchema: z.ZodObject<{
|
|
|
75
75
|
}, z.core.$strict>>;
|
|
76
76
|
template_files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
77
77
|
template_variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
78
|
-
|
|
79
|
-
challenge: z.ZodOptional<z.ZodString>;
|
|
80
|
-
deny: z.ZodOptional<z.ZodString>;
|
|
81
|
-
}, z.core.$strip>>;
|
|
82
|
-
layout_template: z.ZodOptional<z.ZodString>;
|
|
78
|
+
page_artifacts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
83
79
|
serving: z.ZodOptional<z.ZodObject<{
|
|
84
80
|
headers_exact: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
85
81
|
headers_pattern: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -100,15 +96,16 @@ export declare const runtimeVersionFinalizeRequestSchema: z.ZodObject<{
|
|
|
100
96
|
image: z.ZodOptional<z.ZodString>;
|
|
101
97
|
}, z.core.$strip>>>;
|
|
102
98
|
pages: z.ZodOptional<z.ZodObject<{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
routes: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
100
|
+
pages: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
101
|
+
login: "login";
|
|
102
|
+
password: "password";
|
|
103
|
+
denied: "denied";
|
|
104
|
+
404: "404";
|
|
105
|
+
}>, z.ZodString>>;
|
|
106
|
+
index: z.ZodOptional<z.ZodString>;
|
|
109
107
|
}, z.core.$strip>>;
|
|
110
|
-
|
|
111
|
-
white_label: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
previews: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
112
109
|
}, z.core.$strip>>;
|
|
113
110
|
experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
|
|
114
111
|
platform_meta: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -124,7 +121,6 @@ export declare const runtimeVersionFinalizeRequestSchema: z.ZodObject<{
|
|
|
124
121
|
noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
122
|
}, z.core.$strip>>;
|
|
126
123
|
}, z.core.$strip>>;
|
|
127
|
-
theme_css: z.ZodOptional<z.ZodString>;
|
|
128
124
|
zero_endpoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
129
125
|
method: z.ZodEnum<{
|
|
130
126
|
PUT: "PUT";
|
|
@@ -581,6 +577,7 @@ export declare const runtimeCallbackEventSchema: z.ZodObject<{
|
|
|
581
577
|
route_name: z.ZodOptional<z.ZodString>;
|
|
582
578
|
hostnames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
583
579
|
changed_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
580
|
+
changed_paths_known: z.ZodOptional<z.ZodBoolean>;
|
|
584
581
|
previous_version_id: z.ZodOptional<z.ZodString>;
|
|
585
582
|
}, z.core.$loose>;
|
|
586
583
|
export declare const runtimeEventsDrainResponseSchema: z.ZodObject<{
|
|
@@ -599,6 +596,7 @@ export declare const runtimeEventsDrainResponseSchema: z.ZodObject<{
|
|
|
599
596
|
route_name: z.ZodOptional<z.ZodString>;
|
|
600
597
|
hostnames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
601
598
|
changed_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
599
|
+
changed_paths_known: z.ZodOptional<z.ZodBoolean>;
|
|
602
600
|
previous_version_id: z.ZodOptional<z.ZodString>;
|
|
603
601
|
}, z.core.$loose>;
|
|
604
602
|
}, z.core.$strip>>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { accessEventSchema, policyDocSchema } from "./access.js";
|
|
3
3
|
import { conventionFilesSchema, manifestFileSchema } from "./internal.js";
|
|
4
|
+
import { runtimePagesSchema } from "./pages.js";
|
|
4
5
|
const runtimeConventionFilesSchema = conventionFilesSchema.omit({ routes: true }).strict();
|
|
5
6
|
const hostCanonicalRedirectSchema = z.object({
|
|
6
7
|
from: z.string().min(1),
|
|
@@ -35,7 +36,7 @@ const runtimeRouteIntentSchema = z.object({
|
|
|
35
36
|
// changed paths, never a blanket purge when a diff exists. Past this cap (or
|
|
36
37
|
// when no previous pointer target exists) the control plane omits the set and
|
|
37
38
|
// purge handling falls back to one host-wide purge.
|
|
38
|
-
export const RUNTIME_CHANGED_PATHS_MAX =
|
|
39
|
+
export const RUNTIME_CHANGED_PATHS_MAX = 900;
|
|
39
40
|
const changedPathsSchema = z
|
|
40
41
|
.array(z
|
|
41
42
|
.string()
|
|
@@ -208,32 +209,7 @@ const runtimeServingConfigSchema = z.object({
|
|
|
208
209
|
.nullable()
|
|
209
210
|
.optional()
|
|
210
211
|
.describe("Finalize-resolved listing/viewer/OG metadata (effective SpaceConfig meta); wins over session metadata."),
|
|
211
|
-
|
|
212
|
-
// tokens (tier 1) plus the plan-gated white-label flag (tier 2). The runtime
|
|
213
|
-
// reads this shape defensively from the version's serving_config and defaults
|
|
214
|
-
// per-field; platform-LANE pages (tombstones, plan expiry, claim, invariant
|
|
215
|
-
// errors) never consume it (X-17).
|
|
216
|
-
pages: z
|
|
217
|
-
.object({
|
|
218
|
-
theme: z
|
|
219
|
-
.object({
|
|
220
|
-
accent: z.string().max(64).optional(),
|
|
221
|
-
background: z.string().max(64).optional(),
|
|
222
|
-
logo: z.string().max(2000).optional(),
|
|
223
|
-
name: z.string().max(120).optional(),
|
|
224
|
-
// Free tier ("basic color scheme + fonts"): a validated font-family
|
|
225
|
-
// stack, same grammar as pages.theme.accent/background.
|
|
226
|
-
fontFamily: z.string().max(256).optional(),
|
|
227
|
-
})
|
|
228
|
-
.optional(),
|
|
229
|
-
// Additive theme.json palette/font-family CSS custom properties
|
|
230
|
-
// (access-plan §8 tier 3 middle rung): exposes the full WP-compatible
|
|
231
|
-
// palette to custom 401.html/403.html/layout.html authors beyond the
|
|
232
|
-
// flat accent/background tokens above.
|
|
233
|
-
theme_vars: z.string().max(8192).optional(),
|
|
234
|
-
white_label: z.boolean().optional(),
|
|
235
|
-
})
|
|
236
|
-
.optional(),
|
|
212
|
+
pages: runtimePagesSchema.optional(),
|
|
237
213
|
// Hidden experimental build-pipeline flag: absent on every version finalized
|
|
238
214
|
// without it (byte-identical payload to today). Only ever sent as true.
|
|
239
215
|
experimental_gutenberg: z.boolean().optional(),
|
|
@@ -350,46 +326,13 @@ export const runtimeVersionFinalizeRequestSchema = z.object({
|
|
|
350
326
|
})
|
|
351
327
|
.optional()
|
|
352
328
|
.describe("Channel-variant template contents, keyed by runtime route name."),
|
|
353
|
-
//
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
// `access-pages/{challenge,deny}.html` (sibling of serving.php — never a
|
|
359
|
-
// publicly served path) and unlinks stale ones on re-finalize; serving is a
|
|
360
|
-
// single str_replace of the marker with the runtime-owned functional
|
|
361
|
-
// fragment. A version finalized without a key here has no override — the
|
|
362
|
-
// default platform page renders.
|
|
363
|
-
access_pages: z
|
|
364
|
-
.object({
|
|
365
|
-
challenge: z
|
|
366
|
-
.string()
|
|
367
|
-
.max(2 * 1024 * 1024)
|
|
368
|
-
.optional()
|
|
369
|
-
.describe("Baked 401.html carrying <!--spacefast:slot:challenge:v1-->."),
|
|
370
|
-
deny: z
|
|
371
|
-
.string()
|
|
372
|
-
.max(2 * 1024 * 1024)
|
|
373
|
-
.optional()
|
|
374
|
-
.describe("Baked 403.html carrying <!--spacefast:slot:deny:v1-->."),
|
|
329
|
+
// Finalize-rendered Pages documents stored outside the public file tree.
|
|
330
|
+
page_artifacts: z
|
|
331
|
+
.record(z.string().min(1).max(240), z.string().max(2 * 1024 * 1024))
|
|
332
|
+
.refine((documents) => Object.keys(documents).length <= 100_000, {
|
|
333
|
+
message: "page_artifacts supports up to 100,000 rendered documents.",
|
|
375
334
|
})
|
|
376
335
|
.optional(),
|
|
377
|
-
// Custom gate-page chrome (access-plan §8 tier 2): the finalize compiler
|
|
378
|
-
// validates `.spacefast/templates/layout.html`'s `<div data-sf="content">`
|
|
379
|
-
// slot, replaces its contents with the opaque v1 marker comment, and ships
|
|
380
|
-
// the baked document here. The engine stores it as
|
|
381
|
-
// `access-pages/layout.html` (sibling of the challenge/deny overrides,
|
|
382
|
-
// never a publicly served path) and unlinks it when a re-finalize omits it.
|
|
383
|
-
// Serving wraps the runtime-owned gate-page content (brand row + heading +
|
|
384
|
-
// functional fragment) in the layout's content slot with one str_replace;
|
|
385
|
-
// a missing/invalid layout falls back to the platform default chrome. Only
|
|
386
|
-
// consulted when no full custom 401.html/403.html override wins for that
|
|
387
|
-
// page (tier 1 > tier 2).
|
|
388
|
-
layout_template: z
|
|
389
|
-
.string()
|
|
390
|
-
.max(2 * 1024 * 1024)
|
|
391
|
-
.optional()
|
|
392
|
-
.describe("Baked .spacefast/templates/layout.html carrying <!--spacefast:slot:layout-content:v1-->."),
|
|
393
336
|
serving: z
|
|
394
337
|
.object({
|
|
395
338
|
headers_exact: z.record(z.string(), z.array(z.record(z.string(), z.unknown()))).default({}),
|
|
@@ -397,11 +340,6 @@ export const runtimeVersionFinalizeRequestSchema = z.object({
|
|
|
397
340
|
redirects_exact: z.record(z.string(), z.array(z.record(z.string(), z.unknown()))).default({}),
|
|
398
341
|
redirects_pattern: z.array(z.record(z.string(), z.unknown())).default([]),
|
|
399
342
|
config: runtimeServingConfigSchema.optional(),
|
|
400
|
-
// Compiled SpaceTheme custom-property declarations consumed by themeable pages
|
|
401
|
-
// (directory listings, single-file viewers, platform pages). The finalize
|
|
402
|
-
// compiler validates the token grammar; the runtime re-rejects anything that
|
|
403
|
-
// could escape a <style> element or reach the network.
|
|
404
|
-
theme_css: z.string().max(16384).optional(),
|
|
405
343
|
// Trusted Zero endpoint source compiled by the runtime into private
|
|
406
344
|
// endpoint-specific JS, QuickJS bytecode, and PHP manifest invoke actions.
|
|
407
345
|
zero_endpoints: z.array(runtimeZeroEndpointSchema).max(128).optional(),
|
|
@@ -695,6 +633,10 @@ export const runtimeCallbackEventSchema = z.looseObject({
|
|
|
695
633
|
.optional()
|
|
696
634
|
.describe("Hostnames whose serving output this event changed; purge targets."),
|
|
697
635
|
changed_paths: changedPathsSchema,
|
|
636
|
+
changed_paths_known: z
|
|
637
|
+
.boolean()
|
|
638
|
+
.optional()
|
|
639
|
+
.describe("True when changed_paths is the complete diff, including a known-empty diff. Absent on older engines, where an empty array remains the host-wide fallback."),
|
|
698
640
|
previous_version_id: previousVersionIdSchema,
|
|
699
641
|
});
|
|
700
642
|
export const runtimeEventsDrainResponseSchema = z.object({
|
|
@@ -19,42 +19,25 @@ export declare const SPACE_CONFIG_CAPS: {
|
|
|
19
19
|
readonly injectSnippets: 16;
|
|
20
20
|
/** Max `access.rules` entries in the file lane. */
|
|
21
21
|
readonly accessRules: 100;
|
|
22
|
-
/** Max `
|
|
23
|
-
readonly
|
|
24
|
-
/** Max `
|
|
25
|
-
readonly
|
|
26
|
-
/** Max `
|
|
27
|
-
readonly
|
|
22
|
+
/** Max `theme` color token length. */
|
|
23
|
+
readonly themeColorChars: 64;
|
|
24
|
+
/** Max `theme.logo` URL/path length. */
|
|
25
|
+
readonly themeLogoChars: 2000;
|
|
26
|
+
/** Max `theme.name` display-name length. */
|
|
27
|
+
readonly themeNameChars: 120;
|
|
28
28
|
};
|
|
29
29
|
/** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
|
|
30
30
|
export declare const SPACE_CONFIG_SCHEMA_URL: string;
|
|
31
|
-
export declare const
|
|
31
|
+
export declare const spacePageThemeSchema: z.ZodObject<{
|
|
32
32
|
accent: z.ZodOptional<z.ZodString>;
|
|
33
33
|
background: z.ZodOptional<z.ZodString>;
|
|
34
34
|
logo: z.ZodOptional<z.ZodString>;
|
|
35
35
|
name: z.ZodOptional<z.ZodString>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export
|
|
40
|
-
export declare const sfThemeJsoncSchema: z.ZodObject<{
|
|
41
|
-
accent: z.ZodOptional<z.ZodString>;
|
|
42
|
-
background: z.ZodOptional<z.ZodString>;
|
|
43
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
44
|
-
name: z.ZodOptional<z.ZodString>;
|
|
45
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
46
|
-
}, z.core.$strip>;
|
|
36
|
+
font: z.ZodOptional<z.ZodString>;
|
|
37
|
+
hideSpacefastBranding: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type SpacePageTheme = z.infer<typeof spacePageThemeSchema>;
|
|
47
40
|
export declare const THEME_JSON_FILE = "theme.json";
|
|
48
|
-
export declare const LAYOUT_TEMPLATE_FILE = ".spacefast/templates/layout.html";
|
|
49
|
-
export declare const spacePagesConfigSchema: z.ZodObject<{
|
|
50
|
-
theme: z.ZodOptional<z.ZodObject<{
|
|
51
|
-
accent: z.ZodOptional<z.ZodString>;
|
|
52
|
-
background: z.ZodOptional<z.ZodString>;
|
|
53
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
54
|
-
name: z.ZodOptional<z.ZodString>;
|
|
55
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
56
|
-
}, z.core.$strip>>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
41
|
export declare const spaceBuildSettingsSchema: z.ZodObject<{
|
|
59
42
|
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
43
|
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -125,37 +108,13 @@ export declare const spaceConfigSchema: z.ZodObject<{
|
|
|
125
108
|
}, z.core.$strip>>;
|
|
126
109
|
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
110
|
theme: z.ZodOptional<z.ZodObject<{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
typography: z.ZodOptional<z.ZodObject<{
|
|
136
|
-
fontSizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
137
|
-
slug: z.ZodString;
|
|
138
|
-
size: z.ZodString;
|
|
139
|
-
name: z.ZodOptional<z.ZodString>;
|
|
140
|
-
}, z.core.$strip>>>;
|
|
141
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
142
|
-
}, z.core.$strip>>;
|
|
143
|
-
spacing: z.ZodOptional<z.ZodObject<{
|
|
144
|
-
spacingScale: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
-
slug: z.ZodString;
|
|
146
|
-
size: z.ZodString;
|
|
147
|
-
}, z.core.$strip>>>;
|
|
148
|
-
}, z.core.$strip>>;
|
|
149
|
-
}, z.core.$strip>>;
|
|
150
|
-
pages: z.ZodOptional<z.ZodObject<{
|
|
151
|
-
theme: z.ZodOptional<z.ZodObject<{
|
|
152
|
-
accent: z.ZodOptional<z.ZodString>;
|
|
153
|
-
background: z.ZodOptional<z.ZodString>;
|
|
154
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
155
|
-
name: z.ZodOptional<z.ZodString>;
|
|
156
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
157
|
-
}, z.core.$strip>>;
|
|
158
|
-
}, z.core.$strip>>;
|
|
111
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
112
|
+
background: z.ZodOptional<z.ZodString>;
|
|
113
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
114
|
+
name: z.ZodOptional<z.ZodString>;
|
|
115
|
+
font: z.ZodOptional<z.ZodString>;
|
|
116
|
+
hideSpacefastBranding: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
}, z.core.$strict>>;
|
|
159
118
|
build: z.ZodOptional<z.ZodObject<{
|
|
160
119
|
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
120
|
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -243,6 +202,10 @@ export declare const spaceAccessConfigSchema: z.ZodObject<{
|
|
|
243
202
|
message: z.ZodOptional<z.ZodString>;
|
|
244
203
|
}, z.core.$strip>>>;
|
|
245
204
|
}, z.core.$strip>;
|
|
205
|
+
export declare const spacePublishOptionsSchema: z.ZodObject<{
|
|
206
|
+
fingerprint: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
export type SpacePublishOptions = z.infer<typeof spacePublishOptionsSchema>;
|
|
246
209
|
export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
247
210
|
index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
248
211
|
fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -287,37 +250,13 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
|
287
250
|
}, z.core.$strip>>;
|
|
288
251
|
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
289
252
|
theme: z.ZodOptional<z.ZodObject<{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
typography: z.ZodOptional<z.ZodObject<{
|
|
298
|
-
fontSizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
299
|
-
slug: z.ZodString;
|
|
300
|
-
size: z.ZodString;
|
|
301
|
-
name: z.ZodOptional<z.ZodString>;
|
|
302
|
-
}, z.core.$strip>>>;
|
|
303
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
304
|
-
}, z.core.$strip>>;
|
|
305
|
-
spacing: z.ZodOptional<z.ZodObject<{
|
|
306
|
-
spacingScale: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
307
|
-
slug: z.ZodString;
|
|
308
|
-
size: z.ZodString;
|
|
309
|
-
}, z.core.$strip>>>;
|
|
310
|
-
}, z.core.$strip>>;
|
|
311
|
-
}, z.core.$strip>>;
|
|
312
|
-
pages: z.ZodOptional<z.ZodObject<{
|
|
313
|
-
theme: z.ZodOptional<z.ZodObject<{
|
|
314
|
-
accent: z.ZodOptional<z.ZodString>;
|
|
315
|
-
background: z.ZodOptional<z.ZodString>;
|
|
316
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
317
|
-
name: z.ZodOptional<z.ZodString>;
|
|
318
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
319
|
-
}, z.core.$strip>>;
|
|
320
|
-
}, z.core.$strip>>;
|
|
253
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
254
|
+
background: z.ZodOptional<z.ZodString>;
|
|
255
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
256
|
+
name: z.ZodOptional<z.ZodString>;
|
|
257
|
+
font: z.ZodOptional<z.ZodString>;
|
|
258
|
+
hideSpacefastBranding: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
+
}, z.core.$strict>>;
|
|
321
260
|
build: z.ZodOptional<z.ZodObject<{
|
|
322
261
|
rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
262
|
installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -404,6 +343,9 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
|
404
343
|
message: z.ZodOptional<z.ZodString>;
|
|
405
344
|
}, z.core.$strip>>>;
|
|
406
345
|
}, z.core.$strip>>;
|
|
346
|
+
publish: z.ZodOptional<z.ZodObject<{
|
|
347
|
+
fingerprint: z.ZodOptional<z.ZodBoolean>;
|
|
348
|
+
}, z.core.$strip>>;
|
|
407
349
|
}, z.core.$strip>;
|
|
408
350
|
export type SpaceConfigFile = z.infer<typeof spaceConfigFileSchema>;
|
|
409
351
|
/**
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
import { BRAND } from "../brand.js";
|
|
3
3
|
import { runtimeRuleSchema } from "./access.js";
|
|
4
4
|
import { normalizedSiteClass } from "./enums.js";
|
|
5
|
-
import { spaceThemeSchema } from "./space-theme.js";
|
|
6
5
|
export const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
|
|
7
6
|
export const SPACE_CONFIG_ALIAS_FILES = [
|
|
8
7
|
"spacefast.jsonc",
|
|
@@ -38,19 +37,18 @@ export const SPACE_CONFIG_CAPS = {
|
|
|
38
37
|
injectSnippets: 16,
|
|
39
38
|
/** Max `access.rules` entries in the file lane. */
|
|
40
39
|
accessRules: 100,
|
|
41
|
-
/** Max `
|
|
42
|
-
|
|
43
|
-
/** Max `
|
|
44
|
-
|
|
45
|
-
/** Max `
|
|
46
|
-
|
|
40
|
+
/** Max `theme` color token length. */
|
|
41
|
+
themeColorChars: 64,
|
|
42
|
+
/** Max `theme.logo` URL/path length. */
|
|
43
|
+
themeLogoChars: 2000,
|
|
44
|
+
/** Max `theme.name` display-name length. */
|
|
45
|
+
themeNameChars: 120,
|
|
47
46
|
};
|
|
48
47
|
/** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
|
|
49
48
|
export const SPACE_CONFIG_SCHEMA_URL = `${BRAND.websiteOrigin}/schemas/sf.json`;
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
// (
|
|
53
|
-
// Color grammar mirrors the SpaceTheme compiler allowlist (hex/rgb(a)/hsl(a)/
|
|
49
|
+
// Pages theme tokens: visual values consumed by publish-rendered site pages.
|
|
50
|
+
// Presentation only — never layout, behavior, or protocol.
|
|
51
|
+
// Color grammar accepts hex/rgb(a)/hsl(a)/
|
|
54
52
|
// named), categorically rejecting anything that could escape a style context.
|
|
55
53
|
const PAGES_COLOR_PATTERN = new RegExp([
|
|
56
54
|
"^(?:",
|
|
@@ -62,23 +60,24 @@ const PAGES_COLOR_PATTERN = new RegExp([
|
|
|
62
60
|
].join(""));
|
|
63
61
|
// Logo: an https URL or a root-relative path into the space's own files.
|
|
64
62
|
const PAGES_LOGO_PATTERN = /^(?:https:\/\/[^\s"'<>\\]+|\/[^\s"'<>\\]*)$/;
|
|
65
|
-
const
|
|
63
|
+
const pageThemeColorSchema = z
|
|
66
64
|
.string()
|
|
67
65
|
.trim()
|
|
68
|
-
.max(SPACE_CONFIG_CAPS.
|
|
66
|
+
.max(SPACE_CONFIG_CAPS.themeColorChars)
|
|
69
67
|
.regex(PAGES_COLOR_PATTERN, "must be a hex, rgb(a), hsl(a), or named CSS color");
|
|
70
|
-
// Font family stack for
|
|
71
|
-
// SpaceTheme compiler's FONT_FAMILY_PATTERN allowlist (letters/digits/space/
|
|
68
|
+
// Font family stack for Pages (letters/digits/space/
|
|
72
69
|
// comma/hyphen/straight quotes only, no url()/src).
|
|
73
70
|
const PAGES_FONT_FAMILY_PATTERN = /^[A-Za-z0-9 ,'"-]{1,256}$/;
|
|
74
|
-
export const
|
|
71
|
+
export const spacePageThemeSchema = z
|
|
75
72
|
.object({
|
|
76
|
-
accent:
|
|
77
|
-
background:
|
|
73
|
+
accent: pageThemeColorSchema.optional().describe("Accent color for Spacefast-authored pages."),
|
|
74
|
+
background: pageThemeColorSchema
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Background color for Spacefast-authored pages."),
|
|
78
77
|
logo: z
|
|
79
78
|
.string()
|
|
80
79
|
.trim()
|
|
81
|
-
.max(SPACE_CONFIG_CAPS.
|
|
80
|
+
.max(SPACE_CONFIG_CAPS.themeLogoChars)
|
|
82
81
|
.regex(PAGES_LOGO_PATTERN, "must be an https:// URL or a root-relative path")
|
|
83
82
|
.optional()
|
|
84
83
|
.describe("Logo image (https URL or root-relative path) shown in the brand row."),
|
|
@@ -86,46 +85,30 @@ export const spacePagesThemeSchema = z
|
|
|
86
85
|
.string()
|
|
87
86
|
.trim()
|
|
88
87
|
.min(1)
|
|
89
|
-
.max(SPACE_CONFIG_CAPS.
|
|
88
|
+
.max(SPACE_CONFIG_CAPS.themeNameChars)
|
|
90
89
|
.optional()
|
|
91
|
-
.describe("Display name shown in the brand row of
|
|
92
|
-
|
|
93
|
-
// font-family stack applied to gate pages, same grammar as the SpaceTheme
|
|
94
|
-
// compiler's typography.fontFamily.
|
|
95
|
-
fontFamily: z
|
|
90
|
+
.describe("Display name shown in the brand row of Pages defaults."),
|
|
91
|
+
font: z
|
|
96
92
|
.string()
|
|
97
93
|
.trim()
|
|
98
94
|
.max(256)
|
|
99
95
|
.regex(PAGES_FONT_FAMILY_PATTERN, "must be a plain font-family stack (no url()/src)")
|
|
100
96
|
.optional()
|
|
101
|
-
.describe("Font-family stack applied to
|
|
97
|
+
.describe("Font-family stack applied to Spacefast-authored pages."),
|
|
98
|
+
hideSpacefastBranding: z
|
|
99
|
+
.boolean()
|
|
100
|
+
.optional()
|
|
101
|
+
.describe("Remove the Spacefast badge from default pages when the plan permits it."),
|
|
102
102
|
})
|
|
103
|
-
.
|
|
104
|
-
|
|
105
|
-
// `theme.json`
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
// tier ("advanced theming", access-plan §9) — gated at compile by the
|
|
109
|
-
// resolved plan entitlement, never at parse time.
|
|
110
|
-
export const SF_THEME_JSONC_FILE = "sf.theme.jsonc";
|
|
111
|
-
export const sfThemeJsoncSchema = spacePagesThemeSchema.describe("sf.theme.jsonc: the highest-precedence gate-page theme override file.");
|
|
112
|
-
// The WordPress-compatible `theme.json` file (access-plan §8 tier 3, middle
|
|
113
|
-
// precedence): free tier ("theme.json basics"). Only `settings.color.palette`
|
|
114
|
-
// and `settings.typography.fontFamilies` feed gate-page tokens; every other
|
|
103
|
+
.strict()
|
|
104
|
+
.describe("Theme tokens for Spacefast-authored pages.");
|
|
105
|
+
// WordPress-compatible `theme.json` is an inference input, not configuration.
|
|
106
|
+
// Only `settings.color.palette` and `settings.typography.fontFamilies` infer
|
|
107
|
+
// Pages tokens; every other
|
|
115
108
|
// WP theme.json key is accepted-and-ignored (this is not a full WP_Theme_JSON
|
|
116
109
|
// reimplementation, just the safe subset that reaches presentation-only gate
|
|
117
|
-
// pages
|
|
110
|
+
// pages.
|
|
118
111
|
export const THEME_JSON_FILE = "theme.json";
|
|
119
|
-
// Custom chrome/shell for gate pages (access-plan §8 tier 2): the functional
|
|
120
|
-
// challenge/deny fragment slots into `<div data-sf="content">` here so gate
|
|
121
|
-
// pages inherit site look. Paid tier, same entitlement as full custom
|
|
122
|
-
// 401.html/403.html.
|
|
123
|
-
export const LAYOUT_TEMPLATE_FILE = ".spacefast/templates/layout.html";
|
|
124
|
-
export const spacePagesConfigSchema = z
|
|
125
|
-
.object({
|
|
126
|
-
theme: spacePagesThemeSchema.optional(),
|
|
127
|
-
})
|
|
128
|
-
.describe("Platform-page presentation: theme tokens applied to gate pages.");
|
|
129
112
|
export const spaceBuildSettingsSchema = z
|
|
130
113
|
.object({
|
|
131
114
|
rootDirectory: z.string().trim().min(1).nullable().optional(),
|
|
@@ -242,12 +225,9 @@ export const spaceConfigSchema = z.object({
|
|
|
242
225
|
.max(SPACE_CONFIG_CAPS.templates)
|
|
243
226
|
.optional()
|
|
244
227
|
.describe("Files that receive {{ vars.NAME }} substitution at finalize."),
|
|
245
|
-
theme:
|
|
228
|
+
theme: spacePageThemeSchema
|
|
246
229
|
.optional()
|
|
247
|
-
.describe("
|
|
248
|
-
pages: spacePagesConfigSchema
|
|
249
|
-
.optional()
|
|
250
|
-
.describe("Platform gate-page presentation: theme tokens (access-plan §5.7 tier 1)."),
|
|
230
|
+
.describe("Visual tokens for every Spacefast-authored page."),
|
|
251
231
|
build: spaceBuildSettingsSchema
|
|
252
232
|
.optional()
|
|
253
233
|
.describe("Default settings for remote repository builds."),
|
|
@@ -297,6 +277,20 @@ export const spaceAccessConfigSchema = z
|
|
|
297
277
|
// optional `space` link (slug or `spc_` id) resolved by CLI/publish flows.
|
|
298
278
|
// Routing never lives here — redirects/rewrites/proxies/headers stay
|
|
299
279
|
// exclusively in `_redirects`/`_headers` (one way per concern).
|
|
280
|
+
// Client-side publish options (caching plan §6): consumed by the CLI/agent
|
|
281
|
+
// publish tooling before upload, never by the runtime — like `$schema` and
|
|
282
|
+
// `space`, this key lives only in the FILE shape and never reaches the space
|
|
283
|
+
// `config` overlay.
|
|
284
|
+
export const spacePublishOptionsSchema = z
|
|
285
|
+
.object({
|
|
286
|
+
fingerprint: z
|
|
287
|
+
.boolean()
|
|
288
|
+
.optional()
|
|
289
|
+
.describe("Publish-time asset fingerprinting: adds content-hashed immutable aliases " +
|
|
290
|
+
"(name.<sha256-8>.ext) for stable assets and rewrites exact HTML/CSS references. " +
|
|
291
|
+
"Originals keep serving unchanged. Default off."),
|
|
292
|
+
})
|
|
293
|
+
.describe("Client publish-time options consumed by the Spacefast CLI, not the runtime.");
|
|
300
294
|
export const spaceConfigFileSchema = spaceConfigSchema.extend({
|
|
301
295
|
$schema: z
|
|
302
296
|
.string()
|
|
@@ -308,6 +302,7 @@ export const spaceConfigFileSchema = spaceConfigSchema.extend({
|
|
|
308
302
|
.optional()
|
|
309
303
|
.describe("Optional space link: a space slug or spc_ id this project publishes to."),
|
|
310
304
|
access: spaceAccessConfigSchema.optional(),
|
|
305
|
+
publish: spacePublishOptionsSchema.optional(),
|
|
311
306
|
});
|
|
312
307
|
/**
|
|
313
308
|
* The published JSON Schema artifact for `sf.jsonc`, generated from the
|