@cloudflare/vite-plugin 1.39.1 → 1.39.2
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/bin/cf-vite +2 -0
- package/dist/cf-vite.mjs +113 -0
- package/dist/index.mjs +547 -289
- package/dist/index.mjs.map +1 -1
- package/dist/{package-CtWVkw4A.mjs → package-CKVuH4BM.mjs} +4 -3
- package/dist/package-CKVuH4BM.mjs.map +1 -0
- package/package.json +17 -13
- package/dist/package-CtWVkw4A.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import assert from "node:assert";
|
|
|
3
3
|
import { CoreHeaders, CorePaths, Log, LogLevel, Miniflare, Request as Request$1, Response as Response$1, buildPublicUrl, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
|
|
4
4
|
import * as wrangler from "wrangler";
|
|
5
5
|
import * as nodePath from "node:path";
|
|
6
|
-
import
|
|
6
|
+
import path, { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
7
7
|
import * as util$1 from "node:util";
|
|
8
8
|
import { format, inspect, promisify } from "node:util";
|
|
9
9
|
import * as vite from "vite";
|
|
@@ -15,7 +15,7 @@ import os, { arch } from "node:os";
|
|
|
15
15
|
import childProcess, { execFile, execFileSync, spawn } from "node:child_process";
|
|
16
16
|
import net from "node:net";
|
|
17
17
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
18
|
-
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
18
|
+
import { URL as URL$1, URLSearchParams as URLSearchParams$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
19
19
|
import * as fsp from "node:fs/promises";
|
|
20
20
|
import fs, { constants as constants$1 } from "node:fs/promises";
|
|
21
21
|
import * as timersPromises from "node:timers/promises";
|
|
@@ -1504,7 +1504,7 @@ async function assertWranglerVersion() {
|
|
|
1504
1504
|
* The default compatibility date to use when the user omits one.
|
|
1505
1505
|
* This value is injected at build time and remains fixed for each release.
|
|
1506
1506
|
*/
|
|
1507
|
-
const DEFAULT_COMPAT_DATE = "2026-06-
|
|
1507
|
+
const DEFAULT_COMPAT_DATE = "2026-06-02";
|
|
1508
1508
|
|
|
1509
1509
|
//#endregion
|
|
1510
1510
|
//#region ../../node_modules/.pnpm/@remix-run+node-fetch-server@0.8.0/node_modules/@remix-run/node-fetch-server/dist/node-fetch-server.js
|
|
@@ -3959,7 +3959,7 @@ function resolveWranglerConfigPath({ config, script }, options) {
|
|
|
3959
3959
|
deployConfigPath: void 0,
|
|
3960
3960
|
redirected: false
|
|
3961
3961
|
};
|
|
3962
|
-
return findWranglerConfig$1(script !== void 0 ?
|
|
3962
|
+
return findWranglerConfig$1(script !== void 0 ? path.dirname(script) : process.cwd(), options);
|
|
3963
3963
|
}
|
|
3964
3964
|
__name(resolveWranglerConfigPath, "resolveWranglerConfigPath");
|
|
3965
3965
|
function findWranglerConfig$1(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
|
|
@@ -3990,15 +3990,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
3990
3990
|
const deployConfigFile = readFileSync$1(deployConfigPath);
|
|
3991
3991
|
try {
|
|
3992
3992
|
const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
|
|
3993
|
-
redirectedConfigPath = deployConfig.configPath &&
|
|
3993
|
+
redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
|
|
3994
3994
|
} catch (e) {
|
|
3995
|
-
throw new UserError(`Failed to parse the deploy configuration file at ${
|
|
3995
|
+
throw new UserError(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
|
|
3996
3996
|
cause: e,
|
|
3997
3997
|
telemetryMessage: false
|
|
3998
3998
|
});
|
|
3999
3999
|
}
|
|
4000
4000
|
if (!redirectedConfigPath) throw new UserError(esm_default`
|
|
4001
|
-
A deploy configuration file was found at "${
|
|
4001
|
+
A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
|
|
4002
4002
|
But this is not valid - the required "configPath" property was not found.
|
|
4003
4003
|
Instead this file contains:
|
|
4004
4004
|
\`\`\`
|
|
@@ -4006,13 +4006,13 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
4006
4006
|
\`\`\`
|
|
4007
4007
|
`, { telemetryMessage: false });
|
|
4008
4008
|
if (!existsSync(redirectedConfigPath)) throw new UserError(esm_default`
|
|
4009
|
-
There is a deploy configuration at "${
|
|
4010
|
-
But the redirected configuration path it points to, "${
|
|
4009
|
+
There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
|
|
4010
|
+
But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
|
|
4011
4011
|
`, { telemetryMessage: false });
|
|
4012
4012
|
if (userConfigPath) {
|
|
4013
|
-
if (
|
|
4014
|
-
Found both a user configuration file at "${
|
|
4015
|
-
and a deploy configuration file at "${
|
|
4013
|
+
if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError(esm_default`
|
|
4014
|
+
Found both a user configuration file at "${path.relative(".", userConfigPath)}"
|
|
4015
|
+
and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
|
|
4016
4016
|
But these do not share the same base path so it is not clear which should be used.
|
|
4017
4017
|
`, { telemetryMessage: false });
|
|
4018
4018
|
}
|
|
@@ -5228,10 +5228,10 @@ var require_util$5 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
5228
5228
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5229
5229
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
5230
5230
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
5231
|
-
let path = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
5231
|
+
let path$1 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
5232
5232
|
if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1);
|
|
5233
|
-
if (path && path[0] !== "/") path = `/${path}`;
|
|
5234
|
-
return new URL(`${origin}${path}`);
|
|
5233
|
+
if (path$1 && path$1[0] !== "/") path$1 = `/${path$1}`;
|
|
5234
|
+
return new URL(`${origin}${path$1}`);
|
|
5235
5235
|
}
|
|
5236
5236
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5237
5237
|
return url;
|
|
@@ -6106,8 +6106,8 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
6106
6106
|
debugLog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$2, error.message);
|
|
6107
6107
|
});
|
|
6108
6108
|
diagnosticsChannel$1.subscribe("undici:client:sendHeaders", (evt) => {
|
|
6109
|
-
const { request: { method, path, origin } } = evt;
|
|
6110
|
-
debugLog("sending request to %s %s%s", method, origin, path);
|
|
6109
|
+
const { request: { method, path: path$1, origin } } = evt;
|
|
6110
|
+
debugLog("sending request to %s %s%s", method, origin, path$1);
|
|
6111
6111
|
});
|
|
6112
6112
|
}
|
|
6113
6113
|
let isTrackingRequestEvents = false;
|
|
@@ -6119,16 +6119,16 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
6119
6119
|
}
|
|
6120
6120
|
isTrackingRequestEvents = true;
|
|
6121
6121
|
diagnosticsChannel$1.subscribe("undici:request:headers", (evt) => {
|
|
6122
|
-
const { request: { method, path, origin }, response: { statusCode } } = evt;
|
|
6123
|
-
debugLog("received response to %s %s%s - HTTP %d", method, origin, path, statusCode);
|
|
6122
|
+
const { request: { method, path: path$1, origin }, response: { statusCode } } = evt;
|
|
6123
|
+
debugLog("received response to %s %s%s - HTTP %d", method, origin, path$1, statusCode);
|
|
6124
6124
|
});
|
|
6125
6125
|
diagnosticsChannel$1.subscribe("undici:request:trailers", (evt) => {
|
|
6126
|
-
const { request: { method, path, origin } } = evt;
|
|
6127
|
-
debugLog("trailers received from %s %s%s", method, origin, path);
|
|
6126
|
+
const { request: { method, path: path$1, origin } } = evt;
|
|
6127
|
+
debugLog("trailers received from %s %s%s", method, origin, path$1);
|
|
6128
6128
|
});
|
|
6129
6129
|
diagnosticsChannel$1.subscribe("undici:request:error", (evt) => {
|
|
6130
|
-
const { request: { method, path, origin }, error } = evt;
|
|
6131
|
-
debugLog("request to %s %s%s errored - %s", method, origin, path, error.message);
|
|
6130
|
+
const { request: { method, path: path$1, origin }, error } = evt;
|
|
6131
|
+
debugLog("request to %s %s%s errored - %s", method, origin, path$1, error.message);
|
|
6132
6132
|
});
|
|
6133
6133
|
}
|
|
6134
6134
|
let isTrackingWebSocketEvents = false;
|
|
@@ -6181,10 +6181,10 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
6181
6181
|
const invalidPathRegex = /[^\u0021-\u00ff]/;
|
|
6182
6182
|
const kHandler = Symbol("handler");
|
|
6183
6183
|
var Request$6 = class {
|
|
6184
|
-
constructor(origin, { path, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
|
|
6185
|
-
if (typeof path !== "string") throw new InvalidArgumentError$35("path must be a string");
|
|
6186
|
-
else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$35("path must be an absolute URL or start with a slash");
|
|
6187
|
-
else if (invalidPathRegex.test(path)) throw new InvalidArgumentError$35("invalid request path");
|
|
6184
|
+
constructor(origin, { path: path$1, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
|
|
6185
|
+
if (typeof path$1 !== "string") throw new InvalidArgumentError$35("path must be a string");
|
|
6186
|
+
else if (path$1[0] !== "/" && !(path$1.startsWith("http://") || path$1.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$35("path must be an absolute URL or start with a slash");
|
|
6187
|
+
else if (invalidPathRegex.test(path$1)) throw new InvalidArgumentError$35("invalid request path");
|
|
6188
6188
|
if (typeof method !== "string") throw new InvalidArgumentError$35("method must be a string");
|
|
6189
6189
|
else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$2(method)) throw new InvalidArgumentError$35("invalid request method");
|
|
6190
6190
|
if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$35("upgrade must be a string");
|
|
@@ -6225,7 +6225,7 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
6225
6225
|
this.completed = false;
|
|
6226
6226
|
this.aborted = false;
|
|
6227
6227
|
this.upgrade = upgrade$1 || null;
|
|
6228
|
-
this.path = query ? serializePathWithQuery$3(path, query) : path;
|
|
6228
|
+
this.path = query ? serializePathWithQuery$3(path$1, query) : path$1;
|
|
6229
6229
|
this.origin = origin;
|
|
6230
6230
|
this.protocol = getProtocolFromUrlString(origin);
|
|
6231
6231
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -9469,7 +9469,7 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
9469
9469
|
const { kEnumerableProperty: kEnumerableProperty$10 } = require_util$5();
|
|
9470
9470
|
const { webidl: webidl$14 } = require_webidl();
|
|
9471
9471
|
const nodeUtil$2 = __require$2("node:util");
|
|
9472
|
-
var FormData$
|
|
9472
|
+
var FormData$3 = class FormData$3 {
|
|
9473
9473
|
#state = [];
|
|
9474
9474
|
constructor(form = void 0) {
|
|
9475
9475
|
webidl$14.util.markAsUncloneable(this);
|
|
@@ -9480,7 +9480,7 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
9480
9480
|
});
|
|
9481
9481
|
}
|
|
9482
9482
|
append(name, value, filename = void 0) {
|
|
9483
|
-
webidl$14.brandCheck(this, FormData$
|
|
9483
|
+
webidl$14.brandCheck(this, FormData$3);
|
|
9484
9484
|
const prefix = "FormData.append";
|
|
9485
9485
|
webidl$14.argumentLengthCheck(arguments, 2, prefix);
|
|
9486
9486
|
name = webidl$14.converters.USVString(name);
|
|
@@ -9492,13 +9492,13 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
9492
9492
|
this.#state.push(entry);
|
|
9493
9493
|
}
|
|
9494
9494
|
delete(name) {
|
|
9495
|
-
webidl$14.brandCheck(this, FormData$
|
|
9495
|
+
webidl$14.brandCheck(this, FormData$3);
|
|
9496
9496
|
webidl$14.argumentLengthCheck(arguments, 1, "FormData.delete");
|
|
9497
9497
|
name = webidl$14.converters.USVString(name);
|
|
9498
9498
|
this.#state = this.#state.filter((entry) => entry.name !== name);
|
|
9499
9499
|
}
|
|
9500
9500
|
get(name) {
|
|
9501
|
-
webidl$14.brandCheck(this, FormData$
|
|
9501
|
+
webidl$14.brandCheck(this, FormData$3);
|
|
9502
9502
|
webidl$14.argumentLengthCheck(arguments, 1, "FormData.get");
|
|
9503
9503
|
name = webidl$14.converters.USVString(name);
|
|
9504
9504
|
const idx = this.#state.findIndex((entry) => entry.name === name);
|
|
@@ -9506,19 +9506,19 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
9506
9506
|
return this.#state[idx].value;
|
|
9507
9507
|
}
|
|
9508
9508
|
getAll(name) {
|
|
9509
|
-
webidl$14.brandCheck(this, FormData$
|
|
9509
|
+
webidl$14.brandCheck(this, FormData$3);
|
|
9510
9510
|
webidl$14.argumentLengthCheck(arguments, 1, "FormData.getAll");
|
|
9511
9511
|
name = webidl$14.converters.USVString(name);
|
|
9512
9512
|
return this.#state.filter((entry) => entry.name === name).map((entry) => entry.value);
|
|
9513
9513
|
}
|
|
9514
9514
|
has(name) {
|
|
9515
|
-
webidl$14.brandCheck(this, FormData$
|
|
9515
|
+
webidl$14.brandCheck(this, FormData$3);
|
|
9516
9516
|
webidl$14.argumentLengthCheck(arguments, 1, "FormData.has");
|
|
9517
9517
|
name = webidl$14.converters.USVString(name);
|
|
9518
9518
|
return this.#state.findIndex((entry) => entry.name === name) !== -1;
|
|
9519
9519
|
}
|
|
9520
9520
|
set(name, value, filename = void 0) {
|
|
9521
|
-
webidl$14.brandCheck(this, FormData$
|
|
9521
|
+
webidl$14.brandCheck(this, FormData$3);
|
|
9522
9522
|
const prefix = "FormData.set";
|
|
9523
9523
|
webidl$14.argumentLengthCheck(arguments, 2, prefix);
|
|
9524
9524
|
name = webidl$14.converters.USVString(name);
|
|
@@ -9561,11 +9561,11 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
9561
9561
|
formData.#state = newState;
|
|
9562
9562
|
}
|
|
9563
9563
|
};
|
|
9564
|
-
const { getFormDataState, setFormDataState: setFormDataState$1 } = FormData$
|
|
9565
|
-
Reflect.deleteProperty(FormData$
|
|
9566
|
-
Reflect.deleteProperty(FormData$
|
|
9567
|
-
iteratorMixin$1("FormData", FormData$
|
|
9568
|
-
Object.defineProperties(FormData$
|
|
9564
|
+
const { getFormDataState, setFormDataState: setFormDataState$1 } = FormData$3;
|
|
9565
|
+
Reflect.deleteProperty(FormData$3, "getFormDataState");
|
|
9566
|
+
Reflect.deleteProperty(FormData$3, "setFormDataState");
|
|
9567
|
+
iteratorMixin$1("FormData", FormData$3, getFormDataState, "name", "value");
|
|
9568
|
+
Object.defineProperties(FormData$3.prototype, {
|
|
9569
9569
|
append: kEnumerableProperty$10,
|
|
9570
9570
|
delete: kEnumerableProperty$10,
|
|
9571
9571
|
get: kEnumerableProperty$10,
|
|
@@ -9601,9 +9601,9 @@ var require_formdata = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
9601
9601
|
value
|
|
9602
9602
|
};
|
|
9603
9603
|
}
|
|
9604
|
-
webidl$14.is.FormData = webidl$14.util.MakeTypeAssertion(FormData$
|
|
9604
|
+
webidl$14.is.FormData = webidl$14.util.MakeTypeAssertion(FormData$3);
|
|
9605
9605
|
module.exports = {
|
|
9606
|
-
FormData: FormData$
|
|
9606
|
+
FormData: FormData$3,
|
|
9607
9607
|
makeEntry: makeEntry$1,
|
|
9608
9608
|
setFormDataState: setFormDataState$1
|
|
9609
9609
|
};
|
|
@@ -9883,7 +9883,7 @@ var require_promise = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
9883
9883
|
var require_body = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/body.js": ((exports, module) => {
|
|
9884
9884
|
const util$24 = require_util$5();
|
|
9885
9885
|
const { ReadableStreamFrom: ReadableStreamFrom$1, readableStreamClose: readableStreamClose$1, fullyReadBody: fullyReadBody$1, extractMimeType: extractMimeType$1 } = require_util$4();
|
|
9886
|
-
const { FormData: FormData$
|
|
9886
|
+
const { FormData: FormData$2, setFormDataState } = require_formdata();
|
|
9887
9887
|
const { webidl: webidl$12 } = require_webidl();
|
|
9888
9888
|
const assert$25 = __require$2("node:assert");
|
|
9889
9889
|
const { isErrored: isErrored$1, isDisturbed: isDisturbed$2 } = __require$2("node:stream");
|
|
@@ -10053,13 +10053,13 @@ Content-Type: ${value.type || "application/octet-stream"}\r\n\r\n`);
|
|
|
10053
10053
|
if (mimeType !== null) switch (mimeType.essence) {
|
|
10054
10054
|
case "multipart/form-data": {
|
|
10055
10055
|
const parsed = multipartFormDataParser(value, mimeType);
|
|
10056
|
-
const fd = new FormData$
|
|
10056
|
+
const fd = new FormData$2();
|
|
10057
10057
|
setFormDataState(fd, parsed);
|
|
10058
10058
|
return fd;
|
|
10059
10059
|
}
|
|
10060
10060
|
case "application/x-www-form-urlencoded": {
|
|
10061
10061
|
const entries = new URLSearchParams(value.toString());
|
|
10062
|
-
const fd = new FormData$
|
|
10062
|
+
const fd = new FormData$2();
|
|
10063
10063
|
for (const [name, value$1] of entries) fd.append(name, value$1);
|
|
10064
10064
|
return fd;
|
|
10065
10065
|
}
|
|
@@ -10708,7 +10708,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
10708
10708
|
* @returns
|
|
10709
10709
|
*/
|
|
10710
10710
|
function writeH1(client, request$2) {
|
|
10711
|
-
const { method, path, host, upgrade: upgrade$1, blocking, reset } = request$2;
|
|
10711
|
+
const { method, path: path$1, host, upgrade: upgrade$1, blocking, reset } = request$2;
|
|
10712
10712
|
let { body, headers, contentLength } = request$2;
|
|
10713
10713
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
10714
10714
|
if (util$23.isFormDataLike(body)) {
|
|
@@ -10753,7 +10753,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
10753
10753
|
if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
|
|
10754
10754
|
if (blocking) socket[kBlocking] = true;
|
|
10755
10755
|
if (socket.setTypeOfService) socket.setTypeOfService(request$2.typeOfService);
|
|
10756
|
-
let header = `${method} ${path} HTTP/1.1\r\n`;
|
|
10756
|
+
let header = `${method} ${path$1} HTTP/1.1\r\n`;
|
|
10757
10757
|
if (typeof host === "string") header += `host: ${host}\r\n`;
|
|
10758
10758
|
else header += client[kHostHeader$1];
|
|
10759
10759
|
if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
|
|
@@ -11289,7 +11289,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11289
11289
|
function writeH2(client, request$2) {
|
|
11290
11290
|
const requestTimeout = request$2.bodyTimeout ?? client[kBodyTimeout$1];
|
|
11291
11291
|
const session = client[kHTTP2Session];
|
|
11292
|
-
const { method, path, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
|
|
11292
|
+
const { method, path: path$1, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
|
|
11293
11293
|
let { body } = request$2;
|
|
11294
11294
|
if (upgrade$1 != null && upgrade$1 !== "websocket") {
|
|
11295
11295
|
util$22.errorRequest(client, request$2, new InvalidArgumentError$30(`Custom upgrade "${upgrade$1}" not supported over HTTP/2`));
|
|
@@ -11342,7 +11342,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11342
11342
|
}
|
|
11343
11343
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
11344
11344
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
11345
|
-
headers[HTTP2_HEADER_PATH] = path;
|
|
11345
|
+
headers[HTTP2_HEADER_PATH] = path$1;
|
|
11346
11346
|
if (protocol === "ws:" || protocol === "wss:") headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
11347
11347
|
else headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11348
11348
|
stream$2 = session.request(headers, {
|
|
@@ -11384,7 +11384,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11384
11384
|
stream$2.setTimeout(requestTimeout);
|
|
11385
11385
|
return true;
|
|
11386
11386
|
}
|
|
11387
|
-
headers[HTTP2_HEADER_PATH] = path;
|
|
11387
|
+
headers[HTTP2_HEADER_PATH] = path$1;
|
|
11388
11388
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11389
11389
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
11390
11390
|
if (body && typeof body.read === "function") body.read(0);
|
|
@@ -13210,8 +13210,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
13210
13210
|
}
|
|
13211
13211
|
if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$1);
|
|
13212
13212
|
};
|
|
13213
|
-
const { origin, path = "/", headers = {} } = opts;
|
|
13214
|
-
opts.path = origin + path;
|
|
13213
|
+
const { origin, path: path$1 = "/", headers = {} } = opts;
|
|
13214
|
+
opts.path = origin + path$1;
|
|
13215
13215
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
13216
13216
|
const { host } = new URL(origin);
|
|
13217
13217
|
headers.host = host;
|
|
@@ -14995,16 +14995,16 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
14995
14995
|
}
|
|
14996
14996
|
return normalizedQp;
|
|
14997
14997
|
}
|
|
14998
|
-
function safeUrl(path) {
|
|
14999
|
-
if (typeof path !== "string") return path;
|
|
15000
|
-
const pathSegments = path.split("?", 3);
|
|
15001
|
-
if (pathSegments.length !== 2) return path;
|
|
14998
|
+
function safeUrl(path$1) {
|
|
14999
|
+
if (typeof path$1 !== "string") return path$1;
|
|
15000
|
+
const pathSegments = path$1.split("?", 3);
|
|
15001
|
+
if (pathSegments.length !== 2) return path$1;
|
|
15002
15002
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
15003
15003
|
qp.sort();
|
|
15004
15004
|
return [...pathSegments, qp.toString()].join("?");
|
|
15005
15005
|
}
|
|
15006
|
-
function matchKey(mockDispatch$1, { path, method, body, headers }) {
|
|
15007
|
-
const pathMatch = matchValue$1(mockDispatch$1.path, path);
|
|
15006
|
+
function matchKey(mockDispatch$1, { path: path$1, method, body, headers }) {
|
|
15007
|
+
const pathMatch = matchValue$1(mockDispatch$1.path, path$1);
|
|
15008
15008
|
const methodMatch = matchValue$1(mockDispatch$1.method, method);
|
|
15009
15009
|
const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
|
|
15010
15010
|
const headersMatch = matchHeaders(mockDispatch$1, headers);
|
|
@@ -15022,8 +15022,8 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15022
15022
|
const basePath = key.query ? serializePathWithQuery$2(key.path, key.query) : key.path;
|
|
15023
15023
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
15024
15024
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
15025
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path, ignoreTrailingSlash }) => {
|
|
15026
|
-
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path), resolvedPath);
|
|
15025
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$1, ignoreTrailingSlash }) => {
|
|
15026
|
+
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$1)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$1), resolvedPath);
|
|
15027
15027
|
});
|
|
15028
15028
|
if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
15029
15029
|
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
|
|
@@ -15066,15 +15066,15 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15066
15066
|
/**
|
|
15067
15067
|
* @param {string} path Path to remove trailing slash from
|
|
15068
15068
|
*/
|
|
15069
|
-
function removeTrailingSlash(path) {
|
|
15070
|
-
while (path.endsWith("/")) path = path.slice(0, -1);
|
|
15071
|
-
if (path.length === 0) path = "/";
|
|
15072
|
-
return path;
|
|
15069
|
+
function removeTrailingSlash(path$1) {
|
|
15070
|
+
while (path$1.endsWith("/")) path$1 = path$1.slice(0, -1);
|
|
15071
|
+
if (path$1.length === 0) path$1 = "/";
|
|
15072
|
+
return path$1;
|
|
15073
15073
|
}
|
|
15074
15074
|
function buildKey$1(opts) {
|
|
15075
|
-
const { path, method, body, headers, query } = opts;
|
|
15075
|
+
const { path: path$1, method, body, headers, query } = opts;
|
|
15076
15076
|
return {
|
|
15077
|
-
path,
|
|
15077
|
+
path: path$1,
|
|
15078
15078
|
method,
|
|
15079
15079
|
body,
|
|
15080
15080
|
headers,
|
|
@@ -15641,10 +15641,10 @@ var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJS$1({ "../
|
|
|
15641
15641
|
});
|
|
15642
15642
|
}
|
|
15643
15643
|
format(pendingInterceptors) {
|
|
15644
|
-
const withPrettyHeaders = pendingInterceptors.map(({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
15644
|
+
const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$1, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
15645
15645
|
Method: method,
|
|
15646
15646
|
Origin: origin,
|
|
15647
|
-
Path: path,
|
|
15647
|
+
Path: path$1,
|
|
15648
15648
|
"Status code": statusCode,
|
|
15649
15649
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
15650
15650
|
Invocations: timesInvoked,
|
|
@@ -15702,8 +15702,8 @@ var require_mock_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15702
15702
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
15703
15703
|
const dispatchOpts = { ...opts };
|
|
15704
15704
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
15705
|
-
const [path, searchParams] = dispatchOpts.path.split("?");
|
|
15706
|
-
dispatchOpts.path = `${path}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
|
|
15705
|
+
const [path$1, searchParams] = dispatchOpts.path.split("?");
|
|
15706
|
+
dispatchOpts.path = `${path$1}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
|
|
15707
15707
|
}
|
|
15708
15708
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
15709
15709
|
}
|
|
@@ -16180,10 +16180,10 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16180
16180
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
16181
16181
|
*/
|
|
16182
16182
|
async loadSnapshots(filePath) {
|
|
16183
|
-
const path = filePath || this.#snapshotPath;
|
|
16184
|
-
if (!path) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16183
|
+
const path$1 = filePath || this.#snapshotPath;
|
|
16184
|
+
if (!path$1) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16185
16185
|
try {
|
|
16186
|
-
const data$1 = await readFile(resolve$3(path), "utf8");
|
|
16186
|
+
const data$1 = await readFile(resolve$3(path$1), "utf8");
|
|
16187
16187
|
const parsed = JSON.parse(data$1);
|
|
16188
16188
|
if (Array.isArray(parsed)) {
|
|
16189
16189
|
this.#snapshots.clear();
|
|
@@ -16191,7 +16191,7 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16191
16191
|
} else this.#snapshots = new Map(Object.entries(parsed));
|
|
16192
16192
|
} catch (error) {
|
|
16193
16193
|
if (error.code === "ENOENT") this.#snapshots.clear();
|
|
16194
|
-
else throw new UndiciError$1(`Failed to load snapshots from ${path}`, { cause: error });
|
|
16194
|
+
else throw new UndiciError$1(`Failed to load snapshots from ${path$1}`, { cause: error });
|
|
16195
16195
|
}
|
|
16196
16196
|
}
|
|
16197
16197
|
/**
|
|
@@ -16201,9 +16201,9 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16201
16201
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
16202
16202
|
*/
|
|
16203
16203
|
async saveSnapshots(filePath) {
|
|
16204
|
-
const path = filePath || this.#snapshotPath;
|
|
16205
|
-
if (!path) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16206
|
-
const resolvedPath = resolve$3(path);
|
|
16204
|
+
const path$1 = filePath || this.#snapshotPath;
|
|
16205
|
+
if (!path$1) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16206
|
+
const resolvedPath = resolve$3(path$1);
|
|
16207
16207
|
await mkdir(dirname$2(resolvedPath), { recursive: true });
|
|
16208
16208
|
const data$1 = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
16209
16209
|
hash,
|
|
@@ -16770,11 +16770,11 @@ var require_redirect_handler = /* @__PURE__ */ __commonJS$1({ "../../node_module
|
|
|
16770
16770
|
return;
|
|
16771
16771
|
}
|
|
16772
16772
|
const { origin, pathname, search } = util$10.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
16773
|
-
const path = search ? `${pathname}${search}` : pathname;
|
|
16774
|
-
const redirectUrlString = `${origin}${path}`;
|
|
16773
|
+
const path$1 = search ? `${pathname}${search}` : pathname;
|
|
16774
|
+
const redirectUrlString = `${origin}${path$1}`;
|
|
16775
16775
|
for (const historyUrl of this.history) if (historyUrl.toString() === redirectUrlString) throw new InvalidArgumentError$3(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
16776
16776
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
16777
|
-
this.opts.path = path;
|
|
16777
|
+
this.opts.path = path$1;
|
|
16778
16778
|
this.opts.origin = origin;
|
|
16779
16779
|
this.opts.query = null;
|
|
16780
16780
|
}
|
|
@@ -19860,7 +19860,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19860
19860
|
}
|
|
19861
19861
|
}
|
|
19862
19862
|
};
|
|
19863
|
-
var Headers$
|
|
19863
|
+
var Headers$6 = class Headers$6 {
|
|
19864
19864
|
#guard;
|
|
19865
19865
|
/**
|
|
19866
19866
|
* @type {HeadersList}
|
|
@@ -19881,7 +19881,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19881
19881
|
}
|
|
19882
19882
|
}
|
|
19883
19883
|
append(name, value) {
|
|
19884
|
-
webidl$11.brandCheck(this, Headers$
|
|
19884
|
+
webidl$11.brandCheck(this, Headers$6);
|
|
19885
19885
|
webidl$11.argumentLengthCheck(arguments, 2, "Headers.append");
|
|
19886
19886
|
const prefix = "Headers.append";
|
|
19887
19887
|
name = webidl$11.converters.ByteString(name, prefix, "name");
|
|
@@ -19889,7 +19889,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19889
19889
|
return appendHeader(this, name, value);
|
|
19890
19890
|
}
|
|
19891
19891
|
delete(name) {
|
|
19892
|
-
webidl$11.brandCheck(this, Headers$
|
|
19892
|
+
webidl$11.brandCheck(this, Headers$6);
|
|
19893
19893
|
webidl$11.argumentLengthCheck(arguments, 1, "Headers.delete");
|
|
19894
19894
|
name = webidl$11.converters.ByteString(name, "Headers.delete", "name");
|
|
19895
19895
|
if (!isValidHeaderName$1(name)) throw webidl$11.errors.invalidArgument({
|
|
@@ -19902,7 +19902,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19902
19902
|
this.#headersList.delete(name, false);
|
|
19903
19903
|
}
|
|
19904
19904
|
get(name) {
|
|
19905
|
-
webidl$11.brandCheck(this, Headers$
|
|
19905
|
+
webidl$11.brandCheck(this, Headers$6);
|
|
19906
19906
|
webidl$11.argumentLengthCheck(arguments, 1, "Headers.get");
|
|
19907
19907
|
const prefix = "Headers.get";
|
|
19908
19908
|
name = webidl$11.converters.ByteString(name, prefix, "name");
|
|
@@ -19914,7 +19914,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19914
19914
|
return this.#headersList.get(name, false);
|
|
19915
19915
|
}
|
|
19916
19916
|
has(name) {
|
|
19917
|
-
webidl$11.brandCheck(this, Headers$
|
|
19917
|
+
webidl$11.brandCheck(this, Headers$6);
|
|
19918
19918
|
webidl$11.argumentLengthCheck(arguments, 1, "Headers.has");
|
|
19919
19919
|
const prefix = "Headers.has";
|
|
19920
19920
|
name = webidl$11.converters.ByteString(name, prefix, "name");
|
|
@@ -19926,7 +19926,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19926
19926
|
return this.#headersList.contains(name, false);
|
|
19927
19927
|
}
|
|
19928
19928
|
set(name, value) {
|
|
19929
|
-
webidl$11.brandCheck(this, Headers$
|
|
19929
|
+
webidl$11.brandCheck(this, Headers$6);
|
|
19930
19930
|
webidl$11.argumentLengthCheck(arguments, 2, "Headers.set");
|
|
19931
19931
|
const prefix = "Headers.set";
|
|
19932
19932
|
name = webidl$11.converters.ByteString(name, prefix, "name");
|
|
@@ -19946,7 +19946,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19946
19946
|
this.#headersList.set(name, value, false);
|
|
19947
19947
|
}
|
|
19948
19948
|
getSetCookie() {
|
|
19949
|
-
webidl$11.brandCheck(this, Headers$
|
|
19949
|
+
webidl$11.brandCheck(this, Headers$6);
|
|
19950
19950
|
const list$1 = this.#headersList.cookies;
|
|
19951
19951
|
if (list$1) return [...list$1];
|
|
19952
19952
|
return [];
|
|
@@ -19975,13 +19975,13 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19975
19975
|
target$1.#headersList = list$1;
|
|
19976
19976
|
}
|
|
19977
19977
|
};
|
|
19978
|
-
const { getHeadersGuard: getHeadersGuard$2, setHeadersGuard: setHeadersGuard$2, getHeadersList: getHeadersList$2, setHeadersList: setHeadersList$2 } = Headers$
|
|
19979
|
-
Reflect.deleteProperty(Headers$
|
|
19980
|
-
Reflect.deleteProperty(Headers$
|
|
19981
|
-
Reflect.deleteProperty(Headers$
|
|
19982
|
-
Reflect.deleteProperty(Headers$
|
|
19983
|
-
iteratorMixin("Headers", Headers$
|
|
19984
|
-
Object.defineProperties(Headers$
|
|
19978
|
+
const { getHeadersGuard: getHeadersGuard$2, setHeadersGuard: setHeadersGuard$2, getHeadersList: getHeadersList$2, setHeadersList: setHeadersList$2 } = Headers$6;
|
|
19979
|
+
Reflect.deleteProperty(Headers$6, "getHeadersGuard");
|
|
19980
|
+
Reflect.deleteProperty(Headers$6, "setHeadersGuard");
|
|
19981
|
+
Reflect.deleteProperty(Headers$6, "getHeadersList");
|
|
19982
|
+
Reflect.deleteProperty(Headers$6, "setHeadersList");
|
|
19983
|
+
iteratorMixin("Headers", Headers$6, headersListSortAndCombine, 0, 1);
|
|
19984
|
+
Object.defineProperties(Headers$6.prototype, {
|
|
19985
19985
|
append: kEnumerableProperty$9,
|
|
19986
19986
|
delete: kEnumerableProperty$9,
|
|
19987
19987
|
get: kEnumerableProperty$9,
|
|
@@ -19997,7 +19997,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
19997
19997
|
webidl$11.converters.HeadersInit = function(V, prefix, argument) {
|
|
19998
19998
|
if (webidl$11.util.Type(V) === webidl$11.util.Types.OBJECT) {
|
|
19999
19999
|
const iterator = Reflect.get(V, Symbol.iterator);
|
|
20000
|
-
if (!util$6.types.isProxy(V) && iterator === Headers$
|
|
20000
|
+
if (!util$6.types.isProxy(V) && iterator === Headers$6.prototype.entries) try {
|
|
20001
20001
|
return getHeadersList$2(V).entriesList;
|
|
20002
20002
|
} catch {}
|
|
20003
20003
|
if (typeof iterator === "function") return webidl$11.converters["sequence<sequence<ByteString>>"](V, prefix, argument, iterator.bind(V));
|
|
@@ -20012,7 +20012,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
20012
20012
|
module.exports = {
|
|
20013
20013
|
fill: fill$1,
|
|
20014
20014
|
compareHeaderName,
|
|
20015
|
-
Headers: Headers$
|
|
20015
|
+
Headers: Headers$6,
|
|
20016
20016
|
HeadersList: HeadersList$3,
|
|
20017
20017
|
getHeadersGuard: getHeadersGuard$2,
|
|
20018
20018
|
setHeadersGuard: setHeadersGuard$2,
|
|
@@ -20024,7 +20024,7 @@ var require_headers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
20024
20024
|
//#endregion
|
|
20025
20025
|
//#region ../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js
|
|
20026
20026
|
var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js": ((exports, module) => {
|
|
20027
|
-
const { Headers: Headers$
|
|
20027
|
+
const { Headers: Headers$5, HeadersList: HeadersList$2, fill, getHeadersGuard: getHeadersGuard$1, setHeadersGuard: setHeadersGuard$1, setHeadersList: setHeadersList$1 } = require_headers();
|
|
20028
20028
|
const { extractBody: extractBody$2, cloneBody: cloneBody$1, mixinBody: mixinBody$1, streamRegistry, bodyUnusable: bodyUnusable$1 } = require_body();
|
|
20029
20029
|
const util$5 = require_util$5();
|
|
20030
20030
|
const nodeUtil$1 = __require$2("node:util");
|
|
@@ -20037,7 +20037,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20037
20037
|
const assert$9 = __require$2("node:assert");
|
|
20038
20038
|
const { isomorphicEncode: isomorphicEncode$1, serializeJavascriptValueToJSONString } = require_infra();
|
|
20039
20039
|
const textEncoder = new TextEncoder("utf-8");
|
|
20040
|
-
var Response$
|
|
20040
|
+
var Response$3 = class Response$3 {
|
|
20041
20041
|
/** @type {Headers} */
|
|
20042
20042
|
#headers;
|
|
20043
20043
|
#state;
|
|
@@ -20078,7 +20078,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20078
20078
|
if (body !== null) body = webidl$10.converters.BodyInit(body, "Response", "body");
|
|
20079
20079
|
init = webidl$10.converters.ResponseInit(init);
|
|
20080
20080
|
this.#state = makeResponse$1({});
|
|
20081
|
-
this.#headers = new Headers$
|
|
20081
|
+
this.#headers = new Headers$5(kConstruct$6);
|
|
20082
20082
|
setHeadersGuard$1(this.#headers, "response");
|
|
20083
20083
|
setHeadersList$1(this.#headers, this.#state.headersList);
|
|
20084
20084
|
let bodyWithType = null;
|
|
@@ -20092,46 +20092,46 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20092
20092
|
initializeResponse(this, init, bodyWithType);
|
|
20093
20093
|
}
|
|
20094
20094
|
get type() {
|
|
20095
|
-
webidl$10.brandCheck(this, Response$
|
|
20095
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20096
20096
|
return this.#state.type;
|
|
20097
20097
|
}
|
|
20098
20098
|
get url() {
|
|
20099
|
-
webidl$10.brandCheck(this, Response$
|
|
20099
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20100
20100
|
const urlList = this.#state.urlList;
|
|
20101
20101
|
const url = urlList[urlList.length - 1] ?? null;
|
|
20102
20102
|
if (url === null) return "";
|
|
20103
20103
|
return URLSerializer$3(url, true);
|
|
20104
20104
|
}
|
|
20105
20105
|
get redirected() {
|
|
20106
|
-
webidl$10.brandCheck(this, Response$
|
|
20106
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20107
20107
|
return this.#state.urlList.length > 1;
|
|
20108
20108
|
}
|
|
20109
20109
|
get status() {
|
|
20110
|
-
webidl$10.brandCheck(this, Response$
|
|
20110
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20111
20111
|
return this.#state.status;
|
|
20112
20112
|
}
|
|
20113
20113
|
get ok() {
|
|
20114
|
-
webidl$10.brandCheck(this, Response$
|
|
20114
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20115
20115
|
return this.#state.status >= 200 && this.#state.status <= 299;
|
|
20116
20116
|
}
|
|
20117
20117
|
get statusText() {
|
|
20118
|
-
webidl$10.brandCheck(this, Response$
|
|
20118
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20119
20119
|
return this.#state.statusText;
|
|
20120
20120
|
}
|
|
20121
20121
|
get headers() {
|
|
20122
|
-
webidl$10.brandCheck(this, Response$
|
|
20122
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20123
20123
|
return this.#headers;
|
|
20124
20124
|
}
|
|
20125
20125
|
get body() {
|
|
20126
|
-
webidl$10.brandCheck(this, Response$
|
|
20126
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20127
20127
|
return this.#state.body ? this.#state.body.stream : null;
|
|
20128
20128
|
}
|
|
20129
20129
|
get bodyUsed() {
|
|
20130
|
-
webidl$10.brandCheck(this, Response$
|
|
20130
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20131
20131
|
return !!this.#state.body && util$5.isDisturbed(this.#state.body.stream);
|
|
20132
20132
|
}
|
|
20133
20133
|
clone() {
|
|
20134
|
-
webidl$10.brandCheck(this, Response$
|
|
20134
|
+
webidl$10.brandCheck(this, Response$3);
|
|
20135
20135
|
if (bodyUnusable$1(this.#state)) throw webidl$10.errors.exception({
|
|
20136
20136
|
header: "Response.clone",
|
|
20137
20137
|
message: "Body has already been consumed."
|
|
@@ -20183,13 +20183,13 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20183
20183
|
response.#state = newState;
|
|
20184
20184
|
}
|
|
20185
20185
|
};
|
|
20186
|
-
const { getResponseHeaders, setResponseHeaders, getResponseState: getResponseState$2, setResponseState } = Response$
|
|
20187
|
-
Reflect.deleteProperty(Response$
|
|
20188
|
-
Reflect.deleteProperty(Response$
|
|
20189
|
-
Reflect.deleteProperty(Response$
|
|
20190
|
-
Reflect.deleteProperty(Response$
|
|
20191
|
-
mixinBody$1(Response$
|
|
20192
|
-
Object.defineProperties(Response$
|
|
20186
|
+
const { getResponseHeaders, setResponseHeaders, getResponseState: getResponseState$2, setResponseState } = Response$3;
|
|
20187
|
+
Reflect.deleteProperty(Response$3, "getResponseHeaders");
|
|
20188
|
+
Reflect.deleteProperty(Response$3, "setResponseHeaders");
|
|
20189
|
+
Reflect.deleteProperty(Response$3, "getResponseState");
|
|
20190
|
+
Reflect.deleteProperty(Response$3, "setResponseState");
|
|
20191
|
+
mixinBody$1(Response$3, getResponseState$2);
|
|
20192
|
+
Object.defineProperties(Response$3.prototype, {
|
|
20193
20193
|
type: kEnumerableProperty$8,
|
|
20194
20194
|
url: kEnumerableProperty$8,
|
|
20195
20195
|
status: kEnumerableProperty$8,
|
|
@@ -20205,7 +20205,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20205
20205
|
configurable: true
|
|
20206
20206
|
}
|
|
20207
20207
|
});
|
|
20208
|
-
Object.defineProperties(Response$
|
|
20208
|
+
Object.defineProperties(Response$3, {
|
|
20209
20209
|
json: kEnumerableProperty$8,
|
|
20210
20210
|
redirect: kEnumerableProperty$8,
|
|
20211
20211
|
error: kEnumerableProperty$8
|
|
@@ -20315,9 +20315,9 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20315
20315
|
* @returns {Response}
|
|
20316
20316
|
*/
|
|
20317
20317
|
function fromInnerResponse$2(innerResponse, guard) {
|
|
20318
|
-
const response = new Response$
|
|
20318
|
+
const response = new Response$3(kConstruct$6);
|
|
20319
20319
|
setResponseState(response, innerResponse);
|
|
20320
|
-
const headers = new Headers$
|
|
20320
|
+
const headers = new Headers$5(kConstruct$6);
|
|
20321
20321
|
setResponseHeaders(response, headers);
|
|
20322
20322
|
setHeadersList$1(headers, innerResponse.headersList);
|
|
20323
20323
|
setHeadersGuard$1(headers, guard);
|
|
@@ -20353,14 +20353,14 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20353
20353
|
converter: webidl$10.converters.HeadersInit
|
|
20354
20354
|
}
|
|
20355
20355
|
]);
|
|
20356
|
-
webidl$10.is.Response = webidl$10.util.MakeTypeAssertion(Response$
|
|
20356
|
+
webidl$10.is.Response = webidl$10.util.MakeTypeAssertion(Response$3);
|
|
20357
20357
|
module.exports = {
|
|
20358
20358
|
isNetworkError: isNetworkError$1,
|
|
20359
20359
|
makeNetworkError: makeNetworkError$1,
|
|
20360
20360
|
makeResponse: makeResponse$1,
|
|
20361
20361
|
makeAppropriateNetworkError: makeAppropriateNetworkError$1,
|
|
20362
20362
|
filterResponse: filterResponse$1,
|
|
20363
|
-
Response: Response$
|
|
20363
|
+
Response: Response$3,
|
|
20364
20364
|
cloneResponse: cloneResponse$1,
|
|
20365
20365
|
fromInnerResponse: fromInnerResponse$2,
|
|
20366
20366
|
getResponseState: getResponseState$2
|
|
@@ -20371,7 +20371,7 @@ var require_response = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
20371
20371
|
//#region ../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js
|
|
20372
20372
|
var require_request = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js": ((exports, module) => {
|
|
20373
20373
|
const { extractBody: extractBody$1, mixinBody, cloneBody, bodyUnusable } = require_body();
|
|
20374
|
-
const { Headers: Headers$
|
|
20374
|
+
const { Headers: Headers$4, fill: fillHeaders, HeadersList: HeadersList$1, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList: getHeadersList$1 } = require_headers();
|
|
20375
20375
|
const util$4 = require_util$5();
|
|
20376
20376
|
const nodeUtil = __require$2("node:util");
|
|
20377
20377
|
const { isValidHTTPToken, sameOrigin: sameOrigin$1, environmentSettingsObject: environmentSettingsObject$3 } = require_util$4();
|
|
@@ -20547,7 +20547,7 @@ var require_request = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
20547
20547
|
abort: abort$1
|
|
20548
20548
|
}, abort$1);
|
|
20549
20549
|
}
|
|
20550
|
-
this.#headers = new Headers$
|
|
20550
|
+
this.#headers = new Headers$4(kConstruct$5);
|
|
20551
20551
|
setHeadersList(this.#headers, request$2.headersList);
|
|
20552
20552
|
setHeadersGuard(this.#headers, "request");
|
|
20553
20553
|
if (mode === "no-cors") {
|
|
@@ -20820,7 +20820,7 @@ var require_request = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
20820
20820
|
setRequestState(request$2, innerRequest);
|
|
20821
20821
|
setRequestDispatcher(request$2, dispatcher);
|
|
20822
20822
|
setRequestSignal(request$2, signal);
|
|
20823
|
-
const headers = new Headers$
|
|
20823
|
+
const headers = new Headers$4(kConstruct$5);
|
|
20824
20824
|
setRequestHeaders(request$2, headers);
|
|
20825
20825
|
setHeadersList(headers, innerRequest.headersList);
|
|
20826
20826
|
setHeadersGuard(headers, guard);
|
|
@@ -21732,10 +21732,10 @@ var require_fetch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/und
|
|
|
21732
21732
|
const url = requestCurrentURL(request$2);
|
|
21733
21733
|
/** @type {import('../../..').Agent} */
|
|
21734
21734
|
const agent = fetchParams.controller.dispatcher;
|
|
21735
|
-
const path = url.pathname + url.search;
|
|
21735
|
+
const path$1 = url.pathname + url.search;
|
|
21736
21736
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
21737
21737
|
return new Promise((resolve$4, reject) => agent.dispatch({
|
|
21738
|
-
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
21738
|
+
path: hasTrailingQuestionMark ? `${path$1}?` : path$1,
|
|
21739
21739
|
origin: url.origin,
|
|
21740
21740
|
method: request$2.method,
|
|
21741
21741
|
body: agent.isMockActive ? request$2.body && (request$2.body.source || request$2.body.stream) : body,
|
|
@@ -22517,9 +22517,9 @@ var require_util$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
22517
22517
|
* path-value = <any CHAR except CTLs or ";">
|
|
22518
22518
|
* @param {string} path
|
|
22519
22519
|
*/
|
|
22520
|
-
function validateCookiePath(path) {
|
|
22521
|
-
for (let i$1 = 0; i$1 < path.length; ++i$1) {
|
|
22522
|
-
const code = path.charCodeAt(i$1);
|
|
22520
|
+
function validateCookiePath(path$1) {
|
|
22521
|
+
for (let i$1 = 0; i$1 < path$1.length; ++i$1) {
|
|
22522
|
+
const code = path$1.charCodeAt(i$1);
|
|
22523
22523
|
if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path");
|
|
22524
22524
|
}
|
|
22525
22525
|
}
|
|
@@ -22770,8 +22770,8 @@ var require_cookies = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
22770
22770
|
const { parseSetCookie } = require_parse$1();
|
|
22771
22771
|
const { stringify } = require_util$2();
|
|
22772
22772
|
const { webidl: webidl$5 } = require_webidl();
|
|
22773
|
-
const { Headers: Headers$
|
|
22774
|
-
const brandChecks = webidl$5.brandCheckMultiple([Headers$
|
|
22773
|
+
const { Headers: Headers$3 } = require_headers();
|
|
22774
|
+
const brandChecks = webidl$5.brandCheckMultiple([Headers$3, globalThis.Headers].filter(Boolean));
|
|
22775
22775
|
/**
|
|
22776
22776
|
* @typedef {Object} Cookie
|
|
22777
22777
|
* @property {string} name
|
|
@@ -23630,7 +23630,7 @@ var require_connection = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
23630
23630
|
const { parseExtensions, isClosed: isClosed$1, isClosing: isClosing$1, isEstablished: isEstablished$2, isConnecting: isConnecting$1, validateCloseCodeAndReason: validateCloseCodeAndReason$1 } = require_util$1();
|
|
23631
23631
|
const { makeRequest: makeRequest$1 } = require_request();
|
|
23632
23632
|
const { fetching: fetching$1 } = require_fetch();
|
|
23633
|
-
const { Headers: Headers$
|
|
23633
|
+
const { Headers: Headers$2, getHeadersList } = require_headers();
|
|
23634
23634
|
const { getDecodeSplit } = require_util$4();
|
|
23635
23635
|
const { WebsocketFrameSend: WebsocketFrameSend$4 } = require_frame();
|
|
23636
23636
|
const assert$2 = __require$2("node:assert");
|
|
@@ -23658,7 +23658,7 @@ var require_connection = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
23658
23658
|
redirect: "error",
|
|
23659
23659
|
useURLCredentials: true
|
|
23660
23660
|
});
|
|
23661
|
-
if (options.headers) request$2.headersList = getHeadersList(new Headers$
|
|
23661
|
+
if (options.headers) request$2.headersList = getHeadersList(new Headers$2(options.headers));
|
|
23662
23662
|
const keyValue = crypto.randomBytes(16).toString("base64");
|
|
23663
23663
|
request$2.headersList.append("sec-websocket-key", keyValue, true);
|
|
23664
23664
|
request$2.headersList.append("sec-websocket-version", "13", true);
|
|
@@ -25627,9 +25627,9 @@ var require_undici = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
25627
25627
|
if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
|
|
25628
25628
|
if (opts && opts.path != null) {
|
|
25629
25629
|
if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
|
|
25630
|
-
let path = opts.path;
|
|
25631
|
-
if (!opts.path.startsWith("/")) path = `/${path}`;
|
|
25632
|
-
url = new URL(util$3.parseOrigin(url).origin + path);
|
|
25630
|
+
let path$1 = opts.path;
|
|
25631
|
+
if (!opts.path.startsWith("/")) path$1 = `/${path$1}`;
|
|
25632
|
+
url = new URL(util$3.parseOrigin(url).origin + path$1);
|
|
25633
25633
|
} else {
|
|
25634
25634
|
if (!opts) opts = typeof url === "object" ? url : {};
|
|
25635
25635
|
url = util$3.parseURL(url);
|
|
@@ -26251,7 +26251,7 @@ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0
|
|
|
26251
26251
|
return function() {};
|
|
26252
26252
|
};
|
|
26253
26253
|
else {
|
|
26254
|
-
|
|
26254
|
+
assert3 = __require$1("assert");
|
|
26255
26255
|
signals = require_signals();
|
|
26256
26256
|
isWin$1 = /^win/i.test(process2.platform);
|
|
26257
26257
|
EE$3 = __require$1("events");
|
|
@@ -26268,7 +26268,7 @@ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0
|
|
|
26268
26268
|
}
|
|
26269
26269
|
module$1.exports = function(cb, opts) {
|
|
26270
26270
|
if (!processOk(global.process)) return function() {};
|
|
26271
|
-
|
|
26271
|
+
assert3.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
26272
26272
|
if (loaded === false) load();
|
|
26273
26273
|
var ev = "exit";
|
|
26274
26274
|
if (opts && opts.alwaysLast) ev = "afterexit";
|
|
@@ -26349,7 +26349,7 @@ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0
|
|
|
26349
26349
|
} else return originalProcessEmit.apply(this, arguments);
|
|
26350
26350
|
}, "processEmit");
|
|
26351
26351
|
}
|
|
26352
|
-
var
|
|
26352
|
+
var assert3;
|
|
26353
26353
|
var signals;
|
|
26354
26354
|
var isWin$1;
|
|
26355
26355
|
var EE$3;
|
|
@@ -30933,7 +30933,7 @@ __reExport(mod_esm_exports, __toESM(require_mod_cjs3(), 1));
|
|
|
30933
30933
|
var mod_esm_default = import_mod_cjs.default;
|
|
30934
30934
|
function getGlobalWranglerConfigPath() {
|
|
30935
30935
|
const configDir = mod_esm_default(".wrangler").config();
|
|
30936
|
-
const legacyConfigDir =
|
|
30936
|
+
const legacyConfigDir = path.join(os.homedir(), ".wrangler");
|
|
30937
30937
|
if (isDirectory(legacyConfigDir)) return legacyConfigDir;
|
|
30938
30938
|
else return configDir;
|
|
30939
30939
|
}
|
|
@@ -31004,6 +31004,7 @@ var getCloudflareApiBaseUrlFromEnv = getEnvironmentVariableFactory({
|
|
|
31004
31004
|
variableName: "CLOUDFLARE_API_BASE_URL",
|
|
31005
31005
|
deprecatedName: "CF_API_BASE_URL"
|
|
31006
31006
|
});
|
|
31007
|
+
var getCloudflareApiBaseUrl = /* @__PURE__ */ __name((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, "getCloudflareApiBaseUrl");
|
|
31007
31008
|
function getComplianceRegionSubdomain(complianceConfig) {
|
|
31008
31009
|
return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
|
|
31009
31010
|
}
|
|
@@ -31032,7 +31033,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRA
|
|
|
31032
31033
|
var getRegistryPath = getEnvironmentVariableFactory({
|
|
31033
31034
|
variableName: "WRANGLER_REGISTRY_PATH",
|
|
31034
31035
|
defaultValue() {
|
|
31035
|
-
return
|
|
31036
|
+
return path.join(getGlobalWranglerConfigPath(), "registry");
|
|
31036
31037
|
}
|
|
31037
31038
|
});
|
|
31038
31039
|
var getD1ExtraLocationChoices = getEnvironmentVariableFactory({ variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES" });
|
|
@@ -31448,7 +31449,7 @@ function isPagesConfig(rawConfig) {
|
|
|
31448
31449
|
}
|
|
31449
31450
|
__name(isPagesConfig, "isPagesConfig");
|
|
31450
31451
|
function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
|
|
31451
|
-
const diagnostics = new Diagnostics(`Processing ${configPath ?
|
|
31452
|
+
const diagnostics = new Diagnostics(`Processing ${configPath ? path.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
|
|
31452
31453
|
validateOptionalProperty(diagnostics, "", "legacy_env", rawConfig.legacy_env, "boolean");
|
|
31453
31454
|
validateOptionalProperty(diagnostics, "", "send_metrics", rawConfig.send_metrics, "boolean");
|
|
31454
31455
|
validateOptionalProperty(diagnostics, "", "keep_vars", rawConfig.keep_vars, "boolean");
|
|
@@ -31552,34 +31553,34 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
|
|
|
31552
31553
|
else validateOptionalProperty(diagnostics, "build", "watch_dir", watch_dir, "string");
|
|
31553
31554
|
return {
|
|
31554
31555
|
command,
|
|
31555
|
-
watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) =>
|
|
31556
|
+
watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) => path.relative(process.cwd(), path.join(path.dirname(configPath), `${dir}`))) : path.relative(process.cwd(), path.join(path.dirname(configPath), `${watch_dir}`)) : watch_dir,
|
|
31556
31557
|
cwd
|
|
31557
31558
|
};
|
|
31558
31559
|
}
|
|
31559
31560
|
__name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
|
|
31560
31561
|
function normalizeAndValidateMainField(configPath, rawMain) {
|
|
31561
|
-
const configDir =
|
|
31562
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
31562
31563
|
if (rawMain !== void 0) if (typeof rawMain === "string") {
|
|
31563
|
-
const directory =
|
|
31564
|
-
return
|
|
31564
|
+
const directory = path.resolve(configDir);
|
|
31565
|
+
return path.resolve(directory, rawMain);
|
|
31565
31566
|
} else return rawMain;
|
|
31566
31567
|
else return;
|
|
31567
31568
|
}
|
|
31568
31569
|
__name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
|
|
31569
31570
|
function normalizeAndValidateBaseDirField(configPath, rawDir) {
|
|
31570
|
-
const configDir =
|
|
31571
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
31571
31572
|
if (rawDir !== void 0) if (typeof rawDir === "string") {
|
|
31572
|
-
const directory =
|
|
31573
|
-
return
|
|
31573
|
+
const directory = path.resolve(configDir);
|
|
31574
|
+
return path.resolve(directory, rawDir);
|
|
31574
31575
|
} else return rawDir;
|
|
31575
31576
|
else return;
|
|
31576
31577
|
}
|
|
31577
31578
|
__name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
|
|
31578
31579
|
function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
|
|
31579
|
-
const configDir =
|
|
31580
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
31580
31581
|
if (rawPagesDir !== void 0) if (typeof rawPagesDir === "string") {
|
|
31581
|
-
const directory =
|
|
31582
|
-
return
|
|
31582
|
+
const directory = path.resolve(configDir);
|
|
31583
|
+
return path.resolve(directory, rawPagesDir);
|
|
31583
31584
|
} else return rawPagesDir;
|
|
31584
31585
|
else return;
|
|
31585
31586
|
}
|
|
@@ -31632,7 +31633,7 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
|
|
|
31632
31633
|
validateOptionalProperty(diagnostics, "site", "entry-point", rawConfig.site["entry-point"], "string");
|
|
31633
31634
|
deprecated(diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
|
|
31634
31635
|
\`\`\`
|
|
31635
|
-
main = "${
|
|
31636
|
+
main = "${path.join(String(rawConfig.site["entry-point"]) || "workers-site", path.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js")}"
|
|
31636
31637
|
\`\`\``, false, void 0, "warning");
|
|
31637
31638
|
let siteEntryPoint = rawConfig.site["entry-point"];
|
|
31638
31639
|
if (!mainEntryPoint && !siteEntryPoint) {
|
|
@@ -31645,7 +31646,7 @@ main = "workers-site/index.js"
|
|
|
31645
31646
|
} else if (mainEntryPoint && siteEntryPoint) diagnostics.errors.push(`Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
|
|
31646
31647
|
They serve the same purpose: to point to the entry-point of your worker.
|
|
31647
31648
|
Delete the deprecated \`site.entry-point\` field from your config.`);
|
|
31648
|
-
if (configPath && siteEntryPoint) siteEntryPoint =
|
|
31649
|
+
if (configPath && siteEntryPoint) siteEntryPoint = path.relative(process.cwd(), path.join(path.dirname(configPath), siteEntryPoint));
|
|
31649
31650
|
return {
|
|
31650
31651
|
bucket,
|
|
31651
31652
|
"entry-point": siteEntryPoint,
|
|
@@ -31677,7 +31678,7 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
|
|
|
31677
31678
|
if (rawMapping === void 0) return;
|
|
31678
31679
|
const mapping = {};
|
|
31679
31680
|
for (const [name, filePath] of Object.entries(rawMapping)) if (isString$2(diagnostics, `${field}['${name}']`, filePath, void 0)) {
|
|
31680
|
-
if (configPath) mapping[name] = configPath ?
|
|
31681
|
+
if (configPath) mapping[name] = configPath ? path.relative(process.cwd(), path.join(path.dirname(configPath), filePath)) : filePath;
|
|
31681
31682
|
}
|
|
31682
31683
|
return mapping;
|
|
31683
31684
|
}
|
|
@@ -31927,7 +31928,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
31927
31928
|
__name(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
|
|
31928
31929
|
function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
|
|
31929
31930
|
const tsconfig = inheritable(diagnostics, topLevelEnv, rawEnv, "tsconfig", isString$2, void 0);
|
|
31930
|
-
return configPath && tsconfig ?
|
|
31931
|
+
return configPath && tsconfig ? path.relative(process.cwd(), path.join(path.dirname(configPath), tsconfig)) : tsconfig;
|
|
31931
31932
|
}
|
|
31932
31933
|
__name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
|
|
31933
31934
|
var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv, rawEnv, envName) => {
|
|
@@ -32427,9 +32428,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
32427
32428
|
let resolvedBuildContextPath = void 0;
|
|
32428
32429
|
try {
|
|
32429
32430
|
if (isDockerfile(resolvedImage, configPath)) {
|
|
32430
|
-
const baseDir = configPath ?
|
|
32431
|
-
resolvedImage =
|
|
32432
|
-
resolvedBuildContextPath = containerAppOptional.image_build_context ?
|
|
32431
|
+
const baseDir = configPath ? path.dirname(configPath) : process.cwd();
|
|
32432
|
+
resolvedImage = path.resolve(baseDir, resolvedImage);
|
|
32433
|
+
resolvedBuildContextPath = containerAppOptional.image_build_context ? path.resolve(baseDir, containerAppOptional.image_build_context) : path.dirname(resolvedImage);
|
|
32433
32434
|
}
|
|
32434
32435
|
} catch (err) {
|
|
32435
32436
|
if (err instanceof Error && err.message) diagnostics.errors.push(err.message);
|
|
@@ -33596,8 +33597,8 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
|
|
|
33596
33597
|
}
|
|
33597
33598
|
__name(isRemoteValid, "isRemoteValid");
|
|
33598
33599
|
function isDockerfile(imagePath, configPath) {
|
|
33599
|
-
const baseDir = configPath ?
|
|
33600
|
-
const maybeDockerfile =
|
|
33600
|
+
const baseDir = configPath ? path.dirname(configPath) : process.cwd();
|
|
33601
|
+
const maybeDockerfile = path.resolve(baseDir, imagePath);
|
|
33601
33602
|
if (fs2.existsSync(maybeDockerfile)) {
|
|
33602
33603
|
if (isDirectory(maybeDockerfile)) throw new UserError(`${imagePath} is a directory, you should specify a path to the Dockerfile`, { telemetryMessage: false });
|
|
33603
33604
|
return true;
|
|
@@ -33749,7 +33750,7 @@ __name(validateDurableObjectBinding2, "validateDurableObjectBinding");
|
|
|
33749
33750
|
var import_signal_exit = __toESM(require_signal_exit());
|
|
33750
33751
|
function getWranglerHiddenDirPath(projectRoot) {
|
|
33751
33752
|
projectRoot ??= process.cwd();
|
|
33752
|
-
return
|
|
33753
|
+
return path.join(projectRoot, ".wrangler");
|
|
33753
33754
|
}
|
|
33754
33755
|
__name(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
|
|
33755
33756
|
var STALE_WRANGLER_TMP_DIR_MS = 1440 * 60 * 1e3;
|
|
@@ -33766,7 +33767,7 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
|
|
|
33766
33767
|
const cutoff = Date.now() - STALE_WRANGLER_TMP_DIR_MS;
|
|
33767
33768
|
for (const entry of entries) {
|
|
33768
33769
|
if (!entry.isDirectory()) continue;
|
|
33769
|
-
const entryPath =
|
|
33770
|
+
const entryPath = path.join(tmpRoot, entry.name);
|
|
33770
33771
|
try {
|
|
33771
33772
|
if (fs2.statSync(entryPath).mtimeMs < cutoff) removeDirSync(entryPath);
|
|
33772
33773
|
} catch {}
|
|
@@ -33774,10 +33775,10 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
|
|
|
33774
33775
|
}
|
|
33775
33776
|
__name(sweepStaleWranglerTmpDirs, "sweepStaleWranglerTmpDirs");
|
|
33776
33777
|
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
|
|
33777
|
-
const tmpRoot =
|
|
33778
|
+
const tmpRoot = path.join(getWranglerHiddenDirPath(projectRoot), "tmp");
|
|
33778
33779
|
fs2.mkdirSync(tmpRoot, { recursive: true });
|
|
33779
33780
|
sweepStaleWranglerTmpDirs(tmpRoot);
|
|
33780
|
-
const tmpPrefix =
|
|
33781
|
+
const tmpPrefix = path.join(tmpRoot, `${prefix}-`);
|
|
33781
33782
|
const tmpDir = fs2.realpathSync(fs2.mkdtempSync(tmpPrefix));
|
|
33782
33783
|
const cleanupDir = /* @__PURE__ */ __name(() => {
|
|
33783
33784
|
if (cleanup) try {
|
|
@@ -34254,7 +34255,7 @@ function startTunnel(options) {
|
|
|
34254
34255
|
if (disposed) return;
|
|
34255
34256
|
const remainingMs = expiresAt - Date.now();
|
|
34256
34257
|
if (remainingMs <= 0) return;
|
|
34257
|
-
logger?.log(`${publicURL ? `
|
|
34258
|
+
logger?.log(`${publicURL ? `Tunnel still open, expires in ${formatTunnelDuration(remainingMs)}: ${publicURL}` : `The tunnel is still open. It expires in ${formatTunnelDuration(remainingMs)}.`}${options.extendHint ? ` ${options.extendHint}` : ""}`);
|
|
34258
34259
|
}, reminderIntervalMs);
|
|
34259
34260
|
reminderInterval.unref?.();
|
|
34260
34261
|
}
|
|
@@ -34363,12 +34364,237 @@ function createTunnelStartupError(message, stderrOutput, origin) {
|
|
|
34363
34364
|
cloudflared output:
|
|
34364
34365
|
${stderrOutput || "(no output)"}
|
|
34365
34366
|
|
|
34366
|
-
The local dev server started at ${origin.href}
|
|
34367
|
+
The local dev server started at ${origin.href}
|
|
34367
34368
|
` + (isQuickTunnelRateLimited ? "Cloudflare Quick Tunnel creation was rate limited. Try again in a few minutes, or use a named tunnel if you need more reliable access." : `Check the cloudflared output above for more details, and verify that ${origin.href} is reachable from this machine if this keeps happening.`);
|
|
34368
34369
|
if (isQuickTunnelRateLimited) return new UserError(errorMessage, { telemetryMessage: false });
|
|
34369
34370
|
return new Error(errorMessage);
|
|
34370
34371
|
}
|
|
34371
34372
|
__name(createTunnelStartupError, "createTunnelStartupError");
|
|
34373
|
+
function buildDetailedError(message, ...extra) {
|
|
34374
|
+
return new ParseError({
|
|
34375
|
+
text: message,
|
|
34376
|
+
notes: extra.map((text) => ({ text })),
|
|
34377
|
+
telemetryMessage: false
|
|
34378
|
+
});
|
|
34379
|
+
}
|
|
34380
|
+
__name(buildDetailedError, "buildDetailedError");
|
|
34381
|
+
function maybeThrowFriendlyError(error) {
|
|
34382
|
+
if (error.message === "workers.api.error.email_verification_required") throw buildDetailedError("Please verify your account's email address and try again.", "Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one.");
|
|
34383
|
+
}
|
|
34384
|
+
__name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
|
|
34385
|
+
function logHeaders(headers, logger) {
|
|
34386
|
+
const clone = cloneHeaders(headers);
|
|
34387
|
+
clone.delete("Authorization");
|
|
34388
|
+
logger.debugWithSanitization("HEADERS:", JSON.stringify(Object.fromEntries(clone), null, 2));
|
|
34389
|
+
}
|
|
34390
|
+
__name(logHeaders, "logHeaders");
|
|
34391
|
+
async function performApiFetchBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
|
|
34392
|
+
assert(credentials, "credentials are required for performApiFetch");
|
|
34393
|
+
const method = init.method ?? "GET";
|
|
34394
|
+
assert(resource.startsWith("/"), `CF API fetch - resource path must start with a "/" but got "${resource}"`);
|
|
34395
|
+
const headers = cloneHeaders(new import_undici.Headers(init.headers));
|
|
34396
|
+
addAuthorizationHeader(headers, credentials);
|
|
34397
|
+
headers.set("User-Agent", userAgent);
|
|
34398
|
+
maybeAddTraceHeader(headers);
|
|
34399
|
+
const queryString = queryParams ? `?${queryParams.toString()}` : "";
|
|
34400
|
+
logger.debug(`-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`);
|
|
34401
|
+
logger.debugWithSanitization("QUERY STRING:", queryString);
|
|
34402
|
+
logHeaders(headers, logger);
|
|
34403
|
+
logger.debugWithSanitization("INIT:", JSON.stringify({ ...init }, null, 2));
|
|
34404
|
+
if (init.body instanceof import_undici.FormData) logger.debugWithSanitization("BODY:", await new import_undici.Response(init.body).text(), null, 2);
|
|
34405
|
+
logger.debug("-- END CF API REQUEST");
|
|
34406
|
+
return await (0, import_undici.fetch)(`${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`, {
|
|
34407
|
+
method,
|
|
34408
|
+
...init,
|
|
34409
|
+
headers,
|
|
34410
|
+
signal: abortSignal
|
|
34411
|
+
});
|
|
34412
|
+
}
|
|
34413
|
+
__name(performApiFetchBase, "performApiFetchBase");
|
|
34414
|
+
async function fetchInternalBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
|
|
34415
|
+
const method = init.method ?? "GET";
|
|
34416
|
+
const response = await performApiFetchBase(complianceConfig, resource, init, userAgent, logger, queryParams, abortSignal, credentials);
|
|
34417
|
+
const jsonText = await response.text();
|
|
34418
|
+
logger.debug("-- START CF API RESPONSE:", response.statusText, response.status);
|
|
34419
|
+
logHeaders(response.headers, logger);
|
|
34420
|
+
logger.debugWithSanitization("RESPONSE:", jsonText);
|
|
34421
|
+
logger.debug("-- END CF API RESPONSE");
|
|
34422
|
+
if (!jsonText && (response.status === 204 || response.status === 205)) return {
|
|
34423
|
+
response: {
|
|
34424
|
+
result: {},
|
|
34425
|
+
success: true,
|
|
34426
|
+
errors: [],
|
|
34427
|
+
messages: []
|
|
34428
|
+
},
|
|
34429
|
+
status: response.status
|
|
34430
|
+
};
|
|
34431
|
+
if (isWAFBlockResponse(response.headers)) throwWAFBlockError(response.headers, method, resource, response.status, response.statusText);
|
|
34432
|
+
try {
|
|
34433
|
+
return {
|
|
34434
|
+
response: parseJSON(jsonText),
|
|
34435
|
+
status: response.status
|
|
34436
|
+
};
|
|
34437
|
+
} catch {
|
|
34438
|
+
const rayId = extractWAFBlockRayId(response.headers);
|
|
34439
|
+
throw new APIError({
|
|
34440
|
+
text: "Received a malformed response from the API",
|
|
34441
|
+
notes: [
|
|
34442
|
+
{ text: truncate(jsonText, 100) },
|
|
34443
|
+
{ text: `${method} ${resource} -> ${response.status} ${response.statusText}` },
|
|
34444
|
+
...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : []
|
|
34445
|
+
],
|
|
34446
|
+
status: response.status,
|
|
34447
|
+
telemetryMessage: false
|
|
34448
|
+
});
|
|
34449
|
+
}
|
|
34450
|
+
}
|
|
34451
|
+
__name(fetchInternalBase, "fetchInternalBase");
|
|
34452
|
+
async function fetchResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
|
|
34453
|
+
const { response: json, status } = await fetchInternalBase(complianceConfig, resource, init, userAgent, logger, queryParams, abortSignal, credentials);
|
|
34454
|
+
if (json.success) return json.result;
|
|
34455
|
+
else throwFetchError(resource, json, status);
|
|
34456
|
+
}
|
|
34457
|
+
__name(fetchResultBase, "fetchResultBase");
|
|
34458
|
+
async function fetchListResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, credentials) {
|
|
34459
|
+
const results = [];
|
|
34460
|
+
let getMoreResults = true;
|
|
34461
|
+
let cursor;
|
|
34462
|
+
while (getMoreResults) {
|
|
34463
|
+
if (cursor) {
|
|
34464
|
+
queryParams = new URLSearchParams$1(queryParams);
|
|
34465
|
+
queryParams.set("cursor", cursor);
|
|
34466
|
+
}
|
|
34467
|
+
const { response: json, status } = await fetchInternalBase(complianceConfig, resource, init, userAgent, logger, queryParams, void 0, credentials);
|
|
34468
|
+
if (json.success) {
|
|
34469
|
+
results.push(...json.result);
|
|
34470
|
+
if (hasCursor(json.result_info)) cursor = json.result_info?.cursor;
|
|
34471
|
+
else getMoreResults = false;
|
|
34472
|
+
} else throwFetchError(resource, json, status);
|
|
34473
|
+
}
|
|
34474
|
+
return results;
|
|
34475
|
+
}
|
|
34476
|
+
__name(fetchListResultBase, "fetchListResultBase");
|
|
34477
|
+
function truncate(text, maxLength) {
|
|
34478
|
+
const { length } = text;
|
|
34479
|
+
if (length <= maxLength) return text;
|
|
34480
|
+
return `${text.substring(0, maxLength)}... (length = ${length})`;
|
|
34481
|
+
}
|
|
34482
|
+
__name(truncate, "truncate");
|
|
34483
|
+
function isWAFBlockResponse(headers) {
|
|
34484
|
+
return headers.get("cf-mitigated") === "challenge";
|
|
34485
|
+
}
|
|
34486
|
+
__name(isWAFBlockResponse, "isWAFBlockResponse");
|
|
34487
|
+
function extractWAFBlockRayId(headers) {
|
|
34488
|
+
return headers.get("cf-ray") ?? void 0;
|
|
34489
|
+
}
|
|
34490
|
+
__name(extractWAFBlockRayId, "extractWAFBlockRayId");
|
|
34491
|
+
function extractAccountTag(resource) {
|
|
34492
|
+
return (/* @__PURE__ */ new RegExp("/accounts/([a-zA-Z0-9]+)/?")).exec(resource)?.[1];
|
|
34493
|
+
}
|
|
34494
|
+
__name(extractAccountTag, "extractAccountTag");
|
|
34495
|
+
function hasMorePages(result_info) {
|
|
34496
|
+
const page = result_info?.page;
|
|
34497
|
+
const per_page = result_info?.per_page;
|
|
34498
|
+
const total = result_info?.total_count;
|
|
34499
|
+
return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total;
|
|
34500
|
+
}
|
|
34501
|
+
__name(hasMorePages, "hasMorePages");
|
|
34502
|
+
function renderError(err, level = 0) {
|
|
34503
|
+
const indent = " ".repeat(level);
|
|
34504
|
+
const message = err.message ?? "";
|
|
34505
|
+
const chainedMessages = "error_chain" in err ? err.error_chain?.map((chainedError) => `
|
|
34506
|
+
|
|
34507
|
+
${indent}- ${renderError(chainedError, level + 1)}`).join("\n") ?? "" : "";
|
|
34508
|
+
return (err.code ? `${message} [code: ${err.code}]` : message) + (err.documentation_url ? `
|
|
34509
|
+
${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
|
|
34510
|
+
}
|
|
34511
|
+
__name(renderError, "renderError");
|
|
34512
|
+
function addAuthorizationHeader(headers, auth, overrideExisting = false) {
|
|
34513
|
+
if (!headers.has("Authorization") || overrideExisting) if ("apiToken" in auth) {
|
|
34514
|
+
const authorizationHeader = `Bearer ${auth.apiToken}`;
|
|
34515
|
+
validateAuthorizationHeaderValue(authorizationHeader);
|
|
34516
|
+
headers.set("Authorization", authorizationHeader);
|
|
34517
|
+
} else {
|
|
34518
|
+
headers.set("X-Auth-Key", auth.authKey);
|
|
34519
|
+
headers.set("X-Auth-Email", auth.authEmail);
|
|
34520
|
+
}
|
|
34521
|
+
}
|
|
34522
|
+
__name(addAuthorizationHeader, "addAuthorizationHeader");
|
|
34523
|
+
function validateAuthorizationHeaderValue(value) {
|
|
34524
|
+
for (const character of value) {
|
|
34525
|
+
const codePoint = character.codePointAt(0);
|
|
34526
|
+
if (codePoint === void 0 || codePoint > 255) throw new UserError(`The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${formatAuthorizationHeaderCharacter(character, codePoint)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`, { telemetryMessage: "cfetch auth invalid authorization header" });
|
|
34527
|
+
}
|
|
34528
|
+
}
|
|
34529
|
+
__name(validateAuthorizationHeaderValue, "validateAuthorizationHeaderValue");
|
|
34530
|
+
function formatAuthorizationHeaderCharacter(character, codePoint) {
|
|
34531
|
+
if (codePoint === void 0) return "\"\\u{unknown}\"";
|
|
34532
|
+
const codePointLabel = `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")}`;
|
|
34533
|
+
return `${isPrintableCharacter(character) ? `"${character}"` : `"${escapeCharacter(character)}"`} (${codePointLabel})`;
|
|
34534
|
+
}
|
|
34535
|
+
__name(formatAuthorizationHeaderCharacter, "formatAuthorizationHeaderCharacter");
|
|
34536
|
+
function isPrintableCharacter(character) {
|
|
34537
|
+
return !/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(character);
|
|
34538
|
+
}
|
|
34539
|
+
__name(isPrintableCharacter, "isPrintableCharacter");
|
|
34540
|
+
function escapeCharacter(character) {
|
|
34541
|
+
return Array.from(character).map((c) => {
|
|
34542
|
+
const codePoint = c.codePointAt(0);
|
|
34543
|
+
if (codePoint === void 0) return "";
|
|
34544
|
+
return codePoint <= 65535 ? `\\u${codePoint.toString(16).toUpperCase().padStart(4, "0")}` : `\\u{${codePoint.toString(16).toUpperCase()}}`;
|
|
34545
|
+
}).join("");
|
|
34546
|
+
}
|
|
34547
|
+
__name(escapeCharacter, "escapeCharacter");
|
|
34548
|
+
function throwFetchError(resource, response, status) {
|
|
34549
|
+
const errors$1 = response.errors ?? [];
|
|
34550
|
+
for (const error2 of errors$1) maybeThrowFriendlyError(error2);
|
|
34551
|
+
const notes = [...errors$1.map((err) => ({ text: renderError(err) })), ...response.messages?.map((msg) => ({ text: typeof msg === "string" ? msg : msg.message ?? String(msg) })) ?? []];
|
|
34552
|
+
if (notes.length === 0) {
|
|
34553
|
+
const raw = response;
|
|
34554
|
+
const fallbackMessage = typeof raw.error === "string" ? `${raw.error}${raw.code ? ` [code: ${raw.code}]` : ""}` : void 0;
|
|
34555
|
+
if (fallbackMessage) notes.push({ text: fallbackMessage });
|
|
34556
|
+
}
|
|
34557
|
+
const error = new APIError({
|
|
34558
|
+
text: `A request to the Cloudflare API (${resource}) failed.`,
|
|
34559
|
+
notes,
|
|
34560
|
+
status,
|
|
34561
|
+
telemetryMessage: false
|
|
34562
|
+
});
|
|
34563
|
+
const code = errors$1[0]?.code;
|
|
34564
|
+
if (code) error.code = code;
|
|
34565
|
+
error.accountTag = extractAccountTag(resource);
|
|
34566
|
+
throw error;
|
|
34567
|
+
}
|
|
34568
|
+
__name(throwFetchError, "throwFetchError");
|
|
34569
|
+
function throwWAFBlockError(headers, method, resource, status, statusText) {
|
|
34570
|
+
const rayId = extractWAFBlockRayId(headers);
|
|
34571
|
+
throw new APIError({
|
|
34572
|
+
text: "The Cloudflare API responded with a WAF block page instead of the expected JSON response",
|
|
34573
|
+
notes: [
|
|
34574
|
+
{ text: "Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive." },
|
|
34575
|
+
...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : [],
|
|
34576
|
+
{ text: rayId ? "If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above." : "If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser." },
|
|
34577
|
+
{ text: `${method} ${resource} -> ${status} ${statusText}` }
|
|
34578
|
+
],
|
|
34579
|
+
status,
|
|
34580
|
+
telemetryMessage: false
|
|
34581
|
+
});
|
|
34582
|
+
}
|
|
34583
|
+
__name(throwWAFBlockError, "throwWAFBlockError");
|
|
34584
|
+
function hasCursor(result_info) {
|
|
34585
|
+
const cursor = result_info?.cursor;
|
|
34586
|
+
return cursor !== void 0 && cursor !== null && cursor !== "";
|
|
34587
|
+
}
|
|
34588
|
+
__name(hasCursor, "hasCursor");
|
|
34589
|
+
function maybeAddTraceHeader(headers) {
|
|
34590
|
+
const traceHeader = getTraceHeader();
|
|
34591
|
+
if (traceHeader) headers.set("Cf-Trace-Id", traceHeader);
|
|
34592
|
+
}
|
|
34593
|
+
__name(maybeAddTraceHeader, "maybeAddTraceHeader");
|
|
34594
|
+
function cloneHeaders(headers) {
|
|
34595
|
+
return new import_undici.Headers(headers);
|
|
34596
|
+
}
|
|
34597
|
+
__name(cloneHeaders, "cloneHeaders");
|
|
34372
34598
|
var import_update_check = __toESM(require_update_check());
|
|
34373
34599
|
var UPDATE_CHECK_TIMEOUT_MS = 3e3;
|
|
34374
34600
|
var TIMED_OUT = Symbol("timed_out");
|
|
@@ -36619,8 +36845,8 @@ const postfixRE = /[?#].*$/;
|
|
|
36619
36845
|
function cleanUrl(url) {
|
|
36620
36846
|
return url.replace(postfixRE, "");
|
|
36621
36847
|
}
|
|
36622
|
-
function withTrailingSlash(path) {
|
|
36623
|
-
return path.endsWith("/") ? path : `${path}/`;
|
|
36848
|
+
function withTrailingSlash(path$1) {
|
|
36849
|
+
return path$1.endsWith("/") ? path$1 : `${path$1}/`;
|
|
36624
36850
|
}
|
|
36625
36851
|
function createRequestHandler(handler) {
|
|
36626
36852
|
return async (req, res, next) => {
|
|
@@ -42122,15 +42348,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
42122
42348
|
function withTrailingSlash$1(input = "", respectQueryAndFragment) {
|
|
42123
42349
|
if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
|
|
42124
42350
|
if (hasTrailingSlash(input, true)) return input || "/";
|
|
42125
|
-
let path = input;
|
|
42351
|
+
let path$1 = input;
|
|
42126
42352
|
let fragment = "";
|
|
42127
42353
|
const fragmentIndex = input.indexOf("#");
|
|
42128
42354
|
if (fragmentIndex >= 0) {
|
|
42129
|
-
path = input.slice(0, fragmentIndex);
|
|
42355
|
+
path$1 = input.slice(0, fragmentIndex);
|
|
42130
42356
|
fragment = input.slice(fragmentIndex);
|
|
42131
|
-
if (!path) return fragment;
|
|
42357
|
+
if (!path$1) return fragment;
|
|
42132
42358
|
}
|
|
42133
|
-
const [s0, ...s] = path.split("?");
|
|
42359
|
+
const [s0, ...s] = path$1.split("?");
|
|
42134
42360
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
42135
42361
|
}
|
|
42136
42362
|
function isNonEmptyURL(url) {
|
|
@@ -42156,8 +42382,8 @@ const isAbsolute$2 = function(p$1) {
|
|
|
42156
42382
|
//#endregion
|
|
42157
42383
|
//#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
42158
42384
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
42159
|
-
function normalizeSlash(path) {
|
|
42160
|
-
return path.replace(/\\/g, "/");
|
|
42385
|
+
function normalizeSlash(path$1) {
|
|
42386
|
+
return path$1.replace(/\\/g, "/");
|
|
42161
42387
|
}
|
|
42162
42388
|
/**
|
|
42163
42389
|
* @typedef ErrnoExceptionFields
|
|
@@ -42277,8 +42503,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
42277
42503
|
* @param {string} [base]
|
|
42278
42504
|
* @param {string} [message]
|
|
42279
42505
|
*/
|
|
42280
|
-
(path, base, message) => {
|
|
42281
|
-
return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
42506
|
+
(path$1, base, message) => {
|
|
42507
|
+
return `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
42282
42508
|
},
|
|
42283
42509
|
Error
|
|
42284
42510
|
);
|
|
@@ -42308,8 +42534,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
42308
42534
|
* @param {string} base
|
|
42309
42535
|
* @param {boolean} [exactUrl]
|
|
42310
42536
|
*/
|
|
42311
|
-
(path, base, exactUrl = false) => {
|
|
42312
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path}' imported from ${base}`;
|
|
42537
|
+
(path$1, base, exactUrl = false) => {
|
|
42538
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`;
|
|
42313
42539
|
},
|
|
42314
42540
|
Error
|
|
42315
42541
|
);
|
|
@@ -42347,8 +42573,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
42347
42573
|
* @param {string} extension
|
|
42348
42574
|
* @param {string} path
|
|
42349
42575
|
*/
|
|
42350
|
-
(extension, path) => {
|
|
42351
|
-
return `Unknown file extension "${extension}" for ${path}`;
|
|
42576
|
+
(extension, path$1) => {
|
|
42577
|
+
return `Unknown file extension "${extension}" for ${path$1}`;
|
|
42352
42578
|
},
|
|
42353
42579
|
TypeError
|
|
42354
42580
|
);
|
|
@@ -42505,7 +42731,7 @@ function read(jsonPath, { base, specifier }) {
|
|
|
42505
42731
|
/** @type {string | undefined} */
|
|
42506
42732
|
let string;
|
|
42507
42733
|
try {
|
|
42508
|
-
string = fs2.readFileSync(
|
|
42734
|
+
string = fs2.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
|
42509
42735
|
} catch (error) {
|
|
42510
42736
|
const exception = error;
|
|
42511
42737
|
if (exception.code !== "ENOENT") throw exception;
|
|
@@ -42711,15 +42937,15 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
42711
42937
|
const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
|
|
42712
42938
|
const basePath = fileURLToPath(base);
|
|
42713
42939
|
if (!main) process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
42714
|
-
else if (
|
|
42940
|
+
else if (path.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
42715
42941
|
}
|
|
42716
42942
|
/**
|
|
42717
42943
|
* @param {string} path
|
|
42718
42944
|
* @returns {Stats | undefined}
|
|
42719
42945
|
*/
|
|
42720
|
-
function tryStatSync(path) {
|
|
42946
|
+
function tryStatSync(path$1) {
|
|
42721
42947
|
try {
|
|
42722
|
-
return statSync(path);
|
|
42948
|
+
return statSync(path$1);
|
|
42723
42949
|
} catch {}
|
|
42724
42950
|
}
|
|
42725
42951
|
/**
|
|
@@ -42818,7 +43044,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
42818
43044
|
{
|
|
42819
43045
|
const real = realpathSync(filePath);
|
|
42820
43046
|
const { search, hash } = resolved;
|
|
42821
|
-
resolved = pathToFileURL(real + (filePath.endsWith(
|
|
43047
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
|
|
42822
43048
|
resolved.search = search;
|
|
42823
43049
|
resolved.hash = hash;
|
|
42824
43050
|
}
|
|
@@ -43913,9 +44139,10 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
43913
44139
|
const root = userConfig.root ? nodePath.resolve(userConfig.root) : process.cwd();
|
|
43914
44140
|
const prefixedEnv = vite.loadEnv(viteEnv.mode, root, ["CLOUDFLARE_", "WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_"]);
|
|
43915
44141
|
Object.assign(process.env, prefixedEnv);
|
|
44142
|
+
const remoteBindings = prefixedEnv.CLOUDFLARE_VITE_FORCE_LOCAL === "true" ? false : pluginConfig.remoteBindings ?? true;
|
|
43916
44143
|
if (viteEnv.isPreview) return {
|
|
43917
44144
|
...shared,
|
|
43918
|
-
remoteBindings
|
|
44145
|
+
remoteBindings,
|
|
43919
44146
|
type: "preview",
|
|
43920
44147
|
workers: getWorkerConfigs(root, !!process.env.CLOUDFLARE_VITE_BUILD)
|
|
43921
44148
|
};
|
|
@@ -43960,7 +44187,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
43960
44187
|
environmentNameToChildEnvironmentNamesMap,
|
|
43961
44188
|
prerenderWorkerEnvironmentName,
|
|
43962
44189
|
configPaths,
|
|
43963
|
-
remoteBindings
|
|
44190
|
+
remoteBindings,
|
|
43964
44191
|
rawConfigs: { entryWorker: entryWorkerResolvedConfig }
|
|
43965
44192
|
};
|
|
43966
44193
|
let staticRouting;
|
|
@@ -44004,7 +44231,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
44004
44231
|
prerenderWorkerEnvironmentName,
|
|
44005
44232
|
entryWorkerEnvironmentName,
|
|
44006
44233
|
staticRouting,
|
|
44007
|
-
remoteBindings
|
|
44234
|
+
remoteBindings,
|
|
44008
44235
|
rawConfigs: {
|
|
44009
44236
|
entryWorker: entryWorkerResolvedConfig,
|
|
44010
44237
|
auxiliaryWorkers: auxiliaryWorkersResolvedConfigs
|
|
@@ -45207,9 +45434,9 @@ function constructHeaders({ headers, headersFile, logger }) {
|
|
|
45207
45434
|
|
|
45208
45435
|
//#endregion
|
|
45209
45436
|
//#region ../workers-shared/utils/configuration/validateURL.ts
|
|
45210
|
-
const extractPathname = (path = "/", includeSearch, includeHash) => {
|
|
45211
|
-
if (!path.startsWith("/")) path = `/${path}`;
|
|
45212
|
-
const url = new URL(`//${path}`, "relative://");
|
|
45437
|
+
const extractPathname = (path$1 = "/", includeSearch, includeHash) => {
|
|
45438
|
+
if (!path$1.startsWith("/")) path$1 = `/${path$1}`;
|
|
45439
|
+
const url = new URL(`//${path$1}`, "relative://");
|
|
45213
45440
|
return `${url.pathname}${includeSearch ? url.search : ""}${includeHash ? url.hash : ""}`;
|
|
45214
45441
|
};
|
|
45215
45442
|
const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
|
|
@@ -45268,7 +45495,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
45268
45495
|
lineNumber: i$1 + 1,
|
|
45269
45496
|
message: "No headers specified"
|
|
45270
45497
|
});
|
|
45271
|
-
const [path, pathError] = validateUrl(line, false, true);
|
|
45498
|
+
const [path$1, pathError] = validateUrl(line, false, true);
|
|
45272
45499
|
if (pathError) {
|
|
45273
45500
|
invalid.push({
|
|
45274
45501
|
line,
|
|
@@ -45279,7 +45506,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
45279
45506
|
skipUntilNextPath = true;
|
|
45280
45507
|
continue;
|
|
45281
45508
|
}
|
|
45282
|
-
const wildcardError = validateNoMultipleWildcards(path);
|
|
45509
|
+
const wildcardError = validateNoMultipleWildcards(path$1);
|
|
45283
45510
|
if (wildcardError) {
|
|
45284
45511
|
invalid.push({
|
|
45285
45512
|
line,
|
|
@@ -45291,7 +45518,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
45291
45518
|
continue;
|
|
45292
45519
|
}
|
|
45293
45520
|
rule = {
|
|
45294
|
-
path,
|
|
45521
|
+
path: path$1,
|
|
45295
45522
|
line,
|
|
45296
45523
|
headers: {},
|
|
45297
45524
|
unsetHeaders: []
|
|
@@ -45374,11 +45601,11 @@ function isValidRule(rule) {
|
|
|
45374
45601
|
* `:splat` placeholder, would result in duplicate `:splat` parameters which is
|
|
45375
45602
|
* unsupported.
|
|
45376
45603
|
*/
|
|
45377
|
-
function validateNoMultipleWildcards(path) {
|
|
45378
|
-
const wildcardCount = (path.match(SPLAT_REGEX) ?? []).length;
|
|
45379
|
-
const hasSplatPlaceholder = /:splat(?!\w)/.test(path);
|
|
45380
|
-
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path}.`;
|
|
45381
|
-
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path}.`;
|
|
45604
|
+
function validateNoMultipleWildcards(path$1) {
|
|
45605
|
+
const wildcardCount = (path$1.match(SPLAT_REGEX) ?? []).length;
|
|
45606
|
+
const hasSplatPlaceholder = /:splat(?!\w)/.test(path$1);
|
|
45607
|
+
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$1}.`;
|
|
45608
|
+
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$1}.`;
|
|
45382
45609
|
}
|
|
45383
45610
|
|
|
45384
45611
|
//#endregion
|
|
@@ -45595,13 +45822,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
45595
45822
|
const throwError = (message, Ctor) => {
|
|
45596
45823
|
throw new Ctor(message);
|
|
45597
45824
|
};
|
|
45598
|
-
const checkPath = (path, originalPath, doThrow) => {
|
|
45599
|
-
if (!isString$1(path)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
45600
|
-
if (!path) return doThrow(`path must not be empty`, TypeError);
|
|
45601
|
-
if (checkPath.isNotRelative(path)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
|
|
45825
|
+
const checkPath = (path$1, originalPath, doThrow) => {
|
|
45826
|
+
if (!isString$1(path$1)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
45827
|
+
if (!path$1) return doThrow(`path must not be empty`, TypeError);
|
|
45828
|
+
if (checkPath.isNotRelative(path$1)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
|
|
45602
45829
|
return true;
|
|
45603
45830
|
};
|
|
45604
|
-
const isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
|
|
45831
|
+
const isNotRelative = (path$1) => REGEX_TEST_INVALID_PATH.test(path$1);
|
|
45605
45832
|
checkPath.isNotRelative = isNotRelative;
|
|
45606
45833
|
checkPath.convert = (p$1) => p$1;
|
|
45607
45834
|
var Ignore = class {
|
|
@@ -45637,13 +45864,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
45637
45864
|
addPattern(pattern) {
|
|
45638
45865
|
return this.add(pattern);
|
|
45639
45866
|
}
|
|
45640
|
-
_testOne(path, checkUnignored) {
|
|
45867
|
+
_testOne(path$1, checkUnignored) {
|
|
45641
45868
|
let ignored = false;
|
|
45642
45869
|
let unignored = false;
|
|
45643
45870
|
this._rules.forEach((rule) => {
|
|
45644
45871
|
const { negative } = rule;
|
|
45645
45872
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
|
|
45646
|
-
if (rule.regex.test(path)) {
|
|
45873
|
+
if (rule.regex.test(path$1)) {
|
|
45647
45874
|
ignored = !negative;
|
|
45648
45875
|
unignored = negative;
|
|
45649
45876
|
}
|
|
@@ -45654,33 +45881,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
45654
45881
|
};
|
|
45655
45882
|
}
|
|
45656
45883
|
_test(originalPath, cache$2, checkUnignored, slices) {
|
|
45657
|
-
const path = originalPath && checkPath.convert(originalPath);
|
|
45658
|
-
checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
45659
|
-
return this._t(path, cache$2, checkUnignored, slices);
|
|
45884
|
+
const path$1 = originalPath && checkPath.convert(originalPath);
|
|
45885
|
+
checkPath(path$1, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
45886
|
+
return this._t(path$1, cache$2, checkUnignored, slices);
|
|
45660
45887
|
}
|
|
45661
|
-
_t(path, cache$2, checkUnignored, slices) {
|
|
45662
|
-
if (path in cache$2) return cache$2[path];
|
|
45663
|
-
if (!slices) slices = path.split(SLASH);
|
|
45888
|
+
_t(path$1, cache$2, checkUnignored, slices) {
|
|
45889
|
+
if (path$1 in cache$2) return cache$2[path$1];
|
|
45890
|
+
if (!slices) slices = path$1.split(SLASH);
|
|
45664
45891
|
slices.pop();
|
|
45665
|
-
if (!slices.length) return cache$2[path] = this._testOne(path, checkUnignored);
|
|
45892
|
+
if (!slices.length) return cache$2[path$1] = this._testOne(path$1, checkUnignored);
|
|
45666
45893
|
const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
|
|
45667
|
-
return cache$2[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
|
|
45894
|
+
return cache$2[path$1] = parent.ignored ? parent : this._testOne(path$1, checkUnignored);
|
|
45668
45895
|
}
|
|
45669
|
-
ignores(path) {
|
|
45670
|
-
return this._test(path, this._ignoreCache, false).ignored;
|
|
45896
|
+
ignores(path$1) {
|
|
45897
|
+
return this._test(path$1, this._ignoreCache, false).ignored;
|
|
45671
45898
|
}
|
|
45672
45899
|
createFilter() {
|
|
45673
|
-
return (path) => !this.ignores(path);
|
|
45900
|
+
return (path$1) => !this.ignores(path$1);
|
|
45674
45901
|
}
|
|
45675
45902
|
filter(paths) {
|
|
45676
45903
|
return makeArray(paths).filter(this.createFilter());
|
|
45677
45904
|
}
|
|
45678
|
-
test(path) {
|
|
45679
|
-
return this._test(path, this._testCache, true);
|
|
45905
|
+
test(path$1) {
|
|
45906
|
+
return this._test(path$1, this._testCache, true);
|
|
45680
45907
|
}
|
|
45681
45908
|
};
|
|
45682
45909
|
const factory = (options) => new Ignore(options);
|
|
45683
|
-
const isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
|
|
45910
|
+
const isPathValid = (path$1) => checkPath(path$1 && checkPath.convert(path$1), path$1, RETURN_FALSE);
|
|
45684
45911
|
factory.isPathValid = isPathValid;
|
|
45685
45912
|
factory.default = factory;
|
|
45686
45913
|
module.exports = factory;
|
|
@@ -45689,7 +45916,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
45689
45916
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
45690
45917
|
checkPath.convert = makePosix;
|
|
45691
45918
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
45692
|
-
checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
|
|
45919
|
+
checkPath.isNotRelative = (path$1) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$1) || isNotRelative(path$1);
|
|
45693
45920
|
}
|
|
45694
45921
|
}) });
|
|
45695
45922
|
|
|
@@ -47044,11 +47271,11 @@ var Mime = class {
|
|
|
47044
47271
|
}
|
|
47045
47272
|
return this;
|
|
47046
47273
|
}
|
|
47047
|
-
getType(path) {
|
|
47048
|
-
if (typeof path !== "string") return null;
|
|
47049
|
-
const last = path.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
47274
|
+
getType(path$1) {
|
|
47275
|
+
if (typeof path$1 !== "string") return null;
|
|
47276
|
+
const last = path$1.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
47050
47277
|
const ext = last.replace(/^.*\./s, "").toLowerCase();
|
|
47051
|
-
const hasPath = last.length < path.length;
|
|
47278
|
+
const hasPath = last.length < path$1.length;
|
|
47052
47279
|
if (!(ext.length < last.length - 1) && hasPath) return null;
|
|
47053
47280
|
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
|
|
47054
47281
|
}
|
|
@@ -47382,8 +47609,8 @@ function getErrorMap() {
|
|
|
47382
47609
|
//#endregion
|
|
47383
47610
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
47384
47611
|
const makeIssue = (params) => {
|
|
47385
|
-
const { data: data$1, path, errorMaps, issueData } = params;
|
|
47386
|
-
const fullPath = [...path, ...issueData.path || []];
|
|
47612
|
+
const { data: data$1, path: path$1, errorMaps, issueData } = params;
|
|
47613
|
+
const fullPath = [...path$1, ...issueData.path || []];
|
|
47387
47614
|
const fullIssue = {
|
|
47388
47615
|
...issueData,
|
|
47389
47616
|
path: fullPath
|
|
@@ -47495,11 +47722,11 @@ var errorUtil;
|
|
|
47495
47722
|
//#endregion
|
|
47496
47723
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
47497
47724
|
var ParseInputLazyPath = class {
|
|
47498
|
-
constructor(parent, value, path, key) {
|
|
47725
|
+
constructor(parent, value, path$1, key) {
|
|
47499
47726
|
this._cachedPath = [];
|
|
47500
47727
|
this.parent = parent;
|
|
47501
47728
|
this.data = value;
|
|
47502
|
-
this._path = path;
|
|
47729
|
+
this._path = path$1;
|
|
47503
47730
|
this._key = key;
|
|
47504
47731
|
}
|
|
47505
47732
|
get path() {
|
|
@@ -51550,11 +51777,11 @@ const getQueryString = (params) => {
|
|
|
51550
51777
|
};
|
|
51551
51778
|
const getUrl = (config, options) => {
|
|
51552
51779
|
const encoder$1 = config.ENCODE_PATH || encodeURI;
|
|
51553
|
-
const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
51780
|
+
const path$1 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
51554
51781
|
if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
|
|
51555
51782
|
return substring;
|
|
51556
51783
|
});
|
|
51557
|
-
const url = `${config.BASE}${path}`;
|
|
51784
|
+
const url = `${config.BASE}${path$1}`;
|
|
51558
51785
|
if (options.query) return `${url}${getQueryString(options.query)}`;
|
|
51559
51786
|
return url;
|
|
51560
51787
|
};
|
|
@@ -51717,9 +51944,9 @@ const request = (config, options) => {
|
|
|
51717
51944
|
};
|
|
51718
51945
|
const debugLogRequest = async (config, url, headers, body) => {
|
|
51719
51946
|
config.LOGGER?.debug(`-- START CF API REQUEST: ${url}`);
|
|
51720
|
-
const logHeaders = new Headers(headers);
|
|
51721
|
-
logHeaders.delete("Authorization");
|
|
51722
|
-
config.LOGGER?.debugWithSanitization("HEADERS:", JSON.stringify(logHeaders, null, 2));
|
|
51947
|
+
const logHeaders$1 = new Headers(headers);
|
|
51948
|
+
logHeaders$1.delete("Authorization");
|
|
51949
|
+
config.LOGGER?.debugWithSanitization("HEADERS:", JSON.stringify(logHeaders$1, null, 2));
|
|
51723
51950
|
config.LOGGER?.debugWithSanitization("BODY:", JSON.stringify(body instanceof FormData ? await new Response(body).text() : body, null, 2));
|
|
51724
51951
|
config.LOGGER?.debug("-- END CF API REQUEST");
|
|
51725
51952
|
};
|
|
@@ -52605,7 +52832,7 @@ function getContainerOptions(options) {
|
|
|
52605
52832
|
return containersConfig.map((container) => {
|
|
52606
52833
|
if (isDockerfile(container.image, configPath)) return {
|
|
52607
52834
|
dockerfile: container.image,
|
|
52608
|
-
image_build_context: container.image_build_context ??
|
|
52835
|
+
image_build_context: container.image_build_context ?? path.dirname(container.image),
|
|
52609
52836
|
image_vars: container.image_vars,
|
|
52610
52837
|
class_name: container.class_name,
|
|
52611
52838
|
image_tag: getDevContainerImageName(container.class_name, containerBuildId)
|
|
@@ -52621,26 +52848,26 @@ function getContainerOptions(options) {
|
|
|
52621
52848
|
//#endregion
|
|
52622
52849
|
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.4/node_modules/fdir/dist/index.mjs
|
|
52623
52850
|
var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
52624
|
-
function cleanPath(path) {
|
|
52625
|
-
let normalized = normalize(path);
|
|
52851
|
+
function cleanPath(path$1) {
|
|
52852
|
+
let normalized = normalize(path$1);
|
|
52626
52853
|
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
52627
52854
|
return normalized;
|
|
52628
52855
|
}
|
|
52629
52856
|
const SLASHES_REGEX = /[\\/]/g;
|
|
52630
|
-
function convertSlashes(path, separator) {
|
|
52631
|
-
return path.replace(SLASHES_REGEX, separator);
|
|
52857
|
+
function convertSlashes(path$1, separator) {
|
|
52858
|
+
return path$1.replace(SLASHES_REGEX, separator);
|
|
52632
52859
|
}
|
|
52633
52860
|
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
52634
|
-
function isRootDirectory(path) {
|
|
52635
|
-
return path === "/" || WINDOWS_ROOT_DIR_REGEX.test(path);
|
|
52861
|
+
function isRootDirectory(path$1) {
|
|
52862
|
+
return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
|
|
52636
52863
|
}
|
|
52637
|
-
function normalizePath$1(path, options) {
|
|
52864
|
+
function normalizePath$1(path$1, options) {
|
|
52638
52865
|
const { resolvePaths, normalizePath: normalizePath$1$1, pathSeparator } = options;
|
|
52639
|
-
const pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith(".");
|
|
52640
|
-
if (resolvePaths) path = resolve$1(path);
|
|
52641
|
-
if (normalizePath$1$1 || pathNeedsCleaning) path = cleanPath(path);
|
|
52642
|
-
if (path === ".") return "";
|
|
52643
|
-
return convertSlashes(path[path.length - 1] !== pathSeparator ? path + pathSeparator : path, pathSeparator);
|
|
52866
|
+
const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
|
|
52867
|
+
if (resolvePaths) path$1 = resolve$1(path$1);
|
|
52868
|
+
if (normalizePath$1$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
|
|
52869
|
+
if (path$1 === ".") return "";
|
|
52870
|
+
return convertSlashes(path$1[path$1.length - 1] !== pathSeparator ? path$1 + pathSeparator : path$1, pathSeparator);
|
|
52644
52871
|
}
|
|
52645
52872
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
52646
52873
|
return directoryPath + filename;
|
|
@@ -52676,8 +52903,8 @@ const pushDirectory = (directoryPath, paths) => {
|
|
|
52676
52903
|
paths.push(directoryPath || ".");
|
|
52677
52904
|
};
|
|
52678
52905
|
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
52679
|
-
const path = directoryPath || ".";
|
|
52680
|
-
if (filters.every((filter) => filter(path, true))) paths.push(path);
|
|
52906
|
+
const path$1 = directoryPath || ".";
|
|
52907
|
+
if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
|
|
52681
52908
|
};
|
|
52682
52909
|
const empty$2 = () => {};
|
|
52683
52910
|
function build$6(root, options) {
|
|
@@ -52726,26 +52953,26 @@ const empty = () => {};
|
|
|
52726
52953
|
function build$3(options) {
|
|
52727
52954
|
return options.group ? groupFiles : empty;
|
|
52728
52955
|
}
|
|
52729
|
-
const resolveSymlinksAsync = function(path, state, callback$1) {
|
|
52956
|
+
const resolveSymlinksAsync = function(path$1, state, callback$1) {
|
|
52730
52957
|
const { queue, fs: fs$2, options: { suppressErrors } } = state;
|
|
52731
52958
|
queue.enqueue();
|
|
52732
|
-
fs$2.realpath(path, (error, resolvedPath) => {
|
|
52959
|
+
fs$2.realpath(path$1, (error, resolvedPath) => {
|
|
52733
52960
|
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
52734
52961
|
fs$2.stat(resolvedPath, (error$1, stat$1) => {
|
|
52735
52962
|
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
52736
|
-
if (stat$1.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
52963
|
+
if (stat$1.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
|
|
52737
52964
|
callback$1(stat$1, resolvedPath);
|
|
52738
52965
|
queue.dequeue(null, state);
|
|
52739
52966
|
});
|
|
52740
52967
|
});
|
|
52741
52968
|
};
|
|
52742
|
-
const resolveSymlinks = function(path, state, callback$1) {
|
|
52969
|
+
const resolveSymlinks = function(path$1, state, callback$1) {
|
|
52743
52970
|
const { queue, fs: fs$2, options: { suppressErrors } } = state;
|
|
52744
52971
|
queue.enqueue();
|
|
52745
52972
|
try {
|
|
52746
|
-
const resolvedPath = fs$2.realpathSync(path);
|
|
52973
|
+
const resolvedPath = fs$2.realpathSync(path$1);
|
|
52747
52974
|
const stat$1 = fs$2.statSync(resolvedPath);
|
|
52748
|
-
if (stat$1.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
52975
|
+
if (stat$1.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
|
|
52749
52976
|
callback$1(stat$1, resolvedPath);
|
|
52750
52977
|
} catch (e) {
|
|
52751
52978
|
if (!suppressErrors) throw e;
|
|
@@ -52755,16 +52982,16 @@ function build$2(options, isSynchronous) {
|
|
|
52755
52982
|
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
52756
52983
|
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
52757
52984
|
}
|
|
52758
|
-
function isRecursive(path, resolved, state) {
|
|
52985
|
+
function isRecursive(path$1, resolved, state) {
|
|
52759
52986
|
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
52760
|
-
let parent = dirname$1(path);
|
|
52987
|
+
let parent = dirname$1(path$1);
|
|
52761
52988
|
let depth$1 = 1;
|
|
52762
52989
|
while (parent !== state.root && depth$1 < 2) {
|
|
52763
52990
|
const resolvedPath = state.symlinks.get(parent);
|
|
52764
52991
|
if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
|
|
52765
52992
|
else parent = dirname$1(parent);
|
|
52766
52993
|
}
|
|
52767
|
-
state.symlinks.set(path, resolved);
|
|
52994
|
+
state.symlinks.set(path$1, resolved);
|
|
52768
52995
|
return depth$1 > 1;
|
|
52769
52996
|
}
|
|
52770
52997
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
@@ -52945,19 +53172,19 @@ var Walker = class {
|
|
|
52945
53172
|
const filename = this.joinPath(entry.name, directoryPath);
|
|
52946
53173
|
this.pushFile(filename, files, this.state.counts, filters);
|
|
52947
53174
|
} else if (entry.isDirectory()) {
|
|
52948
|
-
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
52949
|
-
if (exclude && exclude(entry.name, path)) continue;
|
|
52950
|
-
this.pushDirectory(path, paths, filters);
|
|
52951
|
-
this.walkDirectory(this.state, path, path, depth$1 - 1, this.walk);
|
|
53175
|
+
let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
53176
|
+
if (exclude && exclude(entry.name, path$1)) continue;
|
|
53177
|
+
this.pushDirectory(path$1, paths, filters);
|
|
53178
|
+
this.walkDirectory(this.state, path$1, path$1, depth$1 - 1, this.walk);
|
|
52952
53179
|
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
52953
|
-
let path = joinPathWithBasePath(entry.name, directoryPath);
|
|
52954
|
-
this.resolveSymlink(path, this.state, (stat$1, resolvedPath) => {
|
|
53180
|
+
let path$1 = joinPathWithBasePath(entry.name, directoryPath);
|
|
53181
|
+
this.resolveSymlink(path$1, this.state, (stat$1, resolvedPath) => {
|
|
52955
53182
|
if (stat$1.isDirectory()) {
|
|
52956
53183
|
resolvedPath = normalizePath$1(resolvedPath, this.state.options);
|
|
52957
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
|
52958
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth$1 - 1, this.walk);
|
|
53184
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
|
|
53185
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth$1 - 1, this.walk);
|
|
52959
53186
|
} else {
|
|
52960
|
-
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
53187
|
+
resolvedPath = useRealPaths ? resolvedPath : path$1;
|
|
52961
53188
|
const filename = basename(resolvedPath);
|
|
52962
53189
|
const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
|
|
52963
53190
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
@@ -53122,7 +53349,7 @@ var Builder = class {
|
|
|
53122
53349
|
isMatch = globFn(patterns, ...options);
|
|
53123
53350
|
this.globCache[patterns.join("\0")] = isMatch;
|
|
53124
53351
|
}
|
|
53125
|
-
this.options.filters.push((path) => isMatch(path));
|
|
53352
|
+
this.options.filters.push((path$1) => isMatch(path$1));
|
|
53126
53353
|
return this;
|
|
53127
53354
|
}
|
|
53128
53355
|
};
|
|
@@ -53336,8 +53563,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
53336
53563
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
53337
53564
|
return output;
|
|
53338
53565
|
};
|
|
53339
|
-
exports.basename = (path, { windows } = {}) => {
|
|
53340
|
-
const segs = path.split(windows ? /[\\/]/ : "/");
|
|
53566
|
+
exports.basename = (path$1, { windows } = {}) => {
|
|
53567
|
+
const segs = path$1.split(windows ? /[\\/]/ : "/");
|
|
53341
53568
|
const last = segs[segs.length - 1];
|
|
53342
53569
|
if (last === "") return segs[segs.length - 2];
|
|
53343
53570
|
return last;
|
|
@@ -55077,15 +55304,15 @@ function buildRelative(cwd, root) {
|
|
|
55077
55304
|
};
|
|
55078
55305
|
}
|
|
55079
55306
|
const splitPatternOptions = { parts: true };
|
|
55080
|
-
function splitPattern(path) {
|
|
55307
|
+
function splitPattern(path$1) {
|
|
55081
55308
|
var _result$parts;
|
|
55082
|
-
const result = import_picomatch.default.scan(path, splitPatternOptions);
|
|
55083
|
-
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path];
|
|
55309
|
+
const result = import_picomatch.default.scan(path$1, splitPatternOptions);
|
|
55310
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
55084
55311
|
}
|
|
55085
55312
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
55086
55313
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
55087
|
-
const escapePosixPath = (path) => path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
55088
|
-
const escapeWin32Path = (path) => path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
55314
|
+
const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
55315
|
+
const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
55089
55316
|
/**
|
|
55090
55317
|
* Escapes a path's special characters depending on the platform.
|
|
55091
55318
|
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
|
|
@@ -55209,13 +55436,13 @@ function buildCrawler(options, patterns) {
|
|
|
55209
55436
|
if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
|
|
55210
55437
|
const crawler = new Builder({
|
|
55211
55438
|
filters: [debug$7 ? (p$1, isDirectory$1) => {
|
|
55212
|
-
const path = format$2(p$1, isDirectory$1);
|
|
55213
|
-
const matches = matcher(path) && !ignore$1(path);
|
|
55214
|
-
if (matches) log(`matched ${path}`);
|
|
55439
|
+
const path$1 = format$2(p$1, isDirectory$1);
|
|
55440
|
+
const matches = matcher(path$1) && !ignore$1(path$1);
|
|
55441
|
+
if (matches) log(`matched ${path$1}`);
|
|
55215
55442
|
return matches;
|
|
55216
55443
|
} : (p$1, isDirectory$1) => {
|
|
55217
|
-
const path = format$2(p$1, isDirectory$1);
|
|
55218
|
-
return matcher(path) && !ignore$1(path);
|
|
55444
|
+
const path$1 = format$2(p$1, isDirectory$1);
|
|
55445
|
+
return matcher(path$1) && !ignore$1(path$1);
|
|
55219
55446
|
}],
|
|
55220
55447
|
exclude: debug$7 ? (_, p$1) => {
|
|
55221
55448
|
const skipped = excludePredicate(_, p$1);
|
|
@@ -55690,6 +55917,12 @@ function getStructuredLogsLogger(logger) {
|
|
|
55690
55917
|
*/
|
|
55691
55918
|
function handleWebSocket(httpServer, miniflare, entryWorkerName) {
|
|
55692
55919
|
const nodeWebSocket = new WebSocketServer({ noServer: true });
|
|
55920
|
+
const workerResponseHeaders = /* @__PURE__ */ new WeakMap();
|
|
55921
|
+
nodeWebSocket.on("headers", (responseHeaders, request$2) => {
|
|
55922
|
+
const extra = workerResponseHeaders.get(request$2);
|
|
55923
|
+
workerResponseHeaders.delete(request$2);
|
|
55924
|
+
if (extra) appendWorkerResponseHeaders(responseHeaders, extra);
|
|
55925
|
+
});
|
|
55693
55926
|
httpServer.on("upgrade", async (request$2, socket, head) => {
|
|
55694
55927
|
socket.on("error", () => socket.destroy());
|
|
55695
55928
|
const rawHost = request$2.headers.host ?? UNKNOWN_HOST;
|
|
@@ -55701,14 +55934,16 @@ function handleWebSocket(httpServer, miniflare, entryWorkerName) {
|
|
|
55701
55934
|
if (isViteRequest && !isSandboxRequest) return;
|
|
55702
55935
|
const headers = createHeaders(request$2);
|
|
55703
55936
|
if (entryWorkerName) headers.set(CoreHeaders.ROUTE_OVERRIDE, entryWorkerName);
|
|
55704
|
-
const
|
|
55937
|
+
const response = await miniflare.dispatchFetch(url, {
|
|
55705
55938
|
headers,
|
|
55706
55939
|
method: request$2.method
|
|
55707
|
-
})
|
|
55940
|
+
});
|
|
55941
|
+
const workerWebSocket = response.webSocket;
|
|
55708
55942
|
if (!workerWebSocket) {
|
|
55709
55943
|
socket.destroy();
|
|
55710
55944
|
return;
|
|
55711
55945
|
}
|
|
55946
|
+
workerResponseHeaders.set(request$2, response.headers);
|
|
55712
55947
|
nodeWebSocket.handleUpgrade(request$2, socket, head, async (clientWebSocket) => {
|
|
55713
55948
|
coupleWebSocket(clientWebSocket, workerWebSocket);
|
|
55714
55949
|
nodeWebSocket.emit("connection", clientWebSocket, request$2);
|
|
@@ -55716,6 +55951,29 @@ function handleWebSocket(httpServer, miniflare, entryWorkerName) {
|
|
|
55716
55951
|
});
|
|
55717
55952
|
}
|
|
55718
55953
|
/**
|
|
55954
|
+
* Headers that must not be forwarded on the 101 upgrade response — they are
|
|
55955
|
+
* either part of the WebSocket handshake managed by `ws` or irrelevant on a
|
|
55956
|
+
* response with no body.
|
|
55957
|
+
*/
|
|
55958
|
+
const EXCLUDED_RESPONSE_HEADERS = new Set([
|
|
55959
|
+
"connection",
|
|
55960
|
+
"content-length",
|
|
55961
|
+
"sec-websocket-accept",
|
|
55962
|
+
"sec-websocket-extensions",
|
|
55963
|
+
"sec-websocket-protocol",
|
|
55964
|
+
"transfer-encoding",
|
|
55965
|
+
"upgrade"
|
|
55966
|
+
]);
|
|
55967
|
+
function appendWorkerResponseHeaders(responseHeaders, workerHeaders) {
|
|
55968
|
+
if (typeof workerHeaders.getSetCookie === "function") for (const cookie of workerHeaders.getSetCookie()) responseHeaders.push(`Set-Cookie: ${cookie}`);
|
|
55969
|
+
workerHeaders.forEach((value, name) => {
|
|
55970
|
+
const lower = name.toLowerCase();
|
|
55971
|
+
if (lower === "set-cookie") return;
|
|
55972
|
+
if (EXCLUDED_RESPONSE_HEADERS.has(lower)) return;
|
|
55973
|
+
responseHeaders.push(`${name}: ${value}`);
|
|
55974
|
+
});
|
|
55975
|
+
}
|
|
55976
|
+
/**
|
|
55719
55977
|
* Matches the origin of a Sandbox SDK preview URL.
|
|
55720
55978
|
* See: https://developers.cloudflare.com/sandbox/concepts/preview-urls/
|
|
55721
55979
|
*
|
|
@@ -56258,13 +56516,13 @@ const wslDefaultBrowser = async () => {
|
|
|
56258
56516
|
const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
|
|
56259
56517
|
return stdout.trim();
|
|
56260
56518
|
};
|
|
56261
|
-
const convertWslPathToWindows = async (path) => {
|
|
56262
|
-
if (/^[a-z]+:\/\//i.test(path)) return path;
|
|
56519
|
+
const convertWslPathToWindows = async (path$1) => {
|
|
56520
|
+
if (/^[a-z]+:\/\//i.test(path$1)) return path$1;
|
|
56263
56521
|
try {
|
|
56264
|
-
const { stdout } = await execFile$1("wslpath", ["-aw", path], { encoding: "utf8" });
|
|
56522
|
+
const { stdout } = await execFile$1("wslpath", ["-aw", path$1], { encoding: "utf8" });
|
|
56265
56523
|
return stdout.trim();
|
|
56266
56524
|
} catch {
|
|
56267
|
-
return path;
|
|
56525
|
+
return path$1;
|
|
56268
56526
|
}
|
|
56269
56527
|
};
|
|
56270
56528
|
|
|
@@ -56450,8 +56708,8 @@ var is_in_ssh_default = isInSsh;
|
|
|
56450
56708
|
//#endregion
|
|
56451
56709
|
//#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
56452
56710
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
56453
|
-
const __dirname = import.meta.url ?
|
|
56454
|
-
const localXdgOpenPath =
|
|
56711
|
+
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
56712
|
+
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
56455
56713
|
const { platform, arch: arch$1 } = process$1;
|
|
56456
56714
|
const tryEachApp = async (apps$1, opener) => {
|
|
56457
56715
|
if (apps$1.length === 0) return;
|