@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.
- 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 +386 -1183
- package/dist/contracts/access.js +240 -1018
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +11 -19
- package/dist/contracts/api-keys.d.ts +69 -45
- package/dist/contracts/api-keys.js +3 -0
- package/dist/contracts/archives.d.ts +9 -10
- package/dist/contracts/archives.js +4 -6
- 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 +102 -93
- package/dist/contracts/comments.js +121 -63
- package/dist/contracts/common.d.ts +4 -3
- package/dist/contracts/common.js +2 -0
- package/dist/contracts/countries.js +2 -7
- package/dist/contracts/data-source-routes.d.ts +20 -0
- package/dist/contracts/data-source-routes.js +15 -0
- package/dist/contracts/deployments.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +21 -15
- 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 +3 -5
- package/dist/contracts/enums.js +3 -8
- package/dist/contracts/error-code-meta.d.ts +99 -33
- package/dist/contracts/error-code-meta.js +36 -9
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +28 -11
- package/dist/contracts/execution.d.ts +212 -0
- package/dist/contracts/execution.js +288 -0
- package/dist/contracts/feature-lifecycle.d.ts +498 -2
- package/dist/contracts/feature-lifecycle.js +539 -2
- package/dist/contracts/features.d.ts +184 -74
- package/dist/contracts/features.js +4 -303
- package/dist/contracts/functions.d.ts +729 -0
- package/dist/contracts/functions.js +485 -0
- package/dist/contracts/git.d.ts +1 -1
- package/dist/contracts/grants.d.ts +1158 -0
- package/dist/contracts/grants.js +696 -0
- package/dist/contracts/ids.d.ts +6 -5
- package/dist/contracts/ids.js +6 -5
- package/dist/contracts/internal.d.ts +3 -3
- package/dist/contracts/mcp.d.ts +12 -12
- 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 +2 -0
- package/dist/contracts/operations.d.ts +4 -4
- package/dist/contracts/pages.d.ts +6 -14
- package/dist/contracts/pages.js +11 -23
- package/dist/contracts/plan-policy.d.ts +2 -9
- package/dist/contracts/plan-policy.js +1 -4
- package/dist/contracts/platform.d.ts +80 -32
- package/dist/contracts/platform.js +59 -12
- package/dist/contracts/push-new.d.ts +26 -2
- package/dist/contracts/push-new.js +8 -0
- package/dist/contracts/quotas.d.ts +0 -1
- package/dist/contracts/quotas.js +0 -5
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/resources.d.ts +21 -85
- package/dist/contracts/resources.js +17 -47
- package/dist/contracts/runtime-api.d.ts +799 -192
- package/dist/contracts/runtime-api.js +231 -100
- package/dist/contracts/runtime-app.d.ts +138 -0
- package/dist/contracts/runtime-app.js +21 -0
- package/dist/contracts/sf-config-v1.d.ts +5 -0
- package/dist/contracts/sf-config-v1.js +1 -1
- package/dist/contracts/sites.d.ts +17 -12
- package/dist/contracts/sites.js +30 -12
- package/dist/contracts/space-config.d.ts +46 -117
- package/dist/contracts/space-config.js +323 -25
- package/dist/contracts/spaces.d.ts +392 -256
- package/dist/contracts/spaces.js +163 -83
- package/dist/contracts/superadmin-emails.d.ts +27 -3
- package/dist/contracts/superadmin-emails.js +10 -15
- package/dist/contracts/superadmin-runtime.d.ts +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +19 -142
- package/dist/contracts/superadmin-spaces.js +7 -0
- package/dist/contracts/tags.d.ts +66 -36
- package/dist/contracts/tags.js +195 -11
- package/dist/contracts/teams.d.ts +9 -9
- package/dist/contracts/transfers.d.ts +1 -2
- 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 +437 -193
- package/dist/contracts/zero.js +149 -158
- package/dist/dashboard-paths/index.d.ts +3 -3
- package/dist/dashboard-paths/index.js +1 -0
- package/dist/docs/agent-prose.js +10 -8
- package/dist/docs/agent-setup.d.ts +6 -4
- package/dist/docs/agent-setup.js +26 -16
- package/dist/docs/agent-solutions.js +1 -1
- package/dist/docs/catalog.d.ts +35 -37
- package/dist/docs/catalog.js +36 -38
- package/dist/docs/error-docs.js +108 -44
- package/dist/utils/asset-fingerprint.d.ts +11 -0
- package/dist/utils/asset-fingerprint.js +46 -0
- package/dist/utils/auth-redirect.d.ts +1 -3
- package/dist/utils/auth-redirect.js +1 -21
- package/dist/utils/build-settings.d.ts +2 -0
- package/dist/utils/build-settings.js +61 -9
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/credential-policy.js +4 -0
- 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/grants.d.ts +53 -0
- package/dist/utils/grants.js +160 -0
- package/dist/utils/id-hints.d.ts +1 -0
- package/dist/utils/id-hints.js +55 -13
- package/dist/utils/local-space-state.js +1 -0
- 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 +19 -6
- package/dist/utils/pages.js +122 -49
- package/dist/utils/production-runtime.d.ts +18 -0
- package/dist/utils/production-runtime.js +28 -0
- package/dist/utils/publish-policy.d.ts +34 -4
- package/dist/utils/publish-policy.js +132 -61
- package/dist/utils/query-keys.d.ts +7 -13
- package/dist/utils/query-keys.js +12 -18
- package/dist/utils/source-archive-policy.d.ts +2 -0
- package/dist/utils/source-archive-policy.js +2 -0
- package/dist/utils/space-config.d.ts +5 -1
- package/dist/utils/space-config.js +35 -0
- package/dist/utils/static-runtime-policy.d.ts +5 -0
- package/dist/utils/static-runtime-policy.fixtures.json +57 -0
- package/dist/utils/static-runtime-policy.js +54 -10
- package/dist/utils/upload-session.d.ts +3 -0
- package/dist/utils/upload-session.js +31 -0
- package/package.json +6 -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
- package/dist/utils/access-match.d.ts +0 -39
- package/dist/utils/access-match.js +0 -296
- package/dist/utils/sf-config-v1.d.ts +0 -2
- package/dist/utils/sf-config-v1.js +0 -542
|
@@ -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
|
+
};
|
|
@@ -8,17 +8,15 @@ export declare const spaceStatus: z.ZodEnum<{
|
|
|
8
8
|
deleting: "deleting";
|
|
9
9
|
failed: "failed";
|
|
10
10
|
}>;
|
|
11
|
-
export declare const spaceDisabledReasonCodeValues: readonly ["anonymous_expired", "abuse_takedown", "tenant_suspended", "site_suspended"
|
|
11
|
+
export declare const spaceDisabledReasonCodeValues: readonly ["anonymous_expired", "abuse_takedown", "tenant_suspended", "site_suspended"];
|
|
12
12
|
export declare const spaceDisabledReasonCode: z.ZodEnum<{
|
|
13
13
|
anonymous_expired: "anonymous_expired";
|
|
14
14
|
abuse_takedown: "abuse_takedown";
|
|
15
15
|
tenant_suspended: "tenant_suspended";
|
|
16
16
|
site_suspended: "site_suspended";
|
|
17
|
-
visit_cap_exceeded: "visit_cap_exceeded";
|
|
18
17
|
}>;
|
|
19
|
-
export declare const spaceTransferStatusValues: readonly ["pending_confirmation", "confirming_domains", "
|
|
18
|
+
export declare const spaceTransferStatusValues: readonly ["pending_confirmation", "confirming_domains", "completed", "canceled", "expired"];
|
|
20
19
|
export declare const spaceTransferStatus: z.ZodEnum<{
|
|
21
|
-
moving: "moving";
|
|
22
20
|
pending_confirmation: "pending_confirmation";
|
|
23
21
|
confirming_domains: "confirming_domains";
|
|
24
22
|
completed: "completed";
|
|
@@ -125,8 +123,8 @@ export declare const buildStatus: z.ZodEnum<{
|
|
|
125
123
|
}>;
|
|
126
124
|
export declare const diagnosticSeverity: z.ZodEnum<{
|
|
127
125
|
info: "info";
|
|
128
|
-
warning: "warning";
|
|
129
126
|
error: "error";
|
|
127
|
+
warning: "warning";
|
|
130
128
|
}>;
|
|
131
129
|
export declare const diagnosticProvider: z.ZodEnum<{
|
|
132
130
|
registrar: "registrar";
|
package/dist/contracts/enums.js
CHANGED
|
@@ -11,18 +11,14 @@ export const spaceStatusValues = [
|
|
|
11
11
|
"failed",
|
|
12
12
|
];
|
|
13
13
|
export const spaceStatus = z.enum(spaceStatusValues);
|
|
14
|
-
// Serving-axis disable reasons (internal-docs/platform.md "Space")
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
// `visit_cap_exceeded` is the anonymous visit-quota pause
|
|
18
|
-
// (ANONYMOUS_PUBLISH_CAPS.maxLifetimeViews): recoverable, the claim token stays
|
|
19
|
-
// intact, and claiming the space restores serving.
|
|
14
|
+
// Serving-axis disable reasons (internal-docs/platform.md "Space"). Confirmed
|
|
15
|
+
// scan takedowns use `abuse_takedown`; infected state and claim invalidation
|
|
16
|
+
// are explicit enforcement effects, not reason metadata.
|
|
20
17
|
export const spaceDisabledReasonCodeValues = [
|
|
21
18
|
"anonymous_expired",
|
|
22
19
|
"abuse_takedown",
|
|
23
20
|
"tenant_suspended",
|
|
24
21
|
"site_suspended",
|
|
25
|
-
"visit_cap_exceeded",
|
|
26
22
|
];
|
|
27
23
|
export const spaceDisabledReasonCode = z.enum(spaceDisabledReasonCodeValues);
|
|
28
24
|
// SpaceTransfer status machine (internal-docs/platform.md "Transfer
|
|
@@ -34,7 +30,6 @@ export const spaceDisabledReasonCode = z.enum(spaceDisabledReasonCodeValues);
|
|
|
34
30
|
export const spaceTransferStatusValues = [
|
|
35
31
|
"pending_confirmation",
|
|
36
32
|
"confirming_domains",
|
|
37
|
-
"moving",
|
|
38
33
|
"completed",
|
|
39
34
|
"canceled",
|
|
40
35
|
"expired",
|