@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,86 @@
1
+ export declare const betterAuthAdditionalFields: {
2
+ readonly user: {
3
+ readonly tenantId: {
4
+ readonly type: "string";
5
+ readonly required: false;
6
+ readonly returned: true;
7
+ readonly input: false;
8
+ };
9
+ readonly analyticsId: {
10
+ readonly type: "string";
11
+ readonly required: false;
12
+ readonly returned: true;
13
+ readonly input: false;
14
+ };
15
+ readonly username: {
16
+ readonly type: "string";
17
+ readonly required: false;
18
+ readonly returned: true;
19
+ readonly input: false;
20
+ };
21
+ readonly displayUsername: {
22
+ readonly type: "string";
23
+ readonly required: false;
24
+ readonly returned: true;
25
+ readonly input: false;
26
+ };
27
+ readonly isAutomattician: {
28
+ readonly type: "boolean";
29
+ readonly required: false;
30
+ readonly defaultValue: false;
31
+ readonly returned: true;
32
+ readonly input: false;
33
+ };
34
+ readonly wpcomProfileJson: {
35
+ readonly type: "json";
36
+ readonly required: false;
37
+ readonly returned: false;
38
+ readonly input: false;
39
+ };
40
+ readonly wpcom: {
41
+ readonly type: "boolean";
42
+ readonly required: false;
43
+ readonly defaultValue: false;
44
+ readonly returned: true;
45
+ readonly input: false;
46
+ };
47
+ readonly betaEnrolledAt: {
48
+ readonly type: "string";
49
+ readonly required: false;
50
+ readonly returned: true;
51
+ readonly input: false;
52
+ };
53
+ readonly theme: {
54
+ readonly type: "string";
55
+ readonly required: false;
56
+ readonly defaultValue: "dark";
57
+ readonly input: true;
58
+ readonly returned: true;
59
+ };
60
+ readonly twoFactorEnabled: {
61
+ readonly type: "boolean";
62
+ readonly required: false;
63
+ readonly defaultValue: false;
64
+ readonly input: false;
65
+ readonly returned: true;
66
+ };
67
+ };
68
+ readonly session: {
69
+ readonly activeTeamId: {
70
+ readonly type: "string";
71
+ readonly required: false;
72
+ readonly returned: true;
73
+ readonly input: false;
74
+ };
75
+ readonly impersonatedBy: {
76
+ readonly type: "string";
77
+ readonly required: false;
78
+ readonly returned: true;
79
+ readonly input: false;
80
+ };
81
+ };
82
+ };
83
+ export type BetterAuthCustomSessionUser = {
84
+ wpcomUserId?: string | null;
85
+ isSuperadmin?: boolean;
86
+ };
@@ -0,0 +1,82 @@
1
+ export const betterAuthAdditionalFields = {
2
+ user: {
3
+ tenantId: {
4
+ type: "string",
5
+ required: false,
6
+ returned: true,
7
+ input: false,
8
+ },
9
+ analyticsId: {
10
+ type: "string",
11
+ required: false,
12
+ returned: true,
13
+ input: false,
14
+ },
15
+ username: {
16
+ type: "string",
17
+ required: false,
18
+ returned: true,
19
+ input: false,
20
+ },
21
+ displayUsername: {
22
+ type: "string",
23
+ required: false,
24
+ returned: true,
25
+ input: false,
26
+ },
27
+ isAutomattician: {
28
+ type: "boolean",
29
+ required: false,
30
+ defaultValue: false,
31
+ returned: true,
32
+ input: false,
33
+ },
34
+ wpcomProfileJson: {
35
+ type: "json",
36
+ required: false,
37
+ returned: false,
38
+ input: false,
39
+ },
40
+ wpcom: {
41
+ type: "boolean",
42
+ required: false,
43
+ defaultValue: false,
44
+ returned: true,
45
+ input: false,
46
+ },
47
+ betaEnrolledAt: {
48
+ type: "string",
49
+ required: false,
50
+ returned: true,
51
+ input: false,
52
+ },
53
+ theme: {
54
+ type: "string",
55
+ required: false,
56
+ defaultValue: "dark",
57
+ input: true,
58
+ returned: true,
59
+ },
60
+ twoFactorEnabled: {
61
+ type: "boolean",
62
+ required: false,
63
+ defaultValue: false,
64
+ input: false,
65
+ returned: true,
66
+ },
67
+ },
68
+ session: {
69
+ activeTeamId: {
70
+ type: "string",
71
+ required: false,
72
+ returned: true,
73
+ input: false,
74
+ },
75
+ impersonatedBy: {
76
+ type: "string",
77
+ required: false,
78
+ returned: true,
79
+ input: false,
80
+ },
81
+ },
82
+ };
@@ -0,0 +1,106 @@
1
+ import { z } from "zod";
2
+ export declare const betaSignupStatusValues: readonly ["pending", "invited", "enrolled"];
3
+ export declare const betaSignupStatusSchema: z.ZodEnum<{
4
+ pending: "pending";
5
+ invited: "invited";
6
+ enrolled: "enrolled";
7
+ }>;
8
+ export type BetaSignupStatus = z.infer<typeof betaSignupStatusSchema>;
9
+ export declare const betaAutoEnrollKindValues: readonly ["email", "domain"];
10
+ export declare const betaAutoEnrollKindSchema: z.ZodEnum<{
11
+ email: "email";
12
+ domain: "domain";
13
+ }>;
14
+ export type BetaAutoEnrollKind = z.infer<typeof betaAutoEnrollKindSchema>;
15
+ export declare const betaEligibleTeamSourceValues: readonly ["invitation", "auto_enroll_domain", "automattician"];
16
+ export declare const betaEligibleTeamSourceSchema: z.ZodEnum<{
17
+ invitation: "invitation";
18
+ auto_enroll_domain: "auto_enroll_domain";
19
+ automattician: "automattician";
20
+ }>;
21
+ export type BetaEligibleTeamSource = z.infer<typeof betaEligibleTeamSourceSchema>;
22
+ export declare const betaSignupCreateSchema: z.ZodObject<{
23
+ email: z.ZodString;
24
+ website: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export declare const betaSignupReceiptSchema: z.ZodObject<{
27
+ ok: z.ZodLiteral<true>;
28
+ }, z.core.$strip>;
29
+ export declare const betaAcceptSchema: z.ZodObject<{
30
+ token: z.ZodString;
31
+ }, z.core.$strip>;
32
+ export declare const betaAcceptResponseSchema: z.ZodObject<{
33
+ enrolled: z.ZodLiteral<true>;
34
+ }, z.core.$strip>;
35
+ export declare const teamAutoEnrollEntrySchema: z.ZodObject<{
36
+ id: z.ZodString;
37
+ teamId: z.ZodString;
38
+ kind: z.ZodLiteral<"domain">;
39
+ value: z.ZodString;
40
+ createdAt: z.ZodString;
41
+ }, z.core.$strip>;
42
+ export declare const teamAutoEnrollCreateSchema: z.ZodObject<{
43
+ kind: z.ZodLiteral<"domain">;
44
+ value: z.ZodString;
45
+ }, z.core.$strip>;
46
+ export declare const teamAutoEnrollListResponseSchema: z.ZodObject<{
47
+ data: z.ZodArray<z.ZodObject<{
48
+ id: z.ZodString;
49
+ teamId: z.ZodString;
50
+ kind: z.ZodLiteral<"domain">;
51
+ value: z.ZodString;
52
+ createdAt: z.ZodString;
53
+ }, z.core.$strip>>;
54
+ }, z.core.$strip>;
55
+ export declare const SuperadminBetaSignupSchema: z.ZodObject<{
56
+ id: z.ZodString;
57
+ email: z.ZodString;
58
+ status: z.ZodEnum<{
59
+ pending: "pending";
60
+ invited: "invited";
61
+ enrolled: "enrolled";
62
+ }>;
63
+ isAutomattician: z.ZodBoolean;
64
+ wpcom: z.ZodBoolean;
65
+ invitedAt: z.ZodNullable<z.ZodString>;
66
+ tokenExpiresAt: z.ZodNullable<z.ZodString>;
67
+ invitedBy: z.ZodNullable<z.ZodString>;
68
+ enrolledUserId: z.ZodNullable<z.ZodString>;
69
+ createdAt: z.ZodString;
70
+ }, z.core.$strip>;
71
+ export declare const superadminBetaSignupListQuerySchema: z.ZodObject<{
72
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
73
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
74
+ search: z.ZodOptional<z.ZodString>;
75
+ status: z.ZodOptional<z.ZodEnum<{
76
+ pending: "pending";
77
+ invited: "invited";
78
+ enrolled: "enrolled";
79
+ }>>;
80
+ }, z.core.$strip>;
81
+ export declare const SuperadminBetaSignupListSchema: z.ZodObject<{
82
+ signups: z.ZodArray<z.ZodObject<{
83
+ id: z.ZodString;
84
+ email: z.ZodString;
85
+ status: z.ZodEnum<{
86
+ pending: "pending";
87
+ invited: "invited";
88
+ enrolled: "enrolled";
89
+ }>;
90
+ isAutomattician: z.ZodBoolean;
91
+ wpcom: z.ZodBoolean;
92
+ invitedAt: z.ZodNullable<z.ZodString>;
93
+ tokenExpiresAt: z.ZodNullable<z.ZodString>;
94
+ invitedBy: z.ZodNullable<z.ZodString>;
95
+ enrolledUserId: z.ZodNullable<z.ZodString>;
96
+ createdAt: z.ZodString;
97
+ }, z.core.$strip>>;
98
+ total: z.ZodNumber;
99
+ limit: z.ZodNumber;
100
+ offset: z.ZodNumber;
101
+ pagination: z.ZodObject<{
102
+ count: z.ZodNumber;
103
+ next: z.ZodNullable<z.ZodNumber>;
104
+ prev: z.ZodNullable<z.ZodNumber>;
105
+ }, z.core.$strip>;
106
+ }, z.core.$strip>;
@@ -0,0 +1,104 @@
1
+ import { z } from "zod";
2
+ import { makeOffsetListSchema } from "./common.js";
3
+ import { superadminPaginationSchema } from "./superadmin.js";
4
+ // Private-beta enrollment contracts (internal-docs/prelaunch-private-beta-plan.md).
5
+ // Two invite systems coexist: `stattic_beta_signups` (this file) is the public
6
+ // waitlist, while `stattic_auth_invitation` stays team-membership-only — the
7
+ // two share no rows, routes, or email templates.
8
+ // `stattic_beta_signups` state machine: pending → invited → enrolled.
9
+ // `pending → enrolled` is possible — a team grant path can enroll the user
10
+ // before any invite was sent; the enrolling code back-fills the matching row.
11
+ export const betaSignupStatusValues = ["pending", "invited", "enrolled"];
12
+ export const betaSignupStatusSchema = z
13
+ .enum(betaSignupStatusValues)
14
+ .describe("Waitlist signup status.");
15
+ // Internal auto-enroll kinds. New create requests are domain-only; `email`
16
+ // remains here so legacy rows can still be read and resolved predictably.
17
+ export const betaAutoEnrollKindValues = ["email", "domain"];
18
+ export const betaAutoEnrollKindSchema = z
19
+ .enum(betaAutoEnrollKindValues)
20
+ .describe("Auto-enroll match kind.");
21
+ // Why a team appears in the join picker (`GET /v1/me` beta.eligibleTeams).
22
+ export const betaEligibleTeamSourceValues = [
23
+ "invitation",
24
+ "auto_enroll_domain",
25
+ "automattician",
26
+ ];
27
+ export const betaEligibleTeamSourceSchema = z
28
+ .enum(betaEligibleTeamSourceValues)
29
+ .describe("Why the team is joinable by the caller.");
30
+ // `POST /v1/beta/signups` (public). `website` is a honeypot: real browsers
31
+ // leave it empty, and the route accepts and drops it silently either way —
32
+ // never a validation error that would tip off bots.
33
+ export const betaSignupCreateSchema = z.object({
34
+ email: z
35
+ .string()
36
+ .trim()
37
+ .email()
38
+ .max(320)
39
+ .toLowerCase()
40
+ .describe("Address to put on the waitlist."),
41
+ website: z.string().optional().describe("Honeypot field; leave empty."),
42
+ });
43
+ // Always the same generic body — duplicates included — so the public endpoint
44
+ // cannot be used to enumerate the waitlist.
45
+ export const betaSignupReceiptSchema = z.object({
46
+ ok: z.literal(true).describe("Generic acknowledgement; identical for every outcome."),
47
+ });
48
+ // `POST /v1/beta/accept` (authed): binds the invite token's signup row to the
49
+ // calling account and enrolls it. Idempotent — an already-enrolled caller
50
+ // still binds the row and gets a 200.
51
+ export const betaAcceptSchema = z.object({
52
+ token: z.string().trim().min(1).max(255).describe("Raw invite token from the email link."),
53
+ });
54
+ export const betaAcceptResponseSchema = z.object({
55
+ enrolled: z.literal(true).describe("The calling account is enrolled in the private beta."),
56
+ });
57
+ // Team auto-enroll entries (`GET/POST/DELETE /v1/teams/{teamId}/auto-enroll`).
58
+ // A match grants beta enrollment but NOT team membership — the user gets a
59
+ // picker. Values are normalized before storage: domains IDNA-canonicalized to
60
+ // ASCII.
61
+ export const teamAutoEnrollEntrySchema = z.object({
62
+ id: z.string().describe("Auto-enroll entry id."),
63
+ teamId: z.string().describe("Team the entry belongs to."),
64
+ kind: z.literal("domain").describe("Auto-enroll entry kind."),
65
+ value: z.string().describe("IDNA ASCII-canonicalized domain."),
66
+ createdAt: z.string().datetime(),
67
+ });
68
+ export const teamAutoEnrollCreateSchema = z.object({
69
+ kind: z.literal("domain").describe("Auto-enroll is domain-only."),
70
+ value: z
71
+ .string()
72
+ .trim()
73
+ .min(1)
74
+ .max(320)
75
+ .toLowerCase()
76
+ .describe("Domain to auto-enroll; validated and canonicalized server-side."),
77
+ });
78
+ export const teamAutoEnrollListResponseSchema = z.object({
79
+ data: z.array(teamAutoEnrollEntrySchema),
80
+ });
81
+ // Superadmin waitlist views (`GET /v1/superadmin/beta-signups`), mirroring the
82
+ // users page shapes in contracts/superadmin.ts.
83
+ export const SuperadminBetaSignupSchema = z.object({
84
+ id: z.string(),
85
+ email: z.string().email(),
86
+ status: betaSignupStatusSchema,
87
+ isAutomattician: z.boolean(),
88
+ wpcom: z.boolean(),
89
+ invitedAt: z.string().datetime().nullable(),
90
+ tokenExpiresAt: z.string().datetime().nullable(),
91
+ invitedBy: z
92
+ .string()
93
+ .nullable()
94
+ .describe("Inviting operator's user id; null = auto-approved (Automattician signup)."),
95
+ enrolledUserId: z.string().nullable(),
96
+ createdAt: z.string().datetime(),
97
+ });
98
+ export const superadminBetaSignupListQuerySchema = z.object({
99
+ limit: z.coerce.number().int().min(1).max(100).default(25),
100
+ offset: z.coerce.number().int().min(0).default(0),
101
+ search: z.string().trim().optional(),
102
+ status: betaSignupStatusSchema.optional(),
103
+ });
104
+ export const SuperadminBetaSignupListSchema = makeOffsetListSchema("signups", SuperadminBetaSignupSchema, superadminPaginationSchema);