@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
package/dist/contracts/enums.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
// Space operation-lifecycle axis (
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// Space operation-lifecycle axis (the platform spec "Space"). Serving
|
|
3
|
+
// (disabled) and deletion (deletedAt) are separate axes, so a disabled space
|
|
4
|
+
// can still be updating. There is no `moving`: a space IS a site, so ownership
|
|
5
|
+
// changes commit in place.
|
|
6
6
|
export const spaceStatusValues = [
|
|
7
7
|
"provisioning",
|
|
8
8
|
"active",
|
|
@@ -11,7 +11,7 @@ export const spaceStatusValues = [
|
|
|
11
11
|
"failed",
|
|
12
12
|
];
|
|
13
13
|
export const spaceStatus = z.enum(spaceStatusValues);
|
|
14
|
-
// Serving-axis disable reasons (
|
|
14
|
+
// Serving-axis disable reasons (the platform spec "Space"). Confirmed
|
|
15
15
|
// scan takedowns use `abuse_takedown`; infected state and claim invalidation
|
|
16
16
|
// are explicit enforcement effects, not reason metadata.
|
|
17
17
|
export const spaceDisabledReasonCodeValues = [
|
|
@@ -19,18 +19,16 @@ export const spaceDisabledReasonCodeValues = [
|
|
|
19
19
|
"abuse_takedown",
|
|
20
20
|
"tenant_suspended",
|
|
21
21
|
"site_suspended",
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
22
|
+
// The owner, or the holder of an unclaimed space's key, deleted the Space.
|
|
23
|
+
// Serving stops while data remains retained for deliberate cleanup. An
|
|
24
|
+
// unclaimed key survives so it can restore or claim during its claim window.
|
|
25
25
|
"author_removed",
|
|
26
26
|
];
|
|
27
27
|
export const spaceDisabledReasonCode = z.enum(spaceDisabledReasonCodeValues);
|
|
28
|
-
// SpaceTransfer status machine (
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// state and no `failed` state. Withdraw (from-side) and decline (to-side)
|
|
33
|
-
// both land on `canceled`.
|
|
28
|
+
// SpaceTransfer status machine (the platform spec "Transfer semantics"),
|
|
29
|
+
// stored directly with no separate DB vocabulary. Accepting moves ownership in
|
|
30
|
+
// one database transaction, so there is no intermediate moving state and no
|
|
31
|
+
// `failed` state. Withdraw and decline both land on `canceled`.
|
|
34
32
|
export const spaceTransferStatusValues = [
|
|
35
33
|
"pending_confirmation",
|
|
36
34
|
"completed",
|
|
@@ -38,14 +36,21 @@ export const spaceTransferStatusValues = [
|
|
|
38
36
|
"expired",
|
|
39
37
|
];
|
|
40
38
|
export const spaceTransferStatus = z.enum(spaceTransferStatusValues);
|
|
41
|
-
// A tenant is the platform-account boundary that owns every resource
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
export const tenantKindValues = ["main", "platform", "partner", "internal"];
|
|
39
|
+
// A tenant is the platform-account boundary that owns every resource,
|
|
40
|
+
// Stripe-style. `main` is the single well-known account (`ten_main`) all
|
|
41
|
+
// self-serve teams/users live under; `partner` is a host integration with
|
|
42
|
+
// its own user directory and/or external customers; `internal` is for
|
|
43
|
+
// Spacefast-operated infrastructure tenants.
|
|
44
|
+
export const tenantKindValues = ["main", "partner", "internal"];
|
|
48
45
|
export const tenantKind = z.enum(tenantKindValues);
|
|
46
|
+
// A tenant's mode: `live` is a real partner account provisioning real sites;
|
|
47
|
+
// `test` is its linked sandbox twin — same partner API, isolated data,
|
|
48
|
+
// simulated provisioning, no real wp.cloud/DNS/email. Modeled as a SEPARATE
|
|
49
|
+
// tenant row linked back to its live parent via `liveTenantId`, never a column
|
|
50
|
+
// filtered into every resource query (partner-operations spec §1): isolation
|
|
51
|
+
// holds by construction because every resource is already `tenant_id`-scoped.
|
|
52
|
+
export const tenantModeValues = ["live", "test"];
|
|
53
|
+
export const tenantMode = z.enum(tenantModeValues);
|
|
49
54
|
// `past_due` is the billing-grace state: mutations are rejected immediately
|
|
50
55
|
// (`tenant_past_due`) but serving continues until `servingGraceUntil`, after
|
|
51
56
|
// which the tenant transitions to `suspended` and goes dark.
|
|
@@ -55,40 +60,22 @@ export const tenantStatus = z.enum(tenantStatusValues);
|
|
|
55
60
|
// (operator-only resource, `pvc_` prefix).
|
|
56
61
|
export const providerClientStatusValues = ["active", "disabled"];
|
|
57
62
|
export const providerClientStatus = z.enum(providerClientStatusValues);
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
export const siteIsolationValues = ["site", "space"];
|
|
67
|
-
export const siteIsolation = z.enum(siteIsolationValues);
|
|
68
|
-
// Site lifecycle. A dead-code sweep removed this vocabulary while two live
|
|
69
|
-
// consumers still needed it: the `sites` table's own status column and the
|
|
70
|
-
// superadmin provider-site search result. `ready_pool` is a pre-provisioned
|
|
71
|
-
// warm site waiting to be claimed — load-bearing now that every space draws
|
|
72
|
-
// its own site from the pool.
|
|
73
|
-
export const siteStatusValues = [
|
|
74
|
-
"ready_pool",
|
|
75
|
-
"active",
|
|
63
|
+
// Warm-pool inventory (`site_pool`): provider sites provisioned ahead of
|
|
64
|
+
// demand, with no owner yet. These statuses are the whole lifecycle a row has
|
|
65
|
+
// before a space adopts it and the row is deleted. `retired` holds a legacy
|
|
66
|
+
// migration source box that is never automatically promoted for deletion.
|
|
67
|
+
// `cleanup_pending` is the explicit, unclaimable queue for Superadmin review.
|
|
68
|
+
// This is a varchar type union, not a PostgreSQL enum, so adding a value needs
|
|
69
|
+
// no database migration.
|
|
70
|
+
export const poolSiteStatusValues = [
|
|
76
71
|
"provisioning",
|
|
72
|
+
"ready_pool",
|
|
77
73
|
"degraded",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
74
|
+
"retired",
|
|
75
|
+
"cleanup_pending",
|
|
80
76
|
];
|
|
81
|
-
export const siteStatus = z.enum(siteStatusValues);
|
|
82
|
-
// Warm-pool inventory (`site_pool`): provider sites provisioned ahead of
|
|
83
|
-
// demand, with no owner yet. A space IS a site, so these statuses are the
|
|
84
|
-
// whole lifecycle a row can have before a space adopts it and the row is
|
|
85
|
-
// deleted — `active`/`suspended`/`deleted` were live-space states and now live
|
|
86
|
-
// on the space's own axes. `retired` holds a drained space=site migration
|
|
87
|
-
// source box: not adoptable, not reapable, kept permanently — migration
|
|
88
|
-
// tooling never deletes a wp.cloud site (owner ruling 2026-08-11).
|
|
89
|
-
export const poolSiteStatusValues = ["provisioning", "ready_pool", "degraded", "retired"];
|
|
90
77
|
export const poolSiteStatus = z.enum(poolSiteStatusValues);
|
|
91
|
-
// PublishSource.kind (
|
|
78
|
+
// PublishSource.kind (the platform spec "PublishSource"): the single
|
|
92
79
|
// provenance axis for how a version came to exist. `variable_update` and
|
|
93
80
|
// `config_update` versions are minted by cascades/config regeneration.
|
|
94
81
|
export const publishSourceKindValues = [
|
|
@@ -105,7 +92,7 @@ export const publishSourceKindValues = [
|
|
|
105
92
|
];
|
|
106
93
|
export const publishSourceKind = z.enum(publishSourceKindValues);
|
|
107
94
|
export const versionStatusValues = [
|
|
108
|
-
// Spec state machine (
|
|
95
|
+
// Spec state machine (the platform spec "Upload Contract"):
|
|
109
96
|
// created -> uploading -> uploaded -> finalizing -> ready, with terminal
|
|
110
97
|
// failed/canceled/expired. Build runs are tracked on the Build resource;
|
|
111
98
|
// a building version stays `created` until upload starts.
|
|
@@ -126,14 +113,14 @@ export const versionStatusValues = [
|
|
|
126
113
|
export const versionStatus = z.enum(versionStatusValues);
|
|
127
114
|
export const gitProviderValues = ["github", "gitlab", "bitbucket", "generic"];
|
|
128
115
|
export const gitProvider = z.enum(gitProviderValues);
|
|
129
|
-
// Pre-ready, non-terminal statuses
|
|
116
|
+
// Pre-ready, non-terminal statuses.
|
|
130
117
|
export const VERSION_IN_FLIGHT_STATUSES = [
|
|
131
118
|
"created",
|
|
132
119
|
"uploading",
|
|
133
120
|
"uploaded",
|
|
134
121
|
"finalizing",
|
|
135
122
|
];
|
|
136
|
-
// Build resource statuses (
|
|
123
|
+
// Build resource statuses (the platform spec "Build", `bld_`).
|
|
137
124
|
export const buildStatusValues = [
|
|
138
125
|
"waiting_for_source",
|
|
139
126
|
"uploading_source",
|
|
@@ -145,10 +132,34 @@ export const buildStatusValues = [
|
|
|
145
132
|
"skipped",
|
|
146
133
|
];
|
|
147
134
|
export const buildStatus = z.enum(buildStatusValues);
|
|
135
|
+
/**
|
|
136
|
+
* The one authoritative "this build can still change on its own" set. Poll
|
|
137
|
+
* cadences, cancelability, activity checks and webhook re-enqueue gates all
|
|
138
|
+
* derive from it — never restate it.
|
|
139
|
+
*/
|
|
140
|
+
export const BUILD_IN_FLIGHT_STATUSES = [
|
|
141
|
+
"waiting_for_source",
|
|
142
|
+
"uploading_source",
|
|
143
|
+
"queued",
|
|
144
|
+
"running",
|
|
145
|
+
];
|
|
146
|
+
const buildInFlightStatusSet = new Set(BUILD_IN_FLIGHT_STATUSES);
|
|
147
|
+
/**
|
|
148
|
+
* Its complement: a build that has settled and will never move again.
|
|
149
|
+
* `skipped` is terminal — a build the runner decided not to run at all.
|
|
150
|
+
*/
|
|
151
|
+
export const BUILD_TERMINAL_STATUSES = buildStatusValues.filter((status) => !buildInFlightStatusSet.has(status));
|
|
152
|
+
const buildTerminalStatusSet = new Set(BUILD_TERMINAL_STATUSES);
|
|
153
|
+
export function buildIsInFlight(status) {
|
|
154
|
+
return buildInFlightStatusSet.has(status);
|
|
155
|
+
}
|
|
156
|
+
export function buildIsTerminal(status) {
|
|
157
|
+
return buildTerminalStatusSet.has(status);
|
|
158
|
+
}
|
|
148
159
|
export const diagnosticSeverity = z.enum(["info", "warning", "error"]);
|
|
149
|
-
// Upstream system a Diagnostic originated from
|
|
150
|
-
//
|
|
151
|
-
export const diagnosticProvider = z.enum(["
|
|
160
|
+
// Upstream system a Diagnostic originated from. Absent when the diagnostic is
|
|
161
|
+
// Stattic's own (validation, routing compile, upload policy, ...).
|
|
162
|
+
export const diagnosticProvider = z.enum(["infra", "dns", "registrar", "runtime"]);
|
|
152
163
|
// Internal domain DB-column vocabularies (consumed by the control-plane schema;
|
|
153
164
|
// never part of the public Domain contract, which lives in contracts/domains.ts).
|
|
154
165
|
export const domainOwnershipTypeValues = [
|
|
@@ -200,9 +211,6 @@ export const safetyCategoryValues = [
|
|
|
200
211
|
export const safetyCategory = z.enum(safetyCategoryValues);
|
|
201
212
|
// Why a review item was closed (or a space taken down): the operator's verdict
|
|
202
213
|
// in one word, so enforcement quality is measurable without parsing notes.
|
|
203
|
-
// Confirmed-* reasons say the detection was right; the tail says it wasn't
|
|
204
|
-
// (false_positive, test_detection) or the item never needed its own verdict
|
|
205
|
-
// (duplicate, insufficient_evidence, other).
|
|
206
214
|
export const safetyResolutionReasonValues = [
|
|
207
215
|
"malware_confirmed",
|
|
208
216
|
"phishing_confirmed",
|
|
@@ -216,7 +224,6 @@ export const safetyResolutionReasonValues = [
|
|
|
216
224
|
"other",
|
|
217
225
|
];
|
|
218
226
|
export const safetyResolutionReason = z.enum(safetyResolutionReasonValues);
|
|
219
|
-
// 1 = suspicious, 2 = low, 3 = medium, 4 = high, 5 = critical.
|
|
220
227
|
export const SAFETY_SEVERITY = {
|
|
221
228
|
suspicious: 1,
|
|
222
229
|
low: 2,
|