@spacefast/common 0.0.23 → 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 +66 -10
- 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 +124 -12
- package/dist/contracts/access.js +73 -9
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +5 -12
- package/dist/contracts/api-keys.d.ts +21 -21
- package/dist/contracts/api-keys.js +2 -2
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/billing.d.ts +3 -35
- package/dist/contracts/billing.js +33 -52
- package/dist/contracts/builds.d.ts +30 -18
- package/dist/contracts/builds.js +28 -9
- package/dist/contracts/channels.js +1 -1
- 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 +282 -53
- package/dist/contracts/comments.js +173 -52
- package/dist/contracts/common.d.ts +3 -3
- 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.d.ts +6 -6
- package/dist/contracts/device-auth.js +2 -2
- package/dist/contracts/docs.js +2 -2
- package/dist/contracts/domains.d.ts +38 -27
- package/dist/contracts/domains.js +29 -2
- package/dist/contracts/enums.d.ts +34 -30
- package/dist/contracts/enums.js +62 -48
- package/dist/contracts/error-code-meta.d.ts +50 -125
- package/dist/contracts/error-code-meta.js +29 -41
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +14 -33
- package/dist/contracts/execution.d.ts +47 -66
- package/dist/contracts/execution.js +53 -49
- 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 +12 -52
- package/dist/contracts/feature-lifecycle.js +16 -59
- package/dist/contracts/features.d.ts +48 -60
- package/dist/contracts/features.js +59 -51
- package/dist/contracts/functions.d.ts +266 -72
- package/dist/contracts/functions.js +260 -37
- package/dist/contracts/git.d.ts +28 -34
- package/dist/contracts/git.js +10 -11
- package/dist/contracts/grants.d.ts +9 -5
- package/dist/contracts/grants.js +18 -9
- package/dist/contracts/ids.js +2 -2
- package/dist/contracts/internal.d.ts +8 -6
- package/dist/contracts/internal.js +12 -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/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 +77 -3
- package/dist/contracts/pages.d.ts +12 -7
- package/dist/contracts/pages.js +24 -1
- package/dist/contracts/plan-policy.d.ts +0 -2
- package/dist/contracts/plan-policy.js +2 -3
- package/dist/contracts/platform.d.ts +61 -148
- package/dist/contracts/platform.js +70 -126
- package/dist/contracts/publish-archive.d.ts +508 -0
- package/dist/contracts/publish-archive.js +32 -0
- 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 +12 -24
- package/dist/contracts/resources.js +36 -16
- package/dist/contracts/runtime-api.d.ts +433 -192
- package/dist/contracts/runtime-api.js +421 -356
- package/dist/contracts/runtime-app.d.ts +127 -120
- package/dist/contracts/runtime-app.js +19 -10
- package/dist/contracts/runtime-db.d.ts +5 -5
- 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-services.d.ts +219 -0
- package/dist/contracts/runtime-services.js +437 -0
- package/dist/contracts/runtime-storage.d.ts +46 -32
- package/dist/contracts/runtime-storage.js +31 -8
- package/dist/contracts/sf-config-v1.d.ts +48 -10
- package/dist/contracts/space-config.d.ts +69 -18
- package/dist/contracts/space-config.js +226 -27
- package/dist/contracts/spaces.d.ts +236 -450
- package/dist/contracts/spaces.js +131 -151
- 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 +361 -92
- 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-tenants.d.ts +0 -6
- package/dist/contracts/superadmin-tenants.js +1 -7
- package/dist/contracts/superadmin.d.ts +135 -54
- package/dist/contracts/superadmin.js +46 -23
- package/dist/contracts/tags.d.ts +12 -12
- package/dist/contracts/tags.js +3 -3
- package/dist/contracts/teams.d.ts +49 -14
- package/dist/contracts/teams.js +40 -22
- package/dist/contracts/transfers.d.ts +0 -49
- package/dist/contracts/transfers.js +4 -8
- 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 +9 -8
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +102 -73
- package/dist/contracts/zero.js +94 -32
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/dashboard-paths/index.js +1 -0
- package/dist/docs/agent-prose.d.ts +2 -2
- package/dist/docs/agent-prose.js +63 -70
- package/dist/docs/agent-setup.js +45 -15
- package/dist/docs/catalog.d.ts +24 -24
- package/dist/docs/catalog.js +35 -24
- package/dist/docs/error-docs.js +194 -270
- package/dist/docs/skills.d.ts +12 -12
- package/dist/docs/skills.js +4 -4
- package/dist/test-helpers/fetch-stub.d.ts +16 -0
- package/dist/test-helpers/fetch-stub.js +25 -0
- package/dist/utils/build-settings.d.ts +5 -1
- package/dist/utils/build-settings.js +91 -13
- package/dist/utils/canonical-json.d.ts +10 -0
- package/dist/utils/canonical-json.js +22 -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/concurrency.js +1 -0
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/credential-policy.js +4 -3
- package/dist/utils/dns-instructions.js +9 -9
- 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 +8 -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 +26 -1
- 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 +9 -16
- package/dist/utils/local-space-state.js +20 -50
- 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 +2 -2
- package/dist/utils/page-fonts.js +15 -4
- package/dist/utils/pages.d.ts +21 -3
- package/dist/utils/pages.js +42 -13
- 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 +27 -0
- package/dist/utils/publish-policy.fixtures.json +403 -0
- package/dist/utils/publish-policy.js +45 -20
- package/dist/utils/push-new.d.ts +7 -0
- package/dist/utils/push-new.js +7 -0
- package/dist/utils/query-keys.d.ts +4 -5
- package/dist/utils/query-keys.js +2 -3
- 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 +6 -11
- package/dist/utils/runtime-upload.js +10 -13
- package/dist/utils/secure-local-file.js +5 -16
- package/dist/utils/space-config.d.ts +1 -34
- package/dist/utils/space-config.js +8 -326
- 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/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/upload-session.d.ts +4 -1
- package/dist/utils/upload-session.js +33 -5
- package/dist/utils/version-path.js +13 -4
- package/dist/vocabulary.d.ts +13 -11
- package/dist/vocabulary.js +42 -28
- package/package.json +7 -17
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { type ExecutionCapabilities } from "./execution.js";
|
|
3
3
|
/**
|
|
4
4
|
* Spacefast Functions: tenant workers run as Cloudflare Dynamic Workers.
|
|
5
5
|
*
|
|
@@ -37,6 +37,13 @@ import { runtimeKindSchema, type ExecutionCapabilities } from "./execution.js";
|
|
|
37
37
|
* than transactional. That is why capsules are a different product rather
|
|
38
38
|
* than a placement option — see `endpointIsPortable` in `./execution.js`.
|
|
39
39
|
*/
|
|
40
|
+
/**
|
|
41
|
+
* The tag a compiled worker artifact carries — in `functionsSourceFinalizeSchema`
|
|
42
|
+
* and the runtime config built from it — so the PHP origin can tell what it is
|
|
43
|
+
* dispatching (`functions-dispatch.php` refuses a config tagged anything else).
|
|
44
|
+
* It is a property of the artifact the tree produced, not a kind a space or a
|
|
45
|
+
* version declares: a publish can carry this beside a capsule.
|
|
46
|
+
*/
|
|
40
47
|
export declare const FUNCTIONS_RUNTIME_KIND = "functions";
|
|
41
48
|
export declare const FUNCTIONS_SOURCE_METADATA_KEY = "spacefastFunctions";
|
|
42
49
|
export declare const FUNCTIONS_PLATFORM_ROUTE_PREFIX = "/__spacefast/functions";
|
|
@@ -44,7 +51,32 @@ export declare const FUNCTIONS_RUNTIME_ROUTE_PATHS: {
|
|
|
44
51
|
readonly logs: "/__spacefast/functions/logs";
|
|
45
52
|
/** Where a dispatched worker calls back for brokered capabilities. */
|
|
46
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";
|
|
47
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";
|
|
69
|
+
/**
|
|
70
|
+
* Where invocation counts are reported, on the CONTROL PLANE rather than the
|
|
71
|
+
* space origin.
|
|
72
|
+
*
|
|
73
|
+
* The two destinations are separate on purpose. Logs are the tenant's content
|
|
74
|
+
* and stay on their own origin; usage is a number the platform bills from and
|
|
75
|
+
* goes straight to us. Sharing one channel would make either destination a
|
|
76
|
+
* plausible place to look for the other's data, and would put log volume on the
|
|
77
|
+
* path that has to stay cheap.
|
|
78
|
+
*/
|
|
79
|
+
export declare const FUNCTIONS_USAGE_INTAKE_PATH = "/v1/runtime/functions/usage";
|
|
48
80
|
/** Public, signed read path. Distinct from storage so the token is never a filename. */
|
|
49
81
|
export declare const FUNCTIONS_BUNDLE_ROUTE_PREFIX = "/__spacefast/functions/b";
|
|
50
82
|
export declare const FUNCTIONS_RUNTIME_STORAGE_ROOT = "__spacefast/functions";
|
|
@@ -71,7 +103,17 @@ export declare const FUNCTIONS_RUNTIME_STORAGE_ROOT = "__spacefast/functions";
|
|
|
71
103
|
* was never given.
|
|
72
104
|
*/
|
|
73
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";
|
|
74
115
|
export declare const FUNCTIONS_BUNDLE_FORMAT = "spacefast.functions.bundle.v1";
|
|
116
|
+
export declare const FUNCTIONS_SEED_FORMAT = "spacefast.functions.seed.v1";
|
|
75
117
|
/**
|
|
76
118
|
* Ceiling on a bundle's decoded size.
|
|
77
119
|
*
|
|
@@ -82,10 +124,67 @@ export declare const FUNCTIONS_BUNDLE_FORMAT = "spacefast.functions.bundle.v1";
|
|
|
82
124
|
* modules are large, rather than at dispatch, where the tenant sees a 502.
|
|
83
125
|
*/
|
|
84
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;
|
|
85
178
|
/**
|
|
86
179
|
* A worker's dynamic route table. Anything not matched here is answered from
|
|
87
180
|
* the version's static content by wp.cloud and never reaches Cloudflare, which
|
|
88
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.
|
|
89
188
|
*/
|
|
90
189
|
export declare const functionsRouteSchema: z.ZodObject<{
|
|
91
190
|
method: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
@@ -105,8 +204,9 @@ export type FunctionsRoute = z.infer<typeof functionsRouteSchema>;
|
|
|
105
204
|
* One module in a bundle, in the shape the Worker Loader consumes.
|
|
106
205
|
*
|
|
107
206
|
* `commonjs` exists because bundlers still emit it and rejecting it would fail
|
|
108
|
-
* builds for a format the runtime accepts. Binary
|
|
109
|
-
*
|
|
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.
|
|
110
210
|
*/
|
|
111
211
|
export declare const functionsBundleModuleSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
112
212
|
js: z.ZodString;
|
|
@@ -116,6 +216,10 @@ export declare const functionsBundleModuleSchema: z.ZodUnion<readonly [z.ZodObje
|
|
|
116
216
|
text: z.ZodString;
|
|
117
217
|
}, z.core.$strict>, z.ZodObject<{
|
|
118
218
|
json: z.ZodUnknown;
|
|
219
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
220
|
+
wasm: z.ZodString;
|
|
221
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
222
|
+
data: z.ZodString;
|
|
119
223
|
}, z.core.$strict>]>;
|
|
120
224
|
export type FunctionsBundleModule = z.infer<typeof functionsBundleModuleSchema>;
|
|
121
225
|
/**
|
|
@@ -137,6 +241,10 @@ export declare const functionsBundleManifestSchema: z.ZodObject<{
|
|
|
137
241
|
text: z.ZodString;
|
|
138
242
|
}, z.core.$strict>, z.ZodObject<{
|
|
139
243
|
json: z.ZodUnknown;
|
|
244
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
245
|
+
wasm: z.ZodString;
|
|
246
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
247
|
+
data: z.ZodString;
|
|
140
248
|
}, z.core.$strict>]>>;
|
|
141
249
|
}, z.core.$strict>;
|
|
142
250
|
export type FunctionsBundleManifest = z.infer<typeof functionsBundleManifestSchema>;
|
|
@@ -153,6 +261,18 @@ export declare const functionsBundleRefSchema: z.ZodObject<{
|
|
|
153
261
|
size: z.ZodNumber;
|
|
154
262
|
}, z.core.$strict>;
|
|
155
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>;
|
|
156
276
|
/**
|
|
157
277
|
* The path a bundle is served from.
|
|
158
278
|
*
|
|
@@ -175,6 +295,16 @@ export declare function functionsBundlePath(input: {
|
|
|
175
295
|
sha256: string;
|
|
176
296
|
token: string;
|
|
177
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;
|
|
178
308
|
/**
|
|
179
309
|
* Where the bundle actually sits in the published version — the same path minus
|
|
180
310
|
* the token segment. The token authorises the read; it does not name the file,
|
|
@@ -183,6 +313,10 @@ export declare function functionsBundlePath(input: {
|
|
|
183
313
|
export declare function functionsBundleStoragePath(input: {
|
|
184
314
|
sha256: string;
|
|
185
315
|
}): string;
|
|
316
|
+
/** The seed's storage twin of `functionsBundleStoragePath`. */
|
|
317
|
+
export declare function functionsSeedStoragePath(input: {
|
|
318
|
+
sha256: string;
|
|
319
|
+
}): string;
|
|
186
320
|
export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
187
321
|
format: z.ZodLiteral<"spacefast.functions.worker.v1">;
|
|
188
322
|
appName: z.ZodString;
|
|
@@ -193,6 +327,12 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
|
193
327
|
sha256: z.ZodString;
|
|
194
328
|
size: z.ZodNumber;
|
|
195
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>>>;
|
|
196
336
|
compatibilityDate: z.ZodString;
|
|
197
337
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
198
338
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -208,6 +348,7 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
|
208
348
|
path: z.ZodString;
|
|
209
349
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
210
350
|
}, z.core.$strict>>>;
|
|
351
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
211
352
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
212
353
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
213
354
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -215,7 +356,13 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
|
|
|
215
356
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
216
357
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
217
358
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
359
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
360
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
361
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
218
362
|
}, z.core.$strip>>;
|
|
363
|
+
platform: z.ZodDefault<z.ZodObject<{
|
|
364
|
+
nextCache: z.ZodDefault<z.ZodBoolean>;
|
|
365
|
+
}, z.core.$strict>>;
|
|
219
366
|
}, z.core.$strict>;
|
|
220
367
|
export type FunctionsWorkerArtifact = z.infer<typeof functionsWorkerArtifactSchema>;
|
|
221
368
|
/**
|
|
@@ -227,19 +374,25 @@ export type FunctionsWorkerArtifact = z.infer<typeof functionsWorkerArtifactSche
|
|
|
227
374
|
* *grants*, resolved by the control plane at finalize so the origin forwards a
|
|
228
375
|
* decision rather than making one. Anything absent fails closed at the relay.
|
|
229
376
|
*/
|
|
230
|
-
export declare const FUNCTIONS_DISPATCH_CAPABILITIES: readonly ["db.read", "db.write", "fetch", "log"];
|
|
377
|
+
export declare const FUNCTIONS_DISPATCH_CAPABILITIES: readonly ["storage.read", "storage.write", "db.read", "db.write", "fetch", "log", "next.cache", "gravatar.profile", "spam.check", "email.send"];
|
|
231
378
|
export declare const functionsDispatchCapabilitySchema: z.ZodEnum<{
|
|
232
379
|
fetch: "fetch";
|
|
380
|
+
"storage.read": "storage.read";
|
|
381
|
+
"storage.write": "storage.write";
|
|
233
382
|
"db.read": "db.read";
|
|
234
383
|
"db.write": "db.write";
|
|
235
384
|
log: "log";
|
|
385
|
+
"next.cache": "next.cache";
|
|
386
|
+
"gravatar.profile": "gravatar.profile";
|
|
387
|
+
"spam.check": "spam.check";
|
|
388
|
+
"email.send": "email.send";
|
|
236
389
|
}>;
|
|
237
390
|
export type FunctionsDispatchCapability = z.infer<typeof functionsDispatchCapabilitySchema>;
|
|
238
391
|
/**
|
|
239
392
|
* Resolves a build's declared capabilities into the grant a dispatch carries.
|
|
240
393
|
*
|
|
241
|
-
* Three
|
|
242
|
-
*
|
|
394
|
+
* Three declared capabilities have no dispatch counterpart, each for its own
|
|
395
|
+
* reason:
|
|
243
396
|
*
|
|
244
397
|
* - `env` is not a runtime call at all. Values are resolved at finalize and
|
|
245
398
|
* travel in the config, so a worker reading `env` reaches nothing.
|
|
@@ -251,9 +404,16 @@ export type FunctionsDispatchCapability = z.infer<typeof functionsDispatchCapabi
|
|
|
251
404
|
* touches the database, not how. Narrowing it would take per-statement analysis
|
|
252
405
|
* we do not do, and guessing "read-only" from a declaration would be a grant
|
|
253
406
|
* the author never asked for and cannot see.
|
|
407
|
+
*
|
|
408
|
+
* The three platform-service grants are named for the operation an author
|
|
409
|
+
* reaches for, and each covers its service's whole operation set for the same
|
|
410
|
+
* reason `db` widens: a declaration says a handler uses spam checking, not that
|
|
411
|
+
* it never files a correction.
|
|
254
412
|
*/
|
|
255
|
-
export declare function functionsDispatchCapabilities(capabilities: ExecutionCapabilities
|
|
256
|
-
|
|
413
|
+
export declare function functionsDispatchCapabilities(capabilities: ExecutionCapabilities, platform?: {
|
|
414
|
+
nextCache?: boolean;
|
|
415
|
+
}): FunctionsDispatchCapability[];
|
|
416
|
+
/** Logs and the host-local Next cache do not transit the origin relay. */
|
|
257
417
|
export declare function functionsGrantNeedsRelay(granted: readonly FunctionsDispatchCapability[]): boolean;
|
|
258
418
|
/**
|
|
259
419
|
* What the space origin needs in order to dispatch to the host on its own. The
|
|
@@ -266,6 +426,7 @@ export declare function functionsGrantNeedsRelay(granted: readonly FunctionsDisp
|
|
|
266
426
|
export declare const functionsHostConfigSchema: z.ZodObject<{
|
|
267
427
|
hostname: z.ZodString;
|
|
268
428
|
bundleUrl: z.ZodString;
|
|
429
|
+
seedUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
269
430
|
}, z.core.$strict>;
|
|
270
431
|
export type FunctionsHostConfig = z.infer<typeof functionsHostConfigSchema>;
|
|
271
432
|
/**
|
|
@@ -286,6 +447,35 @@ export declare const functionsRelayConfigSchema: z.ZodObject<{
|
|
|
286
447
|
maxConcurrentCalls: z.ZodNumber;
|
|
287
448
|
}, z.core.$strict>;
|
|
288
449
|
export type FunctionsRelayConfig = z.infer<typeof functionsRelayConfigSchema>;
|
|
450
|
+
/**
|
|
451
|
+
* Where the execution host reports how much this version ran.
|
|
452
|
+
*
|
|
453
|
+
* Absent means uncounted, not refused: a space whose configuration predates
|
|
454
|
+
* usage reporting must keep serving, and an execution tier that cannot reach
|
|
455
|
+
* the control plane must never fail a request over it. Counting is reporting
|
|
456
|
+
* only — nothing here throttles, and no limit is enforced anywhere from it.
|
|
457
|
+
*/
|
|
458
|
+
export declare const functionsUsageConfigSchema: z.ZodObject<{
|
|
459
|
+
url: z.ZodString;
|
|
460
|
+
token: z.ZodString;
|
|
461
|
+
}, z.core.$strict>;
|
|
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>;
|
|
289
479
|
/**
|
|
290
480
|
* What a build declares about its worker — everything the CLI can know from the
|
|
291
481
|
* author's project alone.
|
|
@@ -309,6 +499,12 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
|
|
|
309
499
|
sha256: z.ZodString;
|
|
310
500
|
size: z.ZodNumber;
|
|
311
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>>>;
|
|
312
508
|
compatibilityDate: z.ZodString;
|
|
313
509
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
314
510
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -324,6 +520,7 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
|
|
|
324
520
|
path: z.ZodString;
|
|
325
521
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
326
522
|
}, z.core.$strict>>>;
|
|
523
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
327
524
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
328
525
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
329
526
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -331,7 +528,13 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
|
|
|
331
528
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
332
529
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
333
530
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
531
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
532
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
533
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
334
534
|
}, z.core.$strip>>;
|
|
535
|
+
platform: z.ZodDefault<z.ZodObject<{
|
|
536
|
+
nextCache: z.ZodDefault<z.ZodBoolean>;
|
|
537
|
+
}, z.core.$strict>>;
|
|
335
538
|
}, z.core.$strict>;
|
|
336
539
|
variables: z.ZodDefault<z.ZodObject<{
|
|
337
540
|
source: z.ZodLiteral<"spacefast-variables">;
|
|
@@ -343,9 +546,10 @@ export type FunctionsSourceFinalize = z.infer<typeof functionsSourceFinalizeSche
|
|
|
343
546
|
* The document the control plane sends to the runtime, which the engine stores
|
|
344
547
|
* beside the version's files and the origin reads on every dispatch.
|
|
345
548
|
*
|
|
346
|
-
* It is the build's declaration plus the
|
|
347
|
-
*
|
|
348
|
-
*
|
|
549
|
+
* It is the build's declaration plus the things only the platform can supply:
|
|
550
|
+
* where to dispatch, what the worker is allowed to do, the credentials that let
|
|
551
|
+
* it do those things and report what it did, and the resolved values of its
|
|
552
|
+
* variables.
|
|
349
553
|
*/
|
|
350
554
|
export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
351
555
|
runtimeKind: z.ZodLiteral<"functions">;
|
|
@@ -359,6 +563,12 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
359
563
|
sha256: z.ZodString;
|
|
360
564
|
size: z.ZodNumber;
|
|
361
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>>>;
|
|
362
572
|
compatibilityDate: z.ZodString;
|
|
363
573
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
364
574
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -374,6 +584,7 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
374
584
|
path: z.ZodString;
|
|
375
585
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
376
586
|
}, z.core.$strict>>>;
|
|
587
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
377
588
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
378
589
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
379
590
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -381,7 +592,13 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
381
592
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
382
593
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
383
594
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
595
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
596
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
597
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
384
598
|
}, z.core.$strip>>;
|
|
599
|
+
platform: z.ZodDefault<z.ZodObject<{
|
|
600
|
+
nextCache: z.ZodDefault<z.ZodBoolean>;
|
|
601
|
+
}, z.core.$strict>>;
|
|
385
602
|
}, z.core.$strict>;
|
|
386
603
|
variables: z.ZodDefault<z.ZodObject<{
|
|
387
604
|
source: z.ZodLiteral<"spacefast-variables">;
|
|
@@ -390,12 +607,19 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
390
607
|
host: z.ZodObject<{
|
|
391
608
|
hostname: z.ZodString;
|
|
392
609
|
bundleUrl: z.ZodString;
|
|
610
|
+
seedUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
393
611
|
}, z.core.$strict>;
|
|
394
612
|
grantedCapabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
395
613
|
fetch: "fetch";
|
|
614
|
+
"storage.read": "storage.read";
|
|
615
|
+
"storage.write": "storage.write";
|
|
396
616
|
"db.read": "db.read";
|
|
397
617
|
"db.write": "db.write";
|
|
398
618
|
log: "log";
|
|
619
|
+
"next.cache": "next.cache";
|
|
620
|
+
"gravatar.profile": "gravatar.profile";
|
|
621
|
+
"spam.check": "spam.check";
|
|
622
|
+
"email.send": "email.send";
|
|
399
623
|
}>>>;
|
|
400
624
|
relay: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
401
625
|
url: z.ZodString;
|
|
@@ -403,6 +627,13 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
|
|
|
403
627
|
maxBatchStatements: z.ZodNumber;
|
|
404
628
|
maxConcurrentCalls: z.ZodNumber;
|
|
405
629
|
}, z.core.$strict>>>;
|
|
630
|
+
usage: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
631
|
+
url: z.ZodString;
|
|
632
|
+
token: z.ZodString;
|
|
633
|
+
}, z.core.$strict>>>;
|
|
634
|
+
purge: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
635
|
+
token: z.ZodString;
|
|
636
|
+
}, z.core.$strict>>>;
|
|
406
637
|
variableValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
407
638
|
}, z.core.$strict>;
|
|
408
639
|
export type FunctionsRuntimeConfig = z.infer<typeof functionsRuntimeConfigSchema>;
|
|
@@ -420,6 +651,12 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
|
|
|
420
651
|
sha256: z.ZodString;
|
|
421
652
|
size: z.ZodNumber;
|
|
422
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>>>;
|
|
423
660
|
compatibilityDate: z.ZodString;
|
|
424
661
|
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
425
662
|
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -435,6 +672,7 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
|
|
|
435
672
|
path: z.ZodString;
|
|
436
673
|
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
437
674
|
}, z.core.$strict>>>;
|
|
675
|
+
bypassCookies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
438
676
|
capabilities: z.ZodDefault<z.ZodObject<{
|
|
439
677
|
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
440
678
|
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -442,7 +680,13 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
|
|
|
442
680
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
443
681
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
444
682
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
683
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
684
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
685
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
445
686
|
}, z.core.$strip>>;
|
|
687
|
+
platform: z.ZodDefault<z.ZodObject<{
|
|
688
|
+
nextCache: z.ZodDefault<z.ZodBoolean>;
|
|
689
|
+
}, z.core.$strict>>;
|
|
446
690
|
}, z.core.$strict>;
|
|
447
691
|
variables: z.ZodDefault<z.ZodObject<{
|
|
448
692
|
source: z.ZodLiteral<"spacefast-variables">;
|
|
@@ -463,10 +707,13 @@ export declare function createFunctionsSourceFinalize(input: {
|
|
|
463
707
|
entry: string;
|
|
464
708
|
mainModule: string;
|
|
465
709
|
bundle: z.input<typeof functionsBundleRefSchema>;
|
|
710
|
+
seed?: z.input<typeof functionsSeedRefSchema> | null;
|
|
466
711
|
compatibilityDate: string;
|
|
467
712
|
compatibilityFlags?: string[];
|
|
468
713
|
routes?: z.input<typeof functionsRouteSchema>[];
|
|
714
|
+
bypassCookies?: string[];
|
|
469
715
|
capabilities?: ExecutionCapabilities;
|
|
716
|
+
nextCache?: boolean;
|
|
470
717
|
variableNames?: string[];
|
|
471
718
|
}): FunctionsSourceFinalize;
|
|
472
719
|
/**
|
|
@@ -485,10 +732,12 @@ export declare const functionsExecutionStateSchema: z.ZodEnum<{
|
|
|
485
732
|
}>;
|
|
486
733
|
export type FunctionsExecutionState = z.infer<typeof functionsExecutionStateSchema>;
|
|
487
734
|
/**
|
|
488
|
-
* What a live worker is, as the `
|
|
735
|
+
* What a live worker is, as the `worker` member of a space's runtime status.
|
|
736
|
+
*
|
|
737
|
+
* It carries no kind tag. The member it rides in already says which product
|
|
738
|
+
* answered, and the same tree can carry a capsule beside it — a discriminant
|
|
739
|
+
* here could only repeat the field name or contradict its sibling.
|
|
489
740
|
*
|
|
490
|
-
* Shaped like `zeroAppSchema` and discriminated by the same `runtimeKind`, so a
|
|
491
|
-
* reader switches on one field rather than probing for which product answered.
|
|
492
741
|
* No `versionId`: the status response it rides in already names the live
|
|
493
742
|
* version.
|
|
494
743
|
*
|
|
@@ -498,7 +747,6 @@ export type FunctionsExecutionState = z.infer<typeof functionsExecutionStateSche
|
|
|
498
747
|
* branches on, and stating it twice invites the two to disagree.
|
|
499
748
|
*/
|
|
500
749
|
export declare const functionsAppSchema: z.ZodObject<{
|
|
501
|
-
runtimeKind: z.ZodLiteral<"functions">;
|
|
502
750
|
artifactId: z.ZodString;
|
|
503
751
|
appName: z.ZodString;
|
|
504
752
|
entry: z.ZodString;
|
|
@@ -524,6 +772,9 @@ export declare const functionsAppSchema: z.ZodObject<{
|
|
|
524
772
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
525
773
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
526
774
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
775
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
776
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
777
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
527
778
|
}, z.core.$strip>>;
|
|
528
779
|
executionState: z.ZodEnum<{
|
|
529
780
|
ready: "ready";
|
|
@@ -538,60 +789,3 @@ export declare const functionsAppSchema: z.ZodObject<{
|
|
|
538
789
|
}, z.core.$strict>;
|
|
539
790
|
}, z.core.$strict>;
|
|
540
791
|
export type FunctionsApp = z.infer<typeof functionsAppSchema>;
|
|
541
|
-
/**
|
|
542
|
-
* The wire shape of the origin's log-read route, not a public API contract.
|
|
543
|
-
*
|
|
544
|
-
* Handler logs reach callers through `GET /v1/spaces/:spaceId/logs/runtime`,
|
|
545
|
-
* which serves the platform's own `runtimeLogListResponseSchema` for both
|
|
546
|
-
* execution tiers. These aliases describe the hop underneath it: a worker tails
|
|
547
|
-
* its output to the origin that dispatched it, and the control plane reads it
|
|
548
|
-
* back from there. Keeping them named after this product is the point — the
|
|
549
|
-
* origin is the only place a wp.cloud-hosted space keeps anything, and Zero's
|
|
550
|
-
* records never travel this path at all.
|
|
551
|
-
*/
|
|
552
|
-
export declare const functionsLogEntrySchema: z.ZodObject<{
|
|
553
|
-
id: z.ZodString;
|
|
554
|
-
timestamp: z.ZodString;
|
|
555
|
-
level: z.ZodEnum<{
|
|
556
|
-
info: "info";
|
|
557
|
-
error: "error";
|
|
558
|
-
debug: "debug";
|
|
559
|
-
warn: "warn";
|
|
560
|
-
}>;
|
|
561
|
-
requestId: z.ZodNullable<z.ZodString>;
|
|
562
|
-
versionId: z.ZodNullable<z.ZodString>;
|
|
563
|
-
handlerName: z.ZodNullable<z.ZodString>;
|
|
564
|
-
message: z.ZodString;
|
|
565
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
566
|
-
}, z.core.$strict>;
|
|
567
|
-
export type FunctionsLogEntry = z.infer<typeof functionsLogEntrySchema>;
|
|
568
|
-
export declare const functionsLogListQuerySchema: z.ZodObject<{
|
|
569
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
570
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
571
|
-
requestId: z.ZodOptional<z.ZodString>;
|
|
572
|
-
handlerName: z.ZodOptional<z.ZodString>;
|
|
573
|
-
}, z.core.$strict>;
|
|
574
|
-
export type FunctionsLogListQuery = z.infer<typeof functionsLogListQuerySchema>;
|
|
575
|
-
export declare const functionsLogListResponseSchema: z.ZodObject<{
|
|
576
|
-
data: z.ZodArray<z.ZodObject<{
|
|
577
|
-
id: z.ZodString;
|
|
578
|
-
timestamp: z.ZodString;
|
|
579
|
-
level: z.ZodEnum<{
|
|
580
|
-
info: "info";
|
|
581
|
-
error: "error";
|
|
582
|
-
debug: "debug";
|
|
583
|
-
warn: "warn";
|
|
584
|
-
}>;
|
|
585
|
-
requestId: z.ZodNullable<z.ZodString>;
|
|
586
|
-
versionId: z.ZodNullable<z.ZodString>;
|
|
587
|
-
handlerName: z.ZodNullable<z.ZodString>;
|
|
588
|
-
message: z.ZodString;
|
|
589
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
590
|
-
}, z.core.$strict>>;
|
|
591
|
-
pagination: z.ZodObject<{
|
|
592
|
-
nextCursor: z.ZodNullable<z.ZodString>;
|
|
593
|
-
}, z.core.$strict>;
|
|
594
|
-
}, z.core.$strict>;
|
|
595
|
-
export type FunctionsLogListResponse = z.infer<typeof functionsLogListResponseSchema>;
|
|
596
|
-
/** Narrows a space's live runtime kind to this product. */
|
|
597
|
-
export declare function isFunctionsRuntime(kind: z.infer<typeof runtimeKindSchema> | null): boolean;
|