@spacefast/common 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/connect-targets.d.ts +4 -4
- package/dist/agents/connect-targets.js +3 -3
- package/dist/agents/private-key-oauth.d.ts +37 -0
- package/dist/agents/private-key-oauth.js +158 -0
- package/dist/config/domains.js +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/postgres-budget.d.ts +126 -0
- package/dist/config/postgres-budget.js +135 -0
- package/dist/config/postgres-budget.json +50 -0
- package/dist/contracts/access.d.ts +42 -24
- package/dist/contracts/access.js +73 -34
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +5 -5
- package/dist/contracts/api-keys.d.ts +53 -45
- package/dist/contracts/api-keys.js +1 -0
- package/dist/contracts/archives.d.ts +8 -8
- package/dist/contracts/builds.d.ts +8 -8
- package/dist/contracts/builds.js +28 -48
- package/dist/contracts/channels.js +1 -2
- package/dist/contracts/comments.d.ts +55 -19
- package/dist/contracts/comments.js +56 -17
- package/dist/contracts/common.d.ts +4 -3
- package/dist/contracts/common.js +2 -0
- package/dist/contracts/deployments.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +14 -12
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/domains.d.ts +261 -1330
- package/dist/contracts/domains.js +39 -301
- package/dist/contracts/email-preferences.d.ts +50 -0
- package/dist/contracts/email-preferences.js +44 -0
- package/dist/contracts/enums.d.ts +1 -1
- package/dist/contracts/error-code-meta.d.ts +84 -15
- package/dist/contracts/error-code-meta.js +28 -4
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +24 -6
- package/dist/contracts/events.d.ts +13 -13
- package/dist/contracts/feature-lifecycle.d.ts +644 -2
- package/dist/contracts/feature-lifecycle.js +685 -2
- package/dist/contracts/features.d.ts +236 -24
- package/dist/contracts/features.js +3 -272
- package/dist/contracts/ids.d.ts +1 -2
- package/dist/contracts/ids.js +1 -2
- package/dist/contracts/internal.d.ts +3 -3
- package/dist/contracts/mcp.d.ts +6 -6
- package/dist/contracts/me.js +1 -1
- package/dist/contracts/mounts.d.ts +142 -0
- package/dist/contracts/mounts.js +56 -0
- package/dist/contracts/oauth-resources.d.ts +5 -5
- package/dist/contracts/oauth-resources.js +1 -0
- package/dist/contracts/operations.d.ts +2 -2
- package/dist/contracts/pages.d.ts +2 -2
- package/dist/contracts/pages.js +8 -3
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/platform.d.ts +3 -3
- package/dist/contracts/resources.d.ts +12 -20
- package/dist/contracts/resources.js +13 -37
- package/dist/contracts/runtime-api.d.ts +330 -16
- package/dist/contracts/runtime-api.js +58 -14
- package/dist/contracts/sf-config-v1.js +1 -1
- package/dist/contracts/sites.d.ts +12 -12
- package/dist/contracts/sites.js +18 -11
- package/dist/contracts/space-config.d.ts +2 -3
- package/dist/contracts/space-config.js +3 -1
- package/dist/contracts/spaces.d.ts +143 -102
- package/dist/contracts/spaces.js +109 -43
- package/dist/contracts/superadmin-emails.d.ts +25 -1
- package/dist/contracts/superadmin-emails.js +10 -15
- package/dist/contracts/superadmin-runtime.d.ts +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +6 -14
- package/dist/contracts/tags.d.ts +43 -13
- package/dist/contracts/tags.js +195 -11
- package/dist/contracts/transfers.d.ts +1 -1
- package/dist/contracts/variables.d.ts +4 -4
- package/dist/contracts/variables.js +4 -3
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +329 -7
- package/dist/contracts/zero.js +121 -2
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/docs/agent-setup.d.ts +4 -2
- package/dist/docs/agent-setup.js +15 -7
- package/dist/docs/agent-solutions.js +1 -1
- package/dist/docs/catalog.d.ts +8 -10
- package/dist/docs/catalog.js +8 -10
- package/dist/docs/error-docs.js +86 -18
- package/dist/utils/access-grant.d.ts +14 -0
- package/dist/utils/access-grant.js +88 -0
- package/dist/utils/access-match.d.ts +7 -0
- package/dist/utils/access-match.fixtures.json +513 -0
- package/dist/utils/access-match.js +32 -16
- package/dist/utils/access-verdict.fixtures.json +421 -0
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/dns-instructions.d.ts +29 -0
- package/dist/utils/dns-instructions.js +78 -0
- package/dist/utils/domain-diagnostics.d.ts +29 -0
- package/dist/utils/domain-diagnostics.js +63 -0
- package/dist/utils/egress-policy.fixtures.json +51 -0
- package/dist/utils/id-hints.d.ts +1 -0
- package/dist/utils/id-hints.js +55 -13
- package/dist/utils/page-colors.d.ts +50 -0
- package/dist/utils/page-colors.js +167 -0
- package/dist/utils/page-fonts.d.ts +2 -0
- package/dist/utils/page-fonts.js +4 -0
- package/dist/utils/pages.d.ts +8 -1
- package/dist/utils/pages.js +123 -37
- package/dist/utils/production-runtime.d.ts +18 -0
- package/dist/utils/production-runtime.js +28 -0
- package/dist/utils/query-keys.d.ts +6 -7
- package/dist/utils/query-keys.js +11 -12
- package/dist/utils/sf-config-v1.fixtures.json +9 -0
- package/dist/utils/sf-config-v1.js +28 -19
- package/dist/utils/source-archive-policy.d.ts +2 -0
- package/dist/utils/source-archive-policy.js +2 -0
- package/dist/utils/static-runtime-policy.fixtures.json +57 -0
- package/dist/utils/static-runtime-policy.js +1 -1
- package/package.json +5 -4
- package/dist/contracts/annotations.d.ts +0 -327
- package/dist/contracts/annotations.js +0 -235
- package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
- package/dist/contracts/generated-feature-launch-entries.js +0 -518
- package/dist/contracts/publishes.d.ts +0 -135
- package/dist/contracts/publishes.js +0 -162
|
@@ -2,10 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
import { AnyObjectSchema, baseDiagnosticSchema, CursorPaginationSchema, cursorListQuerySchema, DnsInstructionSchema, mutationEnvelope, requiredActionsSchema, } from "./common.js";
|
|
3
3
|
import { PrincipalRefSchema } from "./resources.js";
|
|
4
4
|
// ---------------------------------------------------------------------------
|
|
5
|
-
// Domain resource (internal-docs/platform.md L2387-2431).
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// lives on DomainBinding, provider assignment on SiteDomainAssignment.
|
|
5
|
+
// Domain resource (internal-docs/platform.md L2387-2431). A canonical name
|
|
6
|
+
// owned by a tenant-local principal, plus its registrar/DNS facets and THE
|
|
7
|
+
// serving pointer/whole-host redirect intent.
|
|
9
8
|
// ---------------------------------------------------------------------------
|
|
10
9
|
// Registration (who you pay) facet — present only on apex records.
|
|
11
10
|
export const domainRegistrarFacetSchema = z.object({
|
|
@@ -159,6 +158,26 @@ export const domainHintSchema = z.object({
|
|
|
159
158
|
providerRequestId: z.string().optional(),
|
|
160
159
|
expiresAt: z.string().datetime().optional(),
|
|
161
160
|
});
|
|
161
|
+
export const domainRedirectTargetSchema = z
|
|
162
|
+
.union([
|
|
163
|
+
z.object({
|
|
164
|
+
url: z.string().url().describe("Absolute URL to redirect to."),
|
|
165
|
+
}),
|
|
166
|
+
z.object({
|
|
167
|
+
spaceId: z.string().min(1).describe("Space to redirect to (`spc_...`)."),
|
|
168
|
+
path: z.string().max(255).optional().describe("Path on the target space."),
|
|
169
|
+
}),
|
|
170
|
+
])
|
|
171
|
+
.describe("Redirect destination: an absolute URL, or a space (optionally with a path).");
|
|
172
|
+
export const domainRedirectStatusSchema = z
|
|
173
|
+
.union([z.literal(301), z.literal(302), z.literal(307), z.literal(308)])
|
|
174
|
+
.describe("HTTP redirect status; defaults to 308.");
|
|
175
|
+
// A domain either serves its Space or redirects away from it — whole-host
|
|
176
|
+
// only. Path-level routing belongs in the serving Space's `_redirects`.
|
|
177
|
+
export const domainRedirectSchema = z.object({
|
|
178
|
+
to: domainRedirectTargetSchema,
|
|
179
|
+
status: domainRedirectStatusSchema,
|
|
180
|
+
});
|
|
162
181
|
export const DomainSchema = z.object({
|
|
163
182
|
id: z.string().describe("Domain inventory record id (`dom_...`)."),
|
|
164
183
|
tenantId: z.string().describe("Tenant that owns this record (`ten_...`)."),
|
|
@@ -175,7 +194,17 @@ export const DomainSchema = z.object({
|
|
|
175
194
|
.describe("Derived, never create input: `apex` iff `name` equals `derivedGroup`."),
|
|
176
195
|
wildcardEnabled: z
|
|
177
196
|
.boolean()
|
|
178
|
-
.describe("Whether wildcard
|
|
197
|
+
.describe("Whether wildcard hostnames may be derived from this record."),
|
|
198
|
+
spaceId: z
|
|
199
|
+
.string()
|
|
200
|
+
.nullable()
|
|
201
|
+
.describe("Space this hostname selects (`spc_...`), or null when the record is inventory only. One Space per hostname; a Space may hold many domains."),
|
|
202
|
+
primary: z
|
|
203
|
+
.boolean()
|
|
204
|
+
.describe("Whether this domain is its Space's primary hostname (feeds `liveUrl`)."),
|
|
205
|
+
redirect: domainRedirectSchema
|
|
206
|
+
.optional()
|
|
207
|
+
.describe("Whole-host redirect target; present only on redirecting domains."),
|
|
179
208
|
derivedGroup: z
|
|
180
209
|
.string()
|
|
181
210
|
.describe("PSL registrable domain of `name`; server-computed, never client-supplied."),
|
|
@@ -205,7 +234,7 @@ export const spaceCustomDomainSchema = DomainSchema.extend({
|
|
|
205
234
|
managed: z.literal(false),
|
|
206
235
|
deletable: z.literal(true),
|
|
207
236
|
assignable: z.literal(true),
|
|
208
|
-
primary: z.boolean().describe("Whether this custom domain
|
|
237
|
+
primary: z.boolean().describe("Whether this custom domain is the space's primary URL."),
|
|
209
238
|
});
|
|
210
239
|
export const spaceManagedDomainSchema = z.object({
|
|
211
240
|
id: z.string().describe("Stable managed row id derived from the default hostname row."),
|
|
@@ -268,299 +297,6 @@ export const domainPatchSchema = z
|
|
|
268
297
|
message: "At least one domain field is required.",
|
|
269
298
|
});
|
|
270
299
|
// ---------------------------------------------------------------------------
|
|
271
|
-
// DomainBinding (internal-docs/platform.md L2466-2498): a discriminated union
|
|
272
|
-
// on `mode` — serve a space, redirect, or proxy an upstream.
|
|
273
|
-
// ---------------------------------------------------------------------------
|
|
274
|
-
// DomainBindingDiagnostic (L2508-2510): the shared Diagnostic shape plus a
|
|
275
|
-
// binding-specific suggested `action`.
|
|
276
|
-
export const domainBindingDiagnosticSchema = baseDiagnosticSchema.extend({
|
|
277
|
-
action: z
|
|
278
|
-
.enum(["add_dns", "wait", "verify", "confirm_move", "remove_conflict", "contact_support"])
|
|
279
|
-
.optional()
|
|
280
|
-
.describe("Suggested next step to resolve this binding diagnostic."),
|
|
281
|
-
});
|
|
282
|
-
export const domainBindingConflictSchema = z.object({
|
|
283
|
-
id: z.string().describe("Stable conflict id, passed back in activation `confirm`."),
|
|
284
|
-
scope: z
|
|
285
|
-
.enum(["same_space", "same_principal", "same_tenant", "external"])
|
|
286
|
-
.describe("Who holds the overlapping claim, relative to the caller."),
|
|
287
|
-
hostname: z.string().describe("Hostname both claims target."),
|
|
288
|
-
pathPrefix: z.string().optional().describe("Conflicting path scope, when path-based."),
|
|
289
|
-
existingBindingId: z.string().optional().describe("The incumbent binding, when visible."),
|
|
290
|
-
resolution: z
|
|
291
|
-
.enum([
|
|
292
|
-
"activate_moves_existing",
|
|
293
|
-
"choose_different_path",
|
|
294
|
-
"verify_to_takeover",
|
|
295
|
-
"cannot_resolve",
|
|
296
|
-
])
|
|
297
|
-
.optional()
|
|
298
|
-
.describe("How this conflict can be resolved."),
|
|
299
|
-
});
|
|
300
|
-
export const domainBindingStatusSchema = z
|
|
301
|
-
.enum(["draft", "pending", "blocked", "activating", "active", "failed", "deleted"])
|
|
302
|
-
.describe("Binding lifecycle status; the binding is the pollable resource for activation.");
|
|
303
|
-
const domainBindingBaseFields = {
|
|
304
|
-
id: z.string().describe("Domain binding id (`dbn_...`)."),
|
|
305
|
-
tenantId: z.string().describe("Tenant the binding belongs to (`ten_...`)."),
|
|
306
|
-
domainId: z.string().describe("Domain inventory record this binding routes (`dom_...`)."),
|
|
307
|
-
siteDomainAssignmentId: z
|
|
308
|
-
.string()
|
|
309
|
-
.nullable()
|
|
310
|
-
.describe("Provider assignment serving this hostname, once linked (`sda_...`)."),
|
|
311
|
-
hostname: z.string().describe("Hostname this binding claims (copied from the domain)."),
|
|
312
|
-
pathPrefix: z
|
|
313
|
-
.string()
|
|
314
|
-
.nullable()
|
|
315
|
-
.describe("Path scope like `/docs`; null claims the whole host. More specific paths win."),
|
|
316
|
-
wildcard: z
|
|
317
|
-
.boolean()
|
|
318
|
-
.describe("Whether this binding captures subdomains (requires domain wildcardEnabled)."),
|
|
319
|
-
status: domainBindingStatusSchema,
|
|
320
|
-
diagnostics: z
|
|
321
|
-
.array(domainBindingDiagnosticSchema)
|
|
322
|
-
.describe("Structured diagnostics with stable codes and suggested actions."),
|
|
323
|
-
requiredActions: requiredActionsSchema,
|
|
324
|
-
conflicts: z
|
|
325
|
-
.array(domainBindingConflictSchema)
|
|
326
|
-
.describe("Unresolved overlapping claims; conflicts block instead of dead-ending."),
|
|
327
|
-
providerState: AnyObjectSchema.describe("Raw provider-side state, for diagnostics only."),
|
|
328
|
-
createdAt: z.string().datetime().describe("When the binding was created."),
|
|
329
|
-
updatedAt: z.string().datetime().describe("When the binding last changed."),
|
|
330
|
-
};
|
|
331
|
-
export const domainBindingRedirectTargetSchema = z
|
|
332
|
-
.union([
|
|
333
|
-
z.object({
|
|
334
|
-
url: z.string().url().describe("Absolute URL to redirect to."),
|
|
335
|
-
}),
|
|
336
|
-
z.object({
|
|
337
|
-
spaceId: z.string().min(1).describe("Space to redirect to (`spc_...`)."),
|
|
338
|
-
path: z.string().max(255).optional().describe("Path on the target space."),
|
|
339
|
-
}),
|
|
340
|
-
])
|
|
341
|
-
.describe("Redirect destination: an absolute URL, or a space (optionally with a path).");
|
|
342
|
-
export const domainBindingRedirectStatusSchema = z
|
|
343
|
-
.union([z.literal(301), z.literal(302), z.literal(307), z.literal(308)])
|
|
344
|
-
.describe("HTTP redirect status; defaults to 308.");
|
|
345
|
-
export const domainBindingSchema = z.discriminatedUnion("mode", [
|
|
346
|
-
z.object({
|
|
347
|
-
...domainBindingBaseFields,
|
|
348
|
-
mode: z.literal("serve").describe("Serve a space's content on this hostname/path."),
|
|
349
|
-
spaceId: z.string().describe("Space served by this binding (`spc_...`)."),
|
|
350
|
-
channel: z.string().describe('Channel served on this hostname; defaults to "live".'),
|
|
351
|
-
primary: z
|
|
352
|
-
.boolean()
|
|
353
|
-
.describe("One primary hostname per space; the primary binding feeds `liveUrl`."),
|
|
354
|
-
}),
|
|
355
|
-
z.object({
|
|
356
|
-
...domainBindingBaseFields,
|
|
357
|
-
mode: z.literal("redirect").describe("Redirect requests to a URL or another space."),
|
|
358
|
-
to: domainBindingRedirectTargetSchema,
|
|
359
|
-
redirectStatus: domainBindingRedirectStatusSchema,
|
|
360
|
-
}),
|
|
361
|
-
z.object({
|
|
362
|
-
...domainBindingBaseFields,
|
|
363
|
-
mode: z.literal("proxy").describe("Proxy requests to an external upstream."),
|
|
364
|
-
upstream: z.object({
|
|
365
|
-
url: z.string().url().describe("Absolute upstream URL requests are proxied to."),
|
|
366
|
-
}),
|
|
367
|
-
}),
|
|
368
|
-
]);
|
|
369
|
-
function requireBindingModeFields(value, ctx) {
|
|
370
|
-
if (value.mode === "redirect" && value.to === undefined) {
|
|
371
|
-
ctx.addIssue({ code: "custom", path: ["to"], message: "Redirect bindings require `to`." });
|
|
372
|
-
}
|
|
373
|
-
if (value.mode === "proxy" && value.upstream === undefined) {
|
|
374
|
-
ctx.addIssue({
|
|
375
|
-
code: "custom",
|
|
376
|
-
path: ["upstream"],
|
|
377
|
-
message: "Proxy bindings require `upstream`.",
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
if (value.mode !== "redirect" && (value.to !== undefined || value.redirectStatus !== undefined)) {
|
|
381
|
-
ctx.addIssue({
|
|
382
|
-
code: "custom",
|
|
383
|
-
path: ["to"],
|
|
384
|
-
message: "`to`/`redirectStatus` apply only to redirect bindings.",
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
if (value.mode !== "proxy" && value.upstream !== undefined) {
|
|
388
|
-
ctx.addIssue({
|
|
389
|
-
code: "custom",
|
|
390
|
-
path: ["upstream"],
|
|
391
|
-
message: "`upstream` applies only to proxy bindings.",
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
if (value.mode === "serve" || value.mode === undefined) {
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
if (value.channel !== undefined || value.primary !== undefined) {
|
|
398
|
-
ctx.addIssue({
|
|
399
|
-
code: "custom",
|
|
400
|
-
path: ["channel"],
|
|
401
|
-
message: "`channel`/`primary` apply only to serve bindings.",
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
// One POST end to end (charter D5): pass `hostname` and the Domain inventory
|
|
406
|
-
// record is auto-created for the space's principal — no separate create-domain
|
|
407
|
-
// step. Pass `domainId` to bind an existing inventory record instead.
|
|
408
|
-
export const domainBindingCreateSchema = z
|
|
409
|
-
.object({
|
|
410
|
-
domainId: z
|
|
411
|
-
.string()
|
|
412
|
-
.min(1)
|
|
413
|
-
.optional()
|
|
414
|
-
.describe("Existing domain inventory record to bind (`dom_...`)."),
|
|
415
|
-
hostname: z
|
|
416
|
-
.string()
|
|
417
|
-
.trim()
|
|
418
|
-
.min(1)
|
|
419
|
-
.max(253)
|
|
420
|
-
.optional()
|
|
421
|
-
.describe("Hostname to bind. Auto-creates the Domain inventory record for the space's team when none exists."),
|
|
422
|
-
spaceId: z
|
|
423
|
-
.string()
|
|
424
|
-
.min(1)
|
|
425
|
-
.describe("Space this hostname is anchored to: the serve target, or for redirect/proxy bindings the space whose site serves the hostname."),
|
|
426
|
-
mode: z
|
|
427
|
-
.enum(["serve", "redirect", "proxy"])
|
|
428
|
-
.default("serve")
|
|
429
|
-
.describe("Routing intent: serve a space, redirect, or proxy an upstream."),
|
|
430
|
-
pathPrefix: z
|
|
431
|
-
.string()
|
|
432
|
-
.trim()
|
|
433
|
-
.max(255)
|
|
434
|
-
.nullable()
|
|
435
|
-
.optional()
|
|
436
|
-
.describe("Path scope like `/docs`; omit to claim the whole host."),
|
|
437
|
-
wildcard: z
|
|
438
|
-
.boolean()
|
|
439
|
-
.optional()
|
|
440
|
-
.describe("Capture subdomains too (requires domain wildcardEnabled)."),
|
|
441
|
-
channel: z
|
|
442
|
-
.string()
|
|
443
|
-
.trim()
|
|
444
|
-
.min(1)
|
|
445
|
-
.max(64)
|
|
446
|
-
.optional()
|
|
447
|
-
.describe('Channel to serve (serve mode); defaults to "live".'),
|
|
448
|
-
primary: z
|
|
449
|
-
.boolean()
|
|
450
|
-
.optional()
|
|
451
|
-
.describe("Make this the space's primary hostname (serve mode)."),
|
|
452
|
-
to: domainBindingRedirectTargetSchema.optional(),
|
|
453
|
-
redirectStatus: domainBindingRedirectStatusSchema.optional(),
|
|
454
|
-
upstream: z
|
|
455
|
-
.object({ url: z.string().url().describe("Absolute upstream URL.") })
|
|
456
|
-
.optional()
|
|
457
|
-
.describe("Proxy upstream (proxy mode)."),
|
|
458
|
-
})
|
|
459
|
-
.superRefine((value, ctx) => {
|
|
460
|
-
if (!value.domainId && !value.hostname) {
|
|
461
|
-
ctx.addIssue({
|
|
462
|
-
code: "custom",
|
|
463
|
-
path: ["hostname"],
|
|
464
|
-
message: "Pass `hostname` (auto-creates the domain) or `domainId`.",
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
if (value.domainId && value.hostname) {
|
|
468
|
-
ctx.addIssue({
|
|
469
|
-
code: "custom",
|
|
470
|
-
path: ["domainId"],
|
|
471
|
-
message: "Pass either `domainId` or `hostname`, not both.",
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
requireBindingModeFields(value, ctx);
|
|
475
|
-
});
|
|
476
|
-
export const domainBindingPatchSchema = z
|
|
477
|
-
.object({
|
|
478
|
-
mode: z
|
|
479
|
-
.enum(["serve", "redirect", "proxy"])
|
|
480
|
-
.optional()
|
|
481
|
-
.describe("Switch the routing intent; the new mode's fields are required alongside."),
|
|
482
|
-
pathPrefix: z.string().trim().max(255).nullable().optional().describe("New path scope."),
|
|
483
|
-
wildcard: z.boolean().optional().describe("Toggle subdomain capture."),
|
|
484
|
-
channel: z.string().trim().min(1).max(64).optional().describe("Channel to serve (serve mode)."),
|
|
485
|
-
primary: z
|
|
486
|
-
.boolean()
|
|
487
|
-
.optional()
|
|
488
|
-
.describe("Promote to the space's primary hostname (serve mode)."),
|
|
489
|
-
to: domainBindingRedirectTargetSchema.optional(),
|
|
490
|
-
redirectStatus: domainBindingRedirectStatusSchema.optional(),
|
|
491
|
-
upstream: z
|
|
492
|
-
.object({ url: z.string().url().describe("Absolute upstream URL.") })
|
|
493
|
-
.optional()
|
|
494
|
-
.describe("Proxy upstream (proxy mode)."),
|
|
495
|
-
})
|
|
496
|
-
.superRefine((value, ctx) => {
|
|
497
|
-
if (Object.keys(value).length === 0) {
|
|
498
|
-
ctx.addIssue({ code: "custom", message: "At least one binding field is required." });
|
|
499
|
-
}
|
|
500
|
-
if (value.mode !== undefined) {
|
|
501
|
-
requireBindingModeFields(value, ctx);
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
// Binding activation is asynchronous; the binding is the pollable status
|
|
505
|
-
// resource. `confirm` carries conflict ids whose `confirm_move` resolution the
|
|
506
|
-
// caller accepts — activation performs the move (no public move API).
|
|
507
|
-
export const domainBindingActivateSchema = z.object({
|
|
508
|
-
confirm: z
|
|
509
|
-
.array(z.string())
|
|
510
|
-
.default([])
|
|
511
|
-
.describe("Conflict ids whose `activate_moves_existing` resolution the caller confirms."),
|
|
512
|
-
});
|
|
513
|
-
// Activation is asynchronous: the binding is the pollable status resource and
|
|
514
|
-
// `operation` tracks the work item (standard mutation envelope).
|
|
515
|
-
export const domainBindingActivateResponseSchema = mutationEnvelope(domainBindingSchema);
|
|
516
|
-
export const domainBindingListResponseSchema = z.object({
|
|
517
|
-
data: z.array(domainBindingSchema),
|
|
518
|
-
pagination: CursorPaginationSchema,
|
|
519
|
-
});
|
|
520
|
-
export const domainBindingListQuerySchema = cursorListQuerySchema;
|
|
521
|
-
// ---------------------------------------------------------------------------
|
|
522
|
-
// SiteDomainAssignment (internal-docs/platform.md L2445-2464): provider
|
|
523
|
-
// assignment of a hostname to a unified site. Mostly provider state managed by
|
|
524
|
-
// bindings; POST/DELETE exist as the canonical explicit mutation surface.
|
|
525
|
-
// ---------------------------------------------------------------------------
|
|
526
|
-
export const siteDomainAssignmentSchema = z.object({
|
|
527
|
-
id: z.string().describe("Site domain assignment id (`sda_...`)."),
|
|
528
|
-
tenantId: z.string().describe("Tenant the assignment belongs to (`ten_...`)."),
|
|
529
|
-
domainId: z.string().describe("Domain inventory record this hostname belongs to (`dom_...`)."),
|
|
530
|
-
siteId: z.string().nullable().describe("Unified site (`site_...`) the hostname is assigned to."),
|
|
531
|
-
hostname: z.string().describe("Hostname assigned at the provider."),
|
|
532
|
-
status: z
|
|
533
|
-
.enum([
|
|
534
|
-
"unassigned",
|
|
535
|
-
"pending_provider",
|
|
536
|
-
"pending_dns",
|
|
537
|
-
"pending_ssl",
|
|
538
|
-
"active",
|
|
539
|
-
"blocked",
|
|
540
|
-
"failed",
|
|
541
|
-
])
|
|
542
|
-
.describe("Provider assignment status; the assignment is pollable during activation."),
|
|
543
|
-
dnsInstructions: z
|
|
544
|
-
.array(DnsInstructionSchema)
|
|
545
|
-
.describe("DNS records required for this hostname to route and verify."),
|
|
546
|
-
providerState: AnyObjectSchema.describe("Raw provider-side state, for diagnostics only."),
|
|
547
|
-
diagnostics: z
|
|
548
|
-
.array(baseDiagnosticSchema)
|
|
549
|
-
.describe("Structured assignment diagnostics with stable codes."),
|
|
550
|
-
createdAt: z.string().datetime().describe("When the assignment was created."),
|
|
551
|
-
updatedAt: z.string().datetime().describe("When the assignment last changed."),
|
|
552
|
-
});
|
|
553
|
-
export const siteDomainAssignmentCreateSchema = z.object({
|
|
554
|
-
spaceId: z
|
|
555
|
-
.string()
|
|
556
|
-
.min(1)
|
|
557
|
-
.describe("Space whose site this domain's hostname is assigned to (`spc_...`)."),
|
|
558
|
-
});
|
|
559
|
-
export const siteDomainAssignmentListResponseSchema = z.object({
|
|
560
|
-
data: z.array(siteDomainAssignmentSchema),
|
|
561
|
-
pagination: CursorPaginationSchema,
|
|
562
|
-
});
|
|
563
|
-
// ---------------------------------------------------------------------------
|
|
564
300
|
// Registrar facet routes (feature-flagged dev-only per charter D5).
|
|
565
301
|
// ---------------------------------------------------------------------------
|
|
566
302
|
export const domainRegistrationSchema = z.object({
|
|
@@ -1414,13 +1150,15 @@ export const domainHostnameDiagnosticsSchema = z.object({
|
|
|
1414
1150
|
.describe("Provider IPs the hostname should point at."),
|
|
1415
1151
|
verificationCode: z.string().nullable().describe("Expected TXT verification value."),
|
|
1416
1152
|
dnsInstructions: z
|
|
1417
|
-
.array(
|
|
1153
|
+
.array(DnsInstructionSchema)
|
|
1418
1154
|
.default([])
|
|
1419
1155
|
.describe("DNS records required for this hostname."),
|
|
1420
1156
|
dns: z.object({
|
|
1421
1157
|
observedAt: z.string().datetime(),
|
|
1422
1158
|
expectedTxtValue: z.string().nullable(),
|
|
1423
|
-
pointsToProvider: z
|
|
1159
|
+
pointsToProvider: z
|
|
1160
|
+
.boolean()
|
|
1161
|
+
.describe("Whether every provider-supported address family points at the provider."),
|
|
1424
1162
|
proxyDetected: z.boolean().nullable().describe("Whether observed A records look proxied."),
|
|
1425
1163
|
txtVerified: z.boolean().nullable().describe("Whether the verification TXT is observed."),
|
|
1426
1164
|
hasAaaaRecords: z.boolean(),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const emailCategoryValues: readonly ["transactional", "announcements", "offers", "system", "invites"];
|
|
3
|
+
export type EmailCategory = (typeof emailCategoryValues)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Recipient controls are deliberately independent from the mail category.
|
|
6
|
+
* A transactional notification can still belong to a controllable topic,
|
|
7
|
+
* while essential authentication mail has no topic at all.
|
|
8
|
+
*/
|
|
9
|
+
export declare const emailPreferenceTopicValues: readonly ["system", "invites", "announcements", "offers"];
|
|
10
|
+
export type EmailPreferenceTopic = (typeof emailPreferenceTopicValues)[number];
|
|
11
|
+
export declare const emailPreferenceTopicPolicy: {
|
|
12
|
+
readonly system: {
|
|
13
|
+
readonly subscribedByDefault: true;
|
|
14
|
+
readonly reportAbuse: false;
|
|
15
|
+
};
|
|
16
|
+
readonly invites: {
|
|
17
|
+
readonly subscribedByDefault: true;
|
|
18
|
+
readonly reportAbuse: true;
|
|
19
|
+
};
|
|
20
|
+
readonly announcements: {
|
|
21
|
+
readonly subscribedByDefault: true;
|
|
22
|
+
readonly reportAbuse: false;
|
|
23
|
+
};
|
|
24
|
+
readonly offers: {
|
|
25
|
+
readonly subscribedByDefault: false;
|
|
26
|
+
readonly reportAbuse: false;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const emailPreferenceSourceValues: readonly ["one_click", "landing", "dashboard", "ses_subscription", "admin"];
|
|
30
|
+
export declare const emailPreferencesSchema: z.ZodObject<{
|
|
31
|
+
system: z.ZodBoolean;
|
|
32
|
+
invites: z.ZodBoolean;
|
|
33
|
+
announcements: z.ZodBoolean;
|
|
34
|
+
offers: z.ZodBoolean;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export declare const emailPreferencesUpdateSchema: z.ZodObject<{
|
|
37
|
+
system: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
invites: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
announcements: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
offers: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type EmailPreferences = z.infer<typeof emailPreferencesSchema>;
|
|
43
|
+
export type EmailPreferencesUpdate = z.infer<typeof emailPreferencesUpdateSchema>;
|
|
44
|
+
export declare const emailSuppressionReasonValues: readonly ["complaint", "hard_bounce", "manual"];
|
|
45
|
+
export type EmailSuppressionReason = (typeof emailSuppressionReasonValues)[number];
|
|
46
|
+
export declare const emailSuppressionStrength: {
|
|
47
|
+
readonly complaint: 1;
|
|
48
|
+
readonly hard_bounce: 2;
|
|
49
|
+
readonly manual: 3;
|
|
50
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// The canonical category set. superadmin-emails.ts re-exports this as
|
|
3
|
+
// superadminEmailCategoryValues — email-preferences must stay import-free
|
|
4
|
+
// within contracts (it is the foundational email contract; importing back
|
|
5
|
+
// from superadmin-emails created a circular-init TDZ crash in dist).
|
|
6
|
+
export const emailCategoryValues = [
|
|
7
|
+
"transactional",
|
|
8
|
+
"announcements",
|
|
9
|
+
"offers",
|
|
10
|
+
"system",
|
|
11
|
+
"invites",
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* Recipient controls are deliberately independent from the mail category.
|
|
15
|
+
* A transactional notification can still belong to a controllable topic,
|
|
16
|
+
* while essential authentication mail has no topic at all.
|
|
17
|
+
*/
|
|
18
|
+
export const emailPreferenceTopicValues = ["system", "invites", "announcements", "offers"];
|
|
19
|
+
export const emailPreferenceTopicPolicy = {
|
|
20
|
+
system: { subscribedByDefault: true, reportAbuse: false },
|
|
21
|
+
invites: { subscribedByDefault: true, reportAbuse: true },
|
|
22
|
+
announcements: { subscribedByDefault: true, reportAbuse: false },
|
|
23
|
+
offers: { subscribedByDefault: false, reportAbuse: false },
|
|
24
|
+
};
|
|
25
|
+
export const emailPreferenceSourceValues = [
|
|
26
|
+
"one_click",
|
|
27
|
+
"landing",
|
|
28
|
+
"dashboard",
|
|
29
|
+
"ses_subscription",
|
|
30
|
+
"admin",
|
|
31
|
+
];
|
|
32
|
+
export const emailPreferencesSchema = z.object({
|
|
33
|
+
system: z.boolean(),
|
|
34
|
+
invites: z.boolean(),
|
|
35
|
+
announcements: z.boolean(),
|
|
36
|
+
offers: z.boolean(),
|
|
37
|
+
});
|
|
38
|
+
export const emailPreferencesUpdateSchema = emailPreferencesSchema.partial();
|
|
39
|
+
export const emailSuppressionReasonValues = ["complaint", "hard_bounce", "manual"];
|
|
40
|
+
export const emailSuppressionStrength = {
|
|
41
|
+
complaint: 1,
|
|
42
|
+
hard_bounce: 2,
|
|
43
|
+
manual: 3,
|
|
44
|
+
};
|
|
@@ -125,8 +125,8 @@ export declare const buildStatus: z.ZodEnum<{
|
|
|
125
125
|
}>;
|
|
126
126
|
export declare const diagnosticSeverity: z.ZodEnum<{
|
|
127
127
|
info: "info";
|
|
128
|
-
warning: "warning";
|
|
129
128
|
error: "error";
|
|
129
|
+
warning: "warning";
|
|
130
130
|
}>;
|
|
131
131
|
export declare const diagnosticProvider: z.ZodEnum<{
|
|
132
132
|
registrar: "registrar";
|
|
@@ -39,6 +39,10 @@ export declare const ERROR_CODE_META: {
|
|
|
39
39
|
readonly retryable: false;
|
|
40
40
|
readonly recovery: "fix_input";
|
|
41
41
|
};
|
|
42
|
+
readonly agent_handoff_origin_unsupported: {
|
|
43
|
+
readonly retryable: false;
|
|
44
|
+
readonly recovery: "contact_support";
|
|
45
|
+
};
|
|
42
46
|
readonly ambiguous_space_slug: {
|
|
43
47
|
readonly retryable: false;
|
|
44
48
|
readonly recovery: "fix_input";
|
|
@@ -228,9 +232,9 @@ export declare const ERROR_CODE_META: {
|
|
|
228
232
|
readonly retryable: false;
|
|
229
233
|
readonly recovery: "contact_support";
|
|
230
234
|
};
|
|
231
|
-
readonly
|
|
232
|
-
readonly retryable:
|
|
233
|
-
readonly recovery: "
|
|
235
|
+
readonly custom_certificates_require_dedicated_site: {
|
|
236
|
+
readonly retryable: false;
|
|
237
|
+
readonly recovery: "fix_input";
|
|
234
238
|
};
|
|
235
239
|
readonly data_location_immutable: {
|
|
236
240
|
readonly retryable: false;
|
|
@@ -496,6 +500,10 @@ export declare const ERROR_CODE_META: {
|
|
|
496
500
|
readonly retryable: false;
|
|
497
501
|
readonly recovery: "fix_input";
|
|
498
502
|
};
|
|
503
|
+
readonly google_play_webhook_identity_not_configured: {
|
|
504
|
+
readonly retryable: false;
|
|
505
|
+
readonly recovery: "contact_support";
|
|
506
|
+
};
|
|
499
507
|
readonly idempotency_conflict_in_progress: {
|
|
500
508
|
readonly retryable: true;
|
|
501
509
|
readonly recovery: "wait";
|
|
@@ -564,6 +572,10 @@ export declare const ERROR_CODE_META: {
|
|
|
564
572
|
readonly retryable: false;
|
|
565
573
|
readonly recovery: "fix_input";
|
|
566
574
|
};
|
|
575
|
+
readonly invalid_google_play_webhook_identity: {
|
|
576
|
+
readonly retryable: false;
|
|
577
|
+
readonly recovery: "re_auth";
|
|
578
|
+
};
|
|
567
579
|
readonly invalid_grant: {
|
|
568
580
|
readonly retryable: false;
|
|
569
581
|
readonly recovery: "re_auth";
|
|
@@ -704,6 +716,11 @@ export declare const ERROR_CODE_META: {
|
|
|
704
716
|
readonly retryable: false;
|
|
705
717
|
readonly recovery: "fix_input";
|
|
706
718
|
};
|
|
719
|
+
readonly maintenance_in_progress: {
|
|
720
|
+
readonly retryable: true;
|
|
721
|
+
readonly recovery: "wait";
|
|
722
|
+
readonly next: readonly ["Retry after the Retry-After seconds"];
|
|
723
|
+
};
|
|
707
724
|
readonly mcp_acted_for_team_deleted: {
|
|
708
725
|
readonly retryable: false;
|
|
709
726
|
readonly recovery: "fix_input";
|
|
@@ -981,6 +998,10 @@ export declare const ERROR_CODE_META: {
|
|
|
981
998
|
readonly retryable: false;
|
|
982
999
|
readonly recovery: "fix_input";
|
|
983
1000
|
};
|
|
1001
|
+
readonly service_signature_invalid: {
|
|
1002
|
+
readonly retryable: false;
|
|
1003
|
+
readonly recovery: "re_auth";
|
|
1004
|
+
};
|
|
984
1005
|
readonly site_already_deleted: {
|
|
985
1006
|
readonly retryable: false;
|
|
986
1007
|
readonly recovery: "fix_input";
|
|
@@ -1022,6 +1043,18 @@ export declare const ERROR_CODE_META: {
|
|
|
1022
1043
|
readonly retryable: false;
|
|
1023
1044
|
readonly recovery: "fix_input";
|
|
1024
1045
|
};
|
|
1046
|
+
readonly source_archive_decompression_timeout: {
|
|
1047
|
+
readonly retryable: true;
|
|
1048
|
+
readonly recovery: "retry";
|
|
1049
|
+
};
|
|
1050
|
+
readonly source_archive_expansion_ratio_exceeded: {
|
|
1051
|
+
readonly retryable: false;
|
|
1052
|
+
readonly recovery: "fix_input";
|
|
1053
|
+
};
|
|
1054
|
+
readonly source_archive_validation_busy: {
|
|
1055
|
+
readonly retryable: true;
|
|
1056
|
+
readonly recovery: "wait";
|
|
1057
|
+
};
|
|
1025
1058
|
readonly space_already_claimed: {
|
|
1026
1059
|
readonly retryable: false;
|
|
1027
1060
|
readonly recovery: "fix_input";
|
|
@@ -1112,6 +1145,34 @@ export declare const ERROR_CODE_META: {
|
|
|
1112
1145
|
readonly retryable: false;
|
|
1113
1146
|
readonly recovery: "fix_input";
|
|
1114
1147
|
};
|
|
1148
|
+
readonly static_mount_path_conflict: {
|
|
1149
|
+
readonly retryable: false;
|
|
1150
|
+
readonly recovery: "fix_input";
|
|
1151
|
+
};
|
|
1152
|
+
readonly static_mount_source_not_ready: {
|
|
1153
|
+
readonly retryable: true;
|
|
1154
|
+
readonly recovery: "wait";
|
|
1155
|
+
};
|
|
1156
|
+
readonly static_mount_target_forbidden: {
|
|
1157
|
+
readonly retryable: false;
|
|
1158
|
+
readonly recovery: "re_auth";
|
|
1159
|
+
};
|
|
1160
|
+
readonly static_mount_target_in_use: {
|
|
1161
|
+
readonly retryable: false;
|
|
1162
|
+
readonly recovery: "fix_input";
|
|
1163
|
+
};
|
|
1164
|
+
readonly static_mount_target_not_live: {
|
|
1165
|
+
readonly retryable: false;
|
|
1166
|
+
readonly recovery: "fix_input";
|
|
1167
|
+
};
|
|
1168
|
+
readonly static_mount_target_not_ready: {
|
|
1169
|
+
readonly retryable: true;
|
|
1170
|
+
readonly recovery: "wait";
|
|
1171
|
+
};
|
|
1172
|
+
readonly static_mount_target_not_static: {
|
|
1173
|
+
readonly retryable: false;
|
|
1174
|
+
readonly recovery: "fix_input";
|
|
1175
|
+
};
|
|
1115
1176
|
readonly static_runtime_control_path_not_supported: {
|
|
1116
1177
|
readonly retryable: false;
|
|
1117
1178
|
readonly recovery: "fix_input";
|
|
@@ -1420,10 +1481,6 @@ export declare const ERROR_CODE_META: {
|
|
|
1420
1481
|
readonly retryable: false;
|
|
1421
1482
|
readonly recovery: "fix_input";
|
|
1422
1483
|
};
|
|
1423
|
-
readonly zero_artifact_missing: {
|
|
1424
|
-
readonly retryable: false;
|
|
1425
|
-
readonly recovery: "fix_input";
|
|
1426
|
-
};
|
|
1427
1484
|
readonly zero_artifact_path_invalid: {
|
|
1428
1485
|
readonly retryable: false;
|
|
1429
1486
|
readonly recovery: "fix_input";
|
|
@@ -1432,10 +1489,6 @@ export declare const ERROR_CODE_META: {
|
|
|
1432
1489
|
readonly retryable: false;
|
|
1433
1490
|
readonly recovery: "fix_input";
|
|
1434
1491
|
};
|
|
1435
|
-
readonly zero_artifact_untrusted: {
|
|
1436
|
-
readonly retryable: false;
|
|
1437
|
-
readonly recovery: "fix_input";
|
|
1438
|
-
};
|
|
1439
1492
|
readonly zero_auth_unavailable: {
|
|
1440
1493
|
readonly retryable: false;
|
|
1441
1494
|
readonly recovery: "fix_input";
|
|
@@ -1524,6 +1577,10 @@ export declare const ERROR_CODE_META: {
|
|
|
1524
1577
|
readonly retryable: false;
|
|
1525
1578
|
readonly recovery: "fix_input";
|
|
1526
1579
|
};
|
|
1580
|
+
readonly zero_db_transaction_active: {
|
|
1581
|
+
readonly retryable: false;
|
|
1582
|
+
readonly recovery: "contact_support";
|
|
1583
|
+
};
|
|
1527
1584
|
readonly zero_db_transaction_commit_failed: {
|
|
1528
1585
|
readonly retryable: true;
|
|
1529
1586
|
readonly recovery: "retry";
|
|
@@ -1532,6 +1589,14 @@ export declare const ERROR_CODE_META: {
|
|
|
1532
1589
|
readonly retryable: false;
|
|
1533
1590
|
readonly recovery: "fix_input";
|
|
1534
1591
|
};
|
|
1592
|
+
readonly zero_db_transaction_missing: {
|
|
1593
|
+
readonly retryable: false;
|
|
1594
|
+
readonly recovery: "contact_support";
|
|
1595
|
+
};
|
|
1596
|
+
readonly zero_db_transaction_rollback_failed: {
|
|
1597
|
+
readonly retryable: false;
|
|
1598
|
+
readonly recovery: "contact_support";
|
|
1599
|
+
};
|
|
1535
1600
|
readonly zero_db_transaction_start_failed: {
|
|
1536
1601
|
readonly retryable: true;
|
|
1537
1602
|
readonly recovery: "retry";
|
|
@@ -1636,10 +1701,6 @@ export declare const ERROR_CODE_META: {
|
|
|
1636
1701
|
readonly retryable: false;
|
|
1637
1702
|
readonly recovery: "fix_input";
|
|
1638
1703
|
};
|
|
1639
|
-
readonly zero_lookup_invalid: {
|
|
1640
|
-
readonly retryable: false;
|
|
1641
|
-
readonly recovery: "fix_input";
|
|
1642
|
-
};
|
|
1643
1704
|
readonly zero_method_not_allowed: {
|
|
1644
1705
|
readonly retryable: false;
|
|
1645
1706
|
readonly recovery: "fix_input";
|
|
@@ -1696,6 +1757,14 @@ export declare const ERROR_CODE_META: {
|
|
|
1696
1757
|
readonly retryable: false;
|
|
1697
1758
|
readonly recovery: "fix_input";
|
|
1698
1759
|
};
|
|
1760
|
+
readonly zero_response_header_forbidden: {
|
|
1761
|
+
readonly retryable: false;
|
|
1762
|
+
readonly recovery: "fix_input";
|
|
1763
|
+
};
|
|
1764
|
+
readonly zero_response_header_invalid: {
|
|
1765
|
+
readonly retryable: false;
|
|
1766
|
+
readonly recovery: "fix_input";
|
|
1767
|
+
};
|
|
1699
1768
|
readonly zero_response_too_large: {
|
|
1700
1769
|
readonly retryable: false;
|
|
1701
1770
|
readonly recovery: "fix_input";
|