@spacefast/common 0.0.9 → 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
|
@@ -14,12 +14,13 @@ export const FEATURE_KEYS = [
|
|
|
14
14
|
"domains.wpcom_dns",
|
|
15
15
|
"domains.domain_connect",
|
|
16
16
|
"domains.proxy_bindings",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
17
|
+
"collab.preview_loader",
|
|
18
|
+
"collab.comments",
|
|
19
|
+
"collab.anonymous_commenters",
|
|
20
|
+
"collab.cli",
|
|
21
|
+
"collab.notices",
|
|
22
|
+
"collab.published_comments",
|
|
23
|
+
"collab.drawing",
|
|
23
24
|
"sites.dedicated_runtime",
|
|
24
25
|
"shelf",
|
|
25
26
|
"tags",
|
|
@@ -35,7 +36,6 @@ export const FEATURE_KEYS = [
|
|
|
35
36
|
"access.sso_connections",
|
|
36
37
|
"access.byo_issuers",
|
|
37
38
|
"access.views_panel",
|
|
38
|
-
"pages.white_label",
|
|
39
39
|
];
|
|
40
40
|
export const featureKeySchema = z.enum(FEATURE_KEYS).describe("Feature flag key.");
|
|
41
41
|
// Feature override states (env `SPACEFAST_FLAG_*` and the feature_overrides
|
|
@@ -114,15 +114,12 @@ export const teamEntitlementsSchema = z
|
|
|
114
114
|
.describe("Whether `_headers` Basic-Auth rules compile on this plan."),
|
|
115
115
|
externalProxy: z.boolean().describe("Whether external proxy upstreams compile on this plan."),
|
|
116
116
|
dedicatedRuntime: z.boolean().describe("Whether the team can use dedicated runtime sites."),
|
|
117
|
-
|
|
117
|
+
pagesTemplates: z
|
|
118
118
|
.boolean()
|
|
119
|
-
.describe("Whether
|
|
120
|
-
|
|
119
|
+
.describe("Whether _pages/*.html full-page takeovers compile for this team."),
|
|
120
|
+
hideSpacefastBranding: z
|
|
121
121
|
.boolean()
|
|
122
|
-
.describe("Whether
|
|
123
|
-
pagesAdvancedTheming: z
|
|
124
|
-
.boolean()
|
|
125
|
-
.describe("Whether the sf.theme.jsonc escape-hatch theme tier compiles (access-plan §8/§9 paid tier 1); theme.json and pages.theme basics stay free."),
|
|
122
|
+
.describe("Whether theme.hideSpacefastBranding removes the badge from default pages."),
|
|
126
123
|
runtimePhpWorkers: z.number().int().describe("PHP workers per serving site."),
|
|
127
124
|
analyticsHourlyGranularity: z
|
|
128
125
|
.boolean()
|
|
@@ -214,9 +211,8 @@ export const PLAN_DEFINITIONS = {
|
|
|
214
211
|
headersBasicAuth: false,
|
|
215
212
|
externalProxy: false,
|
|
216
213
|
dedicatedRuntime: false,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
pagesAdvancedTheming: false,
|
|
214
|
+
pagesTemplates: false,
|
|
215
|
+
hideSpacefastBranding: false,
|
|
220
216
|
runtimePhpWorkers: 2,
|
|
221
217
|
analyticsHourlyGranularity: false,
|
|
222
218
|
},
|
|
@@ -241,9 +237,8 @@ export const PLAN_DEFINITIONS = {
|
|
|
241
237
|
headersBasicAuth: true,
|
|
242
238
|
externalProxy: true,
|
|
243
239
|
dedicatedRuntime: false,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
pagesAdvancedTheming: true,
|
|
240
|
+
pagesTemplates: true,
|
|
241
|
+
hideSpacefastBranding: true,
|
|
247
242
|
runtimePhpWorkers: 4,
|
|
248
243
|
analyticsHourlyGranularity: true,
|
|
249
244
|
},
|
|
@@ -264,9 +259,8 @@ export const PLAN_DEFINITIONS = {
|
|
|
264
259
|
headersBasicAuth: true,
|
|
265
260
|
externalProxy: true,
|
|
266
261
|
dedicatedRuntime: false,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
pagesAdvancedTheming: true,
|
|
262
|
+
pagesTemplates: true,
|
|
263
|
+
hideSpacefastBranding: true,
|
|
270
264
|
runtimePhpWorkers: 4,
|
|
271
265
|
analyticsHourlyGranularity: true,
|
|
272
266
|
},
|
|
@@ -279,9 +273,8 @@ export const PLAN_DEFINITIONS = {
|
|
|
279
273
|
headersBasicAuth: true,
|
|
280
274
|
externalProxy: true,
|
|
281
275
|
dedicatedRuntime: true,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
pagesAdvancedTheming: true,
|
|
276
|
+
pagesTemplates: true,
|
|
277
|
+
hideSpacefastBranding: true,
|
|
285
278
|
runtimePhpWorkers: 4,
|
|
286
279
|
analyticsHourlyGranularity: true,
|
|
287
280
|
},
|
|
@@ -293,9 +286,8 @@ export const PLAN_DEFINITIONS = {
|
|
|
293
286
|
headersBasicAuth: true,
|
|
294
287
|
externalProxy: true,
|
|
295
288
|
dedicatedRuntime: true,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
pagesAdvancedTheming: true,
|
|
289
|
+
pagesTemplates: true,
|
|
290
|
+
hideSpacefastBranding: true,
|
|
299
291
|
runtimePhpWorkers: 4,
|
|
300
292
|
analyticsHourlyGranularity: true,
|
|
301
293
|
},
|
|
@@ -380,61 +372,70 @@ export const FEATURE_DEFINITIONS = {
|
|
|
380
372
|
internal: true,
|
|
381
373
|
},
|
|
382
374
|
},
|
|
383
|
-
"
|
|
384
|
-
key: "
|
|
385
|
-
name: "
|
|
375
|
+
"collab.preview_loader": {
|
|
376
|
+
key: "collab.preview_loader",
|
|
377
|
+
name: "Collab preview loader",
|
|
386
378
|
description: "Allows immutable version URLs to receive a no-secret preview overlay configuration.",
|
|
387
379
|
defaultEnabled: false,
|
|
388
380
|
enabledInDevelopment: true,
|
|
389
381
|
enabledForA8c: true,
|
|
390
382
|
planDefaults: {},
|
|
391
383
|
},
|
|
392
|
-
"
|
|
393
|
-
key: "
|
|
394
|
-
name: "
|
|
384
|
+
"collab.comments": {
|
|
385
|
+
key: "collab.comments",
|
|
386
|
+
name: "Comments",
|
|
395
387
|
description: "Enables Cast-backed comments on eligible immutable version URLs.",
|
|
396
388
|
defaultEnabled: false,
|
|
397
389
|
enabledInDevelopment: true,
|
|
398
390
|
enabledForA8c: true,
|
|
399
391
|
planDefaults: {},
|
|
400
392
|
},
|
|
401
|
-
"
|
|
402
|
-
key: "
|
|
403
|
-
name: "Anonymous
|
|
404
|
-
description: "Allows anyone
|
|
393
|
+
"collab.anonymous_commenters": {
|
|
394
|
+
key: "collab.anonymous_commenters",
|
|
395
|
+
name: "Anonymous commenters",
|
|
396
|
+
description: "Allows anyone with the link to comment when space policy allows it.",
|
|
405
397
|
defaultEnabled: false,
|
|
406
398
|
enabledForA8c: true,
|
|
407
399
|
planDefaults: {},
|
|
408
400
|
},
|
|
409
|
-
"
|
|
410
|
-
key: "
|
|
411
|
-
name: "
|
|
412
|
-
description: "Enables scriptable
|
|
401
|
+
"collab.cli": {
|
|
402
|
+
key: "collab.cli",
|
|
403
|
+
name: "Comments CLI access",
|
|
404
|
+
description: "Enables scriptable comment read, export, reply, and archive operations.",
|
|
413
405
|
defaultEnabled: false,
|
|
414
406
|
enabledInDevelopment: true,
|
|
415
407
|
enabledForA8c: true,
|
|
416
408
|
planDefaults: {},
|
|
417
409
|
},
|
|
418
|
-
"
|
|
419
|
-
key: "
|
|
410
|
+
"collab.notices": {
|
|
411
|
+
key: "collab.notices",
|
|
420
412
|
name: "Realtime notices",
|
|
421
413
|
description: "Reserved kill-switch for future realtime preview notices.",
|
|
422
414
|
defaultEnabled: false,
|
|
423
415
|
enabledForA8c: true,
|
|
424
416
|
planDefaults: {},
|
|
425
417
|
},
|
|
426
|
-
"
|
|
427
|
-
key: "
|
|
428
|
-
name: "Published host
|
|
429
|
-
description: "Allows the
|
|
418
|
+
"collab.published_comments": {
|
|
419
|
+
key: "collab.published_comments",
|
|
420
|
+
name: "Published host comments",
|
|
421
|
+
description: "Allows the Collab overlay to mount comments on a space's live/published host, not just immutable preview URLs.",
|
|
430
422
|
defaultEnabled: false,
|
|
431
423
|
// ON in local dev so the Spacefast-native published path is exercised end-to-end
|
|
432
|
-
// alongside
|
|
424
|
+
// alongside collab.comments (which already defaults on in dev).
|
|
433
425
|
// Production stays gated behind the per-space toggle.
|
|
434
426
|
enabledInDevelopment: true,
|
|
435
427
|
enabledForA8c: true,
|
|
436
428
|
planDefaults: {},
|
|
437
429
|
},
|
|
430
|
+
"collab.drawing": {
|
|
431
|
+
key: "collab.drawing",
|
|
432
|
+
name: "Collab drawing",
|
|
433
|
+
description: "Enables drawing feedback in the Collab overlay.",
|
|
434
|
+
defaultEnabled: true,
|
|
435
|
+
enabledInDevelopment: true,
|
|
436
|
+
enabledForA8c: true,
|
|
437
|
+
planDefaults: {},
|
|
438
|
+
},
|
|
438
439
|
"sites.dedicated_runtime": {
|
|
439
440
|
key: "sites.dedicated_runtime",
|
|
440
441
|
name: "Dedicated runtime sites",
|
|
@@ -529,15 +530,6 @@ export const FEATURE_DEFINITIONS = {
|
|
|
529
530
|
enabledForA8c: true,
|
|
530
531
|
planDefaults: {},
|
|
531
532
|
},
|
|
532
|
-
"pages.white_label": {
|
|
533
|
-
key: "pages.white_label",
|
|
534
|
-
name: "White-label platform pages",
|
|
535
|
-
description: "Removes Spacefast branding from the challenge/deny page tier between theme tokens and full custom pages (access-plan §5.7, X-16).",
|
|
536
|
-
defaultEnabled: false,
|
|
537
|
-
enabledInDevelopment: true,
|
|
538
|
-
enabledForA8c: true,
|
|
539
|
-
planDefaults: {},
|
|
540
|
-
},
|
|
541
533
|
};
|
|
542
534
|
export const featureStateSourceSchema = z
|
|
543
535
|
.enum(["kill_switch", "env", "override", "default"])
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const launchEntries: readonly import("./feature-lifecycle-core.js").FeatureRegistryEntry<"zero" | "plans.paid.available" | "anonymous.publishing" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "
|
|
2
|
-
export declare const registryHash = "sha256:
|
|
1
|
+
export declare const launchEntries: readonly import("./feature-lifecycle-core.js").FeatureRegistryEntry<"zero" | "plans.paid.available" | "anonymous.publishing" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.preview_loader" | "collab.comments" | "collab.notices" | "collab.published_comments" | "sites.dedicated_runtime" | "tags" | "access.invites" | "access.sso_connections" | "access.byo_issuers" | "domains.catalog" | "build.content_pipeline" | "spaces.slug_rename", "collab.comments" | "sites.dedicated_runtime">[];
|
|
2
|
+
export declare const registryHash = "sha256:a1d9cbc355096bb6a473c87d7cb7624d47bd39ad2dd476d7d8eaa728dd94e93f";
|
|
@@ -208,7 +208,7 @@ export const launchEntries = Object.freeze([
|
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
cohort: "launch",
|
|
211
|
-
key: "
|
|
211
|
+
key: "collab.preview_loader",
|
|
212
212
|
name: "Collab preview loader",
|
|
213
213
|
description: "Controls preview loader/config delivery.",
|
|
214
214
|
stage: "private_beta",
|
|
@@ -234,7 +234,7 @@ export const launchEntries = Object.freeze([
|
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
cohort: "launch",
|
|
237
|
-
key: "
|
|
237
|
+
key: "collab.comments",
|
|
238
238
|
name: "Collab comments",
|
|
239
239
|
description: "Controls comment, reply and collaboration operations.",
|
|
240
240
|
stage: "private_beta",
|
|
@@ -260,7 +260,7 @@ export const launchEntries = Object.freeze([
|
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
cohort: "launch",
|
|
263
|
-
key: "
|
|
263
|
+
key: "collab.notices",
|
|
264
264
|
name: "Collab notices",
|
|
265
265
|
description: "Controls notice token minting, publishing and projection.",
|
|
266
266
|
stage: "internal",
|
|
@@ -282,7 +282,7 @@ export const launchEntries = Object.freeze([
|
|
|
282
282
|
},
|
|
283
283
|
{
|
|
284
284
|
cohort: "launch",
|
|
285
|
-
key: "
|
|
285
|
+
key: "collab.published_comments",
|
|
286
286
|
name: "Published-host Collab comments",
|
|
287
287
|
description: "Controls Collab comment overlay on published hosts.",
|
|
288
288
|
stage: "private_beta",
|
|
@@ -295,7 +295,7 @@ export const launchEntries = Object.freeze([
|
|
|
295
295
|
feedbackUrl: null,
|
|
296
296
|
},
|
|
297
297
|
owner: "team:collaboration",
|
|
298
|
-
requires: ["
|
|
298
|
+
requires: ["collab.comments"],
|
|
299
299
|
lifecycleAdoptedAt: "2026-07-12",
|
|
300
300
|
reviewAfter: "2026-08-11",
|
|
301
301
|
removeAfter: "2026-10-10",
|
|
@@ -515,4 +515,4 @@ export const launchEntries = Object.freeze([
|
|
|
515
515
|
},
|
|
516
516
|
},
|
|
517
517
|
].map((definition) => freezeFeatureRegistryEntry(definition)));
|
|
518
|
-
export const registryHash = "sha256:
|
|
518
|
+
export const registryHash = "sha256:a1d9cbc355096bb6a473c87d7cb7624d47bd39ad2dd476d7d8eaa728dd94e93f";
|
package/dist/contracts/ids.d.ts
CHANGED
package/dist/contracts/ids.js
CHANGED
|
@@ -36,6 +36,13 @@ export declare function normalizeOAuthResourceIdentifier(resource: string): stri
|
|
|
36
36
|
* (loopback dev, docker test hosts) — callers fall back to the api origin.
|
|
37
37
|
*/
|
|
38
38
|
export declare function oauthMcpOriginFromApiOrigin(apiOrigin: string | URL): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The hosted MCP endpoint advertised for a configured api origin: the derived
|
|
41
|
+
* mcp origin in RFC 8707 canonical form, falling back to the api origin itself
|
|
42
|
+
* for loopback/dev stacks without an mcp subdomain. Single source for the
|
|
43
|
+
* dashboard runtime (`hostedMcpEndpoint`) and build-time document generation.
|
|
44
|
+
*/
|
|
45
|
+
export declare function oauthHostedMcpEndpointForApiOrigin(apiOrigin: string | URL): string;
|
|
39
46
|
export declare function oauthAuthorizationServerUrl(origin: string | URL): string;
|
|
40
47
|
export declare function oauthTokenEndpointUrl(origin: string | URL): string;
|
|
41
48
|
export declare function oauthResourceKeyForPathname(pathname: string): OAuthResourceKey | null;
|
|
@@ -77,6 +77,15 @@ export function oauthMcpOriginFromApiOrigin(apiOrigin) {
|
|
|
77
77
|
url.hostname = `mcp.${url.hostname.slice("api.".length)}`;
|
|
78
78
|
return url.origin;
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The hosted MCP endpoint advertised for a configured api origin: the derived
|
|
82
|
+
* mcp origin in RFC 8707 canonical form, falling back to the api origin itself
|
|
83
|
+
* for loopback/dev stacks without an mcp subdomain. Single source for the
|
|
84
|
+
* dashboard runtime (`hostedMcpEndpoint`) and build-time document generation.
|
|
85
|
+
*/
|
|
86
|
+
export function oauthHostedMcpEndpointForApiOrigin(apiOrigin) {
|
|
87
|
+
return oauthMcpResourceUrl(oauthMcpOriginFromApiOrigin(apiOrigin) ?? apiOrigin);
|
|
88
|
+
}
|
|
80
89
|
export function oauthAuthorizationServerUrl(origin) {
|
|
81
90
|
return new URL(OAUTH_AUTHORIZATION_SERVER_PATH, origin).toString();
|
|
82
91
|
}
|
|
@@ -84,8 +93,7 @@ export function oauthTokenEndpointUrl(origin) {
|
|
|
84
93
|
return new URL(`${OAUTH_AUTHORIZATION_SERVER_PATH}/oauth2/token`, origin).toString();
|
|
85
94
|
}
|
|
86
95
|
export function oauthResourceKeyForPathname(pathname) {
|
|
87
|
-
if (pathname === OAUTH_API_RESOURCE_PATH ||
|
|
88
|
-
pathname.startsWith(`${OAUTH_API_RESOURCE_PATH}/`)) {
|
|
96
|
+
if (pathname === OAUTH_API_RESOURCE_PATH || pathname.startsWith(`${OAUTH_API_RESOURCE_PATH}/`)) {
|
|
89
97
|
return "api";
|
|
90
98
|
}
|
|
91
99
|
return null;
|
|
@@ -9,7 +9,6 @@ export declare const userOperationKindSchema: z.ZodEnum<{
|
|
|
9
9
|
domain_ssl_retry: "domain_ssl_retry";
|
|
10
10
|
domain_registration_submit: "domain_registration_submit";
|
|
11
11
|
domain_transfer_submit: "domain_transfer_submit";
|
|
12
|
-
domain_zone_publish: "domain_zone_publish";
|
|
13
12
|
domain_dns_apply: "domain_dns_apply";
|
|
14
13
|
domain_lifecycle: "domain_lifecycle";
|
|
15
14
|
variable_cascade: "variable_cascade";
|
|
@@ -67,7 +66,6 @@ export declare const UserOperationSchema: z.ZodObject<{
|
|
|
67
66
|
domain_ssl_retry: "domain_ssl_retry";
|
|
68
67
|
domain_registration_submit: "domain_registration_submit";
|
|
69
68
|
domain_transfer_submit: "domain_transfer_submit";
|
|
70
|
-
domain_zone_publish: "domain_zone_publish";
|
|
71
69
|
domain_dns_apply: "domain_dns_apply";
|
|
72
70
|
domain_lifecycle: "domain_lifecycle";
|
|
73
71
|
variable_cascade: "variable_cascade";
|
|
@@ -114,6 +112,7 @@ export declare const operationListQuerySchema: z.ZodObject<{
|
|
|
114
112
|
cursor: z.ZodOptional<z.ZodString>;
|
|
115
113
|
resourceType: z.ZodOptional<z.ZodString>;
|
|
116
114
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
115
|
+
spaceId: z.ZodOptional<z.ZodString>;
|
|
117
116
|
}, z.core.$strip>;
|
|
118
117
|
export declare const operationListResponseSchema: z.ZodObject<{
|
|
119
118
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -165,7 +164,6 @@ export declare const operationListResponseSchema: z.ZodObject<{
|
|
|
165
164
|
domain_ssl_retry: "domain_ssl_retry";
|
|
166
165
|
domain_registration_submit: "domain_registration_submit";
|
|
167
166
|
domain_transfer_submit: "domain_transfer_submit";
|
|
168
|
-
domain_zone_publish: "domain_zone_publish";
|
|
169
167
|
domain_dns_apply: "domain_dns_apply";
|
|
170
168
|
domain_lifecycle: "domain_lifecycle";
|
|
171
169
|
variable_cascade: "variable_cascade";
|
|
@@ -9,7 +9,6 @@ export const userOperationKindSchema = z.enum([
|
|
|
9
9
|
"domain_ssl_retry",
|
|
10
10
|
"domain_registration_submit",
|
|
11
11
|
"domain_transfer_submit",
|
|
12
|
-
"domain_zone_publish",
|
|
13
12
|
"domain_dns_apply",
|
|
14
13
|
"domain_lifecycle",
|
|
15
14
|
"variable_cascade",
|
|
@@ -55,6 +54,11 @@ export const operationListQuerySchema = cursorListQuerySchema.extend({
|
|
|
55
54
|
.optional()
|
|
56
55
|
.describe("Filter to operations touching one resource type, e.g. `space`."),
|
|
57
56
|
resourceId: z.string().min(1).optional().describe("Filter to operations touching one resource."),
|
|
57
|
+
spaceId: z
|
|
58
|
+
.string()
|
|
59
|
+
.min(1)
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Filter to operations pertaining to one Space — its own operations plus those of its versions and builds. The Space must be readable by the caller."),
|
|
58
62
|
});
|
|
59
63
|
export const operationListResponseSchema = z.object({
|
|
60
64
|
data: z.array(UserOperationSchema),
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SITE_PAGE_IDS: readonly ["404", "password", "denied", "login", "index", "preview"];
|
|
3
|
+
export declare const sitePageIdSchema: z.ZodEnum<{
|
|
4
|
+
login: "login";
|
|
5
|
+
password: "password";
|
|
6
|
+
denied: "denied";
|
|
7
|
+
index: "index";
|
|
8
|
+
preview: "preview";
|
|
9
|
+
404: "404";
|
|
10
|
+
}>;
|
|
11
|
+
export type SitePageId = z.infer<typeof sitePageIdSchema>;
|
|
12
|
+
export declare const ROUTE_PAGE_IDS: readonly ["404", "password", "denied", "login"];
|
|
13
|
+
export declare const routePageIdSchema: z.ZodEnum<{
|
|
14
|
+
login: "login";
|
|
15
|
+
password: "password";
|
|
16
|
+
denied: "denied";
|
|
17
|
+
404: "404";
|
|
18
|
+
}>;
|
|
19
|
+
export type RoutePageId = z.infer<typeof routePageIdSchema>;
|
|
20
|
+
export declare const CUSTOM_PAGE_IDS: readonly ["404", "password", "denied", "index", "preview"];
|
|
21
|
+
export declare const customPageIdSchema: z.ZodEnum<{
|
|
22
|
+
password: "password";
|
|
23
|
+
denied: "denied";
|
|
24
|
+
index: "index";
|
|
25
|
+
preview: "preview";
|
|
26
|
+
404: "404";
|
|
27
|
+
}>;
|
|
28
|
+
export type CustomPageId = z.infer<typeof customPageIdSchema>;
|
|
29
|
+
export declare const PLATFORM_PAGE_IDS: readonly ["undeployed", "suspended", "legal", "visit-cap", "gone", "runtime-error", "rate-limited", "tier-unavailable", "proxy-error", "method-not-allowed", "content-too-large"];
|
|
30
|
+
export declare const platformPageIdSchema: z.ZodEnum<{
|
|
31
|
+
legal: "legal";
|
|
32
|
+
suspended: "suspended";
|
|
33
|
+
undeployed: "undeployed";
|
|
34
|
+
"visit-cap": "visit-cap";
|
|
35
|
+
gone: "gone";
|
|
36
|
+
"runtime-error": "runtime-error";
|
|
37
|
+
"rate-limited": "rate-limited";
|
|
38
|
+
"tier-unavailable": "tier-unavailable";
|
|
39
|
+
"proxy-error": "proxy-error";
|
|
40
|
+
"method-not-allowed": "method-not-allowed";
|
|
41
|
+
"content-too-large": "content-too-large";
|
|
42
|
+
}>;
|
|
43
|
+
export type PlatformPageId = z.infer<typeof platformPageIdSchema>;
|
|
44
|
+
export declare const PAGE_ELEMENTS: readonly ["sf-content", "sf-password-form", "sf-login", "sf-files", "sf-file", "sf-logo", "sf-name"];
|
|
45
|
+
export type PageElement = (typeof PAGE_ELEMENTS)[number];
|
|
46
|
+
export type PageDefinition = {
|
|
47
|
+
id: SitePageId;
|
|
48
|
+
status: 200 | 401 | 403 | 404;
|
|
49
|
+
cacheControl: "public, max-age=0, must-revalidate" | "private, no-store";
|
|
50
|
+
noindex: boolean;
|
|
51
|
+
customTemplate: boolean;
|
|
52
|
+
};
|
|
53
|
+
export declare const PAGE_CATALOG: Readonly<Record<SitePageId, PageDefinition>>;
|
|
54
|
+
export declare const PAGE_SOURCE_MAX_BYTES: number;
|
|
55
|
+
export declare const PAGES_DIRECTORY = "_pages";
|
|
56
|
+
export declare const PAGE_LAYOUT_FILE = "_layout.html";
|
|
57
|
+
export declare const pageArtifactKeySchema: z.ZodString;
|
|
58
|
+
export declare const runtimePagesSchema: z.ZodObject<{
|
|
59
|
+
routes: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
60
|
+
pages: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
61
|
+
login: "login";
|
|
62
|
+
password: "password";
|
|
63
|
+
denied: "denied";
|
|
64
|
+
404: "404";
|
|
65
|
+
}>, z.ZodString>>;
|
|
66
|
+
index: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
previews: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type RuntimePages = z.infer<typeof runtimePagesSchema>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const SITE_PAGE_IDS = ["404", "password", "denied", "login", "index", "preview"];
|
|
3
|
+
export const sitePageIdSchema = z.enum(SITE_PAGE_IDS);
|
|
4
|
+
export const ROUTE_PAGE_IDS = ["404", "password", "denied", "login"];
|
|
5
|
+
export const routePageIdSchema = z.enum(ROUTE_PAGE_IDS);
|
|
6
|
+
export const CUSTOM_PAGE_IDS = ["404", "password", "denied", "index", "preview"];
|
|
7
|
+
export const customPageIdSchema = z.enum(CUSTOM_PAGE_IDS);
|
|
8
|
+
export const PLATFORM_PAGE_IDS = [
|
|
9
|
+
"undeployed",
|
|
10
|
+
"suspended",
|
|
11
|
+
"legal",
|
|
12
|
+
"visit-cap",
|
|
13
|
+
"gone",
|
|
14
|
+
"runtime-error",
|
|
15
|
+
"rate-limited",
|
|
16
|
+
"tier-unavailable",
|
|
17
|
+
"proxy-error",
|
|
18
|
+
"method-not-allowed",
|
|
19
|
+
"content-too-large",
|
|
20
|
+
];
|
|
21
|
+
export const platformPageIdSchema = z.enum(PLATFORM_PAGE_IDS);
|
|
22
|
+
export const PAGE_ELEMENTS = [
|
|
23
|
+
"sf-content",
|
|
24
|
+
"sf-password-form",
|
|
25
|
+
"sf-login",
|
|
26
|
+
"sf-files",
|
|
27
|
+
"sf-file",
|
|
28
|
+
"sf-logo",
|
|
29
|
+
"sf-name",
|
|
30
|
+
];
|
|
31
|
+
export const PAGE_CATALOG = {
|
|
32
|
+
"404": {
|
|
33
|
+
id: "404",
|
|
34
|
+
status: 404,
|
|
35
|
+
cacheControl: "public, max-age=0, must-revalidate",
|
|
36
|
+
noindex: false,
|
|
37
|
+
customTemplate: true,
|
|
38
|
+
},
|
|
39
|
+
password: {
|
|
40
|
+
id: "password",
|
|
41
|
+
status: 401,
|
|
42
|
+
cacheControl: "private, no-store",
|
|
43
|
+
noindex: true,
|
|
44
|
+
customTemplate: true,
|
|
45
|
+
},
|
|
46
|
+
denied: {
|
|
47
|
+
id: "denied",
|
|
48
|
+
status: 403,
|
|
49
|
+
cacheControl: "private, no-store",
|
|
50
|
+
noindex: true,
|
|
51
|
+
customTemplate: true,
|
|
52
|
+
},
|
|
53
|
+
login: {
|
|
54
|
+
id: "login",
|
|
55
|
+
status: 401,
|
|
56
|
+
cacheControl: "private, no-store",
|
|
57
|
+
noindex: true,
|
|
58
|
+
customTemplate: false,
|
|
59
|
+
},
|
|
60
|
+
index: {
|
|
61
|
+
id: "index",
|
|
62
|
+
status: 200,
|
|
63
|
+
cacheControl: "public, max-age=0, must-revalidate",
|
|
64
|
+
noindex: false,
|
|
65
|
+
customTemplate: true,
|
|
66
|
+
},
|
|
67
|
+
preview: {
|
|
68
|
+
id: "preview",
|
|
69
|
+
status: 200,
|
|
70
|
+
cacheControl: "public, max-age=0, must-revalidate",
|
|
71
|
+
noindex: false,
|
|
72
|
+
customTemplate: true,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
export const PAGE_SOURCE_MAX_BYTES = 2 * 1024 * 1024;
|
|
76
|
+
export const PAGES_DIRECTORY = "_pages";
|
|
77
|
+
export const PAGE_LAYOUT_FILE = "_layout.html";
|
|
78
|
+
export const pageArtifactKeySchema = z
|
|
79
|
+
.string()
|
|
80
|
+
.min(1)
|
|
81
|
+
.max(240)
|
|
82
|
+
.regex(/^[a-z0-9-]+$/);
|
|
83
|
+
export const runtimePagesSchema = z.object({
|
|
84
|
+
routes: z.record(z.string().startsWith("/").max(2048), z.object({
|
|
85
|
+
pages: z.record(routePageIdSchema, pageArtifactKeySchema).optional(),
|
|
86
|
+
index: pageArtifactKeySchema.optional(),
|
|
87
|
+
})),
|
|
88
|
+
previews: z.record(z.string().startsWith("/").max(2048), pageArtifactKeySchema),
|
|
89
|
+
});
|
|
@@ -72,6 +72,11 @@ export declare const publishSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
72
72
|
updated: "updated";
|
|
73
73
|
}>;
|
|
74
74
|
capturedBaseVersionId: z.ZodOptional<z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>>;
|
|
75
|
+
claim: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
token: z.ZodString;
|
|
77
|
+
url: z.ZodString;
|
|
78
|
+
expiresAt: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>;
|
|
75
80
|
result: z.ZodObject<{
|
|
76
81
|
space: z.ZodObject<{
|
|
77
82
|
id: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
|
|
@@ -24,7 +24,8 @@ const cancellableActionSchema = z.object({
|
|
|
24
24
|
publishId: publishIdSchema,
|
|
25
25
|
});
|
|
26
26
|
export const publishSchema = z.discriminatedUnion("state", [
|
|
27
|
-
z
|
|
27
|
+
z
|
|
28
|
+
.object({
|
|
28
29
|
id: publishIdSchema,
|
|
29
30
|
state: z.literal("awaiting_upload"),
|
|
30
31
|
target: z
|
|
@@ -40,22 +41,31 @@ export const publishSchema = z.discriminatedUnion("state", [
|
|
|
40
41
|
})
|
|
41
42
|
.optional(),
|
|
42
43
|
expiresAt: z.string().datetime().optional(),
|
|
43
|
-
upload: z
|
|
44
|
-
|
|
44
|
+
upload: z
|
|
45
|
+
.object({
|
|
46
|
+
missing: z
|
|
47
|
+
.array(z.object({
|
|
45
48
|
path: z.string(),
|
|
46
|
-
sha256: z
|
|
49
|
+
sha256: z
|
|
50
|
+
.string()
|
|
51
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
52
|
+
.nullable(),
|
|
47
53
|
size: z.number().int().nonnegative(),
|
|
48
54
|
url: z.string().url(),
|
|
49
55
|
headers: z.record(z.string(), z.string()),
|
|
50
56
|
expiresAt: z.string().datetime(),
|
|
51
|
-
}))
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
}))
|
|
58
|
+
.min(1),
|
|
59
|
+
})
|
|
60
|
+
.optional(),
|
|
61
|
+
})
|
|
62
|
+
.refine((publish) => publish.counts === undefined ||
|
|
54
63
|
publish.upload === undefined ||
|
|
55
64
|
publish.counts.missing === publish.upload.missing.length, {
|
|
56
65
|
message: "Upload instructions must match the missing upload count.",
|
|
57
66
|
path: ["upload", "missing"],
|
|
58
|
-
})
|
|
67
|
+
})
|
|
68
|
+
.refine((publish) => publish.counts !== undefined || publish.upload !== undefined, {
|
|
59
69
|
message: "An awaiting_upload publish must carry counts or upload instructions.",
|
|
60
70
|
path: ["counts"],
|
|
61
71
|
}),
|
|
@@ -87,6 +97,13 @@ export const publishSchema = z.discriminatedUnion("state", [
|
|
|
87
97
|
state: z.literal("succeeded"),
|
|
88
98
|
outcome: z.enum(["created", "updated", "unchanged"]),
|
|
89
99
|
capturedBaseVersionId: versionIdSchema.nullable().optional(),
|
|
100
|
+
claim: z
|
|
101
|
+
.object({
|
|
102
|
+
token: z.string().min(1),
|
|
103
|
+
url: z.string().url(),
|
|
104
|
+
expiresAt: z.string().datetime(),
|
|
105
|
+
})
|
|
106
|
+
.optional(),
|
|
90
107
|
result: z.object({
|
|
91
108
|
space: z.object({ id: spaceIdSchema, liveUrl: z.string().url() }),
|
|
92
109
|
version: z.object({ id: versionIdSchema, immutableUrl: z.string().url() }),
|