@spacefast/common 0.0.5 → 0.0.7
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/spacefast-favicon.svg +16 -0
- package/brand-assets/spacefast-sf-full-bleed.svg +13 -0
- package/brand-assets/spacefast-wordmark.svg +5 -0
- package/dist/agents/connect-targets.d.ts +138 -0
- package/dist/agents/connect-targets.js +243 -0
- package/dist/brand-assets-build.d.ts +26 -0
- package/dist/brand-assets-build.js +81 -0
- package/dist/brand-assets.d.ts +42 -0
- package/dist/brand-assets.js +30 -0
- package/dist/brand.d.ts +1 -0
- package/dist/brand.js +5 -0
- package/dist/config/domains.d.ts +12 -6
- package/dist/config/domains.js +30 -38
- package/dist/contracts/access.d.ts +967 -124
- package/dist/contracts/access.js +804 -148
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +28 -2
- package/dist/contracts/annotations.d.ts +2 -4
- package/dist/contracts/api-keys.d.ts +126 -4
- package/dist/contracts/api-keys.js +74 -6
- package/dist/contracts/archives.d.ts +8 -2
- package/dist/contracts/archives.js +11 -4
- package/dist/contracts/billing.d.ts +0 -9
- package/dist/contracts/builds.d.ts +65 -21
- package/dist/contracts/builds.js +29 -0
- package/dist/contracts/common.d.ts +2 -0
- package/dist/contracts/common.js +4 -0
- package/dist/contracts/continuation.d.ts +0 -3
- package/dist/contracts/countries.d.ts +2 -0
- package/dist/contracts/countries.js +261 -0
- package/dist/contracts/deployments.d.ts +34 -34
- package/dist/contracts/device-auth.d.ts +4 -11
- package/dist/contracts/device-auth.js +4 -0
- package/dist/contracts/docs.d.ts +119 -0
- package/dist/contracts/docs.js +51 -0
- package/dist/contracts/domains.d.ts +96 -54
- package/dist/contracts/domains.js +26 -4
- package/dist/contracts/enums.d.ts +15 -16
- package/dist/contracts/enums.js +26 -14
- package/dist/contracts/error-code-meta.d.ts +184 -0
- package/dist/contracts/error-code-meta.js +124 -10
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +42 -0
- package/dist/contracts/events.d.ts +1 -1
- package/dist/contracts/feature-lifecycle-core.d.ts +36 -0
- package/dist/contracts/feature-lifecycle-core.js +220 -0
- package/dist/contracts/feature-lifecycle.d.ts +7 -0
- package/dist/contracts/feature-lifecycle.js +31 -0
- package/dist/contracts/features.d.ts +76 -6
- package/dist/contracts/features.js +178 -13
- package/dist/contracts/generated-feature-launch-entries.d.ts +2 -0
- package/dist/contracts/generated-feature-launch-entries.js +518 -0
- package/dist/contracts/git.d.ts +2 -8
- package/dist/contracts/ids.d.ts +9 -0
- package/dist/contracts/ids.js +13 -0
- package/dist/contracts/mcp.d.ts +8 -10
- package/dist/contracts/me.js +1 -1
- package/dist/contracts/oauth-resources.d.ts +19 -8
- package/dist/contracts/oauth-resources.js +44 -13
- package/dist/contracts/operations.d.ts +161 -1
- package/dist/contracts/operations.js +49 -1
- package/dist/contracts/platform.d.ts +6 -102
- package/dist/contracts/platform.js +6 -50
- package/dist/contracts/publishes.d.ts +130 -0
- package/dist/contracts/publishes.js +145 -0
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.d.ts +2 -0
- package/dist/contracts/quotas.js +8 -0
- package/dist/contracts/repository-connections.d.ts +9 -8
- package/dist/contracts/repository-connections.js +13 -0
- package/dist/contracts/resources.d.ts +99 -13
- package/dist/contracts/resources.js +36 -4
- package/dist/contracts/routes.d.ts +0 -2
- package/dist/contracts/runtime-api.d.ts +363 -39
- package/dist/contracts/runtime-api.js +276 -6
- package/dist/contracts/sf-config-v1.d.ts +75 -0
- package/dist/contracts/sf-config-v1.js +6 -0
- package/dist/contracts/sites.d.ts +19 -2
- package/dist/contracts/sites.js +21 -0
- package/dist/contracts/space-config.d.ts +201 -2
- package/dist/contracts/space-config.js +135 -5
- package/dist/contracts/spaces.d.ts +376 -196
- package/dist/contracts/spaces.js +62 -10
- package/dist/contracts/superadmin-emails.d.ts +4 -2
- package/dist/contracts/superadmin-emails.js +8 -0
- package/dist/contracts/superadmin-queues.d.ts +26 -26
- package/dist/contracts/superadmin-spaces.d.ts +172 -42
- package/dist/contracts/superadmin-tenants.d.ts +6 -6
- package/dist/contracts/superadmin-tenants.js +6 -11
- package/dist/contracts/superadmin.d.ts +6 -93
- package/dist/contracts/superadmin.js +6 -14
- package/dist/contracts/tags.d.ts +10 -9
- package/dist/contracts/tags.js +2 -1
- package/dist/contracts/teams.d.ts +26 -30
- package/dist/contracts/teams.js +11 -17
- package/dist/contracts/theme-json.d.ts +30 -0
- package/dist/contracts/theme-json.js +48 -0
- package/dist/contracts/variables.d.ts +0 -2
- package/dist/contracts/variables.js +0 -5
- package/dist/contracts/webhooks.d.ts +2 -0
- package/dist/contracts/webhooks.js +1 -1
- package/dist/contracts/zero.d.ts +5 -10
- package/dist/docs/agent-prose.d.ts +43 -3
- package/dist/docs/agent-prose.js +146 -7
- package/dist/docs/agent-setup.d.ts +51 -0
- package/dist/docs/agent-setup.js +211 -14
- package/dist/docs/agent-solutions.d.ts +5 -5
- package/dist/docs/agent-solutions.js +2 -2
- package/dist/docs/catalog.d.ts +650 -0
- package/dist/docs/catalog.js +758 -0
- package/dist/docs/error-docs.d.ts +0 -2
- package/dist/docs/error-docs.js +189 -35
- package/dist/docs/index-build.d.ts +17 -0
- package/dist/docs/index-build.js +24 -0
- package/dist/docs/search.d.ts +54 -0
- package/dist/docs/search.js +96 -0
- package/dist/docs/skill-distribution.d.ts +5 -3
- package/dist/docs/skill-distribution.js +8 -8
- package/dist/slug-policy/blocklist.d.ts +4 -0
- package/dist/slug-policy/blocklist.js +122 -0
- package/dist/slug-policy/index.d.ts +17 -0
- package/dist/slug-policy/index.js +86 -0
- package/dist/utils/access-match.d.ts +39 -0
- package/dist/utils/access-match.js +296 -0
- package/dist/utils/auth-redirect.d.ts +3 -1
- package/dist/utils/auth-redirect.js +21 -1
- package/dist/utils/build-settings.d.ts +6 -0
- package/dist/utils/build-settings.js +429 -46
- package/dist/utils/claim-token.d.ts +8 -0
- package/dist/utils/claim-token.js +23 -2
- package/dist/utils/concurrency.d.ts +1 -0
- package/dist/utils/concurrency.js +22 -0
- package/dist/utils/content-type.d.ts +1 -0
- package/dist/utils/content-type.js +1 -1
- package/dist/utils/credential-policy.d.ts +54 -0
- package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
- package/dist/utils/email.d.ts +1 -0
- package/dist/utils/email.js +3 -0
- package/dist/utils/gate-theme.d.ts +61 -0
- package/dist/utils/gate-theme.js +217 -0
- package/dist/utils/git-repository.d.ts +0 -1
- package/dist/utils/git-repository.js +0 -3
- package/dist/utils/id-hints.d.ts +8 -0
- package/dist/utils/id-hints.js +61 -0
- package/dist/utils/local-space-state.d.ts +91 -0
- package/dist/utils/local-space-state.js +251 -0
- package/dist/utils/oauth-signed-query.d.ts +8 -0
- package/dist/utils/oauth-signed-query.js +26 -0
- package/dist/utils/publish-detection.d.ts +0 -8
- package/dist/utils/publish-detection.js +0 -93
- package/dist/utils/publish-policy.d.ts +6 -5
- package/dist/utils/publish-policy.js +71 -7
- package/dist/utils/query-keys.d.ts +16 -4
- package/dist/utils/query-keys.js +31 -4
- package/dist/utils/runtime-paths.d.ts +0 -1
- package/dist/utils/runtime-paths.js +0 -1
- package/dist/utils/runtime-upload-batch.d.ts +18 -0
- package/dist/utils/runtime-upload-batch.js +90 -0
- package/dist/utils/runtime-upload.d.ts +2 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/sf-config-v1.d.ts +2 -0
- package/dist/utils/sf-config-v1.js +542 -0
- package/dist/utils/space-config.d.ts +4 -0
- package/dist/utils/space-config.js +10 -1
- package/dist/utils/space-theme.d.ts +2 -0
- package/dist/utils/space-theme.js +9 -0
- package/dist/utils/static-runtime-policy.d.ts +0 -21
- package/dist/utils/static-runtime-policy.js +19 -103
- package/dist/utils/upload-session.d.ts +1 -1
- package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
- package/dist/utils/wpcom-auth-redirects.js +26 -10
- package/dist/vocabulary.d.ts +130 -30
- package/dist/vocabulary.js +77 -36
- package/package.json +35 -1
- package/dist/contracts/account.d.ts +0 -28
- package/dist/contracts/account.js +0 -54
- package/dist/contracts/intercom.d.ts +0 -6
- package/dist/contracts/intercom.js +0 -5
- package/dist/contracts/telemetry.d.ts +0 -2
- package/dist/contracts/telemetry.js +0 -1
- package/dist/utils/access-policy.d.ts +0 -39
- package/dist/utils/error-display.d.ts +0 -7
- package/dist/utils/error-display.js +0 -42
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spacefast/common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared TypeScript contracts and utilities for Spacefast packages.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/spacefast/monorepo.git",
|
|
9
|
+
"directory": "packages/common"
|
|
10
|
+
},
|
|
6
11
|
"type": "module",
|
|
7
12
|
"publishConfig": {
|
|
8
13
|
"access": "public"
|
|
@@ -12,6 +17,7 @@
|
|
|
12
17
|
"node": ">=20"
|
|
13
18
|
},
|
|
14
19
|
"files": [
|
|
20
|
+
"brand-assets",
|
|
15
21
|
"dist"
|
|
16
22
|
],
|
|
17
23
|
"exports": {
|
|
@@ -20,6 +26,24 @@
|
|
|
20
26
|
"import": "./dist/brand.js",
|
|
21
27
|
"default": "./dist/brand.js"
|
|
22
28
|
},
|
|
29
|
+
"./brand-assets": {
|
|
30
|
+
"types": "./dist/brand-assets.d.ts",
|
|
31
|
+
"import": "./dist/brand-assets.js",
|
|
32
|
+
"default": "./dist/brand-assets.js"
|
|
33
|
+
},
|
|
34
|
+
"./brand-assets/build": {
|
|
35
|
+
"types": "./dist/brand-assets-build.d.ts",
|
|
36
|
+
"import": "./dist/brand-assets-build.js",
|
|
37
|
+
"default": "./dist/brand-assets-build.js"
|
|
38
|
+
},
|
|
39
|
+
"./brand-assets/spacefast-wordmark.svg": "./brand-assets/spacefast-wordmark.svg",
|
|
40
|
+
"./brand-assets/spacefast-sf-full-bleed.svg": "./brand-assets/spacefast-sf-full-bleed.svg",
|
|
41
|
+
"./brand-assets/spacefast-favicon.svg": "./brand-assets/spacefast-favicon.svg",
|
|
42
|
+
"./vocabulary": {
|
|
43
|
+
"types": "./dist/vocabulary.d.ts",
|
|
44
|
+
"import": "./dist/vocabulary.js",
|
|
45
|
+
"default": "./dist/vocabulary.js"
|
|
46
|
+
},
|
|
23
47
|
"./contracts/*": {
|
|
24
48
|
"types": "./dist/contracts/*.d.ts",
|
|
25
49
|
"import": "./dist/contracts/*.js",
|
|
@@ -35,6 +59,16 @@
|
|
|
35
59
|
"import": "./dist/utils/*.js",
|
|
36
60
|
"default": "./dist/utils/*.js"
|
|
37
61
|
},
|
|
62
|
+
"./slug-policy": {
|
|
63
|
+
"types": "./dist/slug-policy/index.d.ts",
|
|
64
|
+
"import": "./dist/slug-policy/index.js",
|
|
65
|
+
"default": "./dist/slug-policy/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./agents/*": {
|
|
68
|
+
"types": "./dist/agents/*.d.ts",
|
|
69
|
+
"import": "./dist/agents/*.js",
|
|
70
|
+
"default": "./dist/agents/*.js"
|
|
71
|
+
},
|
|
38
72
|
"./domain-exploration": {
|
|
39
73
|
"types": "./dist/domain-exploration.d.ts",
|
|
40
74
|
"import": "./dist/domain-exploration.js",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const accessTokenScope: z.ZodEnum<{
|
|
3
|
-
"account:read": "account:read";
|
|
4
|
-
"account:write": "account:write";
|
|
5
|
-
"team:read": "team:read";
|
|
6
|
-
"team:write": "team:write";
|
|
7
|
-
"space:read": "space:read";
|
|
8
|
-
"space:write": "space:write";
|
|
9
|
-
"domain:read": "domain:read";
|
|
10
|
-
"domain:write": "domain:write";
|
|
11
|
-
}>;
|
|
12
|
-
export type AccessTokenScope = z.infer<typeof accessTokenScope>;
|
|
13
|
-
export declare const ACCESS_TOKEN_SCOPE_DEFINITIONS: {
|
|
14
|
-
value: AccessTokenScope;
|
|
15
|
-
label: string;
|
|
16
|
-
description: string;
|
|
17
|
-
}[];
|
|
18
|
-
export declare const DEFAULT_ACCESS_TOKEN_SCOPES: AccessTokenScope[];
|
|
19
|
-
export type AuthSession = {
|
|
20
|
-
session: {
|
|
21
|
-
id: string;
|
|
22
|
-
};
|
|
23
|
-
user: {
|
|
24
|
-
id: string;
|
|
25
|
-
email?: string | null | undefined;
|
|
26
|
-
name?: string | null | undefined;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const accessTokenScope = z.enum([
|
|
3
|
-
"account:read",
|
|
4
|
-
"account:write",
|
|
5
|
-
"team:read",
|
|
6
|
-
"team:write",
|
|
7
|
-
"space:read",
|
|
8
|
-
"space:write",
|
|
9
|
-
"domain:read",
|
|
10
|
-
"domain:write",
|
|
11
|
-
]);
|
|
12
|
-
export const ACCESS_TOKEN_SCOPE_DEFINITIONS = [
|
|
13
|
-
{
|
|
14
|
-
value: "account:read",
|
|
15
|
-
label: "Read account",
|
|
16
|
-
description: "View account details, active sessions, and existing access tokens.",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
value: "account:write",
|
|
20
|
-
label: "Manage account",
|
|
21
|
-
description: "Update account settings and revoke or create account-scoped credentials.",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
value: "team:read",
|
|
25
|
-
label: "Read teams",
|
|
26
|
-
description: "View team membership, billing, activity, secrets, and settings.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: "team:write",
|
|
30
|
-
label: "Manage teams",
|
|
31
|
-
description: "Change team settings and manage members, invitations, or secrets.",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
value: "space:read",
|
|
35
|
-
label: "Read spaces",
|
|
36
|
-
description: "View spaces, versions, diagnostics, variables, and runtime status.",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
value: "space:write",
|
|
40
|
-
label: "Manage spaces",
|
|
41
|
-
description: "Create, update, publish, and delete spaces, versions, or variables.",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
value: "domain:read",
|
|
45
|
-
label: "Read domains",
|
|
46
|
-
description: "Inspect custom domains, DNS state, and assignment details.",
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
value: "domain:write",
|
|
50
|
-
label: "Manage domains",
|
|
51
|
-
description: "Attach, update, verify, or remove space and team domains.",
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
export const DEFAULT_ACCESS_TOKEN_SCOPES = ["account:read"];
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { EVENT_BODY_CAP_BYTES as TELEMETRY_BODY_CAP_BYTES, EVENT_MAX_EVENTS_PER_REQUEST as TELEMETRY_MAX_EVENTS_PER_REQUEST, eventAcceptedSchema as telemetryAcceptedSchema, eventIngestSchema as telemetryIngestSchema, eventPayloadSchema as telemetryEventSchema, } from "./events.js";
|
|
2
|
-
export type { EventIngest as TelemetryIngest, EventPayload as TelemetryEvent } from "./events.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { EVENT_BODY_CAP_BYTES as TELEMETRY_BODY_CAP_BYTES, EVENT_MAX_EVENTS_PER_REQUEST as TELEMETRY_MAX_EVENTS_PER_REQUEST, eventAcceptedSchema as telemetryAcceptedSchema, eventIngestSchema as telemetryIngestSchema, eventPayloadSchema as telemetryEventSchema, } from "./events.js";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type ApiKeyPreset, type StatticAccessPolicy, type StatticAction } from "../contracts/api-keys.js";
|
|
2
|
-
type RequestCondition = NonNullable<StatticAccessPolicy["statements"][number]["conditions"]>;
|
|
3
|
-
export type PolicyCompileInput = {
|
|
4
|
-
tenantId: string;
|
|
5
|
-
teamId: string;
|
|
6
|
-
};
|
|
7
|
-
export type PolicyAuthorizeInput = {
|
|
8
|
-
policy: StatticAccessPolicy;
|
|
9
|
-
action: StatticAction;
|
|
10
|
-
/**
|
|
11
|
-
* Candidate resource URIs for one request target, evaluated together: spaces
|
|
12
|
-
* are addressed by their canonical site-rooted URI AND a principal-scoped
|
|
13
|
-
* candidate so principal wildcards cover them. A deny matching ANY candidate
|
|
14
|
-
* wins; otherwise an allow matching any candidate permits.
|
|
15
|
-
*/
|
|
16
|
-
resource: string | readonly string[];
|
|
17
|
-
conditions?: RequestCondition;
|
|
18
|
-
};
|
|
19
|
-
export declare function compileApiKeyPreset(preset: ApiKeyPreset, input: PolicyCompileInput): StatticAccessPolicy;
|
|
20
|
-
export declare function compileTeamRolePolicy(input: PolicyCompileInput & {
|
|
21
|
-
role: string;
|
|
22
|
-
}): StatticAccessPolicy;
|
|
23
|
-
export declare function allowPolicy(actions: StatticAction[], resources: string[]): StatticAccessPolicy;
|
|
24
|
-
export declare function denyAllPolicy(): StatticAccessPolicy;
|
|
25
|
-
export declare function policyIsSubsetOfGrantor(requested: StatticAccessPolicy, grantor: StatticAccessPolicy): boolean;
|
|
26
|
-
export declare function policyAllows(input: PolicyAuthorizeInput): boolean;
|
|
27
|
-
export declare function grantedTenantsFromPolicy(policy: StatticAccessPolicy): {
|
|
28
|
-
all: boolean;
|
|
29
|
-
tenantIds: string[];
|
|
30
|
-
};
|
|
31
|
-
export declare function grantedPrincipalsFromPolicy(policy: StatticAccessPolicy, input: {
|
|
32
|
-
tenantId: string;
|
|
33
|
-
principalType: "team" | "external";
|
|
34
|
-
}): {
|
|
35
|
-
all: boolean;
|
|
36
|
-
principalIds: string[];
|
|
37
|
-
};
|
|
38
|
-
export declare function policyReaches(policy: StatticAccessPolicy, resourceBase: string): boolean;
|
|
39
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ApiError } from "./api.js";
|
|
2
|
-
function baseMessage(error) {
|
|
3
|
-
if (error instanceof Error) {
|
|
4
|
-
return error.message;
|
|
5
|
-
}
|
|
6
|
-
return String(error);
|
|
7
|
-
}
|
|
8
|
-
function detailLines(error) {
|
|
9
|
-
if (!(error instanceof ApiError) || !error.details) {
|
|
10
|
-
return [];
|
|
11
|
-
}
|
|
12
|
-
const lines = [];
|
|
13
|
-
const { details } = error;
|
|
14
|
-
const missingPaths = details.missingPaths;
|
|
15
|
-
if (Array.isArray(missingPaths)) {
|
|
16
|
-
const paths = missingPaths.filter((entry) => typeof entry === "string");
|
|
17
|
-
if (paths.length > 0) {
|
|
18
|
-
lines.push(`Missing files: ${paths.join(", ")}`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const path = details.path;
|
|
22
|
-
if (typeof path === "string" && path && lines.length === 0) {
|
|
23
|
-
lines.push(`Path: ${path}`);
|
|
24
|
-
}
|
|
25
|
-
if (error.requestId) {
|
|
26
|
-
lines.push(`Request ID: ${error.requestId}`);
|
|
27
|
-
}
|
|
28
|
-
return lines;
|
|
29
|
-
}
|
|
30
|
-
export function describeError(error) {
|
|
31
|
-
return {
|
|
32
|
-
message: baseMessage(error),
|
|
33
|
-
details: detailLines(error),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function formatErrorMessage(error) {
|
|
37
|
-
const description = describeError(error);
|
|
38
|
-
if (description.details.length === 0) {
|
|
39
|
-
return description.message;
|
|
40
|
-
}
|
|
41
|
-
return `${description.message} ${description.details.join(" ")}`;
|
|
42
|
-
}
|