@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.
Files changed (78) hide show
  1. package/dist/contracts/activity.d.ts +1 -1
  2. package/dist/contracts/activity.js +11 -6
  3. package/dist/contracts/annotations.d.ts +2 -0
  4. package/dist/contracts/annotations.js +2 -1
  5. package/dist/contracts/api-keys.d.ts +4 -0
  6. package/dist/contracts/api-keys.js +4 -0
  7. package/dist/contracts/archives.d.ts +2 -8
  8. package/dist/contracts/archives.js +3 -8
  9. package/dist/contracts/builds.d.ts +1 -0
  10. package/dist/contracts/builds.js +5 -0
  11. package/dist/contracts/comments.d.ts +309 -0
  12. package/dist/contracts/comments.js +200 -0
  13. package/dist/contracts/device-auth.d.ts +221 -1
  14. package/dist/contracts/device-auth.js +106 -4
  15. package/dist/contracts/device-team-scope.d.ts +10 -0
  16. package/dist/contracts/device-team-scope.js +17 -0
  17. package/dist/contracts/error-code-meta.d.ts +52 -0
  18. package/dist/contracts/error-code-meta.js +13 -0
  19. package/dist/contracts/error-codes.d.ts +1 -1
  20. package/dist/contracts/error-codes.js +13 -0
  21. package/dist/contracts/features.d.ts +37 -38
  22. package/dist/contracts/features.js +51 -59
  23. package/dist/contracts/generated-feature-launch-entries.d.ts +2 -2
  24. package/dist/contracts/generated-feature-launch-entries.js +6 -6
  25. package/dist/contracts/ids.d.ts +1 -1
  26. package/dist/contracts/ids.js +1 -1
  27. package/dist/contracts/oauth-resources.d.ts +7 -0
  28. package/dist/contracts/oauth-resources.js +10 -2
  29. package/dist/contracts/operations.d.ts +1 -3
  30. package/dist/contracts/operations.js +5 -1
  31. package/dist/contracts/pages.d.ts +70 -0
  32. package/dist/contracts/pages.js +89 -0
  33. package/dist/contracts/publishes.d.ts +5 -0
  34. package/dist/contracts/publishes.js +25 -8
  35. package/dist/contracts/resources.d.ts +14 -62
  36. package/dist/contracts/runtime-api.d.ts +13 -15
  37. package/dist/contracts/runtime-api.js +12 -70
  38. package/dist/contracts/space-config.d.ts +32 -90
  39. package/dist/contracts/space-config.js +49 -54
  40. package/dist/contracts/spaces.d.ts +47 -187
  41. package/dist/contracts/spaces.js +19 -3
  42. package/dist/contracts/superadmin-spaces.d.ts +14 -62
  43. package/dist/contracts/superadmin-teams.d.ts +79 -0
  44. package/dist/contracts/superadmin-teams.js +36 -0
  45. package/dist/contracts/superadmin.d.ts +2 -0
  46. package/dist/contracts/superadmin.js +1 -0
  47. package/dist/contracts/teams.d.ts +1 -0
  48. package/dist/contracts/teams.js +8 -0
  49. package/dist/contracts/theme-json.js +4 -5
  50. package/dist/dashboard-paths/index.d.ts +31 -0
  51. package/dist/dashboard-paths/index.js +80 -0
  52. package/dist/docs/agent-handoff-document.d.ts +15 -0
  53. package/dist/docs/agent-handoff-document.js +179 -0
  54. package/dist/docs/agent-setup.d.ts +12 -1
  55. package/dist/docs/agent-setup.js +30 -16
  56. package/dist/docs/catalog.d.ts +2 -2
  57. package/dist/docs/catalog.js +2 -2
  58. package/dist/docs/error-docs.js +52 -0
  59. package/dist/utils/asset-fingerprint.d.ts +53 -0
  60. package/dist/utils/asset-fingerprint.js +574 -0
  61. package/dist/utils/credential-policy.d.ts +5 -0
  62. package/dist/utils/credential-policy.js +31 -8
  63. package/dist/utils/pages.d.ts +53 -0
  64. package/dist/utils/pages.js +274 -0
  65. package/dist/utils/query-keys.d.ts +4 -3
  66. package/dist/utils/query-keys.js +4 -3
  67. package/dist/utils/space-config.d.ts +2 -2
  68. package/dist/utils/space-config.js +1 -1
  69. package/dist/utils/wpcom-auth-redirects.d.ts +0 -4
  70. package/dist/utils/wpcom-auth-redirects.js +0 -6
  71. package/dist/vocabulary.d.ts +2 -2
  72. package/package.json +6 -1
  73. package/dist/contracts/space-theme.d.ts +0 -25
  74. package/dist/contracts/space-theme.js +0 -49
  75. package/dist/utils/gate-theme.d.ts +0 -61
  76. package/dist/utils/gate-theme.js +0 -217
  77. package/dist/utils/space-theme.d.ts +0 -18
  78. 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
- "annotations.preview_loader",
18
- "annotations.comments",
19
- "annotations.anonymous_reviewers",
20
- "annotations.cli",
21
- "annotations.notices",
22
- "annotations.published_comments",
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
- pagesWhiteLabel: z
117
+ pagesTemplates: z
118
118
  .boolean()
119
- .describe("Whether the pages.white_label tier compiles (Spacefast branding removed from gate pages)."),
120
- pagesCustomHtml: z
119
+ .describe("Whether _pages/*.html full-page takeovers compile for this team."),
120
+ hideSpacefastBranding: z
121
121
  .boolean()
122
- .describe("Whether custom gate-page HTML compiles (401.html/403.html slot overrides and .spacefast/templates/layout.html chrome, access-plan §8/§9 paid tier 1)."),
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
- pagesWhiteLabel: false,
218
- pagesCustomHtml: false,
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
- pagesWhiteLabel: false,
245
- pagesCustomHtml: true,
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
- pagesWhiteLabel: true,
268
- pagesCustomHtml: true,
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
- pagesWhiteLabel: true,
283
- pagesCustomHtml: true,
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
- pagesWhiteLabel: true,
297
- pagesCustomHtml: true,
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
- "annotations.preview_loader": {
384
- key: "annotations.preview_loader",
385
- name: "Annotations preview loader",
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
- "annotations.comments": {
393
- key: "annotations.comments",
394
- name: "Annotation comments",
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
- "annotations.anonymous_reviewers": {
402
- key: "annotations.anonymous_reviewers",
403
- name: "Anonymous annotation reviewers",
404
- description: "Allows anyone-with-link annotation identities when space policy allows it.",
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
- "annotations.cli": {
410
- key: "annotations.cli",
411
- name: "Annotation CLI access",
412
- description: "Enables scriptable annotation read/export/reply/resolve operations.",
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
- "annotations.notices": {
419
- key: "annotations.notices",
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
- "annotations.published_comments": {
427
- key: "annotations.published_comments",
428
- name: "Published host annotation comments",
429
- description: "Allows the annotation overlay to mount comments on a space's live/published host, not just immutable preview URLs.",
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 annotations.comments (which already defaults on in dev).
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" | "annotations.preview_loader" | "annotations.comments" | "annotations.notices" | "annotations.published_comments" | "sites.dedicated_runtime" | "tags" | "access.invites" | "access.sso_connections" | "access.byo_issuers" | "domains.catalog" | "build.content_pipeline" | "spaces.slug_rename", "annotations.comments" | "sites.dedicated_runtime">[];
2
- export declare const registryHash = "sha256:bb171bdc1b4815eae685a2c97c5ab5042faf5b1fa0a99ad9ac4406d14210381d";
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: "annotations.preview_loader",
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: "annotations.comments",
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: "annotations.notices",
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: "annotations.published_comments",
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: ["annotations.comments"],
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:bb171bdc1b4815eae685a2c97c5ab5042faf5b1fa0a99ad9ac4406d14210381d";
518
+ export const registryHash = "sha256:a1d9cbc355096bb6a473c87d7cb7624d47bd39ad2dd476d7d8eaa728dd94e93f";
@@ -4,7 +4,7 @@ export declare const ID_PREFIXES: {
4
4
  readonly site: "Site";
5
5
  readonly spc: "Space";
6
6
  readonly ver: "Version";
7
- readonly ann: "AnnotationThread";
7
+ readonly cmt: "CommentThread";
8
8
  readonly bld: "Build";
9
9
  readonly dom: "Domain";
10
10
  readonly dbn: "DomainBinding";
@@ -11,7 +11,7 @@ export const ID_PREFIXES = {
11
11
  site: "Site",
12
12
  spc: "Space",
13
13
  ver: "Version",
14
- ann: "AnnotationThread",
14
+ cmt: "CommentThread",
15
15
  bld: "Build",
16
16
  dom: "Domain",
17
17
  dbn: "DomainBinding",
@@ -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.object({
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.object({
44
- missing: z.array(z.object({
44
+ upload: z
45
+ .object({
46
+ missing: z
47
+ .array(z.object({
45
48
  path: z.string(),
46
- sha256: z.string().regex(/^[0-9a-f]{64}$/).nullable(),
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
- })).min(1),
52
- }).optional(),
53
- }).refine((publish) => publish.counts === undefined ||
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
- }).refine((publish) => publish.counts !== undefined || publish.upload !== undefined, {
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() }),