@spacefast/common 0.0.24 → 0.2.1
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/brand-assets/LICENSE-Haskoy.txt +93 -0
- package/brand-assets/haskoy-latin-variable.woff2 +0 -0
- package/brand-assets/spacefast-favicon.svg +4 -4
- package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
- package/brand-assets/spacefast-wordmark.svg +2 -4
- package/dist/agents/connect-targets.d.ts +6 -146
- package/dist/agents/connect-targets.js +63 -295
- package/dist/agents/private-key-oauth.d.ts +31 -2
- package/dist/agents/private-key-oauth.js +166 -92
- package/dist/agents/registry/core.d.ts +292 -0
- package/dist/agents/registry/core.js +1388 -0
- package/dist/agents/registry/deeplink-probes.d.ts +23 -0
- package/dist/agents/registry/deeplink-probes.js +18 -0
- package/dist/agents/registry/node.d.ts +56 -0
- package/dist/agents/registry/node.js +339 -0
- package/dist/brand-assets-build.js +3 -6
- package/dist/brand-assets.d.ts +5 -15
- package/dist/brand-assets.js +12 -14
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +79 -12
- package/dist/config/domains.js +128 -29
- package/dist/config/index.js +1 -2
- package/dist/contracts/abuse.js +9 -24
- package/dist/contracts/access-profiles.d.ts +86 -0
- package/dist/contracts/access-profiles.js +89 -0
- package/dist/contracts/access.d.ts +24 -30
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +72 -26
- package/dist/contracts/analytics.js +8 -10
- package/dist/contracts/api-keys.d.ts +77 -52
- package/dist/contracts/api-keys.js +44 -24
- package/dist/contracts/application-journal.d.ts +216 -0
- package/dist/contracts/application-journal.js +167 -0
- package/dist/contracts/auth.d.ts +90 -17
- package/dist/contracts/auth.js +86 -17
- package/dist/contracts/beta.d.ts +9 -4
- package/dist/contracts/beta.js +20 -16
- package/dist/contracts/billing.d.ts +2 -1
- package/dist/contracts/billing.js +37 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +209 -18
- package/dist/contracts/builds.js +93 -27
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +25 -9
- package/dist/contracts/cli.d.ts +7 -0
- package/dist/contracts/cli.js +6 -0
- package/dist/contracts/collab-public.d.ts +1 -1
- package/dist/contracts/collab-public.js +5 -8
- package/dist/contracts/comments.d.ts +44 -34
- package/dist/contracts/comments.js +107 -77
- package/dist/contracts/commerce.d.ts +165 -0
- package/dist/contracts/commerce.js +146 -0
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/common.js +20 -31
- package/dist/contracts/content-contract-verification.d.ts +521 -0
- package/dist/contracts/content-contract-verification.js +320 -0
- package/dist/contracts/content-platform-fixture.d.ts +1278 -0
- package/dist/contracts/content-platform-fixture.js +44 -0
- package/dist/contracts/content-program.d.ts +994 -0
- package/dist/contracts/content-program.js +658 -0
- package/dist/contracts/content-sync.d.ts +290 -0
- package/dist/contracts/content-sync.js +167 -0
- package/dist/contracts/content.d.ts +432 -0
- package/dist/contracts/content.js +303 -0
- package/dist/contracts/continuation.d.ts +17 -1
- package/dist/contracts/continuation.js +23 -23
- package/dist/contracts/countries.js +3 -4
- package/dist/contracts/crons.d.ts +52 -0
- package/dist/contracts/crons.js +60 -0
- package/dist/contracts/dashboard-prefs.d.ts +56 -0
- package/dist/contracts/dashboard-prefs.js +51 -0
- package/dist/contracts/device-auth.d.ts +234 -37
- package/dist/contracts/device-auth.js +267 -53
- package/dist/contracts/docs.d.ts +1 -5
- package/dist/contracts/docs.js +7 -15
- package/dist/contracts/domains.d.ts +501 -93
- package/dist/contracts/domains.js +193 -55
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +27 -26
- package/dist/contracts/enums.js +68 -61
- package/dist/contracts/error-code-meta.d.ts +283 -7
- package/dist/contracts/error-code-meta.js +97 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +82 -17
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +48 -64
- package/dist/contracts/execution.js +52 -62
- package/dist/contracts/feature-lifecycle.d.ts +73 -27
- package/dist/contracts/feature-lifecycle.js +86 -26
- package/dist/contracts/features.d.ts +68 -19
- package/dist/contracts/features.js +42 -41
- package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
- package/dist/contracts/frame-session.d.ts +192 -0
- package/dist/contracts/frame-session.js +164 -0
- package/dist/contracts/functions.d.ts +338 -164
- package/dist/contracts/functions.js +367 -198
- package/dist/contracts/git.d.ts +27 -33
- package/dist/contracts/git.js +10 -11
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +62 -54
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +6 -3
- package/dist/contracts/internal.d.ts +8 -18
- package/dist/contracts/internal.js +13 -14
- package/dist/contracts/mcp.d.ts +28 -0
- package/dist/contracts/mcp.js +28 -0
- package/dist/contracts/me.d.ts +6 -1
- package/dist/contracts/me.js +12 -6
- package/dist/contracts/notifications.d.ts +27 -29
- package/dist/contracts/notifications.js +9 -4
- package/dist/contracts/oauth-resources.d.ts +112 -10
- package/dist/contracts/oauth-resources.js +116 -11
- package/dist/contracts/oauth-scope-actions.d.ts +90 -0
- package/dist/contracts/oauth-scope-actions.js +126 -0
- package/dist/contracts/operations.d.ts +27 -4
- package/dist/contracts/operations.js +12 -6
- package/dist/contracts/pages.d.ts +31 -7
- package/dist/contracts/pages.js +22 -5
- package/dist/contracts/partner-notifications.d.ts +3 -0
- package/dist/contracts/partner-notifications.js +65 -0
- package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
- package/dist/contracts/{platform.js → partner.js} +27 -40
- package/dist/contracts/plan-policy.js +1 -1
- package/dist/contracts/principal-assertion.d.ts +43 -0
- package/dist/contracts/principal-assertion.js +67 -0
- package/dist/contracts/principals.d.ts +73 -0
- package/dist/contracts/principals.js +59 -0
- package/dist/contracts/privacy.d.ts +11 -0
- package/dist/contracts/privacy.js +17 -0
- package/dist/contracts/problem-document.js +3 -4
- package/dist/contracts/publish-archive.d.ts +269 -161
- package/dist/contracts/publish-archive.js +11 -1
- package/dist/contracts/push-new.d.ts +8 -8
- package/dist/contracts/quotas.js +5 -5
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +44 -31
- package/dist/contracts/repository-connections.js +17 -5
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +150 -26
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +206 -82
- package/dist/contracts/runtime-api.js +131 -70
- package/dist/contracts/runtime-app.d.ts +13 -23
- package/dist/contracts/runtime-app.js +39 -24
- package/dist/contracts/runtime-components.d.ts +143 -0
- package/dist/contracts/runtime-components.js +199 -0
- package/dist/contracts/runtime-db.d.ts +49 -23
- package/dist/contracts/runtime-db.js +87 -22
- package/dist/contracts/runtime-purge.d.ts +8 -0
- package/dist/contracts/runtime-purge.js +5 -0
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +15 -14
- package/dist/contracts/runtime-storage.js +30 -14
- package/dist/contracts/sf-config-v1.d.ts +48 -14
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +283 -19
- package/dist/contracts/space-config.js +430 -80
- package/dist/contracts/spaces.d.ts +376 -290
- package/dist/contracts/spaces.js +200 -135
- package/dist/contracts/superadmin-activity.d.ts +3 -43
- package/dist/contracts/superadmin-activity.js +6 -30
- package/dist/contracts/superadmin-emails.d.ts +1 -0
- package/dist/contracts/superadmin-emails.js +17 -1
- package/dist/contracts/superadmin-runtime.d.ts +199 -0
- package/dist/contracts/superadmin-runtime.js +141 -0
- package/dist/contracts/superadmin-search.d.ts +22 -2
- package/dist/contracts/superadmin-search.js +14 -6
- package/dist/contracts/superadmin-spaces.d.ts +438 -189
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +5 -2
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -12
- package/dist/contracts/superadmin-tenants.js +32 -13
- package/dist/contracts/superadmin.d.ts +232 -37
- package/dist/contracts/superadmin.js +106 -22
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +47 -37
- package/dist/contracts/teams.d.ts +86 -26
- package/dist/contracts/teams.js +90 -31
- package/dist/contracts/tenants.d.ts +135 -0
- package/dist/contracts/tenants.js +120 -0
- package/dist/contracts/test-triggers.d.ts +70 -0
- package/dist/contracts/test-triggers.js +116 -0
- package/dist/contracts/theme-json.js +3 -8
- package/dist/contracts/transfers.d.ts +1 -0
- package/dist/contracts/transfers.js +3 -2
- package/dist/contracts/usage.d.ts +209 -0
- package/dist/contracts/usage.js +124 -12
- package/dist/contracts/variables.d.ts +2 -2
- package/dist/contracts/variables.js +9 -13
- package/dist/contracts/webhooks.d.ts +13 -5
- package/dist/contracts/webhooks.js +3 -1
- package/dist/contracts/zero.d.ts +72 -81
- package/dist/contracts/zero.js +80 -78
- package/dist/dashboard-paths/index.d.ts +24 -21
- package/dist/dashboard-paths/index.js +35 -47
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
- package/dist/dashboard-paths/route-reservations.generated.js +36 -0
- package/dist/docs/agent-arrival.d.ts +92 -0
- package/dist/docs/agent-arrival.js +227 -0
- package/dist/docs/agent-output-policy.d.ts +6 -0
- package/dist/docs/agent-output-policy.js +22 -0
- package/dist/docs/agent-prose.d.ts +12 -18
- package/dist/docs/agent-prose.js +73 -51
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +339 -436
- package/dist/docs/catalog.d.ts +153 -95
- package/dist/docs/catalog.js +163 -48
- package/dist/docs/error-docs.d.ts +2098 -1
- package/dist/docs/error-docs.js +421 -144
- package/dist/docs/index-build.d.ts +0 -1
- package/dist/docs/index-build.js +2 -3
- package/dist/docs/page-context-prompt.d.ts +77 -0
- package/dist/docs/page-context-prompt.js +131 -0
- package/dist/docs/reference-urls.d.ts +46 -0
- package/dist/docs/reference-urls.js +79 -0
- package/dist/docs/search.d.ts +6 -8
- package/dist/docs/search.js +10 -13
- package/dist/docs/skill-distribution.d.ts +4 -1
- package/dist/docs/skill-distribution.js +10 -5
- package/dist/docs/skills.d.ts +120 -120
- package/dist/docs/skills.js +121 -73
- package/dist/docs/start-prompts.d.ts +45 -0
- package/dist/docs/start-prompts.js +62 -0
- package/dist/domain-exploration.js +9 -13
- package/dist/og-template.d.ts +56 -0
- package/dist/og-template.js +56 -0
- package/dist/slug-policy/index.js +5 -11
- package/dist/test-helpers/fetch-stub.js +1 -0
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +21 -1
- package/dist/utils/build-settings.js +133 -15
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +4 -5
- package/dist/utils/cast-transport.d.ts +5 -17
- package/dist/utils/cast-transport.js +6 -19
- package/dist/utils/claim-token.js +1 -2
- package/dist/utils/comment-avatars.js +4 -6
- package/dist/utils/concurrency.js +3 -3
- package/dist/utils/content-type.d.ts +7 -6
- package/dist/utils/content-type.js +73 -51
- package/dist/utils/credential-policy.d.ts +50 -6
- package/dist/utils/credential-policy.js +126 -59
- package/dist/utils/dns-instructions.js +9 -9
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/error-code.js +1 -0
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grant-decision.fixtures.json +2 -2
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +7 -8
- package/dist/utils/gravatar.d.ts +2 -4
- package/dist/utils/gravatar.js +6 -12
- package/dist/utils/id-hints.js +14 -23
- package/dist/utils/idempotency.d.ts +3 -3
- package/dist/utils/idempotency.js +6 -7
- package/dist/utils/local-space-state.d.ts +23 -26
- package/dist/utils/local-space-state.js +46 -46
- package/dist/utils/oauth-signed-query.d.ts +3 -5
- package/dist/utils/oauth-signed-query.js +6 -9
- package/dist/utils/one-shot-replay.d.ts +7 -6
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +15 -19
- package/dist/utils/page-colors.js +23 -45
- package/dist/utils/page-fonts.d.ts +1 -1
- package/dist/utils/page-fonts.js +8 -20
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +33 -3
- package/dist/utils/pages.js +83 -30
- package/dist/utils/privacy-regions.d.ts +19 -0
- package/dist/utils/privacy-regions.js +91 -0
- package/dist/utils/publish-form-data.d.ts +4 -5
- package/dist/utils/publish-form-data.js +2 -3
- package/dist/utils/publish-policy.d.ts +11 -17
- package/dist/utils/publish-policy.fixtures.json +11 -5
- package/dist/utils/publish-policy.js +65 -110
- package/dist/utils/query-client.d.ts +2 -0
- package/dist/utils/query-client.js +10 -1
- package/dist/utils/runtime-paths.d.ts +4 -4
- package/dist/utils/runtime-paths.js +6 -8
- package/dist/utils/runtime-upload.d.ts +9 -0
- package/dist/utils/runtime-upload.js +12 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +23 -40
- package/dist/utils/space-config.d.ts +12 -15
- package/dist/utils/space-config.js +13 -16
- package/dist/utils/static-runtime-policy.d.ts +10 -7
- package/dist/utils/static-runtime-policy.fixtures.json +38 -41
- package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
- package/dist/utils/static-runtime-policy.generated.js +70 -0
- package/dist/utils/static-runtime-policy.js +31 -132
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.d.ts +4 -1
- package/dist/utils/upload-session.js +41 -19
- package/dist/utils/version-path.js +11 -19
- package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
- package/dist/utils/wpcom-auth-redirects.js +1 -4
- package/dist/vocabulary.d.ts +13 -13
- package/dist/vocabulary.js +52 -27
- package/package.json +15 -18
- package/dist/agents/client-registry.d.ts +0 -22
- package/dist/agents/client-registry.js +0 -41
- package/dist/docs/agent-handoff-document.d.ts +0 -15
- package/dist/docs/agent-handoff-document.js +0 -180
- package/dist/docs/agent-solutions.d.ts +0 -110
- package/dist/docs/agent-solutions.js +0 -183
- package/dist/utils/query-keys.d.ts +0 -84
- package/dist/utils/query-keys.js +0 -108
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ApiKeySchema } from "./api-keys.js";
|
|
2
3
|
import { makeOffsetListSchema } from "./common.js";
|
|
3
|
-
import { providerClientStatus, tenantKind, tenantStatus } from "./enums.js";
|
|
4
|
+
import { providerClientStatus, tenantKind, tenantMode, tenantStatus } from "./enums.js";
|
|
4
5
|
import { superadminPaginationSchema } from "./superadmin.js";
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// configured separately as the platform context. The API token is write-only;
|
|
9
|
-
// responses expose only a masked hint, never the secret.
|
|
6
|
+
// One WP.Cloud API client identity sites are provisioned under. Each row is a
|
|
7
|
+
// tenant-owned BYO account; the first-party client is configured separately.
|
|
8
|
+
// The API token is write-only: responses expose only a masked hint.
|
|
10
9
|
export const SuperadminProviderClientSchema = z.object({
|
|
11
10
|
id: z.string().describe("ProviderClient id (`pvc_`)."),
|
|
12
|
-
provider: z
|
|
11
|
+
provider: z
|
|
12
|
+
.enum(["wpcloud", "simulated"])
|
|
13
|
+
.describe("Hosting provider this client identity belongs to. `simulated` is a linked test tenant's synthetic provider (no real wp.cloud account)."),
|
|
13
14
|
tenantId: z.string().describe("Tenant that owns this WP.Cloud account."),
|
|
14
15
|
name: z.string().describe("The WP.Cloud client/account name used as the {client} path param."),
|
|
15
16
|
label: z.string().describe("Human-readable operator label."),
|
|
@@ -18,10 +19,6 @@ export const SuperadminProviderClientSchema = z.object({
|
|
|
18
19
|
.string()
|
|
19
20
|
.nullable()
|
|
20
21
|
.describe("Default datacenter for sites provisioned under this client."),
|
|
21
|
-
defaultPhpVersion: z
|
|
22
|
-
.string()
|
|
23
|
-
.nullable()
|
|
24
|
-
.describe("Default PHP version for sites provisioned under this client."),
|
|
25
22
|
status: providerClientStatus.describe("Whether this client identity can provision sites."),
|
|
26
23
|
tokenHint: z
|
|
27
24
|
.string()
|
|
@@ -47,7 +44,6 @@ export const superadminProviderClientCreateSchema = z.object({
|
|
|
47
44
|
apiToken: z.string().trim().min(1),
|
|
48
45
|
apiBase: z.string().url().optional(),
|
|
49
46
|
defaultDatacenter: z.string().trim().min(1).optional(),
|
|
50
|
-
defaultPhpVersion: z.string().trim().min(1).optional(),
|
|
51
47
|
tenantId: z.string().trim().min(1),
|
|
52
48
|
});
|
|
53
49
|
export const superadminProviderClientPatchSchema = z.object({
|
|
@@ -56,7 +52,6 @@ export const superadminProviderClientPatchSchema = z.object({
|
|
|
56
52
|
apiToken: z.string().trim().min(1).optional(),
|
|
57
53
|
apiBase: z.string().url().nullable().optional(),
|
|
58
54
|
defaultDatacenter: z.string().trim().min(1).nullable().optional(),
|
|
59
|
-
defaultPhpVersion: z.string().trim().min(1).nullable().optional(),
|
|
60
55
|
status: providerClientStatus.optional(),
|
|
61
56
|
tenantId: z.string().trim().min(1).optional(),
|
|
62
57
|
});
|
|
@@ -72,6 +67,11 @@ export const superadminProviderClientTestResponseSchema = z.object({
|
|
|
72
67
|
export const SuperadminTenantSchema = z.object({
|
|
73
68
|
id: z.string().describe("Tenant id (`ten_`); the main tenant is `ten_main`."),
|
|
74
69
|
kind: tenantKind,
|
|
70
|
+
mode: tenantMode.describe("`test` for a linked test tenant (a sandbox twin), `live` otherwise."),
|
|
71
|
+
liveTenantId: z
|
|
72
|
+
.string()
|
|
73
|
+
.nullable()
|
|
74
|
+
.describe("For a test tenant, the live tenant it is linked to; null on live tenants."),
|
|
75
75
|
name: z.string(),
|
|
76
76
|
status: tenantStatus,
|
|
77
77
|
servingGraceUntil: z
|
|
@@ -110,3 +110,22 @@ export const superadminTenantPatchSchema = z.object({
|
|
|
110
110
|
defaultRegion: z.string().trim().min(1).nullable().optional(),
|
|
111
111
|
metadata: z.record(z.string(), z.string()).nullable().optional(),
|
|
112
112
|
});
|
|
113
|
+
// A tenant-rooted `partner_admin` credential minted for a partner tenant. This
|
|
114
|
+
// is the one-time bootstrap: the secret is returned here and never again, and
|
|
115
|
+
// the holder can then mint its own scoped keys for its customers.
|
|
116
|
+
export const SuperadminBootstrapKeySchema = ApiKeySchema.describe("A freshly minted tenant-rooted partner_admin API key. Its `secret` is returned once, here only.");
|
|
117
|
+
// One side of a partner pair: the tenant plus its one-time bootstrap key.
|
|
118
|
+
export const SuperadminTenantWithBootstrapKeySchema = z.object({
|
|
119
|
+
tenant: SuperadminTenantSchema,
|
|
120
|
+
bootstrapKey: SuperadminBootstrapKeySchema,
|
|
121
|
+
});
|
|
122
|
+
// Creating a partner mints a live+test PAIR: a live tenant and its linked test
|
|
123
|
+
// twin, each with its own tenant-rooted `partner_admin` bootstrap key. The two
|
|
124
|
+
// secrets are the partner's `sk_live` / `sk_test` separation — returned once,
|
|
125
|
+
// here only. `test.tenant.liveTenantId` points back at `live.tenant.id`.
|
|
126
|
+
export const SuperadminTenantPairSchema = z
|
|
127
|
+
.object({
|
|
128
|
+
live: SuperadminTenantWithBootstrapKeySchema,
|
|
129
|
+
test: SuperadminTenantWithBootstrapKeySchema,
|
|
130
|
+
})
|
|
131
|
+
.describe("A newly onboarded partner: the live tenant and its linked test twin, each with its bootstrap key.");
|
|
@@ -10,20 +10,24 @@ export declare const SuperadminAccessSchema: z.ZodObject<{
|
|
|
10
10
|
userId: z.ZodNullable<z.ZodString>;
|
|
11
11
|
role: z.ZodNullable<z.ZodString>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
+
/**
|
|
14
|
+
* `stattic_auth_user.role` is Better Auth's admin-plugin column: a
|
|
15
|
+
* comma-separated list, so "superadmin" is one role among others rather than a
|
|
16
|
+
* separate grant table.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SUPERADMIN_ROLE = "superadmin";
|
|
19
|
+
export declare function parseUserRoles(roleValue: string | null | undefined): string[];
|
|
13
20
|
export declare const SuperadminUserProfileSchema: z.ZodObject<{
|
|
14
21
|
tenantId: z.ZodString;
|
|
15
22
|
analyticsId: z.ZodString;
|
|
16
23
|
image: z.ZodNullable<z.ZodString>;
|
|
17
|
-
username: z.ZodNullable<z.ZodString>;
|
|
18
|
-
displayUsername: z.ZodNullable<z.ZodString>;
|
|
19
24
|
emailVerified: z.ZodBoolean;
|
|
20
25
|
isAutomattician: z.ZodBoolean;
|
|
21
|
-
|
|
26
|
+
automatticBetaGrant: z.ZodBoolean;
|
|
27
|
+
wpcomLinked: z.ZodBoolean;
|
|
22
28
|
betaEnrolledAt: z.ZodNullable<z.ZodString>;
|
|
23
|
-
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
24
29
|
twoFactorEnabled: z.ZodBoolean;
|
|
25
30
|
theme: z.ZodString;
|
|
26
|
-
wpcomProfileJson: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
27
31
|
}, z.core.$strip>;
|
|
28
32
|
export declare const SuperadminUserTeamSchema: z.ZodObject<{
|
|
29
33
|
membershipId: z.ZodString;
|
|
@@ -49,16 +53,13 @@ export declare const SuperadminUserSchema: z.ZodObject<{
|
|
|
49
53
|
tenantId: z.ZodString;
|
|
50
54
|
analyticsId: z.ZodString;
|
|
51
55
|
image: z.ZodNullable<z.ZodString>;
|
|
52
|
-
username: z.ZodNullable<z.ZodString>;
|
|
53
|
-
displayUsername: z.ZodNullable<z.ZodString>;
|
|
54
56
|
emailVerified: z.ZodBoolean;
|
|
55
57
|
isAutomattician: z.ZodBoolean;
|
|
56
|
-
|
|
58
|
+
automatticBetaGrant: z.ZodBoolean;
|
|
59
|
+
wpcomLinked: z.ZodBoolean;
|
|
57
60
|
betaEnrolledAt: z.ZodNullable<z.ZodString>;
|
|
58
|
-
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
59
61
|
twoFactorEnabled: z.ZodBoolean;
|
|
60
62
|
theme: z.ZodString;
|
|
61
|
-
wpcomProfileJson: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
62
63
|
}, z.core.$strip>;
|
|
63
64
|
teams: z.ZodArray<z.ZodObject<{
|
|
64
65
|
membershipId: z.ZodString;
|
|
@@ -71,6 +72,87 @@ export declare const SuperadminUserSchema: z.ZodObject<{
|
|
|
71
72
|
teamCreatedAt: z.ZodString;
|
|
72
73
|
}, z.core.$strip>>;
|
|
73
74
|
}, z.core.$strip>;
|
|
75
|
+
/** One verified address the person owns. Unverified addresses have no row. */
|
|
76
|
+
export declare const SuperadminUserEmailSchema: z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
email: z.ZodString;
|
|
79
|
+
primary: z.ZodBoolean;
|
|
80
|
+
verifiedAt: z.ZodString;
|
|
81
|
+
verificationMethod: z.ZodString;
|
|
82
|
+
verificationSourceAccountId: z.ZodNullable<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
/** One linked sign-in method. `profileJson` is the provider's own snapshot. */
|
|
85
|
+
export declare const SuperadminUserAccountSchema: z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
providerId: z.ZodString;
|
|
88
|
+
accountId: z.ZodString;
|
|
89
|
+
emailObserved: z.ZodNullable<z.ZodString>;
|
|
90
|
+
emailVerifiedByProvider: z.ZodNullable<z.ZodBoolean>;
|
|
91
|
+
profileJson: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
92
|
+
createdAt: z.ZodString;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
/**
|
|
95
|
+
* Everything the list row carries plus the per-person collections. Kept off the
|
|
96
|
+
* list because provider profile blobs are unbounded.
|
|
97
|
+
*/
|
|
98
|
+
export declare const SuperadminUserDetailSchema: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
email: z.ZodString;
|
|
102
|
+
role: z.ZodNullable<z.ZodString>;
|
|
103
|
+
banned: z.ZodBoolean;
|
|
104
|
+
banReason: z.ZodNullable<z.ZodString>;
|
|
105
|
+
banExpires: z.ZodNullable<z.ZodString>;
|
|
106
|
+
createdAt: z.ZodString;
|
|
107
|
+
updatedAt: z.ZodString;
|
|
108
|
+
profile: z.ZodObject<{
|
|
109
|
+
tenantId: z.ZodString;
|
|
110
|
+
analyticsId: z.ZodString;
|
|
111
|
+
image: z.ZodNullable<z.ZodString>;
|
|
112
|
+
emailVerified: z.ZodBoolean;
|
|
113
|
+
isAutomattician: z.ZodBoolean;
|
|
114
|
+
automatticBetaGrant: z.ZodBoolean;
|
|
115
|
+
wpcomLinked: z.ZodBoolean;
|
|
116
|
+
betaEnrolledAt: z.ZodNullable<z.ZodString>;
|
|
117
|
+
twoFactorEnabled: z.ZodBoolean;
|
|
118
|
+
theme: z.ZodString;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
teams: z.ZodArray<z.ZodObject<{
|
|
121
|
+
membershipId: z.ZodString;
|
|
122
|
+
membershipRole: z.ZodString;
|
|
123
|
+
membershipCreatedAt: z.ZodString;
|
|
124
|
+
teamId: z.ZodString;
|
|
125
|
+
teamSlug: z.ZodString;
|
|
126
|
+
teamName: z.ZodString;
|
|
127
|
+
teamTenantId: z.ZodString;
|
|
128
|
+
teamCreatedAt: z.ZodString;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
emails: z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
email: z.ZodString;
|
|
133
|
+
primary: z.ZodBoolean;
|
|
134
|
+
verifiedAt: z.ZodString;
|
|
135
|
+
verificationMethod: z.ZodString;
|
|
136
|
+
verificationSourceAccountId: z.ZodNullable<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
providerId: z.ZodString;
|
|
141
|
+
accountId: z.ZodString;
|
|
142
|
+
emailObserved: z.ZodNullable<z.ZodString>;
|
|
143
|
+
emailVerifiedByProvider: z.ZodNullable<z.ZodBoolean>;
|
|
144
|
+
profileJson: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
145
|
+
createdAt: z.ZodString;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
pendingDeletionAt: z.ZodNullable<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
/**
|
|
150
|
+
* The submitted list replaces the stored one, so the caller carries forward
|
|
151
|
+
* whatever it means to keep, including roles its UI does not know about.
|
|
152
|
+
*/
|
|
153
|
+
export declare const superadminUserRoleUpdateSchema: z.ZodObject<{
|
|
154
|
+
roles: z.ZodArray<z.ZodString>;
|
|
155
|
+
}, z.core.$strip>;
|
|
74
156
|
export declare const superadminUserListQuerySchema: z.ZodObject<{
|
|
75
157
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
76
158
|
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -91,16 +173,13 @@ export declare const SuperadminUserListSchema: z.ZodObject<{
|
|
|
91
173
|
tenantId: z.ZodString;
|
|
92
174
|
analyticsId: z.ZodString;
|
|
93
175
|
image: z.ZodNullable<z.ZodString>;
|
|
94
|
-
username: z.ZodNullable<z.ZodString>;
|
|
95
|
-
displayUsername: z.ZodNullable<z.ZodString>;
|
|
96
176
|
emailVerified: z.ZodBoolean;
|
|
97
177
|
isAutomattician: z.ZodBoolean;
|
|
98
|
-
|
|
178
|
+
automatticBetaGrant: z.ZodBoolean;
|
|
179
|
+
wpcomLinked: z.ZodBoolean;
|
|
99
180
|
betaEnrolledAt: z.ZodNullable<z.ZodString>;
|
|
100
|
-
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
101
181
|
twoFactorEnabled: z.ZodBoolean;
|
|
102
182
|
theme: z.ZodString;
|
|
103
|
-
wpcomProfileJson: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
104
183
|
}, z.core.$strip>;
|
|
105
184
|
teams: z.ZodArray<z.ZodObject<{
|
|
106
185
|
membershipId: z.ZodString;
|
|
@@ -139,11 +218,21 @@ export declare const superadminBuildInventoryQuerySchema: z.ZodObject<{
|
|
|
139
218
|
e2b: "e2b";
|
|
140
219
|
}>>;
|
|
141
220
|
repository: z.ZodOptional<z.ZodString>;
|
|
221
|
+
spaceId: z.ZodOptional<z.ZodString>;
|
|
142
222
|
}, z.core.$strip>;
|
|
143
223
|
export declare const SuperadminBuildInventoryItemSchema: z.ZodObject<{
|
|
144
224
|
id: z.ZodString;
|
|
145
225
|
ref: z.ZodString;
|
|
146
|
-
status: z.
|
|
226
|
+
status: z.ZodEnum<{
|
|
227
|
+
failed: "failed";
|
|
228
|
+
canceled: "canceled";
|
|
229
|
+
waiting_for_source: "waiting_for_source";
|
|
230
|
+
uploading_source: "uploading_source";
|
|
231
|
+
queued: "queued";
|
|
232
|
+
running: "running";
|
|
233
|
+
succeeded: "succeeded";
|
|
234
|
+
skipped: "skipped";
|
|
235
|
+
}>;
|
|
147
236
|
spaceId: z.ZodString;
|
|
148
237
|
spaceSlug: z.ZodNullable<z.ZodString>;
|
|
149
238
|
teamId: z.ZodNullable<z.ZodString>;
|
|
@@ -161,24 +250,25 @@ export declare const SuperadminBuildInventoryItemSchema: z.ZodObject<{
|
|
|
161
250
|
failureMessage: z.ZodNullable<z.ZodString>;
|
|
162
251
|
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
163
252
|
outputBytes: z.ZodNullable<z.ZodNumber>;
|
|
164
|
-
updatedAt: z.ZodString;
|
|
165
|
-
}, z.core.$strip>;
|
|
166
|
-
export declare const SuperadminWebhookDeliverySchema: z.ZodObject<{
|
|
167
|
-
id: z.ZodString;
|
|
168
|
-
deliveryId: z.ZodString;
|
|
169
|
-
eventName: z.ZodString;
|
|
170
|
-
action: z.ZodNullable<z.ZodString>;
|
|
171
|
-
repositoryFullName: z.ZodNullable<z.ZodString>;
|
|
172
|
-
status: z.ZodString;
|
|
173
|
-
statusMessage: z.ZodNullable<z.ZodString>;
|
|
174
253
|
createdAt: z.ZodString;
|
|
254
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
255
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
175
256
|
updatedAt: z.ZodString;
|
|
176
257
|
}, z.core.$strip>;
|
|
177
|
-
export declare const
|
|
178
|
-
|
|
258
|
+
export declare const SuperadminBuildDetailSchema: z.ZodObject<{
|
|
259
|
+
build: z.ZodObject<{
|
|
179
260
|
id: z.ZodString;
|
|
180
261
|
ref: z.ZodString;
|
|
181
|
-
status: z.
|
|
262
|
+
status: z.ZodEnum<{
|
|
263
|
+
failed: "failed";
|
|
264
|
+
canceled: "canceled";
|
|
265
|
+
waiting_for_source: "waiting_for_source";
|
|
266
|
+
uploading_source: "uploading_source";
|
|
267
|
+
queued: "queued";
|
|
268
|
+
running: "running";
|
|
269
|
+
succeeded: "succeeded";
|
|
270
|
+
skipped: "skipped";
|
|
271
|
+
}>;
|
|
182
272
|
spaceId: z.ZodString;
|
|
183
273
|
spaceSlug: z.ZodNullable<z.ZodString>;
|
|
184
274
|
teamId: z.ZodNullable<z.ZodString>;
|
|
@@ -196,20 +286,122 @@ export declare const SuperadminBuildInventorySchema: z.ZodObject<{
|
|
|
196
286
|
failureMessage: z.ZodNullable<z.ZodString>;
|
|
197
287
|
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
198
288
|
outputBytes: z.ZodNullable<z.ZodNumber>;
|
|
289
|
+
createdAt: z.ZodString;
|
|
290
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
291
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
199
292
|
updatedAt: z.ZodString;
|
|
293
|
+
inputKind: z.ZodString;
|
|
294
|
+
command: z.ZodNullable<z.ZodString>;
|
|
295
|
+
retryOfBuildId: z.ZodNullable<z.ZodString>;
|
|
296
|
+
producedVersionId: z.ZodNullable<z.ZodString>;
|
|
297
|
+
reusedVersionId: z.ZodNullable<z.ZodString>;
|
|
298
|
+
settings: z.ZodObject<{
|
|
299
|
+
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
301
|
+
installCommand: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
302
|
+
buildCommand: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
303
|
+
outputDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
304
|
+
ignoredBuildCommand: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
305
|
+
frameworkPreset: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
306
|
+
platformPreset: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
307
|
+
allowUnsupportedPlatformFeatures: z.ZodDefault<z.ZodBoolean>;
|
|
308
|
+
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
target: z.ZodObject<{
|
|
311
|
+
channel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
312
|
+
preview: z.ZodDefault<z.ZodBoolean>;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
execution: z.ZodNullable<z.ZodObject<{
|
|
316
|
+
logOffset: z.ZodNullable<z.ZodNumber>;
|
|
317
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
318
|
+
terminationReason: z.ZodNullable<z.ZodEnum<{
|
|
319
|
+
command: "command";
|
|
320
|
+
timeout: "timeout";
|
|
321
|
+
}>>;
|
|
322
|
+
artifactDeadlineAt: z.ZodNullable<z.ZodString>;
|
|
323
|
+
launch: z.ZodNullable<z.ZodObject<{
|
|
324
|
+
state: z.ZodEnum<{
|
|
325
|
+
started: "started";
|
|
326
|
+
starting: "starting";
|
|
327
|
+
rejected: "rejected";
|
|
328
|
+
}>;
|
|
329
|
+
requestedAt: z.ZodString;
|
|
330
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
331
|
+
pid: z.ZodNullable<z.ZodNumber>;
|
|
332
|
+
rejectedReason: z.ZodNullable<z.ZodString>;
|
|
333
|
+
}, z.core.$strip>>;
|
|
334
|
+
phases: z.ZodArray<z.ZodObject<{
|
|
335
|
+
phase: z.ZodString;
|
|
336
|
+
at: z.ZodString;
|
|
337
|
+
}, z.core.$strip>>;
|
|
200
338
|
}, z.core.$strip>>;
|
|
201
|
-
|
|
339
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
340
|
+
code: z.ZodString;
|
|
341
|
+
severity: z.ZodEnum<{
|
|
342
|
+
info: "info";
|
|
343
|
+
warning: "warning";
|
|
344
|
+
error: "error";
|
|
345
|
+
}>;
|
|
346
|
+
message: z.ZodString;
|
|
347
|
+
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
349
|
+
registrar: "registrar";
|
|
350
|
+
infra: "infra";
|
|
351
|
+
dns: "dns";
|
|
352
|
+
runtime: "runtime";
|
|
353
|
+
}>>>;
|
|
354
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
355
|
+
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
356
|
+
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
357
|
+
}, z.core.$strip>>;
|
|
358
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
359
|
+
timestamp: z.ZodString;
|
|
360
|
+
level: z.ZodString;
|
|
361
|
+
code: z.ZodString;
|
|
362
|
+
message: z.ZodString;
|
|
363
|
+
}, z.core.$strip>>;
|
|
364
|
+
logCount: z.ZodNumber;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
export declare const SuperadminBuildInventorySchema: z.ZodObject<{
|
|
367
|
+
builds: z.ZodArray<z.ZodObject<{
|
|
202
368
|
id: z.ZodString;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
369
|
+
ref: z.ZodString;
|
|
370
|
+
status: z.ZodEnum<{
|
|
371
|
+
failed: "failed";
|
|
372
|
+
canceled: "canceled";
|
|
373
|
+
waiting_for_source: "waiting_for_source";
|
|
374
|
+
uploading_source: "uploading_source";
|
|
375
|
+
queued: "queued";
|
|
376
|
+
running: "running";
|
|
377
|
+
succeeded: "succeeded";
|
|
378
|
+
skipped: "skipped";
|
|
379
|
+
}>;
|
|
380
|
+
spaceId: z.ZodString;
|
|
381
|
+
spaceSlug: z.ZodNullable<z.ZodString>;
|
|
382
|
+
teamId: z.ZodNullable<z.ZodString>;
|
|
383
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
384
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
385
|
+
pullRequestNumber: z.ZodNullable<z.ZodNumber>;
|
|
386
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
387
|
+
driver: z.ZodNullable<z.ZodString>;
|
|
388
|
+
sandboxId: z.ZodNullable<z.ZodString>;
|
|
389
|
+
runnerJobId: z.ZodNullable<z.ZodString>;
|
|
390
|
+
region: z.ZodNullable<z.ZodString>;
|
|
391
|
+
executionMetadataKeys: z.ZodArray<z.ZodString>;
|
|
392
|
+
e2bTemplateId: z.ZodNullable<z.ZodString>;
|
|
393
|
+
failureCode: z.ZodNullable<z.ZodString>;
|
|
394
|
+
failureMessage: z.ZodNullable<z.ZodString>;
|
|
395
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
396
|
+
outputBytes: z.ZodNullable<z.ZodNumber>;
|
|
209
397
|
createdAt: z.ZodString;
|
|
398
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
399
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
210
400
|
updatedAt: z.ZodString;
|
|
211
401
|
}, z.core.$strip>>;
|
|
212
402
|
}, z.core.$strip>;
|
|
403
|
+
export type SuperadminBuildInventoryItem = z.infer<typeof SuperadminBuildInventoryItemSchema>;
|
|
404
|
+
export type SuperadminBuildDetail = z.infer<typeof SuperadminBuildDetailSchema>;
|
|
213
405
|
export declare const superadminPlanGrantCreateSchema: z.ZodObject<{
|
|
214
406
|
team: z.ZodString;
|
|
215
407
|
plan: z.ZodEnum<{
|
|
@@ -268,9 +460,9 @@ export declare const SuperadminPlanGrantListSchema: z.ZodObject<{
|
|
|
268
460
|
export declare const superadminAddonCreateSchema: z.ZodObject<{
|
|
269
461
|
team: z.ZodString;
|
|
270
462
|
limit: z.ZodEnum<{
|
|
463
|
+
storageBytes: "storageBytes";
|
|
271
464
|
teamMembers: "teamMembers";
|
|
272
465
|
subTeams: "subTeams";
|
|
273
|
-
storageBytes: "storageBytes";
|
|
274
466
|
externalDomainGroups: "externalDomainGroups";
|
|
275
467
|
}>;
|
|
276
468
|
amount: z.ZodNumber;
|
|
@@ -538,4 +730,7 @@ export declare const SuperadminAnonymousPoolListSchema: z.ZodObject<{
|
|
|
538
730
|
}, z.core.$strip>;
|
|
539
731
|
}, z.core.$strip>;
|
|
540
732
|
export type SuperadminUser = z.infer<typeof SuperadminUserSchema>;
|
|
733
|
+
export type SuperadminUserDetail = z.infer<typeof SuperadminUserDetailSchema>;
|
|
734
|
+
export type SuperadminUserEmail = z.infer<typeof SuperadminUserEmailSchema>;
|
|
735
|
+
export type SuperadminUserAccount = z.infer<typeof SuperadminUserAccountSchema>;
|
|
541
736
|
export type SuperadminUserList = z.infer<typeof SuperadminUserListSchema>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { BuildSettingsSchema, BuildTargetSchema } from "./builds.js";
|
|
3
|
+
import { baseDiagnosticSchema } from "./common.js";
|
|
2
4
|
import { makeOffsetListSchema } from "./common.js";
|
|
3
5
|
import { buildStatus } from "./enums.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
import { PLAN_CODES } from "./features.js";
|
|
7
|
+
import { versionLogEntrySchema } from "./spaces.js";
|
|
8
|
+
// Operator-only offset pagination. The platform API uses opaque cursors
|
|
9
|
+
// (contracts/common.ts); this is the one exception.
|
|
6
10
|
export const superadminPaginationSchema = z.object({
|
|
7
11
|
count: z.number().int().nonnegative(),
|
|
8
12
|
next: z.number().int().nonnegative().nullable(),
|
|
@@ -13,20 +17,33 @@ export const SuperadminAccessSchema = z.object({
|
|
|
13
17
|
userId: z.string().nullable(),
|
|
14
18
|
role: z.string().nullable(),
|
|
15
19
|
});
|
|
20
|
+
/**
|
|
21
|
+
* `stattic_auth_user.role` is Better Auth's admin-plugin column: a
|
|
22
|
+
* comma-separated list, so "superadmin" is one role among others rather than a
|
|
23
|
+
* separate grant table.
|
|
24
|
+
*/
|
|
25
|
+
export const SUPERADMIN_ROLE = "superadmin";
|
|
26
|
+
export function parseUserRoles(roleValue) {
|
|
27
|
+
return (roleValue ?? "").split(",").flatMap((entry) => {
|
|
28
|
+
const role = entry.trim();
|
|
29
|
+
return role ? [role] : [];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
16
32
|
export const SuperadminUserProfileSchema = z.object({
|
|
17
33
|
tenantId: z.string(),
|
|
18
34
|
analyticsId: z.string(),
|
|
19
35
|
image: z.string().nullable(),
|
|
20
|
-
username: z.string().nullable(),
|
|
21
|
-
displayUsername: z.string().nullable(),
|
|
22
36
|
emailVerified: z.boolean(),
|
|
23
37
|
isAutomattician: z.boolean(),
|
|
24
|
-
|
|
38
|
+
automatticBetaGrant: z.boolean(),
|
|
39
|
+
/**
|
|
40
|
+
* A live linked wp.com account row — distinct from beta-admission
|
|
41
|
+
* provenance, which survives unlinking. Gates the superadmin grant.
|
|
42
|
+
*/
|
|
43
|
+
wpcomLinked: z.boolean(),
|
|
25
44
|
betaEnrolledAt: z.string().datetime().nullable(),
|
|
26
|
-
stripeCustomerId: z.string().nullable(),
|
|
27
45
|
twoFactorEnabled: z.boolean(),
|
|
28
46
|
theme: z.string(),
|
|
29
|
-
wpcomProfileJson: z.record(z.string(), z.unknown()).nullable(),
|
|
30
47
|
});
|
|
31
48
|
export const SuperadminUserTeamSchema = z.object({
|
|
32
49
|
membershipId: z.string(),
|
|
@@ -51,6 +68,42 @@ export const SuperadminUserSchema = z.object({
|
|
|
51
68
|
profile: SuperadminUserProfileSchema,
|
|
52
69
|
teams: z.array(SuperadminUserTeamSchema),
|
|
53
70
|
});
|
|
71
|
+
/** One verified address the person owns. Unverified addresses have no row. */
|
|
72
|
+
export const SuperadminUserEmailSchema = z.object({
|
|
73
|
+
id: z.string(),
|
|
74
|
+
email: z.string(),
|
|
75
|
+
primary: z.boolean(),
|
|
76
|
+
verifiedAt: z.string().datetime(),
|
|
77
|
+
verificationMethod: z.string(),
|
|
78
|
+
verificationSourceAccountId: z.string().nullable(),
|
|
79
|
+
});
|
|
80
|
+
/** One linked sign-in method. `profileJson` is the provider's own snapshot. */
|
|
81
|
+
export const SuperadminUserAccountSchema = z.object({
|
|
82
|
+
id: z.string(),
|
|
83
|
+
providerId: z.string(),
|
|
84
|
+
accountId: z.string(),
|
|
85
|
+
emailObserved: z.string().nullable(),
|
|
86
|
+
emailVerifiedByProvider: z.boolean().nullable(),
|
|
87
|
+
profileJson: z.record(z.string(), z.unknown()).nullable(),
|
|
88
|
+
createdAt: z.string().datetime(),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Everything the list row carries plus the per-person collections. Kept off the
|
|
92
|
+
* list because provider profile blobs are unbounded.
|
|
93
|
+
*/
|
|
94
|
+
export const SuperadminUserDetailSchema = SuperadminUserSchema.extend({
|
|
95
|
+
emails: z.array(SuperadminUserEmailSchema),
|
|
96
|
+
accounts: z.array(SuperadminUserAccountSchema),
|
|
97
|
+
/** Non-null while a self-serve close request is queued or running. */
|
|
98
|
+
pendingDeletionAt: z.string().datetime().nullable(),
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* The submitted list replaces the stored one, so the caller carries forward
|
|
102
|
+
* whatever it means to keep, including roles its UI does not know about.
|
|
103
|
+
*/
|
|
104
|
+
export const superadminUserRoleUpdateSchema = z.object({
|
|
105
|
+
roles: z.array(z.string().trim().min(1)).min(1).max(16),
|
|
106
|
+
});
|
|
54
107
|
export const superadminUserListQuerySchema = z.object({
|
|
55
108
|
limit: z.coerce.number().int().min(1).max(100).default(25),
|
|
56
109
|
offset: z.coerce.number().int().min(0).default(0),
|
|
@@ -61,11 +114,12 @@ export const superadminBuildInventoryQuerySchema = z.object({
|
|
|
61
114
|
status: z.union([z.literal("all"), buildStatus]).default("all"),
|
|
62
115
|
driver: z.enum(["all", "e2b", "local"]).default("all"),
|
|
63
116
|
repository: z.string().trim().optional(),
|
|
117
|
+
spaceId: z.string().trim().min(1).optional(),
|
|
64
118
|
});
|
|
65
119
|
export const SuperadminBuildInventoryItemSchema = z.object({
|
|
66
120
|
id: z.string(),
|
|
67
121
|
ref: z.string(),
|
|
68
|
-
status:
|
|
122
|
+
status: buildStatus,
|
|
69
123
|
spaceId: z.string(),
|
|
70
124
|
spaceSlug: z.string().nullable(),
|
|
71
125
|
teamId: z.string().nullable(),
|
|
@@ -83,28 +137,58 @@ export const SuperadminBuildInventoryItemSchema = z.object({
|
|
|
83
137
|
failureMessage: z.string().nullable(),
|
|
84
138
|
durationMs: z.number().nullable(),
|
|
85
139
|
outputBytes: z.number().nullable(),
|
|
86
|
-
updatedAt: z.string().datetime(),
|
|
87
|
-
});
|
|
88
|
-
export const SuperadminWebhookDeliverySchema = z.object({
|
|
89
|
-
id: z.string(),
|
|
90
|
-
deliveryId: z.string(),
|
|
91
|
-
eventName: z.string(),
|
|
92
|
-
action: z.string().nullable(),
|
|
93
|
-
repositoryFullName: z.string().nullable(),
|
|
94
|
-
status: z.string(),
|
|
95
|
-
statusMessage: z.string().nullable(),
|
|
96
140
|
createdAt: z.string().datetime(),
|
|
141
|
+
startedAt: z.string().datetime().nullable(),
|
|
142
|
+
finishedAt: z.string().datetime().nullable(),
|
|
97
143
|
updatedAt: z.string().datetime(),
|
|
98
144
|
});
|
|
145
|
+
export const SuperadminBuildDetailSchema = z.object({
|
|
146
|
+
build: SuperadminBuildInventoryItemSchema.extend({
|
|
147
|
+
inputKind: z.string(),
|
|
148
|
+
command: z.string().nullable(),
|
|
149
|
+
retryOfBuildId: z.string().nullable(),
|
|
150
|
+
producedVersionId: z.string().nullable(),
|
|
151
|
+
reusedVersionId: z.string().nullable(),
|
|
152
|
+
settings: BuildSettingsSchema,
|
|
153
|
+
target: BuildTargetSchema,
|
|
154
|
+
}),
|
|
155
|
+
execution: z
|
|
156
|
+
.object({
|
|
157
|
+
logOffset: z.number().int().nonnegative().nullable(),
|
|
158
|
+
exitCode: z.number().int().min(0).max(255).nullable(),
|
|
159
|
+
terminationReason: z.enum(["command", "timeout"]).nullable(),
|
|
160
|
+
artifactDeadlineAt: z.string().datetime().nullable(),
|
|
161
|
+
launch: z
|
|
162
|
+
.object({
|
|
163
|
+
state: z.enum(["starting", "started", "rejected"]),
|
|
164
|
+
requestedAt: z.string().datetime(),
|
|
165
|
+
startedAt: z.string().datetime().nullable(),
|
|
166
|
+
pid: z.number().int().nullable(),
|
|
167
|
+
rejectedReason: z.string().nullable(),
|
|
168
|
+
})
|
|
169
|
+
.nullable(),
|
|
170
|
+
phases: z.array(z.object({
|
|
171
|
+
phase: z.string(),
|
|
172
|
+
at: z.string().datetime(),
|
|
173
|
+
})),
|
|
174
|
+
})
|
|
175
|
+
.nullable(),
|
|
176
|
+
diagnostics: z.array(baseDiagnosticSchema),
|
|
177
|
+
// Newest first, capped server-side; logCount is the uncapped total.
|
|
178
|
+
logs: z.array(versionLogEntrySchema),
|
|
179
|
+
logCount: z.number().int().nonnegative(),
|
|
180
|
+
});
|
|
99
181
|
export const SuperadminBuildInventorySchema = z.object({
|
|
100
182
|
builds: z.array(SuperadminBuildInventoryItemSchema),
|
|
101
|
-
webhookDeliveries: z.array(SuperadminWebhookDeliverySchema),
|
|
102
183
|
});
|
|
103
|
-
//
|
|
104
|
-
//
|
|
184
|
+
// Plan grants: operator-issued plan entitlements with no payment provider and
|
|
185
|
+
// no transactions behind them. `free` is the default every team already has, so
|
|
186
|
+
// there is nothing to grant; the rest of the plan vocabulary comes from the
|
|
187
|
+
// contract rather than a second list.
|
|
188
|
+
const GRANTABLE_PLAN_CODES = PLAN_CODES.filter((code) => code !== "free");
|
|
105
189
|
export const superadminPlanGrantCreateSchema = z.object({
|
|
106
190
|
team: z.string().trim().min(1).describe("Team id or slug."),
|
|
107
|
-
plan: z.enum(
|
|
191
|
+
plan: z.enum(GRANTABLE_PLAN_CODES),
|
|
108
192
|
note: z.string().trim().max(500).optional(),
|
|
109
193
|
/** Omit for a non-expiring grant. */
|
|
110
194
|
expiresAt: z.string().datetime().optional(),
|