@spacefast/common 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/README.md +42 -0
  2. package/dist/brand.d.ts +15 -0
  3. package/dist/brand.js +24 -0
  4. package/dist/config/domains.d.ts +30 -0
  5. package/dist/config/domains.js +75 -0
  6. package/dist/config/index.d.ts +1 -0
  7. package/dist/config/index.js +3 -0
  8. package/dist/contracts/abuse.d.ts +93 -0
  9. package/dist/contracts/abuse.js +50 -0
  10. package/dist/contracts/access.d.ts +409 -0
  11. package/dist/contracts/access.js +396 -0
  12. package/dist/contracts/account.d.ts +28 -0
  13. package/dist/contracts/account.js +54 -0
  14. package/dist/contracts/activity.d.ts +118 -0
  15. package/dist/contracts/activity.js +180 -0
  16. package/dist/contracts/analytics.d.ts +56 -0
  17. package/dist/contracts/analytics.js +91 -0
  18. package/dist/contracts/annotations.d.ts +327 -0
  19. package/dist/contracts/annotations.js +234 -0
  20. package/dist/contracts/api-keys.d.ts +517 -0
  21. package/dist/contracts/api-keys.js +235 -0
  22. package/dist/contracts/archives.d.ts +332 -0
  23. package/dist/contracts/archives.js +120 -0
  24. package/dist/contracts/auth.d.ts +86 -0
  25. package/dist/contracts/auth.js +82 -0
  26. package/dist/contracts/beta.d.ts +106 -0
  27. package/dist/contracts/beta.js +104 -0
  28. package/dist/contracts/billing.d.ts +328 -0
  29. package/dist/contracts/billing.js +203 -0
  30. package/dist/contracts/builds.d.ts +504 -0
  31. package/dist/contracts/builds.js +248 -0
  32. package/dist/contracts/channels.d.ts +49 -0
  33. package/dist/contracts/channels.js +51 -0
  34. package/dist/contracts/common.d.ts +238 -0
  35. package/dist/contracts/common.js +175 -0
  36. package/dist/contracts/deployments.d.ts +574 -0
  37. package/dist/contracts/deployments.js +97 -0
  38. package/dist/contracts/device-auth.d.ts +194 -0
  39. package/dist/contracts/device-auth.js +162 -0
  40. package/dist/contracts/domains.d.ts +6115 -0
  41. package/dist/contracts/domains.js +1435 -0
  42. package/dist/contracts/enums.d.ts +196 -0
  43. package/dist/contracts/enums.js +211 -0
  44. package/dist/contracts/error-code-meta.d.ts +1560 -0
  45. package/dist/contracts/error-code-meta.js +400 -0
  46. package/dist/contracts/error-codes.d.ts +13 -0
  47. package/dist/contracts/error-codes.js +416 -0
  48. package/dist/contracts/events.d.ts +398 -0
  49. package/dist/contracts/events.js +320 -0
  50. package/dist/contracts/fast-domain-search.d.ts +19 -0
  51. package/dist/contracts/fast-domain-search.js +22 -0
  52. package/dist/contracts/features.d.ts +240 -0
  53. package/dist/contracts/features.js +406 -0
  54. package/dist/contracts/git.d.ts +288 -0
  55. package/dist/contracts/git.js +116 -0
  56. package/dist/contracts/ids.d.ts +35 -0
  57. package/dist/contracts/ids.js +45 -0
  58. package/dist/contracts/intercom.d.ts +6 -0
  59. package/dist/contracts/intercom.js +5 -0
  60. package/dist/contracts/internal.d.ts +103 -0
  61. package/dist/contracts/internal.js +92 -0
  62. package/dist/contracts/mcp.d.ts +788 -0
  63. package/dist/contracts/mcp.js +161 -0
  64. package/dist/contracts/me.d.ts +81 -0
  65. package/dist/contracts/me.js +104 -0
  66. package/dist/contracts/oauth-resources.d.ts +30 -0
  67. package/dist/contracts/oauth-resources.js +61 -0
  68. package/dist/contracts/operations.d.ts +54 -0
  69. package/dist/contracts/operations.js +14 -0
  70. package/dist/contracts/plan-policy.d.ts +85 -0
  71. package/dist/contracts/plan-policy.js +75 -0
  72. package/dist/contracts/platform.d.ts +359 -0
  73. package/dist/contracts/platform.js +216 -0
  74. package/dist/contracts/push-new.d.ts +156 -0
  75. package/dist/contracts/push-new.js +52 -0
  76. package/dist/contracts/quotas.d.ts +16 -0
  77. package/dist/contracts/quotas.js +36 -0
  78. package/dist/contracts/repository-connections.d.ts +231 -0
  79. package/dist/contracts/repository-connections.js +106 -0
  80. package/dist/contracts/resources.d.ts +529 -0
  81. package/dist/contracts/resources.js +209 -0
  82. package/dist/contracts/routes.d.ts +45 -0
  83. package/dist/contracts/routes.js +31 -0
  84. package/dist/contracts/runtime-api.d.ts +449 -0
  85. package/dist/contracts/runtime-api.js +513 -0
  86. package/dist/contracts/sites.d.ts +393 -0
  87. package/dist/contracts/sites.js +121 -0
  88. package/dist/contracts/slugs.d.ts +31 -0
  89. package/dist/contracts/slugs.js +47 -0
  90. package/dist/contracts/space-config.d.ts +216 -0
  91. package/dist/contracts/space-config.js +237 -0
  92. package/dist/contracts/space-theme.d.ts +25 -0
  93. package/dist/contracts/space-theme.js +49 -0
  94. package/dist/contracts/spaces.d.ts +2760 -0
  95. package/dist/contracts/spaces.js +589 -0
  96. package/dist/contracts/superadmin-activity.d.ts +205 -0
  97. package/dist/contracts/superadmin-activity.js +107 -0
  98. package/dist/contracts/superadmin-emails.d.ts +212 -0
  99. package/dist/contracts/superadmin-emails.js +112 -0
  100. package/dist/contracts/superadmin-queues.d.ts +414 -0
  101. package/dist/contracts/superadmin-queues.js +202 -0
  102. package/dist/contracts/superadmin-runtime.d.ts +27 -0
  103. package/dist/contracts/superadmin-runtime.js +38 -0
  104. package/dist/contracts/superadmin-spaces.d.ts +429 -0
  105. package/dist/contracts/superadmin-spaces.js +82 -0
  106. package/dist/contracts/superadmin-tenants.d.ts +180 -0
  107. package/dist/contracts/superadmin-tenants.js +117 -0
  108. package/dist/contracts/superadmin.d.ts +654 -0
  109. package/dist/contracts/superadmin.js +309 -0
  110. package/dist/contracts/tags.d.ts +1140 -0
  111. package/dist/contracts/tags.js +1050 -0
  112. package/dist/contracts/teams.d.ts +233 -0
  113. package/dist/contracts/teams.js +174 -0
  114. package/dist/contracts/telemetry.d.ts +2 -0
  115. package/dist/contracts/telemetry.js +1 -0
  116. package/dist/contracts/transfers.d.ts +105 -0
  117. package/dist/contracts/transfers.js +48 -0
  118. package/dist/contracts/variables.d.ts +189 -0
  119. package/dist/contracts/variables.js +82 -0
  120. package/dist/contracts/webhooks.d.ts +159 -0
  121. package/dist/contracts/webhooks.js +59 -0
  122. package/dist/contracts/zero.d.ts +1538 -0
  123. package/dist/contracts/zero.js +755 -0
  124. package/dist/docs/agent-prose.d.ts +35 -0
  125. package/dist/docs/agent-prose.js +153 -0
  126. package/dist/docs/agent-setup.d.ts +6 -0
  127. package/dist/docs/agent-setup.js +164 -0
  128. package/dist/docs/agent-solutions.d.ts +110 -0
  129. package/dist/docs/agent-solutions.js +181 -0
  130. package/dist/docs/error-docs.d.ts +12 -0
  131. package/dist/docs/error-docs.js +1601 -0
  132. package/dist/docs/skill-distribution.d.ts +12 -0
  133. package/dist/docs/skill-distribution.js +18 -0
  134. package/dist/domain-exploration.d.ts +108 -0
  135. package/dist/domain-exploration.js +488 -0
  136. package/dist/domain-normalize.d.ts +1 -0
  137. package/dist/domain-normalize.js +14 -0
  138. package/dist/domain-zones.d.ts +1 -0
  139. package/dist/domain-zones.js +5272 -0
  140. package/dist/index.d.ts +1 -0
  141. package/dist/index.js +1 -0
  142. package/dist/utils/access-policy.d.ts +39 -0
  143. package/dist/utils/access-policy.js +232 -0
  144. package/dist/utils/api.d.ts +4 -0
  145. package/dist/utils/api.js +13 -0
  146. package/dist/utils/auth-redirect.d.ts +1 -0
  147. package/dist/utils/auth-redirect.js +48 -0
  148. package/dist/utils/auth.d.ts +5 -0
  149. package/dist/utils/auth.js +13 -0
  150. package/dist/utils/build-settings.d.ts +49 -0
  151. package/dist/utils/build-settings.js +366 -0
  152. package/dist/utils/claim-token.d.ts +1 -0
  153. package/dist/utils/claim-token.js +9 -0
  154. package/dist/utils/collections.d.ts +1 -0
  155. package/dist/utils/collections.js +5 -0
  156. package/dist/utils/concurrency.d.ts +1 -0
  157. package/dist/utils/concurrency.js +18 -0
  158. package/dist/utils/content-type.d.ts +10 -0
  159. package/dist/utils/content-type.js +145 -0
  160. package/dist/utils/error-display.d.ts +7 -0
  161. package/dist/utils/error-display.js +42 -0
  162. package/dist/utils/error.d.ts +1 -0
  163. package/dist/utils/error.js +3 -0
  164. package/dist/utils/generate-space-name.d.ts +14 -0
  165. package/dist/utils/generate-space-name.js +95 -0
  166. package/dist/utils/git-repository.d.ts +5 -0
  167. package/dist/utils/git-repository.js +99 -0
  168. package/dist/utils/guards.d.ts +1 -0
  169. package/dist/utils/guards.js +3 -0
  170. package/dist/utils/publish-detection.d.ts +10 -0
  171. package/dist/utils/publish-detection.js +118 -0
  172. package/dist/utils/publish-policy.d.ts +69 -0
  173. package/dist/utils/publish-policy.js +429 -0
  174. package/dist/utils/query-client.d.ts +7 -0
  175. package/dist/utils/query-client.js +21 -0
  176. package/dist/utils/query-keys.d.ts +75 -0
  177. package/dist/utils/query-keys.js +78 -0
  178. package/dist/utils/runtime-paths.d.ts +7 -0
  179. package/dist/utils/runtime-paths.js +28 -0
  180. package/dist/utils/runtime-upload.d.ts +19 -0
  181. package/dist/utils/runtime-upload.js +27 -0
  182. package/dist/utils/slug.d.ts +5 -0
  183. package/dist/utils/slug.js +13 -0
  184. package/dist/utils/space-config.d.ts +75 -0
  185. package/dist/utils/space-config.js +415 -0
  186. package/dist/utils/space-theme.d.ts +16 -0
  187. package/dist/utils/space-theme.js +89 -0
  188. package/dist/utils/static-runtime-policy.d.ts +17 -0
  189. package/dist/utils/static-runtime-policy.js +103 -0
  190. package/dist/utils/upload-session.d.ts +34 -0
  191. package/dist/utils/upload-session.js +69 -0
  192. package/dist/utils/urls.d.ts +2 -0
  193. package/dist/utils/urls.js +7 -0
  194. package/dist/utils/version-path.d.ts +6 -0
  195. package/dist/utils/version-path.js +51 -0
  196. package/dist/utils/wpcom-auth-redirects.d.ts +14 -0
  197. package/dist/utils/wpcom-auth-redirects.js +49 -0
  198. package/dist/utils/zero-realtime-signature.d.ts +12 -0
  199. package/dist/utils/zero-realtime-signature.js +45 -0
  200. package/dist/vocabulary.d.ts +230 -0
  201. package/dist/vocabulary.js +218 -0
  202. package/package.json +58 -0
@@ -0,0 +1,393 @@
1
+ import { z } from "zod";
2
+ export declare const SiteCapacitySchema: z.ZodObject<{
3
+ maxSpaces: z.ZodOptional<z.ZodNumber>;
4
+ usedSpaces: z.ZodOptional<z.ZodNumber>;
5
+ storageBytes: z.ZodOptional<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export type SiteCapacity = z.infer<typeof SiteCapacitySchema>;
8
+ export declare const SiteSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ tenantId: z.ZodString;
11
+ principal: z.ZodNullable<z.ZodObject<{
12
+ tenantId: z.ZodString;
13
+ principalType: z.ZodEnum<{
14
+ external: "external";
15
+ team: "team";
16
+ }>;
17
+ principalId: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ kind: z.ZodEnum<{
20
+ static_runtime: "static_runtime";
21
+ }>;
22
+ isolation: z.ZodEnum<{
23
+ space: "space";
24
+ site: "site";
25
+ }>;
26
+ status: z.ZodEnum<{
27
+ active: "active";
28
+ provisioning: "provisioning";
29
+ deleted: "deleted";
30
+ degraded: "degraded";
31
+ ready_pool: "ready_pool";
32
+ suspended: "suspended";
33
+ }>;
34
+ region: z.ZodString;
35
+ managementHostname: z.ZodNullable<z.ZodString>;
36
+ runtimeInstanceId: z.ZodNullable<z.ZodString>;
37
+ provider: z.ZodLiteral<"wpcloud">;
38
+ capacity: z.ZodNullable<z.ZodObject<{
39
+ maxSpaces: z.ZodOptional<z.ZodNumber>;
40
+ usedSpaces: z.ZodOptional<z.ZodNumber>;
41
+ storageBytes: z.ZodOptional<z.ZodNumber>;
42
+ }, z.core.$strip>>;
43
+ operation: z.ZodNullable<z.ZodObject<{
44
+ id: z.ZodString;
45
+ kind: z.ZodString;
46
+ status: z.ZodEnum<{
47
+ failed: "failed";
48
+ queued: "queued";
49
+ running: "running";
50
+ succeeded: "succeeded";
51
+ canceled: "canceled";
52
+ }>;
53
+ resources: z.ZodArray<z.ZodObject<{
54
+ type: z.ZodString;
55
+ id: z.ZodString;
56
+ }, z.core.$strip>>;
57
+ progress: z.ZodOptional<z.ZodObject<{
58
+ total: z.ZodNumber;
59
+ completed: z.ZodNumber;
60
+ failed: z.ZodNumber;
61
+ }, z.core.$strip>>;
62
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
+ code: z.ZodString;
64
+ severity: z.ZodEnum<{
65
+ info: "info";
66
+ warning: "warning";
67
+ error: "error";
68
+ }>;
69
+ message: z.ZodString;
70
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
72
+ wpcloud: "wpcloud";
73
+ dns: "dns";
74
+ registrar: "registrar";
75
+ runtime: "runtime";
76
+ }>>>;
77
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
78
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
80
+ }, z.core.$strip>>>;
81
+ createdAt: z.ZodString;
82
+ finishedAt: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>>;
84
+ createdAt: z.ZodString;
85
+ updatedAt: z.ZodString;
86
+ }, z.core.$strip>;
87
+ export type Site = z.infer<typeof SiteSchema>;
88
+ export declare const siteProvisioningSchema: z.ZodOptional<z.ZodObject<{
89
+ importProviderSiteId: z.ZodOptional<z.ZodString>;
90
+ }, z.core.$strip>>;
91
+ export declare const siteCreateSchema: z.ZodObject<{
92
+ kind: z.ZodDefault<z.ZodEnum<{
93
+ static_runtime: "static_runtime";
94
+ }>>;
95
+ isolation: z.ZodDefault<z.ZodEnum<{
96
+ space: "space";
97
+ site: "site";
98
+ }>>;
99
+ region: z.ZodOptional<z.ZodString>;
100
+ provisioning: z.ZodOptional<z.ZodObject<{
101
+ importProviderSiteId: z.ZodOptional<z.ZodString>;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>;
104
+ export declare const siteListSchema: z.ZodObject<{
105
+ data: z.ZodArray<z.ZodObject<{
106
+ id: z.ZodString;
107
+ tenantId: z.ZodString;
108
+ principal: z.ZodNullable<z.ZodObject<{
109
+ tenantId: z.ZodString;
110
+ principalType: z.ZodEnum<{
111
+ external: "external";
112
+ team: "team";
113
+ }>;
114
+ principalId: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ kind: z.ZodEnum<{
117
+ static_runtime: "static_runtime";
118
+ }>;
119
+ isolation: z.ZodEnum<{
120
+ space: "space";
121
+ site: "site";
122
+ }>;
123
+ status: z.ZodEnum<{
124
+ active: "active";
125
+ provisioning: "provisioning";
126
+ deleted: "deleted";
127
+ degraded: "degraded";
128
+ ready_pool: "ready_pool";
129
+ suspended: "suspended";
130
+ }>;
131
+ region: z.ZodString;
132
+ managementHostname: z.ZodNullable<z.ZodString>;
133
+ runtimeInstanceId: z.ZodNullable<z.ZodString>;
134
+ provider: z.ZodLiteral<"wpcloud">;
135
+ capacity: z.ZodNullable<z.ZodObject<{
136
+ maxSpaces: z.ZodOptional<z.ZodNumber>;
137
+ usedSpaces: z.ZodOptional<z.ZodNumber>;
138
+ storageBytes: z.ZodOptional<z.ZodNumber>;
139
+ }, z.core.$strip>>;
140
+ operation: z.ZodNullable<z.ZodObject<{
141
+ id: z.ZodString;
142
+ kind: z.ZodString;
143
+ status: z.ZodEnum<{
144
+ failed: "failed";
145
+ queued: "queued";
146
+ running: "running";
147
+ succeeded: "succeeded";
148
+ canceled: "canceled";
149
+ }>;
150
+ resources: z.ZodArray<z.ZodObject<{
151
+ type: z.ZodString;
152
+ id: z.ZodString;
153
+ }, z.core.$strip>>;
154
+ progress: z.ZodOptional<z.ZodObject<{
155
+ total: z.ZodNumber;
156
+ completed: z.ZodNumber;
157
+ failed: z.ZodNumber;
158
+ }, z.core.$strip>>;
159
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
160
+ code: z.ZodString;
161
+ severity: z.ZodEnum<{
162
+ info: "info";
163
+ warning: "warning";
164
+ error: "error";
165
+ }>;
166
+ message: z.ZodString;
167
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
169
+ wpcloud: "wpcloud";
170
+ dns: "dns";
171
+ registrar: "registrar";
172
+ runtime: "runtime";
173
+ }>>>;
174
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
175
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
176
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
177
+ }, z.core.$strip>>>;
178
+ createdAt: z.ZodString;
179
+ finishedAt: z.ZodOptional<z.ZodString>;
180
+ }, z.core.$strip>>;
181
+ createdAt: z.ZodString;
182
+ updatedAt: z.ZodString;
183
+ }, z.core.$strip>>;
184
+ pagination: z.ZodObject<{
185
+ nextCursor: z.ZodNullable<z.ZodString>;
186
+ hasMore: z.ZodBoolean;
187
+ }, z.core.$strip>;
188
+ }, z.core.$strip>;
189
+ export declare const siteListQuerySchema: z.ZodObject<{
190
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
191
+ cursor: z.ZodOptional<z.ZodString>;
192
+ kind: z.ZodOptional<z.ZodEnum<{
193
+ static_runtime: "static_runtime";
194
+ }>>;
195
+ }, z.core.$strip>;
196
+ export declare const SuperadminSiteSchema: z.ZodObject<{
197
+ id: z.ZodString;
198
+ tenantId: z.ZodString;
199
+ principal: z.ZodNullable<z.ZodObject<{
200
+ tenantId: z.ZodString;
201
+ principalType: z.ZodEnum<{
202
+ external: "external";
203
+ team: "team";
204
+ }>;
205
+ principalId: z.ZodString;
206
+ }, z.core.$strip>>;
207
+ kind: z.ZodEnum<{
208
+ static_runtime: "static_runtime";
209
+ }>;
210
+ isolation: z.ZodEnum<{
211
+ space: "space";
212
+ site: "site";
213
+ }>;
214
+ status: z.ZodEnum<{
215
+ active: "active";
216
+ provisioning: "provisioning";
217
+ deleted: "deleted";
218
+ degraded: "degraded";
219
+ ready_pool: "ready_pool";
220
+ suspended: "suspended";
221
+ }>;
222
+ region: z.ZodString;
223
+ managementHostname: z.ZodNullable<z.ZodString>;
224
+ runtimeInstanceId: z.ZodNullable<z.ZodString>;
225
+ provider: z.ZodLiteral<"wpcloud">;
226
+ capacity: z.ZodNullable<z.ZodObject<{
227
+ maxSpaces: z.ZodOptional<z.ZodNumber>;
228
+ usedSpaces: z.ZodOptional<z.ZodNumber>;
229
+ storageBytes: z.ZodOptional<z.ZodNumber>;
230
+ }, z.core.$strip>>;
231
+ operation: z.ZodNullable<z.ZodObject<{
232
+ id: z.ZodString;
233
+ kind: z.ZodString;
234
+ status: z.ZodEnum<{
235
+ failed: "failed";
236
+ queued: "queued";
237
+ running: "running";
238
+ succeeded: "succeeded";
239
+ canceled: "canceled";
240
+ }>;
241
+ resources: z.ZodArray<z.ZodObject<{
242
+ type: z.ZodString;
243
+ id: z.ZodString;
244
+ }, z.core.$strip>>;
245
+ progress: z.ZodOptional<z.ZodObject<{
246
+ total: z.ZodNumber;
247
+ completed: z.ZodNumber;
248
+ failed: z.ZodNumber;
249
+ }, z.core.$strip>>;
250
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
251
+ code: z.ZodString;
252
+ severity: z.ZodEnum<{
253
+ info: "info";
254
+ warning: "warning";
255
+ error: "error";
256
+ }>;
257
+ message: z.ZodString;
258
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
259
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
260
+ wpcloud: "wpcloud";
261
+ dns: "dns";
262
+ registrar: "registrar";
263
+ runtime: "runtime";
264
+ }>>>;
265
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
266
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
267
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
268
+ }, z.core.$strip>>>;
269
+ createdAt: z.ZodString;
270
+ finishedAt: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strip>>;
272
+ createdAt: z.ZodString;
273
+ updatedAt: z.ZodString;
274
+ class: z.ZodEnum<{
275
+ anonymous_pool: "anonymous_pool";
276
+ shared_org: "shared_org";
277
+ dedicated_space: "dedicated_space";
278
+ }>;
279
+ providerClientId: z.ZodNullable<z.ZodString>;
280
+ providerRef: z.ZodNullable<z.ZodString>;
281
+ }, z.core.$strip>;
282
+ export declare const SuperadminSiteListSchema: z.ZodObject<{
283
+ sites: z.ZodArray<z.ZodObject<{
284
+ id: z.ZodString;
285
+ tenantId: z.ZodString;
286
+ principal: z.ZodNullable<z.ZodObject<{
287
+ tenantId: z.ZodString;
288
+ principalType: z.ZodEnum<{
289
+ external: "external";
290
+ team: "team";
291
+ }>;
292
+ principalId: z.ZodString;
293
+ }, z.core.$strip>>;
294
+ kind: z.ZodEnum<{
295
+ static_runtime: "static_runtime";
296
+ }>;
297
+ isolation: z.ZodEnum<{
298
+ space: "space";
299
+ site: "site";
300
+ }>;
301
+ status: z.ZodEnum<{
302
+ active: "active";
303
+ provisioning: "provisioning";
304
+ deleted: "deleted";
305
+ degraded: "degraded";
306
+ ready_pool: "ready_pool";
307
+ suspended: "suspended";
308
+ }>;
309
+ region: z.ZodString;
310
+ managementHostname: z.ZodNullable<z.ZodString>;
311
+ runtimeInstanceId: z.ZodNullable<z.ZodString>;
312
+ provider: z.ZodLiteral<"wpcloud">;
313
+ capacity: z.ZodNullable<z.ZodObject<{
314
+ maxSpaces: z.ZodOptional<z.ZodNumber>;
315
+ usedSpaces: z.ZodOptional<z.ZodNumber>;
316
+ storageBytes: z.ZodOptional<z.ZodNumber>;
317
+ }, z.core.$strip>>;
318
+ operation: z.ZodNullable<z.ZodObject<{
319
+ id: z.ZodString;
320
+ kind: z.ZodString;
321
+ status: z.ZodEnum<{
322
+ failed: "failed";
323
+ queued: "queued";
324
+ running: "running";
325
+ succeeded: "succeeded";
326
+ canceled: "canceled";
327
+ }>;
328
+ resources: z.ZodArray<z.ZodObject<{
329
+ type: z.ZodString;
330
+ id: z.ZodString;
331
+ }, z.core.$strip>>;
332
+ progress: z.ZodOptional<z.ZodObject<{
333
+ total: z.ZodNumber;
334
+ completed: z.ZodNumber;
335
+ failed: z.ZodNumber;
336
+ }, z.core.$strip>>;
337
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
338
+ code: z.ZodString;
339
+ severity: z.ZodEnum<{
340
+ info: "info";
341
+ warning: "warning";
342
+ error: "error";
343
+ }>;
344
+ message: z.ZodString;
345
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
347
+ wpcloud: "wpcloud";
348
+ dns: "dns";
349
+ registrar: "registrar";
350
+ runtime: "runtime";
351
+ }>>>;
352
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
353
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
354
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
355
+ }, z.core.$strip>>>;
356
+ createdAt: z.ZodString;
357
+ finishedAt: z.ZodOptional<z.ZodString>;
358
+ }, z.core.$strip>>;
359
+ createdAt: z.ZodString;
360
+ updatedAt: z.ZodString;
361
+ class: z.ZodEnum<{
362
+ anonymous_pool: "anonymous_pool";
363
+ shared_org: "shared_org";
364
+ dedicated_space: "dedicated_space";
365
+ }>;
366
+ providerClientId: z.ZodNullable<z.ZodString>;
367
+ providerRef: z.ZodNullable<z.ZodString>;
368
+ }, z.core.$strip>>;
369
+ }, z.core.$strip>;
370
+ export declare const superadminSiteCreateSchema: z.ZodObject<{
371
+ kind: z.ZodDefault<z.ZodEnum<{
372
+ static_runtime: "static_runtime";
373
+ }>>;
374
+ isolation: z.ZodDefault<z.ZodEnum<{
375
+ space: "space";
376
+ site: "site";
377
+ }>>;
378
+ region: z.ZodOptional<z.ZodString>;
379
+ provisioning: z.ZodOptional<z.ZodObject<{
380
+ importProviderSiteId: z.ZodOptional<z.ZodString>;
381
+ }, z.core.$strip>>;
382
+ tenantId: z.ZodString;
383
+ }, z.core.$strip>;
384
+ export declare const siteRebalanceRequestSchema: z.ZodObject<{
385
+ spaceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
386
+ }, z.core.$strip>;
387
+ export declare const SiteRebalanceResultSchema: z.ZodObject<{
388
+ siteId: z.ZodString;
389
+ moves: z.ZodArray<z.ZodObject<{
390
+ spaceId: z.ZodString;
391
+ operationId: z.ZodString;
392
+ }, z.core.$strip>>;
393
+ }, z.core.$strip>;
@@ -0,0 +1,121 @@
1
+ import { z } from "zod";
2
+ import { AsyncOperationSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
+ import { siteClass, siteIsolation, siteKind, siteStatus } from "./enums.js";
4
+ import { PrincipalRefSchema } from "./resources.js";
5
+ // Capacity accounting for shared-pool sites (internal-docs/platform.md "Site").
6
+ // `usedSpaces` counts spaces currently placed on the site.
7
+ export const SiteCapacitySchema = z
8
+ .object({
9
+ maxSpaces: z
10
+ .number()
11
+ .int()
12
+ .nonnegative()
13
+ .optional()
14
+ .describe("Maximum spaces this site may host."),
15
+ usedSpaces: z
16
+ .number()
17
+ .int()
18
+ .nonnegative()
19
+ .optional()
20
+ .describe("Spaces currently placed on this site."),
21
+ storageBytes: z
22
+ .number()
23
+ .int()
24
+ .nonnegative()
25
+ .optional()
26
+ .describe("Storage budget for the site in bytes."),
27
+ })
28
+ .describe("Capacity accounting for shared-pool sites.");
29
+ // A Site is THE placement unit (internal-docs/platform.md "Site", `site_`):
30
+ // one WP.Cloud site per row. Spaces are placed onto a site via `space.siteId`.
31
+ // Provider linkage (`providerClientId`, `providerRef`) is operator-only and
32
+ // never appears in this tenant-facing shape.
33
+ export const SiteSchema = z.object({
34
+ id: z.string().describe("Site id (`site_...`)."),
35
+ tenantId: z.string().describe("Owning tenant id (`ten_...`)."),
36
+ principal: PrincipalRefSchema.nullable().describe("Owning principal within the tenant; null for tenant-level and pool sites."),
37
+ kind: siteKind.describe("Runtime kind. Only the Spacefast static runtime exists today."),
38
+ isolation: siteIsolation.describe("Whether settings/access default to the site or to each space."),
39
+ status: siteStatus.describe("Site lifecycle status. `ready_pool` is a warm pre-provisioned pool site."),
40
+ region: z.string().describe('Placement region; `"auto"` lets placement decide.'),
41
+ managementHostname: z
42
+ .string()
43
+ .nullable()
44
+ .describe("Hostname the control plane manages the site runtime through."),
45
+ runtimeInstanceId: z.string().nullable().describe("Runtime instance identity for this site."),
46
+ provider: z.literal("wpcloud").describe("Hosting provider."),
47
+ capacity: SiteCapacitySchema.nullable().describe("Capacity accounting; null when the site has no explicit budget."),
48
+ operation: AsyncOperationSchema.nullable(),
49
+ createdAt: z.string().datetime(),
50
+ updatedAt: z.string().datetime(),
51
+ });
52
+ // How a site connects to WP.Cloud on creation: provision a fresh provider site
53
+ // (optional region override, falling back to the tenant's WP.Cloud client
54
+ // defaults), or import an existing one by its WP.Cloud site id (atomic_site_id).
55
+ // Runtime-owned knobs such as filesystem mode, static miss handling, PHP
56
+ // workers, and alias canonicalization are intentionally not exposed here; the
57
+ // control plane sets them from Spacefast runtime invariants.
58
+ export const siteProvisioningSchema = z
59
+ .object({
60
+ importProviderSiteId: z
61
+ .string()
62
+ .trim()
63
+ .min(1)
64
+ .optional()
65
+ .describe("Import an existing WP.Cloud site by its atomic_site_id (operator flows)."),
66
+ })
67
+ .optional();
68
+ export const siteCreateSchema = z.object({
69
+ kind: siteKind.default("static_runtime"),
70
+ isolation: siteIsolation.default("site"),
71
+ region: z.string().trim().min(1).optional().describe('Placement region; defaults to `"auto"`.'),
72
+ provisioning: siteProvisioningSchema,
73
+ });
74
+ export const siteListSchema = z.object({
75
+ data: z.array(SiteSchema),
76
+ pagination: CursorPaginationSchema,
77
+ });
78
+ export const siteListQuerySchema = cursorListQuerySchema.extend({
79
+ kind: siteKind.optional().describe("Filter to sites with this runtime kind."),
80
+ });
81
+ // Superadmin site view: the tenant SiteSchema plus the internal provider
82
+ // linkage and placement class (hidden from tenant callers).
83
+ export const SuperadminSiteSchema = SiteSchema.extend({
84
+ class: siteClass.describe("Placement class: pool partition, shared team site, or dedicated."),
85
+ providerClientId: z
86
+ .string()
87
+ .nullable()
88
+ .describe("WP.Cloud client identity (`pvc_...`) the site is provisioned under."),
89
+ providerRef: z.string().nullable().describe("WP.Cloud atomic_site_id."),
90
+ });
91
+ export const SuperadminSiteListSchema = z.object({
92
+ sites: z.array(SuperadminSiteSchema),
93
+ });
94
+ // Superadmin site create targets an explicit tenant (the tenant-facing
95
+ // `siteCreateSchema` derives the tenant from the principal).
96
+ export const superadminSiteCreateSchema = siteCreateSchema.extend({
97
+ tenantId: z.string().trim().min(1),
98
+ });
99
+ // Operator rebalance trigger (internal-docs/platform.md "Space placement and
100
+ // moves": operator rebalancing is a move trigger). Queues `space_move`
101
+ // operations off the site for the selected (default: all) live spaces.
102
+ export const siteRebalanceRequestSchema = z
103
+ .object({
104
+ spaceIds: z
105
+ .array(z.string().trim().min(1))
106
+ .max(100)
107
+ .optional()
108
+ .describe("Limit the rebalance to these space ids; omitted means every live space on the site."),
109
+ })
110
+ .describe("Operator-only rebalance trigger: move spaces off this site.");
111
+ export const SiteRebalanceResultSchema = z
112
+ .object({
113
+ siteId: z.string().describe("The site spaces are being moved off."),
114
+ moves: z
115
+ .array(z.object({
116
+ spaceId: z.string().describe("Space queued to move."),
117
+ operationId: z.string().describe("The queued `space_move` operation id (`op_...`)."),
118
+ }))
119
+ .describe("One queued move operation per affected space."),
120
+ })
121
+ .describe("Queued rebalance moves; track each operation for completion.");
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ export declare const slugResourceKindValues: readonly ["team", "space"];
3
+ export declare const slugResourceKind: z.ZodEnum<{
4
+ space: "space";
5
+ team: "team";
6
+ }>;
7
+ export declare const slugAvailabilityQuerySchema: z.ZodObject<{
8
+ kind: z.ZodEnum<{
9
+ space: "space";
10
+ team: "team";
11
+ }>;
12
+ slug: z.ZodDefault<z.ZodString>;
13
+ currentSlug: z.ZodOptional<z.ZodString>;
14
+ teamId: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ export declare const slugAvailabilityResponseSchema: z.ZodObject<{
17
+ kind: z.ZodEnum<{
18
+ space: "space";
19
+ team: "team";
20
+ }>;
21
+ normalizedSlug: z.ZodString;
22
+ available: z.ZodBoolean;
23
+ suggestion: z.ZodNullable<z.ZodString>;
24
+ hostnameAvailable: z.ZodOptional<z.ZodBoolean>;
25
+ hostnameSuggestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ selectedHostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ hostnameConflictReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ globalHostnameAvailable: z.ZodOptional<z.ZodBoolean>;
29
+ globalHostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ globalHostnameSuggestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
+ }, z.core.$strip>;
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+ export const slugResourceKindValues = ["team", "space"];
3
+ export const slugResourceKind = z.enum(slugResourceKindValues);
4
+ export const slugAvailabilityQuerySchema = z.object({
5
+ kind: slugResourceKind,
6
+ slug: z.string().default(""),
7
+ currentSlug: z.string().optional(),
8
+ teamId: z.string().optional(),
9
+ });
10
+ export const slugAvailabilityResponseSchema = z.object({
11
+ kind: slugResourceKind.describe("Resource kind the slug was checked for."),
12
+ normalizedSlug: z.string().describe("Slug after normalization; empty when nothing usable."),
13
+ available: z.boolean().describe("Whether the normalized slug can be used as-is."),
14
+ suggestion: z
15
+ .string()
16
+ .nullable()
17
+ .describe("Closest available slug when the requested one is taken; null when available."),
18
+ hostnameAvailable: z
19
+ .boolean()
20
+ .optional()
21
+ .describe("Whether the normalized slug's managed view.fast hostname can be used as-is."),
22
+ hostnameSuggestion: z
23
+ .string()
24
+ .nullable()
25
+ .optional()
26
+ .describe("Closest available public name when the managed hostname is taken."),
27
+ selectedHostname: z
28
+ .string()
29
+ .nullable()
30
+ .optional()
31
+ .describe("Managed view.fast hostname selected for the requested slug."),
32
+ hostnameConflictReason: z
33
+ .string()
34
+ .nullable()
35
+ .optional()
36
+ .describe("Stable reason code for the selected hostname conflict, when unavailable."),
37
+ globalHostnameAvailable: z
38
+ .boolean()
39
+ .optional()
40
+ .describe("Whether `{slug}.view.fast` is available."),
41
+ globalHostname: z.string().nullable().optional().describe("The global managed hostname checked."),
42
+ globalHostnameSuggestion: z
43
+ .string()
44
+ .nullable()
45
+ .optional()
46
+ .describe("Closest available global public name when `{slug}.view.fast` is taken."),
47
+ });