@spacefast/common 0.0.21 → 0.0.24
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 +9 -6
- package/dist/agents/connect-targets.js +9 -6
- package/dist/config/domains.d.ts +1 -1
- package/dist/config/domains.js +1 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -1
- package/dist/contracts/abuse.d.ts +2 -0
- package/dist/contracts/abuse.js +12 -0
- package/dist/contracts/access.d.ts +121 -9
- package/dist/contracts/access.js +73 -9
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +0 -9
- package/dist/contracts/api-keys.d.ts +21 -21
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/billing.d.ts +1 -34
- package/dist/contracts/billing.js +4 -53
- package/dist/contracts/builds.d.ts +8 -8
- package/dist/contracts/builds.js +10 -3
- package/dist/contracts/cli.d.ts +10 -0
- package/dist/contracts/cli.js +10 -0
- package/dist/contracts/collab-public.d.ts +63 -0
- package/dist/contracts/collab-public.js +46 -0
- package/dist/contracts/comments.d.ts +283 -54
- package/dist/contracts/comments.js +173 -52
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +6 -6
- package/dist/contracts/device-auth.js +1 -1
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/domains.d.ts +36 -36
- package/dist/contracts/enums.d.ts +33 -30
- package/dist/contracts/enums.js +52 -38
- package/dist/contracts/error-code-meta.d.ts +37 -126
- package/dist/contracts/error-code-meta.js +12 -41
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +10 -32
- package/dist/contracts/execution.d.ts +35 -57
- package/dist/contracts/execution.js +41 -40
- package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
- package/dist/contracts/feature-lifecycle-core.js +2 -31
- package/dist/contracts/feature-lifecycle.d.ts +8 -38
- package/dist/contracts/feature-lifecycle.js +16 -48
- package/dist/contracts/features.d.ts +15 -13
- package/dist/contracts/features.js +39 -38
- package/dist/contracts/functions.d.ts +97 -70
- package/dist/contracts/functions.js +101 -34
- package/dist/contracts/git.d.ts +1 -1
- package/dist/contracts/grants.d.ts +7 -3
- package/dist/contracts/grants.js +18 -9
- package/dist/contracts/internal.d.ts +14 -1
- package/dist/contracts/internal.js +17 -7
- package/dist/contracts/oauth-resources.d.ts +4 -3
- package/dist/contracts/oauth-resources.js +12 -3
- package/dist/contracts/operations.d.ts +90 -5
- package/dist/contracts/operations.js +75 -1
- package/dist/contracts/pages.d.ts +6 -1
- package/dist/contracts/pages.js +24 -1
- package/dist/contracts/plan-policy.d.ts +1 -3
- package/dist/contracts/plan-policy.js +1 -2
- package/dist/contracts/platform.d.ts +61 -148
- package/dist/contracts/platform.js +70 -126
- package/dist/contracts/publish-archive.d.ts +498 -0
- package/dist/contracts/publish-archive.js +25 -0
- package/dist/contracts/resources.d.ts +12 -24
- package/dist/contracts/resources.js +32 -12
- package/dist/contracts/runtime-api.d.ts +369 -175
- package/dist/contracts/runtime-api.js +372 -348
- package/dist/contracts/runtime-app.d.ts +127 -120
- package/dist/contracts/runtime-app.js +19 -10
- package/dist/contracts/runtime-db.d.ts +1 -1
- package/dist/contracts/runtime-services.d.ts +219 -0
- package/dist/contracts/runtime-services.js +437 -0
- package/dist/contracts/runtime-storage.d.ts +45 -32
- package/dist/contracts/runtime-storage.js +30 -8
- package/dist/contracts/space-config.d.ts +10 -16
- package/dist/contracts/space-config.js +14 -10
- package/dist/contracts/spaces.d.ts +241 -436
- package/dist/contracts/spaces.js +128 -145
- package/dist/contracts/superadmin-activity.d.ts +57 -4
- package/dist/contracts/superadmin-activity.js +48 -2
- package/dist/contracts/superadmin-search.d.ts +126 -0
- package/dist/contracts/superadmin-search.js +61 -0
- package/dist/contracts/superadmin-spaces.d.ts +358 -89
- package/dist/contracts/superadmin-spaces.js +97 -24
- package/dist/contracts/superadmin-teams.d.ts +28 -10
- package/dist/contracts/superadmin-teams.js +5 -8
- package/dist/contracts/superadmin.d.ts +0 -32
- package/dist/contracts/superadmin.js +3 -11
- package/dist/contracts/tags.d.ts +9 -9
- package/dist/contracts/teams.d.ts +44 -2
- package/dist/contracts/teams.js +43 -23
- package/dist/contracts/transfers.d.ts +0 -49
- package/dist/contracts/transfers.js +2 -6
- package/dist/contracts/usage.d.ts +61 -0
- package/dist/contracts/usage.js +64 -0
- package/dist/contracts/variables.d.ts +2 -7
- package/dist/contracts/variables.js +6 -5
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +87 -56
- package/dist/contracts/zero.js +82 -20
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/dashboard-paths/index.js +1 -0
- package/dist/docs/agent-prose.d.ts +1 -1
- package/dist/docs/agent-prose.js +62 -66
- package/dist/docs/agent-setup.js +49 -23
- package/dist/docs/agent-solutions.d.ts +4 -4
- package/dist/docs/agent-solutions.js +8 -8
- package/dist/docs/catalog.d.ts +19 -19
- package/dist/docs/catalog.js +30 -19
- package/dist/docs/error-docs.js +63 -151
- package/dist/docs/skills.d.ts +3 -3
- package/dist/docs/skills.js +1 -1
- package/dist/test-helpers/fetch-stub.d.ts +16 -0
- package/dist/test-helpers/fetch-stub.js +24 -0
- package/dist/utils/build-settings.js +9 -3
- package/dist/utils/canonical-json.d.ts +10 -0
- package/dist/utils/canonical-json.js +21 -0
- package/dist/utils/cast-transport.d.ts +28 -0
- package/dist/utils/cast-transport.js +52 -0
- package/dist/utils/claim-token.d.ts +0 -8
- package/dist/utils/claim-token.js +3 -15
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/env-file.d.ts +17 -0
- package/dist/utils/env-file.js +96 -0
- package/dist/utils/error-code.d.ts +2 -0
- package/dist/utils/error-code.js +7 -0
- package/dist/utils/generate-space-name.d.ts +8 -10
- package/dist/utils/generate-space-name.js +206 -21
- package/dist/utils/grant-decision.fixtures.json +2938 -0
- package/dist/utils/grants.d.ts +2 -0
- package/dist/utils/grants.js +25 -2
- package/dist/utils/gravatar.d.ts +9 -0
- package/dist/utils/gravatar.js +31 -0
- package/dist/utils/idempotency.d.ts +6 -0
- package/dist/utils/idempotency.js +28 -0
- package/dist/utils/local-space-state.d.ts +1 -5
- package/dist/utils/local-space-state.js +7 -26
- package/dist/utils/page-fonts.d.ts +2 -2
- package/dist/utils/page-fonts.js +22 -4
- package/dist/utils/pages.d.ts +1 -2
- package/dist/utils/pages.js +21 -5
- package/dist/utils/publish-form-data.d.ts +12 -0
- package/dist/utils/publish-form-data.js +10 -0
- package/dist/utils/publish-policy.d.ts +20 -0
- package/dist/utils/publish-policy.fixtures.json +397 -0
- package/dist/utils/publish-policy.js +36 -19
- package/dist/utils/push-new.d.ts +7 -0
- package/dist/utils/push-new.js +7 -0
- package/dist/utils/query-keys.d.ts +0 -1
- package/dist/utils/query-keys.js +0 -1
- package/dist/utils/runtime-paths.d.ts +5 -0
- package/dist/utils/runtime-paths.js +5 -0
- package/dist/utils/runtime-upload-batch.d.ts +0 -5
- package/dist/utils/runtime-upload-batch.js +1 -27
- package/dist/utils/runtime-upload.d.ts +3 -13
- package/dist/utils/runtime-upload.js +4 -14
- package/dist/utils/space-config.d.ts +0 -33
- package/dist/utils/space-config.js +5 -326
- package/dist/utils/storage-policy.d.ts +1 -1
- package/dist/utils/storage-policy.js +3 -1
- package/dist/utils/structured-error.d.ts +14 -0
- package/dist/utils/structured-error.js +22 -0
- package/dist/utils/version-path.js +12 -3
- package/dist/vocabulary.d.ts +5 -3
- package/dist/vocabulary.js +13 -10
- package/package.json +10 -5
- package/dist/config/postgres-budget.d.ts +0 -129
- package/dist/config/postgres-budget.js +0 -140
- package/dist/config/postgres-budget.json +0 -51
- package/dist/contracts/archives.d.ts +0 -331
- package/dist/contracts/archives.js +0 -120
- package/dist/contracts/deployments.d.ts +0 -574
- package/dist/contracts/deployments.js +0 -97
- package/dist/contracts/sites.d.ts +0 -416
- package/dist/contracts/sites.js +0 -168
- package/dist/contracts/superadmin-queues.d.ts +0 -414
- package/dist/contracts/superadmin-queues.js +0 -202
- package/dist/contracts/superadmin-runtime.d.ts +0 -27
- package/dist/contracts/superadmin-runtime.js +0 -38
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/utils/api.d.ts +0 -4
- package/dist/utils/api.js +0 -13
|
@@ -2,6 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
|
|
3
3
|
export declare const SPACE_CONFIG_ALIAS_FILES: readonly ["spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
|
|
4
4
|
export declare const SPACE_CONFIG_ACCEPTED_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
|
|
5
|
+
/**
|
|
6
|
+
* Accepted config filenames in read precedence order, highest first. Kept in
|
|
7
|
+
* step with the finalizer's `CONFIG_PRECEDENCE` (crates/stattic-runtime-core
|
|
8
|
+
* protocol.rs) — the runtime compile is the selection authority, and a local
|
|
9
|
+
* read choosing a different file than the publish serves is a split brain.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SPACE_CONFIG_PRECEDENCE: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
|
|
5
12
|
export declare const SPACE_CONFIG_PRIVATE_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
|
|
6
13
|
export declare const SPACE_CONFIG_CAPS: {
|
|
7
14
|
/** Max raw `sf.jsonc` size in bytes. */
|
|
@@ -12,6 +19,7 @@ export declare const SPACE_CONFIG_CAPS: {
|
|
|
12
19
|
readonly templates: 100;
|
|
13
20
|
readonly metaTitleChars: 300;
|
|
14
21
|
readonly metaDescriptionChars: 1000;
|
|
22
|
+
/** Max OG image or favicon path/URL length; enough for signed URLs while staying request-safe. */
|
|
15
23
|
readonly metaImageChars: 2000;
|
|
16
24
|
/** Max bytes per `inject` snippet. */
|
|
17
25
|
readonly injectSnippetBytes: number;
|
|
@@ -53,15 +61,7 @@ export declare const spaceBuildSettingsSchema: z.ZodObject<{
|
|
|
53
61
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
54
62
|
}, z.core.$strict>;
|
|
55
63
|
export type SpaceBuildSettings = z.infer<typeof spaceBuildSettingsSchema>;
|
|
56
|
-
export declare const spacePlacementModeSchema: z.ZodEnum<{
|
|
57
|
-
shared: "shared";
|
|
58
|
-
dedicated: "dedicated";
|
|
59
|
-
}>;
|
|
60
64
|
export declare const spacePlacementConfigSchema: z.ZodObject<{
|
|
61
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
shared: "shared";
|
|
63
|
-
dedicated: "dedicated";
|
|
64
|
-
}>>;
|
|
65
65
|
burstable: z.ZodOptional<z.ZodBoolean>;
|
|
66
66
|
}, z.core.$strict>;
|
|
67
67
|
export type SpacePlacementConfig = z.infer<typeof spacePlacementConfigSchema>;
|
|
@@ -88,6 +88,7 @@ export declare const spaceConfigSchema: z.ZodObject<{
|
|
|
88
88
|
title: z.ZodOptional<z.ZodString>;
|
|
89
89
|
description: z.ZodOptional<z.ZodString>;
|
|
90
90
|
image: z.ZodOptional<z.ZodString>;
|
|
91
|
+
favicon: z.ZodOptional<z.ZodString>;
|
|
91
92
|
}, z.core.$strip>>;
|
|
92
93
|
superpowers: z.ZodOptional<z.ZodObject<{
|
|
93
94
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -140,10 +141,6 @@ export declare const spaceConfigSchema: z.ZodObject<{
|
|
|
140
141
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
141
142
|
}, z.core.$strict>>;
|
|
142
143
|
placement: z.ZodOptional<z.ZodObject<{
|
|
143
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
144
|
-
shared: "shared";
|
|
145
|
-
dedicated: "dedicated";
|
|
146
|
-
}>>;
|
|
147
144
|
burstable: z.ZodOptional<z.ZodBoolean>;
|
|
148
145
|
}, z.core.$strict>>;
|
|
149
146
|
markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -231,6 +228,7 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
|
231
228
|
title: z.ZodOptional<z.ZodString>;
|
|
232
229
|
description: z.ZodOptional<z.ZodString>;
|
|
233
230
|
image: z.ZodOptional<z.ZodString>;
|
|
231
|
+
favicon: z.ZodOptional<z.ZodString>;
|
|
234
232
|
}, z.core.$strip>>;
|
|
235
233
|
superpowers: z.ZodOptional<z.ZodObject<{
|
|
236
234
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -283,10 +281,6 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
|
283
281
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
284
282
|
}, z.core.$strict>>;
|
|
285
283
|
placement: z.ZodOptional<z.ZodObject<{
|
|
286
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
287
|
-
shared: "shared";
|
|
288
|
-
dedicated: "dedicated";
|
|
289
|
-
}>>;
|
|
290
284
|
burstable: z.ZodOptional<z.ZodBoolean>;
|
|
291
285
|
}, z.core.$strict>>;
|
|
292
286
|
markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { serviceOrigin } from "../config/domains.js";
|
|
3
|
-
import { normalizedSiteClass } from "./enums.js";
|
|
4
3
|
import { GRANT_RESOURCE_PATTERN_LIMIT, normalizeGrantResourcePattern } from "./grants.js";
|
|
5
4
|
export const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
|
|
6
5
|
export const SPACE_CONFIG_ALIAS_FILES = [
|
|
@@ -15,6 +14,13 @@ export const SPACE_CONFIG_ACCEPTED_FILES = [
|
|
|
15
14
|
SPACE_CONFIG_CANONICAL_FILE,
|
|
16
15
|
...SPACE_CONFIG_ALIAS_FILES,
|
|
17
16
|
];
|
|
17
|
+
/**
|
|
18
|
+
* Accepted config filenames in read precedence order, highest first. Kept in
|
|
19
|
+
* step with the finalizer's `CONFIG_PRECEDENCE` (crates/stattic-runtime-core
|
|
20
|
+
* protocol.rs) — the runtime compile is the selection authority, and a local
|
|
21
|
+
* read choosing a different file than the publish serves is a split brain.
|
|
22
|
+
*/
|
|
23
|
+
export const SPACE_CONFIG_PRECEDENCE = SPACE_CONFIG_ACCEPTED_FILES;
|
|
18
24
|
export const SPACE_CONFIG_PRIVATE_FILES = [...SPACE_CONFIG_ACCEPTED_FILES];
|
|
19
25
|
// Config compiler parser-safety caps (internal-docs/platform.md "Config
|
|
20
26
|
// compiler scale targets"): hard from launch, enforced by ONE shared validator
|
|
@@ -30,6 +36,7 @@ export const SPACE_CONFIG_CAPS = {
|
|
|
30
36
|
templates: 100,
|
|
31
37
|
metaTitleChars: 300,
|
|
32
38
|
metaDescriptionChars: 1000,
|
|
39
|
+
/** Max OG image or favicon path/URL length; enough for signed URLs while staying request-safe. */
|
|
33
40
|
metaImageChars: 2000,
|
|
34
41
|
/** Max bytes per `inject` snippet. */
|
|
35
42
|
injectSnippetBytes: 8 * 1024,
|
|
@@ -126,16 +133,12 @@ export const spaceBuildSettingsSchema = z
|
|
|
126
133
|
})
|
|
127
134
|
.strict()
|
|
128
135
|
.describe("Remote build settings used by repository builds.");
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
// space
|
|
132
|
-
|
|
133
|
-
// No region knob: a space binds to the site it was placed on at creation and
|
|
134
|
-
// the only placement change that relocates it is shared -> dedicated. Data
|
|
135
|
-
// location is chosen once, at creation, and never changes.
|
|
136
|
+
// Every space gets its own site, so there is nothing to place between: no mode,
|
|
137
|
+
// no region knob. `burstable` is the one real provider knob left — whether the
|
|
138
|
+
// space's site may burst provider PHP workers. Data location is chosen once, at
|
|
139
|
+
// creation, and never changes.
|
|
136
140
|
export const spacePlacementConfigSchema = z
|
|
137
141
|
.object({
|
|
138
|
-
mode: spacePlacementModeSchema.optional(),
|
|
139
142
|
burstable: z.boolean().optional(),
|
|
140
143
|
})
|
|
141
144
|
.strict()
|
|
@@ -377,9 +380,10 @@ const spaceConfigBaseSchema = z.object({
|
|
|
377
380
|
title: z.string().min(1).max(SPACE_CONFIG_CAPS.metaTitleChars).optional(),
|
|
378
381
|
description: z.string().max(SPACE_CONFIG_CAPS.metaDescriptionChars).optional(),
|
|
379
382
|
image: z.string().max(SPACE_CONFIG_CAPS.metaImageChars).optional(),
|
|
383
|
+
favicon: z.string().max(SPACE_CONFIG_CAPS.metaImageChars).optional(),
|
|
380
384
|
})
|
|
381
385
|
.optional()
|
|
382
|
-
.describe("Listing
|
|
386
|
+
.describe("Listing, viewer, sharing, and browser icon metadata."),
|
|
383
387
|
superpowers: z
|
|
384
388
|
.object({
|
|
385
389
|
enabled: z.boolean().optional().describe("Master switch for platform-managed injections."),
|