@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
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FEATURE_RUNTIME_DEFINITIONS, FEATURE_RUNTIME_KEYS, } from "./feature-lifecycle.js";
|
|
3
|
-
// Spec plan vocabulary (
|
|
3
|
+
// Spec plan vocabulary (the platform spec "Plans And Limits").
|
|
4
4
|
// `enterprise` and `internal` are named plans without self-serve pricing.
|
|
5
|
+
// Codes are wire/storage vocabulary and never change with marketing renames:
|
|
6
|
+
// `personal` sells as "Plus" and `work` as "Pro" (2026-08 rename) — display
|
|
7
|
+
// names live on PlanDefinition.name.
|
|
5
8
|
export const PLAN_CODES = ["free", "personal", "work", "enterprise", "internal"];
|
|
6
9
|
export const planCodeSchema = z.enum(PLAN_CODES).describe("Plan code.");
|
|
7
10
|
export const DEFAULT_PLAN_CODE = "free";
|
|
@@ -21,7 +24,7 @@ export const featureOverrideStateSchema = z.enum(FEATURE_OVERRIDE_STATES);
|
|
|
21
24
|
export const planLimitValueSchema = z
|
|
22
25
|
.union([z.number().int().nonnegative(), z.literal("unlimited")])
|
|
23
26
|
.describe('Plan limit value; "unlimited" when the plan does not limit this axis.');
|
|
24
|
-
// Named plan limit table (
|
|
27
|
+
// Named plan limit table (the platform spec "Plans And Limits",
|
|
25
28
|
// Free/Personal/Work columns verbatim). Keys mirror `PlanPolicyResponse.limits`
|
|
26
29
|
// so plan policy is a projection of this data, never a re-derivation.
|
|
27
30
|
export const planLimitsSchema = z
|
|
@@ -31,7 +34,7 @@ export const planLimitsSchema = z
|
|
|
31
34
|
subTeams: planLimitValueSchema,
|
|
32
35
|
externalDomainGroups: planLimitValueSchema,
|
|
33
36
|
// Per-space daily bandwidth cap feeding the egress kill-switch sweep
|
|
34
|
-
// (
|
|
37
|
+
// (the platform spec "Abuse Posture"; internal plan data — never on
|
|
35
38
|
// the PlanPolicyResponse wire shape). WORST_CASE_QUOTAS
|
|
36
39
|
// .maxEgressBytesPerSpacePerDay stays the absolute platform ceiling.
|
|
37
40
|
egressBytesPerDay: planLimitValueSchema,
|
|
@@ -126,11 +129,13 @@ export const PLAN_DEFINITIONS = {
|
|
|
126
129
|
name: "Free",
|
|
127
130
|
monthlyPriceUsd: 0,
|
|
128
131
|
yearlyPriceUsd: 0,
|
|
129
|
-
|
|
132
|
+
// Free is single-player: the owner is the only editor. Reviewers and
|
|
133
|
+
// agent principals are not seats.
|
|
134
|
+
includedSeats: 1,
|
|
130
135
|
extraSeatPriceUsd: null,
|
|
131
136
|
limits: {
|
|
132
|
-
storageBytes:
|
|
133
|
-
teamMembers:
|
|
137
|
+
storageBytes: 10 * GB,
|
|
138
|
+
teamMembers: 1,
|
|
134
139
|
subTeams: 0,
|
|
135
140
|
externalDomainGroups: 3,
|
|
136
141
|
egressBytesPerDay: 100 * GB, // = worst-case ceiling; tunable per plan
|
|
@@ -149,15 +154,17 @@ export const PLAN_DEFINITIONS = {
|
|
|
149
154
|
},
|
|
150
155
|
personal: {
|
|
151
156
|
code: "personal",
|
|
152
|
-
name: "
|
|
153
|
-
monthlyPriceUsd:
|
|
154
|
-
yearlyPriceUsd:
|
|
155
|
-
includedSeats:
|
|
156
|
-
|
|
157
|
+
name: "Plus",
|
|
158
|
+
monthlyPriceUsd: 4.99,
|
|
159
|
+
yearlyPriceUsd: 49.99,
|
|
160
|
+
includedSeats: 3,
|
|
161
|
+
// Each paid seat also raises usage limits (builds, domains, emails,
|
|
162
|
+
// versions) via additive grants — the seat price is not access alone.
|
|
163
|
+
extraSeatPriceUsd: { monthly: 4.99, yearly: 49.99 },
|
|
157
164
|
limits: {
|
|
158
165
|
...UNLIMITED_LIMITS,
|
|
159
|
-
storageBytes:
|
|
160
|
-
teamMembers:
|
|
166
|
+
storageBytes: 50 * GB,
|
|
167
|
+
teamMembers: 3,
|
|
161
168
|
subTeams: 0,
|
|
162
169
|
externalDomainGroups: 10,
|
|
163
170
|
maxFileBytes: 1 * GB,
|
|
@@ -174,18 +181,18 @@ export const PLAN_DEFINITIONS = {
|
|
|
174
181
|
},
|
|
175
182
|
work: {
|
|
176
183
|
code: "work",
|
|
177
|
-
name: "
|
|
178
|
-
monthlyPriceUsd:
|
|
179
|
-
yearlyPriceUsd:
|
|
180
|
-
includedSeats:
|
|
181
|
-
extraSeatPriceUsd: { monthly:
|
|
184
|
+
name: "Pro",
|
|
185
|
+
monthlyPriceUsd: 49.99,
|
|
186
|
+
yearlyPriceUsd: 499,
|
|
187
|
+
includedSeats: 10,
|
|
188
|
+
extraSeatPriceUsd: { monthly: 4.99, yearly: 49.99 },
|
|
182
189
|
limits: {
|
|
183
190
|
...UNLIMITED_LIMITS,
|
|
184
|
-
storageBytes:
|
|
191
|
+
storageBytes: 200 * GB,
|
|
185
192
|
// The catalog keeps the included quantity numeric for display and seat
|
|
186
193
|
// billing. An active paid Stripe source lifts admission separately so
|
|
187
194
|
// editors beyond this number can be added and reconciled automatically.
|
|
188
|
-
teamMembers:
|
|
195
|
+
teamMembers: 10,
|
|
189
196
|
subTeams: 0,
|
|
190
197
|
...ACCESS_QUOTA_DEFAULTS,
|
|
191
198
|
},
|
|
@@ -51,7 +51,21 @@ export declare const FUNCTIONS_RUNTIME_ROUTE_PATHS: {
|
|
|
51
51
|
readonly logs: "/__spacefast/functions/logs";
|
|
52
52
|
/** Where a dispatched worker calls back for brokered capabilities. */
|
|
53
53
|
readonly relay: "/__spacefast/functions/relay";
|
|
54
|
+
/**
|
|
55
|
+
* Where the execution host asks the space origin to drop cached responses —
|
|
56
|
+
* an OpenNext `revalidatePath` must reach the CDN in front of wp.cloud, and
|
|
57
|
+
* only the origin can speak for its own cache. Authenticated with the
|
|
58
|
+
* version-scoped purge credential in the `sf-purge-token` request header.
|
|
59
|
+
*/
|
|
60
|
+
readonly purge: "/__spacefast/functions/purge";
|
|
54
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* The header the execution host presents at the origin purge route. Outside the
|
|
64
|
+
* `sf-fx-` namespace on purpose: that prefix names dispatch instructions the
|
|
65
|
+
* origin SENDS, and is stripped from anything inbound before tenant code — a
|
|
66
|
+
* purge call is the host speaking for itself, like a relay call.
|
|
67
|
+
*/
|
|
68
|
+
export declare const FUNCTIONS_PURGE_TOKEN_HEADER = "sf-purge-token";
|
|
55
69
|
/**
|
|
56
70
|
* Where invocation counts are reported, on the CONTROL PLANE rather than the
|
|
57
71
|
* space origin.
|
|
@@ -89,7 +103,17 @@ export declare const FUNCTIONS_RUNTIME_STORAGE_ROOT = "__spacefast/functions";
|
|
|
89
103
|
* was never given.
|
|
90
104
|
*/
|
|
91
105
|
export declare const FUNCTIONS_RUNTIME_BUNDLE_ROOT = "__spacefast/functions/bundles";
|
|
106
|
+
/**
|
|
107
|
+
* Where a version's Next-cache seed document lives — the build-time prerender
|
|
108
|
+
* and fetch-cache entries that warm the execution host's cache object so the
|
|
109
|
+
* first visitor gets the page the build rendered instead of a live re-render.
|
|
110
|
+
* A sibling of `bundles/` with the same properties: publishable through the
|
|
111
|
+
* ordinary upload path (its own carve-out in publish-policy), never servable
|
|
112
|
+
* as static content, read back only through the signed artifact route.
|
|
113
|
+
*/
|
|
114
|
+
export declare const FUNCTIONS_RUNTIME_SEED_ROOT = "__spacefast/functions/seeds";
|
|
92
115
|
export declare const FUNCTIONS_BUNDLE_FORMAT = "spacefast.functions.bundle.v1";
|
|
116
|
+
export declare const FUNCTIONS_SEED_FORMAT = "spacefast.functions.seed.v1";
|
|
93
117
|
/**
|
|
94
118
|
* Ceiling on a bundle's decoded size.
|
|
95
119
|
*
|
|
@@ -100,10 +124,67 @@ export declare const FUNCTIONS_BUNDLE_FORMAT = "spacefast.functions.bundle.v1";
|
|
|
100
124
|
* modules are large, rather than at dispatch, where the tenant sees a 502.
|
|
101
125
|
*/
|
|
102
126
|
export declare const FUNCTIONS_BUNDLE_MAX_BYTES: number;
|
|
127
|
+
/**
|
|
128
|
+
* Ceilings on the cache seed document. Per-entry mirrors the cache object's
|
|
129
|
+
* own row limit (an entry the object would refuse is dead weight in the
|
|
130
|
+
* document); the total bounds what the host pulls and ingests on a cold
|
|
131
|
+
* cache. Both are enforced in the CLI, where an overflow can say WHICH pages
|
|
132
|
+
* were left out — an omitted entry is not an error, it just renders live on
|
|
133
|
+
* first request like any cache miss.
|
|
134
|
+
*/
|
|
135
|
+
export declare const FUNCTIONS_SEED_ENTRY_MAX_BYTES: number;
|
|
136
|
+
export declare const FUNCTIONS_SEED_MAX_BYTES: number;
|
|
137
|
+
/**
|
|
138
|
+
* One warm-cache entry: exactly what the runtime's incremental-cache client
|
|
139
|
+
* would have written for `key` had it rendered the page itself. `valueJson`
|
|
140
|
+
* is carried as the JSON string it already is on disk (OpenNext's `.cache` /
|
|
141
|
+
* fetch-cache files) — re-parsing it here would only invite the seed writer
|
|
142
|
+
* and the cache client to disagree about serialization.
|
|
143
|
+
*/
|
|
144
|
+
export declare const functionsSeedEntrySchema: z.ZodObject<{
|
|
145
|
+
key: z.ZodString;
|
|
146
|
+
cacheType: z.ZodEnum<{
|
|
147
|
+
fetch: "fetch";
|
|
148
|
+
cache: "cache";
|
|
149
|
+
}>;
|
|
150
|
+
valueJson: z.ZodString;
|
|
151
|
+
lastModified: z.ZodNumber;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
export type FunctionsSeedEntry = z.infer<typeof functionsSeedEntrySchema>;
|
|
154
|
+
/** The document served at a seed URL; host and CLI validate the same shape. */
|
|
155
|
+
export declare const functionsSeedManifestSchema: z.ZodObject<{
|
|
156
|
+
format: z.ZodLiteral<"spacefast.functions.seed.v1">;
|
|
157
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
158
|
+
key: z.ZodString;
|
|
159
|
+
cacheType: z.ZodEnum<{
|
|
160
|
+
fetch: "fetch";
|
|
161
|
+
cache: "cache";
|
|
162
|
+
}>;
|
|
163
|
+
valueJson: z.ZodString;
|
|
164
|
+
lastModified: z.ZodNumber;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
export type FunctionsSeedManifest = z.infer<typeof functionsSeedManifestSchema>;
|
|
168
|
+
/**
|
|
169
|
+
* How many entries the origin's dispatch table accepts.
|
|
170
|
+
*
|
|
171
|
+
* Exported because the CLI classifier has to compact its route claims BEFORE
|
|
172
|
+
* assembling the artifact — discovering the ceiling as a validation error at
|
|
173
|
+
* finalize would mean a build that classified fine fails at the last step — so
|
|
174
|
+
* the ceiling has to be a value both sides can read, not a literal each side
|
|
175
|
+
* spells for itself.
|
|
176
|
+
*/
|
|
177
|
+
export declare const FUNCTIONS_MAX_ROUTES = 256;
|
|
103
178
|
/**
|
|
104
179
|
* A worker's dynamic route table. Anything not matched here is answered from
|
|
105
180
|
* the version's static content by wp.cloud and never reaches Cloudflare, which
|
|
106
181
|
* is both the cheaper path and the one that keeps assets ours.
|
|
182
|
+
*
|
|
183
|
+
* A `subtree` entry covers its own path AND everything below it: the engine
|
|
184
|
+
* expands one into both `path` and `path/:splat`
|
|
185
|
+
* (`_stattic_runtime_functions_routes_artifact`, runtime/engine/admin/management.php),
|
|
186
|
+
* which is why `wholeSiteRoutes()` is a single `/` subtree entry and why an
|
|
187
|
+
* exact entry beside a subtree entry at the same path is dead weight.
|
|
107
188
|
*/
|
|
108
189
|
export declare const functionsRouteSchema: z.ZodObject<{
|
|
109
190
|
method: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
@@ -123,8 +204,9 @@ export type FunctionsRoute = z.infer<typeof functionsRouteSchema>;
|
|
|
123
204
|
* One module in a bundle, in the shape the Worker Loader consumes.
|
|
124
205
|
*
|
|
125
206
|
* `commonjs` exists because bundlers still emit it and rejecting it would fail
|
|
126
|
-
* builds for a format the runtime accepts. Binary
|
|
127
|
-
*
|
|
207
|
+
* builds for a format the runtime accepts. Binary modules cross this JSON wire
|
|
208
|
+
* format as base64; the Functions host turns them back into ArrayBuffers at the
|
|
209
|
+
* Worker Loader boundary.
|
|
128
210
|
*/
|
|
129
211
|
export declare const functionsBundleModuleSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
130
212
|
js: z.ZodString;
|
|
@@ -134,6 +216,10 @@ export declare const functionsBundleModuleSchema: z.ZodUnion<readonly [z.ZodObje
|
|
|
134
216
|
text: z.ZodString;
|
|
135
217
|
}, z.core.$strict>, z.ZodObject<{
|
|
136
218
|
json: z.ZodUnknown;
|
|
219
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
220
|
+
wasm: z.ZodString;
|
|
221
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
222
|
+
data: z.ZodString;
|
|
137
223
|
}, z.core.$strict>]>;
|
|
138
224
|
export type FunctionsBundleModule = z.infer<typeof functionsBundleModuleSchema>;
|
|
139
225
|
/**
|
|
@@ -155,6 +241,10 @@ export declare const functionsBundleManifestSchema: z.ZodObject<{
|
|
|
155
241
|
text: z.ZodString;
|
|
156
242
|
}, z.core.$strict>, z.ZodObject<{
|
|
157
243
|
json: z.ZodUnknown;
|
|
244
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
245
|
+
wasm: z.ZodString;
|
|
246
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
247
|
+
data: z.ZodString;
|
|
158
248
|
}, z.core.$strict>]>>;
|
|
159
249
|
}, z.core.$strict>;
|
|
160
250
|
export type FunctionsBundleManifest = z.infer<typeof functionsBundleManifestSchema>;
|
|
@@ -171,6 +261,18 @@ export declare const functionsBundleRefSchema: z.ZodObject<{
|
|
|
171
261
|
size: z.ZodNumber;
|
|
172
262
|
}, z.core.$strict>;
|
|
173
263
|
export type FunctionsBundleRef = z.infer<typeof functionsBundleRefSchema>;
|
|
264
|
+
/**
|
|
265
|
+
* Where a version's cache seed document sits in its content store — the
|
|
266
|
+
* bundle ref's sibling, with the seed's own root and ceiling. `entries` is
|
|
267
|
+
* carried so status surfaces can say what the seed holds without fetching it.
|
|
268
|
+
*/
|
|
269
|
+
export declare const functionsSeedRefSchema: z.ZodObject<{
|
|
270
|
+
path: z.ZodString;
|
|
271
|
+
sha256: z.ZodString;
|
|
272
|
+
size: z.ZodNumber;
|
|
273
|
+
entries: z.ZodNumber;
|
|
274
|
+
}, z.core.$strict>;
|
|
275
|
+
export type FunctionsSeedRef = z.infer<typeof functionsSeedRefSchema>;
|
|
174
276
|
/**
|
|
175
277
|
* The path a bundle is served from.
|
|
176
278
|
*
|
|
@@ -193,6 +295,16 @@ export declare function functionsBundlePath(input: {
|
|
|
193
295
|
sha256: string;
|
|
194
296
|
token: string;
|
|
195
297
|
}): string;
|
|
298
|
+
/**
|
|
299
|
+
* The seed document's read path — the bundle route with a different terminal
|
|
300
|
+
* filename and its own token audience. One signed artifact route on the
|
|
301
|
+
* origin serves both: the filename says what the digest names, the token's
|
|
302
|
+
* audience says what the caller was authorised to read.
|
|
303
|
+
*/
|
|
304
|
+
export declare function functionsSeedPath(input: {
|
|
305
|
+
sha256: string;
|
|
306
|
+
token: string;
|
|
307
|
+
}): string;
|
|
196
308
|
/**
|
|
197
309
|
* Where the bundle actually sits in the published version — the same path minus
|
|
198
310
|
* the token segment. The token authorises the read; it does not name the file,
|
|
@@ -201,6 +313,10 @@ export declare function functionsBundlePath(input: {
|
|
|
201
313
|
export declare function functionsBundleStoragePath(input: {
|
|
202
314
|
sha256: string;
|
|
203
315
|
}): string;
|
|
316
|
+
/** The seed's storage twin of `functionsBundleStoragePath`. */
|
|
317
|
+
export declare function functionsSeedStoragePath(input: {
|
|
318
|
+
sha256: string;
|
|
319
|
+
}): string;
|
|
204
320
|
export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
205
321
|
format: z.ZodLiteral<"spacefast.functions.worker.v1">;
|
|
206
322
|
appName: z.ZodString;
|
|
@@ -211,6 +327,12 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
|
211
327
|
sha256: z.ZodString;
|
|
212
328
|
size: z.ZodNumber;
|
|
213
329
|
}, z.core.$strict>;
|
|
330
|
+
seed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
331
|
+
path: z.ZodString;
|
|
332
|
+
sha256: z.ZodString;
|
|
333
|
+
size: z.ZodNumber;
|
|
334
|
+
entries: z.ZodNumber;
|
|
335
|
+
}, z.core.$strict>>>;
|
|
214
336
|
compatibilityDate: z.ZodString;
|
|
215
337
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
216
338
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -226,6 +348,7 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
|
226
348
|
path: z.ZodString;
|
|
227
349
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
228
350
|
}, z.core.$strict>>>;
|
|
351
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
229
352
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
230
353
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
231
354
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -303,6 +426,7 @@ export declare function functionsGrantNeedsRelay(granted: readonly FunctionsDisp
|
|
|
303
426
|
export declare const functionsHostConfigSchema: z.ZodObject<{
|
|
304
427
|
hostname: z.ZodString;
|
|
305
428
|
bundleUrl: z.ZodString;
|
|
429
|
+
seedUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
306
430
|
}, z.core.$strict>;
|
|
307
431
|
export type FunctionsHostConfig = z.infer<typeof functionsHostConfigSchema>;
|
|
308
432
|
/**
|
|
@@ -336,6 +460,22 @@ export declare const functionsUsageConfigSchema: z.ZodObject<{
|
|
|
336
460
|
token: z.ZodString;
|
|
337
461
|
}, z.core.$strict>;
|
|
338
462
|
export type FunctionsUsageConfig = z.infer<typeof functionsUsageConfigSchema>;
|
|
463
|
+
/**
|
|
464
|
+
* The credential the execution host presents at the origin's purge route.
|
|
465
|
+
*
|
|
466
|
+
* Only the token lives here: the purge route is on whichever hostname the
|
|
467
|
+
* visitor actually hit, so the origin composes the URL from the request host at
|
|
468
|
+
* dispatch time — exactly as it does for log intake — instead of freezing one
|
|
469
|
+
* hostname at finalize. A third credential rather than a reuse of the relay's,
|
|
470
|
+
* for the relay's own reason: purging cached responses is a distinct authority,
|
|
471
|
+
* and a worker whose relay is unusable must still be able to invalidate what it
|
|
472
|
+
* rendered. Version-scoped and folded into the host's isolate identity like its
|
|
473
|
+
* siblings, so a republish revokes it.
|
|
474
|
+
*/
|
|
475
|
+
export declare const functionsPurgeConfigSchema: z.ZodObject<{
|
|
476
|
+
token: z.ZodString;
|
|
477
|
+
}, z.core.$strict>;
|
|
478
|
+
export type FunctionsPurgeConfig = z.infer<typeof functionsPurgeConfigSchema>;
|
|
339
479
|
/**
|
|
340
480
|
* What a build declares about its worker — everything the CLI can know from the
|
|
341
481
|
* author's project alone.
|
|
@@ -359,6 +499,12 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
|
|
|
359
499
|
sha256: z.ZodString;
|
|
360
500
|
size: z.ZodNumber;
|
|
361
501
|
}, z.core.$strict>;
|
|
502
|
+
seed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
503
|
+
path: z.ZodString;
|
|
504
|
+
sha256: z.ZodString;
|
|
505
|
+
size: z.ZodNumber;
|
|
506
|
+
entries: z.ZodNumber;
|
|
507
|
+
}, z.core.$strict>>>;
|
|
362
508
|
compatibilityDate: z.ZodString;
|
|
363
509
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
364
510
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -374,6 +520,7 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
|
|
|
374
520
|
path: z.ZodString;
|
|
375
521
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
376
522
|
}, z.core.$strict>>>;
|
|
523
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
377
524
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
378
525
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
379
526
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -416,6 +563,12 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
416
563
|
sha256: z.ZodString;
|
|
417
564
|
size: z.ZodNumber;
|
|
418
565
|
}, z.core.$strict>;
|
|
566
|
+
seed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
567
|
+
path: z.ZodString;
|
|
568
|
+
sha256: z.ZodString;
|
|
569
|
+
size: z.ZodNumber;
|
|
570
|
+
entries: z.ZodNumber;
|
|
571
|
+
}, z.core.$strict>>>;
|
|
419
572
|
compatibilityDate: z.ZodString;
|
|
420
573
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
421
574
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -431,6 +584,7 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
431
584
|
path: z.ZodString;
|
|
432
585
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
433
586
|
}, z.core.$strict>>>;
|
|
587
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
434
588
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
435
589
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
436
590
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -453,6 +607,7 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
453
607
|
host: z.ZodObject<{
|
|
454
608
|
hostname: z.ZodString;
|
|
455
609
|
bundleUrl: z.ZodString;
|
|
610
|
+
seedUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
456
611
|
}, z.core.$strict>;
|
|
457
612
|
grantedCapabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
458
613
|
fetch: "fetch";
|
|
@@ -476,6 +631,9 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
476
631
|
url: z.ZodString;
|
|
477
632
|
token: z.ZodString;
|
|
478
633
|
}, z.core.$strict>>>;
|
|
634
|
+
purge: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
635
|
+
token: z.ZodString;
|
|
636
|
+
}, z.core.$strict>>>;
|
|
479
637
|
variableValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
480
638
|
}, z.core.$strict>;
|
|
481
639
|
export type FunctionsRuntimeConfig = z.infer<typeof functionsRuntimeConfigSchema>;
|
|
@@ -493,6 +651,12 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
|
|
|
493
651
|
sha256: z.ZodString;
|
|
494
652
|
size: z.ZodNumber;
|
|
495
653
|
}, z.core.$strict>;
|
|
654
|
+
seed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
655
|
+
path: z.ZodString;
|
|
656
|
+
sha256: z.ZodString;
|
|
657
|
+
size: z.ZodNumber;
|
|
658
|
+
entries: z.ZodNumber;
|
|
659
|
+
}, z.core.$strict>>>;
|
|
496
660
|
compatibilityDate: z.ZodString;
|
|
497
661
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
498
662
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -508,6 +672,7 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
|
|
|
508
672
|
path: z.ZodString;
|
|
509
673
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
510
674
|
}, z.core.$strict>>>;
|
|
675
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
511
676
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
512
677
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
513
678
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -542,9 +707,11 @@ export declare function createFunctionsSourceFinalize(input: {
|
|
|
542
707
|
entry: string;
|
|
543
708
|
mainModule: string;
|
|
544
709
|
bundle: z.input<typeof functionsBundleRefSchema>;
|
|
710
|
+
seed?: z.input<typeof functionsSeedRefSchema> | null;
|
|
545
711
|
compatibilityDate: string;
|
|
546
712
|
compatibilityFlags?: string[];
|
|
547
713
|
routes?: z.input<typeof functionsRouteSchema>[];
|
|
714
|
+
bypassCookies?: string[];
|
|
548
715
|
capabilities?: ExecutionCapabilities;
|
|
549
716
|
nextCache?: boolean;
|
|
550
717
|
variableNames?: string[];
|