@spacefast/common 0.0.24 → 0.0.26
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.js +1 -1
- package/dist/agents/private-key-oauth.d.ts +0 -1
- package/dist/agents/private-key-oauth.js +46 -63
- package/dist/brand-assets-build.js +4 -6
- package/dist/brand-assets.d.ts +5 -15
- package/dist/brand-assets.js +15 -14
- package/dist/config/domains.d.ts +47 -7
- package/dist/config/domains.js +65 -10
- package/dist/contracts/access.d.ts +3 -3
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +5 -3
- package/dist/contracts/api-keys.js +2 -2
- package/dist/contracts/billing.d.ts +2 -1
- package/dist/contracts/billing.js +30 -0
- package/dist/contracts/builds.d.ts +34 -22
- package/dist/contracts/builds.js +18 -6
- package/dist/contracts/channels.js +1 -1
- package/dist/contracts/comments.d.ts +1 -1
- package/dist/contracts/common.d.ts +6 -6
- package/dist/contracts/common.js +5 -5
- package/dist/contracts/crons.d.ts +35 -0
- package/dist/contracts/crons.js +42 -0
- package/dist/contracts/device-auth.js +1 -1
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/docs.js +2 -2
- package/dist/contracts/domains.d.ts +74 -63
- package/dist/contracts/domains.js +29 -2
- package/dist/contracts/enums.d.ts +3 -2
- package/dist/contracts/enums.js +10 -10
- package/dist/contracts/error-code-meta.d.ts +14 -0
- package/dist/contracts/error-code-meta.js +17 -0
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +4 -1
- package/dist/contracts/execution.d.ts +15 -12
- package/dist/contracts/execution.js +15 -12
- package/dist/contracts/feature-lifecycle.d.ts +4 -14
- package/dist/contracts/feature-lifecycle.js +0 -11
- package/dist/contracts/features.d.ts +33 -47
- package/dist/contracts/features.js +27 -20
- package/dist/contracts/functions.d.ts +169 -2
- package/dist/contracts/functions.js +160 -4
- package/dist/contracts/git.d.ts +27 -33
- package/dist/contracts/git.js +10 -11
- package/dist/contracts/grants.d.ts +2 -2
- package/dist/contracts/ids.js +2 -2
- package/dist/contracts/internal.d.ts +5 -16
- package/dist/contracts/internal.js +2 -12
- package/dist/contracts/mcp.d.ts +11 -0
- package/dist/contracts/mcp.js +5 -0
- package/dist/contracts/me.js +1 -1
- package/dist/contracts/operations.d.ts +4 -4
- package/dist/contracts/operations.js +2 -2
- package/dist/contracts/pages.d.ts +6 -6
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/plan-policy.js +1 -1
- package/dist/contracts/platform.d.ts +4 -4
- package/dist/contracts/publish-archive.d.ts +170 -160
- package/dist/contracts/publish-archive.js +8 -1
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.js +2 -2
- package/dist/contracts/repository-connections.d.ts +43 -30
- package/dist/contracts/repository-connections.js +11 -3
- package/dist/contracts/resources.d.ts +8 -8
- package/dist/contracts/resources.js +6 -6
- package/dist/contracts/runtime-api.d.ts +103 -56
- package/dist/contracts/runtime-api.js +67 -26
- package/dist/contracts/runtime-app.d.ts +2 -2
- package/dist/contracts/runtime-db.d.ts +6 -6
- package/dist/contracts/runtime-db.js +2 -2
- package/dist/contracts/runtime-purge.d.ts +8 -0
- package/dist/contracts/runtime-purge.js +7 -0
- package/dist/contracts/runtime-storage.d.ts +3 -2
- package/dist/contracts/runtime-storage.js +2 -1
- package/dist/contracts/sf-config-v1.d.ts +48 -10
- package/dist/contracts/space-config.d.ts +60 -3
- package/dist/contracts/space-config.js +213 -18
- package/dist/contracts/spaces.d.ts +55 -74
- package/dist/contracts/spaces.js +11 -14
- package/dist/contracts/superadmin-spaces.d.ts +9 -9
- package/dist/contracts/superadmin-teams.d.ts +2 -2
- package/dist/contracts/superadmin-tenants.d.ts +0 -6
- package/dist/contracts/superadmin-tenants.js +1 -7
- package/dist/contracts/superadmin.d.ts +135 -22
- package/dist/contracts/superadmin.js +43 -12
- package/dist/contracts/tags.d.ts +21 -21
- package/dist/contracts/tags.js +3 -3
- package/dist/contracts/teams.d.ts +14 -17
- package/dist/contracts/teams.js +6 -6
- package/dist/contracts/transfers.js +2 -2
- package/dist/contracts/variables.d.ts +4 -4
- package/dist/contracts/variables.js +3 -3
- package/dist/contracts/webhooks.d.ts +4 -4
- package/dist/contracts/zero.d.ts +15 -17
- package/dist/contracts/zero.js +12 -12
- package/dist/docs/agent-prose.d.ts +1 -1
- package/dist/docs/agent-prose.js +11 -14
- package/dist/docs/agent-setup.js +5 -2
- package/dist/docs/catalog.d.ts +7 -7
- package/dist/docs/catalog.js +7 -7
- package/dist/docs/error-docs.js +145 -133
- package/dist/docs/skills.d.ts +12 -12
- package/dist/docs/skills.js +4 -4
- package/dist/test-helpers/fetch-stub.js +1 -0
- package/dist/utils/build-settings.d.ts +5 -1
- package/dist/utils/build-settings.js +82 -10
- package/dist/utils/canonical-json.js +1 -0
- package/dist/utils/concurrency.js +1 -0
- package/dist/utils/credential-policy.js +4 -3
- package/dist/utils/dns-instructions.js +9 -9
- package/dist/utils/error-code.js +1 -0
- package/dist/utils/grant-decision.fixtures.json +2 -2
- package/dist/utils/grants.js +3 -1
- package/dist/utils/local-space-state.d.ts +8 -11
- package/dist/utils/local-space-state.js +13 -24
- package/dist/utils/one-shot-replay.d.ts +4 -1
- package/dist/utils/page-colors.d.ts +14 -12
- package/dist/utils/page-colors.js +15 -13
- package/dist/utils/page-fonts.d.ts +1 -1
- package/dist/utils/page-fonts.js +11 -18
- package/dist/utils/pages.d.ts +20 -1
- package/dist/utils/pages.js +22 -9
- package/dist/utils/publish-policy.d.ts +7 -0
- package/dist/utils/publish-policy.fixtures.json +11 -5
- package/dist/utils/publish-policy.js +9 -1
- package/dist/utils/query-keys.d.ts +4 -4
- package/dist/utils/query-keys.js +2 -2
- package/dist/utils/runtime-upload.d.ts +5 -0
- package/dist/utils/runtime-upload.js +7 -0
- package/dist/utils/secure-local-file.js +5 -16
- package/dist/utils/space-config.d.ts +1 -1
- package/dist/utils/space-config.js +3 -0
- package/dist/utils/static-runtime-policy.d.ts +9 -3
- package/dist/utils/static-runtime-policy.fixtures.json +38 -41
- package/dist/utils/static-runtime-policy.js +22 -56
- package/dist/utils/upload-session.d.ts +4 -1
- package/dist/utils/upload-session.js +33 -5
- package/dist/utils/version-path.js +1 -1
- package/dist/vocabulary.d.ts +8 -8
- package/dist/vocabulary.js +31 -20
- package/package.json +2 -17
package/dist/contracts/enums.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
// Space operation-lifecycle axis (
|
|
2
|
+
// Space operation-lifecycle axis (the platform spec "Space"): exactly
|
|
3
3
|
// these five. Serving (disabled) and deletion (deletedAt) are separate axes —
|
|
4
4
|
// a disabled space can still be updating. There is no `moving`: a space IS a
|
|
5
5
|
// site, so ownership changes commit in place and nothing relocates.
|
|
@@ -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 = [
|
|
@@ -25,7 +25,7 @@ export const spaceDisabledReasonCodeValues = [
|
|
|
25
25
|
"author_removed",
|
|
26
26
|
];
|
|
27
27
|
export const spaceDisabledReasonCode = z.enum(spaceDisabledReasonCodeValues);
|
|
28
|
-
// SpaceTransfer status machine (
|
|
28
|
+
// SpaceTransfer status machine (the platform spec "Transfer
|
|
29
29
|
// semantics"), stored directly — there is no separate DB vocabulary. A
|
|
30
30
|
// transfer is a request that the receiving side accepts; accepting moves
|
|
31
31
|
// ownership in one database transaction, so there is no intermediate moving
|
|
@@ -38,7 +38,7 @@ export const spaceTransferStatusValues = [
|
|
|
38
38
|
"expired",
|
|
39
39
|
];
|
|
40
40
|
export const spaceTransferStatus = z.enum(spaceTransferStatusValues);
|
|
41
|
-
// A tenant is the platform-account boundary that owns every resource (
|
|
41
|
+
// A tenant is the platform-account boundary that owns every resource (the platform spec
|
|
42
42
|
// "Tenant -> Site -> Space"), Stripe-style. `main` is the single well-known
|
|
43
43
|
// Stattic account (`ten_main`) all self-serve teams/users live under;
|
|
44
44
|
// `platform` and `partner` are host integrations with their own user
|
|
@@ -88,7 +88,7 @@ export const siteStatus = z.enum(siteStatusValues);
|
|
|
88
88
|
// tooling never deletes a wp.cloud site (owner ruling 2026-08-11).
|
|
89
89
|
export const poolSiteStatusValues = ["provisioning", "ready_pool", "degraded", "retired"];
|
|
90
90
|
export const poolSiteStatus = z.enum(poolSiteStatusValues);
|
|
91
|
-
// PublishSource.kind (
|
|
91
|
+
// PublishSource.kind (the platform spec "PublishSource"): the single
|
|
92
92
|
// provenance axis for how a version came to exist. `variable_update` and
|
|
93
93
|
// `config_update` versions are minted by cascades/config regeneration.
|
|
94
94
|
export const publishSourceKindValues = [
|
|
@@ -105,7 +105,7 @@ export const publishSourceKindValues = [
|
|
|
105
105
|
];
|
|
106
106
|
export const publishSourceKind = z.enum(publishSourceKindValues);
|
|
107
107
|
export const versionStatusValues = [
|
|
108
|
-
// Spec state machine (
|
|
108
|
+
// Spec state machine (the platform spec "Upload Contract"):
|
|
109
109
|
// created -> uploading -> uploaded -> finalizing -> ready, with terminal
|
|
110
110
|
// failed/canceled/expired. Build runs are tracked on the Build resource;
|
|
111
111
|
// a building version stays `created` until upload starts.
|
|
@@ -133,7 +133,7 @@ export const VERSION_IN_FLIGHT_STATUSES = [
|
|
|
133
133
|
"uploaded",
|
|
134
134
|
"finalizing",
|
|
135
135
|
];
|
|
136
|
-
// Build resource statuses (
|
|
136
|
+
// Build resource statuses (the platform spec "Build", `bld_`).
|
|
137
137
|
export const buildStatusValues = [
|
|
138
138
|
"waiting_for_source",
|
|
139
139
|
"uploading_source",
|
|
@@ -146,9 +146,9 @@ export const buildStatusValues = [
|
|
|
146
146
|
];
|
|
147
147
|
export const buildStatus = z.enum(buildStatusValues);
|
|
148
148
|
export const diagnosticSeverity = z.enum(["info", "warning", "error"]);
|
|
149
|
-
// Upstream system a Diagnostic originated from
|
|
150
|
-
//
|
|
151
|
-
export const diagnosticProvider = z.enum(["
|
|
149
|
+
// Upstream system a Diagnostic originated from. Absent when the diagnostic is
|
|
150
|
+
// Stattic's own (validation, routing compile, upload policy, ...).
|
|
151
|
+
export const diagnosticProvider = z.enum(["infra", "dns", "registrar", "runtime"]);
|
|
152
152
|
// Internal domain DB-column vocabularies (consumed by the control-plane schema;
|
|
153
153
|
// never part of the public Domain contract, which lives in contracts/domains.ts).
|
|
154
154
|
export const domainOwnershipTypeValues = [
|
|
@@ -114,6 +114,11 @@ export declare const ERROR_CODE_META: {
|
|
|
114
114
|
readonly retryable: false;
|
|
115
115
|
readonly recovery: "fix_input";
|
|
116
116
|
};
|
|
117
|
+
readonly build_output_contains_server_bundle: {
|
|
118
|
+
readonly retryable: false;
|
|
119
|
+
readonly recovery: "fix_input";
|
|
120
|
+
readonly next: readonly ["sf publish (the Spacefast CLI runs the Functions pipeline for server apps)", "Or point the output directory at a browser-ready export"];
|
|
121
|
+
};
|
|
117
122
|
readonly build_output_dir_missing: {
|
|
118
123
|
readonly retryable: false;
|
|
119
124
|
readonly recovery: "fix_input";
|
|
@@ -745,6 +750,11 @@ export declare const ERROR_CODE_META: {
|
|
|
745
750
|
readonly retryable: false;
|
|
746
751
|
readonly recovery: "fix_input";
|
|
747
752
|
};
|
|
753
|
+
readonly prebuilt_metadata_invalid: {
|
|
754
|
+
readonly retryable: false;
|
|
755
|
+
readonly recovery: "fix_input";
|
|
756
|
+
readonly next: readonly ["sf build", "Delete the archive's .meta.json sidecar if the archive contains plain files"];
|
|
757
|
+
};
|
|
748
758
|
readonly principal_space_mismatch: {
|
|
749
759
|
readonly retryable: false;
|
|
750
760
|
readonly recovery: "fix_input";
|
|
@@ -954,6 +964,10 @@ export declare const ERROR_CODE_META: {
|
|
|
954
964
|
readonly retryable: true;
|
|
955
965
|
readonly recovery: "retry";
|
|
956
966
|
};
|
|
967
|
+
readonly runtime_release_unverifiable: {
|
|
968
|
+
readonly retryable: false;
|
|
969
|
+
readonly recovery: "fix_input";
|
|
970
|
+
};
|
|
957
971
|
readonly runtime_scope_forbidden: {
|
|
958
972
|
readonly retryable: false;
|
|
959
973
|
readonly recovery: "re_auth";
|
|
@@ -49,6 +49,14 @@ export const ERROR_CODE_META = {
|
|
|
49
49
|
build_no_index_html: { retryable: false, recovery: "fix_input" },
|
|
50
50
|
build_not_created: { retryable: false, recovery: "fix_input" },
|
|
51
51
|
build_oom: { retryable: false, recovery: "fix_input" },
|
|
52
|
+
build_output_contains_server_bundle: {
|
|
53
|
+
retryable: false,
|
|
54
|
+
recovery: "fix_input",
|
|
55
|
+
next: [
|
|
56
|
+
"sf publish (the Spacefast CLI runs the Functions pipeline for server apps)",
|
|
57
|
+
"Or point the output directory at a browser-ready export",
|
|
58
|
+
],
|
|
59
|
+
},
|
|
52
60
|
build_output_dir_missing: { retryable: false, recovery: "fix_input" },
|
|
53
61
|
build_timeout: { retryable: true, recovery: "retry" },
|
|
54
62
|
cache_purge_domain_required: { retryable: false, recovery: "fix_input" },
|
|
@@ -241,6 +249,14 @@ export const ERROR_CODE_META = {
|
|
|
241
249
|
placement_invalid_burstable: { retryable: false, recovery: "fix_input" },
|
|
242
250
|
platform_tenant_immutable_client: { retryable: false, recovery: "fix_input" },
|
|
243
251
|
policy_exceeds_grantor: { retryable: false, recovery: "fix_input" },
|
|
252
|
+
prebuilt_metadata_invalid: {
|
|
253
|
+
retryable: false,
|
|
254
|
+
recovery: "fix_input",
|
|
255
|
+
next: [
|
|
256
|
+
"sf build",
|
|
257
|
+
"Delete the archive's .meta.json sidecar if the archive contains plain files",
|
|
258
|
+
],
|
|
259
|
+
},
|
|
244
260
|
principal_space_mismatch: { retryable: false, recovery: "fix_input" },
|
|
245
261
|
provider_error: { retryable: true, recovery: "retry" },
|
|
246
262
|
provider_job_failed: { retryable: true, recovery: "retry" },
|
|
@@ -297,6 +313,7 @@ export const ERROR_CODE_META = {
|
|
|
297
313
|
response_table_too_large: { retryable: false, recovery: "fix_input" },
|
|
298
314
|
review_item_claimed: { retryable: false, recovery: "fix_input" },
|
|
299
315
|
runtime_purge_failed: { retryable: true, recovery: "retry" },
|
|
316
|
+
runtime_release_unverifiable: { retryable: false, recovery: "fix_input" },
|
|
300
317
|
runtime_scope_forbidden: { retryable: false, recovery: "re_auth" },
|
|
301
318
|
runtime_token_bad_signature: { retryable: false, recovery: "re_auth" },
|
|
302
319
|
runtime_token_expired: { retryable: false, recovery: "re_auth" },
|
|
@@ -5,7 +5,7 @@ export declare const PROBLEM_CONTENT_TYPE = "application/problem+json";
|
|
|
5
5
|
export declare function errorDocsUrl(code: string): string;
|
|
6
6
|
/** Problem `title` derivation rule: the snake_case code as a sentence ("version_not_found" → "Version not found"). */
|
|
7
7
|
export declare function errorTitle(code: string): string;
|
|
8
|
-
export declare const ERROR_CODES: readonly ["abuse_report_invalid_transition", "abuse_report_rate_limited", "abuse_takedown", "access_denied", "account_suspended", "agent_handoff_declined", "agent_handoff_limit_reached", "agent_handoff_origin_unsupported", "ambiguous_space_slug", "anonymous_expired", "anonymous_publish_rate_limited", "anonymous_space_limit_reached", "api_key_scope_underivable", "archive_too_large", "auth_code_required", "authorization_pending", "blob_gate_record_missing", "blob_gate_token_invalid", "build_command_missing", "build_execution_unavailable", "build_failed", "build_install_failed", "build_no_index_html", "build_not_created", "build_oom", "build_output_dir_missing", "build_timeout", "cache_purge_domain_required", "cache_purge_path_required", "channel_name_reserved", "channel_pointer_moved", "channel_unsupported", "claim_blocked_takedown", "claim_target_not_found", "claimed_space_quota_exceeded", "cli_upgrade_required", "config_file_too_large", "config_functions_key_removed", "config_invalid", "config_meta_too_long", "config_name_too_long", "config_runtime_entry_missing", "config_runtime_invalid_kind", "config_templates_over_limit", "continuation_unavailable", "continuation_used", "credential_expired", "credential_not_yet_valid", "credential_retired", "credential_revoked", "csam_blocked", "csam_policy_floor", "data_location_immutable", "db_not_available", "device_authorization_failed", "device_verification_rate_limited", "dns_export_required", "dns_field_conflict", "dns_field_not_applicable", "dns_import_partial_visibility", "dns_provider_auth_expired", "dns_provider_batch_unsupported", "dns_provider_change_pending", "dns_provider_conflict", "dns_provider_connection_in_use", "dns_provider_connection_unavailable", "dns_provider_controlled_desired_state", "dns_provider_credentials_expired", "dns_provider_feature_descriptors", "dns_provider_feature_unavailable", "dns_provider_field_unsupported", "dns_provider_future_authoritative_backend", "dns_provider_missing_permission", "dns_provider_not_connected", "dns_provider_operation_failed", "dns_provider_permission_denied", "dns_provider_rate_limited", "dns_provider_replace_all_requires_fresh_plan", "dns_provider_replace_all_write_strategy", "dns_provider_snapshot_stale", "dns_provider_snapshot_unavailable", "dns_provider_temporarily_unavailable", "dns_provider_timeout", "dns_provider_validation_failed", "dns_provider_workflow_templates", "dns_provider_zone_not_found", "dns_record_conflicts_with_managed", "dns_record_managed", "dns_record_not_found", "domain_already_exists", "domain_bound", "domain_facet_already_managed", "domain_facet_external", "domain_facet_not_applicable", "domain_hostname_site_mismatch", "domain_in_use", "domain_lookup_rate_limited", "domain_not_bound", "domain_quota_exceeded", "domain_registration_active", "domain_registration_not_renewable", "domain_reserved_suffix", "domain_transfer_active", "domain_wildcard_label", "domain_wildcard_not_enabled", "download_required", "duplicate_version_path", "enforcement_policy_overlap", "event_payload_too_large", "event_rate_limited", "expired_token", "feature_unavailable", "files_mode_does_not_support_spa", "forbidden", "free_external_proxy_disabled", "idempotency_conflict_in_progress", "idempotency_key_reused", "incumbent_controls_dns", "ingest_admission_exceeded", "inject_invalid", "inject_snippet_too_large", "internal_error", "invalid_claim_token", "invalid_continuation_token", "invalid_data_location", "invalid_device_code", "invalid_domain", "invalid_domain_name", "invalid_file_path", "invalid_grant", "invalid_idempotency_key", "invalid_publish_archive", "invalid_publish_path", "invalid_publish_payload", "invalid_request", "invalid_runtime_event", "invalid_space", "invalid_space_mode", "invalid_user_code", "invalid_version_path", "invalid_webhook_events", "invalid_webhook_payload", "invalid_webhook_signature", "invalid_webhook_url", "invalid_zero_realtime_event", "invalid_zero_realtime_replay_query", "invitation_already_exists", "invitation_email_mismatch", "invitation_expired", "invitation_not_pending", "ip_blocked", "job_not_found", "job_not_promotable", "job_not_removable", "job_not_retryable", "last_owner", "log_retention_clamped", "lost_domain_control", "maintenance_in_progress", "malware_detected", "managed_domain_protected", "manifest_body_too_large", "manifest_duplicate_path", "manifest_too_many_files", "member_already_exists", "method_not_allowed", "missing_route_param", "move_target_capacity_lost", "name_managed_by_config", "nameserver_delegation_required", "nameserver_divergence", "noop_publish", "not_enrolled", "not_found", "path_case_collision", "path_too_long", "placement_invalid_burstable", "plan_grant_already_active", "plan_grant_already_revoked", "platform_tenant_immutable_client", "policy_exceeds_grantor", "principal_space_mismatch", "promote_admission_exceeded", "provider_error", "provider_job_failed", "provider_job_timeout", "provider_privilege", "provider_runtime_feature_unsupported", "provider_site_id_required", "proxy_upstream_denied", "proxy_upstream_unresolved", "publish_archive_compression_ratio_exceeded", "publish_archive_expanded_size_exceeded", "publish_archive_file_count_exceeded", "publish_archive_too_large", "publish_base_changed", "publish_bytes_missing", "publish_config_unsupported", "publish_failed", "publish_file_missing", "publish_hash_mismatch", "publish_inline_limit_exceeded", "publish_not_cancelable", "publish_path_collision", "publish_path_invalid", "publish_session_expired", "publish_setup_failed", "publish_snapshot_empty", "publish_upload_failed", "publish_verification_failed", "queue_not_found", "rate_limited", "registration_expired", "registration_expiring", "resource_revision_changed", "response_headers_unservable", "response_table_too_large", "review_item_claimed", "routing_rules_over_plan", "runtime_action_forbidden", "runtime_api_not_found", "runtime_callback_forbidden", "runtime_dev_unsupported", "runtime_hostname_unassigned", "runtime_instance_mismatch", "runtime_jti_missing", "runtime_jti_replayed", "runtime_jwks_key_missing", "runtime_kind_mismatch", "runtime_management_unavailable", "runtime_not_provisioned", "runtime_operation_missing", "runtime_purge_failed", "runtime_scope_forbidden", "runtime_token_bad_signature", "runtime_token_expired", "runtime_token_invalid", "runtime_unauthorized", "runtime_upload_operation_not_supported", "runtime_upload_required", "scan_pending", "secret_variable_in_template", "service_booting", "service_signature_invalid", "site_already_deleted", "site_has_live_spaces", "site_not_static", "site_required", "site_suspended", "slow_down", "slug_invalid", "slug_reserved", "slug_unavailable", "source_archive_decompression_timeout", "source_archive_expansion_ratio_exceeded", "source_archive_validation_busy", "space_already_claimed", "space_claim_unavailable", "space_claimed_credential_available", "space_disabled", "space_expired", "space_has_active_publish", "space_has_active_version", "space_hostname_identity_missing", "space_no_live_version", "space_not_disabled", "space_not_restorable", "space_person_already_member", "space_person_invitation_pending", "space_person_self_invite", "space_ref_ambiguous", "space_ref_required", "space_transferring", "space_unclaimed", "ssl_renewal_blocked", "static_control_file_not_supported", "static_runtime_control_path_not_supported", "static_runtime_required", "storage_auth_required", "storage_bucket_unavailable", "storage_content_blocked", "storage_delete_forbidden", "storage_empty_file", "storage_file_too_large", "storage_key_invalid", "storage_object_not_found", "storage_quota_already_unlimited", "storage_quota_decrease_not_supported", "storage_quota_exceeded", "storage_unavailable", "stripe_error", "superseded_by_publish", "takeover_notice_window", "team_member_quota_exceeded", "team_ref_required", "team_required", "team_slug_conflict", "template_file_too_large", "template_not_in_version", "template_variable_unresolved", "tenant_id_mismatch", "tenant_not_found", "tenant_not_granted", "tenant_past_due", "tenant_selection_required", "tenant_suspended", "theme_value_invalid", "transfer_cross_tenant_unsupported", "transfer_not_cancelable", "transfer_push_failed", "transfer_source_changed", "transfer_target_same_as_source", "transfer_verify_failed", "unauthorized", "unsupported_publish_media_type", "upload_hash_mismatch", "upload_path_not_canonical", "upload_path_not_declared", "upload_size_mismatch", "user_banned", "validation_error", "verification_required", "version_already_live", "version_artifact_not_found", "version_busy", "version_canceled", "version_closed", "version_expired", "version_failed", "version_file_count_exceeded", "version_file_not_found", "version_file_too_large", "version_files_missing", "version_in_use", "version_live", "version_no_publishable_files", "version_not_finalizable", "version_not_found", "version_not_prepared", "version_not_promotable", "version_not_ready", "version_quota_exceeded", "version_total_bytes_exceeded", "webhook_delivery_budget_exceeded", "whois_unavailable", "wp_cloud_assignment_kind_mismatch", "wp_cloud_assignment_space_mismatch", "wp_cloud_assignment_team_mismatch", "wp_cloud_client_in_use", "wp_cloud_client_not_found", "wp_cloud_site_still_assigned", "wp_cloud_team_shared_site_exists", "wp_cloud_webhook_secret_not_configured", "zero_ai_unavailable", "zero_artifact_abi_mismatch", "zero_artifact_invalid", "zero_artifact_malformed", "zero_artifact_path_invalid", "zero_artifact_unreadable", "zero_auth_unavailable", "zero_blob_key_invalid", "zero_blob_store_full", "zero_blob_too_large", "zero_blob_value_invalid", "zero_bootstrap_encode_failed", "zero_bytecode_hash_mismatch", "zero_bytecode_invalid", "zero_bytecode_path_invalid", "zero_bytecode_unreadable", "zero_capabilities_encode_failed", "zero_client_bundle_not_loaded", "zero_db_connect_failed", "zero_db_execute_failed", "zero_db_export_cursor_invalid", "zero_db_export_failed", "zero_db_export_page_too_large", "zero_db_export_query_invalid", "zero_db_export_schema_changed", "zero_db_export_schema_unavailable", "zero_db_host_install_failed", "zero_db_operation_invalid", "zero_db_operation_too_large", "zero_db_param_invalid", "zero_db_query_failed", "zero_db_row_invalid", "zero_db_sql_invalid", "zero_db_target_denied", "zero_db_tls_required", "zero_db_too_many_params", "zero_db_transaction_active", "zero_db_transaction_commit_failed", "zero_db_transaction_invalid", "zero_db_transaction_missing", "zero_db_transaction_rollback_failed", "zero_db_transaction_start_failed", "zero_db_url_invalid", "zero_db_url_missing", "zero_dev_endpoint_failed", "zero_dump_query_invalid", "zero_endpoint_compile_failed", "zero_endpoint_conflict", "zero_endpoint_duplicate", "zero_endpoint_id_duplicate", "zero_endpoint_index_invalid", "zero_endpoint_index_malformed", "zero_endpoint_index_path_invalid", "zero_endpoint_index_unreadable", "zero_endpoint_invalid", "zero_endpoint_mismatch", "zero_endpoint_not_found", "zero_endpoints_invalid", "zero_endpoints_too_many", "zero_envelope_encode_failed", "zero_js_context_init_failed", "zero_js_execution_failed", "zero_js_execution_timeout", "zero_js_globals_failed", "zero_js_response_malformed", "zero_js_runtime_init_failed", "zero_log_query_invalid", "zero_method_not_allowed", "zero_migration_failed", "zero_query_name_missing", "zero_realtime_forbidden", "zero_realtime_message_invalid", "zero_realtime_operation_unsupported", "zero_realtime_query_invalid", "zero_realtime_space_required", "zero_realtime_unavailable", "zero_realtime_websocket_forbidden", "zero_replay_failed", "zero_replay_query_invalid", "zero_replay_unavailable", "zero_request_body_too_large", "zero_response_header_forbidden", "zero_response_header_invalid", "zero_response_too_large", "zero_routes_invalid", "zero_run_compile_failed", "zero_run_duplicate", "zero_run_invalid", "zero_run_operation_unsupported", "zero_runner_envelope_invalid", "zero_runner_failed", "zero_runner_invalid_body", "zero_runner_invalid_response", "zero_runner_invalid_status", "zero_runner_protocol_unsupported", "zero_runner_response_encode_failed", "zero_runner_stdin_invalid", "zero_runner_stdin_too_large", "zero_runner_unavailable", "zero_runs_invalid", "zero_runs_require_runtime_compiler", "zero_runs_too_many"];
|
|
8
|
+
export declare const ERROR_CODES: readonly ["abuse_report_invalid_transition", "abuse_report_rate_limited", "abuse_takedown", "access_denied", "account_suspended", "agent_handoff_declined", "agent_handoff_limit_reached", "agent_handoff_origin_unsupported", "ambiguous_space_slug", "anonymous_expired", "anonymous_publish_rate_limited", "anonymous_space_limit_reached", "api_key_scope_underivable", "archive_too_large", "auth_code_required", "authorization_pending", "blob_gate_record_missing", "blob_gate_token_invalid", "build_command_missing", "build_execution_unavailable", "build_failed", "build_install_failed", "build_no_index_html", "build_not_created", "build_oom", "build_output_contains_server_bundle", "build_output_dir_missing", "build_timeout", "cache_purge_domain_required", "cache_purge_path_required", "channel_name_reserved", "channel_pointer_moved", "channel_unsupported", "claim_blocked_takedown", "claim_target_not_found", "claimed_space_quota_exceeded", "cli_upgrade_required", "config_file_too_large", "config_functions_key_removed", "config_invalid", "config_meta_too_long", "config_name_too_long", "config_runtime_entry_missing", "config_runtime_invalid_kind", "config_templates_over_limit", "continuation_unavailable", "continuation_used", "credential_expired", "credential_not_yet_valid", "credential_retired", "credential_revoked", "csam_blocked", "csam_policy_floor", "data_location_immutable", "db_not_available", "device_authorization_failed", "device_verification_rate_limited", "dns_export_required", "dns_field_conflict", "dns_field_not_applicable", "dns_import_partial_visibility", "dns_provider_auth_expired", "dns_provider_batch_unsupported", "dns_provider_change_pending", "dns_provider_conflict", "dns_provider_connection_in_use", "dns_provider_connection_unavailable", "dns_provider_controlled_desired_state", "dns_provider_credentials_expired", "dns_provider_feature_descriptors", "dns_provider_feature_unavailable", "dns_provider_field_unsupported", "dns_provider_future_authoritative_backend", "dns_provider_missing_permission", "dns_provider_not_connected", "dns_provider_operation_failed", "dns_provider_permission_denied", "dns_provider_rate_limited", "dns_provider_replace_all_requires_fresh_plan", "dns_provider_replace_all_write_strategy", "dns_provider_snapshot_stale", "dns_provider_snapshot_unavailable", "dns_provider_temporarily_unavailable", "dns_provider_timeout", "dns_provider_validation_failed", "dns_provider_workflow_templates", "dns_provider_zone_not_found", "dns_record_conflicts_with_managed", "dns_record_managed", "dns_record_not_found", "domain_already_exists", "domain_bound", "domain_facet_already_managed", "domain_facet_external", "domain_facet_not_applicable", "domain_hostname_site_mismatch", "domain_in_use", "domain_lookup_rate_limited", "domain_not_bound", "domain_quota_exceeded", "domain_registration_active", "domain_registration_not_renewable", "domain_reserved_suffix", "domain_transfer_active", "domain_wildcard_label", "domain_wildcard_not_enabled", "download_required", "duplicate_version_path", "enforcement_policy_overlap", "event_payload_too_large", "event_rate_limited", "expired_token", "feature_unavailable", "files_mode_does_not_support_spa", "forbidden", "free_external_proxy_disabled", "idempotency_conflict_in_progress", "idempotency_key_reused", "incumbent_controls_dns", "ingest_admission_exceeded", "inject_invalid", "inject_snippet_too_large", "internal_error", "invalid_claim_token", "invalid_continuation_token", "invalid_data_location", "invalid_device_code", "invalid_domain", "invalid_domain_name", "invalid_file_path", "invalid_grant", "invalid_idempotency_key", "invalid_publish_archive", "invalid_publish_path", "invalid_publish_payload", "invalid_request", "invalid_runtime_event", "invalid_space", "invalid_space_mode", "invalid_user_code", "invalid_version_path", "invalid_webhook_events", "invalid_webhook_payload", "invalid_webhook_signature", "invalid_webhook_url", "invalid_zero_realtime_event", "invalid_zero_realtime_replay_query", "invitation_already_exists", "invitation_email_mismatch", "invitation_expired", "invitation_not_pending", "ip_blocked", "job_not_found", "job_not_promotable", "job_not_removable", "job_not_retryable", "last_owner", "log_retention_clamped", "lost_domain_control", "maintenance_in_progress", "malware_detected", "managed_domain_protected", "manifest_body_too_large", "manifest_duplicate_path", "manifest_too_many_files", "member_already_exists", "method_not_allowed", "missing_route_param", "move_target_capacity_lost", "name_managed_by_config", "nameserver_delegation_required", "nameserver_divergence", "noop_publish", "not_enrolled", "not_found", "path_case_collision", "path_too_long", "placement_invalid_burstable", "plan_grant_already_active", "plan_grant_already_revoked", "platform_tenant_immutable_client", "policy_exceeds_grantor", "prebuilt_metadata_invalid", "principal_space_mismatch", "promote_admission_exceeded", "provider_error", "provider_job_failed", "provider_job_timeout", "provider_privilege", "provider_runtime_feature_unsupported", "provider_site_id_required", "proxy_upstream_denied", "proxy_upstream_unresolved", "publish_archive_compression_ratio_exceeded", "publish_archive_expanded_size_exceeded", "publish_archive_file_count_exceeded", "publish_archive_too_large", "publish_base_changed", "publish_bytes_missing", "publish_config_unsupported", "publish_failed", "publish_file_missing", "publish_hash_mismatch", "publish_inline_limit_exceeded", "publish_not_cancelable", "publish_path_collision", "publish_path_invalid", "publish_session_expired", "publish_setup_failed", "publish_snapshot_empty", "publish_upload_failed", "publish_verification_failed", "queue_not_found", "rate_limited", "registration_expired", "registration_expiring", "resource_revision_changed", "response_headers_unservable", "response_table_too_large", "review_item_claimed", "routing_rules_over_plan", "runtime_action_forbidden", "runtime_api_not_found", "runtime_callback_forbidden", "runtime_dev_unsupported", "runtime_hostname_unassigned", "runtime_instance_mismatch", "runtime_jti_missing", "runtime_jti_replayed", "runtime_jwks_key_missing", "runtime_kind_mismatch", "runtime_management_unavailable", "runtime_not_provisioned", "runtime_operation_missing", "runtime_purge_failed", "runtime_release_unverifiable", "runtime_scope_forbidden", "runtime_token_bad_signature", "runtime_token_expired", "runtime_token_invalid", "runtime_unauthorized", "runtime_upload_operation_not_supported", "runtime_upload_required", "scan_pending", "secret_variable_in_template", "service_booting", "service_signature_invalid", "site_already_deleted", "site_has_live_spaces", "site_not_static", "site_required", "site_suspended", "slow_down", "slug_invalid", "slug_reserved", "slug_unavailable", "source_archive_decompression_timeout", "source_archive_expansion_ratio_exceeded", "source_archive_validation_busy", "space_already_claimed", "space_claim_unavailable", "space_claimed_credential_available", "space_disabled", "space_expired", "space_has_active_publish", "space_has_active_version", "space_hostname_identity_missing", "space_no_live_version", "space_not_disabled", "space_not_restorable", "space_person_already_member", "space_person_invitation_pending", "space_person_self_invite", "space_ref_ambiguous", "space_ref_required", "space_transferring", "space_unclaimed", "ssl_renewal_blocked", "static_control_file_not_supported", "static_runtime_control_path_not_supported", "static_runtime_required", "storage_auth_required", "storage_bucket_unavailable", "storage_content_blocked", "storage_delete_forbidden", "storage_empty_file", "storage_file_too_large", "storage_key_invalid", "storage_object_not_found", "storage_quota_already_unlimited", "storage_quota_decrease_not_supported", "storage_quota_exceeded", "storage_unavailable", "stripe_error", "superseded_by_publish", "takeover_notice_window", "team_member_quota_exceeded", "team_ref_required", "team_required", "team_slug_conflict", "template_file_too_large", "template_not_in_version", "template_variable_unresolved", "tenant_id_mismatch", "tenant_not_found", "tenant_not_granted", "tenant_past_due", "tenant_selection_required", "tenant_suspended", "theme_value_invalid", "transfer_cross_tenant_unsupported", "transfer_not_cancelable", "transfer_push_failed", "transfer_source_changed", "transfer_target_same_as_source", "transfer_verify_failed", "unauthorized", "unsupported_publish_media_type", "upload_hash_mismatch", "upload_path_not_canonical", "upload_path_not_declared", "upload_size_mismatch", "user_banned", "validation_error", "verification_required", "version_already_live", "version_artifact_not_found", "version_busy", "version_canceled", "version_closed", "version_expired", "version_failed", "version_file_count_exceeded", "version_file_not_found", "version_file_too_large", "version_files_missing", "version_in_use", "version_live", "version_no_publishable_files", "version_not_finalizable", "version_not_found", "version_not_prepared", "version_not_promotable", "version_not_ready", "version_quota_exceeded", "version_total_bytes_exceeded", "webhook_delivery_budget_exceeded", "whois_unavailable", "wp_cloud_assignment_kind_mismatch", "wp_cloud_assignment_space_mismatch", "wp_cloud_assignment_team_mismatch", "wp_cloud_client_in_use", "wp_cloud_client_not_found", "wp_cloud_site_still_assigned", "wp_cloud_team_shared_site_exists", "wp_cloud_webhook_secret_not_configured", "zero_ai_unavailable", "zero_artifact_abi_mismatch", "zero_artifact_invalid", "zero_artifact_malformed", "zero_artifact_path_invalid", "zero_artifact_unreadable", "zero_auth_unavailable", "zero_blob_key_invalid", "zero_blob_store_full", "zero_blob_too_large", "zero_blob_value_invalid", "zero_bootstrap_encode_failed", "zero_bytecode_hash_mismatch", "zero_bytecode_invalid", "zero_bytecode_path_invalid", "zero_bytecode_unreadable", "zero_capabilities_encode_failed", "zero_client_bundle_not_loaded", "zero_db_connect_failed", "zero_db_execute_failed", "zero_db_export_cursor_invalid", "zero_db_export_failed", "zero_db_export_page_too_large", "zero_db_export_query_invalid", "zero_db_export_schema_changed", "zero_db_export_schema_unavailable", "zero_db_host_install_failed", "zero_db_operation_invalid", "zero_db_operation_too_large", "zero_db_param_invalid", "zero_db_query_failed", "zero_db_row_invalid", "zero_db_sql_invalid", "zero_db_target_denied", "zero_db_tls_required", "zero_db_too_many_params", "zero_db_transaction_active", "zero_db_transaction_commit_failed", "zero_db_transaction_invalid", "zero_db_transaction_missing", "zero_db_transaction_rollback_failed", "zero_db_transaction_start_failed", "zero_db_url_invalid", "zero_db_url_missing", "zero_dev_endpoint_failed", "zero_dump_query_invalid", "zero_endpoint_compile_failed", "zero_endpoint_conflict", "zero_endpoint_duplicate", "zero_endpoint_id_duplicate", "zero_endpoint_index_invalid", "zero_endpoint_index_malformed", "zero_endpoint_index_path_invalid", "zero_endpoint_index_unreadable", "zero_endpoint_invalid", "zero_endpoint_mismatch", "zero_endpoint_not_found", "zero_endpoints_invalid", "zero_endpoints_too_many", "zero_envelope_encode_failed", "zero_js_context_init_failed", "zero_js_execution_failed", "zero_js_execution_timeout", "zero_js_globals_failed", "zero_js_response_malformed", "zero_js_runtime_init_failed", "zero_log_query_invalid", "zero_method_not_allowed", "zero_migration_failed", "zero_query_name_missing", "zero_realtime_forbidden", "zero_realtime_message_invalid", "zero_realtime_operation_unsupported", "zero_realtime_query_invalid", "zero_realtime_space_required", "zero_realtime_unavailable", "zero_realtime_websocket_forbidden", "zero_replay_failed", "zero_replay_query_invalid", "zero_replay_unavailable", "zero_request_body_too_large", "zero_response_header_forbidden", "zero_response_header_invalid", "zero_response_too_large", "zero_routes_invalid", "zero_run_compile_failed", "zero_run_duplicate", "zero_run_invalid", "zero_run_operation_unsupported", "zero_runner_envelope_invalid", "zero_runner_failed", "zero_runner_invalid_body", "zero_runner_invalid_response", "zero_runner_invalid_status", "zero_runner_protocol_unsupported", "zero_runner_response_encode_failed", "zero_runner_stdin_invalid", "zero_runner_stdin_too_large", "zero_runner_unavailable", "zero_runs_invalid", "zero_runs_require_runtime_compiler", "zero_runs_too_many"];
|
|
9
9
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
10
10
|
export declare function isErrorCode(value: string): value is ErrorCode;
|
|
11
11
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The single error-code table (
|
|
1
|
+
// The single error-code table (the platform spec "Global API Conventions").
|
|
2
2
|
// Every problem document `code` the control plane emits is a member of this table, and
|
|
3
3
|
// the problem `type` is derived mechanically from the code
|
|
4
4
|
// (`https://spacefast.com/docs/errors/{code}`).
|
|
@@ -49,6 +49,7 @@ export const ERROR_CODES = [
|
|
|
49
49
|
"build_no_index_html",
|
|
50
50
|
"build_not_created",
|
|
51
51
|
"build_oom",
|
|
52
|
+
"build_output_contains_server_bundle",
|
|
52
53
|
"build_output_dir_missing",
|
|
53
54
|
"build_timeout",
|
|
54
55
|
"cache_purge_domain_required",
|
|
@@ -205,6 +206,7 @@ export const ERROR_CODES = [
|
|
|
205
206
|
"plan_grant_already_revoked",
|
|
206
207
|
"platform_tenant_immutable_client",
|
|
207
208
|
"policy_exceeds_grantor",
|
|
209
|
+
"prebuilt_metadata_invalid",
|
|
208
210
|
"principal_space_mismatch",
|
|
209
211
|
"promote_admission_exceeded",
|
|
210
212
|
"provider_error",
|
|
@@ -257,6 +259,7 @@ export const ERROR_CODES = [
|
|
|
257
259
|
"runtime_not_provisioned",
|
|
258
260
|
"runtime_operation_missing",
|
|
259
261
|
"runtime_purge_failed",
|
|
262
|
+
"runtime_release_unverifiable",
|
|
260
263
|
"runtime_scope_forbidden",
|
|
261
264
|
"runtime_token_bad_signature",
|
|
262
265
|
"runtime_token_expired",
|
|
@@ -14,10 +14,10 @@ import { z } from "zod";
|
|
|
14
14
|
* as well ourselves.
|
|
15
15
|
*
|
|
16
16
|
* The only surface both can host is an endpoint that touches neither the
|
|
17
|
-
* database
|
|
18
|
-
* portable seam, and it is deliberately narrow: a capsule
|
|
19
|
-
* depend on the transaction wrapped around it, which does
|
|
20
|
-
* isolate a continent away from the database.
|
|
17
|
+
* database, the caller's identity, nor realtime — see `endpointIsPortable`.
|
|
18
|
+
* That is the portable seam, and it is deliberately narrow: a capsule
|
|
19
|
+
* handler's semantics depend on the transaction wrapped around it, which does
|
|
20
|
+
* not exist on an isolate a continent away from the database.
|
|
21
21
|
*
|
|
22
22
|
* Neither is a "kind" a space declares. Every space owns a site, so what runs
|
|
23
23
|
* is a routing decision derived from what the published tree carries: static
|
|
@@ -124,13 +124,16 @@ export declare const EXECUTION_CAPABILITY_ORDER: readonly ["db", "fetch", "auth"
|
|
|
124
124
|
/**
|
|
125
125
|
* The portable seam, stated as one predicate.
|
|
126
126
|
*
|
|
127
|
-
* `db` and `
|
|
128
|
-
* tier. `db` because Zero's store guarantees every handler runs
|
|
129
|
-
* parent-owned transaction, which an isolate reaching the database
|
|
130
|
-
* relay cannot offer. `auth` because capsule identity is resolved
|
|
131
|
-
* same transaction's view.
|
|
132
|
-
*
|
|
133
|
-
*
|
|
127
|
+
* `db`, `auth` and `realtime` are the three capabilities that bind a handler
|
|
128
|
+
* to the local tier. `db` because Zero's store guarantees every handler runs
|
|
129
|
+
* inside one parent-owned transaction, which an isolate reaching the database
|
|
130
|
+
* over a relay cannot offer. `auth` because capsule identity is resolved
|
|
131
|
+
* against that same transaction's view. `realtime` because invalidations are
|
|
132
|
+
* emitted by the native runner beside the store, and the Functions grant
|
|
133
|
+
* vocabulary has no counterpart for them — a worker declaring the capability
|
|
134
|
+
* would fail closed at the relay with nothing to reach. Everything else —
|
|
135
|
+
* fetch, env, logging, and the three platform services — is brokered
|
|
136
|
+
* identically on both tiers and does not constrain placement.
|
|
134
137
|
*
|
|
135
138
|
* `email` is the one worth stating explicitly, because it looks like it should
|
|
136
139
|
* bind: a Zero mutation's send is atomic with its database writes, and a
|
|
@@ -210,7 +213,7 @@ export declare function executionStaticFileSchema(options: {
|
|
|
210
213
|
* the same question on each.
|
|
211
214
|
*/
|
|
212
215
|
export declare const executionInspectPolicySchema: z.ZodEnum<{
|
|
213
|
-
public: "public";
|
|
214
216
|
private: "private";
|
|
217
|
+
public: "public";
|
|
215
218
|
}>;
|
|
216
219
|
export type ExecutionInspectPolicy = z.infer<typeof executionInspectPolicySchema>;
|
|
@@ -14,10 +14,10 @@ import { z } from "zod";
|
|
|
14
14
|
* as well ourselves.
|
|
15
15
|
*
|
|
16
16
|
* The only surface both can host is an endpoint that touches neither the
|
|
17
|
-
* database
|
|
18
|
-
* portable seam, and it is deliberately narrow: a capsule
|
|
19
|
-
* depend on the transaction wrapped around it, which does
|
|
20
|
-
* isolate a continent away from the database.
|
|
17
|
+
* database, the caller's identity, nor realtime — see `endpointIsPortable`.
|
|
18
|
+
* That is the portable seam, and it is deliberately narrow: a capsule
|
|
19
|
+
* handler's semantics depend on the transaction wrapped around it, which does
|
|
20
|
+
* not exist on an isolate a continent away from the database.
|
|
21
21
|
*
|
|
22
22
|
* Neither is a "kind" a space declares. Every space owns a site, so what runs
|
|
23
23
|
* is a routing decision derived from what the published tree carries: static
|
|
@@ -215,13 +215,16 @@ true;
|
|
|
215
215
|
/**
|
|
216
216
|
* The portable seam, stated as one predicate.
|
|
217
217
|
*
|
|
218
|
-
* `db` and `
|
|
219
|
-
* tier. `db` because Zero's store guarantees every handler runs
|
|
220
|
-
* parent-owned transaction, which an isolate reaching the database
|
|
221
|
-
* relay cannot offer. `auth` because capsule identity is resolved
|
|
222
|
-
* same transaction's view.
|
|
223
|
-
*
|
|
224
|
-
*
|
|
218
|
+
* `db`, `auth` and `realtime` are the three capabilities that bind a handler
|
|
219
|
+
* to the local tier. `db` because Zero's store guarantees every handler runs
|
|
220
|
+
* inside one parent-owned transaction, which an isolate reaching the database
|
|
221
|
+
* over a relay cannot offer. `auth` because capsule identity is resolved
|
|
222
|
+
* against that same transaction's view. `realtime` because invalidations are
|
|
223
|
+
* emitted by the native runner beside the store, and the Functions grant
|
|
224
|
+
* vocabulary has no counterpart for them — a worker declaring the capability
|
|
225
|
+
* would fail closed at the relay with nothing to reach. Everything else —
|
|
226
|
+
* fetch, env, logging, and the three platform services — is brokered
|
|
227
|
+
* identically on both tiers and does not constrain placement.
|
|
225
228
|
*
|
|
226
229
|
* `email` is the one worth stating explicitly, because it looks like it should
|
|
227
230
|
* bind: a Zero mutation's send is atomic with its database writes, and a
|
|
@@ -234,7 +237,7 @@ true;
|
|
|
234
237
|
* whether the code could also have run on the other tier.
|
|
235
238
|
*/
|
|
236
239
|
export function endpointIsPortable(capabilities) {
|
|
237
|
-
return capabilities.db !== true && capabilities.auth !== true;
|
|
240
|
+
return capabilities.db !== true && capabilities.auth !== true && capabilities.realtime !== true;
|
|
238
241
|
}
|
|
239
242
|
/**
|
|
240
243
|
* A source-carrying handler, before it is compiled to whichever tier will run
|
|
@@ -7,7 +7,7 @@ type RuntimeFeaturePolicy = {
|
|
|
7
7
|
readonly enabledForA8c: boolean;
|
|
8
8
|
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
9
9
|
};
|
|
10
|
-
type
|
|
10
|
+
type RuntimeFeatureDefinitionFields<K extends string> = {
|
|
11
11
|
readonly key: K;
|
|
12
12
|
readonly name: string;
|
|
13
13
|
readonly description: string;
|
|
@@ -306,16 +306,6 @@ declare const featureEntries: readonly [{
|
|
|
306
306
|
readonly code: "dedicated_runtime_stop";
|
|
307
307
|
readonly summary: "Deny customer mutation and new placement/materialization immediately; serve-time revocation of already-materialized output lands with the deferred runtime-proof slice; operator recovery/export/delete remain; downloaded bytes cannot be recalled.";
|
|
308
308
|
};
|
|
309
|
-
}, {
|
|
310
|
-
readonly key: "shelf";
|
|
311
|
-
readonly name: "Shelf";
|
|
312
|
-
readonly description: "Exposes the per-user artifact shelf: dashboard curation and public /shelf/{handle} pages.";
|
|
313
|
-
readonly defaultEnabled: false;
|
|
314
|
-
readonly runtime: {
|
|
315
|
-
readonly enabledInDevelopment: true;
|
|
316
|
-
readonly enabledForA8c: true;
|
|
317
|
-
readonly planDefaults: {};
|
|
318
|
-
};
|
|
319
309
|
}, {
|
|
320
310
|
readonly cohort: "launch";
|
|
321
311
|
readonly key: "build.content_pipeline";
|
|
@@ -460,11 +450,11 @@ type RuntimeFeatureEntry = Extract<FeatureEntry, {
|
|
|
460
450
|
}>;
|
|
461
451
|
export type LifecycleFeatureKey = LifecycleFeatureEntry["key"];
|
|
462
452
|
export type RuntimeFeatureKey = RuntimeFeatureEntry["key"];
|
|
463
|
-
export type RuntimeFeatureDefinition<K extends RuntimeFeatureKey = RuntimeFeatureKey> =
|
|
453
|
+
export type RuntimeFeatureDefinition<K extends RuntimeFeatureKey = RuntimeFeatureKey> = RuntimeFeatureDefinitionFields<K>;
|
|
464
454
|
export declare const FEATURE_LIFECYCLE_REGISTRY: readonly FeatureRegistryEntry<LifecycleFeatureKey>[];
|
|
465
455
|
type RuntimeDefinitionRecord<K extends string> = {
|
|
466
|
-
readonly [Key in K]:
|
|
456
|
+
readonly [Key in K]: RuntimeFeatureDefinitionFields<Key>;
|
|
467
457
|
};
|
|
468
458
|
export declare const FEATURE_RUNTIME_KEYS: readonly RuntimeFeatureKey[];
|
|
469
|
-
export declare const FEATURE_RUNTIME_DEFINITIONS: Readonly<RuntimeDefinitionRecord<"zero" | "plans.paid.available" | "anonymous.publishing" | "beta.enrollment_gate" | "domains.search" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.notices" | "collab.drawing" | "sites.dedicated_runtime" | "
|
|
459
|
+
export declare const FEATURE_RUNTIME_DEFINITIONS: Readonly<RuntimeDefinitionRecord<"zero" | "tags" | "functions" | "plans.paid.available" | "anonymous.publishing" | "beta.enrollment_gate" | "domains.search" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.notices" | "collab.drawing" | "sites.dedicated_runtime" | "spaces.slug_rename">>;
|
|
470
460
|
export declare const FEATURE_LIFECYCLE_BY_KEY: ReadonlyMap<LifecycleFeatureKey, FeatureRegistryEntry<LifecycleFeatureKey>>;
|
|
@@ -309,17 +309,6 @@ const featureEntries = Object.freeze([
|
|
|
309
309
|
summary: "Deny customer mutation and new placement/materialization immediately; serve-time revocation of already-materialized output lands with the deferred runtime-proof slice; operator recovery/export/delete remain; downloaded bytes cannot be recalled.",
|
|
310
310
|
},
|
|
311
311
|
},
|
|
312
|
-
{
|
|
313
|
-
key: "shelf",
|
|
314
|
-
name: "Shelf",
|
|
315
|
-
description: "Exposes the per-user artifact shelf: dashboard curation and public /shelf/{handle} pages.",
|
|
316
|
-
defaultEnabled: false,
|
|
317
|
-
runtime: {
|
|
318
|
-
enabledInDevelopment: true,
|
|
319
|
-
enabledForA8c: true,
|
|
320
|
-
planDefaults: {},
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
312
|
{
|
|
324
313
|
cohort: "launch",
|
|
325
314
|
key: "build.content_pipeline",
|
|
@@ -12,9 +12,11 @@ export type PlanCode = z.infer<typeof planCodeSchema>;
|
|
|
12
12
|
export declare const DEFAULT_PLAN_CODE: PlanCode;
|
|
13
13
|
export declare const SELF_SERVE_PLAN_CODES: readonly ["personal", "work"];
|
|
14
14
|
export declare const PUBLIC_PLAN_CODES: readonly ["free", "personal", "work", "enterprise"];
|
|
15
|
-
export declare const FEATURE_KEYS: readonly ("zero" | "plans.paid.available" | "anonymous.publishing" | "beta.enrollment_gate" | "domains.search" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.notices" | "collab.drawing" | "sites.dedicated_runtime" | "
|
|
15
|
+
export declare const FEATURE_KEYS: readonly ("zero" | "tags" | "functions" | "plans.paid.available" | "anonymous.publishing" | "beta.enrollment_gate" | "domains.search" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.notices" | "collab.drawing" | "sites.dedicated_runtime" | "spaces.slug_rename")[];
|
|
16
16
|
export declare const featureKeySchema: z.ZodEnum<{
|
|
17
17
|
zero: "zero";
|
|
18
|
+
tags: "tags";
|
|
19
|
+
functions: "functions";
|
|
18
20
|
"plans.paid.available": "plans.paid.available";
|
|
19
21
|
"anonymous.publishing": "anonymous.publishing";
|
|
20
22
|
"beta.enrollment_gate": "beta.enrollment_gate";
|
|
@@ -27,9 +29,6 @@ export declare const featureKeySchema: z.ZodEnum<{
|
|
|
27
29
|
"collab.notices": "collab.notices";
|
|
28
30
|
"collab.drawing": "collab.drawing";
|
|
29
31
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
30
|
-
shelf: "shelf";
|
|
31
|
-
tags: "tags";
|
|
32
|
-
functions: "functions";
|
|
33
32
|
"spaces.slug_rename": "spaces.slug_rename";
|
|
34
33
|
}>;
|
|
35
34
|
export type FeatureKey = RuntimeFeatureKey;
|
|
@@ -110,9 +109,9 @@ export declare const teamEntitlementsResponseSchema: z.ZodObject<{
|
|
|
110
109
|
runtimePhpWorkers: z.ZodNumber;
|
|
111
110
|
versionDiagnosticsIncluded: z.ZodBoolean;
|
|
112
111
|
limits: z.ZodObject<{
|
|
112
|
+
storageBytes: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
113
113
|
teamMembers: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
114
114
|
subTeams: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
115
|
-
storageBytes: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
116
115
|
externalDomainGroups: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
117
116
|
maxFileBytes: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
118
117
|
maxVersionFiles: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
@@ -160,6 +159,26 @@ export declare const FEATURE_DEFINITIONS: Readonly<{
|
|
|
160
159
|
readonly enabledForA8c: boolean;
|
|
161
160
|
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
162
161
|
};
|
|
162
|
+
readonly tags: {
|
|
163
|
+
readonly key: "tags";
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly description: string;
|
|
166
|
+
readonly defaultEnabled: boolean;
|
|
167
|
+
} & {
|
|
168
|
+
readonly enabledInDevelopment?: boolean;
|
|
169
|
+
readonly enabledForA8c: boolean;
|
|
170
|
+
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
171
|
+
};
|
|
172
|
+
readonly functions: {
|
|
173
|
+
readonly key: "functions";
|
|
174
|
+
readonly name: string;
|
|
175
|
+
readonly description: string;
|
|
176
|
+
readonly defaultEnabled: boolean;
|
|
177
|
+
} & {
|
|
178
|
+
readonly enabledInDevelopment?: boolean;
|
|
179
|
+
readonly enabledForA8c: boolean;
|
|
180
|
+
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
181
|
+
};
|
|
163
182
|
readonly "plans.paid.available": {
|
|
164
183
|
readonly key: "plans.paid.available";
|
|
165
184
|
readonly name: string;
|
|
@@ -280,36 +299,6 @@ export declare const FEATURE_DEFINITIONS: Readonly<{
|
|
|
280
299
|
readonly enabledForA8c: boolean;
|
|
281
300
|
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
282
301
|
};
|
|
283
|
-
readonly shelf: {
|
|
284
|
-
readonly key: "shelf";
|
|
285
|
-
readonly name: string;
|
|
286
|
-
readonly description: string;
|
|
287
|
-
readonly defaultEnabled: boolean;
|
|
288
|
-
} & {
|
|
289
|
-
readonly enabledInDevelopment?: boolean;
|
|
290
|
-
readonly enabledForA8c: boolean;
|
|
291
|
-
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
292
|
-
};
|
|
293
|
-
readonly tags: {
|
|
294
|
-
readonly key: "tags";
|
|
295
|
-
readonly name: string;
|
|
296
|
-
readonly description: string;
|
|
297
|
-
readonly defaultEnabled: boolean;
|
|
298
|
-
} & {
|
|
299
|
-
readonly enabledInDevelopment?: boolean;
|
|
300
|
-
readonly enabledForA8c: boolean;
|
|
301
|
-
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
302
|
-
};
|
|
303
|
-
readonly functions: {
|
|
304
|
-
readonly key: "functions";
|
|
305
|
-
readonly name: string;
|
|
306
|
-
readonly description: string;
|
|
307
|
-
readonly defaultEnabled: boolean;
|
|
308
|
-
} & {
|
|
309
|
-
readonly enabledInDevelopment?: boolean;
|
|
310
|
-
readonly enabledForA8c: boolean;
|
|
311
|
-
readonly planDefaults: Readonly<Partial<Record<PlanCode, boolean>>>;
|
|
312
|
-
};
|
|
313
302
|
readonly "spaces.slug_rename": {
|
|
314
303
|
readonly key: "spaces.slug_rename";
|
|
315
304
|
readonly name: string;
|
|
@@ -324,12 +313,14 @@ export declare const FEATURE_DEFINITIONS: Readonly<{
|
|
|
324
313
|
export declare const featureStateSourceSchema: z.ZodEnum<{
|
|
325
314
|
default: "default";
|
|
326
315
|
override: "override";
|
|
327
|
-
kill_switch: "kill_switch";
|
|
328
316
|
env: "env";
|
|
317
|
+
kill_switch: "kill_switch";
|
|
329
318
|
}>;
|
|
330
319
|
export declare const FeatureStateSchema: z.ZodObject<{
|
|
331
320
|
key: z.ZodEnum<{
|
|
332
321
|
zero: "zero";
|
|
322
|
+
tags: "tags";
|
|
323
|
+
functions: "functions";
|
|
333
324
|
"plans.paid.available": "plans.paid.available";
|
|
334
325
|
"anonymous.publishing": "anonymous.publishing";
|
|
335
326
|
"beta.enrollment_gate": "beta.enrollment_gate";
|
|
@@ -342,17 +333,14 @@ export declare const FeatureStateSchema: z.ZodObject<{
|
|
|
342
333
|
"collab.notices": "collab.notices";
|
|
343
334
|
"collab.drawing": "collab.drawing";
|
|
344
335
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
345
|
-
shelf: "shelf";
|
|
346
|
-
tags: "tags";
|
|
347
|
-
functions: "functions";
|
|
348
336
|
"spaces.slug_rename": "spaces.slug_rename";
|
|
349
337
|
}>;
|
|
350
338
|
enabled: z.ZodBoolean;
|
|
351
339
|
source: z.ZodEnum<{
|
|
352
340
|
default: "default";
|
|
353
341
|
override: "override";
|
|
354
|
-
kill_switch: "kill_switch";
|
|
355
342
|
env: "env";
|
|
343
|
+
kill_switch: "kill_switch";
|
|
356
344
|
}>;
|
|
357
345
|
}, z.core.$strip>;
|
|
358
346
|
export declare const FeatureStateResponseSchema: z.ZodObject<{
|
|
@@ -365,6 +353,8 @@ export declare const FeatureStateResponseSchema: z.ZodObject<{
|
|
|
365
353
|
}>;
|
|
366
354
|
features: z.ZodRecord<z.ZodEnum<{
|
|
367
355
|
zero: "zero";
|
|
356
|
+
tags: "tags";
|
|
357
|
+
functions: "functions";
|
|
368
358
|
"plans.paid.available": "plans.paid.available";
|
|
369
359
|
"anonymous.publishing": "anonymous.publishing";
|
|
370
360
|
"beta.enrollment_gate": "beta.enrollment_gate";
|
|
@@ -377,13 +367,12 @@ export declare const FeatureStateResponseSchema: z.ZodObject<{
|
|
|
377
367
|
"collab.notices": "collab.notices";
|
|
378
368
|
"collab.drawing": "collab.drawing";
|
|
379
369
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
380
|
-
shelf: "shelf";
|
|
381
|
-
tags: "tags";
|
|
382
|
-
functions: "functions";
|
|
383
370
|
"spaces.slug_rename": "spaces.slug_rename";
|
|
384
371
|
}>, z.ZodObject<{
|
|
385
372
|
key: z.ZodEnum<{
|
|
386
373
|
zero: "zero";
|
|
374
|
+
tags: "tags";
|
|
375
|
+
functions: "functions";
|
|
387
376
|
"plans.paid.available": "plans.paid.available";
|
|
388
377
|
"anonymous.publishing": "anonymous.publishing";
|
|
389
378
|
"beta.enrollment_gate": "beta.enrollment_gate";
|
|
@@ -396,17 +385,14 @@ export declare const FeatureStateResponseSchema: z.ZodObject<{
|
|
|
396
385
|
"collab.notices": "collab.notices";
|
|
397
386
|
"collab.drawing": "collab.drawing";
|
|
398
387
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
399
|
-
shelf: "shelf";
|
|
400
|
-
tags: "tags";
|
|
401
|
-
functions: "functions";
|
|
402
388
|
"spaces.slug_rename": "spaces.slug_rename";
|
|
403
389
|
}>;
|
|
404
390
|
enabled: z.ZodBoolean;
|
|
405
391
|
source: z.ZodEnum<{
|
|
406
392
|
default: "default";
|
|
407
393
|
override: "override";
|
|
408
|
-
kill_switch: "kill_switch";
|
|
409
394
|
env: "env";
|
|
395
|
+
kill_switch: "kill_switch";
|
|
410
396
|
}>;
|
|
411
397
|
}, z.core.$strip>>;
|
|
412
398
|
}, z.core.$strip>;
|