@spacefast/common 0.0.26 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 -1
- package/dist/agents/private-key-oauth.js +124 -33
- 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 +1 -2
- package/dist/brand-assets.js +4 -7
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +55 -28
- package/dist/config/domains.js +85 -41
- 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 +21 -27
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +70 -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.js +7 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +192 -7
- package/dist/contracts/builds.js +84 -21
- 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 +45 -35
- 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 +18 -29
- 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 +17 -0
- package/dist/contracts/crons.js +33 -15
- 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 +6 -10
- package/dist/contracts/docs.js +5 -13
- package/dist/contracts/domains.d.ts +499 -102
- package/dist/contracts/domains.js +169 -58
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +26 -26
- package/dist/contracts/enums.js +61 -54
- package/dist/contracts/error-code-meta.d.ts +273 -7
- package/dist/contracts/error-code-meta.js +81 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +79 -16
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +47 -66
- package/dist/contracts/execution.js +51 -64
- package/dist/contracts/feature-lifecycle.d.ts +70 -14
- package/dist/contracts/feature-lifecycle.js +86 -15
- package/dist/contracts/features.d.ts +100 -37
- package/dist/contracts/features.js +21 -27
- 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 +218 -211
- package/dist/contracts/functions.js +273 -260
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +64 -56
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +4 -1
- package/dist/contracts/internal.d.ts +5 -4
- package/dist/contracts/internal.js +12 -3
- package/dist/contracts/mcp.d.ts +17 -0
- package/dist/contracts/mcp.js +23 -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 +121 -10
- package/dist/contracts/oauth-resources.js +130 -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 +11 -5
- package/dist/contracts/pages.d.ts +29 -5
- 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.d.ts +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 +116 -18
- package/dist/contracts/publish-archive.js +6 -3
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.js +3 -3
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/repository-connections.js +6 -2
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +145 -21
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +112 -35
- package/dist/contracts/runtime-api.js +86 -66
- package/dist/contracts/runtime-app.d.ts +11 -21
- 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 +45 -19
- package/dist/contracts/runtime-db.js +85 -20
- package/dist/contracts/runtime-purge.js +3 -5
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +14 -14
- package/dist/contracts/runtime-storage.js +28 -13
- package/dist/contracts/sf-config-v1.d.ts +14 -18
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +235 -28
- package/dist/contracts/space-config.js +246 -91
- package/dist/contracts/spaces.d.ts +360 -255
- package/dist/contracts/spaces.js +190 -122
- 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 +435 -186
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +3 -0
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -6
- package/dist/contracts/superadmin-tenants.js +32 -7
- package/dist/contracts/superadmin.d.ts +98 -16
- package/dist/contracts/superadmin.js +63 -10
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +44 -34
- package/dist/contracts/teams.d.ts +72 -9
- package/dist/contracts/teams.js +84 -25
- 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 +1 -0
- 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 +57 -64
- package/dist/contracts/zero.js +68 -66
- 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 +11 -17
- package/dist/docs/agent-prose.js +62 -37
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +336 -436
- package/dist/docs/catalog.d.ts +147 -89
- package/dist/docs/catalog.js +157 -42
- package/dist/docs/error-docs.d.ts +2102 -1
- package/dist/docs/error-docs.js +285 -16
- 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 +117 -117
- package/dist/docs/skills.js +120 -72
- 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/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +16 -0
- package/dist/utils/build-settings.js +63 -17
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +3 -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 +2 -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 +123 -57
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +4 -7
- 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 +15 -15
- package/dist/utils/local-space-state.js +34 -23
- 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 +3 -5
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +4 -10
- package/dist/utils/page-colors.js +11 -35
- package/dist/utils/page-fonts.js +6 -11
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +22 -11
- package/dist/utils/pages.js +70 -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 +10 -23
- package/dist/utils/publish-policy.js +63 -116
- 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 +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +18 -24
- package/dist/utils/space-config.d.ts +11 -14
- package/dist/utils/space-config.js +10 -16
- package/dist/utils/static-runtime-policy.d.ts +5 -8
- 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 +17 -84
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.js +8 -14
- 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 +7 -7
- package/dist/vocabulary.js +30 -16
- package/package.json +14 -2
- 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/config/domains.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
// THE single source of truth for Spacefast hostnames and per-service origins
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// one-file edit instead of the ~100-site sweep this migration had to untangle.
|
|
1
|
+
// THE single source of truth for Spacefast hostnames and per-service origins.
|
|
2
|
+
// Brand strings, app URL builders, CORS allowlists, cookie scope, and redirect
|
|
3
|
+
// rules all derive from here, so a domain change is a one-file edit.
|
|
5
4
|
//
|
|
6
|
-
// Env-var NAMES
|
|
7
|
-
// VALUES they carry are produced from this registry.
|
|
5
|
+
// Env-var NAMES stay `SPACEFAST_*`; only the VALUES come from this registry.
|
|
8
6
|
/** The production apex. Everything else about prod derives from this string. */
|
|
9
7
|
export const PROD_ENV_DOMAIN = "spacefast.com";
|
|
10
8
|
/** The local-dev apex (portless serves every subdomain over HTTPS). */
|
|
11
9
|
export const DEV_ENV_DOMAIN = "sf.localhost";
|
|
12
10
|
/** The deployed staging apex. Not local: staging is a hosted environment. */
|
|
13
11
|
export const STAGING_ENV_DOMAIN = "stattic.net";
|
|
14
|
-
/** The deployed dev apex
|
|
12
|
+
/** The deployed dev apex. Local dev is separate and stays on sf.localhost. */
|
|
15
13
|
export const DEV_DEPLOY_ENV_DOMAIN = "stattic.xyz";
|
|
16
14
|
export const HOSTED_ENV_DOMAINS = {
|
|
17
15
|
dev: DEV_DEPLOY_ENV_DOMAIN,
|
|
@@ -37,12 +35,11 @@ export function hostedEnvDomain(environment) {
|
|
|
37
35
|
return hosted ? HOSTED_ENV_DOMAINS[hosted] : null;
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* Git push and the internal handbook live on their own apexes in prod.
|
|
38
|
+
* The per-service host map for one env domain (`spacefast.com`, `sf.localhost`,
|
|
39
|
+
* …). Services are `<service>.<domain>` over https, with three exceptions: the
|
|
40
|
+
* marketing site takes the bare apex of a hosted environment (so staging
|
|
41
|
+
* rehearses production's shape), and Git push and the internal handbook get
|
|
42
|
+
* their own apexes in prod.
|
|
46
43
|
*/
|
|
47
44
|
export function envDomainsFor(domain) {
|
|
48
45
|
const prod = domain === PROD_ENV_DOMAIN;
|
|
@@ -65,13 +62,11 @@ export function envDomainsFor(domain) {
|
|
|
65
62
|
};
|
|
66
63
|
}
|
|
67
64
|
const PROD = envDomainsFor(PROD_ENV_DOMAIN);
|
|
68
|
-
// Local dev runs every service under *.sf.localhost via portless
|
|
69
|
-
// ports
|
|
70
|
-
// portless records` per the migration spec: sf.localhost is the only TLD.
|
|
65
|
+
// Local dev runs every service under *.sf.localhost via portless, which proxies
|
|
66
|
+
// the raw dev ports so URLs carry no port. sf.localhost is the only local TLD.
|
|
71
67
|
const DEV = envDomainsFor(DEV_ENV_DOMAIN);
|
|
72
|
-
// The test stack
|
|
73
|
-
//
|
|
74
|
-
// can run side-by-side with dev. URL host scheme is identical to dev.
|
|
68
|
+
// The test stack uses dev's hostname scheme but its own isolated compose project
|
|
69
|
+
// and ports (see ports config), so the two run side by side.
|
|
75
70
|
const TEST = DEV;
|
|
76
71
|
const BY_ENV = {
|
|
77
72
|
dev: DEV,
|
|
@@ -83,8 +78,16 @@ export function serviceOrigin(service, env) {
|
|
|
83
78
|
const d = BY_ENV[env];
|
|
84
79
|
return `${d.protocol}://${d.hosts[service]}`;
|
|
85
80
|
}
|
|
86
|
-
/** Base URL every documentation link
|
|
81
|
+
/** Base URL every documentation link resolves against: catalog entries, skills, error pages. */
|
|
87
82
|
export const DOCS_BASE_URL = `${serviceOrigin("www", "prod")}/docs`;
|
|
83
|
+
/**
|
|
84
|
+
* The API origin every first-party client falls back to when nothing else names
|
|
85
|
+
* a provider: no `--api-url`, no `SPACEFAST_API_URL`, no saved profile or
|
|
86
|
+
* checkout link. The CLI and the MCP server share this one literal so a caller
|
|
87
|
+
* cannot be pointed at two different "defaults" depending on which surface it
|
|
88
|
+
* came through.
|
|
89
|
+
*/
|
|
90
|
+
export const DEFAULT_API_URL = serviceOrigin("api", "prod");
|
|
88
91
|
// --- Apexes that are NOT spacefast.com subdomains -------------------------------
|
|
89
92
|
/**
|
|
90
93
|
* The production infrastructure apex. Committed artifacts and anything
|
|
@@ -98,29 +101,24 @@ export const DEV_VIEW_FAST_APEX = "preview.space";
|
|
|
98
101
|
/**
|
|
99
102
|
* Resolve the infrastructure apex, allowing an explicit deployment override.
|
|
100
103
|
*
|
|
101
|
-
* Only production has an apex here. Every other hosted environment names its
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* site.
|
|
104
|
+
* Only production has an apex here. Every other hosted environment names its own
|
|
105
|
+
* through `SPACEFAST_VIEW_FAST_APEX`, because a space apex is a zone that must
|
|
106
|
+
* exist, be delegated, and be attached at the provider. Two environments
|
|
107
|
+
* allocating from one apex race for the same hostname, and the loser is a
|
|
108
|
+
* customer's site.
|
|
107
109
|
*
|
|
108
|
-
* When nothing names the apex
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* schema refuses to boot without it, while builds and browser bundles import
|
|
113
|
-
* this registry for its host scheme and must not explode over an environment
|
|
114
|
-
* they do not have.
|
|
110
|
+
* When nothing names the apex this falls back to the local one: a caller that
|
|
111
|
+
* cannot say which environment it is has no claim on production's namespace. The
|
|
112
|
+
* control plane's env schema is what holds deployments to naming it; builds and
|
|
113
|
+
* browser bundles import this registry only for its host scheme.
|
|
115
114
|
*/
|
|
116
115
|
export function resolveViewFastApex(environment) {
|
|
117
116
|
const explicit = environment.SPACEFAST_VIEW_FAST_APEX?.trim().toLowerCase();
|
|
118
117
|
if (explicit)
|
|
119
118
|
return explicit;
|
|
120
119
|
// SPACEFAST_ENV names a hosted environment only on a deployed service, where
|
|
121
|
-
// NODE_ENV is production
|
|
122
|
-
//
|
|
123
|
-
// must keep the local apex rather than allocate under hosted dev's.
|
|
120
|
+
// NODE_ENV is production. `dev` is also the local stack's name, and a local
|
|
121
|
+
// stack must keep the local apex rather than allocate under hosted dev's.
|
|
124
122
|
const nodeEnvironment = environment.NODE_ENV?.trim().toLowerCase();
|
|
125
123
|
if (!["prod", "production"].includes(nodeEnvironment ?? ""))
|
|
126
124
|
return DEV_VIEW_FAST_APEX;
|
|
@@ -130,8 +128,54 @@ export function resolveViewFastApex(environment) {
|
|
|
130
128
|
}
|
|
131
129
|
/** Infrastructure apex used for public managed/custom domains. */
|
|
132
130
|
export const VIEW_FAST_APEX = resolveViewFastApex(typeof process === "undefined" ? {} : process.env);
|
|
133
|
-
// Default space hostnames are `{hostLabel}.{VIEW_FAST_APEX}
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
131
|
+
// Default space hostnames are `{hostLabel}.{VIEW_FAST_APEX}`.
|
|
132
|
+
// --- Test-mode (simulated) apex -------------------------------------------------
|
|
133
|
+
/**
|
|
134
|
+
* The Spacefast-owned apex under which a LINKED TEST TENANT's simulated sites and
|
|
135
|
+
* hostname namespaces materialize (partner-operations spec §1). It is never
|
|
136
|
+
* served by real infrastructure — nothing points DNS at it and no cert is
|
|
137
|
+
* provisioned — so it exists purely as a collision-free namespace: a test
|
|
138
|
+
* tenant's hostnames are `{label}.{tenant}.{TEST_APEX}` (per-tenant, see
|
|
139
|
+
* `testApexForTenant`), which is also the marker the runtime-API transport uses
|
|
140
|
+
* to recognize a simulated box and short-circuit rather than reach a real one.
|
|
141
|
+
*
|
|
142
|
+
* Defaults to `test.{VIEW_FAST_APEX}` so every environment gets a distinct test
|
|
143
|
+
* apex for free; a deployment can override it with `SPACEFAST_TEST_APEX`.
|
|
144
|
+
*/
|
|
145
|
+
export function resolveTestApex(environment) {
|
|
146
|
+
const explicit = environment.SPACEFAST_TEST_APEX?.trim().toLowerCase();
|
|
147
|
+
if (explicit)
|
|
148
|
+
return explicit;
|
|
149
|
+
return `test.${resolveViewFastApex(environment)}`;
|
|
150
|
+
}
|
|
151
|
+
/** The resolved test-mode apex for this process. */
|
|
152
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- isomorphic process guard: this registry is imported by browser bundles where `process` is undefined (same guard as VIEW_FAST_APEX above).
|
|
153
|
+
export const TEST_APEX = resolveTestApex(typeof process === "undefined" ? {} : process.env);
|
|
154
|
+
// A tenant id (`ten_<rand>`) as a DNS label: lowercase, `_`→`-`, non-label chars
|
|
155
|
+
// dropped. Every test tenant gets its OWN apex under `TEST_APEX` so the GLOBAL
|
|
156
|
+
// `hostname_namespace_apex_uq` never collides at the second test tenant, and so
|
|
157
|
+
// a test label can never steer a live space.
|
|
158
|
+
export function testApexForTenant(tenantId, testApex = TEST_APEX) {
|
|
159
|
+
const label = tenantId
|
|
160
|
+
.trim()
|
|
161
|
+
.toLowerCase()
|
|
162
|
+
.replaceAll("_", "-")
|
|
163
|
+
.replace(/[^a-z0-9-]/g, "")
|
|
164
|
+
.replace(/^-+|-+$/g, "");
|
|
165
|
+
return `${label || "tenant"}.${testApex}`;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Whether a hostname belongs to the test-mode apex (a simulated box).
|
|
169
|
+
*
|
|
170
|
+
* STRICTLY a suffix check — the apex ITSELF is never a simulated hostname. Every
|
|
171
|
+
* simulated hostname is `{label}.{tenant}.{TEST_APEX}` (two labels deep), while
|
|
172
|
+
* the bare apex is reachable as a LIVE space's hostname: `TEST_APEX` defaults to
|
|
173
|
+
* `test.{VIEW_FAST_APEX}`, so a live space slugged `test` is served at exactly
|
|
174
|
+
* `test.view.fast`. Matching the apex would make every Runtime-API call for that
|
|
175
|
+
* space short-circuit to a synthetic response — engine installs reporting
|
|
176
|
+
* `installed` and publishes reporting success while nothing ever reaches the box.
|
|
177
|
+
*/
|
|
178
|
+
export function isTestApexHostname(hostname, testApex = TEST_APEX) {
|
|
179
|
+
const normalized = hostname.trim().toLowerCase().replace(/\.$/, "");
|
|
180
|
+
return normalized.endsWith(`.${testApex}`);
|
|
181
|
+
}
|
package/dist/config/index.js
CHANGED
package/dist/contracts/abuse.js
CHANGED
|
@@ -4,20 +4,13 @@ export const abuseReportCategorySchema = z
|
|
|
4
4
|
.enum(["malware", "phishing", "spam", "copyright", "illegal_content", "other"])
|
|
5
5
|
.describe("Reported abuse category.");
|
|
6
6
|
export const abuseReportCreateSchema = z.object({
|
|
7
|
-
url: z.string().url().describe("
|
|
7
|
+
url: z.string().url().describe("URL of the reported content."),
|
|
8
8
|
category: abuseReportCategorySchema,
|
|
9
|
-
description: z
|
|
10
|
-
.string()
|
|
11
|
-
.trim()
|
|
12
|
-
.min(10)
|
|
13
|
-
.max(5000)
|
|
14
|
-
.describe("What the reporter saw; 10-5000 characters."),
|
|
9
|
+
description: z.string().trim().min(10).max(5000).describe("What the reporter saw."),
|
|
15
10
|
});
|
|
16
11
|
export const abuseReportStatusSchema = z
|
|
17
12
|
.enum(["new", "reviewing", "actioned", "closed"])
|
|
18
13
|
.describe("Triage status of the report.");
|
|
19
|
-
// Triage state machine: reports move forward through review; `closed` reports
|
|
20
|
-
// can be reopened into `reviewing` (and only there) when new evidence lands.
|
|
21
14
|
export const ABUSE_REPORT_STATUS_TRANSITIONS = {
|
|
22
15
|
new: ["reviewing", "actioned", "closed"],
|
|
23
16
|
reviewing: ["actioned", "closed"],
|
|
@@ -29,33 +22,25 @@ export const abuseReportSchema = z.object({
|
|
|
29
22
|
status: abuseReportStatusSchema,
|
|
30
23
|
category: abuseReportCategorySchema,
|
|
31
24
|
url: z.string().describe("Reported URL."),
|
|
32
|
-
spaceId: z
|
|
33
|
-
.string()
|
|
34
|
-
.nullable()
|
|
35
|
-
.describe("Space the reported hostname resolved to, when resolution succeeds."),
|
|
25
|
+
spaceId: z.string().nullable().describe("Space the reported hostname resolved to."),
|
|
36
26
|
createdAt: z.string().datetime().describe("When the report was filed."),
|
|
37
27
|
});
|
|
38
|
-
//
|
|
28
|
+
// Intake details the public receipt omits.
|
|
39
29
|
export const superadminAbuseReportSchema = abuseReportSchema.extend({
|
|
40
|
-
hostname: z.string().describe("Normalized hostname
|
|
41
|
-
tenantId: z.string().nullable().describe("Tenant owning the resolved space
|
|
30
|
+
hostname: z.string().describe("Normalized hostname from the reported URL."),
|
|
31
|
+
tenantId: z.string().nullable().describe("Tenant owning the resolved space."),
|
|
42
32
|
description: z.string().describe("Reporter-supplied description."),
|
|
43
33
|
updatedAt: z.string().datetime().describe("Last triage update."),
|
|
44
34
|
});
|
|
45
35
|
export const superadminAbuseReportListQuerySchema = cursorListQuerySchema.extend({
|
|
46
|
-
status: abuseReportStatusSchema.optional().describe("Filter
|
|
47
|
-
spaceId: z
|
|
48
|
-
.string()
|
|
49
|
-
.trim()
|
|
50
|
-
.min(1)
|
|
51
|
-
.optional()
|
|
52
|
-
.describe("Filter to reports that resolved to one Space."),
|
|
36
|
+
status: abuseReportStatusSchema.optional().describe("Filter by status."),
|
|
37
|
+
spaceId: z.string().trim().min(1).optional().describe("Filter to reports for this Space."),
|
|
53
38
|
hostname: z
|
|
54
39
|
.string()
|
|
55
40
|
.trim()
|
|
56
41
|
.min(1)
|
|
57
42
|
.optional()
|
|
58
|
-
.describe("Filter by
|
|
43
|
+
.describe("Filter by normalized hostname, case-insensitively."),
|
|
59
44
|
});
|
|
60
45
|
export const superadminAbuseReportPatchSchema = z.object({
|
|
61
46
|
status: abuseReportStatusSchema.describe("New triage status; must be a valid transition from the current status."),
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The scopes any interactive authorization may grant — THE list every surface
|
|
4
|
+
* derives from. The device approval page, OAuth consent, the CLI receipt, and
|
|
5
|
+
* the server's approval validator all import this instead of keeping copies.
|
|
6
|
+
*
|
|
7
|
+
* This is the shared API set — NOT the granular `spaces:publish` /
|
|
8
|
+
* `builds:trigger` scopes, whose actions `publish:write` already covers. A
|
|
9
|
+
* person approving a device never sees two checkboxes that mean the same grant,
|
|
10
|
+
* and this set equals the hosted-MCP resource's scopes so the two converge.
|
|
11
|
+
*/
|
|
12
|
+
export declare const APPROVABLE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
|
|
13
|
+
export type ApprovableScope = (typeof APPROVABLE_SCOPES)[number];
|
|
14
|
+
/**
|
|
15
|
+
* Whether a scope, when approved, is bounded by the holder's team role. This is
|
|
16
|
+
* DERIVED from `isTenantAdmissionAction` — the same declaration the credential
|
|
17
|
+
* compiler mints from — so it can never disagree with what actually gets minted:
|
|
18
|
+
*
|
|
19
|
+
* - "team": grants at least one team-role action — authority OVER a team's
|
|
20
|
+
* resources, bounded by the approver's LIVE role there on every request.
|
|
21
|
+
* - "account": every action is tenant-admission (never role-bounded), so no
|
|
22
|
+
* team role gates it and any member can approve it (creating a
|
|
23
|
+
* not-yet-existing team).
|
|
24
|
+
*
|
|
25
|
+
* Drives grantability (`scopeGrantableByRole`); the compiler owns the resource.
|
|
26
|
+
*/
|
|
27
|
+
export type ScopePlane = "team" | "account";
|
|
28
|
+
export declare const SCOPE_PLANES: Record<ApprovableScope, ScopePlane>;
|
|
29
|
+
export declare const ACCESS_PROFILE_IDS: readonly ["read", "agent"];
|
|
30
|
+
export type AccessProfileId = (typeof ACCESS_PROFILE_IDS)[number];
|
|
31
|
+
export declare const AccessProfileIdSchema: z.ZodEnum<{
|
|
32
|
+
read: "read";
|
|
33
|
+
agent: "agent";
|
|
34
|
+
}>;
|
|
35
|
+
export type AccessProfile = Readonly<{
|
|
36
|
+
id: AccessProfileId;
|
|
37
|
+
/** The ONE name every surface prints: CLI request line and receipt, approval
|
|
38
|
+
* page heading, consent screen, ledger row, email. */
|
|
39
|
+
label: string;
|
|
40
|
+
/** One sentence a person reads INSTEAD of the scope list. Reviewed copy —
|
|
41
|
+
* the derived scope list under it stays authoritative, so this can only ever
|
|
42
|
+
* be stale, never wrong about what is granted. */
|
|
43
|
+
blurb: string;
|
|
44
|
+
/** The negative space: notable things this profile deliberately can't do,
|
|
45
|
+
* shown under the blurb. Optional — omit when there's nothing worth calling
|
|
46
|
+
* out (a read-only profile speaks for itself). */
|
|
47
|
+
limits?: string;
|
|
48
|
+
scopes: readonly ApprovableScope[];
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Named grant profiles. A profile is REQUEST INTENT — one word on device start
|
|
52
|
+
* with a server-owned meaning — never authority. Scopes are the grant
|
|
53
|
+
* vocabulary; actions are authority. The default is deliberately the full
|
|
54
|
+
* approvable set, matching what a `vercel login`/`gh auth login` grants:
|
|
55
|
+
* everything the credential's holder can do, capped per team by their live
|
|
56
|
+
* role at request time.
|
|
57
|
+
*/
|
|
58
|
+
export declare const ACCESS_PROFILES: {
|
|
59
|
+
readonly read: {
|
|
60
|
+
readonly id: "read";
|
|
61
|
+
readonly label: "Read-only access";
|
|
62
|
+
readonly blurb: "Read your teams, sites, and domains. Changes nothing.";
|
|
63
|
+
readonly scopes: readonly ["teams:read", "spaces:read", "domains:read"];
|
|
64
|
+
};
|
|
65
|
+
readonly agent: {
|
|
66
|
+
readonly id: "agent";
|
|
67
|
+
readonly label: "Agent access";
|
|
68
|
+
readonly blurb: "Create and publish sites, manage domains and DNS, create teams, and use Spacefast tools.";
|
|
69
|
+
readonly limits: "It can't delete sites, manage team members, change billing, or mint credentials.";
|
|
70
|
+
readonly scopes: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export declare const DEFAULT_ACCESS_PROFILE_ID: AccessProfileId;
|
|
74
|
+
/** Parse an untyped scope list (wire, storage) into approvable scopes, in
|
|
75
|
+
* checklist order, deduplicated. Unknown entries grant nothing and are dropped. */
|
|
76
|
+
export declare function approvableScopesFrom(scopes: readonly string[] | null | undefined): ApprovableScope[];
|
|
77
|
+
/** The profile a scope set IS — exact set equality — or null once edited.
|
|
78
|
+
* Profiles are pinned distinct by test, so this inverse is total. */
|
|
79
|
+
export declare function accessProfileForScopes(scopes: readonly string[] | null | undefined): AccessProfile | null;
|
|
80
|
+
/**
|
|
81
|
+
* What every surface prints for a granted scope set: a profile's label, or
|
|
82
|
+
* `Custom (Agent access, minus …)` when the set is a strict subset of a
|
|
83
|
+
* profile, or plain `Custom`. Derived, never stored — a profile redefinition
|
|
84
|
+
* can never make an old receipt lie about its scopes.
|
|
85
|
+
*/
|
|
86
|
+
export declare function accessGrantLabel(scopes: readonly string[] | null | undefined, scopeLabel?: (scope: ApprovableScope) => string): string;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { OAUTH_SHARED_API_RESOURCE_SCOPES } from "./oauth-resources.js";
|
|
3
|
+
import { isTenantAdmissionAction, oauthScopeActions } from "./oauth-scope-actions.js";
|
|
4
|
+
/**
|
|
5
|
+
* The scopes any interactive authorization may grant — THE list every surface
|
|
6
|
+
* derives from. The device approval page, OAuth consent, the CLI receipt, and
|
|
7
|
+
* the server's approval validator all import this instead of keeping copies.
|
|
8
|
+
*
|
|
9
|
+
* This is the shared API set — NOT the granular `spaces:publish` /
|
|
10
|
+
* `builds:trigger` scopes, whose actions `publish:write` already covers. A
|
|
11
|
+
* person approving a device never sees two checkboxes that mean the same grant,
|
|
12
|
+
* and this set equals the hosted-MCP resource's scopes so the two converge.
|
|
13
|
+
*/
|
|
14
|
+
export const APPROVABLE_SCOPES = [...OAUTH_SHARED_API_RESOURCE_SCOPES];
|
|
15
|
+
export const SCOPE_PLANES =
|
|
16
|
+
// SAFETY: mapped over every APPROVABLE_SCOPES entry, so the record is total.
|
|
17
|
+
Object.fromEntries(APPROVABLE_SCOPES.map((scope) => [
|
|
18
|
+
scope,
|
|
19
|
+
oauthScopeActions([scope]).every(isTenantAdmissionAction) ? "account" : "team",
|
|
20
|
+
]));
|
|
21
|
+
export const ACCESS_PROFILE_IDS = ["read", "agent"];
|
|
22
|
+
export const AccessProfileIdSchema = z.enum(ACCESS_PROFILE_IDS);
|
|
23
|
+
/**
|
|
24
|
+
* Named grant profiles. A profile is REQUEST INTENT — one word on device start
|
|
25
|
+
* with a server-owned meaning — never authority. Scopes are the grant
|
|
26
|
+
* vocabulary; actions are authority. The default is deliberately the full
|
|
27
|
+
* approvable set, matching what a `vercel login`/`gh auth login` grants:
|
|
28
|
+
* everything the credential's holder can do, capped per team by their live
|
|
29
|
+
* role at request time.
|
|
30
|
+
*/
|
|
31
|
+
export const ACCESS_PROFILES = {
|
|
32
|
+
// Read-only. It can open a hosted MCP session and invoke tools (each tool call
|
|
33
|
+
// is re-gated by its own API scope, so only reads succeed), and it can observe
|
|
34
|
+
// the MCP console. It cannot MANAGE the console — closing sessions and
|
|
35
|
+
// approving paused executions are gated on `spaces:write` (see mcp/service.ts)
|
|
36
|
+
// — so it still changes nothing.
|
|
37
|
+
read: {
|
|
38
|
+
id: "read",
|
|
39
|
+
label: "Read-only access",
|
|
40
|
+
blurb: "Read your teams, sites, and domains. Changes nothing.",
|
|
41
|
+
scopes: ["teams:read", "spaces:read", "domains:read"],
|
|
42
|
+
},
|
|
43
|
+
agent: {
|
|
44
|
+
id: "agent",
|
|
45
|
+
label: "Agent access",
|
|
46
|
+
blurb: "Create and publish sites, manage domains and DNS, create teams, and use Spacefast tools.",
|
|
47
|
+
limits: "It can't delete sites, manage team members, change billing, or mint credentials.",
|
|
48
|
+
scopes: [...APPROVABLE_SCOPES],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
export const DEFAULT_ACCESS_PROFILE_ID = "agent";
|
|
52
|
+
function isApprovableScope(scope) {
|
|
53
|
+
return APPROVABLE_SCOPES.some((known) => known === scope);
|
|
54
|
+
}
|
|
55
|
+
/** Parse an untyped scope list (wire, storage) into approvable scopes, in
|
|
56
|
+
* checklist order, deduplicated. Unknown entries grant nothing and are dropped. */
|
|
57
|
+
export function approvableScopesFrom(scopes) {
|
|
58
|
+
const requested = new Set(scopes ?? []);
|
|
59
|
+
return APPROVABLE_SCOPES.filter((scope) => requested.has(scope));
|
|
60
|
+
}
|
|
61
|
+
/** The profile a scope set IS — exact set equality — or null once edited.
|
|
62
|
+
* Profiles are pinned distinct by test, so this inverse is total. */
|
|
63
|
+
export function accessProfileForScopes(scopes) {
|
|
64
|
+
const granted = new Set(approvableScopesFrom(scopes));
|
|
65
|
+
return (Object.values(ACCESS_PROFILES).find((profile) => profile.scopes.length === granted.size &&
|
|
66
|
+
profile.scopes.every((scope) => granted.has(scope))) ?? null);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* What every surface prints for a granted scope set: a profile's label, or
|
|
70
|
+
* `Custom (Agent access, minus …)` when the set is a strict subset of a
|
|
71
|
+
* profile, or plain `Custom`. Derived, never stored — a profile redefinition
|
|
72
|
+
* can never make an old receipt lie about its scopes.
|
|
73
|
+
*/
|
|
74
|
+
export function accessGrantLabel(scopes, scopeLabel = (scope) => scope) {
|
|
75
|
+
const granted = approvableScopesFrom(scopes);
|
|
76
|
+
const exact = accessProfileForScopes(granted);
|
|
77
|
+
if (exact) {
|
|
78
|
+
return exact.label;
|
|
79
|
+
}
|
|
80
|
+
const grantedSet = new Set(granted);
|
|
81
|
+
// Narrowest containing profile names the diff; `read` precedes `agent`.
|
|
82
|
+
const profiles = Object.values(ACCESS_PROFILES);
|
|
83
|
+
const superset = profiles.find((profile) => granted.length > 0 && granted.every((scope) => profile.scopes.includes(scope)));
|
|
84
|
+
if (!superset) {
|
|
85
|
+
return "Custom";
|
|
86
|
+
}
|
|
87
|
+
const missing = superset.scopes.filter((scope) => !grantedSet.has(scope));
|
|
88
|
+
return `Custom (${superset.label}, minus ${missing.map((scope) => scopeLabel(scope)).join(", ")})`;
|
|
89
|
+
}
|
|
@@ -10,16 +10,14 @@ export declare const spaceAccessPresetSchema: z.ZodEnum<{
|
|
|
10
10
|
export type SpaceAccessPreset = z.infer<typeof spaceAccessPresetSchema>;
|
|
11
11
|
/**
|
|
12
12
|
* The sharing vocabulary. Capabilities are the ground truth; a role is a named
|
|
13
|
-
* set of them, ordered from least to most. This is the only role enum
|
|
14
|
-
*
|
|
15
|
-
* API, comments) names access with these four words and derives capabilities
|
|
16
|
-
* here rather than keeping its own preset list.
|
|
13
|
+
* set of them, ordered from least to most. This is the product's only role enum
|
|
14
|
+
* and role⇄capability mapping: every surface derives its capabilities here.
|
|
17
15
|
*/
|
|
18
16
|
export declare const ACCESS_ROLES: readonly ["viewer", "commenter", "editor", "manager"];
|
|
19
17
|
export declare const accessRoleSchema: z.ZodEnum<{
|
|
18
|
+
editor: "editor";
|
|
20
19
|
viewer: "viewer";
|
|
21
20
|
commenter: "commenter";
|
|
22
|
-
editor: "editor";
|
|
23
21
|
manager: "manager";
|
|
24
22
|
}>;
|
|
25
23
|
export type AccessRole = z.infer<typeof accessRoleSchema>;
|
|
@@ -31,15 +29,13 @@ export declare const ACCESS_ROLE_CAPABILITIES: {
|
|
|
31
29
|
};
|
|
32
30
|
export declare function accessRoleCapabilities(role: AccessRole): GrantCapability[];
|
|
33
31
|
/**
|
|
34
|
-
* The role a capability set amounts to
|
|
35
|
-
*
|
|
36
|
-
* exactly; this reports the role it reaches, never more.
|
|
32
|
+
* The role a capability set amounts to: the strongest role it reaches, never
|
|
33
|
+
* more. A Grant assembled capability-by-capability need not match one exactly.
|
|
37
34
|
*/
|
|
38
35
|
export declare function accessRoleForCapabilities(capabilities: readonly GrantCapability[]): AccessRole;
|
|
39
36
|
/**
|
|
40
|
-
* Roles a
|
|
41
|
-
*
|
|
42
|
-
* the same boundary `grantSchema` enforces on the capabilities themselves.
|
|
37
|
+
* Roles a forwardable secret (a Link, a password) can carry. It never publishes
|
|
38
|
+
* and never manages access; `grantSchema` enforces that on capabilities too.
|
|
43
39
|
*/
|
|
44
40
|
export declare const VISITOR_ACCESS_ROLES: readonly ["viewer", "commenter"];
|
|
45
41
|
export type VisitorAccessRole = (typeof VISITOR_ACCESS_ROLES)[number];
|
|
@@ -70,18 +66,17 @@ export declare function accountPrincipal(userId: string): AccountPrincipal;
|
|
|
70
66
|
/** The user id behind an account principal; null for anonymous or malformed. */
|
|
71
67
|
export declare function accountPrincipalUserId(principal: string | undefined | null): string | null;
|
|
72
68
|
/**
|
|
73
|
-
* The identity an authority reference names on its own, if any.
|
|
74
|
-
*
|
|
75
|
-
* the exchange that just authenticated it, never downstream.
|
|
69
|
+
* The identity an authority reference names on its own, if any. The ONE place a
|
|
70
|
+
* class maps to an identity: at the exchange that authenticated it, never after.
|
|
76
71
|
*/
|
|
77
72
|
export declare function principalForAuthority(reference: AuthorityReference): IdentifiedPrincipal | undefined;
|
|
78
73
|
export declare const personGrantSchema: z.ZodObject<{
|
|
79
74
|
id: z.ZodString;
|
|
80
75
|
scope: z.ZodString;
|
|
81
76
|
role: z.ZodEnum<{
|
|
77
|
+
editor: "editor";
|
|
82
78
|
viewer: "viewer";
|
|
83
79
|
commenter: "commenter";
|
|
84
|
-
editor: "editor";
|
|
85
80
|
manager: "manager";
|
|
86
81
|
}>;
|
|
87
82
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -120,9 +115,9 @@ export declare const spacePersonSchema: z.ZodObject<{
|
|
|
120
115
|
id: z.ZodString;
|
|
121
116
|
scope: z.ZodString;
|
|
122
117
|
role: z.ZodEnum<{
|
|
118
|
+
editor: "editor";
|
|
123
119
|
viewer: "viewer";
|
|
124
120
|
commenter: "commenter";
|
|
125
|
-
editor: "editor";
|
|
126
121
|
manager: "manager";
|
|
127
122
|
}>;
|
|
128
123
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -175,9 +170,9 @@ export declare const spacePeopleListSchema: z.ZodObject<{
|
|
|
175
170
|
id: z.ZodString;
|
|
176
171
|
scope: z.ZodString;
|
|
177
172
|
role: z.ZodEnum<{
|
|
173
|
+
editor: "editor";
|
|
178
174
|
viewer: "viewer";
|
|
179
175
|
commenter: "commenter";
|
|
180
|
-
editor: "editor";
|
|
181
176
|
manager: "manager";
|
|
182
177
|
}>;
|
|
183
178
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -373,9 +368,9 @@ export declare const canonicalAccessRequestStatusSchema: z.ZodEnum<{
|
|
|
373
368
|
denied: "denied";
|
|
374
369
|
}>;
|
|
375
370
|
export declare const accessRequestRoleSchema: z.ZodEnum<{
|
|
371
|
+
editor: "editor";
|
|
376
372
|
viewer: "viewer";
|
|
377
373
|
commenter: "commenter";
|
|
378
|
-
editor: "editor";
|
|
379
374
|
manager: "manager";
|
|
380
375
|
}>;
|
|
381
376
|
export type AccessRequestRole = z.infer<typeof accessRequestRoleSchema>;
|
|
@@ -386,9 +381,9 @@ export declare const canonicalAccessRequestSchema: z.ZodObject<{
|
|
|
386
381
|
email: z.ZodString;
|
|
387
382
|
scope: z.ZodString;
|
|
388
383
|
requestedRole: z.ZodEnum<{
|
|
384
|
+
editor: "editor";
|
|
389
385
|
viewer: "viewer";
|
|
390
386
|
commenter: "commenter";
|
|
391
|
-
editor: "editor";
|
|
392
387
|
manager: "manager";
|
|
393
388
|
}>;
|
|
394
389
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -424,9 +419,9 @@ export type LinkCapabilities = z.infer<typeof linkCapabilitiesSchema>;
|
|
|
424
419
|
export declare const personGrantWriteSchema: z.ZodObject<{
|
|
425
420
|
scope: z.ZodString;
|
|
426
421
|
role: z.ZodEnum<{
|
|
422
|
+
editor: "editor";
|
|
427
423
|
viewer: "viewer";
|
|
428
424
|
commenter: "commenter";
|
|
429
|
-
editor: "editor";
|
|
430
425
|
manager: "manager";
|
|
431
426
|
}>;
|
|
432
427
|
target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -446,9 +441,9 @@ export declare const spacePersonInviteWriteSchema: z.ZodObject<{
|
|
|
446
441
|
grants: z.ZodArray<z.ZodObject<{
|
|
447
442
|
scope: z.ZodString;
|
|
448
443
|
role: z.ZodEnum<{
|
|
444
|
+
editor: "editor";
|
|
449
445
|
viewer: "viewer";
|
|
450
446
|
commenter: "commenter";
|
|
451
|
-
editor: "editor";
|
|
452
447
|
manager: "manager";
|
|
453
448
|
}>;
|
|
454
449
|
target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -469,9 +464,9 @@ export declare const spacePersonGrantSetWriteSchema: z.ZodObject<{
|
|
|
469
464
|
grants: z.ZodArray<z.ZodObject<{
|
|
470
465
|
scope: z.ZodString;
|
|
471
466
|
role: z.ZodEnum<{
|
|
467
|
+
editor: "editor";
|
|
472
468
|
viewer: "viewer";
|
|
473
469
|
commenter: "commenter";
|
|
474
|
-
editor: "editor";
|
|
475
470
|
manager: "manager";
|
|
476
471
|
}>;
|
|
477
472
|
target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -564,9 +559,9 @@ export declare const canonicalAccessRequestCreateSchema: z.ZodObject<{
|
|
|
564
559
|
email: z.ZodString;
|
|
565
560
|
scope: z.ZodString;
|
|
566
561
|
requestedRole: z.ZodDefault<z.ZodEnum<{
|
|
562
|
+
editor: "editor";
|
|
567
563
|
viewer: "viewer";
|
|
568
564
|
commenter: "commenter";
|
|
569
|
-
editor: "editor";
|
|
570
565
|
manager: "manager";
|
|
571
566
|
}>>;
|
|
572
567
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -574,9 +569,9 @@ export declare const canonicalAccessRequestCreateSchema: z.ZodObject<{
|
|
|
574
569
|
export declare const canonicalAccessRequestApproveSchema: z.ZodObject<{
|
|
575
570
|
scope: z.ZodOptional<z.ZodString>;
|
|
576
571
|
role: z.ZodOptional<z.ZodEnum<{
|
|
572
|
+
editor: "editor";
|
|
577
573
|
viewer: "viewer";
|
|
578
574
|
commenter: "commenter";
|
|
579
|
-
editor: "editor";
|
|
580
575
|
manager: "manager";
|
|
581
576
|
}>>;
|
|
582
577
|
}, z.core.$strip>;
|
|
@@ -631,9 +626,8 @@ export declare const teamSpaceAccessDefaultWriteSchema: z.ZodObject<{
|
|
|
631
626
|
export declare const ACCESS_TOKEN_KID = "spacefast-runtime-v1";
|
|
632
627
|
export declare const ACCESS_TOKEN_ALG = "EdDSA";
|
|
633
628
|
/**
|
|
634
|
-
* The claim-schema version every platform token carries in `v`.
|
|
635
|
-
*
|
|
636
|
-
* under a later shape instead of reading unknown claims optimistically.
|
|
629
|
+
* The claim-schema version every platform token carries in `v`. A verifier that
|
|
630
|
+
* understands v1 refuses a token minted under a later shape.
|
|
637
631
|
*/
|
|
638
632
|
export declare const PLATFORM_TOKEN_CLAIM_VERSION: 1;
|
|
639
633
|
export declare const BLOB_GATE_DOWNLOAD_TTL_SECONDS: number;
|