sst 2.0.0-rc.9 → 2.0.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/bootstrap.d.ts +2 -4
- package/bootstrap.js +208 -61
- package/bus.d.ts +3 -3
- package/bus.js +1 -1
- package/cache.js +1 -1
- package/cdk/cloudformation-deployments-wrapper.d.ts +3 -0
- package/cdk/cloudformation-deployments-wrapper.js +117 -0
- package/cdk/cloudformation-deployments.d.ts +19 -4
- package/cdk/deploy-stack.d.ts +17 -2
- package/cdk/deploy-stack.js +6 -1
- package/cli/colors.d.ts +28 -0
- package/cli/colors.js +27 -0
- package/cli/commands/bind.d.ts +4 -0
- package/cli/commands/bind.js +10 -7
- package/cli/commands/bootstrap.d.ts +13 -0
- package/cli/commands/bootstrap.js +11 -0
- package/cli/commands/build.d.ts +6 -2
- package/cli/commands/build.js +13 -8
- package/cli/commands/console.d.ts +5 -1
- package/cli/commands/console.js +8 -6
- package/cli/commands/deploy.d.ts +4 -2
- package/cli/commands/deploy.js +69 -29
- package/cli/commands/dev.d.ts +5 -1
- package/cli/commands/dev.js +157 -79
- package/cli/commands/diff.d.ts +15 -0
- package/cli/commands/diff.js +61 -0
- package/cli/commands/env.d.ts +5 -1
- package/cli/commands/env.js +14 -15
- package/cli/commands/plugins/kysely.js +13 -5
- package/cli/commands/plugins/pothos.js +9 -4
- package/cli/commands/remove.d.ts +4 -0
- package/cli/commands/remove.js +26 -18
- package/cli/commands/secrets/get.d.ts +7 -3
- package/cli/commands/secrets/get.js +11 -24
- package/cli/commands/secrets/list.d.ts +6 -2
- package/cli/commands/secrets/list.js +15 -7
- package/cli/commands/secrets/remove.d.ts +8 -4
- package/cli/commands/secrets/remove.js +18 -16
- package/cli/commands/secrets/secrets.js +3 -3
- package/cli/commands/secrets/set.d.ts +8 -6
- package/cli/commands/secrets/set.js +16 -33
- package/cli/commands/telemetry.d.ts +15 -0
- package/cli/commands/telemetry.js +17 -0
- package/cli/commands/transform.d.ts +15 -0
- package/cli/commands/transform.js +55 -0
- package/cli/commands/update.d.ts +6 -2
- package/cli/commands/update.js +41 -33
- package/cli/commands/version.d.ts +13 -0
- package/cli/commands/version.js +7 -0
- package/cli/local/router.d.ts +6 -6
- package/cli/local/router.js +3 -3
- package/cli/local/server.d.ts +5 -3
- package/cli/local/server.js +21 -14
- package/cli/program.d.ts +5 -1
- package/cli/program.js +29 -5
- package/cli/spinner.js +2 -0
- package/cli/sst.js +35 -23
- package/cli/telemetry/environment.d.ts +1 -1
- package/cli/telemetry/environment.js +1 -1
- package/cli/terminal.d.ts +1 -0
- package/cli/terminal.js +8 -0
- package/cli/ui/deploy.d.ts +3 -2
- package/cli/ui/deploy.js +106 -106
- package/cli/ui/functions.d.ts +2 -0
- package/cli/ui/functions.js +132 -0
- package/cli/ui/header.d.ts +5 -0
- package/cli/ui/header.js +16 -0
- package/cli/ui/stack.d.ts +1 -0
- package/cli/ui/stack.js +6 -0
- package/config.d.ts +1 -1
- package/config.js +8 -8
- package/constructs/Api.d.ts +3 -71
- package/constructs/Api.js +3 -42
- package/constructs/ApiGatewayV1Api.d.ts +3 -3
- package/constructs/ApiGatewayV1Api.js +4 -3
- package/constructs/App.d.ts +2 -22
- package/constructs/App.js +12 -25
- package/constructs/AppSyncApi.d.ts +4 -5
- package/constructs/AppSyncApi.js +8 -5
- package/constructs/AstroSite.d.ts +2 -3
- package/constructs/AstroSite.js +43 -53
- package/constructs/Auth.js +27 -16
- package/constructs/BaseSite.d.ts +10 -10
- package/constructs/BaseSite.js +2 -2
- package/constructs/Cognito.js +28 -28
- package/constructs/EdgeFunction.d.ts +6 -4
- package/constructs/EdgeFunction.js +56 -59
- package/constructs/EventBus.js +1 -1
- package/constructs/Function.d.ts +4 -44
- package/constructs/Function.js +14 -50
- package/constructs/FunctionalStack.d.ts +2 -2
- package/constructs/Job.d.ts +23 -63
- package/constructs/Job.js +11 -32
- package/constructs/Metadata.d.ts +18 -20
- package/constructs/NextjsSite.d.ts +21 -5
- package/constructs/NextjsSite.js +67 -101
- package/constructs/Queue.js +10 -10
- package/constructs/RDS.d.ts +1 -1
- package/constructs/RDS.js +1 -1
- package/constructs/RemixSite.d.ts +0 -2
- package/constructs/RemixSite.js +20 -20
- package/constructs/Script.js +1 -1
- package/constructs/Secret.js +5 -3
- package/constructs/SolidStartSite.d.ts +2 -3
- package/constructs/SolidStartSite.js +42 -52
- package/constructs/SsrFunction.d.ts +22 -0
- package/constructs/SsrFunction.js +113 -0
- package/constructs/SsrSite.d.ts +104 -104
- package/constructs/SsrSite.js +196 -217
- package/constructs/Stack.d.ts +1 -20
- package/constructs/Stack.js +3 -65
- package/constructs/StaticSite.d.ts +33 -53
- package/constructs/StaticSite.js +92 -118
- package/constructs/Table.d.ts +1 -1
- package/constructs/Table.js +4 -4
- package/constructs/Topic.js +1 -1
- package/constructs/cdk/certificate-base.d.ts +18 -0
- package/constructs/cdk/certificate-base.js +26 -0
- package/constructs/cdk/dns-validated-certificate.d.ts +77 -0
- package/constructs/cdk/dns-validated-certificate.js +125 -0
- package/constructs/cdk/website-redirect.d.ts +53 -0
- package/constructs/cdk/website-redirect.js +77 -0
- package/constructs/deferred_task.d.ts +1 -1
- package/constructs/deprecated/NextjsSite.js +8 -6
- package/constructs/index.d.ts +0 -6
- package/constructs/index.js +0 -6
- package/constructs/util/apiGatewayV1AccessLog.d.ts +1 -1
- package/constructs/util/apiGatewayV2AccessLog.js +4 -4
- package/constructs/util/apiGatewayV2Domain.js +9 -2
- package/constructs/util/appSyncApiDomain.d.ts +1 -1
- package/constructs/util/appSyncApiDomain.js +9 -15
- package/constructs/util/duration.d.ts +1 -1
- package/constructs/util/functionBinding.js +1 -1
- package/constructs/util/permission.d.ts +3 -3
- package/constructs/util/permission.js +16 -18
- package/constructs/util/size.d.ts +1 -1
- package/constructs/util/warning.js +2 -2
- package/context/context.d.ts +2 -2
- package/context/context.js +4 -4
- package/context/handler.d.ts +1 -1
- package/credentials.d.ts +1 -1
- package/credentials.js +42 -6
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/iot.js +6 -2
- package/logger.js +3 -1
- package/node/api/index.d.ts +2 -3
- package/node/api/index.js +8 -2
- package/node/auth/adapter/adapter.d.ts +1 -1
- package/node/auth/adapter/facebook.js +1 -1
- package/node/auth/adapter/github.js +4 -4
- package/node/auth/adapter/google.d.ts +1 -1
- package/node/auth/adapter/google.js +2 -2
- package/node/auth/adapter/twitch.js +1 -1
- package/node/auth/session.d.ts +1 -1
- package/node/config/index.d.ts +2 -2
- package/node/config/index.js +3 -8
- package/node/job/index.d.ts +2 -2
- package/node/site/index.js +3 -5
- package/package.json +26 -21
- package/pothos.js +1 -0
- package/project.d.ts +47 -0
- package/{app.js → project.js} +60 -53
- package/runtime/handlers/dotnet.d.ts +1 -1
- package/runtime/handlers/dotnet.js +4 -4
- package/runtime/handlers/go.d.ts +1 -1
- package/runtime/handlers/go.js +3 -3
- package/runtime/handlers/java.d.ts +1 -1
- package/runtime/handlers/java.js +4 -4
- package/runtime/handlers/node.d.ts +1 -1
- package/runtime/handlers/node.js +60 -39
- package/runtime/handlers/python.d.ts +1 -1
- package/runtime/handlers/python.js +3 -3
- package/runtime/handlers.js +15 -12
- package/runtime/iot.js +3 -0
- package/runtime/runtime.d.ts +4 -0
- package/runtime/server.d.ts +3 -3
- package/runtime/server.js +11 -5
- package/runtime/workers.d.ts +4 -2
- package/runtime/workers.js +13 -3
- package/site-env.js +2 -1
- package/sst.mjs +6357 -20848
- package/stacks/app-metadata.d.ts +7 -0
- package/stacks/app-metadata.js +78 -0
- package/stacks/assembly.d.ts +1 -0
- package/stacks/assembly.js +4 -0
- package/stacks/build.d.ts +1 -1
- package/stacks/build.js +41 -48
- package/stacks/deploy.d.ts +1 -0
- package/stacks/deploy.js +128 -7
- package/stacks/diff.d.ts +8 -0
- package/stacks/diff.js +62 -0
- package/stacks/index.d.ts +3 -0
- package/stacks/index.js +3 -0
- package/stacks/metadata.d.ts +2 -0
- package/stacks/metadata.js +14 -12
- package/stacks/monitor.d.ts +8 -3
- package/stacks/monitor.js +38 -4
- package/stacks/remove.js +0 -4
- package/stacks/synth.d.ts +1 -0
- package/stacks/synth.js +27 -13
- package/support/base-site-archiver.mjs +1 -1
- package/support/bootstrap-metadata-function/index.mjs +68740 -0
- package/support/bridge/bridge.mjs +28 -28
- package/support/certificate-requestor/index.js +549 -0
- package/support/custom-resources/index.mjs +3824 -26567
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.deps.json +1 -1
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +1 -1
- package/support/edge-function/edge-lambda.mjs +2 -2
- package/support/job-invoker/index.mjs +26 -0
- package/support/nodejs-runtime/index.mjs +75 -72
- package/support/rds-migrator/index.mjs +22 -23
- package/support/remix-site-function/edge-server.js +1 -1
- package/support/script-function/index.mjs +30485 -0
- package/support/{edge-function-code-replacer → sls-nextjs-site-function-code-replacer}/lambda-code-updater.py +0 -0
- package/support/ssr-site-function-archiver.mjs +96 -0
- package/watcher.js +1 -1
- package/app.d.ts +0 -36
- package/constructs/DebugApp.d.ts +0 -49
- package/constructs/DebugApp.js +0 -63
- package/constructs/DebugStack.d.ts +0 -34
- package/constructs/DebugStack.js +0 -132
- package/constructs/GraphQLApi.d.ts +0 -98
- package/constructs/GraphQLApi.js +0 -80
- package/constructs/ReactStaticSite.d.ts +0 -20
- package/constructs/ReactStaticSite.js +0 -54
- package/constructs/Script/cfn-response.d.ts +0 -19
- package/constructs/Script/cfn-response.js +0 -77
- package/constructs/Script/index.d.ts +0 -1
- package/constructs/Script/index.js +0 -78
- package/constructs/Script/outbound.d.ts +0 -10
- package/constructs/Script/outbound.js +0 -42
- package/constructs/Script/util.d.ts +0 -2
- package/constructs/Script/util.js +0 -11
- package/constructs/ViteStaticSite.d.ts +0 -32
- package/constructs/ViteStaticSite.js +0 -66
- package/support/astro-site-html-stub/index.html +0 -99
- package/support/base-site-archiver.cjs +0 -116
- package/support/nextjs-site-html-stub/index.html +0 -99
- package/support/remix-site-html-stub/index.html +0 -99
- package/support/solid-start-site-html-stub/index.html +0 -99
- package/support/static-site-stub/index.html +0 -90
|
@@ -317,61 +317,61 @@ var require_util = __commonJS({
|
|
|
317
317
|
function isBlobLike(object) {
|
|
318
318
|
return Blob && object instanceof Blob || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);
|
|
319
319
|
}
|
|
320
|
-
function buildURL(
|
|
321
|
-
if (
|
|
320
|
+
function buildURL(url2, queryParams) {
|
|
321
|
+
if (url2.includes("?") || url2.includes("#")) {
|
|
322
322
|
throw new Error('Query params cannot be passed when url already contains "?" or "#".');
|
|
323
323
|
}
|
|
324
324
|
const stringified = stringify(queryParams);
|
|
325
325
|
if (stringified) {
|
|
326
|
-
|
|
326
|
+
url2 += "?" + stringified;
|
|
327
327
|
}
|
|
328
|
-
return
|
|
328
|
+
return url2;
|
|
329
329
|
}
|
|
330
|
-
function parseURL(
|
|
331
|
-
if (typeof
|
|
332
|
-
|
|
330
|
+
function parseURL(url2) {
|
|
331
|
+
if (typeof url2 === "string") {
|
|
332
|
+
url2 = new URL(url2);
|
|
333
333
|
}
|
|
334
|
-
if (!
|
|
334
|
+
if (!url2 || typeof url2 !== "object") {
|
|
335
335
|
throw new InvalidArgumentError("invalid url");
|
|
336
336
|
}
|
|
337
|
-
if (
|
|
337
|
+
if (url2.port != null && url2.port !== "" && !Number.isFinite(parseInt(url2.port))) {
|
|
338
338
|
throw new InvalidArgumentError("invalid port");
|
|
339
339
|
}
|
|
340
|
-
if (
|
|
340
|
+
if (url2.path != null && typeof url2.path !== "string") {
|
|
341
341
|
throw new InvalidArgumentError("invalid path");
|
|
342
342
|
}
|
|
343
|
-
if (
|
|
343
|
+
if (url2.pathname != null && typeof url2.pathname !== "string") {
|
|
344
344
|
throw new InvalidArgumentError("invalid pathname");
|
|
345
345
|
}
|
|
346
|
-
if (
|
|
346
|
+
if (url2.hostname != null && typeof url2.hostname !== "string") {
|
|
347
347
|
throw new InvalidArgumentError("invalid hostname");
|
|
348
348
|
}
|
|
349
|
-
if (
|
|
349
|
+
if (url2.origin != null && typeof url2.origin !== "string") {
|
|
350
350
|
throw new InvalidArgumentError("invalid origin");
|
|
351
351
|
}
|
|
352
|
-
if (!/^https?:/.test(
|
|
352
|
+
if (!/^https?:/.test(url2.origin || url2.protocol)) {
|
|
353
353
|
throw new InvalidArgumentError("invalid protocol");
|
|
354
354
|
}
|
|
355
|
-
if (!(
|
|
356
|
-
const port =
|
|
357
|
-
let origin =
|
|
358
|
-
let path2 =
|
|
355
|
+
if (!(url2 instanceof URL)) {
|
|
356
|
+
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
357
|
+
let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`;
|
|
358
|
+
let path2 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
359
359
|
if (origin.endsWith("/")) {
|
|
360
360
|
origin = origin.substring(0, origin.length - 1);
|
|
361
361
|
}
|
|
362
362
|
if (path2 && !path2.startsWith("/")) {
|
|
363
363
|
path2 = `/${path2}`;
|
|
364
364
|
}
|
|
365
|
-
|
|
365
|
+
url2 = new URL(origin + path2);
|
|
366
366
|
}
|
|
367
|
-
return
|
|
367
|
+
return url2;
|
|
368
368
|
}
|
|
369
|
-
function parseOrigin(
|
|
370
|
-
|
|
371
|
-
if (
|
|
369
|
+
function parseOrigin(url2) {
|
|
370
|
+
url2 = parseURL(url2);
|
|
371
|
+
if (url2.pathname !== "/" || url2.search || url2.hash) {
|
|
372
372
|
throw new InvalidArgumentError("invalid url");
|
|
373
373
|
}
|
|
374
|
-
return
|
|
374
|
+
return url2;
|
|
375
375
|
}
|
|
376
376
|
function getHostname(host) {
|
|
377
377
|
if (host[0] === "[") {
|
|
@@ -4532,8 +4532,8 @@ var require_util2 = __commonJS({
|
|
|
4532
4532
|
return request.urlList[request.urlList.length - 1];
|
|
4533
4533
|
}
|
|
4534
4534
|
function requestBadPort(request) {
|
|
4535
|
-
const
|
|
4536
|
-
if (/^https?:/.test(
|
|
4535
|
+
const url2 = requestCurrentURL(request);
|
|
4536
|
+
if (/^https?:/.test(url2.protocol) && badPorts.includes(url2.port)) {
|
|
4537
4537
|
return "blocked";
|
|
4538
4538
|
}
|
|
4539
4539
|
return "allowed";
|
|
@@ -4709,26 +4709,26 @@ var require_util2 = __commonJS({
|
|
|
4709
4709
|
default:
|
|
4710
4710
|
return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;
|
|
4711
4711
|
}
|
|
4712
|
-
function stripURLForReferrer(
|
|
4713
|
-
const urlObject = new URL(
|
|
4712
|
+
function stripURLForReferrer(url2, originOnly = false) {
|
|
4713
|
+
const urlObject = new URL(url2.href);
|
|
4714
4714
|
urlObject.username = "";
|
|
4715
4715
|
urlObject.password = "";
|
|
4716
4716
|
urlObject.hash = "";
|
|
4717
4717
|
return originOnly ? urlObject.origin : urlObject.href;
|
|
4718
4718
|
}
|
|
4719
4719
|
}
|
|
4720
|
-
function isURLPotentiallyTrustworthy(
|
|
4721
|
-
if (!(
|
|
4720
|
+
function isURLPotentiallyTrustworthy(url2) {
|
|
4721
|
+
if (!(url2 instanceof URL)) {
|
|
4722
4722
|
return false;
|
|
4723
4723
|
}
|
|
4724
|
-
if (
|
|
4724
|
+
if (url2.href === "about:blank" || url2.href === "about:srcdoc") {
|
|
4725
4725
|
return true;
|
|
4726
4726
|
}
|
|
4727
|
-
if (
|
|
4727
|
+
if (url2.protocol === "data:")
|
|
4728
4728
|
return true;
|
|
4729
|
-
if (
|
|
4729
|
+
if (url2.protocol === "file:")
|
|
4730
4730
|
return true;
|
|
4731
|
-
return isOriginPotentiallyTrustworthy(
|
|
4731
|
+
return isOriginPotentiallyTrustworthy(url2.origin);
|
|
4732
4732
|
function isOriginPotentiallyTrustworthy(origin) {
|
|
4733
4733
|
if (origin == null || origin === "null")
|
|
4734
4734
|
return false;
|
|
@@ -5353,31 +5353,31 @@ var require_dataURL = __commonJS({
|
|
|
5353
5353
|
}
|
|
5354
5354
|
return { mimeType: mimeTypeRecord, body };
|
|
5355
5355
|
}
|
|
5356
|
-
function URLSerializer(
|
|
5357
|
-
let output =
|
|
5358
|
-
if (
|
|
5356
|
+
function URLSerializer(url2, excludeFragment = false) {
|
|
5357
|
+
let output = url2.protocol;
|
|
5358
|
+
if (url2.host.length > 0) {
|
|
5359
5359
|
output += "//";
|
|
5360
|
-
if (
|
|
5361
|
-
output +=
|
|
5362
|
-
if (
|
|
5363
|
-
output += ":" +
|
|
5360
|
+
if (url2.username.length > 0 || url2.password.length > 0) {
|
|
5361
|
+
output += url2.username;
|
|
5362
|
+
if (url2.password.length > 0) {
|
|
5363
|
+
output += ":" + url2.password;
|
|
5364
5364
|
}
|
|
5365
5365
|
output += "@";
|
|
5366
5366
|
}
|
|
5367
|
-
output += decodeURIComponent(
|
|
5368
|
-
if (
|
|
5369
|
-
output += ":" +
|
|
5367
|
+
output += decodeURIComponent(url2.hostname);
|
|
5368
|
+
if (url2.port.length > 0) {
|
|
5369
|
+
output += ":" + url2.port;
|
|
5370
5370
|
}
|
|
5371
5371
|
}
|
|
5372
|
-
if (
|
|
5372
|
+
if (url2.host.length === 0 && url2.pathname.length > 1 && url2.href.slice(url2.protocol.length + 1)[0] === ".") {
|
|
5373
5373
|
output += "/.";
|
|
5374
5374
|
}
|
|
5375
|
-
output +=
|
|
5376
|
-
if (
|
|
5377
|
-
output +=
|
|
5375
|
+
output += url2.pathname;
|
|
5376
|
+
if (url2.search.length > 0) {
|
|
5377
|
+
output += url2.search;
|
|
5378
5378
|
}
|
|
5379
|
-
if (excludeFragment === false &&
|
|
5380
|
-
output +=
|
|
5379
|
+
if (excludeFragment === false && url2.hash.length > 0) {
|
|
5380
|
+
output += url2.hash;
|
|
5381
5381
|
}
|
|
5382
5382
|
return output;
|
|
5383
5383
|
}
|
|
@@ -7489,7 +7489,7 @@ var require_client = __commonJS({
|
|
|
7489
7489
|
channels.connected = { hasSubscribers: false };
|
|
7490
7490
|
}
|
|
7491
7491
|
var Client = class extends DispatcherBase {
|
|
7492
|
-
constructor(
|
|
7492
|
+
constructor(url2, {
|
|
7493
7493
|
interceptors,
|
|
7494
7494
|
maxHeaderSize,
|
|
7495
7495
|
headersTimeout,
|
|
@@ -7579,7 +7579,7 @@ var require_client = __commonJS({
|
|
|
7579
7579
|
});
|
|
7580
7580
|
}
|
|
7581
7581
|
this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })];
|
|
7582
|
-
this[kUrl] = util.parseOrigin(
|
|
7582
|
+
this[kUrl] = util.parseOrigin(url2);
|
|
7583
7583
|
this[kConnector] = connect2;
|
|
7584
7584
|
this[kSocket] = null;
|
|
7585
7585
|
this[kPipelining] = pipelining != null ? pipelining : 1;
|
|
@@ -10594,10 +10594,10 @@ var require_mock_utils = __commonJS({
|
|
|
10594
10594
|
};
|
|
10595
10595
|
}
|
|
10596
10596
|
function checkNetConnect(netConnect, origin) {
|
|
10597
|
-
const
|
|
10597
|
+
const url2 = new URL(origin);
|
|
10598
10598
|
if (netConnect === true) {
|
|
10599
10599
|
return true;
|
|
10600
|
-
} else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher,
|
|
10600
|
+
} else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url2.host))) {
|
|
10601
10601
|
return true;
|
|
10602
10602
|
}
|
|
10603
10603
|
return false;
|
|
@@ -11711,20 +11711,20 @@ var require_response = __commonJS({
|
|
|
11711
11711
|
initializeResponse(responseObject, init, { body: body[0], type: "application/json" });
|
|
11712
11712
|
return responseObject;
|
|
11713
11713
|
}
|
|
11714
|
-
static redirect(
|
|
11714
|
+
static redirect(url2, status = 302) {
|
|
11715
11715
|
const relevantRealm = { settingsObject: {} };
|
|
11716
11716
|
if (arguments.length < 1) {
|
|
11717
11717
|
throw new TypeError(
|
|
11718
11718
|
`Failed to execute 'redirect' on 'Response': 1 argument required, but only ${arguments.length} present.`
|
|
11719
11719
|
);
|
|
11720
11720
|
}
|
|
11721
|
-
|
|
11721
|
+
url2 = webidl.converters.USVString(url2);
|
|
11722
11722
|
status = webidl.converters["unsigned short"](status);
|
|
11723
11723
|
let parsedURL;
|
|
11724
11724
|
try {
|
|
11725
|
-
parsedURL = new URL(
|
|
11725
|
+
parsedURL = new URL(url2, getGlobalOrigin());
|
|
11726
11726
|
} catch (err) {
|
|
11727
|
-
throw Object.assign(new TypeError("Failed to parse URL from " +
|
|
11727
|
+
throw Object.assign(new TypeError("Failed to parse URL from " + url2), {
|
|
11728
11728
|
cause: err
|
|
11729
11729
|
});
|
|
11730
11730
|
}
|
|
@@ -11772,11 +11772,11 @@ var require_response = __commonJS({
|
|
|
11772
11772
|
throw new TypeError("Illegal invocation");
|
|
11773
11773
|
}
|
|
11774
11774
|
const urlList = this[kState].urlList;
|
|
11775
|
-
const
|
|
11776
|
-
if (
|
|
11775
|
+
const url2 = urlList[urlList.length - 1] ?? null;
|
|
11776
|
+
if (url2 === null) {
|
|
11777
11777
|
return "";
|
|
11778
11778
|
}
|
|
11779
|
-
return URLSerializer(
|
|
11779
|
+
return URLSerializer(url2, true);
|
|
11780
11780
|
}
|
|
11781
11781
|
get redirected() {
|
|
11782
11782
|
if (!(this instanceof Response)) {
|
|
@@ -13548,11 +13548,11 @@ var require_fetch = __commonJS({
|
|
|
13548
13548
|
}
|
|
13549
13549
|
return response;
|
|
13550
13550
|
async function dispatch({ body }) {
|
|
13551
|
-
const
|
|
13551
|
+
const url2 = requestCurrentURL(request);
|
|
13552
13552
|
return new Promise((resolve, reject) => fetchParams.controller.dispatcher.dispatch(
|
|
13553
13553
|
{
|
|
13554
|
-
path:
|
|
13555
|
-
origin:
|
|
13554
|
+
path: url2.pathname + url2.search,
|
|
13555
|
+
origin: url2.origin,
|
|
13556
13556
|
method: request.method,
|
|
13557
13557
|
body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body,
|
|
13558
13558
|
headers: [...request.headersList].flat(),
|
|
@@ -14516,12 +14516,12 @@ var require_undici = __commonJS({
|
|
|
14516
14516
|
module.exports.buildConnector = buildConnector;
|
|
14517
14517
|
module.exports.errors = errors;
|
|
14518
14518
|
function makeDispatcher(fn) {
|
|
14519
|
-
return (
|
|
14519
|
+
return (url2, opts, handler) => {
|
|
14520
14520
|
if (typeof opts === "function") {
|
|
14521
14521
|
handler = opts;
|
|
14522
14522
|
opts = null;
|
|
14523
14523
|
}
|
|
14524
|
-
if (!
|
|
14524
|
+
if (!url2 || typeof url2 !== "string" && typeof url2 !== "object" && !(url2 instanceof URL)) {
|
|
14525
14525
|
throw new InvalidArgumentError("invalid url");
|
|
14526
14526
|
}
|
|
14527
14527
|
if (opts != null && typeof opts !== "object") {
|
|
@@ -14535,12 +14535,12 @@ var require_undici = __commonJS({
|
|
|
14535
14535
|
if (!opts.path.startsWith("/")) {
|
|
14536
14536
|
path2 = `/${path2}`;
|
|
14537
14537
|
}
|
|
14538
|
-
|
|
14538
|
+
url2 = new URL(util.parseOrigin(url2).origin + path2);
|
|
14539
14539
|
} else {
|
|
14540
14540
|
if (!opts) {
|
|
14541
|
-
opts = typeof
|
|
14541
|
+
opts = typeof url2 === "object" ? url2 : {};
|
|
14542
14542
|
}
|
|
14543
|
-
|
|
14543
|
+
url2 = util.parseURL(url2);
|
|
14544
14544
|
}
|
|
14545
14545
|
const { agent, dispatcher = getGlobalDispatcher() } = opts;
|
|
14546
14546
|
if (agent) {
|
|
@@ -14548,8 +14548,8 @@ var require_undici = __commonJS({
|
|
|
14548
14548
|
}
|
|
14549
14549
|
return fn.call(dispatcher, {
|
|
14550
14550
|
...opts,
|
|
14551
|
-
origin:
|
|
14552
|
-
path:
|
|
14551
|
+
origin: url2.origin,
|
|
14552
|
+
path: url2.search ? `${url2.pathname}${url2.search}` : url2.pathname,
|
|
14553
14553
|
method: opts.method || (opts.body ? "PUT" : "GET")
|
|
14554
14554
|
}, handler);
|
|
14555
14555
|
};
|
|
@@ -14596,6 +14596,7 @@ var import_undici = __toESM(require_undici(), 1);
|
|
|
14596
14596
|
import { workerData } from "node:worker_threads";
|
|
14597
14597
|
import path from "path";
|
|
14598
14598
|
import fs from "fs";
|
|
14599
|
+
import url from "url";
|
|
14599
14600
|
var input = workerData;
|
|
14600
14601
|
var parsed = path.parse(input.handler);
|
|
14601
14602
|
var file = [".js", ".jsx", ".mjs", ".cjs"].map((ext) => path.join(input.out, parsed.dir, parsed.name + ext)).find((file2) => {
|
|
@@ -14603,7 +14604,8 @@ var file = [".js", ".jsx", ".mjs", ".cjs"].map((ext) => path.join(input.out, par
|
|
|
14603
14604
|
});
|
|
14604
14605
|
var mod;
|
|
14605
14606
|
try {
|
|
14606
|
-
|
|
14607
|
+
const { href } = url.pathToFileURL(file);
|
|
14608
|
+
mod = await import(href);
|
|
14607
14609
|
} catch (ex) {
|
|
14608
14610
|
await (0, import_undici.fetch)(`${input.url}/runtime/init/error`, {
|
|
14609
14611
|
method: "POST",
|
|
@@ -14616,6 +14618,7 @@ try {
|
|
|
14616
14618
|
trace: ex.stack?.split("\n")
|
|
14617
14619
|
})
|
|
14618
14620
|
});
|
|
14621
|
+
process.exit(1);
|
|
14619
14622
|
}
|
|
14620
14623
|
var timeout;
|
|
14621
14624
|
while (true) {
|