@run402/sdk 1.65.0 → 1.66.0
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/README.md +37 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/namespaces/deploy.d.ts +7 -1
- package/dist/namespaces/deploy.d.ts.map +1 -1
- package/dist/namespaces/deploy.js +137 -15
- package/dist/namespaces/deploy.js.map +1 -1
- package/dist/namespaces/deploy.types.d.ts +144 -1
- package/dist/namespaces/deploy.types.d.ts.map +1 -1
- package/dist/namespaces/deploy.types.js +266 -0
- package/dist/namespaces/deploy.types.js.map +1 -1
- package/dist/node/deploy-manifest.d.ts.map +1 -1
- package/dist/node/deploy-manifest.js +59 -12
- package/dist/node/deploy-manifest.js.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/scoped.d.ts +2 -1
- package/dist/scoped.d.ts.map +1 -1
- package/dist/scoped.js +6 -0
- package/dist/scoped.js.map +1 -1
- package/dist/type-contract.d.ts.map +1 -1
- package/dist/type-contract.js +2 -0
- package/dist/type-contract.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ The `CredentialsProvider` interface has two required methods (`getAuth`, `getPro
|
|
|
59
59
|
| Namespace | Highlights |
|
|
60
60
|
|---|---|
|
|
61
61
|
| `projects` | `provision`, `delete`, `list`, `sql`, `rest`, `validateExpose`, `applyExpose`, `getExpose`, `getUsage`, `getSchema`, `info`, `keys`, `use`, `active`, `pin`, `getQuote` |
|
|
62
|
-
| `deploy` | **The unified deploy primitive (v1.34+).** `apply` / `start` / `resume` / `status` / `list` / `events` / `getRelease` / `getActiveRelease` / `diff` / `plan` / `upload` / `commit` |
|
|
62
|
+
| `deploy` | **The unified deploy primitive (v1.34+).** `apply` / `start` / `resume` / `status` / `list` / `events` / `resolve` / `getRelease` / `getActiveRelease` / `diff` / `plan` / `upload` / `commit` |
|
|
63
63
|
| `ci` | GitHub Actions OIDC federation over `/ci/v1/*`: `createBinding`, `listBindings`, `getBinding`, `revokeBinding`, `exchangeToken`; plus canonical delegation helpers |
|
|
64
64
|
| `sites` | `deployDir` — Node entry only (`@run402/sdk/node`); thin wrapper over `r.deploy.apply` |
|
|
65
65
|
| `blobs` | `put` (returns `AssetRef` with `cdnUrl` / `sri` / `etag` / `cacheKind` and `scriptTag()`/`linkTag()`/`imgTag()` emitters), `get`, `ls`, `rm`, `sign`, `diagnoseUrl`, `waitFresh` |
|
|
@@ -168,12 +168,12 @@ const resumed = await r.deploy.resume(operationId);
|
|
|
168
168
|
|
|
169
169
|
- **All bytes ride through CAS.** The plan request body never carries inline bytes — only `ContentRef` objects. When the spec exceeds 5 MB JSON, the SDK uploads the manifest itself as a CAS object (`manifest_ref` escape hatch).
|
|
170
170
|
- **Per-resource semantics on the spec.** `site.replace` = "this is the whole site" (files absent are removed). `site.patch.put` / `patch.delete` are surgical updates. `functions.replace` / `functions.patch.set` / `functions.patch.delete` mirror that. Secrets are value-free: set values first with `r.secrets.set(project, key, value)`, then deploy with `secrets.require` and/or `secrets.delete`. `subdomains.set` / `subdomains.add` / `subdomains.remove` use their own shape. Top-level absence = leave untouched.
|
|
171
|
-
- **Same-origin web routes.** `routes` is `undefined | null | { replace: RouteSpec[] }`. Omit it or pass `null` to carry forward base routes, pass `{ replace: [] }` to clear routes, or pass route entries to replace the table.
|
|
171
|
+
- **Same-origin web routes.** `routes` is `undefined | null | { replace: RouteSpec[] }`. Omit it or pass `null` to carry forward base routes, pass `{ replace: [] }` to clear routes, or pass route entries to replace the table. Function targets use `{ type: "function", name }`; exact static route targets use `{ type: "static", file }` with methods `["GET"]` or `["GET","HEAD"]`, no wildcard pattern, and a relative deployed file path with no leading slash. Use exact `/admin` plus final-wildcard `/admin/*` for a dynamic section root; ordinary static files do not need route entries. Routed browser ingress invokes Node 22 Fetch Request -> Response handlers; `req.url` is the full public URL on managed subdomains, deployment hosts, and verified custom domains. Direct `/functions/v1/:name` invocation remains API-key protected. Runtime route failure codes include `ROUTE_MANIFEST_LOAD_FAILED`, `ROUTED_INVOKE_WORKER_SECRET_MISSING`, `ROUTED_INVOKE_AUTH_FAILED`, `ROUTED_ROUTE_STALE`, `ROUTE_METHOD_NOT_ALLOWED`, and `ROUTED_RESPONSE_TOO_LARGE`.
|
|
172
172
|
- **Strict spec validation happens before network calls.** Raw `ReleaseSpec` objects reject unknown fields (for example `project_id` or `subdomain`) instead of silently dropping them during normalization, and project/base-only or empty nested specs fail with `Run402DeployError.code === "MANIFEST_EMPTY"`. Use the Node manifest helpers when starting from CLI/MCP-style JSON.
|
|
173
173
|
- **Warnings are structured.** `DeployResult.warnings` contains `WarningEntry[]` (`code`, `severity`, `requires_confirmation`, `message`, optional `affected`/`details`/`confidence`); the type preserves legacy low/medium/high plan warnings and modern deploy-observability info/warn/high warnings. `apply()` emits `plan.warnings` and stops before upload/commit on confirmation-required warnings unless `allowWarnings` is set. For `MISSING_REQUIRED_SECRET`, set the affected keys with `r.secrets.set`, then retry.
|
|
174
174
|
- **Safe release-race retries are SDK-owned.** `deploy.apply()` automatically re-plans and retries omitted/current-base specs when the gateway returns `BASE_RELEASE_CONFLICT` with `safe_to_retry: true`. The default budget is two retries after the initial attempt; pass `{ maxRetries: 0 }` to opt out. Each retry emits `deploy.retry`; exhausted retries keep the last `Run402DeployError` and add `attempts`, `maxRetries`, and `lastRetryCode`.
|
|
175
175
|
- **Planning supports dry-runs.** `r.deploy.plan(spec, { dryRun: true })` calls the server-authoritative dry-run route and returns the normalized v2 plan envelope without uploading bytes or creating plan/operation rows (`plan_id` and `operation_id` are `null`).
|
|
176
|
-
- **Release observability is typed.** Use `r.deploy.getRelease({ project, releaseId, siteLimit? })`, `r.deploy.getActiveRelease({ project, siteLimit? })`, and `r.deploy.diff({ project, from, to, limit? })` to inspect release inventory and release-to-release diffs. `diff` returns `ReleaseToReleaseDiff` with `migrations.applied_between_releases`; secret diffs expose keys only.
|
|
176
|
+
- **Release observability is typed.** Use `r.deploy.getRelease({ project, releaseId, siteLimit? })`, `r.deploy.getActiveRelease({ project, siteLimit? })`, and `r.deploy.diff({ project, from, to, limit? })` to inspect release inventory and release-to-release diffs. Inventories include `release_generation`, `static_manifest_sha256`, and nullable `static_manifest_metadata` (`file_count`, `total_bytes`, `cache_classes`, `cache_class_sources`, `spa_fallback`); `null` means unavailable, not zero. `diff` returns `ReleaseToReleaseDiff` with `migrations.applied_between_releases`; secret diffs expose keys only; `static_assets` exposes unchanged/changed/added/removed files, CAS byte reuse, eliminated deployment-copy bytes, and immutable/CAS warning counts.
|
|
177
177
|
- **Server-authoritative manifest digest** — no byte-for-byte canonicalize requirement on the client.
|
|
178
178
|
- The Node entry adds `fileSetFromDir(path)` for filesystem byte sources:
|
|
179
179
|
|
|
@@ -194,10 +194,11 @@ const resumed = await r.deploy.resume(operationId);
|
|
|
194
194
|
|
|
195
195
|
const r = run402();
|
|
196
196
|
const routes: RouteSpec[] = [
|
|
197
|
-
{ pattern: "/api/*", methods: ["GET", "POST"], target: { type: "function", name: "api" } },
|
|
197
|
+
{ pattern: "/api/*", methods: ["GET", "POST", "OPTIONS"], target: { type: "function", name: "api" } },
|
|
198
198
|
{ pattern: "/admin", target: { type: "function", name: "admin" } },
|
|
199
199
|
{ pattern: "/admin/*", target: { type: "function", name: "admin" } },
|
|
200
200
|
{ pattern: "/login", methods: ["POST"], target: { type: "function", name: "auth" } },
|
|
201
|
+
{ pattern: "/events", methods: ["GET", "HEAD"], target: { type: "static", file: "events.html" } },
|
|
201
202
|
];
|
|
202
203
|
const spec: ReleaseSpec = {
|
|
203
204
|
project: projectId,
|
|
@@ -208,17 +209,43 @@ const resumed = await r.deploy.resume(operationId);
|
|
|
208
209
|
auth: { source: "export default async () => new Response('login')" },
|
|
209
210
|
},
|
|
210
211
|
},
|
|
211
|
-
site: { replace: {
|
|
212
|
+
site: { replace: {
|
|
213
|
+
"index.html": "<!doctype html><main id='app'></main>",
|
|
214
|
+
"events.html": "<!doctype html><h1>Events</h1>",
|
|
215
|
+
} },
|
|
212
216
|
routes: { replace: routes },
|
|
213
217
|
};
|
|
214
218
|
|
|
215
219
|
await r.deploy.apply(spec);
|
|
216
220
|
```
|
|
217
221
|
|
|
218
|
-
Matching is exact or final `/*` prefix only. `/admin/*` does not match `/admin`; deploy both `/admin` and `/admin/*` when the section root is dynamic. Query strings are ignored for matching and preserved in the handler's full public `req.url`. Exact beats prefix, longest prefix wins, and method-compatible dynamic routes beat static files. A method-specific `POST /login` route lets static `GET /login` serve HTML. Unsafe method mismatch returns `405`; matched dynamic route failures do not fall back to static assets.
|
|
222
|
+
Matching is exact or final `/*` prefix only. `/admin/*` does not match `/admin`; deploy both `/admin` and `/admin/*` when the section root is dynamic. Static route targets are exact file targets, not rewrites or redirects; avoid routing every static file, wildcard static targets, leading-slash files, directory shorthand, broad method lists by default, and one-static-route-target-per-page route-table exhaustion. Query strings are ignored for matching and preserved in the handler's full public `req.url`. Exact beats prefix, longest prefix wins, and method-compatible dynamic routes beat static files. A method-specific `POST /login` route lets static `GET /login` serve HTML. Unsafe method mismatch returns `405`; matched dynamic route failures do not fall back to static assets.
|
|
219
223
|
|
|
220
224
|
Routed functions use Node 22 Fetch Request -> Response. `req.url` is the full public URL on managed subdomains, deployment hosts, and verified custom domains. The raw `run402.routed_http.v1` envelope is internal; direct `/functions/v1/:name` remains API-key protected.
|
|
221
225
|
|
|
226
|
+
- URL-first public diagnostics:
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
import {
|
|
230
|
+
buildDeployResolveSummary,
|
|
231
|
+
normalizeDeployResolveRequest,
|
|
232
|
+
run402,
|
|
233
|
+
type DeployResolveResponse,
|
|
234
|
+
} from "@run402/sdk/node";
|
|
235
|
+
|
|
236
|
+
const r = run402();
|
|
237
|
+
const request = normalizeDeployResolveRequest({
|
|
238
|
+
project: projectId,
|
|
239
|
+
url: "https://example.com/events?utm=x#hero",
|
|
240
|
+
method: "GET",
|
|
241
|
+
});
|
|
242
|
+
const resolution: DeployResolveResponse = await r.deploy.resolve(request);
|
|
243
|
+
const summary = buildDeployResolveSummary(resolution, request);
|
|
244
|
+
console.log(summary.would_serve, summary.match, request.ignored);
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`r.deploy.resolve({ project, url, method })` and scoped `p.deploy.resolve({ url, method })` also accept lower-level `{ project, host, path?, method? }`. URL query strings/fragments are ignored for lookup and surfaced in `request.ignored`. Current known `match` literals are `host_missing`, `manifest_missing`, `path_error`, `none`, `static_exact`, `static_index`, `spa_fallback`, and `spa_fallback_missing`; preserve unknown future strings. Today resolve is authoritative for host/static/SPAfallback diagnostics, not complete route introspection unless future gateways return route context. `result` is diagnostic body status, not SDK HTTP transport status, so host misses can be successful calls with `would_serve: false`. Do not use resolve as a fetch, cache purge, or cache-policy oracle, and do not hard-code `cache_policy` strings; branch on `cache_class` and preserve unknown cache classes.
|
|
248
|
+
|
|
222
249
|
Route warning recovery:
|
|
223
250
|
|
|
224
251
|
| Code | Why it matters | Recovery |
|
|
@@ -227,8 +254,12 @@ const resumed = await r.deploy.resume(operationId);
|
|
|
227
254
|
| `ROUTE_TARGET_CARRIED_FORWARD` | Carried-forward route still targets a base-release function. | Inspect active routes and deploy `routes.replace` if the target should change. |
|
|
228
255
|
| `ROUTE_SHADOWS_STATIC_PATH` / `WILDCARD_ROUTE_SHADOWS_STATIC_PATHS` | Dynamic route shadows static content. | Inspect warning details and active routes; confirm only when intentional. |
|
|
229
256
|
| `METHOD_SPECIFIC_ROUTE_ALLOWS_GET_STATIC_FALLBACK` | Unmatched methods can serve static content. | Confirm fallback is intended or add method coverage. |
|
|
257
|
+
| `WILDCARD_ROUTE_EXCLUDES_MUTATION_METHODS` | Wildcard function route only allows `GET`/`HEAD`. | Add mutation methods such as `POST`, omit methods for an API prefix, or confirm it is read-only. |
|
|
230
258
|
| `ROUTE_TABLE_NEAR_LIMIT` | Route table is near a limit. | Consolidate or remove routes. |
|
|
231
259
|
| `ROUTES_NOT_ENABLED` | Routes are disabled for the project/environment. | Deploy without `routes` or request enablement; direct function invoke is not a browser-route substitute. |
|
|
260
|
+
| `STATIC_ALIAS_SHADOWS_STATIC_PATH` / `STATIC_ALIAS_RELATIVE_ASSET_RISK` | Static route target conflicts with a real static path or has relative-asset risk. | Prefer canonical static files, fix relative asset paths, and confirm only when intentional. |
|
|
261
|
+
| `STATIC_ALIAS_DUPLICATE_CANONICAL_URL` / `STATIC_ALIAS_EXTENSIONLESS_NON_HTML` | Static route target may duplicate canonical URLs or expose extensionless non-HTML. | Use one canonical URL per page and reserve exact static route targets for intentional HTML-like public paths. |
|
|
262
|
+
| `STATIC_ALIAS_TABLE_NEAR_LIMIT` | Static route targets are near route-table limits. | Avoid one-static-route-target-per-page tables; consolidate. |
|
|
232
263
|
|
|
233
264
|
- The Node entry also has the typed manifest adapter shared by CLI/MCP:
|
|
234
265
|
|
package/dist/index.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ export type * from "./kernel.js";
|
|
|
127
127
|
export { CI_SESSION_CREDENTIALS, createCiSessionCredentials, githubActionsCredentials, isCiSessionCredentials, } from "./ci-credentials.js";
|
|
128
128
|
export type * from "./ci-credentials.js";
|
|
129
129
|
export { Deploy } from "./namespaces/deploy.js";
|
|
130
|
-
export { ROUTE_HTTP_METHODS } from "./namespaces/deploy.types.js";
|
|
130
|
+
export { EMPTY_STATIC_MANIFEST_METADATA, ROUTE_HTTP_METHODS, buildDeployResolveSummary, isDeployResolveRouteHit, isDeployResolveStaticHit, normalizeDeployResolveRequest, normalizeStaticManifestMetadata, } from "./namespaces/deploy.types.js";
|
|
131
131
|
export { Ci, CI_AUDIENCE, CI_GITHUB_ACTIONS_ISSUER, CI_GITHUB_ACTIONS_PROVIDER, DEFAULT_CI_DELEGATION_CHAIN_ID, V1_CI_ALLOWED_ACTIONS, V1_CI_ALLOWED_EVENTS_DEFAULT, assertCiDeployableSpec, buildCiDelegationResourceUri, buildCiDelegationStatement, normalizeCiRouteScopes, normalizeCiDelegationValues, validateCiNonce, validateCiRouteScope, validateCiSubjectMatch, } from "./namespaces/ci.js";
|
|
132
132
|
export { ScopedRun402 } from "./scoped.js";
|
|
133
133
|
export type * from "./namespaces/admin.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAA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AAW,EACX,wBAAwB,EACxB,0BAA0B,EAC1B,8BAA8B,EAC9B,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,6BAA6B,CAAC;AACjD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -176,7 +176,7 @@ export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError,
|
|
|
176
176
|
export { withRetry } from "./retry.js";
|
|
177
177
|
export { CI_SESSION_CREDENTIALS, createCiSessionCredentials, githubActionsCredentials, isCiSessionCredentials, } from "./ci-credentials.js";
|
|
178
178
|
export { Deploy } from "./namespaces/deploy.js";
|
|
179
|
-
export { ROUTE_HTTP_METHODS } from "./namespaces/deploy.types.js";
|
|
179
|
+
export { EMPTY_STATIC_MANIFEST_METADATA, ROUTE_HTTP_METHODS, buildDeployResolveSummary, isDeployResolveRouteHit, isDeployResolveStaticHit, normalizeDeployResolveRequest, normalizeStaticManifestMetadata, } from "./namespaces/deploy.types.js";
|
|
180
180
|
export { Ci, CI_AUDIENCE, CI_GITHUB_ACTIONS_ISSUER, CI_GITHUB_ACTIONS_PROVIDER, DEFAULT_CI_DELEGATION_CHAIN_ID, V1_CI_ALLOWED_ACTIONS, V1_CI_ALLOWED_EVENTS_DEFAULT, assertCiDeployableSpec, buildCiDelegationResourceUri, buildCiDelegationStatement, normalizeCiRouteScopes, normalizeCiDelegationValues, validateCiNonce, validateCiRouteScope, validateCiSubjectMatch, } from "./namespaces/ci.js";
|
|
181
181
|
export { ScopedRun402 } from "./scoped.js";
|
|
182
182
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAA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|
|
19
19
|
* behavior; this file is the implementation.
|
|
20
20
|
*/
|
|
21
21
|
import type { Client } from "../kernel.js";
|
|
22
|
-
import type { ApplyOptions, ActiveReleaseInventory, DeployEvent, DeployEventsResponse, DeployListResponse, DeployOperation, DeployResult, OperationSnapshot, PlanResponse, ReleaseDiffOptions, ReleaseInventory, ReleaseInventoryByIdOptions, ReleaseInventoryOptions, ReleaseSpec, ReleaseToReleaseDiff, StartOptions } from "./deploy.types.js";
|
|
22
|
+
import type { ApplyOptions, ActiveReleaseInventory, DeployEvent, DeployEventsResponse, DeployListResponse, DeployOperation, DeployResult, DeployResolveOptions, DeployResolveResponse, OperationSnapshot, PlanResponse, ReleaseDiffOptions, ReleaseInventory, ReleaseInventoryByIdOptions, ReleaseInventoryOptions, ReleaseSpec, ReleaseToReleaseDiff, StartOptions } from "./deploy.types.js";
|
|
23
23
|
export declare class Deploy {
|
|
24
24
|
private readonly client;
|
|
25
25
|
constructor(client: Client);
|
|
@@ -147,6 +147,12 @@ export declare class Deploy {
|
|
|
147
147
|
diff(opts: Omit<ReleaseDiffOptions, "project"> & {
|
|
148
148
|
project?: string;
|
|
149
149
|
}): Promise<ReleaseToReleaseDiff>;
|
|
150
|
+
/**
|
|
151
|
+
* Diagnose how a stable public URL or host/path would resolve against the
|
|
152
|
+
* current live release. This is an authenticated read: `project` is used
|
|
153
|
+
* only for local apikey lookup and is not sent to the gateway.
|
|
154
|
+
*/
|
|
155
|
+
resolve(opts: DeployResolveOptions): Promise<DeployResolveResponse>;
|
|
150
156
|
}
|
|
151
157
|
/**
|
|
152
158
|
* A deferred byte reader: returns the bytes when called. The `label` is a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/namespaces/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"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AAO,CAAC,gBAAgB,CAAC;IA8B5B;;;;OAIG;IACG,gBAAgB,CACpB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAgBlC;;;;OAIG;IACG,IAAI,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IACnE;;;;OAIG;IACG,IAAI,CACR,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/D,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAW1E;AAmwBD;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { isCiSessionCredentials } from "../ci-credentials.js";
|
|
22
22
|
import { assertCiDeployableSpec } from "./ci.js";
|
|
23
|
-
import { ROUTE_HTTP_METHODS } from "./deploy.types.js";
|
|
23
|
+
import { ROUTE_HTTP_METHODS, normalizeDeployResolveRequest, } from "./deploy.types.js";
|
|
24
24
|
import { ApiError, LocalError, NetworkError, PaymentRequired, Run402DeployError, Unauthorized, } from "../errors.js";
|
|
25
25
|
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
26
26
|
const PLAN_BODY_LIMIT_BYTES = 5 * 1024 * 1024;
|
|
@@ -262,6 +262,21 @@ export class Deploy {
|
|
|
262
262
|
qs.set("limit", String(opts.limit));
|
|
263
263
|
return this.client.request(`/deploy/v2/releases/diff?${qs.toString()}`, { headers, context: "diffing releases" });
|
|
264
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Diagnose how a stable public URL or host/path would resolve against the
|
|
267
|
+
* current live release. This is an authenticated read: `project` is used
|
|
268
|
+
* only for local apikey lookup and is not sent to the gateway.
|
|
269
|
+
*/
|
|
270
|
+
async resolve(opts) {
|
|
271
|
+
const request = normalizeDeployResolveRequest(opts);
|
|
272
|
+
const headers = await apikeyHeaders(this.client, request.project);
|
|
273
|
+
const qs = new URLSearchParams({ host: request.host });
|
|
274
|
+
if ("url" in opts || opts.path !== undefined)
|
|
275
|
+
qs.set("path", request.path);
|
|
276
|
+
if (request.method)
|
|
277
|
+
qs.set("method", request.method);
|
|
278
|
+
return this.client.request(`/deploy/v2/resolve?${qs.toString()}`, { headers, context: "resolving deploy public URL" });
|
|
279
|
+
}
|
|
265
280
|
}
|
|
266
281
|
function appendQuery(path, params) {
|
|
267
282
|
const qs = new URLSearchParams();
|
|
@@ -406,11 +421,11 @@ async function planInternal(client, spec, idempotencyKey, dryRun = false) {
|
|
|
406
421
|
}
|
|
407
422
|
let plan;
|
|
408
423
|
try {
|
|
409
|
-
plan = normalizePlanResponse(await client.request(dryRun ? "/deploy/v2/plans?dry_run=true" : "/deploy/v2/plans", {
|
|
424
|
+
plan = withClientPlanWarnings(normalized, normalizePlanResponse(await client.request(dryRun ? "/deploy/v2/plans?dry_run=true" : "/deploy/v2/plans", {
|
|
410
425
|
method: "POST",
|
|
411
426
|
body,
|
|
412
427
|
context: "planning deploy",
|
|
413
|
-
}));
|
|
428
|
+
})));
|
|
414
429
|
}
|
|
415
430
|
catch (err) {
|
|
416
431
|
throw translateDeployError(err, "plan", null, null);
|
|
@@ -913,7 +928,8 @@ const SITE_PATCH_FIELDS = new Set(["put", "delete"]);
|
|
|
913
928
|
const SUBDOMAINS_SPEC_FIELDS = new Set(["set", "add", "remove"]);
|
|
914
929
|
const ROUTES_SPEC_FIELDS = new Set(["replace"]);
|
|
915
930
|
const ROUTE_ENTRY_FIELDS = new Set(["pattern", "methods", "target"]);
|
|
916
|
-
const
|
|
931
|
+
const FUNCTION_ROUTE_TARGET_FIELDS = new Set(["type", "name"]);
|
|
932
|
+
const STATIC_ROUTE_TARGET_FIELDS = new Set(["type", "file"]);
|
|
917
933
|
const ROUTE_METHOD_SET = new Set(ROUTE_HTTP_METHODS);
|
|
918
934
|
function validateSpec(spec) {
|
|
919
935
|
if (!spec || typeof spec !== "object") {
|
|
@@ -1079,7 +1095,7 @@ function validateRoutesSpec(routes) {
|
|
|
1079
1095
|
}
|
|
1080
1096
|
validateKnownFields(obj, "routes", ROUTES_SPEC_FIELDS, routeShapeHints(obj));
|
|
1081
1097
|
if (!hasOwn(obj, "replace")) {
|
|
1082
|
-
throw invalidRouteSpec("ReleaseSpec.routes must be null or { replace: [{ pattern, target: { type: \"function\", name } }] }. Path-keyed route maps are not supported.", "routes");
|
|
1098
|
+
throw invalidRouteSpec("ReleaseSpec.routes must be null or { replace: [{ pattern, target: { type: \"function\", name } | { type: \"static\", file } }] }. Path-keyed route maps are not supported.", "routes");
|
|
1083
1099
|
}
|
|
1084
1100
|
if (!Array.isArray(obj.replace)) {
|
|
1085
1101
|
throw invalidRouteSpec("ReleaseSpec.routes.replace must be an array of route entries", "routes.replace");
|
|
@@ -1092,7 +1108,7 @@ function routeShapeHints(obj) {
|
|
|
1092
1108
|
const hints = {};
|
|
1093
1109
|
for (const key of Object.keys(obj)) {
|
|
1094
1110
|
if (key.startsWith("/")) {
|
|
1095
|
-
hints[key] = "Use `routes.replace[]` entries like `{ pattern, target: { type: \"function\", name } }` instead of a path-keyed route map.";
|
|
1111
|
+
hints[key] = "Use `routes.replace[]` entries like `{ pattern, target: { type: \"function\", name } }` or `{ pattern, methods: [\"GET\"], target: { type: \"static\", file } }` instead of a path-keyed route map.";
|
|
1096
1112
|
}
|
|
1097
1113
|
}
|
|
1098
1114
|
return hints;
|
|
@@ -1115,23 +1131,70 @@ function validateRouteEntry(route, resource) {
|
|
|
1115
1131
|
throw invalidRouteSpec(`Unsupported route method ${JSON.stringify(method)} at ReleaseSpec.${resource}.methods. Supported methods: ${ROUTE_HTTP_METHODS.join(", ")}`, `${resource}.methods`);
|
|
1116
1132
|
}
|
|
1117
1133
|
}
|
|
1134
|
+
const seen = new Set();
|
|
1135
|
+
for (const method of entry.methods) {
|
|
1136
|
+
const methodString = method;
|
|
1137
|
+
if (seen.has(methodString)) {
|
|
1138
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.methods contains duplicate method ${JSON.stringify(method)}`, `${resource}.methods`);
|
|
1139
|
+
}
|
|
1140
|
+
seen.add(methodString);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
const targetType = validateRouteTarget(entry.target, `${resource}.target`);
|
|
1144
|
+
if (targetType === "static") {
|
|
1145
|
+
validateStaticRouteEntry(entry, resource);
|
|
1118
1146
|
}
|
|
1119
|
-
validateRouteTarget(entry.target, `${resource}.target`);
|
|
1120
1147
|
}
|
|
1121
1148
|
function validateRouteTarget(target, resource) {
|
|
1122
1149
|
const obj = requireObject(target, resource);
|
|
1123
|
-
if (hasOwn(obj, "function") && !hasOwn(obj, "type")) {
|
|
1124
|
-
throw invalidRouteSpec(`ReleaseSpec.${resource} uses an unsupported target shorthand. Use { type: "function", name: "api" }.`, resource);
|
|
1150
|
+
if ((hasOwn(obj, "function") || hasOwn(obj, "static")) && !hasOwn(obj, "type")) {
|
|
1151
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource} uses an unsupported target shorthand. Use { type: "function", name: "api" } or { type: "static", file: "events.html" }.`, resource);
|
|
1125
1152
|
}
|
|
1126
|
-
validateKnownFields(obj, resource, ROUTE_TARGET_FIELDS);
|
|
1127
1153
|
if (obj.type === undefined) {
|
|
1128
|
-
throw invalidRouteSpec(`ReleaseSpec.${resource}.type is required; use "function"`, `${resource}.type`);
|
|
1154
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.type is required; use "function" or "static"`, `${resource}.type`);
|
|
1129
1155
|
}
|
|
1130
|
-
if (obj.type
|
|
1131
|
-
|
|
1156
|
+
if (obj.type === "function") {
|
|
1157
|
+
validateKnownFields(obj, resource, FUNCTION_ROUTE_TARGET_FIELDS);
|
|
1158
|
+
if (typeof obj.name !== "string" || obj.name.length === 0) {
|
|
1159
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.name is required for function route targets`, `${resource}.name`);
|
|
1160
|
+
}
|
|
1161
|
+
return "function";
|
|
1132
1162
|
}
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
1163
|
+
if (obj.type === "static") {
|
|
1164
|
+
validateKnownFields(obj, resource, STATIC_ROUTE_TARGET_FIELDS);
|
|
1165
|
+
if (typeof obj.file !== "string" || obj.file.length === 0) {
|
|
1166
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.file is required for static route targets`, `${resource}.file`);
|
|
1167
|
+
}
|
|
1168
|
+
validateStaticTargetFile(obj.file, `${resource}.file`);
|
|
1169
|
+
return "static";
|
|
1170
|
+
}
|
|
1171
|
+
throw invalidRouteSpec(`Unsupported route target type ${JSON.stringify(obj.type)} at ReleaseSpec.${resource}.type; route targets support "function" and "static"`, `${resource}.type`);
|
|
1172
|
+
}
|
|
1173
|
+
function validateStaticRouteEntry(entry, resource) {
|
|
1174
|
+
const pattern = entry.pattern;
|
|
1175
|
+
if (pattern.includes("*")) {
|
|
1176
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.pattern uses a static route target, so it must be an exact path pattern (wildcard patterns such as /docs/* are not supported for static targets)`, `${resource}.pattern`);
|
|
1177
|
+
}
|
|
1178
|
+
if (entry.methods === undefined) {
|
|
1179
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.methods is required for static route targets; use ["GET"] or ["GET", "HEAD"]`, `${resource}.methods`);
|
|
1180
|
+
}
|
|
1181
|
+
const methods = entry.methods;
|
|
1182
|
+
const methodSet = new Set(methods);
|
|
1183
|
+
const valid = methodSet.has("GET") &&
|
|
1184
|
+
(methodSet.size === 1 || (methodSet.size === 2 && methodSet.has("HEAD")));
|
|
1185
|
+
if (!valid) {
|
|
1186
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource}.methods for static route targets must be ["GET"] or ["GET", "HEAD"]; either form materializes effective GET plus HEAD`, `${resource}.methods`);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
function validateStaticTargetFile(file, resource) {
|
|
1190
|
+
const invalid = file.startsWith("/") ||
|
|
1191
|
+
file.includes("?") ||
|
|
1192
|
+
file.includes("#") ||
|
|
1193
|
+
file.includes("\\") ||
|
|
1194
|
+
file.endsWith("/") ||
|
|
1195
|
+
file.split("/").some((segment) => segment === "" || segment === "." || segment === "..");
|
|
1196
|
+
if (invalid) {
|
|
1197
|
+
throw invalidRouteSpec(`ReleaseSpec.${resource} must be a relative materialized static-site file path without leading slash, query, fragment, traversal, empty segments, backslashes, or directory shorthand`, resource);
|
|
1135
1198
|
}
|
|
1136
1199
|
}
|
|
1137
1200
|
function validateChecksSpec(checks) {
|
|
@@ -1246,6 +1309,11 @@ function invalidRouteSpec(message, resource) {
|
|
|
1246
1309
|
pattern: "/api/*",
|
|
1247
1310
|
target: { type: "function", name: "api" },
|
|
1248
1311
|
},
|
|
1312
|
+
{
|
|
1313
|
+
pattern: "/events",
|
|
1314
|
+
methods: ["GET", "HEAD"],
|
|
1315
|
+
target: { type: "static", file: "events.html" },
|
|
1316
|
+
},
|
|
1249
1317
|
],
|
|
1250
1318
|
},
|
|
1251
1319
|
},
|
|
@@ -1267,6 +1335,7 @@ function normalizePlanResponse(plan) {
|
|
|
1267
1335
|
secrets: raw.secrets,
|
|
1268
1336
|
subdomains: raw.subdomains,
|
|
1269
1337
|
routes: raw.routes,
|
|
1338
|
+
static_assets: raw.static_assets,
|
|
1270
1339
|
};
|
|
1271
1340
|
return {
|
|
1272
1341
|
...plan,
|
|
@@ -1297,6 +1366,59 @@ function emitPlanWarnings(plan, emit) {
|
|
|
1297
1366
|
emit({ type: "plan.warnings", warnings: plan.warnings });
|
|
1298
1367
|
}
|
|
1299
1368
|
}
|
|
1369
|
+
function withClientPlanWarnings(spec, plan) {
|
|
1370
|
+
const warnings = clientRoutePlanWarnings(spec);
|
|
1371
|
+
if (warnings.length === 0)
|
|
1372
|
+
return plan;
|
|
1373
|
+
const seen = new Set(plan.warnings.map((warning) => warningKey(warning)));
|
|
1374
|
+
const nextWarnings = [...plan.warnings];
|
|
1375
|
+
for (const warning of warnings) {
|
|
1376
|
+
const key = warningKey(warning);
|
|
1377
|
+
if (seen.has(key))
|
|
1378
|
+
continue;
|
|
1379
|
+
seen.add(key);
|
|
1380
|
+
nextWarnings.push(warning);
|
|
1381
|
+
}
|
|
1382
|
+
return { ...plan, warnings: nextWarnings };
|
|
1383
|
+
}
|
|
1384
|
+
function warningKey(warning) {
|
|
1385
|
+
return `${warning.code}:${(warning.affected ?? []).join(",")}`;
|
|
1386
|
+
}
|
|
1387
|
+
function clientRoutePlanWarnings(spec) {
|
|
1388
|
+
const routes = spec.routes;
|
|
1389
|
+
if (!routes || !("replace" in routes))
|
|
1390
|
+
return [];
|
|
1391
|
+
const affected = routes.replace
|
|
1392
|
+
.filter((route) => {
|
|
1393
|
+
if (route.target.type !== "function")
|
|
1394
|
+
return false;
|
|
1395
|
+
if (!route.pattern.endsWith("/*"))
|
|
1396
|
+
return false;
|
|
1397
|
+
if (!route.methods)
|
|
1398
|
+
return false;
|
|
1399
|
+
const methods = new Set(route.methods);
|
|
1400
|
+
return (methods.size > 0 &&
|
|
1401
|
+
[...methods].every((method) => method === "GET" || method === "HEAD"));
|
|
1402
|
+
})
|
|
1403
|
+
.map((route) => route.pattern)
|
|
1404
|
+
.sort();
|
|
1405
|
+
if (affected.length === 0)
|
|
1406
|
+
return [];
|
|
1407
|
+
return [
|
|
1408
|
+
{
|
|
1409
|
+
code: "WILDCARD_ROUTE_EXCLUDES_MUTATION_METHODS",
|
|
1410
|
+
severity: "warn",
|
|
1411
|
+
requires_confirmation: true,
|
|
1412
|
+
message: "A wildcard function route only allows GET/HEAD. Mutation endpoints under that prefix will be rejected by the gateway before the function runs.",
|
|
1413
|
+
affected,
|
|
1414
|
+
confidence: "heuristic",
|
|
1415
|
+
details: {
|
|
1416
|
+
missing_common_methods: ["POST", "PUT", "PATCH", "DELETE"],
|
|
1417
|
+
fix: "Add the mutation methods your routed function supports, or omit methods to allow every supported method.",
|
|
1418
|
+
},
|
|
1419
|
+
},
|
|
1420
|
+
];
|
|
1421
|
+
}
|
|
1300
1422
|
function abortOnConfirmationWarnings(plan, opts) {
|
|
1301
1423
|
if (opts.allowWarnings)
|
|
1302
1424
|
return;
|