@spacefast/common 0.0.11 → 0.0.13

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 (160) hide show
  1. package/dist/agents/connect-targets.d.ts +4 -4
  2. package/dist/agents/connect-targets.js +3 -3
  3. package/dist/agents/private-key-oauth.d.ts +37 -0
  4. package/dist/agents/private-key-oauth.js +158 -0
  5. package/dist/config/domains.js +1 -1
  6. package/dist/config/index.d.ts +1 -0
  7. package/dist/config/index.js +1 -0
  8. package/dist/config/postgres-budget.d.ts +126 -0
  9. package/dist/config/postgres-budget.js +135 -0
  10. package/dist/config/postgres-budget.json +50 -0
  11. package/dist/contracts/access.d.ts +386 -1183
  12. package/dist/contracts/access.js +240 -1018
  13. package/dist/contracts/activity.d.ts +1 -1
  14. package/dist/contracts/activity.js +11 -19
  15. package/dist/contracts/api-keys.d.ts +69 -45
  16. package/dist/contracts/api-keys.js +3 -0
  17. package/dist/contracts/archives.d.ts +9 -10
  18. package/dist/contracts/archives.js +4 -6
  19. package/dist/contracts/builds.d.ts +8 -8
  20. package/dist/contracts/builds.js +28 -48
  21. package/dist/contracts/channels.js +1 -2
  22. package/dist/contracts/comments.d.ts +102 -93
  23. package/dist/contracts/comments.js +121 -63
  24. package/dist/contracts/common.d.ts +4 -3
  25. package/dist/contracts/common.js +2 -0
  26. package/dist/contracts/countries.js +2 -7
  27. package/dist/contracts/data-source-routes.d.ts +20 -0
  28. package/dist/contracts/data-source-routes.js +15 -0
  29. package/dist/contracts/deployments.d.ts +3 -3
  30. package/dist/contracts/device-auth.d.ts +21 -15
  31. package/dist/contracts/docs.d.ts +5 -5
  32. package/dist/contracts/domains.d.ts +261 -1330
  33. package/dist/contracts/domains.js +39 -301
  34. package/dist/contracts/email-preferences.d.ts +50 -0
  35. package/dist/contracts/email-preferences.js +44 -0
  36. package/dist/contracts/enums.d.ts +3 -5
  37. package/dist/contracts/enums.js +3 -8
  38. package/dist/contracts/error-code-meta.d.ts +99 -33
  39. package/dist/contracts/error-code-meta.js +36 -9
  40. package/dist/contracts/error-codes.d.ts +1 -1
  41. package/dist/contracts/error-codes.js +28 -11
  42. package/dist/contracts/execution.d.ts +212 -0
  43. package/dist/contracts/execution.js +288 -0
  44. package/dist/contracts/feature-lifecycle.d.ts +498 -2
  45. package/dist/contracts/feature-lifecycle.js +539 -2
  46. package/dist/contracts/features.d.ts +184 -74
  47. package/dist/contracts/features.js +4 -303
  48. package/dist/contracts/functions.d.ts +729 -0
  49. package/dist/contracts/functions.js +485 -0
  50. package/dist/contracts/git.d.ts +1 -1
  51. package/dist/contracts/grants.d.ts +1158 -0
  52. package/dist/contracts/grants.js +696 -0
  53. package/dist/contracts/ids.d.ts +6 -5
  54. package/dist/contracts/ids.js +6 -5
  55. package/dist/contracts/internal.d.ts +3 -3
  56. package/dist/contracts/mcp.d.ts +12 -12
  57. package/dist/contracts/me.js +1 -1
  58. package/dist/contracts/mounts.d.ts +142 -0
  59. package/dist/contracts/mounts.js +56 -0
  60. package/dist/contracts/oauth-resources.d.ts +5 -5
  61. package/dist/contracts/oauth-resources.js +2 -0
  62. package/dist/contracts/operations.d.ts +4 -4
  63. package/dist/contracts/pages.d.ts +6 -14
  64. package/dist/contracts/pages.js +11 -23
  65. package/dist/contracts/plan-policy.d.ts +2 -9
  66. package/dist/contracts/plan-policy.js +1 -4
  67. package/dist/contracts/platform.d.ts +80 -32
  68. package/dist/contracts/platform.js +59 -12
  69. package/dist/contracts/push-new.d.ts +26 -2
  70. package/dist/contracts/push-new.js +8 -0
  71. package/dist/contracts/quotas.d.ts +0 -1
  72. package/dist/contracts/quotas.js +0 -5
  73. package/dist/contracts/repository-connections.d.ts +1 -1
  74. package/dist/contracts/resources.d.ts +21 -85
  75. package/dist/contracts/resources.js +17 -47
  76. package/dist/contracts/runtime-api.d.ts +799 -192
  77. package/dist/contracts/runtime-api.js +231 -100
  78. package/dist/contracts/runtime-app.d.ts +138 -0
  79. package/dist/contracts/runtime-app.js +21 -0
  80. package/dist/contracts/sf-config-v1.d.ts +5 -0
  81. package/dist/contracts/sf-config-v1.js +1 -1
  82. package/dist/contracts/sites.d.ts +17 -12
  83. package/dist/contracts/sites.js +30 -12
  84. package/dist/contracts/space-config.d.ts +46 -117
  85. package/dist/contracts/space-config.js +323 -25
  86. package/dist/contracts/spaces.d.ts +392 -256
  87. package/dist/contracts/spaces.js +163 -83
  88. package/dist/contracts/superadmin-emails.d.ts +27 -3
  89. package/dist/contracts/superadmin-emails.js +10 -15
  90. package/dist/contracts/superadmin-runtime.d.ts +2 -2
  91. package/dist/contracts/superadmin-spaces.d.ts +19 -142
  92. package/dist/contracts/superadmin-spaces.js +7 -0
  93. package/dist/contracts/tags.d.ts +66 -36
  94. package/dist/contracts/tags.js +195 -11
  95. package/dist/contracts/teams.d.ts +9 -9
  96. package/dist/contracts/transfers.d.ts +1 -2
  97. package/dist/contracts/variables.d.ts +4 -4
  98. package/dist/contracts/variables.js +4 -3
  99. package/dist/contracts/webhooks.d.ts +2 -2
  100. package/dist/contracts/zero.d.ts +437 -193
  101. package/dist/contracts/zero.js +149 -158
  102. package/dist/dashboard-paths/index.d.ts +3 -3
  103. package/dist/dashboard-paths/index.js +1 -0
  104. package/dist/docs/agent-prose.js +10 -8
  105. package/dist/docs/agent-setup.d.ts +6 -4
  106. package/dist/docs/agent-setup.js +26 -16
  107. package/dist/docs/agent-solutions.js +1 -1
  108. package/dist/docs/catalog.d.ts +35 -37
  109. package/dist/docs/catalog.js +36 -38
  110. package/dist/docs/error-docs.js +108 -44
  111. package/dist/utils/asset-fingerprint.d.ts +11 -0
  112. package/dist/utils/asset-fingerprint.js +46 -0
  113. package/dist/utils/auth-redirect.d.ts +1 -3
  114. package/dist/utils/auth-redirect.js +1 -21
  115. package/dist/utils/build-settings.d.ts +2 -0
  116. package/dist/utils/build-settings.js +61 -9
  117. package/dist/utils/credential-policy.d.ts +1 -1
  118. package/dist/utils/credential-policy.js +4 -0
  119. package/dist/utils/dns-instructions.d.ts +29 -0
  120. package/dist/utils/dns-instructions.js +78 -0
  121. package/dist/utils/domain-diagnostics.d.ts +29 -0
  122. package/dist/utils/domain-diagnostics.js +63 -0
  123. package/dist/utils/egress-policy.fixtures.json +51 -0
  124. package/dist/utils/grants.d.ts +53 -0
  125. package/dist/utils/grants.js +160 -0
  126. package/dist/utils/id-hints.d.ts +1 -0
  127. package/dist/utils/id-hints.js +55 -13
  128. package/dist/utils/local-space-state.js +1 -0
  129. package/dist/utils/page-colors.d.ts +50 -0
  130. package/dist/utils/page-colors.js +167 -0
  131. package/dist/utils/page-fonts.d.ts +2 -0
  132. package/dist/utils/page-fonts.js +4 -0
  133. package/dist/utils/pages.d.ts +19 -6
  134. package/dist/utils/pages.js +122 -49
  135. package/dist/utils/production-runtime.d.ts +18 -0
  136. package/dist/utils/production-runtime.js +28 -0
  137. package/dist/utils/publish-policy.d.ts +34 -4
  138. package/dist/utils/publish-policy.js +132 -61
  139. package/dist/utils/query-keys.d.ts +7 -13
  140. package/dist/utils/query-keys.js +12 -18
  141. package/dist/utils/source-archive-policy.d.ts +2 -0
  142. package/dist/utils/source-archive-policy.js +2 -0
  143. package/dist/utils/space-config.d.ts +5 -1
  144. package/dist/utils/space-config.js +35 -0
  145. package/dist/utils/static-runtime-policy.d.ts +5 -0
  146. package/dist/utils/static-runtime-policy.fixtures.json +57 -0
  147. package/dist/utils/static-runtime-policy.js +54 -10
  148. package/dist/utils/upload-session.d.ts +3 -0
  149. package/dist/utils/upload-session.js +31 -0
  150. package/package.json +6 -4
  151. package/dist/contracts/annotations.d.ts +0 -327
  152. package/dist/contracts/annotations.js +0 -235
  153. package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
  154. package/dist/contracts/generated-feature-launch-entries.js +0 -518
  155. package/dist/contracts/publishes.d.ts +0 -135
  156. package/dist/contracts/publishes.js +0 -162
  157. package/dist/utils/access-match.d.ts +0 -39
  158. package/dist/utils/access-match.js +0 -296
  159. package/dist/utils/sf-config-v1.d.ts +0 -2
  160. package/dist/utils/sf-config-v1.js +0 -542
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import { functionsAppSchema } from "./functions.js";
3
+ import { zeroAppSchema } from "./zero.js";
4
+ /**
5
+ * The one answer to "what is running on this space".
6
+ *
7
+ * A space is exactly one runtime kind — `versionRuntimeKind()` returns a single
8
+ * value and a publish carrying both declarations is refused at finalize — so
9
+ * this is a discriminated union rather than a bag of optional per-product
10
+ * fields. Anything that is not an execution tier has no member here and reads
11
+ * as `null`, which is the overwhelmingly common answer: a static space is not a
12
+ * degenerate app, it is the absence of one.
13
+ *
14
+ * It lives in its own module because it is the only place that needs to know
15
+ * about both products at once. `spaces.ts` imports it to describe runtime
16
+ * status; neither `zero.ts` nor `functions.ts` has to learn about the other.
17
+ */
18
+ export const runtimeAppSchema = z.discriminatedUnion("runtimeKind", [
19
+ zeroAppSchema,
20
+ functionsAppSchema,
21
+ ]);
@@ -1,3 +1,4 @@
1
+ import type { Grant } from "./grants.js";
1
2
  export declare const SF_CONFIG_V1_CANONICAL_FILE = "sf.jsonc";
2
3
  export declare const SF_CONFIG_V1_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
3
4
  /** Published JSON Schema URL for the strict `sf.jsonc` v1 contract. */
@@ -26,6 +27,9 @@ export type SfConfigV1 = {
26
27
  substitute?: {
27
28
  files: string[];
28
29
  };
30
+ access?: {
31
+ public: string[];
32
+ };
29
33
  };
30
34
  export type EffectiveConfigV1 = {
31
35
  version: 1;
@@ -41,6 +45,7 @@ export type EffectiveConfigV1 = {
41
45
  };
42
46
  metadata?: SfConfigV1["metadata"];
43
47
  substitute?: SfConfigV1["substitute"];
48
+ grants?: Grant[];
44
49
  };
45
50
  export type SfConfigV1Issue = {
46
51
  code: "config_alias" | "config_conflict" | "config_identity_moved" | "config_invalid" | "config_key_removed" | "config_unknown_key" | "serve_index_required" | "template_syntax_retired";
@@ -1,5 +1,5 @@
1
1
  import { BRAND } from "../brand.js";
2
- import { SPACE_CONFIG_ACCEPTED_FILES, SPACE_CONFIG_CANONICAL_FILE, } from "./space-config.js";
2
+ import { SPACE_CONFIG_ACCEPTED_FILES, SPACE_CONFIG_CANONICAL_FILE } from "./space-config.js";
3
3
  export const SF_CONFIG_V1_CANONICAL_FILE = SPACE_CONFIG_CANONICAL_FILE;
4
4
  export const SF_CONFIG_V1_FILES = SPACE_CONFIG_ACCEPTED_FILES;
5
5
  /** Published JSON Schema URL for the strict `sf.jsonc` v1 contract. */
@@ -14,6 +14,7 @@ export declare const SitePressureSchema: z.ZodObject<{
14
14
  lastSampleAt: z.ZodOptional<z.ZodString>;
15
15
  consecutivePressured: z.ZodOptional<z.ZodNumber>;
16
16
  consecutiveClean: z.ZodOptional<z.ZodNumber>;
17
+ placementHoldRevision: z.ZodOptional<z.ZodNumber>;
17
18
  pressureHoldUntil: z.ZodOptional<z.ZodString>;
18
19
  lastBulkLaneActivityAt: z.ZodOptional<z.ZodString>;
19
20
  }, z.core.$loose>;
@@ -76,8 +77,8 @@ export declare const SiteSchema: z.ZodObject<{
76
77
  code: z.ZodString;
77
78
  severity: z.ZodEnum<{
78
79
  info: "info";
79
- warning: "warning";
80
80
  error: "error";
81
+ warning: "warning";
81
82
  }>;
82
83
  message: z.ZodString;
83
84
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -98,9 +99,10 @@ export declare const SiteSchema: z.ZodObject<{
98
99
  updatedAt: z.ZodString;
99
100
  }, z.core.$strip>;
100
101
  export type Site = z.infer<typeof SiteSchema>;
101
- export declare const siteProvisioningSchema: z.ZodOptional<z.ZodObject<{
102
+ export declare const operatorSiteProvisioningSchema: z.ZodOptional<z.ZodObject<{
102
103
  importProviderSiteId: z.ZodOptional<z.ZodString>;
103
104
  }, z.core.$strip>>;
105
+ export declare const tenantSiteProvisioningSchema: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
104
106
  export declare const siteCreateSchema: z.ZodObject<{
105
107
  kind: z.ZodDefault<z.ZodEnum<{
106
108
  static_runtime: "static_runtime";
@@ -110,10 +112,8 @@ export declare const siteCreateSchema: z.ZodObject<{
110
112
  space: "space";
111
113
  }>>;
112
114
  region: z.ZodOptional<z.ZodString>;
113
- provisioning: z.ZodOptional<z.ZodObject<{
114
- importProviderSiteId: z.ZodOptional<z.ZodString>;
115
- }, z.core.$strip>>;
116
- }, z.core.$strip>;
115
+ provisioning: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
116
+ }, z.core.$strict>;
117
117
  export declare const siteListSchema: z.ZodObject<{
118
118
  data: z.ZodArray<z.ZodObject<{
119
119
  id: z.ZodString;
@@ -173,8 +173,8 @@ export declare const siteListSchema: z.ZodObject<{
173
173
  code: z.ZodString;
174
174
  severity: z.ZodEnum<{
175
175
  info: "info";
176
- warning: "warning";
177
176
  error: "error";
177
+ warning: "warning";
178
178
  }>;
179
179
  message: z.ZodString;
180
180
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -264,8 +264,8 @@ export declare const SuperadminSiteSchema: z.ZodObject<{
264
264
  code: z.ZodString;
265
265
  severity: z.ZodEnum<{
266
266
  info: "info";
267
- warning: "warning";
268
267
  error: "error";
268
+ warning: "warning";
269
269
  }>;
270
270
  message: z.ZodString;
271
271
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -353,8 +353,8 @@ export declare const SuperadminSiteListSchema: z.ZodObject<{
353
353
  code: z.ZodString;
354
354
  severity: z.ZodEnum<{
355
355
  info: "info";
356
- warning: "warning";
357
356
  error: "error";
357
+ warning: "warning";
358
358
  }>;
359
359
  message: z.ZodString;
360
360
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -388,16 +388,16 @@ export declare const superadminSiteCreateSchema: z.ZodObject<{
388
388
  kind: z.ZodDefault<z.ZodEnum<{
389
389
  static_runtime: "static_runtime";
390
390
  }>>;
391
+ region: z.ZodOptional<z.ZodString>;
391
392
  isolation: z.ZodDefault<z.ZodEnum<{
392
393
  site: "site";
393
394
  space: "space";
394
395
  }>>;
395
- region: z.ZodOptional<z.ZodString>;
396
+ tenantId: z.ZodString;
396
397
  provisioning: z.ZodOptional<z.ZodObject<{
397
398
  importProviderSiteId: z.ZodOptional<z.ZodString>;
398
399
  }, z.core.$strip>>;
399
- tenantId: z.ZodString;
400
- }, z.core.$strip>;
400
+ }, z.core.$strict>;
401
401
  export declare const siteRebalanceRequestSchema: z.ZodObject<{
402
402
  spaceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
403
403
  }, z.core.$strip>;
@@ -407,4 +407,9 @@ export declare const SiteRebalanceResultSchema: z.ZodObject<{
407
407
  spaceId: z.ZodString;
408
408
  operationId: z.ZodString;
409
409
  }, z.core.$strip>>;
410
+ warning: z.ZodString;
411
+ domainsRequiringReverification: z.ZodArray<z.ZodObject<{
412
+ spaceId: z.ZodString;
413
+ hostname: z.ZodString;
414
+ }, z.core.$strip>>;
410
415
  }, z.core.$strip>;
@@ -36,6 +36,10 @@ export const SitePressureSchema = z
36
36
  lastSampleAt: z.string().datetime().optional(),
37
37
  consecutivePressured: z.number().int().nonnegative().optional(),
38
38
  consecutiveClean: z.number().int().nonnegative().optional(),
39
+ // Monotonic CAS token shared by explicit operator hold actions and the
40
+ // pressure sampler. Every durable hold transition advances it, including
41
+ // transitions that restore a prior timestamp.
42
+ placementHoldRevision: z.number().int().nonnegative().optional(),
39
43
  // Provenance stamp for the sampler's automatic hold: set on trip to the
40
44
  // exact hold instant it wrote, so release only clears holds the pressure
41
45
  // pipeline itself set — never an operator-set placement hold.
@@ -70,13 +74,10 @@ export const SiteSchema = z.object({
70
74
  createdAt: z.string().datetime(),
71
75
  updatedAt: z.string().datetime(),
72
76
  });
73
- // How a site connects to WP.Cloud on creation: provision a fresh provider site
74
- // (optional region override, falling back to the tenant's WP.Cloud client
75
- // defaults), or import an existing one by its WP.Cloud site id (atomic_site_id).
76
- // Runtime-owned knobs such as filesystem mode, static miss handling, PHP
77
- // workers, and alias canonicalization are intentionally not exposed here; the
78
- // control plane sets them from Spacefast runtime invariants.
79
- export const siteProvisioningSchema = z
77
+ // Operator-only WP.Cloud provisioning controls. Tenant site creation never
78
+ // accepts provider object identifiers: authority to create a Spacefast site
79
+ // must not imply authority to adopt existing provider infrastructure.
80
+ export const operatorSiteProvisioningSchema = z
80
81
  .object({
81
82
  importProviderSiteId: z
82
83
  .string()
@@ -86,12 +87,17 @@ export const siteProvisioningSchema = z
86
87
  .describe("Import an existing WP.Cloud site by its atomic_site_id (operator flows)."),
87
88
  })
88
89
  .optional();
89
- export const siteCreateSchema = z.object({
90
+ // An explicit empty object requests fresh provider provisioning while keeping
91
+ // every provider identity and runtime knob outside tenant control.
92
+ export const tenantSiteProvisioningSchema = z.object({}).strict().optional();
93
+ export const siteCreateSchema = z
94
+ .object({
90
95
  kind: siteKind.default("static_runtime"),
91
96
  isolation: siteIsolation.default("site"),
92
97
  region: z.string().trim().min(1).optional().describe('Placement region; defaults to `"auto"`.'),
93
- provisioning: siteProvisioningSchema,
94
- });
98
+ provisioning: tenantSiteProvisioningSchema,
99
+ })
100
+ .strict();
95
101
  export const siteListSchema = z.object({
96
102
  data: z.array(SiteSchema),
97
103
  pagination: CursorPaginationSchema,
@@ -114,8 +120,9 @@ export const SuperadminSiteListSchema = z.object({
114
120
  });
115
121
  // Superadmin site create targets an explicit tenant (the tenant-facing
116
122
  // `siteCreateSchema` derives the tenant from the principal).
117
- export const superadminSiteCreateSchema = siteCreateSchema.extend({
123
+ export const superadminSiteCreateSchema = siteCreateSchema.omit({ provisioning: true }).extend({
118
124
  tenantId: z.string().trim().min(1),
125
+ provisioning: operatorSiteProvisioningSchema,
119
126
  });
120
127
  // Operator rebalance trigger (internal-docs/platform.md "Space placement and
121
128
  // moves": operator rebalancing is a move trigger). Queues `space_move`
@@ -128,7 +135,7 @@ export const siteRebalanceRequestSchema = z
128
135
  .optional()
129
136
  .describe("Limit the rebalance to these space ids; omitted means every live space on the site."),
130
137
  })
131
- .describe("Operator-only rebalance trigger: move spaces off this site.");
138
+ .describe("Operator-only rebalance trigger: move spaces off this site. This is the ONLY path that relocates an existing Space, and it is not free — see the reverification warning on the result.");
132
139
  export const SiteRebalanceResultSchema = z
133
140
  .object({
134
141
  siteId: z.string().describe("The site spaces are being moved off."),
@@ -138,5 +145,16 @@ export const SiteRebalanceResultSchema = z
138
145
  operationId: z.string().describe("The queued `space_move` operation id (`op_...`)."),
139
146
  }))
140
147
  .describe("One queued move operation per affected space."),
148
+ warning: z
149
+ .string()
150
+ .describe("Consequence of relocating these Spaces: each hostname is handed to another provider site, which re-runs the provider's domain-exclusivity check and is rejected unless the domain's ownership TXT record is still live in DNS."),
151
+ domainsRequiringReverification: z
152
+ .array(z.object({
153
+ spaceId: z.string().describe("Space the hostname serves."),
154
+ hostname: z
155
+ .string()
156
+ .describe("Custom hostname whose provider ownership check re-runs during the move."),
157
+ }))
158
+ .describe("Live custom hostnames on the moved Spaces. Empty means nothing customer-visible is at risk."),
141
159
  })
142
160
  .describe("Queued rebalance moves; track each operation for completion.");
@@ -17,8 +17,8 @@ export declare const SPACE_CONFIG_CAPS: {
17
17
  readonly injectSnippetBytes: number;
18
18
  /** Max snippets per `inject` array. */
19
19
  readonly injectSnippets: 16;
20
- /** Max `access.rules` entries in the file lane. */
21
- readonly accessRules: 100;
20
+ /** Max public WordPress sources exposed to repository builds. */
21
+ readonly dataSources: 32;
22
22
  /** Max `theme` color token length. */
23
23
  readonly themeColorChars: 64;
24
24
  /** Max `theme.logo` URL/path length. */
@@ -56,7 +56,6 @@ export declare const spacePlacementModeSchema: z.ZodEnum<{
56
56
  dedicated: "dedicated";
57
57
  }>;
58
58
  export declare const spacePlacementConfigSchema: z.ZodObject<{
59
- region: z.ZodOptional<z.ZodString>;
60
59
  mode: z.ZodOptional<z.ZodEnum<{
61
60
  shared: "shared";
62
61
  dedicated: "dedicated";
@@ -64,6 +63,17 @@ export declare const spacePlacementConfigSchema: z.ZodObject<{
64
63
  burstable: z.ZodOptional<z.ZodBoolean>;
65
64
  }, z.core.$strict>;
66
65
  export type SpacePlacementConfig = z.infer<typeof spacePlacementConfigSchema>;
66
+ export declare const dataSourceNameSchema: z.ZodString;
67
+ export declare const wordpressDataSourceUrlSchema: z.ZodString;
68
+ export declare const wordpressDataSourceSchema: z.ZodObject<{
69
+ kind: z.ZodLiteral<"wordpress">;
70
+ url: z.ZodString;
71
+ }, z.core.$strict>;
72
+ export type WordPressDataSource = z.infer<typeof wordpressDataSourceSchema>;
73
+ export declare const spaceDataSourcesSchema: z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
74
+ kind: z.ZodLiteral<"wordpress">;
75
+ url: z.ZodString;
76
+ }, z.core.$strict>>>;
67
77
  export declare const spaceConfigSchema: z.ZodObject<{
68
78
  index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
69
79
  fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -128,7 +138,6 @@ export declare const spaceConfigSchema: z.ZodObject<{
128
138
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
129
139
  }, z.core.$strict>>;
130
140
  placement: z.ZodOptional<z.ZodObject<{
131
- region: z.ZodOptional<z.ZodString>;
132
141
  mode: z.ZodOptional<z.ZodEnum<{
133
142
  shared: "shared";
134
143
  dedicated: "dedicated";
@@ -143,69 +152,38 @@ export declare const spaceConfigSchema: z.ZodObject<{
143
152
  bodyEnd: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
153
  noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
154
  }, z.core.$strip>>;
155
+ dataSources: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
156
+ kind: z.ZodLiteral<"wordpress">;
157
+ url: z.ZodString;
158
+ }, z.core.$strict>>>>;
159
+ defaultDataSource: z.ZodOptional<z.ZodString>;
146
160
  }, z.core.$strip>;
147
161
  export type SpaceConfig = z.infer<typeof spaceConfigSchema>;
162
+ export declare function compareDataSourceNames(left: string, right: string): number;
163
+ export declare function resolveDefaultDataSourceName(config: Pick<SpaceConfig, "dataSources" | "defaultDataSource"> | null | undefined): string | null;
148
164
  export declare function spaceSuperpowersEnabled(config: SpaceConfig | null | undefined): boolean;
149
- export declare const spaceAccessConfigSchema: z.ZodObject<{
150
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
151
- id: z.ZodOptional<z.ZodString>;
152
- match: z.ZodDefault<z.ZodObject<{
153
- host: z.ZodOptional<z.ZodString>;
154
- hostPattern: z.ZodOptional<z.ZodString>;
155
- hostTemplate: z.ZodOptional<z.ZodString>;
156
- pathPattern: z.ZodOptional<z.ZodString>;
157
- channel: z.ZodOptional<z.ZodString>;
158
- ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
159
- agent: z.ZodOptional<z.ZodString>;
160
- country: z.ZodOptional<z.ZodString>;
161
- header: z.ZodOptional<z.ZodObject<{
162
- name: z.ZodString;
163
- value: z.ZodString;
164
- }, z.core.$strip>>;
165
- }, z.core.$strip>>;
166
- effect: z.ZodEnum<{
167
- allow: "allow";
168
- deny: "deny";
169
- challenge: "challenge";
170
- }>;
171
- auth: z.ZodOptional<z.ZodObject<{
172
- requiredGrants: z.ZodArray<z.ZodString>;
173
- issuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
174
- kid: z.ZodString;
175
- alg: z.ZodLiteral<"EdDSA">;
176
- publicKey: z.ZodString;
177
- grantNamespaces: z.ZodArray<z.ZodString>;
178
- }, z.core.$strip>>>;
179
- acquire: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
180
- type: z.ZodLiteral<"password">;
181
- ref: z.ZodString;
182
- transport: z.ZodEnum<{
183
- basic: "basic";
184
- form: "form";
185
- }>;
186
- username: z.ZodOptional<z.ZodString>;
187
- }, z.core.$strip>, z.ZodObject<{
188
- type: z.ZodLiteral<"login">;
189
- url: z.ZodString;
190
- label: z.ZodOptional<z.ZodString>;
191
- }, z.core.$strip>], "type">>>;
192
- }, z.core.$strip>>;
193
- managedBy: z.ZodOptional<z.ZodEnum<{
194
- sharing: "sharing";
195
- firewall: "firewall";
196
- file_share: "file_share";
197
- cast_reviewer: "cast_reviewer";
198
- team_default: "team_default";
199
- }>>;
200
- expiresAt: z.ZodOptional<z.ZodNumber>;
201
- reasonCode: z.ZodOptional<z.ZodString>;
202
- message: z.ZodOptional<z.ZodString>;
203
- }, z.core.$strip>>>;
204
- }, z.core.$strip>;
205
165
  export declare const spacePublishOptionsSchema: z.ZodObject<{
206
166
  fingerprint: z.ZodOptional<z.ZodBoolean>;
207
167
  }, z.core.$strip>;
208
168
  export type SpacePublishOptions = z.infer<typeof spacePublishOptionsSchema>;
169
+ export declare const spaceConfigFileAccessSchema: z.ZodObject<{
170
+ public: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
171
+ }, z.core.$strict>;
172
+ export type SpaceConfigFileAccess = z.infer<typeof spaceConfigFileAccessSchema>;
173
+ /**
174
+ * Overrides for the worker `sf publish` compiles.
175
+ *
176
+ * Every field is optional because the normal case is detection: a project with
177
+ * `handler.ts` or an OpenNext build needs no configuration at all. These exist
178
+ * for the layouts detection cannot guess — a worker somewhere unusual, or a
179
+ * compatibility date the author wants pinned rather than defaulted.
180
+ */
181
+ export declare const spaceFunctionsOptionsSchema: z.ZodObject<{
182
+ entry: z.ZodOptional<z.ZodString>;
183
+ database: z.ZodDefault<z.ZodBoolean>;
184
+ compatibilityDate: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>;
186
+ export type SpaceFunctionsOptions = z.infer<typeof spaceFunctionsOptionsSchema>;
209
187
  export declare const spaceConfigFileSchema: z.ZodObject<{
210
188
  index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
211
189
  fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -270,7 +248,6 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
270
248
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
271
249
  }, z.core.$strict>>;
272
250
  placement: z.ZodOptional<z.ZodObject<{
273
- region: z.ZodOptional<z.ZodString>;
274
251
  mode: z.ZodOptional<z.ZodEnum<{
275
252
  shared: "shared";
276
253
  dedicated: "dedicated";
@@ -287,65 +264,17 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
287
264
  }, z.core.$strip>>;
288
265
  $schema: z.ZodOptional<z.ZodString>;
289
266
  space: z.ZodOptional<z.ZodString>;
290
- access: z.ZodOptional<z.ZodObject<{
291
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
292
- id: z.ZodOptional<z.ZodString>;
293
- match: z.ZodDefault<z.ZodObject<{
294
- host: z.ZodOptional<z.ZodString>;
295
- hostPattern: z.ZodOptional<z.ZodString>;
296
- hostTemplate: z.ZodOptional<z.ZodString>;
297
- pathPattern: z.ZodOptional<z.ZodString>;
298
- channel: z.ZodOptional<z.ZodString>;
299
- ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
300
- agent: z.ZodOptional<z.ZodString>;
301
- country: z.ZodOptional<z.ZodString>;
302
- header: z.ZodOptional<z.ZodObject<{
303
- name: z.ZodString;
304
- value: z.ZodString;
305
- }, z.core.$strip>>;
306
- }, z.core.$strip>>;
307
- effect: z.ZodEnum<{
308
- allow: "allow";
309
- deny: "deny";
310
- challenge: "challenge";
311
- }>;
312
- auth: z.ZodOptional<z.ZodObject<{
313
- requiredGrants: z.ZodArray<z.ZodString>;
314
- issuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
315
- kid: z.ZodString;
316
- alg: z.ZodLiteral<"EdDSA">;
317
- publicKey: z.ZodString;
318
- grantNamespaces: z.ZodArray<z.ZodString>;
319
- }, z.core.$strip>>>;
320
- acquire: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
321
- type: z.ZodLiteral<"password">;
322
- ref: z.ZodString;
323
- transport: z.ZodEnum<{
324
- basic: "basic";
325
- form: "form";
326
- }>;
327
- username: z.ZodOptional<z.ZodString>;
328
- }, z.core.$strip>, z.ZodObject<{
329
- type: z.ZodLiteral<"login">;
330
- url: z.ZodString;
331
- label: z.ZodOptional<z.ZodString>;
332
- }, z.core.$strip>], "type">>>;
333
- }, z.core.$strip>>;
334
- managedBy: z.ZodOptional<z.ZodEnum<{
335
- sharing: "sharing";
336
- firewall: "firewall";
337
- file_share: "file_share";
338
- cast_reviewer: "cast_reviewer";
339
- team_default: "team_default";
340
- }>>;
341
- expiresAt: z.ZodOptional<z.ZodNumber>;
342
- reasonCode: z.ZodOptional<z.ZodString>;
343
- message: z.ZodOptional<z.ZodString>;
344
- }, z.core.$strip>>>;
345
- }, z.core.$strip>>;
346
267
  publish: z.ZodOptional<z.ZodObject<{
347
268
  fingerprint: z.ZodOptional<z.ZodBoolean>;
348
269
  }, z.core.$strip>>;
270
+ access: z.ZodOptional<z.ZodObject<{
271
+ public: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
272
+ }, z.core.$strict>>;
273
+ functions: z.ZodOptional<z.ZodObject<{
274
+ entry: z.ZodOptional<z.ZodString>;
275
+ database: z.ZodDefault<z.ZodBoolean>;
276
+ compatibilityDate: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strip>>;
349
278
  }, z.core.$strip>;
350
279
  export type SpaceConfigFile = z.infer<typeof spaceConfigFileSchema>;
351
280
  /**