@spacefast/common 0.0.24 → 0.2.1
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.d.ts +6 -146
- package/dist/agents/connect-targets.js +63 -295
- package/dist/agents/private-key-oauth.d.ts +31 -2
- package/dist/agents/private-key-oauth.js +166 -92
- package/dist/agents/registry/core.d.ts +292 -0
- package/dist/agents/registry/core.js +1388 -0
- package/dist/agents/registry/deeplink-probes.d.ts +23 -0
- package/dist/agents/registry/deeplink-probes.js +18 -0
- package/dist/agents/registry/node.d.ts +56 -0
- package/dist/agents/registry/node.js +339 -0
- package/dist/brand-assets-build.js +3 -6
- package/dist/brand-assets.d.ts +5 -15
- package/dist/brand-assets.js +12 -14
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +79 -12
- package/dist/config/domains.js +128 -29
- package/dist/config/index.js +1 -2
- package/dist/contracts/abuse.js +9 -24
- package/dist/contracts/access-profiles.d.ts +86 -0
- package/dist/contracts/access-profiles.js +89 -0
- package/dist/contracts/access.d.ts +24 -30
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +72 -26
- package/dist/contracts/analytics.js +8 -10
- package/dist/contracts/api-keys.d.ts +77 -52
- package/dist/contracts/api-keys.js +44 -24
- package/dist/contracts/application-journal.d.ts +216 -0
- package/dist/contracts/application-journal.js +167 -0
- package/dist/contracts/auth.d.ts +90 -17
- package/dist/contracts/auth.js +86 -17
- package/dist/contracts/beta.d.ts +9 -4
- package/dist/contracts/beta.js +20 -16
- package/dist/contracts/billing.d.ts +2 -1
- package/dist/contracts/billing.js +37 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +209 -18
- package/dist/contracts/builds.js +93 -27
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +25 -9
- package/dist/contracts/cli.d.ts +7 -0
- package/dist/contracts/cli.js +6 -0
- package/dist/contracts/collab-public.d.ts +1 -1
- package/dist/contracts/collab-public.js +5 -8
- package/dist/contracts/comments.d.ts +44 -34
- package/dist/contracts/comments.js +107 -77
- package/dist/contracts/commerce.d.ts +165 -0
- package/dist/contracts/commerce.js +146 -0
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/common.js +20 -31
- package/dist/contracts/content-contract-verification.d.ts +521 -0
- package/dist/contracts/content-contract-verification.js +320 -0
- package/dist/contracts/content-platform-fixture.d.ts +1278 -0
- package/dist/contracts/content-platform-fixture.js +44 -0
- package/dist/contracts/content-program.d.ts +994 -0
- package/dist/contracts/content-program.js +658 -0
- package/dist/contracts/content-sync.d.ts +290 -0
- package/dist/contracts/content-sync.js +167 -0
- package/dist/contracts/content.d.ts +432 -0
- package/dist/contracts/content.js +303 -0
- package/dist/contracts/continuation.d.ts +17 -1
- package/dist/contracts/continuation.js +23 -23
- package/dist/contracts/countries.js +3 -4
- package/dist/contracts/crons.d.ts +52 -0
- package/dist/contracts/crons.js +60 -0
- package/dist/contracts/dashboard-prefs.d.ts +56 -0
- package/dist/contracts/dashboard-prefs.js +51 -0
- package/dist/contracts/device-auth.d.ts +234 -37
- package/dist/contracts/device-auth.js +267 -53
- package/dist/contracts/docs.d.ts +1 -5
- package/dist/contracts/docs.js +7 -15
- package/dist/contracts/domains.d.ts +501 -93
- package/dist/contracts/domains.js +193 -55
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +27 -26
- package/dist/contracts/enums.js +68 -61
- package/dist/contracts/error-code-meta.d.ts +283 -7
- package/dist/contracts/error-code-meta.js +97 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +82 -17
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +48 -64
- package/dist/contracts/execution.js +52 -62
- package/dist/contracts/feature-lifecycle.d.ts +73 -27
- package/dist/contracts/feature-lifecycle.js +86 -26
- package/dist/contracts/features.d.ts +68 -19
- package/dist/contracts/features.js +42 -41
- package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
- package/dist/contracts/frame-session.d.ts +192 -0
- package/dist/contracts/frame-session.js +164 -0
- package/dist/contracts/functions.d.ts +338 -164
- package/dist/contracts/functions.js +367 -198
- package/dist/contracts/git.d.ts +27 -33
- package/dist/contracts/git.js +10 -11
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +62 -54
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +6 -3
- package/dist/contracts/internal.d.ts +8 -18
- package/dist/contracts/internal.js +13 -14
- package/dist/contracts/mcp.d.ts +28 -0
- package/dist/contracts/mcp.js +28 -0
- package/dist/contracts/me.d.ts +6 -1
- package/dist/contracts/me.js +12 -6
- package/dist/contracts/notifications.d.ts +27 -29
- package/dist/contracts/notifications.js +9 -4
- package/dist/contracts/oauth-resources.d.ts +112 -10
- package/dist/contracts/oauth-resources.js +116 -11
- package/dist/contracts/oauth-scope-actions.d.ts +90 -0
- package/dist/contracts/oauth-scope-actions.js +126 -0
- package/dist/contracts/operations.d.ts +27 -4
- package/dist/contracts/operations.js +12 -6
- package/dist/contracts/pages.d.ts +31 -7
- package/dist/contracts/pages.js +22 -5
- package/dist/contracts/partner-notifications.d.ts +3 -0
- package/dist/contracts/partner-notifications.js +65 -0
- package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
- package/dist/contracts/{platform.js → partner.js} +27 -40
- package/dist/contracts/plan-policy.js +1 -1
- package/dist/contracts/principal-assertion.d.ts +43 -0
- package/dist/contracts/principal-assertion.js +67 -0
- package/dist/contracts/principals.d.ts +73 -0
- package/dist/contracts/principals.js +59 -0
- package/dist/contracts/privacy.d.ts +11 -0
- package/dist/contracts/privacy.js +17 -0
- package/dist/contracts/problem-document.js +3 -4
- package/dist/contracts/publish-archive.d.ts +269 -161
- package/dist/contracts/publish-archive.js +11 -1
- package/dist/contracts/push-new.d.ts +8 -8
- package/dist/contracts/quotas.js +5 -5
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +44 -31
- package/dist/contracts/repository-connections.js +17 -5
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +150 -26
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +206 -82
- package/dist/contracts/runtime-api.js +131 -70
- package/dist/contracts/runtime-app.d.ts +13 -23
- package/dist/contracts/runtime-app.js +39 -24
- package/dist/contracts/runtime-components.d.ts +143 -0
- package/dist/contracts/runtime-components.js +199 -0
- package/dist/contracts/runtime-db.d.ts +49 -23
- package/dist/contracts/runtime-db.js +87 -22
- package/dist/contracts/runtime-purge.d.ts +8 -0
- package/dist/contracts/runtime-purge.js +5 -0
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +15 -14
- package/dist/contracts/runtime-storage.js +30 -14
- package/dist/contracts/sf-config-v1.d.ts +48 -14
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +283 -19
- package/dist/contracts/space-config.js +430 -80
- package/dist/contracts/spaces.d.ts +376 -290
- package/dist/contracts/spaces.js +200 -135
- package/dist/contracts/superadmin-activity.d.ts +3 -43
- package/dist/contracts/superadmin-activity.js +6 -30
- package/dist/contracts/superadmin-emails.d.ts +1 -0
- package/dist/contracts/superadmin-emails.js +17 -1
- package/dist/contracts/superadmin-runtime.d.ts +199 -0
- package/dist/contracts/superadmin-runtime.js +141 -0
- package/dist/contracts/superadmin-search.d.ts +22 -2
- package/dist/contracts/superadmin-search.js +14 -6
- package/dist/contracts/superadmin-spaces.d.ts +438 -189
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +5 -2
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -12
- package/dist/contracts/superadmin-tenants.js +32 -13
- package/dist/contracts/superadmin.d.ts +232 -37
- package/dist/contracts/superadmin.js +106 -22
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +47 -37
- package/dist/contracts/teams.d.ts +86 -26
- package/dist/contracts/teams.js +90 -31
- package/dist/contracts/tenants.d.ts +135 -0
- package/dist/contracts/tenants.js +120 -0
- package/dist/contracts/test-triggers.d.ts +70 -0
- package/dist/contracts/test-triggers.js +116 -0
- package/dist/contracts/theme-json.js +3 -8
- package/dist/contracts/transfers.d.ts +1 -0
- package/dist/contracts/transfers.js +3 -2
- package/dist/contracts/usage.d.ts +209 -0
- package/dist/contracts/usage.js +124 -12
- package/dist/contracts/variables.d.ts +2 -2
- package/dist/contracts/variables.js +9 -13
- package/dist/contracts/webhooks.d.ts +13 -5
- package/dist/contracts/webhooks.js +3 -1
- package/dist/contracts/zero.d.ts +72 -81
- package/dist/contracts/zero.js +80 -78
- package/dist/dashboard-paths/index.d.ts +24 -21
- package/dist/dashboard-paths/index.js +35 -47
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
- package/dist/dashboard-paths/route-reservations.generated.js +36 -0
- package/dist/docs/agent-arrival.d.ts +92 -0
- package/dist/docs/agent-arrival.js +227 -0
- package/dist/docs/agent-output-policy.d.ts +6 -0
- package/dist/docs/agent-output-policy.js +22 -0
- package/dist/docs/agent-prose.d.ts +12 -18
- package/dist/docs/agent-prose.js +73 -51
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +339 -436
- package/dist/docs/catalog.d.ts +153 -95
- package/dist/docs/catalog.js +163 -48
- package/dist/docs/error-docs.d.ts +2098 -1
- package/dist/docs/error-docs.js +421 -144
- package/dist/docs/index-build.d.ts +0 -1
- package/dist/docs/index-build.js +2 -3
- package/dist/docs/page-context-prompt.d.ts +77 -0
- package/dist/docs/page-context-prompt.js +131 -0
- package/dist/docs/reference-urls.d.ts +46 -0
- package/dist/docs/reference-urls.js +79 -0
- package/dist/docs/search.d.ts +6 -8
- package/dist/docs/search.js +10 -13
- package/dist/docs/skill-distribution.d.ts +4 -1
- package/dist/docs/skill-distribution.js +10 -5
- package/dist/docs/skills.d.ts +120 -120
- package/dist/docs/skills.js +121 -73
- package/dist/docs/start-prompts.d.ts +45 -0
- package/dist/docs/start-prompts.js +62 -0
- package/dist/domain-exploration.js +9 -13
- package/dist/og-template.d.ts +56 -0
- package/dist/og-template.js +56 -0
- package/dist/slug-policy/index.js +5 -11
- package/dist/test-helpers/fetch-stub.js +1 -0
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +21 -1
- package/dist/utils/build-settings.js +133 -15
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +4 -5
- package/dist/utils/cast-transport.d.ts +5 -17
- package/dist/utils/cast-transport.js +6 -19
- package/dist/utils/claim-token.js +1 -2
- package/dist/utils/comment-avatars.js +4 -6
- package/dist/utils/concurrency.js +3 -3
- package/dist/utils/content-type.d.ts +7 -6
- package/dist/utils/content-type.js +73 -51
- package/dist/utils/credential-policy.d.ts +50 -6
- package/dist/utils/credential-policy.js +126 -59
- package/dist/utils/dns-instructions.js +9 -9
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/error-code.js +1 -0
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grant-decision.fixtures.json +2 -2
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +7 -8
- package/dist/utils/gravatar.d.ts +2 -4
- package/dist/utils/gravatar.js +6 -12
- package/dist/utils/id-hints.js +14 -23
- package/dist/utils/idempotency.d.ts +3 -3
- package/dist/utils/idempotency.js +6 -7
- package/dist/utils/local-space-state.d.ts +23 -26
- package/dist/utils/local-space-state.js +46 -46
- package/dist/utils/oauth-signed-query.d.ts +3 -5
- package/dist/utils/oauth-signed-query.js +6 -9
- package/dist/utils/one-shot-replay.d.ts +7 -6
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +15 -19
- package/dist/utils/page-colors.js +23 -45
- package/dist/utils/page-fonts.d.ts +1 -1
- package/dist/utils/page-fonts.js +8 -20
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +33 -3
- package/dist/utils/pages.js +83 -30
- package/dist/utils/privacy-regions.d.ts +19 -0
- package/dist/utils/privacy-regions.js +91 -0
- package/dist/utils/publish-form-data.d.ts +4 -5
- package/dist/utils/publish-form-data.js +2 -3
- package/dist/utils/publish-policy.d.ts +11 -17
- package/dist/utils/publish-policy.fixtures.json +11 -5
- package/dist/utils/publish-policy.js +65 -110
- package/dist/utils/query-client.d.ts +2 -0
- package/dist/utils/query-client.js +10 -1
- package/dist/utils/runtime-paths.d.ts +4 -4
- package/dist/utils/runtime-paths.js +6 -8
- package/dist/utils/runtime-upload.d.ts +9 -0
- package/dist/utils/runtime-upload.js +12 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +23 -40
- package/dist/utils/space-config.d.ts +12 -15
- package/dist/utils/space-config.js +13 -16
- package/dist/utils/static-runtime-policy.d.ts +10 -7
- package/dist/utils/static-runtime-policy.fixtures.json +38 -41
- package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
- package/dist/utils/static-runtime-policy.generated.js +70 -0
- package/dist/utils/static-runtime-policy.js +31 -132
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.d.ts +4 -1
- package/dist/utils/upload-session.js +41 -19
- package/dist/utils/version-path.js +11 -19
- package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
- package/dist/utils/wpcom-auth-redirects.js +1 -4
- package/dist/vocabulary.d.ts +13 -13
- package/dist/vocabulary.js +52 -27
- package/package.json +15 -18
- package/dist/agents/client-registry.d.ts +0 -22
- package/dist/agents/client-registry.js +0 -41
- package/dist/docs/agent-handoff-document.d.ts +0 -15
- package/dist/docs/agent-handoff-document.js +0 -180
- package/dist/docs/agent-solutions.d.ts +0 -110
- package/dist/docs/agent-solutions.js +0 -183
- package/dist/utils/query-keys.d.ts +0 -84
- package/dist/utils/query-keys.js +0 -108
|
@@ -11,20 +11,16 @@ export declare const STATIC_RUNTIME_CONTROL_PATHS: string[];
|
|
|
11
11
|
export declare const STATIC_RUNTIME_CONTROL_PREFIXES: string[];
|
|
12
12
|
export declare function normalizePublishPath(relativePath: string): string;
|
|
13
13
|
/**
|
|
14
|
-
* The one subtree inside the runtime control prefix
|
|
14
|
+
* The one subtree inside the runtime control prefix a publish may write, so a
|
|
15
|
+
* compiled worker bundle travels the ordinary manifest and upload path while
|
|
16
|
+
* staying unservable as static content.
|
|
15
17
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* needing a parallel one. Keeping it under the control prefix is what makes it
|
|
19
|
-
* unservable as static content by default — the runtime answers it only behind a
|
|
20
|
-
* signature.
|
|
21
|
-
*
|
|
22
|
-
* Scoped to `bundles/` rather than the whole `__spacefast/functions/` directory
|
|
23
|
-
* on purpose: the sibling `config.json` holds the key those signatures are
|
|
24
|
-
* minted with, and a publish that could overwrite it would be a publish that
|
|
25
|
-
* could mint its own tokens.
|
|
18
|
+
* Scoped to `bundles/`, not the whole `__spacefast/functions/` directory: the
|
|
19
|
+
* sibling `config.json` holds the key its signatures are minted with.
|
|
26
20
|
*/
|
|
27
21
|
export declare const PUBLISHABLE_BUILD_ARTIFACT_PREFIX = "__spacefast/functions/bundles/";
|
|
22
|
+
/** The same carve-out for the Next-cache seed document. */
|
|
23
|
+
export declare const PUBLISHABLE_SEED_ARTIFACT_PREFIX = "__spacefast/functions/seeds/";
|
|
28
24
|
export declare function publishPathIgnored(relativePath: string): boolean;
|
|
29
25
|
export declare function publishPathIsConvention(relativePath: string): boolean;
|
|
30
26
|
export declare function providerRuntimeFeatureWarnings(paths: readonly string[]): PublishManifestWarning[];
|
|
@@ -89,12 +85,10 @@ export type PublishRouteOwnership = {
|
|
|
89
85
|
*/
|
|
90
86
|
export declare function canonicalizePublishRequestedRoute(route: string): string;
|
|
91
87
|
/**
|
|
92
|
-
* Expands artifact paths into the request routes they can serve
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* expansion in canonical access-route form so authorization and diagnostics
|
|
97
|
-
* never have to infer a route from an artifact path.
|
|
88
|
+
* Expands artifact paths into the request routes they can serve: literal
|
|
89
|
+
* files, directory indexes and clean `.html` aliases. Two artifacts owning one
|
|
90
|
+
* route is rejected at publish rather than left to lookup order.
|
|
91
|
+
* `routeOwnership` restates the expansion in canonical access-route form.
|
|
98
92
|
*/
|
|
99
93
|
export declare function analyzePublishRoutes(paths: readonly string[], options?: {
|
|
100
94
|
index?: string | false;
|
|
@@ -146,6 +146,16 @@
|
|
|
146
146
|
"path": "__spacefast/functions/bundlesX/evil.json",
|
|
147
147
|
"expected": "static_runtime_control_path_not_supported"
|
|
148
148
|
},
|
|
149
|
+
{
|
|
150
|
+
"path": "__spacefast/functions/seeds/abc123/seed.json",
|
|
151
|
+
"expected": null,
|
|
152
|
+
"why": "the Next-cache seed document, the bundle carve-out's sibling"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"path": "__spacefast/functions/seeds.json",
|
|
156
|
+
"expected": "static_runtime_control_path_not_supported",
|
|
157
|
+
"why": "the carve-out is the seeds/ prefix, not anything starting with seeds"
|
|
158
|
+
},
|
|
149
159
|
{
|
|
150
160
|
"path": "__spacefast/zero/deploy.json",
|
|
151
161
|
"expected": null,
|
|
@@ -201,10 +211,6 @@
|
|
|
201
211
|
"path": "engine-manifest.json",
|
|
202
212
|
"expected": "static_runtime_control_path_not_supported"
|
|
203
213
|
},
|
|
204
|
-
{
|
|
205
|
-
"path": "entrypoint-shim.php",
|
|
206
|
-
"expected": "static_runtime_control_path_not_supported"
|
|
207
|
-
},
|
|
208
214
|
{
|
|
209
215
|
"path": "nested/custom-redirects.php",
|
|
210
216
|
"expected": null,
|
|
@@ -213,7 +219,7 @@
|
|
|
213
219
|
{
|
|
214
220
|
"path": "init.php",
|
|
215
221
|
"expected": null,
|
|
216
|
-
"why": "engine/init.php installs
|
|
222
|
+
"why": "engine/init.php installs inside an immutable release, not the docroot"
|
|
217
223
|
},
|
|
218
224
|
{
|
|
219
225
|
"path": ".spacefast/storage/routes/current.php",
|
|
@@ -2,21 +2,17 @@ import { BRAND } from "../brand.js";
|
|
|
2
2
|
import { WORST_CASE_QUOTAS } from "../contracts/quotas.js";
|
|
3
3
|
import { SPACE_CONFIG_PRIVATE_FILES } from "../contracts/space-config.js";
|
|
4
4
|
import { ZERO_RUNTIME_DEPLOY_PATH } from "../contracts/zero.js";
|
|
5
|
-
// The ONE static publish policy (
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// local preflight, inline archive extraction, and the runtime parity fixtures
|
|
9
|
-
// (the PHP twin is runtime/engine/admin/upload-policy.php).
|
|
5
|
+
// The ONE static publish policy (spec "Upload Contract"), shared by API
|
|
6
|
+
// manifest validation, CLI preflight and archive extraction. The PHP twin is
|
|
7
|
+
// runtime/engine/admin/upload-policy.php.
|
|
10
8
|
import { canonicalizeVersionPath, normalizeVersionPath } from "./version-path.js";
|
|
11
|
-
// Manifest scale caps (spec "Upload Contract")
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// 16 MB, enforced fail-early before any upload session exists.
|
|
9
|
+
// Manifest scale caps (spec "Upload Contract"). Plan policy may LOWER the
|
|
10
|
+
// file-count ceiling (Free 20,000), never raise it. All are enforced before
|
|
11
|
+
// any upload session exists.
|
|
15
12
|
export const MANIFEST_MAX_FILES_CEILING = 100_000;
|
|
16
13
|
export const MANIFEST_MAX_PATH_BYTES = 1024;
|
|
17
14
|
export const MANIFEST_MAX_BODY_BYTES = 16 * 1024 * 1024;
|
|
18
15
|
export const MAX_VERSION_FILE_SIZE_BYTES = 64 * 1024 * 1024;
|
|
19
|
-
// Worst-case artifact ceiling lives in the named raise-only quota table.
|
|
20
16
|
export const MAX_VERSION_TOTAL_BYTES = WORST_CASE_QUOTAS.maxArtifactBytes;
|
|
21
17
|
const IGNORED_EXACT_PATHS = new Set([
|
|
22
18
|
".DS_Store",
|
|
@@ -28,8 +24,7 @@ const IGNORED_EXACT_PATHS = new Set([
|
|
|
28
24
|
".env.test",
|
|
29
25
|
".npmrc",
|
|
30
26
|
".netrc",
|
|
31
|
-
// CLI checkout state
|
|
32
|
-
// user archives may contain either; both stay out of every publish).
|
|
27
|
+
// CLI checkout state. Both spellings appear in user archives.
|
|
33
28
|
".spacefast/state.json",
|
|
34
29
|
".stattic/state.json",
|
|
35
30
|
"_routes.json",
|
|
@@ -57,33 +52,22 @@ const SENSITIVE_FILE_PATTERNS = [
|
|
|
57
52
|
// Denied runtime private/control paths (spec "Static path policy").
|
|
58
53
|
// Every list below is generated verbatim into runtime/engine/admin/upload-policy.php
|
|
59
54
|
// by apps/control-plane/src/scripts/codegen-php-policy.ts, so the two enforcers
|
|
60
|
-
// cannot hold different literals. Lowercase only
|
|
55
|
+
// cannot hold different literals. Lowercase only; both sides fold the path first.
|
|
61
56
|
export const STATIC_EXECUTION_CONTROL_FILES = [".htaccess", ".user.ini"];
|
|
62
|
-
//
|
|
63
|
-
// `/__spacefast
|
|
64
|
-
// (`/__stattic_probe` today, more `/__stattic/*` routes planned) stays
|
|
65
|
-
// reserved the same way. Mid-segment occurrences are ordinary content.
|
|
57
|
+
// Matched by PREFIX, so the runtime owns `__spacefast_generated/` as well as
|
|
58
|
+
// `/__spacefast/*`. Mid-segment occurrences are ordinary content.
|
|
66
59
|
export const STATIC_RUNTIME_CONTROL_SEGMENT_PREFIXES = ["__spacefast", "__stattic"];
|
|
67
|
-
// Reserved as WHOLE root segments
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
// starts_with('/__sf/')`, so `/__sfx/...` and `/__spanish/page` are ordinary
|
|
71
|
-
// tenant paths. Reserving more than the front door claims would refuse a publish
|
|
72
|
-
// of content the front door then happily serves as tenant content.
|
|
60
|
+
// Reserved as WHOLE root segments, so `/__sfx/...` and `/__spanish/page` are
|
|
61
|
+
// ordinary tenant paths. Reserving more than the front door claims would refuse
|
|
62
|
+
// a publish of content the front door then serves anyway.
|
|
73
63
|
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
// time, where serve.php refuses to let either a published file or a routing rule
|
|
79
|
-
// answer a reserved route, and that refusal is what runtime/tests/collab-frame.test.ts
|
|
80
|
-
// exercises by publishing a file at `__/collab` on purpose. The control table is
|
|
81
|
-
// the authority; this list is a publish-time convenience, so keep it a subset
|
|
82
|
-
// and never let it contradict the table.
|
|
64
|
+
// A SUBSET of what the control table in runtime/engine/shared/context.php
|
|
65
|
+
// reserves, never a mirror: the table also reserves `/__/collab`, enforced at
|
|
66
|
+
// request time by serve.php. The table is the authority; keep this list a
|
|
67
|
+
// subset of it.
|
|
83
68
|
export const STATIC_RUNTIME_ROOT_SEGMENTS = ["__sf", "__span"];
|
|
84
|
-
// Both
|
|
85
|
-
//
|
|
86
|
-
// legacy on-disk layout, and user archives may carry either name.
|
|
69
|
+
// Both spellings stay denied: spaces published before the `.stattic` →
|
|
70
|
+
// `.spacefast` rename still serve from the legacy on-disk layout.
|
|
87
71
|
export const STATIC_RUNTIME_CONTROL_PATHS = [
|
|
88
72
|
".well-known/spacefast-runtime",
|
|
89
73
|
".well-known/stattic-runtime",
|
|
@@ -98,43 +82,34 @@ export function normalizePublishPath(relativePath) {
|
|
|
98
82
|
return relativePath.replace(/\\/g, "/").replace(/^\/+/g, "");
|
|
99
83
|
}
|
|
100
84
|
/**
|
|
101
|
-
* The one subtree inside the runtime control prefix
|
|
85
|
+
* The one subtree inside the runtime control prefix a publish may write, so a
|
|
86
|
+
* compiled worker bundle travels the ordinary manifest and upload path while
|
|
87
|
+
* staying unservable as static content.
|
|
102
88
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* needing a parallel one. Keeping it under the control prefix is what makes it
|
|
106
|
-
* unservable as static content by default — the runtime answers it only behind a
|
|
107
|
-
* signature.
|
|
108
|
-
*
|
|
109
|
-
* Scoped to `bundles/` rather than the whole `__spacefast/functions/` directory
|
|
110
|
-
* on purpose: the sibling `config.json` holds the key those signatures are
|
|
111
|
-
* minted with, and a publish that could overwrite it would be a publish that
|
|
112
|
-
* could mint its own tokens.
|
|
89
|
+
* Scoped to `bundles/`, not the whole `__spacefast/functions/` directory: the
|
|
90
|
+
* sibling `config.json` holds the key its signatures are minted with.
|
|
113
91
|
*/
|
|
114
92
|
export const PUBLISHABLE_BUILD_ARTIFACT_PREFIX = "__spacefast/functions/bundles/";
|
|
93
|
+
/** The same carve-out for the Next-cache seed document. */
|
|
94
|
+
export const PUBLISHABLE_SEED_ARTIFACT_PREFIX = "__spacefast/functions/seeds/";
|
|
115
95
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* the Functions bundle above, same channel.
|
|
123
|
-
*
|
|
124
|
-
* One exact path, not a prefix: its siblings under `__spacefast/zero/` are the
|
|
125
|
-
* runtime's own artifact, config and binary, and a publish that could overwrite
|
|
126
|
-
* those would be a publish that could replace the runtime.
|
|
96
|
+
* ZERO_RUNTIME_DEPLOY_PATH is the one FILE a publish may write inside the
|
|
97
|
+
* control prefix. A Zero capsule's server travels as version metadata, so a
|
|
98
|
+
* server-only change would otherwise ship a byte-identical shell that the
|
|
99
|
+
* manifest comparison reads as "no changes"; the deploy digest moves it. One
|
|
100
|
+
* exact path, not a prefix: its siblings under `__spacefast/zero/` are the
|
|
101
|
+
* runtime's own artifact, config and binary.
|
|
127
102
|
*/
|
|
128
103
|
function isPublishableBuildArtifactPath(normalizedPath, lowerPath) {
|
|
129
104
|
return (lowerPath.startsWith(PUBLISHABLE_BUILD_ARTIFACT_PREFIX) ||
|
|
105
|
+
lowerPath.startsWith(PUBLISHABLE_SEED_ARTIFACT_PREFIX) ||
|
|
130
106
|
normalizedPath === ZERO_RUNTIME_DEPLOY_PATH);
|
|
131
107
|
}
|
|
132
108
|
export function publishPathIgnored(relativePath) {
|
|
133
109
|
const path = normalizePublishPath(relativePath);
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
// content in the same dirs (e.g. the legacy .stattic/routes.json convention).
|
|
110
|
+
// Drop these files at any depth so a checkout archived one level too high
|
|
111
|
+
// never ships a claim token, while other content in the same dirs still
|
|
112
|
+
// publishes (e.g. the legacy .stattic/routes.json convention).
|
|
138
113
|
if (/(?:^|\/)\.(?:spacefast|stattic)\/(?:state|space)\.json$/.test(path) ||
|
|
139
114
|
/(?:^|\/)\.spacefast-(?:[0-9a-f-]{36}\.(?:tmp|rollback|retired)|[0-9a-f]{24}\.lock)$/.test(path)) {
|
|
140
115
|
return true;
|
|
@@ -151,11 +126,9 @@ export function publishPathIgnored(relativePath) {
|
|
|
151
126
|
export function publishPathIsConvention(relativePath) {
|
|
152
127
|
return RESERVED_CONVENTION_PATHS.has(normalizePublishPath(relativePath));
|
|
153
128
|
}
|
|
154
|
-
// Provider runtime features
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
// with a warning so migrations are never silent. A root `functions/` directory
|
|
158
|
-
// is Spacefast's own file-router convention and must never reach this warning.
|
|
129
|
+
// Provider runtime features with no Spacefast equivalent publish as inert
|
|
130
|
+
// content with a warning, so migrations are never silent. A root `functions/`
|
|
131
|
+
// directory is Spacefast's own convention and must never reach this warning.
|
|
159
132
|
function providerRuntimeFeatureForPath(path) {
|
|
160
133
|
if (path === "_worker.js") {
|
|
161
134
|
return "Cloudflare Pages _worker.js";
|
|
@@ -210,9 +183,8 @@ export function staticUploadPathViolation(path, options = {}) {
|
|
|
210
183
|
return pathViolation("invalid_file_path", "File path is invalid.", rawPath);
|
|
211
184
|
}
|
|
212
185
|
if (normalizedPath !== rawPath) {
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
// this policy used to report a different string than the runtime's copy.
|
|
186
|
+
// Echo the path the caller sent; a rewritten one would suggest the
|
|
187
|
+
// rewrite was accepted.
|
|
216
188
|
return pathViolation("invalid_file_path", "File path is invalid.", rawPath);
|
|
217
189
|
}
|
|
218
190
|
if (new TextEncoder().encode(normalizedPath).length > MANIFEST_MAX_PATH_BYTES) {
|
|
@@ -280,12 +252,10 @@ export function canonicalizePublishRequestedRoute(route) {
|
|
|
280
252
|
return segments.length === 0 ? "/" : `/${segments.join("/")}`;
|
|
281
253
|
}
|
|
282
254
|
/**
|
|
283
|
-
* Expands artifact paths into the request routes they can serve
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* expansion in canonical access-route form so authorization and diagnostics
|
|
288
|
-
* never have to infer a route from an artifact path.
|
|
255
|
+
* Expands artifact paths into the request routes they can serve: literal
|
|
256
|
+
* files, directory indexes and clean `.html` aliases. Two artifacts owning one
|
|
257
|
+
* route is rejected at publish rather than left to lookup order.
|
|
258
|
+
* `routeOwnership` restates the expansion in canonical access-route form.
|
|
289
259
|
*/
|
|
290
260
|
export function analyzePublishRoutes(paths, options = {}) {
|
|
291
261
|
const index = options.index === undefined ? "index.html" : options.index;
|
|
@@ -354,12 +324,10 @@ export function analyzePublishRoutes(paths, options = {}) {
|
|
|
354
324
|
export function resolveManifestFileCap(maxFiles) {
|
|
355
325
|
return Math.min(MANIFEST_MAX_FILES_CEILING, maxFiles && maxFiles > 0 ? maxFiles : MANIFEST_MAX_FILES_CEILING);
|
|
356
326
|
}
|
|
357
|
-
// The shared manifest validator (spec "Upload Contract")
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
-
//
|
|
361
|
-
// extraction routes through the same checks. Returns the manifest with
|
|
362
|
-
// canonical paths — callers use the returned files, never the input.
|
|
327
|
+
// The shared manifest validator (spec "Upload Contract"). Runs BEFORE any
|
|
328
|
+
// upload session is created; archive extraction routes through the same
|
|
329
|
+
// checks. Returns canonical paths, so callers use the returned files, never
|
|
330
|
+
// the input.
|
|
363
331
|
export function validatePublishManifest(files, caps = {}) {
|
|
364
332
|
const maxFiles = resolveManifestFileCap(caps.maxFiles);
|
|
365
333
|
if (files.length > maxFiles) {
|
|
@@ -416,15 +384,13 @@ export function validatePublishManifest(files, caps = {}) {
|
|
|
416
384
|
warnings: [],
|
|
417
385
|
};
|
|
418
386
|
}
|
|
419
|
-
//
|
|
420
|
-
//
|
|
421
|
-
// high must never publish a claim token to the live site, and failing the
|
|
422
|
-
// whole manifest for it would punish the common accident.
|
|
387
|
+
// Dropped rather than rejected: failing a whole manifest over a stray
|
|
388
|
+
// .env or .spacefast/ would punish the common accident.
|
|
423
389
|
if (publishPathIgnored(canonicalPath)) {
|
|
424
390
|
continue;
|
|
425
391
|
}
|
|
426
|
-
//
|
|
427
|
-
//
|
|
392
|
+
// Distinct paths here, but they cannot round-trip a case-insensitive
|
|
393
|
+
// filesystem.
|
|
428
394
|
const lowercase = canonicalPath.toLowerCase();
|
|
429
395
|
const caseSibling = lowercasePaths.get(lowercase);
|
|
430
396
|
if (caseSibling !== undefined && caseSibling !== canonicalPath) {
|
|
@@ -486,8 +452,7 @@ const FREE_PLAN_ALLOWED_UPLOAD_EXTENSIONS = new Set([
|
|
|
486
452
|
".txt",
|
|
487
453
|
".md",
|
|
488
454
|
".csv",
|
|
489
|
-
//
|
|
490
|
-
// application/octet-stream by the runtime.
|
|
455
|
+
// Migration fixtures, served as application/octet-stream.
|
|
491
456
|
".customtype",
|
|
492
457
|
".xml",
|
|
493
458
|
".svg",
|
|
@@ -503,13 +468,10 @@ const FREE_PLAN_ALLOWED_UPLOAD_EXTENSIONS = new Set([
|
|
|
503
468
|
".ttf",
|
|
504
469
|
".otf",
|
|
505
470
|
]);
|
|
506
|
-
// THE anonymous content enforcement
|
|
507
|
-
//
|
|
508
|
-
//
|
|
509
|
-
//
|
|
510
|
-
// enforces the list without knowing it means "anonymous"). Web-page content
|
|
511
|
-
// only — no opaque octet-streams, archives (except scanned gzip, which
|
|
512
|
-
// pagefind search indexes depend on), documents, or media containers.
|
|
471
|
+
// THE anonymous content enforcement: uploads are accepted like any free
|
|
472
|
+
// publish, but until the space is claimed the runtime serves only these types,
|
|
473
|
+
// pushed as the route-config `content_types` allowlist. Web-page content only.
|
|
474
|
+
// Gzip is the one archive, because pagefind search indexes need it.
|
|
513
475
|
export const ANONYMOUS_SERVE_CONTENT_TYPES = [
|
|
514
476
|
"text/*",
|
|
515
477
|
"image/*",
|
|
@@ -534,20 +496,14 @@ function freePlanDeniedExecutablePath(filePath) {
|
|
|
534
496
|
.split("/")
|
|
535
497
|
.some((segment) => segment === "bin");
|
|
536
498
|
}
|
|
537
|
-
// Acceptance is deliberately identical for claimed-free and unclaimed
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
// SERVE-time content-type allowlist (ANONYMOUS_SERVE_CONTENT_TYPES via the
|
|
542
|
-
// route-config `content_types` policy) is what keeps opaque binaries dark
|
|
543
|
-
// until the space is claimed.
|
|
499
|
+
// Acceptance is deliberately identical for claimed-free and unclaimed spaces:
|
|
500
|
+
// rejecting types at upload adds no safety, since the bytes reach us before
|
|
501
|
+
// any scan either way. ANONYMOUS_SERVE_CONTENT_TYPES is what keeps opaque
|
|
502
|
+
// binaries dark until the space is claimed.
|
|
544
503
|
export function freePlanCanUploadPath(filePath, options) {
|
|
545
504
|
const path = normalizePublishPath(filePath);
|
|
546
|
-
//
|
|
547
|
-
//
|
|
548
|
-
// `_redirects`/`_headers`) — the plan's content-extension gate must never
|
|
549
|
-
// eat it (e2e checkpoint 4: it was silently dropped on free publishes,
|
|
550
|
-
// disabling fallback/meta/templates/theme for every free space).
|
|
505
|
+
// Platform machinery, not user content: same lifecycle as
|
|
506
|
+
// `_redirects`/`_headers`, so the content-extension gate must never eat them.
|
|
551
507
|
if (SPACE_CONFIG_PRIVATE_FILES.includes(path)) {
|
|
552
508
|
return true;
|
|
553
509
|
}
|
|
@@ -571,8 +527,7 @@ export function freePlanCanUploadContentType(contentType) {
|
|
|
571
527
|
normalized === "application/javascript" ||
|
|
572
528
|
normalized === "application/json" ||
|
|
573
529
|
normalized === "application/manifest+json" ||
|
|
574
|
-
//
|
|
575
|
-
// ship as gzip fragments, and ClamAV decompresses gzip when scanning.
|
|
530
|
+
// pagefind ships gzip fragments, and ClamAV decompresses gzip when scanning.
|
|
576
531
|
normalized === "application/gzip" ||
|
|
577
532
|
normalized === "image/svg+xml" ||
|
|
578
533
|
normalized === "application/xml" ||
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
/**
|
|
3
|
+
* Freshness for a caller that has not adopted a tiered caching policy.
|
|
4
|
+
*
|
|
5
|
+
* The tiers themselves (`STALE_TIME_MS`) live in `@spacefast/sdk/query`, which
|
|
6
|
+
* depends on this package — so they cannot be imported here and arrive as an
|
|
7
|
+
* argument instead. The dashboard passes `STALE_TIME_MS.normal`; superadmin
|
|
8
|
+
* still runs on this default.
|
|
9
|
+
*/
|
|
10
|
+
const UNTIERED_STALE_TIME_MS = 60_000;
|
|
2
11
|
export function createSpacefastQueryClient(options) {
|
|
3
12
|
return new QueryClient({
|
|
4
13
|
defaultOptions: {
|
|
@@ -12,7 +21,7 @@ export function createSpacefastQueryClient(options) {
|
|
|
12
21
|
}
|
|
13
22
|
return failureCount < 2;
|
|
14
23
|
},
|
|
15
|
-
staleTime:
|
|
24
|
+
staleTime: options?.staleTime ?? UNTIERED_STALE_TIME_MS,
|
|
16
25
|
refetchOnWindowFocus: true,
|
|
17
26
|
refetchOnReconnect: true,
|
|
18
27
|
},
|
|
@@ -2,13 +2,13 @@ export declare const SPACEFAST_RUNTIME_NAMESPACE: "/__spacefast";
|
|
|
2
2
|
export declare const RUNTIME_MANAGEMENT_API_PATH: "/__spacefast/api.php";
|
|
3
3
|
export declare const RUNTIME_UPLOAD_API_PATH: "/__spacefast/upload.php";
|
|
4
4
|
export declare const RUNTIME_HEALTH_PATH: "/__spacefast/health.php";
|
|
5
|
+
export declare const RUNTIME_CONTENT_API_PATH: "/__spacefast/content.php";
|
|
5
6
|
export declare const RUNTIME_COMMENTS_CONFIG_PATH: "/__spacefast/comments/config";
|
|
6
7
|
export declare const RUNTIME_COMMENTS_TICKET_PATH: "/__spacefast/comments/ticket";
|
|
7
8
|
export declare const RUNTIME_COMMENTS_VERSION_URLS_PATH: "/__spacefast/comments/version-urls";
|
|
8
|
-
/** The review workspace the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in runtime/engine/shared/context.php. */
|
|
9
|
+
/** The review workspace, on the Space's own origin and outside the
|
|
10
|
+
* `/__spacefast` exchange namespace because people paste it into Slack.
|
|
11
|
+
* The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in shared/context.php. */
|
|
12
12
|
export declare const RUNTIME_COLLAB_FRAME_PATH: "/__/collab";
|
|
13
13
|
export declare function runtimeManagementPath(suffix: string): string;
|
|
14
14
|
export declare function runtimeUploadPath(params: URLSearchParams | Record<string, string>): string;
|
|
@@ -2,17 +2,15 @@ export const SPACEFAST_RUNTIME_NAMESPACE = "/__spacefast";
|
|
|
2
2
|
export const RUNTIME_MANAGEMENT_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/api.php`;
|
|
3
3
|
export const RUNTIME_UPLOAD_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/upload.php`;
|
|
4
4
|
export const RUNTIME_HEALTH_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/health.php`;
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
// runtime/
|
|
8
|
-
// packages/collab-sdk/test/entry.test.ts pins the SDK side to these literals.
|
|
5
|
+
export const RUNTIME_CONTENT_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/content.php`;
|
|
6
|
+
// Same-origin Comments exchange paths. The PHP mirror is
|
|
7
|
+
// SPACEFAST_COMMENTS_*_PATH in runtime/engine/shared/context.php.
|
|
9
8
|
export const RUNTIME_COMMENTS_CONFIG_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/config`;
|
|
10
9
|
export const RUNTIME_COMMENTS_TICKET_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/ticket`;
|
|
11
10
|
export const RUNTIME_COMMENTS_VERSION_URLS_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/version-urls`;
|
|
12
|
-
/** The review workspace the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in runtime/engine/shared/context.php. */
|
|
11
|
+
/** The review workspace, on the Space's own origin and outside the
|
|
12
|
+
* `/__spacefast` exchange namespace because people paste it into Slack.
|
|
13
|
+
* The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in shared/context.php. */
|
|
16
14
|
export const RUNTIME_COLLAB_FRAME_PATH = "/__/collab";
|
|
17
15
|
export function runtimeManagementPath(suffix) {
|
|
18
16
|
const route = normalizeRuntimeRoute(suffix);
|
|
@@ -4,6 +4,15 @@ export declare function runtimeUploadFetchUrl(input: {
|
|
|
4
4
|
uploadId: string;
|
|
5
5
|
path: string;
|
|
6
6
|
}): string;
|
|
7
|
+
export declare function runtimeUploadFileUrl(input: {
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
uploadId: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function runtimeUploadBlobsHaveUrl(input: {
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
spaceId: string;
|
|
15
|
+
}): string;
|
|
7
16
|
export declare function runtimeUploadBlobUrl(input: {
|
|
8
17
|
baseUrl: string;
|
|
9
18
|
spaceId: string;
|
|
@@ -15,6 +15,18 @@ export function runtimeUploadFetchUrl(input) {
|
|
|
15
15
|
path: runtimeUploadCanonicalPath(input.path),
|
|
16
16
|
}), input.baseUrl).toString();
|
|
17
17
|
}
|
|
18
|
+
export function runtimeUploadFileUrl(input) {
|
|
19
|
+
return new URL(runtimeUploadPath({
|
|
20
|
+
op: "file",
|
|
21
|
+
upload_id: input.uploadId,
|
|
22
|
+
path: runtimeUploadCanonicalPath(input.path),
|
|
23
|
+
}), input.baseUrl).toString();
|
|
24
|
+
}
|
|
25
|
+
export function runtimeUploadBlobsHaveUrl(input) {
|
|
26
|
+
return new URL(runtimeUploadPath({
|
|
27
|
+
route: `/spaces/${encodeURIComponent(input.spaceId)}/blobs/have`,
|
|
28
|
+
}), input.baseUrl).toString();
|
|
29
|
+
}
|
|
18
30
|
export function runtimeUploadBlobUrl(input) {
|
|
19
31
|
return new URL(runtimeUploadPath({
|
|
20
32
|
route: `/spaces/${encodeURIComponent(input.spaceId)}/blobs/${encodeURIComponent(input.sha256)}`,
|
|
@@ -51,9 +51,9 @@ export declare function secureOutputLocation(trustedPath: string, outputPath: st
|
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
53
|
* Writes beneath an explicitly trusted root without following output-tree
|
|
54
|
-
* symlinks. Linux uses descriptor-relative operations; other
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* symlinks. Linux uses descriptor-relative operations; other platforms use
|
|
55
|
+
* exclusive staging plus before-and-after ancestor identity validation, and
|
|
56
|
+
* fail closed if any binding changes.
|
|
57
57
|
*/
|
|
58
58
|
export declare function secureWriteFile(options: SecureWriteOptions): Promise<void>;
|
|
59
59
|
export declare function secureReadFile(options: SecureReadOptions & {
|