wrangler 4.156.1 → 4.157.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config-schema.json +6 -6
- package/package.json +19 -19
- package/wrangler-dist/cli.d.ts +5 -6
- package/wrangler-dist/cli.js +994 -744
package/wrangler-dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ var path29 = require('path');
|
|
|
5
5
|
var nodeModule = require('module');
|
|
6
6
|
var Url = require('url');
|
|
7
7
|
var os7 = require('os');
|
|
8
|
-
var
|
|
8
|
+
var assert39 = require('assert');
|
|
9
9
|
var process17 = require('process');
|
|
10
10
|
var tty = require('tty');
|
|
11
11
|
var util = require('util');
|
|
@@ -58,7 +58,7 @@ var path29__namespace = /*#__PURE__*/_interopNamespace(path29);
|
|
|
58
58
|
var nodeModule__namespace = /*#__PURE__*/_interopNamespace(nodeModule);
|
|
59
59
|
var Url__default = /*#__PURE__*/_interopDefault(Url);
|
|
60
60
|
var os7__namespace = /*#__PURE__*/_interopNamespace(os7);
|
|
61
|
-
var
|
|
61
|
+
var assert39__default = /*#__PURE__*/_interopDefault(assert39);
|
|
62
62
|
var process17__default = /*#__PURE__*/_interopDefault(process17);
|
|
63
63
|
var tty__default = /*#__PURE__*/_interopDefault(tty);
|
|
64
64
|
var util__namespace = /*#__PURE__*/_interopNamespace(util);
|
|
@@ -186,7 +186,7 @@ var init_MultipartBody = __esm({
|
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
// ../workers-utils/src/config/environment.ts
|
|
189
|
-
var ARTIFACTS_EVENT_TYPES, WORKFLOW_JURISDICTIONS;
|
|
189
|
+
var ARTIFACTS_EVENT_TYPES, WORKFLOW_JURISDICTIONS, DEFAULT_MODULE_RULES;
|
|
190
190
|
var init_environment = __esm({
|
|
191
191
|
"../workers-utils/src/config/environment.ts"() {
|
|
192
192
|
init_import_meta_url();
|
|
@@ -202,6 +202,11 @@ var init_environment = __esm({
|
|
|
202
202
|
"cf.artifacts.repo.token.revoked"
|
|
203
203
|
];
|
|
204
204
|
WORKFLOW_JURISDICTIONS = ["eu", "fedramp", "us"];
|
|
205
|
+
DEFAULT_MODULE_RULES = [
|
|
206
|
+
{ type: "Text", globs: ["**/*.txt", "**/*.html", "**/*.sql"] },
|
|
207
|
+
{ type: "Data", globs: ["**/*.bin"] },
|
|
208
|
+
{ type: "CompiledWasm", globs: ["**/*.wasm", "**/*.wasm?module"] }
|
|
209
|
+
];
|
|
205
210
|
}
|
|
206
211
|
});
|
|
207
212
|
|
|
@@ -25960,7 +25965,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
|
|
|
25960
25965
|
);
|
|
25961
25966
|
}
|
|
25962
25967
|
const envName = args.env ?? getCloudflareEnv();
|
|
25963
|
-
|
|
25968
|
+
assert39__default.default(envName === void 0 || typeof envName === "string");
|
|
25964
25969
|
let activeEnv = topLevelEnv;
|
|
25965
25970
|
if (envName) {
|
|
25966
25971
|
if (isRedirectedConfig2) {
|
|
@@ -26163,7 +26168,7 @@ function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
|
|
|
26163
26168
|
}
|
|
26164
26169
|
}
|
|
26165
26170
|
function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
26166
|
-
|
|
26171
|
+
assert39__default.default(typeof args === "object" && args !== null && !Array.isArray(args));
|
|
26167
26172
|
const {
|
|
26168
26173
|
localProtocol: localProtocolArg,
|
|
26169
26174
|
upstreamProtocol: upstreamProtocolArg,
|
|
@@ -26171,17 +26176,17 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
|
26171
26176
|
enableContainers: enableContainersArg,
|
|
26172
26177
|
generateTypes: generateTypesArg
|
|
26173
26178
|
} = args;
|
|
26174
|
-
|
|
26179
|
+
assert39__default.default(
|
|
26175
26180
|
localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
|
|
26176
26181
|
);
|
|
26177
|
-
|
|
26182
|
+
assert39__default.default(
|
|
26178
26183
|
upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https"
|
|
26179
26184
|
);
|
|
26180
|
-
|
|
26181
|
-
|
|
26185
|
+
assert39__default.default(remoteArg === void 0 || typeof remoteArg === "boolean");
|
|
26186
|
+
assert39__default.default(
|
|
26182
26187
|
enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
|
|
26183
26188
|
);
|
|
26184
|
-
|
|
26189
|
+
assert39__default.default(
|
|
26185
26190
|
generateTypesArg === void 0 || typeof generateTypesArg === "boolean"
|
|
26186
26191
|
);
|
|
26187
26192
|
const {
|
|
@@ -33014,7 +33019,7 @@ var DEFAULT_COMPAT_DATE;
|
|
|
33014
33019
|
var init_default_compat_date = __esm({
|
|
33015
33020
|
"../workers-utils/src/default-compat-date.ts"() {
|
|
33016
33021
|
init_import_meta_url();
|
|
33017
|
-
DEFAULT_COMPAT_DATE = "2026-11-
|
|
33022
|
+
DEFAULT_COMPAT_DATE = "2026-11-03";
|
|
33018
33023
|
}
|
|
33019
33024
|
});
|
|
33020
33025
|
|
|
@@ -34791,12 +34796,100 @@ var init_print_bindings = __esm({
|
|
|
34791
34796
|
function isNodejsCompatDefaultOn(compatibilityDate) {
|
|
34792
34797
|
return compatibilityDate !== void 0 && compatibilityDate >= NODEJS_COMPAT_DEFAULT_ON_DATE;
|
|
34793
34798
|
}
|
|
34794
|
-
|
|
34799
|
+
function resolveNodejsCompat(compatibilityDate, compatibilityFlags) {
|
|
34800
|
+
const isDefaultOn = isNodejsCompatDefaultOn(compatibilityDate);
|
|
34801
|
+
const isNodejsCompatEnabled = compatibilityFlags.includes("nodejs_compat") || isDefaultOn && !compatibilityFlags.includes("no_nodejs_compat");
|
|
34802
|
+
const isNodejsCompatV2Enabled = compatibilityFlags.includes("nodejs_compat_v2") || !compatibilityFlags.includes("no_nodejs_compat_v2") && (isDefaultOn || isNodejsCompatEnabled && compatibilityDate >= NODEJS_COMPAT_V2_SWITCH_OVER_DATE);
|
|
34803
|
+
return { isNodejsCompatEnabled, isNodejsCompatV2Enabled };
|
|
34804
|
+
}
|
|
34805
|
+
var NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE;
|
|
34795
34806
|
var init_compatibility_date = __esm({
|
|
34796
34807
|
"../workers-utils/src/compatibility-date.ts"() {
|
|
34797
34808
|
init_import_meta_url();
|
|
34798
34809
|
NODEJS_COMPAT_DEFAULT_ON_DATE = "2026-08-04";
|
|
34799
34810
|
__name(isNodejsCompatDefaultOn, "isNodejsCompatDefaultOn");
|
|
34811
|
+
NODEJS_COMPAT_V2_SWITCH_OVER_DATE = "2024-09-23";
|
|
34812
|
+
__name(resolveNodejsCompat, "resolveNodejsCompat");
|
|
34813
|
+
}
|
|
34814
|
+
});
|
|
34815
|
+
|
|
34816
|
+
// ../workers-utils/src/node-compat.ts
|
|
34817
|
+
function getNodeCompat(compatibilityDate = "2000-01-01", compatibilityFlags) {
|
|
34818
|
+
const {
|
|
34819
|
+
hasNodejsAlsFlag,
|
|
34820
|
+
hasNodejsCompatFlag,
|
|
34821
|
+
hasNoNodejsCompatFlag,
|
|
34822
|
+
hasNodejsCompatV2Flag,
|
|
34823
|
+
hasNoNodejsCompatV2Flag,
|
|
34824
|
+
hasExperimentalNodejsCompatV2Flag
|
|
34825
|
+
} = parseNodeCompatibilityFlags(compatibilityFlags);
|
|
34826
|
+
const { isNodejsCompatEnabled, isNodejsCompatV2Enabled } = resolveNodejsCompat(compatibilityDate, compatibilityFlags);
|
|
34827
|
+
let mode = null;
|
|
34828
|
+
if (isNodejsCompatV2Enabled) {
|
|
34829
|
+
mode = "v2";
|
|
34830
|
+
} else if (isNodejsCompatEnabled) {
|
|
34831
|
+
mode = "v1";
|
|
34832
|
+
} else if (hasNodejsAlsFlag) {
|
|
34833
|
+
mode = "als";
|
|
34834
|
+
}
|
|
34835
|
+
return {
|
|
34836
|
+
mode,
|
|
34837
|
+
// Whether workerd will enable the `nodejs_compat`/`nodejs_compat_v2`
|
|
34838
|
+
// features, accounting for both the flags and the compatibility date.
|
|
34839
|
+
isNodejsCompatEnabled,
|
|
34840
|
+
isNodejsCompatV2Enabled,
|
|
34841
|
+
// Whether each flag was explicitly specified.
|
|
34842
|
+
hasNodejsAlsFlag,
|
|
34843
|
+
hasNodejsCompatFlag,
|
|
34844
|
+
hasNoNodejsCompatFlag,
|
|
34845
|
+
hasNodejsCompatV2Flag,
|
|
34846
|
+
hasNoNodejsCompatV2Flag,
|
|
34847
|
+
hasExperimentalNodejsCompatV2Flag
|
|
34848
|
+
};
|
|
34849
|
+
}
|
|
34850
|
+
function parseNodeCompatibilityFlags(compatibilityFlags) {
|
|
34851
|
+
return {
|
|
34852
|
+
hasNodejsAlsFlag: compatibilityFlags.includes("nodejs_als"),
|
|
34853
|
+
hasNodejsCompatFlag: compatibilityFlags.includes("nodejs_compat"),
|
|
34854
|
+
hasNoNodejsCompatFlag: compatibilityFlags.includes("no_nodejs_compat"),
|
|
34855
|
+
hasNodejsCompatV2Flag: compatibilityFlags.includes("nodejs_compat_v2"),
|
|
34856
|
+
hasNoNodejsCompatV2Flag: compatibilityFlags.includes("no_nodejs_compat_v2"),
|
|
34857
|
+
hasExperimentalNodejsCompatV2Flag: compatibilityFlags.includes(
|
|
34858
|
+
"experimental:nodejs_compat_v2"
|
|
34859
|
+
)
|
|
34860
|
+
};
|
|
34861
|
+
}
|
|
34862
|
+
var init_node_compat = __esm({
|
|
34863
|
+
"../workers-utils/src/node-compat.ts"() {
|
|
34864
|
+
init_import_meta_url();
|
|
34865
|
+
init_compatibility_date();
|
|
34866
|
+
__name(getNodeCompat, "getNodeCompat");
|
|
34867
|
+
__name(parseNodeCompatibilityFlags, "parseNodeCompatibilityFlags");
|
|
34868
|
+
}
|
|
34869
|
+
});
|
|
34870
|
+
function getFreshSourceMapSupport() {
|
|
34871
|
+
const realRequire = nodeModule.createRequire(import_meta_url || __filename);
|
|
34872
|
+
const resolvedSupportPath = realRequire.resolve(
|
|
34873
|
+
"@cspotcode/source-map-support"
|
|
34874
|
+
);
|
|
34875
|
+
const originalSymbolFor = Symbol.for;
|
|
34876
|
+
const originalSupport = realRequire.cache[resolvedSupportPath];
|
|
34877
|
+
try {
|
|
34878
|
+
Symbol.for = (key) => {
|
|
34879
|
+
assert39__default.default.strictEqual(key, "source-map-support/sharedData");
|
|
34880
|
+
return Symbol(key);
|
|
34881
|
+
};
|
|
34882
|
+
delete realRequire.cache[resolvedSupportPath];
|
|
34883
|
+
return realRequire(resolvedSupportPath);
|
|
34884
|
+
} finally {
|
|
34885
|
+
Symbol.for = originalSymbolFor;
|
|
34886
|
+
realRequire.cache[resolvedSupportPath] = originalSupport;
|
|
34887
|
+
}
|
|
34888
|
+
}
|
|
34889
|
+
var init_sourcemap = __esm({
|
|
34890
|
+
"../workers-utils/src/sourcemap.ts"() {
|
|
34891
|
+
init_import_meta_url();
|
|
34892
|
+
__name(getFreshSourceMapSupport, "getFreshSourceMapSupport");
|
|
34800
34893
|
}
|
|
34801
34894
|
});
|
|
34802
34895
|
|
|
@@ -36806,7 +36899,7 @@ var require_tree = __commonJS({
|
|
|
36806
36899
|
var require_util = __commonJS({
|
|
36807
36900
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/core/util.js"(exports2, module2) {
|
|
36808
36901
|
init_import_meta_url();
|
|
36809
|
-
var
|
|
36902
|
+
var assert72 = __require("assert");
|
|
36810
36903
|
var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
|
|
36811
36904
|
var { IncomingMessage } = __require("http");
|
|
36812
36905
|
var stream2 = __require("stream");
|
|
@@ -36827,7 +36920,7 @@ var require_util = __commonJS({
|
|
|
36827
36920
|
this[kBodyUsed] = false;
|
|
36828
36921
|
}
|
|
36829
36922
|
async *[Symbol.asyncIterator]() {
|
|
36830
|
-
|
|
36923
|
+
assert72(!this[kBodyUsed], "disturbed");
|
|
36831
36924
|
this[kBodyUsed] = true;
|
|
36832
36925
|
yield* this[kBody];
|
|
36833
36926
|
}
|
|
@@ -36839,7 +36932,7 @@ var require_util = __commonJS({
|
|
|
36839
36932
|
if (isStream(body)) {
|
|
36840
36933
|
if (bodyLength(body) === 0) {
|
|
36841
36934
|
body.on("data", function() {
|
|
36842
|
-
|
|
36935
|
+
assert72(false);
|
|
36843
36936
|
});
|
|
36844
36937
|
}
|
|
36845
36938
|
if (typeof body.readableDidRead !== "boolean") {
|
|
@@ -36959,7 +37052,7 @@ var require_util = __commonJS({
|
|
|
36959
37052
|
function getHostname(host) {
|
|
36960
37053
|
if (host[0] === "[") {
|
|
36961
37054
|
const idx2 = host.indexOf("]");
|
|
36962
|
-
|
|
37055
|
+
assert72(idx2 !== -1);
|
|
36963
37056
|
return host.substring(1, idx2);
|
|
36964
37057
|
}
|
|
36965
37058
|
const idx = host.indexOf(":");
|
|
@@ -36971,7 +37064,7 @@ var require_util = __commonJS({
|
|
|
36971
37064
|
if (!host) {
|
|
36972
37065
|
return null;
|
|
36973
37066
|
}
|
|
36974
|
-
|
|
37067
|
+
assert72(typeof host === "string");
|
|
36975
37068
|
const servername = getHostname(host);
|
|
36976
37069
|
if (net3.isIP(servername)) {
|
|
36977
37070
|
return "";
|
|
@@ -37529,7 +37622,7 @@ var require_util = __commonJS({
|
|
|
37529
37622
|
function errorRequest(client, request4, err) {
|
|
37530
37623
|
try {
|
|
37531
37624
|
request4.onError(err);
|
|
37532
|
-
|
|
37625
|
+
assert72(request4.aborted);
|
|
37533
37626
|
} catch (err2) {
|
|
37534
37627
|
client.emit("error", err2);
|
|
37535
37628
|
}
|
|
@@ -37935,7 +38028,7 @@ var require_request = __commonJS({
|
|
|
37935
38028
|
InvalidArgumentError,
|
|
37936
38029
|
NotSupportedError
|
|
37937
38030
|
} = require_errors();
|
|
37938
|
-
var
|
|
38031
|
+
var assert72 = __require("assert");
|
|
37939
38032
|
var {
|
|
37940
38033
|
isValidHTTPToken,
|
|
37941
38034
|
isValidHeaderValue,
|
|
@@ -38137,8 +38230,8 @@ var require_request = __commonJS({
|
|
|
38137
38230
|
}
|
|
38138
38231
|
}
|
|
38139
38232
|
onConnect(abort) {
|
|
38140
|
-
|
|
38141
|
-
|
|
38233
|
+
assert72(!this.aborted);
|
|
38234
|
+
assert72(!this.completed);
|
|
38142
38235
|
if (this.error) {
|
|
38143
38236
|
abort(this.error);
|
|
38144
38237
|
} else {
|
|
@@ -38150,8 +38243,8 @@ var require_request = __commonJS({
|
|
|
38150
38243
|
return this[kHandler].onResponseStarted?.();
|
|
38151
38244
|
}
|
|
38152
38245
|
onHeaders(statusCode, headers, resume, statusText) {
|
|
38153
|
-
|
|
38154
|
-
|
|
38246
|
+
assert72(!this.aborted);
|
|
38247
|
+
assert72(!this.completed);
|
|
38155
38248
|
if (channels.headers.hasSubscribers) {
|
|
38156
38249
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
38157
38250
|
}
|
|
@@ -38162,8 +38255,8 @@ var require_request = __commonJS({
|
|
|
38162
38255
|
}
|
|
38163
38256
|
}
|
|
38164
38257
|
onData(chunk) {
|
|
38165
|
-
|
|
38166
|
-
|
|
38258
|
+
assert72(!this.aborted);
|
|
38259
|
+
assert72(!this.completed);
|
|
38167
38260
|
if (channels.bodyChunkReceived.hasSubscribers) {
|
|
38168
38261
|
channels.bodyChunkReceived.publish({ request: this, chunk });
|
|
38169
38262
|
}
|
|
@@ -38182,8 +38275,8 @@ var require_request = __commonJS({
|
|
|
38182
38275
|
*/
|
|
38183
38276
|
onUpgrade(statusCode, headers, socket, statusText = "") {
|
|
38184
38277
|
this.onFinally();
|
|
38185
|
-
|
|
38186
|
-
|
|
38278
|
+
assert72(!this.aborted);
|
|
38279
|
+
assert72(!this.completed);
|
|
38187
38280
|
if (channels.headers.hasSubscribers) {
|
|
38188
38281
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
38189
38282
|
}
|
|
@@ -38198,8 +38291,8 @@ var require_request = __commonJS({
|
|
|
38198
38291
|
}
|
|
38199
38292
|
onComplete(trailers) {
|
|
38200
38293
|
this.onFinally();
|
|
38201
|
-
|
|
38202
|
-
|
|
38294
|
+
assert72(!this.aborted);
|
|
38295
|
+
assert72(!this.completed);
|
|
38203
38296
|
this.completed = true;
|
|
38204
38297
|
if (channels.trailers.hasSubscribers) {
|
|
38205
38298
|
channels.trailers.publish({ request: this, trailers });
|
|
@@ -38725,7 +38818,7 @@ var require_connect = __commonJS({
|
|
|
38725
38818
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/core/connect.js"(exports2, module2) {
|
|
38726
38819
|
init_import_meta_url();
|
|
38727
38820
|
var net3 = __require("net");
|
|
38728
|
-
var
|
|
38821
|
+
var assert72 = __require("assert");
|
|
38729
38822
|
var util2 = require_util();
|
|
38730
38823
|
var { InvalidArgumentError } = require_errors();
|
|
38731
38824
|
var tls;
|
|
@@ -38792,7 +38885,7 @@ var require_connect = __commonJS({
|
|
|
38792
38885
|
}
|
|
38793
38886
|
servername = servername || options.servername || util2.getServerName(host) || null;
|
|
38794
38887
|
const sessionKey = servername || hostname4;
|
|
38795
|
-
|
|
38888
|
+
assert72(sessionKey);
|
|
38796
38889
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
|
38797
38890
|
port = port || 443;
|
|
38798
38891
|
socket = tls.connect({
|
|
@@ -38812,7 +38905,7 @@ var require_connect = __commonJS({
|
|
|
38812
38905
|
sessionCache.set(sessionKey, session2);
|
|
38813
38906
|
});
|
|
38814
38907
|
} else {
|
|
38815
|
-
|
|
38908
|
+
assert72(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
38816
38909
|
port = port || 80;
|
|
38817
38910
|
socket = net3.connect({
|
|
38818
38911
|
highWaterMark: 64 * 1024,
|
|
@@ -39812,7 +39905,7 @@ var require_encoding = __commonJS({
|
|
|
39812
39905
|
var require_infra = __commonJS({
|
|
39813
39906
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/infra/index.js"(exports2, module2) {
|
|
39814
39907
|
init_import_meta_url();
|
|
39815
|
-
var
|
|
39908
|
+
var assert72 = __require("assert");
|
|
39816
39909
|
var { utf8DecodeBytes } = require_encoding();
|
|
39817
39910
|
function collectASequenceOfCodePoints(condition, input2, position) {
|
|
39818
39911
|
let result = "";
|
|
@@ -39888,7 +39981,7 @@ var require_infra = __commonJS({
|
|
|
39888
39981
|
__name(isomorphicDecode, "isomorphicDecode");
|
|
39889
39982
|
var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
|
|
39890
39983
|
function isomorphicEncode(input2) {
|
|
39891
|
-
|
|
39984
|
+
assert72(!invalidIsomorphicEncodeValueRegex.test(input2));
|
|
39892
39985
|
return input2;
|
|
39893
39986
|
}
|
|
39894
39987
|
__name(isomorphicEncode, "isomorphicEncode");
|
|
@@ -39917,7 +40010,7 @@ var require_infra = __commonJS({
|
|
|
39917
40010
|
if (result === void 0) {
|
|
39918
40011
|
throw new TypeError("Value is not JSON serializable");
|
|
39919
40012
|
}
|
|
39920
|
-
|
|
40013
|
+
assert72(typeof result === "string");
|
|
39921
40014
|
return result;
|
|
39922
40015
|
}
|
|
39923
40016
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
|
@@ -39941,14 +40034,14 @@ var require_infra = __commonJS({
|
|
|
39941
40034
|
var require_data_url = __commonJS({
|
|
39942
40035
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) {
|
|
39943
40036
|
init_import_meta_url();
|
|
39944
|
-
var
|
|
40037
|
+
var assert72 = __require("assert");
|
|
39945
40038
|
var { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra();
|
|
39946
40039
|
var encoder2 = new TextEncoder();
|
|
39947
40040
|
var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u;
|
|
39948
40041
|
var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u;
|
|
39949
40042
|
var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;
|
|
39950
40043
|
function dataURLProcessor(dataURL) {
|
|
39951
|
-
|
|
40044
|
+
assert72(dataURL.protocol === "data:");
|
|
39952
40045
|
let input2 = URLSerializer(dataURL, true);
|
|
39953
40046
|
input2 = input2.slice(5);
|
|
39954
40047
|
const position = { position: 0 };
|
|
@@ -40120,7 +40213,7 @@ var require_data_url = __commonJS({
|
|
|
40120
40213
|
function collectAnHTTPQuotedString(input2, position, extractValue2 = false) {
|
|
40121
40214
|
const positionStart = position.position;
|
|
40122
40215
|
let value = "";
|
|
40123
|
-
|
|
40216
|
+
assert72(input2[position.position] === '"');
|
|
40124
40217
|
position.position++;
|
|
40125
40218
|
while (true) {
|
|
40126
40219
|
value += collectASequenceOfCodePoints(
|
|
@@ -40141,7 +40234,7 @@ var require_data_url = __commonJS({
|
|
|
40141
40234
|
value += input2[position.position];
|
|
40142
40235
|
position.position++;
|
|
40143
40236
|
} else {
|
|
40144
|
-
|
|
40237
|
+
assert72(quoteOrBackslash === '"');
|
|
40145
40238
|
break;
|
|
40146
40239
|
}
|
|
40147
40240
|
}
|
|
@@ -40152,7 +40245,7 @@ var require_data_url = __commonJS({
|
|
|
40152
40245
|
}
|
|
40153
40246
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
|
40154
40247
|
function serializeAMimeType(mimeType) {
|
|
40155
|
-
|
|
40248
|
+
assert72(mimeType !== "failure");
|
|
40156
40249
|
const { parameters, essence } = mimeType;
|
|
40157
40250
|
let serialization = essence;
|
|
40158
40251
|
for (let [name2, value] of parameters.entries()) {
|
|
@@ -40340,7 +40433,7 @@ var require_runtime_features = __commonJS({
|
|
|
40340
40433
|
var require_webidl = __commonJS({
|
|
40341
40434
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/webidl/index.js"(exports2, module2) {
|
|
40342
40435
|
init_import_meta_url();
|
|
40343
|
-
var
|
|
40436
|
+
var assert72 = __require("assert");
|
|
40344
40437
|
var { types: types14, inspect: inspect5 } = __require("util");
|
|
40345
40438
|
var { runtimeFeatures } = require_runtime_features();
|
|
40346
40439
|
var UNDEFINED = 1;
|
|
@@ -40696,7 +40789,7 @@ var require_webidl = __commonJS({
|
|
|
40696
40789
|
offset = jsBufferSource.byteOffset;
|
|
40697
40790
|
length = jsBufferSource.byteLength;
|
|
40698
40791
|
} else {
|
|
40699
|
-
|
|
40792
|
+
assert72(types14.isAnyArrayBuffer(jsBufferSource));
|
|
40700
40793
|
length = jsBufferSource.byteLength;
|
|
40701
40794
|
}
|
|
40702
40795
|
if (jsArrayBuffer.detached) {
|
|
@@ -40949,7 +41042,7 @@ var require_util2 = __commonJS({
|
|
|
40949
41042
|
var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
|
|
40950
41043
|
var { performance: performance2 } = __require("perf_hooks");
|
|
40951
41044
|
var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
|
|
40952
|
-
var
|
|
41045
|
+
var assert72 = __require("assert");
|
|
40953
41046
|
var { isUint8Array } = __require("util/types");
|
|
40954
41047
|
var { webidl } = require_webidl();
|
|
40955
41048
|
var { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require_infra();
|
|
@@ -41152,7 +41245,7 @@ var require_util2 = __commonJS({
|
|
|
41152
41245
|
__name(clonePolicyContainer, "clonePolicyContainer");
|
|
41153
41246
|
function determineRequestsReferrer(request4) {
|
|
41154
41247
|
const policy = request4.referrerPolicy;
|
|
41155
|
-
|
|
41248
|
+
assert72(policy);
|
|
41156
41249
|
let referrerSource = null;
|
|
41157
41250
|
if (request4.referrer === "client") {
|
|
41158
41251
|
const globalOrigin = getGlobalOrigin();
|
|
@@ -41216,7 +41309,7 @@ var require_util2 = __commonJS({
|
|
|
41216
41309
|
}
|
|
41217
41310
|
__name(determineRequestsReferrer, "determineRequestsReferrer");
|
|
41218
41311
|
function stripURLForReferrer(url4, originOnly = false) {
|
|
41219
|
-
|
|
41312
|
+
assert72(webidl.is.URL(url4));
|
|
41220
41313
|
url4 = new URL(url4);
|
|
41221
41314
|
if (urlIsLocal(url4)) {
|
|
41222
41315
|
return "no-referrer";
|
|
@@ -41480,7 +41573,7 @@ var require_util2 = __commonJS({
|
|
|
41480
41573
|
}
|
|
41481
41574
|
__name(readAllBytes, "readAllBytes");
|
|
41482
41575
|
function urlIsLocal(url4) {
|
|
41483
|
-
|
|
41576
|
+
assert72("protocol" in url4);
|
|
41484
41577
|
const protocol = url4.protocol;
|
|
41485
41578
|
return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
|
41486
41579
|
}
|
|
@@ -41490,7 +41583,7 @@ var require_util2 = __commonJS({
|
|
|
41490
41583
|
}
|
|
41491
41584
|
__name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
|
41492
41585
|
function urlIsHttpHttpsScheme(url4) {
|
|
41493
|
-
|
|
41586
|
+
assert72("protocol" in url4);
|
|
41494
41587
|
const protocol = url4.protocol;
|
|
41495
41588
|
return protocol === "http:" || protocol === "https:";
|
|
41496
41589
|
}
|
|
@@ -41663,7 +41756,7 @@ var require_util2 = __commonJS({
|
|
|
41663
41756
|
continue;
|
|
41664
41757
|
}
|
|
41665
41758
|
} else {
|
|
41666
|
-
|
|
41759
|
+
assert72(input2.charCodeAt(position.position) === 44);
|
|
41667
41760
|
position.position++;
|
|
41668
41761
|
}
|
|
41669
41762
|
}
|
|
@@ -41938,7 +42031,7 @@ var require_formdata_parser = __commonJS({
|
|
|
41938
42031
|
var { HTTP_TOKEN_CODEPOINTS } = require_data_url();
|
|
41939
42032
|
var { makeEntry } = require_formdata();
|
|
41940
42033
|
var { webidl } = require_webidl();
|
|
41941
|
-
var
|
|
42034
|
+
var assert72 = __require("assert");
|
|
41942
42035
|
var { isomorphicDecode } = require_infra();
|
|
41943
42036
|
var dd = Buffer.from("--");
|
|
41944
42037
|
var decoder2 = new TextDecoder();
|
|
@@ -41967,7 +42060,7 @@ var require_formdata_parser = __commonJS({
|
|
|
41967
42060
|
}
|
|
41968
42061
|
__name(validateBoundary, "validateBoundary");
|
|
41969
42062
|
function multipartFormDataParser(input2, mimeType) {
|
|
41970
|
-
|
|
42063
|
+
assert72(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
|
|
41971
42064
|
const boundaryString = mimeType.parameters.get("boundary");
|
|
41972
42065
|
if (boundaryString === void 0) {
|
|
41973
42066
|
throw parsingError("missing boundary in content-type header");
|
|
@@ -42023,8 +42116,8 @@ var require_formdata_parser = __commonJS({
|
|
|
42023
42116
|
} else {
|
|
42024
42117
|
value = decoderIgnoreBOM.decode(Buffer.from(body));
|
|
42025
42118
|
}
|
|
42026
|
-
|
|
42027
|
-
|
|
42119
|
+
assert72(webidl.is.USVString(name2));
|
|
42120
|
+
assert72(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
|
|
42028
42121
|
entryList.push(makeEntry(name2, value, filename));
|
|
42029
42122
|
}
|
|
42030
42123
|
}
|
|
@@ -42305,7 +42398,7 @@ var require_body = __commonJS({
|
|
|
42305
42398
|
} = require_util2();
|
|
42306
42399
|
var { FormData: FormData14, setFormDataState } = require_formdata();
|
|
42307
42400
|
var { webidl } = require_webidl();
|
|
42308
|
-
var
|
|
42401
|
+
var assert72 = __require("assert");
|
|
42309
42402
|
var { isErrored, isDisturbed } = __require("stream");
|
|
42310
42403
|
var { isUint8Array } = __require("util/types");
|
|
42311
42404
|
var { serializeAMimeType } = require_data_url();
|
|
@@ -42344,7 +42437,7 @@ var require_body = __commonJS({
|
|
|
42344
42437
|
type: "bytes"
|
|
42345
42438
|
});
|
|
42346
42439
|
}
|
|
42347
|
-
|
|
42440
|
+
assert72(webidl.is.ReadableStream(stream2));
|
|
42348
42441
|
let action = null;
|
|
42349
42442
|
let source = null;
|
|
42350
42443
|
let length = null;
|
|
@@ -42452,8 +42545,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
42452
42545
|
__name(extractBody, "extractBody");
|
|
42453
42546
|
function safelyExtractBody(object2, keepalive = false) {
|
|
42454
42547
|
if (webidl.is.ReadableStream(object2)) {
|
|
42455
|
-
|
|
42456
|
-
|
|
42548
|
+
assert72(!util2.isDisturbed(object2), "The body has already been consumed.");
|
|
42549
|
+
assert72(!object2.locked, "The stream is locked.");
|
|
42457
42550
|
}
|
|
42458
42551
|
return extractBody(object2, keepalive);
|
|
42459
42552
|
}
|
|
@@ -42587,7 +42680,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
42587
42680
|
var require_client_h1 = __commonJS({
|
|
42588
42681
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module2) {
|
|
42589
42682
|
init_import_meta_url();
|
|
42590
|
-
var
|
|
42683
|
+
var assert72 = __require("assert");
|
|
42591
42684
|
var util2 = require_util();
|
|
42592
42685
|
var { channels } = require_diagnostics();
|
|
42593
42686
|
var timers = require_timers();
|
|
@@ -42688,7 +42781,7 @@ var require_client_h1 = __commonJS({
|
|
|
42688
42781
|
* @returns {number}
|
|
42689
42782
|
*/
|
|
42690
42783
|
wasm_on_status: /* @__PURE__ */ __name((p8, at4, len) => {
|
|
42691
|
-
|
|
42784
|
+
assert72(currentParser.ptr === p8);
|
|
42692
42785
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
42693
42786
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
42694
42787
|
}, "wasm_on_status"),
|
|
@@ -42697,7 +42790,7 @@ var require_client_h1 = __commonJS({
|
|
|
42697
42790
|
* @returns {number}
|
|
42698
42791
|
*/
|
|
42699
42792
|
wasm_on_message_begin: /* @__PURE__ */ __name((p8) => {
|
|
42700
|
-
|
|
42793
|
+
assert72(currentParser.ptr === p8);
|
|
42701
42794
|
return currentParser.onMessageBegin();
|
|
42702
42795
|
}, "wasm_on_message_begin"),
|
|
42703
42796
|
/**
|
|
@@ -42707,7 +42800,7 @@ var require_client_h1 = __commonJS({
|
|
|
42707
42800
|
* @returns {number}
|
|
42708
42801
|
*/
|
|
42709
42802
|
wasm_on_header_field: /* @__PURE__ */ __name((p8, at4, len) => {
|
|
42710
|
-
|
|
42803
|
+
assert72(currentParser.ptr === p8);
|
|
42711
42804
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
42712
42805
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
42713
42806
|
}, "wasm_on_header_field"),
|
|
@@ -42718,7 +42811,7 @@ var require_client_h1 = __commonJS({
|
|
|
42718
42811
|
* @returns {number}
|
|
42719
42812
|
*/
|
|
42720
42813
|
wasm_on_header_value: /* @__PURE__ */ __name((p8, at4, len) => {
|
|
42721
|
-
|
|
42814
|
+
assert72(currentParser.ptr === p8);
|
|
42722
42815
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
42723
42816
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
42724
42817
|
}, "wasm_on_header_value"),
|
|
@@ -42730,7 +42823,7 @@ var require_client_h1 = __commonJS({
|
|
|
42730
42823
|
* @returns {number}
|
|
42731
42824
|
*/
|
|
42732
42825
|
wasm_on_headers_complete: /* @__PURE__ */ __name((p8, statusCode, upgrade, shouldKeepAlive) => {
|
|
42733
|
-
|
|
42826
|
+
assert72(currentParser.ptr === p8);
|
|
42734
42827
|
return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
|
|
42735
42828
|
}, "wasm_on_headers_complete"),
|
|
42736
42829
|
/**
|
|
@@ -42740,7 +42833,7 @@ var require_client_h1 = __commonJS({
|
|
|
42740
42833
|
* @returns {number}
|
|
42741
42834
|
*/
|
|
42742
42835
|
wasm_on_body: /* @__PURE__ */ __name((p8, at4, len) => {
|
|
42743
|
-
|
|
42836
|
+
assert72(currentParser.ptr === p8);
|
|
42744
42837
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
42745
42838
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
42746
42839
|
}, "wasm_on_body"),
|
|
@@ -42749,7 +42842,7 @@ var require_client_h1 = __commonJS({
|
|
|
42749
42842
|
* @returns {number}
|
|
42750
42843
|
*/
|
|
42751
42844
|
wasm_on_message_complete: /* @__PURE__ */ __name((p8) => {
|
|
42752
|
-
|
|
42845
|
+
assert72(currentParser.ptr === p8);
|
|
42753
42846
|
return currentParser.onMessageComplete();
|
|
42754
42847
|
}, "wasm_on_message_complete")
|
|
42755
42848
|
}
|
|
@@ -42825,10 +42918,10 @@ var require_client_h1 = __commonJS({
|
|
|
42825
42918
|
if (this.socket.destroyed || !this.paused) {
|
|
42826
42919
|
return;
|
|
42827
42920
|
}
|
|
42828
|
-
|
|
42829
|
-
|
|
42921
|
+
assert72(this.ptr != null);
|
|
42922
|
+
assert72(currentParser === null);
|
|
42830
42923
|
this.llhttp.llhttp_resume(this.ptr);
|
|
42831
|
-
|
|
42924
|
+
assert72(this.timeoutType === TIMEOUT_BODY);
|
|
42832
42925
|
if (this.timeout) {
|
|
42833
42926
|
if (this.timeout.refresh) {
|
|
42834
42927
|
this.timeout.refresh();
|
|
@@ -42851,9 +42944,9 @@ var require_client_h1 = __commonJS({
|
|
|
42851
42944
|
* @param {Buffer} chunk
|
|
42852
42945
|
*/
|
|
42853
42946
|
execute(chunk) {
|
|
42854
|
-
|
|
42855
|
-
|
|
42856
|
-
|
|
42947
|
+
assert72(currentParser === null);
|
|
42948
|
+
assert72(this.ptr != null);
|
|
42949
|
+
assert72(!this.paused);
|
|
42857
42950
|
const { socket, llhttp } = this;
|
|
42858
42951
|
if (chunk.length > currentBufferSize) {
|
|
42859
42952
|
if (currentBufferPtr) {
|
|
@@ -42889,9 +42982,9 @@ var require_client_h1 = __commonJS({
|
|
|
42889
42982
|
}
|
|
42890
42983
|
}
|
|
42891
42984
|
finish() {
|
|
42892
|
-
|
|
42893
|
-
|
|
42894
|
-
|
|
42985
|
+
assert72(currentParser === null);
|
|
42986
|
+
assert72(this.ptr != null);
|
|
42987
|
+
assert72(!this.paused);
|
|
42895
42988
|
const { llhttp } = this;
|
|
42896
42989
|
let ret;
|
|
42897
42990
|
try {
|
|
@@ -42923,8 +43016,8 @@ var require_client_h1 = __commonJS({
|
|
|
42923
43016
|
return new HTTPParserError(message, constants4.ERROR[ret], data);
|
|
42924
43017
|
}
|
|
42925
43018
|
destroy() {
|
|
42926
|
-
|
|
42927
|
-
|
|
43019
|
+
assert72(currentParser === null);
|
|
43020
|
+
assert72(this.ptr != null);
|
|
42928
43021
|
this.llhttp.llhttp_free(this.ptr);
|
|
42929
43022
|
this.ptr = null;
|
|
42930
43023
|
this.timeout && timers.clearTimeout(this.timeout);
|
|
@@ -43014,14 +43107,14 @@ var require_client_h1 = __commonJS({
|
|
|
43014
43107
|
*/
|
|
43015
43108
|
onUpgrade(head) {
|
|
43016
43109
|
const { upgrade, client, socket, headers, statusCode, statusText } = this;
|
|
43017
|
-
|
|
43018
|
-
|
|
43019
|
-
|
|
43020
|
-
|
|
43021
|
-
|
|
43110
|
+
assert72(upgrade);
|
|
43111
|
+
assert72(client[kSocket] === socket);
|
|
43112
|
+
assert72(!socket.destroyed);
|
|
43113
|
+
assert72(!this.paused);
|
|
43114
|
+
assert72((headers.length & 1) === 0);
|
|
43022
43115
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
43023
|
-
|
|
43024
|
-
|
|
43116
|
+
assert72(request4);
|
|
43117
|
+
assert72(request4.upgrade || request4.method === "CONNECT");
|
|
43025
43118
|
this.statusCode = 0;
|
|
43026
43119
|
this.statusText = "";
|
|
43027
43120
|
this.shouldKeepAlive = false;
|
|
@@ -43064,8 +43157,8 @@ var require_client_h1 = __commonJS({
|
|
|
43064
43157
|
if (!request4) {
|
|
43065
43158
|
return -1;
|
|
43066
43159
|
}
|
|
43067
|
-
|
|
43068
|
-
|
|
43160
|
+
assert72(!this.upgrade);
|
|
43161
|
+
assert72(this.statusCode < 200);
|
|
43069
43162
|
if (statusCode === 100) {
|
|
43070
43163
|
util2.destroy(socket, new SocketError("bad response", util2.getSocketInfo(socket)));
|
|
43071
43164
|
return -1;
|
|
@@ -43074,7 +43167,7 @@ var require_client_h1 = __commonJS({
|
|
|
43074
43167
|
util2.destroy(socket, new SocketError("bad upgrade", util2.getSocketInfo(socket)));
|
|
43075
43168
|
return -1;
|
|
43076
43169
|
}
|
|
43077
|
-
|
|
43170
|
+
assert72(this.timeoutType === TIMEOUT_HEADERS);
|
|
43078
43171
|
this.statusCode = statusCode;
|
|
43079
43172
|
this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
|
43080
43173
|
request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
|
@@ -43087,16 +43180,16 @@ var require_client_h1 = __commonJS({
|
|
|
43087
43180
|
}
|
|
43088
43181
|
}
|
|
43089
43182
|
if (request4.method === "CONNECT") {
|
|
43090
|
-
|
|
43183
|
+
assert72(client[kRunning] === 1);
|
|
43091
43184
|
this.upgrade = true;
|
|
43092
43185
|
return 2;
|
|
43093
43186
|
}
|
|
43094
43187
|
if (upgrade) {
|
|
43095
|
-
|
|
43188
|
+
assert72(client[kRunning] === 1);
|
|
43096
43189
|
this.upgrade = true;
|
|
43097
43190
|
return 2;
|
|
43098
43191
|
}
|
|
43099
|
-
|
|
43192
|
+
assert72((this.headers.length & 1) === 0);
|
|
43100
43193
|
this.headers = [];
|
|
43101
43194
|
this.headersSize = 0;
|
|
43102
43195
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
|
@@ -43143,14 +43236,14 @@ var require_client_h1 = __commonJS({
|
|
|
43143
43236
|
return -1;
|
|
43144
43237
|
}
|
|
43145
43238
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
43146
|
-
|
|
43147
|
-
|
|
43239
|
+
assert72(request4);
|
|
43240
|
+
assert72(this.timeoutType === TIMEOUT_BODY);
|
|
43148
43241
|
if (this.timeout) {
|
|
43149
43242
|
if (this.timeout.refresh) {
|
|
43150
43243
|
this.timeout.refresh();
|
|
43151
43244
|
}
|
|
43152
43245
|
}
|
|
43153
|
-
|
|
43246
|
+
assert72(statusCode >= 200);
|
|
43154
43247
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
|
43155
43248
|
util2.destroy(socket, new ResponseExceededMaxSizeError());
|
|
43156
43249
|
return -1;
|
|
@@ -43172,10 +43265,10 @@ var require_client_h1 = __commonJS({
|
|
|
43172
43265
|
if (upgrade) {
|
|
43173
43266
|
return 0;
|
|
43174
43267
|
}
|
|
43175
|
-
|
|
43176
|
-
|
|
43268
|
+
assert72(statusCode >= 100);
|
|
43269
|
+
assert72((this.headers.length & 1) === 0);
|
|
43177
43270
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
43178
|
-
|
|
43271
|
+
assert72(request4);
|
|
43179
43272
|
this.statusCode = 0;
|
|
43180
43273
|
this.statusText = "";
|
|
43181
43274
|
this.bytesRead = 0;
|
|
@@ -43195,7 +43288,7 @@ var require_client_h1 = __commonJS({
|
|
|
43195
43288
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
43196
43289
|
socket[kSocketUsed] = client[kPending] === 0;
|
|
43197
43290
|
if (socket[kWriting]) {
|
|
43198
|
-
|
|
43291
|
+
assert72(client[kRunning] === 0);
|
|
43199
43292
|
util2.destroy(socket, new InformationalError("reset"));
|
|
43200
43293
|
return constants4.ERROR.PAUSED;
|
|
43201
43294
|
} else if (!shouldKeepAlive) {
|
|
@@ -43220,7 +43313,7 @@ var require_client_h1 = __commonJS({
|
|
|
43220
43313
|
const { socket, timeoutType, client, paused } = parser2;
|
|
43221
43314
|
if (timeoutType === TIMEOUT_HEADERS) {
|
|
43222
43315
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
|
43223
|
-
|
|
43316
|
+
assert72(!paused, "cannot be paused while waiting for headers");
|
|
43224
43317
|
util2.destroy(socket, new HeadersTimeoutError());
|
|
43225
43318
|
}
|
|
43226
43319
|
} else if (timeoutType === TIMEOUT_BODY) {
|
|
@@ -43228,7 +43321,7 @@ var require_client_h1 = __commonJS({
|
|
|
43228
43321
|
util2.destroy(socket, new BodyTimeoutError());
|
|
43229
43322
|
}
|
|
43230
43323
|
} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
|
|
43231
|
-
|
|
43324
|
+
assert72(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
|
43232
43325
|
util2.destroy(socket, new InformationalError("socket idle timeout"));
|
|
43233
43326
|
}
|
|
43234
43327
|
}
|
|
@@ -43354,7 +43447,7 @@ var require_client_h1 = __commonJS({
|
|
|
43354
43447
|
client[kSocket] = null;
|
|
43355
43448
|
client[kHTTPContext] = null;
|
|
43356
43449
|
if (client.destroyed) {
|
|
43357
|
-
|
|
43450
|
+
assert72(client[kPending] === 0);
|
|
43358
43451
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
43359
43452
|
for (let i8 = 0; i8 < requests.length; i8++) {
|
|
43360
43453
|
const request4 = requests[i8];
|
|
@@ -43366,7 +43459,7 @@ var require_client_h1 = __commonJS({
|
|
|
43366
43459
|
util2.errorRequest(client, request4, err);
|
|
43367
43460
|
}
|
|
43368
43461
|
client[kPendingIdx] = client[kRunningIdx];
|
|
43369
|
-
|
|
43462
|
+
assert72(client[kRunning] === 0);
|
|
43370
43463
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
43371
43464
|
client[kResume]();
|
|
43372
43465
|
}
|
|
@@ -43576,13 +43669,13 @@ upgrade: ${upgrade}\r
|
|
|
43576
43669
|
} else if (util2.isIterable(body)) {
|
|
43577
43670
|
writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
|
|
43578
43671
|
} else {
|
|
43579
|
-
|
|
43672
|
+
assert72(false);
|
|
43580
43673
|
}
|
|
43581
43674
|
return true;
|
|
43582
43675
|
}
|
|
43583
43676
|
__name(writeH1, "writeH1");
|
|
43584
43677
|
function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
43585
|
-
|
|
43678
|
+
assert72(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
43586
43679
|
let finished = false;
|
|
43587
43680
|
const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
|
|
43588
43681
|
const onData = /* @__PURE__ */ __name(function(chunk) {
|
|
@@ -43619,7 +43712,7 @@ upgrade: ${upgrade}\r
|
|
|
43619
43712
|
return;
|
|
43620
43713
|
}
|
|
43621
43714
|
finished = true;
|
|
43622
|
-
|
|
43715
|
+
assert72(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
|
43623
43716
|
socket.off("drain", onDrain).off("error", onFinished);
|
|
43624
43717
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
|
|
43625
43718
|
if (!err) {
|
|
@@ -43659,12 +43752,12 @@ upgrade: ${upgrade}\r
|
|
|
43659
43752
|
\r
|
|
43660
43753
|
`, "latin1");
|
|
43661
43754
|
} else {
|
|
43662
|
-
|
|
43755
|
+
assert72(contentLength === null, "no body must not have content length");
|
|
43663
43756
|
socket.write(`${header}\r
|
|
43664
43757
|
`, "latin1");
|
|
43665
43758
|
}
|
|
43666
43759
|
} else if (util2.isBuffer(body)) {
|
|
43667
|
-
|
|
43760
|
+
assert72(contentLength === body.byteLength, "buffer body must have content length");
|
|
43668
43761
|
socket.cork();
|
|
43669
43762
|
socket.write(`${header}content-length: ${contentLength}\r
|
|
43670
43763
|
\r
|
|
@@ -43684,7 +43777,7 @@ upgrade: ${upgrade}\r
|
|
|
43684
43777
|
}
|
|
43685
43778
|
__name(writeBuffer, "writeBuffer");
|
|
43686
43779
|
async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
43687
|
-
|
|
43780
|
+
assert72(contentLength === body.size, "blob body must have content length");
|
|
43688
43781
|
try {
|
|
43689
43782
|
if (contentLength != null && contentLength !== body.size) {
|
|
43690
43783
|
throw new RequestContentLengthMismatchError();
|
|
@@ -43708,7 +43801,7 @@ upgrade: ${upgrade}\r
|
|
|
43708
43801
|
}
|
|
43709
43802
|
__name(writeBlob, "writeBlob");
|
|
43710
43803
|
async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
43711
|
-
|
|
43804
|
+
assert72(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
43712
43805
|
let callback2 = null;
|
|
43713
43806
|
function onDrain() {
|
|
43714
43807
|
if (callback2) {
|
|
@@ -43719,7 +43812,7 @@ upgrade: ${upgrade}\r
|
|
|
43719
43812
|
}
|
|
43720
43813
|
__name(onDrain, "onDrain");
|
|
43721
43814
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve38, reject) => {
|
|
43722
|
-
|
|
43815
|
+
assert72(callback2 === null);
|
|
43723
43816
|
if (socket[kError]) {
|
|
43724
43817
|
reject(socket[kError]);
|
|
43725
43818
|
} else {
|
|
@@ -43872,7 +43965,7 @@ ${len.toString(16)}\r
|
|
|
43872
43965
|
const { socket, client, abort } = this;
|
|
43873
43966
|
socket[kWriting] = false;
|
|
43874
43967
|
if (err) {
|
|
43875
|
-
|
|
43968
|
+
assert72(client[kRunning] <= 1, "pipeline should only contain this request");
|
|
43876
43969
|
abort(err);
|
|
43877
43970
|
}
|
|
43878
43971
|
}
|
|
@@ -43885,7 +43978,7 @@ ${len.toString(16)}\r
|
|
|
43885
43978
|
var require_client_h2 = __commonJS({
|
|
43886
43979
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module2) {
|
|
43887
43980
|
init_import_meta_url();
|
|
43888
|
-
var
|
|
43981
|
+
var assert72 = __require("assert");
|
|
43889
43982
|
var { pipeline: pipeline2 } = __require("stream");
|
|
43890
43983
|
var util2 = require_util();
|
|
43891
43984
|
var {
|
|
@@ -44167,7 +44260,7 @@ var require_client_h2 = __commonJS({
|
|
|
44167
44260
|
}
|
|
44168
44261
|
client[kPendingIdx] = client[kRunningIdx];
|
|
44169
44262
|
}
|
|
44170
|
-
|
|
44263
|
+
assert72(client[kRunning] === 0);
|
|
44171
44264
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
44172
44265
|
client.emit("connectionError", client[kUrl], [client], err);
|
|
44173
44266
|
client[kResume]();
|
|
@@ -44184,7 +44277,7 @@ var require_client_h2 = __commonJS({
|
|
|
44184
44277
|
state3.ping.interval = null;
|
|
44185
44278
|
}
|
|
44186
44279
|
if (client.destroyed) {
|
|
44187
|
-
|
|
44280
|
+
assert72(client[kPending] === 0);
|
|
44188
44281
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
44189
44282
|
for (let i8 = 0; i8 < requests.length; i8++) {
|
|
44190
44283
|
const request4 = requests[i8];
|
|
@@ -44204,7 +44297,7 @@ var require_client_h2 = __commonJS({
|
|
|
44204
44297
|
this[kHTTP2Session].destroy(err);
|
|
44205
44298
|
}
|
|
44206
44299
|
client[kPendingIdx] = client[kRunningIdx];
|
|
44207
|
-
|
|
44300
|
+
assert72(client[kRunning] === 0);
|
|
44208
44301
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
44209
44302
|
client[kResume]();
|
|
44210
44303
|
}
|
|
@@ -44379,7 +44472,7 @@ var require_client_h2 = __commonJS({
|
|
|
44379
44472
|
process.emitWarning(new RequestContentLengthMismatchError());
|
|
44380
44473
|
}
|
|
44381
44474
|
if (contentLength != null) {
|
|
44382
|
-
|
|
44475
|
+
assert72(body || contentLength === 0, "no body must not have content length");
|
|
44383
44476
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
|
|
44384
44477
|
}
|
|
44385
44478
|
session.ref();
|
|
@@ -44551,7 +44644,7 @@ var require_client_h2 = __commonJS({
|
|
|
44551
44644
|
expectsPayload
|
|
44552
44645
|
);
|
|
44553
44646
|
} else {
|
|
44554
|
-
|
|
44647
|
+
assert72(false);
|
|
44555
44648
|
}
|
|
44556
44649
|
}
|
|
44557
44650
|
}
|
|
@@ -44559,7 +44652,7 @@ var require_client_h2 = __commonJS({
|
|
|
44559
44652
|
function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
44560
44653
|
try {
|
|
44561
44654
|
if (body != null && util2.isBuffer(body)) {
|
|
44562
|
-
|
|
44655
|
+
assert72(contentLength === body.byteLength, "buffer body must have content length");
|
|
44563
44656
|
h2stream.cork();
|
|
44564
44657
|
h2stream.write(body);
|
|
44565
44658
|
h2stream.uncork();
|
|
@@ -44577,7 +44670,7 @@ var require_client_h2 = __commonJS({
|
|
|
44577
44670
|
}
|
|
44578
44671
|
__name(writeBuffer, "writeBuffer");
|
|
44579
44672
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
|
|
44580
|
-
|
|
44673
|
+
assert72(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
44581
44674
|
const pipe2 = pipeline2(
|
|
44582
44675
|
body,
|
|
44583
44676
|
h2stream,
|
|
@@ -44603,7 +44696,7 @@ var require_client_h2 = __commonJS({
|
|
|
44603
44696
|
}
|
|
44604
44697
|
__name(writeStream, "writeStream");
|
|
44605
44698
|
async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
44606
|
-
|
|
44699
|
+
assert72(contentLength === body.size, "blob body must have content length");
|
|
44607
44700
|
try {
|
|
44608
44701
|
if (contentLength != null && contentLength !== body.size) {
|
|
44609
44702
|
throw new RequestContentLengthMismatchError();
|
|
@@ -44625,7 +44718,7 @@ var require_client_h2 = __commonJS({
|
|
|
44625
44718
|
}
|
|
44626
44719
|
__name(writeBlob, "writeBlob");
|
|
44627
44720
|
async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
44628
|
-
|
|
44721
|
+
assert72(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
44629
44722
|
let callback2 = null;
|
|
44630
44723
|
function onDrain() {
|
|
44631
44724
|
if (callback2) {
|
|
@@ -44636,7 +44729,7 @@ var require_client_h2 = __commonJS({
|
|
|
44636
44729
|
}
|
|
44637
44730
|
__name(onDrain, "onDrain");
|
|
44638
44731
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve38, reject) => {
|
|
44639
|
-
|
|
44732
|
+
assert72(callback2 === null);
|
|
44640
44733
|
if (socket[kError]) {
|
|
44641
44734
|
reject(socket[kError]);
|
|
44642
44735
|
} else {
|
|
@@ -44676,7 +44769,7 @@ var require_client_h2 = __commonJS({
|
|
|
44676
44769
|
var require_client = __commonJS({
|
|
44677
44770
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/dispatcher/client.js"(exports2, module2) {
|
|
44678
44771
|
init_import_meta_url();
|
|
44679
|
-
var
|
|
44772
|
+
var assert72 = __require("assert");
|
|
44680
44773
|
var net3 = __require("net");
|
|
44681
44774
|
var http6 = __require("http");
|
|
44682
44775
|
var util2 = require_util();
|
|
@@ -44997,7 +45090,7 @@ var require_client = __commonJS({
|
|
|
44997
45090
|
};
|
|
44998
45091
|
function onError(client, err) {
|
|
44999
45092
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
|
45000
|
-
|
|
45093
|
+
assert72(client[kPendingIdx] === client[kRunningIdx]);
|
|
45001
45094
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
45002
45095
|
for (let i8 = 0; i8 < requests.length; i8++) {
|
|
45003
45096
|
const request4 = requests[i8];
|
|
@@ -45005,19 +45098,19 @@ var require_client = __commonJS({
|
|
|
45005
45098
|
util2.errorRequest(client, request4, err);
|
|
45006
45099
|
}
|
|
45007
45100
|
}
|
|
45008
|
-
|
|
45101
|
+
assert72(client[kSize] === 0);
|
|
45009
45102
|
}
|
|
45010
45103
|
}
|
|
45011
45104
|
__name(onError, "onError");
|
|
45012
45105
|
function connect(client) {
|
|
45013
|
-
|
|
45014
|
-
|
|
45106
|
+
assert72(!client[kConnecting]);
|
|
45107
|
+
assert72(!client[kHTTPContext]);
|
|
45015
45108
|
let { host, hostname: hostname4, protocol, port } = client[kUrl];
|
|
45016
45109
|
if (hostname4[0] === "[") {
|
|
45017
45110
|
const idx = hostname4.indexOf("]");
|
|
45018
|
-
|
|
45111
|
+
assert72(idx !== -1);
|
|
45019
45112
|
const ip = hostname4.substring(1, idx);
|
|
45020
|
-
|
|
45113
|
+
assert72(net3.isIPv6(ip));
|
|
45021
45114
|
hostname4 = ip;
|
|
45022
45115
|
}
|
|
45023
45116
|
client[kConnecting] = true;
|
|
@@ -45054,7 +45147,7 @@ var require_client = __commonJS({
|
|
|
45054
45147
|
client[kResume]();
|
|
45055
45148
|
return;
|
|
45056
45149
|
}
|
|
45057
|
-
|
|
45150
|
+
assert72(socket);
|
|
45058
45151
|
try {
|
|
45059
45152
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
|
|
45060
45153
|
} catch (err2) {
|
|
@@ -45113,7 +45206,7 @@ var require_client = __commonJS({
|
|
|
45113
45206
|
});
|
|
45114
45207
|
}
|
|
45115
45208
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
|
45116
|
-
|
|
45209
|
+
assert72(client[kRunning] === 0);
|
|
45117
45210
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
|
45118
45211
|
const request4 = client[kQueue][client[kPendingIdx]++];
|
|
45119
45212
|
util2.errorRequest(client, request4, err);
|
|
@@ -45146,7 +45239,7 @@ var require_client = __commonJS({
|
|
|
45146
45239
|
function _resume(client, sync) {
|
|
45147
45240
|
while (true) {
|
|
45148
45241
|
if (client.destroyed) {
|
|
45149
|
-
|
|
45242
|
+
assert72(client[kPending] === 0);
|
|
45150
45243
|
return;
|
|
45151
45244
|
}
|
|
45152
45245
|
if (client[kClosedResolve] && !client[kSize]) {
|
|
@@ -47097,7 +47190,7 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
47097
47190
|
var require_retry_handler = __commonJS({
|
|
47098
47191
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/handler/retry-handler.js"(exports2, module2) {
|
|
47099
47192
|
init_import_meta_url();
|
|
47100
|
-
var
|
|
47193
|
+
var assert72 = __require("assert");
|
|
47101
47194
|
var { kRetryHandlerDefaultRetry } = require_symbols();
|
|
47102
47195
|
var { RequestRetryError } = require_errors();
|
|
47103
47196
|
var WrapHandler = require_wrap_handler();
|
|
@@ -47291,7 +47384,7 @@ var require_retry_handler = __commonJS({
|
|
|
47291
47384
|
if (this.end == null && this.opts.method !== "HEAD") {
|
|
47292
47385
|
const contentLength = headers["content-length"];
|
|
47293
47386
|
this.end = contentLength != null ? Number(contentLength) - 1 : null;
|
|
47294
|
-
|
|
47387
|
+
assert72(
|
|
47295
47388
|
this.end == null || Number.isFinite(this.end),
|
|
47296
47389
|
"invalid content-length"
|
|
47297
47390
|
);
|
|
@@ -47402,11 +47495,11 @@ var require_retry_handler = __commonJS({
|
|
|
47402
47495
|
}
|
|
47403
47496
|
validatePartialResponseContentLength(headers, range2, statusCode, this.retryCount);
|
|
47404
47497
|
const { start, size, end = size ? size - 1 : null } = range2;
|
|
47405
|
-
|
|
47498
|
+
assert72(
|
|
47406
47499
|
start != null && Number.isFinite(start),
|
|
47407
47500
|
"content-range mismatch"
|
|
47408
47501
|
);
|
|
47409
|
-
|
|
47502
|
+
assert72(end != null && Number.isFinite(end), "invalid content-length");
|
|
47410
47503
|
this.start = start;
|
|
47411
47504
|
this.end = end;
|
|
47412
47505
|
}
|
|
@@ -47414,8 +47507,8 @@ var require_retry_handler = __commonJS({
|
|
|
47414
47507
|
const contentLength = headers["content-length"];
|
|
47415
47508
|
this.end = contentLength != null ? Number(contentLength) - 1 : null;
|
|
47416
47509
|
}
|
|
47417
|
-
|
|
47418
|
-
|
|
47510
|
+
assert72(Number.isFinite(this.start));
|
|
47511
|
+
assert72(
|
|
47419
47512
|
this.end == null || Number.isFinite(this.end),
|
|
47420
47513
|
"invalid content-length"
|
|
47421
47514
|
);
|
|
@@ -47596,7 +47689,7 @@ var require_h2c_client = __commonJS({
|
|
|
47596
47689
|
var require_readable = __commonJS({
|
|
47597
47690
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/api/readable.js"(exports2, module2) {
|
|
47598
47691
|
init_import_meta_url();
|
|
47599
|
-
var
|
|
47692
|
+
var assert72 = __require("assert");
|
|
47600
47693
|
var { Readable: Readable13 } = __require("stream");
|
|
47601
47694
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
|
|
47602
47695
|
var util2 = require_util();
|
|
@@ -47793,7 +47886,7 @@ var require_readable = __commonJS({
|
|
|
47793
47886
|
this[kBody] = ReadableStreamFrom(this);
|
|
47794
47887
|
if (this[kConsume]) {
|
|
47795
47888
|
this[kBody].getReader();
|
|
47796
|
-
|
|
47889
|
+
assert72(this[kBody].locked);
|
|
47797
47890
|
}
|
|
47798
47891
|
}
|
|
47799
47892
|
return this[kBody];
|
|
@@ -47864,7 +47957,7 @@ var require_readable = __commonJS({
|
|
|
47864
47957
|
}
|
|
47865
47958
|
__name(isUnusable, "isUnusable");
|
|
47866
47959
|
function consume(stream2, type) {
|
|
47867
|
-
|
|
47960
|
+
assert72(!stream2[kConsume]);
|
|
47868
47961
|
return new Promise((resolve38, reject) => {
|
|
47869
47962
|
if (isUnusable(stream2)) {
|
|
47870
47963
|
const rState = stream2._readableState;
|
|
@@ -48010,7 +48103,7 @@ var require_readable = __commonJS({
|
|
|
48010
48103
|
var require_api_request = __commonJS({
|
|
48011
48104
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/api/api-request.js"(exports2, module2) {
|
|
48012
48105
|
init_import_meta_url();
|
|
48013
|
-
var
|
|
48106
|
+
var assert72 = __require("assert");
|
|
48014
48107
|
var { AsyncResource } = __require("async_hooks");
|
|
48015
48108
|
var { Readable: Readable13 } = require_readable();
|
|
48016
48109
|
var { InvalidArgumentError, RequestAbortedError } = require_errors();
|
|
@@ -48081,7 +48174,7 @@ var require_api_request = __commonJS({
|
|
|
48081
48174
|
abort(this.reason);
|
|
48082
48175
|
return;
|
|
48083
48176
|
}
|
|
48084
|
-
|
|
48177
|
+
assert72(this.callback);
|
|
48085
48178
|
this.abort = abort;
|
|
48086
48179
|
this.context = context2;
|
|
48087
48180
|
}
|
|
@@ -48248,7 +48341,7 @@ var require_abort_signal = __commonJS({
|
|
|
48248
48341
|
var require_api_stream = __commonJS({
|
|
48249
48342
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/api/api-stream.js"(exports2, module2) {
|
|
48250
48343
|
init_import_meta_url();
|
|
48251
|
-
var
|
|
48344
|
+
var assert72 = __require("assert");
|
|
48252
48345
|
var { finished } = __require("stream");
|
|
48253
48346
|
var { AsyncResource } = __require("async_hooks");
|
|
48254
48347
|
var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
|
|
@@ -48311,7 +48404,7 @@ var require_api_stream = __commonJS({
|
|
|
48311
48404
|
abort(this.reason);
|
|
48312
48405
|
return;
|
|
48313
48406
|
}
|
|
48314
|
-
|
|
48407
|
+
assert72(this.callback);
|
|
48315
48408
|
this.abort = abort;
|
|
48316
48409
|
this.context = context2;
|
|
48317
48410
|
}
|
|
@@ -48419,7 +48512,7 @@ var require_api_pipeline = __commonJS({
|
|
|
48419
48512
|
Duplex: Duplex2,
|
|
48420
48513
|
PassThrough: PassThrough4
|
|
48421
48514
|
} = __require("stream");
|
|
48422
|
-
var
|
|
48515
|
+
var assert72 = __require("assert");
|
|
48423
48516
|
var { AsyncResource } = __require("async_hooks");
|
|
48424
48517
|
var {
|
|
48425
48518
|
InvalidArgumentError,
|
|
@@ -48543,7 +48636,7 @@ var require_api_pipeline = __commonJS({
|
|
|
48543
48636
|
abort(this.reason);
|
|
48544
48637
|
return;
|
|
48545
48638
|
}
|
|
48546
|
-
|
|
48639
|
+
assert72(!res, "pipeline cannot be retried");
|
|
48547
48640
|
this.abort = abort;
|
|
48548
48641
|
this.context = context2;
|
|
48549
48642
|
}
|
|
@@ -48628,7 +48721,7 @@ var require_api_upgrade = __commonJS({
|
|
|
48628
48721
|
init_import_meta_url();
|
|
48629
48722
|
var { InvalidArgumentError, SocketError } = require_errors();
|
|
48630
48723
|
var { AsyncResource } = __require("async_hooks");
|
|
48631
|
-
var
|
|
48724
|
+
var assert72 = __require("assert");
|
|
48632
48725
|
var util2 = require_util();
|
|
48633
48726
|
var { kHTTP2Stream } = require_symbols();
|
|
48634
48727
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
@@ -48660,7 +48753,7 @@ var require_api_upgrade = __commonJS({
|
|
|
48660
48753
|
abort(this.reason);
|
|
48661
48754
|
return;
|
|
48662
48755
|
}
|
|
48663
|
-
|
|
48756
|
+
assert72(this.callback);
|
|
48664
48757
|
this.abort = abort;
|
|
48665
48758
|
this.context = null;
|
|
48666
48759
|
}
|
|
@@ -48668,7 +48761,7 @@ var require_api_upgrade = __commonJS({
|
|
|
48668
48761
|
throw new SocketError("bad upgrade", null);
|
|
48669
48762
|
}
|
|
48670
48763
|
onUpgrade(statusCode, rawHeaders, socket) {
|
|
48671
|
-
|
|
48764
|
+
assert72(socket[kHTTP2Stream] === true ? statusCode === 200 : statusCode === 101);
|
|
48672
48765
|
const { callback: callback2, opaque, context: context2 } = this;
|
|
48673
48766
|
removeSignal(this);
|
|
48674
48767
|
this.callback = null;
|
|
@@ -48724,7 +48817,7 @@ var require_api_upgrade = __commonJS({
|
|
|
48724
48817
|
var require_api_connect = __commonJS({
|
|
48725
48818
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/api/api-connect.js"(exports2, module2) {
|
|
48726
48819
|
init_import_meta_url();
|
|
48727
|
-
var
|
|
48820
|
+
var assert72 = __require("assert");
|
|
48728
48821
|
var { AsyncResource } = __require("async_hooks");
|
|
48729
48822
|
var { InvalidArgumentError, SocketError } = require_errors();
|
|
48730
48823
|
var util2 = require_util();
|
|
@@ -48756,7 +48849,7 @@ var require_api_connect = __commonJS({
|
|
|
48756
48849
|
abort(this.reason);
|
|
48757
48850
|
return;
|
|
48758
48851
|
}
|
|
48759
|
-
|
|
48852
|
+
assert72(this.callback);
|
|
48760
48853
|
this.abort = abort;
|
|
48761
48854
|
this.context = context2;
|
|
48762
48855
|
}
|
|
@@ -50858,7 +50951,7 @@ var require_global2 = __commonJS({
|
|
|
50858
50951
|
var require_decorator_handler = __commonJS({
|
|
50859
50952
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/handler/decorator-handler.js"(exports2, module2) {
|
|
50860
50953
|
init_import_meta_url();
|
|
50861
|
-
var
|
|
50954
|
+
var assert72 = __require("assert");
|
|
50862
50955
|
var WrapHandler = require_wrap_handler();
|
|
50863
50956
|
module2.exports = class DecoratorHandler {
|
|
50864
50957
|
static {
|
|
@@ -50878,25 +50971,25 @@ var require_decorator_handler = __commonJS({
|
|
|
50878
50971
|
this.#handler.onRequestStart?.(...args);
|
|
50879
50972
|
}
|
|
50880
50973
|
onRequestUpgrade(...args) {
|
|
50881
|
-
|
|
50882
|
-
|
|
50974
|
+
assert72(!this.#onCompleteCalled);
|
|
50975
|
+
assert72(!this.#onErrorCalled);
|
|
50883
50976
|
return this.#handler.onRequestUpgrade?.(...args);
|
|
50884
50977
|
}
|
|
50885
50978
|
onResponseStart(...args) {
|
|
50886
|
-
|
|
50887
|
-
|
|
50888
|
-
|
|
50979
|
+
assert72(!this.#onCompleteCalled);
|
|
50980
|
+
assert72(!this.#onErrorCalled);
|
|
50981
|
+
assert72(!this.#onResponseStartCalled);
|
|
50889
50982
|
this.#onResponseStartCalled = true;
|
|
50890
50983
|
return this.#handler.onResponseStart?.(...args);
|
|
50891
50984
|
}
|
|
50892
50985
|
onResponseData(...args) {
|
|
50893
|
-
|
|
50894
|
-
|
|
50986
|
+
assert72(!this.#onCompleteCalled);
|
|
50987
|
+
assert72(!this.#onErrorCalled);
|
|
50895
50988
|
return this.#handler.onResponseData?.(...args);
|
|
50896
50989
|
}
|
|
50897
50990
|
onResponseEnd(...args) {
|
|
50898
|
-
|
|
50899
|
-
|
|
50991
|
+
assert72(!this.#onCompleteCalled);
|
|
50992
|
+
assert72(!this.#onErrorCalled);
|
|
50900
50993
|
this.#onCompleteCalled = true;
|
|
50901
50994
|
return this.#handler.onResponseEnd?.(...args);
|
|
50902
50995
|
}
|
|
@@ -50919,7 +51012,7 @@ var require_redirect_handler = __commonJS({
|
|
|
50919
51012
|
init_import_meta_url();
|
|
50920
51013
|
var util2 = require_util();
|
|
50921
51014
|
var { kBodyUsed, kRedirectCacheControl } = require_symbols();
|
|
50922
|
-
var
|
|
51015
|
+
var assert72 = __require("assert");
|
|
50923
51016
|
var { InvalidArgumentError } = require_errors();
|
|
50924
51017
|
var EE = __require("events");
|
|
50925
51018
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
@@ -50935,7 +51028,7 @@ var require_redirect_handler = __commonJS({
|
|
|
50935
51028
|
this[kBodyUsed] = false;
|
|
50936
51029
|
}
|
|
50937
51030
|
async *[Symbol.asyncIterator]() {
|
|
50938
|
-
|
|
51031
|
+
assert72(!this[kBodyUsed], "disturbed");
|
|
50939
51032
|
this[kBodyUsed] = true;
|
|
50940
51033
|
yield* this[kBody];
|
|
50941
51034
|
}
|
|
@@ -50969,7 +51062,7 @@ var require_redirect_handler = __commonJS({
|
|
|
50969
51062
|
if (util2.isStream(this.opts.body)) {
|
|
50970
51063
|
if (util2.bodyLength(this.opts.body) === 0) {
|
|
50971
51064
|
this.opts.body.on("data", function() {
|
|
50972
|
-
|
|
51065
|
+
assert72(false);
|
|
50973
51066
|
});
|
|
50974
51067
|
}
|
|
50975
51068
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
|
@@ -51076,7 +51169,7 @@ var require_redirect_handler = __commonJS({
|
|
|
51076
51169
|
}
|
|
51077
51170
|
}
|
|
51078
51171
|
} else {
|
|
51079
|
-
|
|
51172
|
+
assert72(headers == null, "headers must be an object or an array");
|
|
51080
51173
|
}
|
|
51081
51174
|
return ret;
|
|
51082
51175
|
}
|
|
@@ -53557,7 +53650,7 @@ var require_memory_cache_store = __commonJS({
|
|
|
53557
53650
|
var require_cache_revalidation_handler = __commonJS({
|
|
53558
53651
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports2, module2) {
|
|
53559
53652
|
init_import_meta_url();
|
|
53560
|
-
var
|
|
53653
|
+
var assert72 = __require("assert");
|
|
53561
53654
|
var CacheRevalidationHandler = class {
|
|
53562
53655
|
static {
|
|
53563
53656
|
__name(this, "CacheRevalidationHandler");
|
|
@@ -53597,7 +53690,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
|
53597
53690
|
this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
|
|
53598
53691
|
}
|
|
53599
53692
|
onResponseStart(controller, statusCode, headers, statusMessage) {
|
|
53600
|
-
|
|
53693
|
+
assert72(this.#callback != null);
|
|
53601
53694
|
this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
|
|
53602
53695
|
this.#callback(this.#successful, this.#context, statusCode, headers);
|
|
53603
53696
|
this.#callback = null;
|
|
@@ -53647,7 +53740,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
|
53647
53740
|
var require_cache2 = __commonJS({
|
|
53648
53741
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/interceptor/cache.js"(exports2, module2) {
|
|
53649
53742
|
init_import_meta_url();
|
|
53650
|
-
var
|
|
53743
|
+
var assert72 = __require("assert");
|
|
53651
53744
|
var { Readable: Readable13 } = __require("stream");
|
|
53652
53745
|
var util2 = require_util();
|
|
53653
53746
|
var CacheHandler = require_cache_handler();
|
|
@@ -53832,8 +53925,8 @@ var require_cache2 = __commonJS({
|
|
|
53832
53925
|
__name(handleUncachedResponse, "handleUncachedResponse");
|
|
53833
53926
|
function sendCachedValue(handler, opts, result, age, context2, isStale2) {
|
|
53834
53927
|
const stream2 = util2.isStream(result.body) ? result.body : Readable13.from(result.body ?? []);
|
|
53835
|
-
|
|
53836
|
-
|
|
53928
|
+
assert72(!stream2.destroyed, "stream should not be destroyed");
|
|
53929
|
+
assert72(!stream2.readableDidRead, "stream should not be readableDidRead");
|
|
53837
53930
|
const controller = {
|
|
53838
53931
|
resume() {
|
|
53839
53932
|
stream2.resume();
|
|
@@ -55420,7 +55513,7 @@ var require_headers = __commonJS({
|
|
|
55420
55513
|
isValidHeaderValue
|
|
55421
55514
|
} = require_util2();
|
|
55422
55515
|
var { webidl } = require_webidl();
|
|
55423
|
-
var
|
|
55516
|
+
var assert72 = __require("assert");
|
|
55424
55517
|
var util2 = __require("util");
|
|
55425
55518
|
function isHTTPWhiteSpaceCharCode(code) {
|
|
55426
55519
|
return code === 10 || code === 13 || code === 9 || code === 32;
|
|
@@ -55645,11 +55738,11 @@ var require_headers = __commonJS({
|
|
|
55645
55738
|
const iterator = this.headersMap[Symbol.iterator]();
|
|
55646
55739
|
const firstValue = iterator.next().value;
|
|
55647
55740
|
array2[0] = [firstValue[0], firstValue[1].value];
|
|
55648
|
-
|
|
55741
|
+
assert72(firstValue[1].value !== null);
|
|
55649
55742
|
for (let i8 = 1, j8 = 0, right2 = 0, left2 = 0, pivot = 0, x7, value; i8 < size; ++i8) {
|
|
55650
55743
|
value = iterator.next().value;
|
|
55651
55744
|
x7 = array2[i8] = [value[0], value[1].value];
|
|
55652
|
-
|
|
55745
|
+
assert72(x7[1] !== null);
|
|
55653
55746
|
left2 = 0;
|
|
55654
55747
|
right2 = i8;
|
|
55655
55748
|
while (left2 < right2) {
|
|
@@ -55676,7 +55769,7 @@ var require_headers = __commonJS({
|
|
|
55676
55769
|
let i8 = 0;
|
|
55677
55770
|
for (const { 0: name2, 1: { value } } of this.headersMap) {
|
|
55678
55771
|
array2[i8++] = [name2, value];
|
|
55679
|
-
|
|
55772
|
+
assert72(value !== null);
|
|
55680
55773
|
}
|
|
55681
55774
|
return array2.sort(compareHeaderName);
|
|
55682
55775
|
}
|
|
@@ -55904,7 +55997,7 @@ var require_response = __commonJS({
|
|
|
55904
55997
|
var { webidl } = require_webidl();
|
|
55905
55998
|
var { URLSerializer } = require_data_url();
|
|
55906
55999
|
var { kConstruct } = require_symbols();
|
|
55907
|
-
var
|
|
56000
|
+
var assert72 = __require("assert");
|
|
55908
56001
|
var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra();
|
|
55909
56002
|
var textEncoder = new TextEncoder("utf-8");
|
|
55910
56003
|
var Response14 = class _Response {
|
|
@@ -56168,7 +56261,7 @@ var require_response = __commonJS({
|
|
|
56168
56261
|
return p8 in state3 ? state3[p8] : target[p8];
|
|
56169
56262
|
},
|
|
56170
56263
|
set(target, p8, value) {
|
|
56171
|
-
|
|
56264
|
+
assert72(!(p8 in state3));
|
|
56172
56265
|
target[p8] = value;
|
|
56173
56266
|
return true;
|
|
56174
56267
|
}
|
|
@@ -56203,12 +56296,12 @@ var require_response = __commonJS({
|
|
|
56203
56296
|
body: null
|
|
56204
56297
|
});
|
|
56205
56298
|
} else {
|
|
56206
|
-
|
|
56299
|
+
assert72(false);
|
|
56207
56300
|
}
|
|
56208
56301
|
}
|
|
56209
56302
|
__name(filterResponse, "filterResponse");
|
|
56210
56303
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
|
56211
|
-
|
|
56304
|
+
assert72(isCancelled(fetchParams));
|
|
56212
56305
|
return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
|
|
56213
56306
|
}
|
|
56214
56307
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
|
@@ -56342,7 +56435,7 @@ var require_request2 = __commonJS({
|
|
|
56342
56435
|
var { webidl } = require_webidl();
|
|
56343
56436
|
var { URLSerializer } = require_data_url();
|
|
56344
56437
|
var { kConstruct } = require_symbols();
|
|
56345
|
-
var
|
|
56438
|
+
var assert72 = __require("assert");
|
|
56346
56439
|
var { getMaxListeners, setMaxListeners, defaultMaxListeners } = __require("events");
|
|
56347
56440
|
var kAbortController = Symbol("abortController");
|
|
56348
56441
|
var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
|
|
@@ -56422,7 +56515,7 @@ var require_request2 = __commonJS({
|
|
|
56422
56515
|
request4 = makeRequest({ urlList: [parsedURL] });
|
|
56423
56516
|
fallbackMode = "cors";
|
|
56424
56517
|
} else {
|
|
56425
|
-
|
|
56518
|
+
assert72(webidl.is.Request(input2));
|
|
56426
56519
|
request4 = input2.#state;
|
|
56427
56520
|
signal = input2.#signal;
|
|
56428
56521
|
this.#dispatcher = init4.dispatcher || input2.#dispatcher;
|
|
@@ -57082,7 +57175,7 @@ var require_request2 = __commonJS({
|
|
|
57082
57175
|
var require_subresource_integrity = __commonJS({
|
|
57083
57176
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js"(exports2, module2) {
|
|
57084
57177
|
init_import_meta_url();
|
|
57085
|
-
var
|
|
57178
|
+
var assert72 = __require("assert");
|
|
57086
57179
|
var { runtimeFeatures } = require_runtime_features();
|
|
57087
57180
|
var { asciiLowercase } = require_infra();
|
|
57088
57181
|
var validSRIHashAlgorithmTokenSet = /* @__PURE__ */ new Map([["sha256", 0], ["sha384", 1], ["sha512", 2]]);
|
|
@@ -57128,7 +57221,7 @@ var require_subresource_integrity = __commonJS({
|
|
|
57128
57221
|
const result = [];
|
|
57129
57222
|
let strongest = null;
|
|
57130
57223
|
for (const item of metadataList) {
|
|
57131
|
-
|
|
57224
|
+
assert72(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token");
|
|
57132
57225
|
if (result.length === 0) {
|
|
57133
57226
|
result.push(item);
|
|
57134
57227
|
strongest = item;
|
|
@@ -57268,7 +57361,7 @@ var require_fetch = __commonJS({
|
|
|
57268
57361
|
includesCredentials,
|
|
57269
57362
|
isTraversableNavigable
|
|
57270
57363
|
} = require_util2();
|
|
57271
|
-
var
|
|
57364
|
+
var assert72 = __require("assert");
|
|
57272
57365
|
var { safelyExtractBody, extractBody } = require_body();
|
|
57273
57366
|
var {
|
|
57274
57367
|
redirectStatusSet,
|
|
@@ -57355,7 +57448,7 @@ var require_fetch = __commonJS({
|
|
|
57355
57448
|
requestObject.signal,
|
|
57356
57449
|
() => {
|
|
57357
57450
|
locallyAborted = true;
|
|
57358
|
-
|
|
57451
|
+
assert72(controller != null);
|
|
57359
57452
|
controller.abort(requestObject.signal.reason);
|
|
57360
57453
|
const realResponse = responseObject?.deref();
|
|
57361
57454
|
abortFetch(p8, request4, realResponse, requestObject.signal.reason, controller.controller);
|
|
@@ -57461,7 +57554,7 @@ var require_fetch = __commonJS({
|
|
|
57461
57554
|
requestObject = null
|
|
57462
57555
|
// Keep alive to prevent AbortController GC, see #4627
|
|
57463
57556
|
}) {
|
|
57464
|
-
|
|
57557
|
+
assert72(dispatcher);
|
|
57465
57558
|
let taskDestination = null;
|
|
57466
57559
|
let crossOriginIsolatedCapability = false;
|
|
57467
57560
|
if (request4.client != null) {
|
|
@@ -57486,7 +57579,7 @@ var require_fetch = __commonJS({
|
|
|
57486
57579
|
// Keep requestObject alive to prevent its AbortController from being GC'd
|
|
57487
57580
|
requestObject
|
|
57488
57581
|
};
|
|
57489
|
-
|
|
57582
|
+
assert72(!request4.body || request4.body.stream);
|
|
57490
57583
|
if (request4.window === "client") {
|
|
57491
57584
|
request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
|
|
57492
57585
|
}
|
|
@@ -57574,7 +57667,7 @@ var require_fetch = __commonJS({
|
|
|
57574
57667
|
} else if (request4.responseTainting === "opaque") {
|
|
57575
57668
|
response = filterResponse(response, "opaque");
|
|
57576
57669
|
} else {
|
|
57577
|
-
|
|
57670
|
+
assert72(false);
|
|
57578
57671
|
}
|
|
57579
57672
|
}
|
|
57580
57673
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
|
@@ -57807,7 +57900,7 @@ var require_fetch = __commonJS({
|
|
|
57807
57900
|
} else if (request4.redirect === "follow") {
|
|
57808
57901
|
response = await httpRedirectFetch(fetchParams, response);
|
|
57809
57902
|
} else {
|
|
57810
|
-
|
|
57903
|
+
assert72(false);
|
|
57811
57904
|
}
|
|
57812
57905
|
}
|
|
57813
57906
|
response.timingInfo = timingInfo;
|
|
@@ -57861,7 +57954,7 @@ var require_fetch = __commonJS({
|
|
|
57861
57954
|
request4.headersList.delete("host", true);
|
|
57862
57955
|
}
|
|
57863
57956
|
if (request4.body != null) {
|
|
57864
|
-
|
|
57957
|
+
assert72(request4.body.source != null);
|
|
57865
57958
|
request4.body = safelyExtractBody(request4.body.source)[0];
|
|
57866
57959
|
}
|
|
57867
57960
|
const timingInfo = fetchParams.timingInfo;
|
|
@@ -58013,7 +58106,7 @@ var require_fetch = __commonJS({
|
|
|
58013
58106
|
}
|
|
58014
58107
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
|
58015
58108
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
|
58016
|
-
|
|
58109
|
+
assert72(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
|
58017
58110
|
fetchParams.controller.connection = {
|
|
58018
58111
|
abort: null,
|
|
58019
58112
|
destroyed: false,
|
|
@@ -58367,7 +58460,7 @@ var require_fetch = __commonJS({
|
|
|
58367
58460
|
var require_util3 = __commonJS({
|
|
58368
58461
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/cache/util.js"(exports2, module2) {
|
|
58369
58462
|
init_import_meta_url();
|
|
58370
|
-
var
|
|
58463
|
+
var assert72 = __require("assert");
|
|
58371
58464
|
var { URLSerializer } = require_data_url();
|
|
58372
58465
|
var { isValidHeaderName } = require_util2();
|
|
58373
58466
|
function urlEquals(A5, B4, excludeFragment = false) {
|
|
@@ -58377,7 +58470,7 @@ var require_util3 = __commonJS({
|
|
|
58377
58470
|
}
|
|
58378
58471
|
__name(urlEquals, "urlEquals");
|
|
58379
58472
|
function getFieldValues(header) {
|
|
58380
|
-
|
|
58473
|
+
assert72(header !== null);
|
|
58381
58474
|
const values = [];
|
|
58382
58475
|
for (let value of header.split(",")) {
|
|
58383
58476
|
value = value.trim();
|
|
@@ -58399,7 +58492,7 @@ var require_util3 = __commonJS({
|
|
|
58399
58492
|
var require_cache3 = __commonJS({
|
|
58400
58493
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/cache/cache.js"(exports2, module2) {
|
|
58401
58494
|
init_import_meta_url();
|
|
58402
|
-
var
|
|
58495
|
+
var assert72 = __require("assert");
|
|
58403
58496
|
var { kConstruct } = require_symbols();
|
|
58404
58497
|
var { urlEquals, getFieldValues } = require_util3();
|
|
58405
58498
|
var { kEnumerableProperty, isDisturbed } = require_util();
|
|
@@ -58652,7 +58745,7 @@ var require_cache3 = __commonJS({
|
|
|
58652
58745
|
return false;
|
|
58653
58746
|
}
|
|
58654
58747
|
} else {
|
|
58655
|
-
|
|
58748
|
+
assert72(typeof request4 === "string");
|
|
58656
58749
|
r10 = getRequestState(new Request8(request4));
|
|
58657
58750
|
}
|
|
58658
58751
|
const operations = [];
|
|
@@ -58763,7 +58856,7 @@ var require_cache3 = __commonJS({
|
|
|
58763
58856
|
}
|
|
58764
58857
|
for (const requestResponse of requestResponses) {
|
|
58765
58858
|
const idx = cache5.indexOf(requestResponse);
|
|
58766
|
-
|
|
58859
|
+
assert72(idx !== -1);
|
|
58767
58860
|
cache5.splice(idx, 1);
|
|
58768
58861
|
}
|
|
58769
58862
|
} else if (operation.type === "put") {
|
|
@@ -58795,7 +58888,7 @@ var require_cache3 = __commonJS({
|
|
|
58795
58888
|
requestResponses = this.#queryCache(operation.request);
|
|
58796
58889
|
for (const requestResponse of requestResponses) {
|
|
58797
58890
|
const idx = cache5.indexOf(requestResponse);
|
|
58798
|
-
|
|
58891
|
+
assert72(idx !== -1);
|
|
58799
58892
|
cache5.splice(idx, 1);
|
|
58800
58893
|
}
|
|
58801
58894
|
cache5.push([operation.request, operation.response]);
|
|
@@ -59301,7 +59394,7 @@ var require_parse = __commonJS({
|
|
|
59301
59394
|
var { collectASequenceOfCodePointsFast } = require_infra();
|
|
59302
59395
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
|
|
59303
59396
|
var { isCTLExcludingHtab } = require_util4();
|
|
59304
|
-
var
|
|
59397
|
+
var assert72 = __require("assert");
|
|
59305
59398
|
function parseSetCookie(header) {
|
|
59306
59399
|
if (isCTLExcludingHtab(header)) {
|
|
59307
59400
|
return null;
|
|
@@ -59345,7 +59438,7 @@ var require_parse = __commonJS({
|
|
|
59345
59438
|
if (unparsedAttributes.length === 0) {
|
|
59346
59439
|
return cookieAttributeList;
|
|
59347
59440
|
}
|
|
59348
|
-
|
|
59441
|
+
assert72(unparsedAttributes[0] === ";");
|
|
59349
59442
|
unparsedAttributes = unparsedAttributes.slice(1);
|
|
59350
59443
|
let cookieAv = "";
|
|
59351
59444
|
if (unparsedAttributes.includes(";")) {
|
|
@@ -60220,7 +60313,7 @@ var require_connection = __commonJS({
|
|
|
60220
60313
|
var { Headers: Headers7, getHeadersList } = require_headers();
|
|
60221
60314
|
var { getDecodeSplit } = require_util2();
|
|
60222
60315
|
var { WebsocketFrameSend } = require_frame();
|
|
60223
|
-
var
|
|
60316
|
+
var assert72 = __require("assert");
|
|
60224
60317
|
var { runtimeFeatures } = require_runtime_features();
|
|
60225
60318
|
var crypto8 = runtimeFeatures.has("crypto") ? __require("crypto") : null;
|
|
60226
60319
|
var warningEmitted2 = false;
|
|
@@ -60326,7 +60419,7 @@ var require_connection = __commonJS({
|
|
|
60326
60419
|
if (reason.length !== 0 && code === null) {
|
|
60327
60420
|
code = 1e3;
|
|
60328
60421
|
}
|
|
60329
|
-
|
|
60422
|
+
assert72(code === null || Number.isInteger(code));
|
|
60330
60423
|
if (code === null && reason.length === 0) {
|
|
60331
60424
|
frame.frameData = emptyBuffer;
|
|
60332
60425
|
} else if (code !== null && reason === null) {
|
|
@@ -60464,7 +60557,7 @@ var require_receiver = __commonJS({
|
|
|
60464
60557
|
"../../node_modules/.pnpm/undici@7.30.1/node_modules/undici/lib/web/websocket/receiver.js"(exports2, module2) {
|
|
60465
60558
|
init_import_meta_url();
|
|
60466
60559
|
var { Writable: Writable6 } = __require("stream");
|
|
60467
|
-
var
|
|
60560
|
+
var assert72 = __require("assert");
|
|
60468
60561
|
var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
|
|
60469
60562
|
var {
|
|
60470
60563
|
isValidStatusCode,
|
|
@@ -60760,7 +60853,7 @@ var require_receiver = __commonJS({
|
|
|
60760
60853
|
return output2;
|
|
60761
60854
|
}
|
|
60762
60855
|
parseCloseBody(data) {
|
|
60763
|
-
|
|
60856
|
+
assert72(data.length !== 1);
|
|
60764
60857
|
let code;
|
|
60765
60858
|
if (data.length >= 2) {
|
|
60766
60859
|
code = data.readUInt16BE(0);
|
|
@@ -62807,9 +62900,9 @@ function logHeaders(headers, logger7) {
|
|
|
62807
62900
|
);
|
|
62808
62901
|
}
|
|
62809
62902
|
async function performApiFetchBase(complianceConfig, resource, init4 = {}, userAgent, logger7, queryParams, abortSignal, credentials) {
|
|
62810
|
-
|
|
62903
|
+
assert39__default.default(credentials, "credentials are required for performApiFetch");
|
|
62811
62904
|
const method = init4.method ?? "GET";
|
|
62812
|
-
|
|
62905
|
+
assert39__default.default(
|
|
62813
62906
|
resource.startsWith("/"),
|
|
62814
62907
|
`CF API fetch - resource path must start with a "/" but got "${resource}"`
|
|
62815
62908
|
);
|
|
@@ -65416,7 +65509,7 @@ var init_zod_format = __esm({
|
|
|
65416
65509
|
}
|
|
65417
65510
|
});
|
|
65418
65511
|
function toUrlPath(filePath) {
|
|
65419
|
-
|
|
65512
|
+
assert39__default.default(
|
|
65420
65513
|
!/^[a-z]:/i.test(filePath),
|
|
65421
65514
|
"Tried to convert a Windows file path with a drive to a URL path."
|
|
65422
65515
|
);
|
|
@@ -66347,6 +66440,323 @@ var init_d1_migrations = __esm({
|
|
|
66347
66440
|
}
|
|
66348
66441
|
});
|
|
66349
66442
|
|
|
66443
|
+
// ../workers-utils/src/d1-trimmer.ts
|
|
66444
|
+
function trimSqlQuery(sql) {
|
|
66445
|
+
if (!mayContainTransaction(sql)) {
|
|
66446
|
+
return sql;
|
|
66447
|
+
}
|
|
66448
|
+
const trimmedSql = sql.replace("BEGIN TRANSACTION;", "").replace("COMMIT;", "");
|
|
66449
|
+
if (mayContainTransaction(trimmedSql)) {
|
|
66450
|
+
throw new UserError(
|
|
66451
|
+
"Wrangler could not process the provided SQL file, as it contains several transactions.\nD1 runs your SQL in a transaction for you.\nPlease export an SQL file from your SQLite database and try again.",
|
|
66452
|
+
{
|
|
66453
|
+
telemetryMessage: "d1 execute sql file contains multiple transactions"
|
|
66454
|
+
}
|
|
66455
|
+
);
|
|
66456
|
+
}
|
|
66457
|
+
return trimmedSql;
|
|
66458
|
+
}
|
|
66459
|
+
function mayContainTransaction(sql) {
|
|
66460
|
+
return sql.includes("BEGIN TRANSACTION");
|
|
66461
|
+
}
|
|
66462
|
+
var init_d1_trimmer = __esm({
|
|
66463
|
+
"../workers-utils/src/d1-trimmer.ts"() {
|
|
66464
|
+
init_import_meta_url();
|
|
66465
|
+
init_errors();
|
|
66466
|
+
__name(trimSqlQuery, "trimSqlQuery");
|
|
66467
|
+
__name(mayContainTransaction, "mayContainTransaction");
|
|
66468
|
+
}
|
|
66469
|
+
});
|
|
66470
|
+
|
|
66471
|
+
// ../workers-utils/src/d1-splitter.ts
|
|
66472
|
+
function mayContainMultipleStatements(sql) {
|
|
66473
|
+
const trimmed = sql.trimEnd();
|
|
66474
|
+
const semiColonIndex = trimmed.indexOf(";");
|
|
66475
|
+
return semiColonIndex !== -1 && semiColonIndex !== trimmed.length - 1;
|
|
66476
|
+
}
|
|
66477
|
+
function splitSqlQuery(sql) {
|
|
66478
|
+
const trimmedSql = trimSqlQuery(sql);
|
|
66479
|
+
if (!mayContainMultipleStatements(trimmedSql)) {
|
|
66480
|
+
return [trimmedSql];
|
|
66481
|
+
}
|
|
66482
|
+
const split = splitSqlIntoStatements(trimmedSql);
|
|
66483
|
+
if (split.length === 0) {
|
|
66484
|
+
return [trimmedSql];
|
|
66485
|
+
} else {
|
|
66486
|
+
return split;
|
|
66487
|
+
}
|
|
66488
|
+
}
|
|
66489
|
+
function normalizeSqlLineEndings(sql) {
|
|
66490
|
+
let normalized = "";
|
|
66491
|
+
let quoteEnd;
|
|
66492
|
+
let inLineComment = false;
|
|
66493
|
+
let inBlockComment = false;
|
|
66494
|
+
for (let index = 0; index < sql.length; index++) {
|
|
66495
|
+
const char = sql[index];
|
|
66496
|
+
const nextChar = sql[index + 1];
|
|
66497
|
+
if (quoteEnd !== void 0) {
|
|
66498
|
+
normalized += char;
|
|
66499
|
+
if (char === quoteEnd) {
|
|
66500
|
+
if (nextChar === quoteEnd) {
|
|
66501
|
+
normalized += nextChar;
|
|
66502
|
+
index++;
|
|
66503
|
+
} else {
|
|
66504
|
+
quoteEnd = void 0;
|
|
66505
|
+
}
|
|
66506
|
+
}
|
|
66507
|
+
continue;
|
|
66508
|
+
}
|
|
66509
|
+
if (inLineComment) {
|
|
66510
|
+
if (char === "\r" && nextChar === "\n") {
|
|
66511
|
+
normalized += "\n";
|
|
66512
|
+
index++;
|
|
66513
|
+
inLineComment = false;
|
|
66514
|
+
} else {
|
|
66515
|
+
normalized += char;
|
|
66516
|
+
inLineComment = char !== "\n";
|
|
66517
|
+
}
|
|
66518
|
+
continue;
|
|
66519
|
+
}
|
|
66520
|
+
if (inBlockComment) {
|
|
66521
|
+
if (char === "\r" && nextChar === "\n") {
|
|
66522
|
+
normalized += "\n";
|
|
66523
|
+
index++;
|
|
66524
|
+
} else {
|
|
66525
|
+
normalized += char;
|
|
66526
|
+
if (char === "*" && nextChar === "/") {
|
|
66527
|
+
normalized += nextChar;
|
|
66528
|
+
index++;
|
|
66529
|
+
inBlockComment = false;
|
|
66530
|
+
}
|
|
66531
|
+
}
|
|
66532
|
+
continue;
|
|
66533
|
+
}
|
|
66534
|
+
if (char === "-" && nextChar === "-") {
|
|
66535
|
+
normalized += "--";
|
|
66536
|
+
index++;
|
|
66537
|
+
inLineComment = true;
|
|
66538
|
+
continue;
|
|
66539
|
+
}
|
|
66540
|
+
if (char === "/" && nextChar === "*") {
|
|
66541
|
+
normalized += "/*";
|
|
66542
|
+
index++;
|
|
66543
|
+
inBlockComment = true;
|
|
66544
|
+
continue;
|
|
66545
|
+
}
|
|
66546
|
+
if (char === "'" || char === '"' || char === "`") {
|
|
66547
|
+
normalized += char;
|
|
66548
|
+
quoteEnd = char;
|
|
66549
|
+
continue;
|
|
66550
|
+
}
|
|
66551
|
+
if (char === "[") {
|
|
66552
|
+
normalized += char;
|
|
66553
|
+
quoteEnd = "]";
|
|
66554
|
+
continue;
|
|
66555
|
+
}
|
|
66556
|
+
if (char === "\r" && nextChar === "\n") {
|
|
66557
|
+
normalized += "\n";
|
|
66558
|
+
index++;
|
|
66559
|
+
continue;
|
|
66560
|
+
}
|
|
66561
|
+
normalized += char;
|
|
66562
|
+
}
|
|
66563
|
+
return normalized;
|
|
66564
|
+
}
|
|
66565
|
+
function splitSqlIntoStatements(sql) {
|
|
66566
|
+
const statements = [];
|
|
66567
|
+
let start = 0;
|
|
66568
|
+
while (start < sql.length) {
|
|
66569
|
+
const { end, hasUsefulToken } = findCompleteStatementEnd(sql, start);
|
|
66570
|
+
if (end === void 0) {
|
|
66571
|
+
if (hasUsefulToken) {
|
|
66572
|
+
statements.push(sql.slice(start).trim());
|
|
66573
|
+
}
|
|
66574
|
+
break;
|
|
66575
|
+
}
|
|
66576
|
+
const statement = sql.slice(start, end - 1).trim();
|
|
66577
|
+
if (hasUsefulToken && statement.length > 0) {
|
|
66578
|
+
statements.push(statement);
|
|
66579
|
+
}
|
|
66580
|
+
start = end;
|
|
66581
|
+
}
|
|
66582
|
+
return statements;
|
|
66583
|
+
}
|
|
66584
|
+
function findCompleteStatementEnd(sql, start) {
|
|
66585
|
+
let state3 = "INVALID";
|
|
66586
|
+
let hasUsefulToken = false;
|
|
66587
|
+
for (let index = start; index < sql.length; index++) {
|
|
66588
|
+
const char = sql[index];
|
|
66589
|
+
let token;
|
|
66590
|
+
if (char === ";") {
|
|
66591
|
+
token = "tkSEMI";
|
|
66592
|
+
} else if (char === " " || char === "\r" || char === " " || char === "\n" || char === "\f") {
|
|
66593
|
+
token = "tkWS";
|
|
66594
|
+
} else if (char === "/" && sql[index + 1] === "*") {
|
|
66595
|
+
const end = sql.indexOf("*/", index + 2);
|
|
66596
|
+
if (end === -1) {
|
|
66597
|
+
return { end: void 0, hasUsefulToken };
|
|
66598
|
+
}
|
|
66599
|
+
index = end + 1;
|
|
66600
|
+
token = "tkWS";
|
|
66601
|
+
} else if (char === "-" && sql[index + 1] === "-") {
|
|
66602
|
+
const end = sql.indexOf("\n", index + 2);
|
|
66603
|
+
if (end === -1) {
|
|
66604
|
+
return { end: void 0, hasUsefulToken };
|
|
66605
|
+
}
|
|
66606
|
+
index = end;
|
|
66607
|
+
token = "tkWS";
|
|
66608
|
+
} else if (char === "[") {
|
|
66609
|
+
const end = sql.indexOf("]", index + 1);
|
|
66610
|
+
if (end === -1) {
|
|
66611
|
+
return { end: void 0, hasUsefulToken: true };
|
|
66612
|
+
}
|
|
66613
|
+
index = end;
|
|
66614
|
+
token = "tkOTHER";
|
|
66615
|
+
} else if (char === "'" || char === '"' || char === "`") {
|
|
66616
|
+
const end = sql.indexOf(char, index + 1);
|
|
66617
|
+
if (end === -1) {
|
|
66618
|
+
return { end: void 0, hasUsefulToken: true };
|
|
66619
|
+
}
|
|
66620
|
+
index = end;
|
|
66621
|
+
token = "tkOTHER";
|
|
66622
|
+
} else if (isIdentifierChar(char)) {
|
|
66623
|
+
const identifierStart = index;
|
|
66624
|
+
while (index + 1 < sql.length && isIdentifierChar(sql[index + 1])) {
|
|
66625
|
+
index++;
|
|
66626
|
+
}
|
|
66627
|
+
token = classifyIdentifier(sql.slice(identifierStart, index + 1));
|
|
66628
|
+
} else {
|
|
66629
|
+
token = "tkOTHER";
|
|
66630
|
+
}
|
|
66631
|
+
hasUsefulToken ||= token !== "tkSEMI" && token !== "tkWS";
|
|
66632
|
+
state3 = getNextState(state3, token);
|
|
66633
|
+
if (state3 === "START") {
|
|
66634
|
+
return { end: index + 1, hasUsefulToken };
|
|
66635
|
+
}
|
|
66636
|
+
}
|
|
66637
|
+
return { end: void 0, hasUsefulToken };
|
|
66638
|
+
}
|
|
66639
|
+
function getNextState(state3, token) {
|
|
66640
|
+
return transitions[state3][token];
|
|
66641
|
+
}
|
|
66642
|
+
function isIdentifierChar(char) {
|
|
66643
|
+
return /[A-Za-z0-9_$\u0080-\uffff]/.test(char);
|
|
66644
|
+
}
|
|
66645
|
+
function classifyIdentifier(identifier) {
|
|
66646
|
+
switch (identifier.toLowerCase()) {
|
|
66647
|
+
case "explain":
|
|
66648
|
+
return "tkEXPLAIN";
|
|
66649
|
+
case "create":
|
|
66650
|
+
return "tkCREATE";
|
|
66651
|
+
case "temp":
|
|
66652
|
+
case "temporary":
|
|
66653
|
+
return "tkTEMP";
|
|
66654
|
+
case "trigger":
|
|
66655
|
+
return "tkTRIGGER";
|
|
66656
|
+
case "end":
|
|
66657
|
+
return "tkEND";
|
|
66658
|
+
default:
|
|
66659
|
+
return "tkOTHER";
|
|
66660
|
+
}
|
|
66661
|
+
}
|
|
66662
|
+
var transitions;
|
|
66663
|
+
var init_d1_splitter = __esm({
|
|
66664
|
+
"../workers-utils/src/d1-splitter.ts"() {
|
|
66665
|
+
init_import_meta_url();
|
|
66666
|
+
init_d1_trimmer();
|
|
66667
|
+
__name(mayContainMultipleStatements, "mayContainMultipleStatements");
|
|
66668
|
+
__name(splitSqlQuery, "splitSqlQuery");
|
|
66669
|
+
__name(normalizeSqlLineEndings, "normalizeSqlLineEndings");
|
|
66670
|
+
__name(splitSqlIntoStatements, "splitSqlIntoStatements");
|
|
66671
|
+
transitions = {
|
|
66672
|
+
INVALID: {
|
|
66673
|
+
tkSEMI: "START",
|
|
66674
|
+
tkWS: "INVALID",
|
|
66675
|
+
tkOTHER: "NORMAL",
|
|
66676
|
+
tkEXPLAIN: "EXPLAIN",
|
|
66677
|
+
tkCREATE: "CREATE",
|
|
66678
|
+
tkTEMP: "NORMAL",
|
|
66679
|
+
tkTRIGGER: "NORMAL",
|
|
66680
|
+
tkEND: "NORMAL"
|
|
66681
|
+
},
|
|
66682
|
+
START: {
|
|
66683
|
+
tkSEMI: "START",
|
|
66684
|
+
tkWS: "START",
|
|
66685
|
+
tkOTHER: "NORMAL",
|
|
66686
|
+
tkEXPLAIN: "EXPLAIN",
|
|
66687
|
+
tkCREATE: "CREATE",
|
|
66688
|
+
tkTEMP: "NORMAL",
|
|
66689
|
+
tkTRIGGER: "NORMAL",
|
|
66690
|
+
tkEND: "NORMAL"
|
|
66691
|
+
},
|
|
66692
|
+
NORMAL: {
|
|
66693
|
+
tkSEMI: "START",
|
|
66694
|
+
tkWS: "NORMAL",
|
|
66695
|
+
tkOTHER: "NORMAL",
|
|
66696
|
+
tkEXPLAIN: "NORMAL",
|
|
66697
|
+
tkCREATE: "NORMAL",
|
|
66698
|
+
tkTEMP: "NORMAL",
|
|
66699
|
+
tkTRIGGER: "NORMAL",
|
|
66700
|
+
tkEND: "NORMAL"
|
|
66701
|
+
},
|
|
66702
|
+
EXPLAIN: {
|
|
66703
|
+
tkSEMI: "START",
|
|
66704
|
+
tkWS: "EXPLAIN",
|
|
66705
|
+
tkOTHER: "EXPLAIN",
|
|
66706
|
+
tkEXPLAIN: "NORMAL",
|
|
66707
|
+
tkCREATE: "CREATE",
|
|
66708
|
+
tkTEMP: "NORMAL",
|
|
66709
|
+
tkTRIGGER: "NORMAL",
|
|
66710
|
+
tkEND: "NORMAL"
|
|
66711
|
+
},
|
|
66712
|
+
CREATE: {
|
|
66713
|
+
tkSEMI: "START",
|
|
66714
|
+
tkWS: "CREATE",
|
|
66715
|
+
tkOTHER: "NORMAL",
|
|
66716
|
+
tkEXPLAIN: "NORMAL",
|
|
66717
|
+
tkCREATE: "NORMAL",
|
|
66718
|
+
tkTEMP: "CREATE",
|
|
66719
|
+
tkTRIGGER: "TRIGGER",
|
|
66720
|
+
tkEND: "NORMAL"
|
|
66721
|
+
},
|
|
66722
|
+
TRIGGER: {
|
|
66723
|
+
tkSEMI: "SEMI",
|
|
66724
|
+
tkWS: "TRIGGER",
|
|
66725
|
+
tkOTHER: "TRIGGER",
|
|
66726
|
+
tkEXPLAIN: "TRIGGER",
|
|
66727
|
+
tkCREATE: "TRIGGER",
|
|
66728
|
+
tkTEMP: "TRIGGER",
|
|
66729
|
+
tkTRIGGER: "TRIGGER",
|
|
66730
|
+
tkEND: "TRIGGER"
|
|
66731
|
+
},
|
|
66732
|
+
SEMI: {
|
|
66733
|
+
tkSEMI: "SEMI",
|
|
66734
|
+
tkWS: "SEMI",
|
|
66735
|
+
tkOTHER: "TRIGGER",
|
|
66736
|
+
tkEXPLAIN: "TRIGGER",
|
|
66737
|
+
tkCREATE: "TRIGGER",
|
|
66738
|
+
tkTEMP: "TRIGGER",
|
|
66739
|
+
tkTRIGGER: "TRIGGER",
|
|
66740
|
+
tkEND: "END"
|
|
66741
|
+
},
|
|
66742
|
+
END: {
|
|
66743
|
+
tkSEMI: "START",
|
|
66744
|
+
tkWS: "END",
|
|
66745
|
+
tkOTHER: "TRIGGER",
|
|
66746
|
+
tkEXPLAIN: "TRIGGER",
|
|
66747
|
+
tkCREATE: "TRIGGER",
|
|
66748
|
+
tkTEMP: "TRIGGER",
|
|
66749
|
+
tkTRIGGER: "TRIGGER",
|
|
66750
|
+
tkEND: "TRIGGER"
|
|
66751
|
+
}
|
|
66752
|
+
};
|
|
66753
|
+
__name(findCompleteStatementEnd, "findCompleteStatementEnd");
|
|
66754
|
+
__name(getNextState, "getNextState");
|
|
66755
|
+
__name(isIdentifierChar, "isIdentifierChar");
|
|
66756
|
+
__name(classifyIdentifier, "classifyIdentifier");
|
|
66757
|
+
}
|
|
66758
|
+
});
|
|
66759
|
+
|
|
66350
66760
|
// ../workers-utils/src/index.ts
|
|
66351
66761
|
var friendlyBindingNames2;
|
|
66352
66762
|
var init_src = __esm({
|
|
@@ -66400,6 +66810,7 @@ var init_src = __esm({
|
|
|
66400
66810
|
init_zod_format();
|
|
66401
66811
|
init_url_path();
|
|
66402
66812
|
init_d1_migrations();
|
|
66813
|
+
init_d1_splitter();
|
|
66403
66814
|
friendlyBindingNames2 = friendlyBindingNames;
|
|
66404
66815
|
}
|
|
66405
66816
|
});
|
|
@@ -68120,8 +68531,8 @@ var init_esm2 = __esm({
|
|
|
68120
68531
|
mainFilename = __dirname3.substring(0, __dirname3.lastIndexOf("node_modules"));
|
|
68121
68532
|
esm_default2 = {
|
|
68122
68533
|
assert: {
|
|
68123
|
-
notStrictEqual:
|
|
68124
|
-
strictEqual:
|
|
68534
|
+
notStrictEqual: assert39.notStrictEqual,
|
|
68535
|
+
strictEqual: assert39.strictEqual
|
|
68125
68536
|
},
|
|
68126
68537
|
cliui: ui,
|
|
68127
68538
|
findUp: sync_default,
|
|
@@ -68193,7 +68604,7 @@ var name, version2;
|
|
|
68193
68604
|
var init_package = __esm({
|
|
68194
68605
|
"package.json"() {
|
|
68195
68606
|
name = "wrangler";
|
|
68196
|
-
version2 = "4.
|
|
68607
|
+
version2 = "4.157.0";
|
|
68197
68608
|
}
|
|
68198
68609
|
});
|
|
68199
68610
|
|
|
@@ -130689,7 +131100,7 @@ function isReturningFromAuthServer(query, state3, logger7) {
|
|
|
130689
131100
|
if (!code) {
|
|
130690
131101
|
return false;
|
|
130691
131102
|
}
|
|
130692
|
-
|
|
131103
|
+
assert39__default.default(!Array.isArray(code));
|
|
130693
131104
|
state3.authorizationCode = code;
|
|
130694
131105
|
state3.hasAuthCodeBeenExchangedForAccessToken = false;
|
|
130695
131106
|
return true;
|
|
@@ -130963,7 +131374,7 @@ async function getOauthToken(options, state3, ctx, generators) {
|
|
|
130963
131374
|
if (error64 || closeErr) {
|
|
130964
131375
|
reject(error64 || closeErr);
|
|
130965
131376
|
} else {
|
|
130966
|
-
|
|
131377
|
+
assert39__default.default(token);
|
|
130967
131378
|
resolve38(token);
|
|
130968
131379
|
}
|
|
130969
131380
|
});
|
|
@@ -130976,7 +131387,7 @@ async function getOauthToken(options, state3, ctx, generators) {
|
|
|
130976
131387
|
}
|
|
130977
131388
|
__name(renderErrorPage, "renderErrorPage");
|
|
130978
131389
|
__name2(renderErrorPage, "renderErrorPage");
|
|
130979
|
-
|
|
131390
|
+
assert39__default.default(req.url, "This request doesn't have a URL");
|
|
130980
131391
|
const { pathname, query } = Url__default.default.parse(req.url, true);
|
|
130981
131392
|
if (req.method !== "GET") {
|
|
130982
131393
|
return res.end("OK");
|
|
@@ -143976,7 +144387,7 @@ var require_signal_exit = __commonJS({
|
|
|
143976
144387
|
};
|
|
143977
144388
|
};
|
|
143978
144389
|
} else {
|
|
143979
|
-
|
|
144390
|
+
assert72 = __require("assert");
|
|
143980
144391
|
signals2 = require_signals();
|
|
143981
144392
|
isWin = /^win/i.test(process18.platform);
|
|
143982
144393
|
EE = __require("events");
|
|
@@ -143999,7 +144410,7 @@ var require_signal_exit = __commonJS({
|
|
|
143999
144410
|
return function() {
|
|
144000
144411
|
};
|
|
144001
144412
|
}
|
|
144002
|
-
|
|
144413
|
+
assert72.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
|
144003
144414
|
if (loaded === false) {
|
|
144004
144415
|
load2();
|
|
144005
144416
|
}
|
|
@@ -144105,7 +144516,7 @@ var require_signal_exit = __commonJS({
|
|
|
144105
144516
|
}
|
|
144106
144517
|
}, "processEmit");
|
|
144107
144518
|
}
|
|
144108
|
-
var
|
|
144519
|
+
var assert72;
|
|
144109
144520
|
var signals2;
|
|
144110
144521
|
var isWin;
|
|
144111
144522
|
var EE;
|
|
@@ -145962,10 +146373,11 @@ function isDockerfileContainerConfig(container) {
|
|
|
145962
146373
|
return "dockerfile" in container;
|
|
145963
146374
|
}
|
|
145964
146375
|
async function constructBuildCommand(options) {
|
|
146376
|
+
const imageOutput = process.env.WRANGLER_CONTAINER_IMAGE_COMPRESSION === "zstd" ? "type=docker,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true" : void 0;
|
|
145965
146377
|
const platform4 = options.platform ?? "linux/amd64";
|
|
145966
146378
|
const buildCmd = [
|
|
145967
146379
|
"build",
|
|
145968
|
-
"--load",
|
|
146380
|
+
...imageOutput ? ["--output", imageOutput] : ["--load"],
|
|
145969
146381
|
"-t",
|
|
145970
146382
|
options.tag,
|
|
145971
146383
|
"--platform",
|
|
@@ -145991,6 +146403,19 @@ async function startContainerBuild({
|
|
|
145991
146403
|
pathToDocker,
|
|
145992
146404
|
verifyDockerIsRunning
|
|
145993
146405
|
}) {
|
|
146406
|
+
if (process.env.WRANGLER_CONTAINER_IMAGE_COMPRESSION === "zstd") {
|
|
146407
|
+
const driverStatus = runDockerCmdWithOutput(pathToDocker, [
|
|
146408
|
+
"info",
|
|
146409
|
+
"--format",
|
|
146410
|
+
"{{json .DriverStatus}}"
|
|
146411
|
+
]);
|
|
146412
|
+
if (!driverStatus.includes("io.containerd.snapshotter.v1")) {
|
|
146413
|
+
throw new UserError(
|
|
146414
|
+
"Zstd compression requires Docker's containerd image store. Enable the containerd image store or unset WRANGLER_CONTAINER_IMAGE_COMPRESSION.",
|
|
146415
|
+
{ telemetryMessage: false }
|
|
146416
|
+
);
|
|
146417
|
+
}
|
|
146418
|
+
}
|
|
145994
146419
|
const { buildCmd, dockerfile } = await constructBuildCommand(build5);
|
|
145995
146420
|
return await dockerBuild(pathToDocker, {
|
|
145996
146421
|
buildCmd,
|
|
@@ -146927,7 +147352,7 @@ function requiresObservabilityMigration(app, observability) {
|
|
|
146927
147352
|
}
|
|
146928
147353
|
function buildLegacyObservabilityMigrationPatch(app) {
|
|
146929
147354
|
const observability = app.configuration.observability;
|
|
146930
|
-
|
|
147355
|
+
assert39__default.default(observability?.logs?.enabled === true);
|
|
146931
147356
|
return { logs: observability.logs };
|
|
146932
147357
|
}
|
|
146933
147358
|
function migrateLegacyObservabilityState(app, observability) {
|
|
@@ -156406,17 +156831,12 @@ Add \`fallthrough = true\` to rule to allow next rule to be used or \`fallthroug
|
|
|
156406
156831
|
rulesToRemove.forEach((rule) => rules.splice(rules.indexOf(rule), 1));
|
|
156407
156832
|
return { rules, removedRules: rulesToRemove };
|
|
156408
156833
|
}
|
|
156409
|
-
var DEFAULT_MODULE_RULES;
|
|
156410
156834
|
var init_rules13 = __esm({
|
|
156411
156835
|
"src/deployment-bundle/rules.ts"() {
|
|
156412
156836
|
init_import_meta_url();
|
|
156837
|
+
init_src();
|
|
156413
156838
|
init_logger2();
|
|
156414
156839
|
__name(isJavaScriptModuleRule, "isJavaScriptModuleRule");
|
|
156415
|
-
DEFAULT_MODULE_RULES = [
|
|
156416
|
-
{ type: "Text", globs: ["**/*.txt", "**/*.html", "**/*.sql"] },
|
|
156417
|
-
{ type: "Data", globs: ["**/*.bin"] },
|
|
156418
|
-
{ type: "CompiledWasm", globs: ["**/*.wasm", "**/*.wasm?module"] }
|
|
156419
|
-
];
|
|
156420
156840
|
__name(parseRules, "parseRules");
|
|
156421
156841
|
}
|
|
156422
156842
|
});
|
|
@@ -156899,7 +157319,7 @@ function createModuleCollector(props) {
|
|
|
156899
157319
|
)}". This will stop working in the future. Replace references to "${args.path}" with "./${args.path}";`
|
|
156900
157320
|
);
|
|
156901
157321
|
const cleanedPath = stripQueryString(args.path);
|
|
156902
|
-
|
|
157322
|
+
assert39__default.default(props.wrangler1xLegacyModuleReferences);
|
|
156903
157323
|
const filePath = path29__namespace.default.join(
|
|
156904
157324
|
props.wrangler1xLegacyModuleReferences.rootDirectory,
|
|
156905
157325
|
cleanedPath
|
|
@@ -164816,6 +165236,30 @@ var init_owned_workflows = __esm({
|
|
|
164816
165236
|
}
|
|
164817
165237
|
});
|
|
164818
165238
|
|
|
165239
|
+
// ../deploy-helpers/src/shared/partition-routes.ts
|
|
165240
|
+
function partitionRoutes(routes) {
|
|
165241
|
+
const routesOnly = [];
|
|
165242
|
+
const customDomainsOnly = [];
|
|
165243
|
+
for (const route of routes) {
|
|
165244
|
+
if (isCustomDomainRoute(route)) {
|
|
165245
|
+
customDomainsOnly.push(route);
|
|
165246
|
+
} else {
|
|
165247
|
+
routesOnly.push(route);
|
|
165248
|
+
}
|
|
165249
|
+
}
|
|
165250
|
+
return { routesOnly, customDomainsOnly };
|
|
165251
|
+
}
|
|
165252
|
+
function isCustomDomainRoute(route) {
|
|
165253
|
+
return typeof route !== "string" && route.custom_domain === true;
|
|
165254
|
+
}
|
|
165255
|
+
var init_partition_routes = __esm({
|
|
165256
|
+
"../deploy-helpers/src/shared/partition-routes.ts"() {
|
|
165257
|
+
init_import_meta_url();
|
|
165258
|
+
__name(partitionRoutes, "partitionRoutes");
|
|
165259
|
+
__name(isCustomDomainRoute, "isCustomDomainRoute");
|
|
165260
|
+
}
|
|
165261
|
+
});
|
|
165262
|
+
|
|
164819
165263
|
// ../deploy-helpers/src/deploy/helpers/worker-not-found-error.ts
|
|
164820
165264
|
function isWorkerNotFoundError(error64) {
|
|
164821
165265
|
return typeof error64 === "object" && error64 !== null && "code" in error64 && (error64.code === WORKER_NOT_FOUND_ERR_CODE || error64.code === WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE);
|
|
@@ -166176,7 +166620,7 @@ async function triggersDeploy(props) {
|
|
|
166176
166620
|
return;
|
|
166177
166621
|
}
|
|
166178
166622
|
const { accountId } = props;
|
|
166179
|
-
|
|
166623
|
+
assert39__default.default(accountId);
|
|
166180
166624
|
if (props.validated !== true) {
|
|
166181
166625
|
await ensureQueuesExistByConfig(
|
|
166182
166626
|
config2,
|
|
@@ -166186,15 +166630,7 @@ async function triggersDeploy(props) {
|
|
|
166186
166630
|
props.queueCreateCommand
|
|
166187
166631
|
);
|
|
166188
166632
|
}
|
|
166189
|
-
const routesOnly =
|
|
166190
|
-
const customDomainsOnly = [];
|
|
166191
|
-
for (const route of routes) {
|
|
166192
|
-
if (typeof route !== "string" && route.custom_domain) {
|
|
166193
|
-
customDomainsOnly.push(route);
|
|
166194
|
-
} else {
|
|
166195
|
-
routesOnly.push(route);
|
|
166196
|
-
}
|
|
166197
|
-
}
|
|
166633
|
+
const { routesOnly, customDomainsOnly } = partitionRoutes(routes);
|
|
166198
166634
|
const start = Date.now();
|
|
166199
166635
|
const workerUrl = `/accounts/${accountId}/workers/scripts/${scriptName}`;
|
|
166200
166636
|
const uploadMs = Date.now() - start;
|
|
@@ -166800,6 +167236,7 @@ var init_deploy = __esm({
|
|
|
166800
167236
|
init_error_codes();
|
|
166801
167237
|
init_owned_workflows();
|
|
166802
167238
|
init_context();
|
|
167239
|
+
init_partition_routes();
|
|
166803
167240
|
init_email_routing2();
|
|
166804
167241
|
init_publish_routes();
|
|
166805
167242
|
init_queue_consumers();
|
|
@@ -168912,7 +169349,7 @@ var init_assets5 = __esm({
|
|
|
168912
169349
|
MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
168913
169350
|
MAX_DIFF_LINES = 100;
|
|
168914
169351
|
syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
|
|
168915
|
-
|
|
169352
|
+
assert39__default.default(accountId, "Missing accountId");
|
|
168916
169353
|
logger.info("\u{1F300} Building list of assets...");
|
|
168917
169354
|
const manifest = await buildAssetManifest(assetDirectory);
|
|
168918
169355
|
const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
|
|
@@ -169635,7 +170072,7 @@ function getContainerMetadata(containers, preparedContainerImages = {}, options
|
|
|
169635
170072
|
return containers?.map((container) => {
|
|
169636
170073
|
if (isDurableObjectContainerApp(container)) {
|
|
169637
170074
|
const className = managedClasses.get(container.name);
|
|
169638
|
-
|
|
170075
|
+
assert39__default.default(className, "managed container class should have been resolved");
|
|
169639
170076
|
const configuredImages = Object.keys(container.images ?? {});
|
|
169640
170077
|
const images = preparedContainerImages[className];
|
|
169641
170078
|
if (configuredImages.length > 0 && images === void 0 && !options.allowUnprepared) {
|
|
@@ -170407,7 +170844,7 @@ function createWorkerUploadForm(worker, bindings2, options) {
|
|
|
170407
170844
|
const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
|
|
170408
170845
|
const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
|
|
170409
170846
|
if (hasManifest && main2.type === "esm") {
|
|
170410
|
-
|
|
170847
|
+
assert39__default.default(modules !== void 0);
|
|
170411
170848
|
const subDirs = new Set(
|
|
170412
170849
|
modules.map((module2) => path29__namespace.default.posix.dirname(module2.name))
|
|
170413
170850
|
);
|
|
@@ -170836,7 +171273,7 @@ async function pushOrResolveImage(config2, container, imageName, imageConfig, bu
|
|
|
170836
171273
|
if (dryRun) {
|
|
170837
171274
|
return imageConfig.image;
|
|
170838
171275
|
}
|
|
170839
|
-
|
|
171276
|
+
assert39__default.default(accountId, "Expected accountId to resolve container image name");
|
|
170840
171277
|
return resolveImageName(accountId, imageConfig.image, config2);
|
|
170841
171278
|
}
|
|
170842
171279
|
const builtImage = getBuiltImage(container, imageName, builtImages);
|
|
@@ -170922,7 +171359,7 @@ async function prepareDurableObjectContainerApplications(config2, durableObjectC
|
|
|
170922
171359
|
config2.exports
|
|
170923
171360
|
);
|
|
170924
171361
|
if (!dryRun) {
|
|
170925
|
-
|
|
171362
|
+
assert39__default.default(accountId, "Expected accountId to prepare container applications");
|
|
170926
171363
|
const storageByClass = getDurableObjectClassNameToUseSQLiteMap(
|
|
170927
171364
|
config2.migrations,
|
|
170928
171365
|
config2.exports
|
|
@@ -170947,9 +171384,9 @@ async function prepareDurableObjectContainerApplications(config2, durableObjectC
|
|
|
170947
171384
|
}
|
|
170948
171385
|
}
|
|
170949
171386
|
if (!dryRun && requireExistingImageLessApplications) {
|
|
170950
|
-
|
|
170951
|
-
|
|
170952
|
-
|
|
171387
|
+
assert39__default.default(accountId);
|
|
171388
|
+
assert39__default.default(deployCommand2, "Expected deploy command for versions upload");
|
|
171389
|
+
assert39__default.default(
|
|
170953
171390
|
versionsUploadCommand2,
|
|
170954
171391
|
"Expected versions upload command for versions upload"
|
|
170955
171392
|
);
|
|
@@ -171115,7 +171552,7 @@ var init_environments = __esm({
|
|
|
171115
171552
|
});
|
|
171116
171553
|
async function getMigrationsToUpload(scriptName, props) {
|
|
171117
171554
|
const { config: config2, accountId } = props;
|
|
171118
|
-
|
|
171555
|
+
assert39__default.default(accountId, "Missing accountId");
|
|
171119
171556
|
let migrations;
|
|
171120
171557
|
if (config2.migrations.length > 0) {
|
|
171121
171558
|
let script;
|
|
@@ -176322,7 +176759,7 @@ async function provisionBindings(bindings2, accountId, scriptName, autoCreate, c
|
|
|
176322
176759
|
options.d1DeleteCommand
|
|
176323
176760
|
);
|
|
176324
176761
|
if (pendingResources.length > 0) {
|
|
176325
|
-
|
|
176762
|
+
assert39__default.default(
|
|
176326
176763
|
configPath,
|
|
176327
176764
|
"Provisioning resources is not possible without a config file"
|
|
176328
176765
|
);
|
|
@@ -176397,7 +176834,7 @@ async function provisionBindings(bindings2, accountId, scriptName, autoCreate, c
|
|
|
176397
176834
|
}
|
|
176398
176835
|
}
|
|
176399
176836
|
if (config2.userConfigPath && config2.userConfigPath !== config2.configPath) {
|
|
176400
|
-
|
|
176837
|
+
assert39__default.default(config2.configPath);
|
|
176401
176838
|
try {
|
|
176402
176839
|
writeProvisionedIdsToConfig(config2.configPath, resolvedResources);
|
|
176403
176840
|
} catch (error64) {
|
|
@@ -176835,7 +177272,7 @@ var init_provision_bindings = __esm({
|
|
|
176835
177272
|
);
|
|
176836
177273
|
}
|
|
176837
177274
|
async isConnectedToExistingResource() {
|
|
176838
|
-
|
|
177275
|
+
assert39__default.default(typeof this.binding.bucket_name !== "symbol");
|
|
176839
177276
|
if (!this.binding.bucket_name) {
|
|
176840
177277
|
return false;
|
|
176841
177278
|
}
|
|
@@ -176882,7 +177319,7 @@ var init_provision_bindings = __esm({
|
|
|
176882
177319
|
);
|
|
176883
177320
|
}
|
|
176884
177321
|
async isConnectedToExistingResource() {
|
|
176885
|
-
|
|
177322
|
+
assert39__default.default(typeof this.binding.namespace !== "symbol");
|
|
176886
177323
|
if (!this.binding.namespace) {
|
|
176887
177324
|
return false;
|
|
176888
177325
|
}
|
|
@@ -176925,7 +177362,7 @@ var init_provision_bindings = __esm({
|
|
|
176925
177362
|
);
|
|
176926
177363
|
}
|
|
176927
177364
|
async isConnectedToExistingResource() {
|
|
176928
|
-
|
|
177365
|
+
assert39__default.default(typeof this.binding.namespace !== "symbol");
|
|
176929
177366
|
if (!this.binding.namespace) {
|
|
176930
177367
|
return false;
|
|
176931
177368
|
}
|
|
@@ -176980,7 +177417,7 @@ var init_provision_bindings = __esm({
|
|
|
176980
177417
|
return true;
|
|
176981
177418
|
}
|
|
176982
177419
|
async isConnectedToExistingResource() {
|
|
176983
|
-
|
|
177420
|
+
assert39__default.default(typeof this.binding.queue_name !== "symbol");
|
|
176984
177421
|
if (!this.binding.queue_name) {
|
|
176985
177422
|
return false;
|
|
176986
177423
|
}
|
|
@@ -177036,7 +177473,7 @@ var init_provision_bindings = __esm({
|
|
|
177036
177473
|
return true;
|
|
177037
177474
|
}
|
|
177038
177475
|
async isConnectedToExistingResource() {
|
|
177039
|
-
|
|
177476
|
+
assert39__default.default(typeof this.binding.namespace !== "symbol");
|
|
177040
177477
|
if (!this.binding.namespace) {
|
|
177041
177478
|
return false;
|
|
177042
177479
|
}
|
|
@@ -177165,7 +177602,7 @@ var init_provision_bindings = __esm({
|
|
|
177165
177602
|
return false;
|
|
177166
177603
|
}
|
|
177167
177604
|
async isConnectedToExistingResource() {
|
|
177168
|
-
|
|
177605
|
+
assert39__default.default(typeof this.binding.database_name !== "symbol");
|
|
177169
177606
|
if (!this.binding.database_name) {
|
|
177170
177607
|
return false;
|
|
177171
177608
|
}
|
|
@@ -177934,7 +178371,7 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
|
|
|
177934
178371
|
if (sourceMappingPrepareStackTrace !== void 0) {
|
|
177935
178372
|
return sourceMappingPrepareStackTrace;
|
|
177936
178373
|
}
|
|
177937
|
-
const support =
|
|
178374
|
+
const support = getFreshSourceMapSupport();
|
|
177938
178375
|
const originalPrepareStackTrace = Error.prepareStackTrace;
|
|
177939
178376
|
support.install({
|
|
177940
178377
|
environment: "node",
|
|
@@ -177951,7 +178388,7 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
|
|
|
177951
178388
|
}
|
|
177952
178389
|
});
|
|
177953
178390
|
sourceMappingPrepareStackTrace = Error.prepareStackTrace;
|
|
177954
|
-
|
|
178391
|
+
assert39__default.default(sourceMappingPrepareStackTrace !== void 0);
|
|
177955
178392
|
Error.prepareStackTrace = originalPrepareStackTrace;
|
|
177956
178393
|
return sourceMappingPrepareStackTrace;
|
|
177957
178394
|
}
|
|
@@ -178012,7 +178449,7 @@ function getSourceMappedString(value, retrieveSourceMap) {
|
|
|
178012
178449
|
}
|
|
178013
178450
|
const callSiteLine = callSiteLines[i8][0];
|
|
178014
178451
|
const callSiteAtIndex = callSiteLine.indexOf("at");
|
|
178015
|
-
|
|
178452
|
+
assert39__default.default(callSiteAtIndex !== -1);
|
|
178016
178453
|
const callSiteLineLeftPad = callSiteLine.substring(0, callSiteAtIndex);
|
|
178017
178454
|
value = value.replace(
|
|
178018
178455
|
callSiteLine,
|
|
@@ -178064,10 +178501,11 @@ function lineMatchToCallSite(lineMatch) {
|
|
|
178064
178501
|
});
|
|
178065
178502
|
}
|
|
178066
178503
|
var sourceMappingPrepareStackTrace, retrieveSourceMapOverride, placeholderError, CALL_SITE_REGEXP, CallSite;
|
|
178067
|
-
var
|
|
178504
|
+
var init_sourcemap2 = __esm({
|
|
178068
178505
|
"../deploy-helpers/src/deploy/helpers/sourcemap.ts"() {
|
|
178069
178506
|
init_import_meta_url();
|
|
178070
178507
|
init_workers_shared();
|
|
178508
|
+
init_sourcemap();
|
|
178071
178509
|
init_context();
|
|
178072
178510
|
__name(maybeRetrieveFileSourceMap, "maybeRetrieveFileSourceMap");
|
|
178073
178511
|
__name(getSourceMappingPrepareStackTrace, "getSourceMappingPrepareStackTrace");
|
|
@@ -178649,10 +179087,10 @@ var require_difflib = __commonJS({
|
|
|
178649
179087
|
"../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js"(exports2) {
|
|
178650
179088
|
init_import_meta_url();
|
|
178651
179089
|
(function() {
|
|
178652
|
-
var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any2, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has,
|
|
179090
|
+
var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any2, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert72, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff2, indexOf = [].indexOf;
|
|
178653
179091
|
({ floor, max, min } = Math);
|
|
178654
179092
|
Heap = require_heap2();
|
|
178655
|
-
|
|
179093
|
+
assert72 = __require("assert");
|
|
178656
179094
|
_calculateRatio = /* @__PURE__ */ __name(function(matches, length) {
|
|
178657
179095
|
if (length) {
|
|
178658
179096
|
return 2 * matches / length;
|
|
@@ -179223,7 +179661,7 @@ var require_difflib = __commonJS({
|
|
|
179223
179661
|
}
|
|
179224
179662
|
_plainReplace(a8, alo, ahi, b11, blo, bhi) {
|
|
179225
179663
|
var first, g7, l8, len, len1, line, lines, m7, ref, second;
|
|
179226
|
-
|
|
179664
|
+
assert72(alo < ahi && blo < bhi);
|
|
179227
179665
|
if (bhi - blo < ahi - alo) {
|
|
179228
179666
|
first = this._dump("+", b11, blo, bhi);
|
|
179229
179667
|
second = this._dump("-", a8, alo, ahi);
|
|
@@ -181123,10 +181561,10 @@ function populateConfigPatch(diff, patchObj, targetEnvironment) {
|
|
|
181123
181561
|
return;
|
|
181124
181562
|
}
|
|
181125
181563
|
if (Array.isArray(diff)) {
|
|
181126
|
-
|
|
181564
|
+
assert39__default.default(Array.isArray(patchObj));
|
|
181127
181565
|
return populateConfigPatchArray(diff, patchObj);
|
|
181128
181566
|
}
|
|
181129
|
-
|
|
181567
|
+
assert39__default.default(!Array.isArray(patchObj));
|
|
181130
181568
|
return populateConfigPatchObject(diff, patchObj, targetEnvironment);
|
|
181131
181569
|
}
|
|
181132
181570
|
function populateConfigPatchArray(diff, patchArray) {
|
|
@@ -181295,7 +181733,7 @@ var init_deploy_confirm = __esm({
|
|
|
181295
181733
|
});
|
|
181296
181734
|
|
|
181297
181735
|
// ../deploy-helpers/src/deploy/helpers/download-worker-config.ts
|
|
181298
|
-
async function fetchWorkerConfig(complianceConfig, accountId, workerName, environment) {
|
|
181736
|
+
async function fetchWorkerConfig(complianceConfig, accountId, workerName, environment, fetchRoutes, fetchCustomDomains) {
|
|
181299
181737
|
const [
|
|
181300
181738
|
bindings2,
|
|
181301
181739
|
routes,
|
|
@@ -181308,14 +181746,14 @@ async function fetchWorkerConfig(complianceConfig, accountId, workerName, enviro
|
|
|
181308
181746
|
complianceConfig,
|
|
181309
181747
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/bindings`
|
|
181310
181748
|
),
|
|
181311
|
-
fetchResult(
|
|
181749
|
+
fetchRoutes ? fetchResult(
|
|
181312
181750
|
complianceConfig,
|
|
181313
181751
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/routes?show_zonename=true`
|
|
181314
|
-
),
|
|
181315
|
-
fetchResult(
|
|
181752
|
+
) : Promise.resolve([]),
|
|
181753
|
+
fetchCustomDomains ? fetchResult(
|
|
181316
181754
|
complianceConfig,
|
|
181317
181755
|
`/accounts/${accountId}/workers/domains/records?page=0&per_page=5&service=${workerName}&environment=${environment}`
|
|
181318
|
-
),
|
|
181756
|
+
) : Promise.resolve([]),
|
|
181319
181757
|
fetchResult(
|
|
181320
181758
|
complianceConfig,
|
|
181321
181759
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/subdomain`
|
|
@@ -181343,7 +181781,7 @@ async function fetchWorkerConfig(complianceConfig, accountId, workerName, enviro
|
|
|
181343
181781
|
cronTriggers
|
|
181344
181782
|
};
|
|
181345
181783
|
}
|
|
181346
|
-
async function downloadWorkerConfig(complianceConfig, workerName, environment, entrypoint, accountId) {
|
|
181784
|
+
async function downloadWorkerConfig(complianceConfig, workerName, environment, entrypoint, accountId, fetchRoutes, fetchCustomDomains) {
|
|
181347
181785
|
const {
|
|
181348
181786
|
bindings: bindings2,
|
|
181349
181787
|
routes,
|
|
@@ -181355,7 +181793,9 @@ async function downloadWorkerConfig(complianceConfig, workerName, environment, e
|
|
|
181355
181793
|
complianceConfig,
|
|
181356
181794
|
accountId,
|
|
181357
181795
|
workerName,
|
|
181358
|
-
environment
|
|
181796
|
+
environment,
|
|
181797
|
+
fetchRoutes,
|
|
181798
|
+
fetchCustomDomains
|
|
181359
181799
|
);
|
|
181360
181800
|
return constructWranglerConfig({
|
|
181361
181801
|
name: workerName,
|
|
@@ -181656,7 +182096,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
181656
182096
|
props.routes
|
|
181657
182097
|
).workers_dev;
|
|
181658
182098
|
validateRoutes2(props.routes, props.assetsOptions, workersDevEnabled);
|
|
181659
|
-
|
|
182099
|
+
assert39__default.default(
|
|
181660
182100
|
!config2.site || config2.site.bucket,
|
|
181661
182101
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
181662
182102
|
);
|
|
@@ -181722,12 +182162,17 @@ async function preUploadApiChecks(props, config2, queueCreateCommand2) {
|
|
|
181722
182162
|
);
|
|
181723
182163
|
}
|
|
181724
182164
|
if (script.last_deployed_from === "dash") {
|
|
182165
|
+
const { routesOnly, customDomainsOnly } = partitionRoutes(
|
|
182166
|
+
props.command === "deploy" ? props.routes : []
|
|
182167
|
+
);
|
|
181725
182168
|
const remoteWorkerConfig = await downloadWorkerConfig(
|
|
181726
182169
|
config2,
|
|
181727
182170
|
name2,
|
|
181728
182171
|
serviceMetaData.default_environment.environment,
|
|
181729
182172
|
props.entry.file,
|
|
181730
|
-
accountId
|
|
182173
|
+
accountId,
|
|
182174
|
+
routesOnly.length > 0,
|
|
182175
|
+
customDomainsOnly.length > 0
|
|
181731
182176
|
);
|
|
181732
182177
|
const configForDiff = props.command === "deploy" ? {
|
|
181733
182178
|
...config2,
|
|
@@ -181828,6 +182273,7 @@ var init_validate_worker_props = __esm({
|
|
|
181828
182273
|
init_import_meta_url();
|
|
181829
182274
|
init_src();
|
|
181830
182275
|
init_context();
|
|
182276
|
+
init_partition_routes();
|
|
181831
182277
|
init_deploy();
|
|
181832
182278
|
init_queue_consumers();
|
|
181833
182279
|
init_subdomain2();
|
|
@@ -182111,7 +182557,7 @@ async function deployWorker(props, config2, buildResult, options) {
|
|
|
182111
182557
|
unsafeMetadata: config2.unsafe?.metadata
|
|
182112
182558
|
});
|
|
182113
182559
|
} else {
|
|
182114
|
-
|
|
182560
|
+
assert39__default.default(accountId, "Missing accountId");
|
|
182115
182561
|
let provisionBindingsResult;
|
|
182116
182562
|
if (assetsOptions?.routerConfig.has_user_worker === false) {
|
|
182117
182563
|
logger.debug("skipping provisioning on assets-only project");
|
|
@@ -182343,7 +182789,7 @@ async function deployWorker(props, config2, buildResult, options) {
|
|
|
182343
182789
|
const uploadMs = Date.now() - start;
|
|
182344
182790
|
logger.log("Uploaded", workerName, formatTime(uploadMs));
|
|
182345
182791
|
if (shouldDeployContainers) {
|
|
182346
|
-
|
|
182792
|
+
assert39__default.default(versionId && accountId);
|
|
182347
182793
|
initContainersSharedContext({
|
|
182348
182794
|
logger,
|
|
182349
182795
|
fetchPagedListResult,
|
|
@@ -182355,7 +182801,7 @@ async function deployWorker(props, config2, buildResult, options) {
|
|
|
182355
182801
|
const builtImage = builtContainerImages.find(
|
|
182356
182802
|
(image) => image.container === container
|
|
182357
182803
|
);
|
|
182358
|
-
|
|
182804
|
+
assert39__default.default(
|
|
182359
182805
|
builtImage,
|
|
182360
182806
|
"Expected container image to be built before upload"
|
|
182361
182807
|
);
|
|
@@ -182391,7 +182837,7 @@ async function deployWorker(props, config2, buildResult, options) {
|
|
|
182391
182837
|
);
|
|
182392
182838
|
}
|
|
182393
182839
|
if (!skipContainerChanges && durableObjectContainerConfig.length > 0) {
|
|
182394
|
-
|
|
182840
|
+
assert39__default.default(versionId && accountId);
|
|
182395
182841
|
try {
|
|
182396
182842
|
await deployDurableObjectContainerApplications(
|
|
182397
182843
|
config2,
|
|
@@ -182417,7 +182863,7 @@ async function deployWorker(props, config2, buildResult, options) {
|
|
|
182417
182863
|
deployWfpUserWorker(props.dispatchNamespace, versionId);
|
|
182418
182864
|
return { versionId, workerTag, assetUploadStats, bundleSize };
|
|
182419
182865
|
}
|
|
182420
|
-
|
|
182866
|
+
assert39__default.default(accountId);
|
|
182421
182867
|
const targets = await triggersDeploy({
|
|
182422
182868
|
config: config2,
|
|
182423
182869
|
accountId,
|
|
@@ -182472,7 +182918,7 @@ var init_deploy2 = __esm({
|
|
|
182472
182918
|
init_placement();
|
|
182473
182919
|
init_provision_bindings();
|
|
182474
182920
|
init_secrets_validation();
|
|
182475
|
-
|
|
182921
|
+
init_sourcemap2();
|
|
182476
182922
|
init_validate_worker_props();
|
|
182477
182923
|
init_versions_api();
|
|
182478
182924
|
init_workers_sites_bindings();
|
|
@@ -182664,7 +183110,7 @@ async function uploadWorkerVersion(props, config2, buildResult, options) {
|
|
|
182664
183110
|
unsafeMetadata: config2.unsafe?.metadata
|
|
182665
183111
|
});
|
|
182666
183112
|
} else {
|
|
182667
|
-
|
|
183113
|
+
assert39__default.default(accountId, "Missing accountId");
|
|
182668
183114
|
let provisionBindingsResult;
|
|
182669
183115
|
if (assetsOptions?.routerConfig.has_user_worker === false) {
|
|
182670
183116
|
logger.debug("skipping provisioning on assets-only project");
|
|
@@ -182785,9 +183231,9 @@ async function uploadWorkerVersion(props, config2, buildResult, options) {
|
|
|
182785
183231
|
logger.log(`--dry-run: exiting now.`);
|
|
182786
183232
|
return { versionId, workerTag, bundleSize };
|
|
182787
183233
|
}
|
|
182788
|
-
|
|
183234
|
+
assert39__default.default(accountId);
|
|
182789
183235
|
if (!hasDurableObjectExports(config2.exports) && durableObjectContainerConfig.length > 0) {
|
|
182790
|
-
|
|
183236
|
+
assert39__default.default(versionId);
|
|
182791
183237
|
await deployDurableObjectContainerApplications(
|
|
182792
183238
|
config2,
|
|
182793
183239
|
durableObjectContainerConfig.filter(
|
|
@@ -182867,7 +183313,7 @@ var init_versions_upload = __esm({
|
|
|
182867
183313
|
init_placement();
|
|
182868
183314
|
init_provision_bindings();
|
|
182869
183315
|
init_secrets_validation();
|
|
182870
|
-
|
|
183316
|
+
init_sourcemap2();
|
|
182871
183317
|
init_validate_worker_props();
|
|
182872
183318
|
init_versions_api();
|
|
182873
183319
|
__name(versionsUpload, "versionsUpload");
|
|
@@ -182987,6 +183433,8 @@ var init_preview_alias = __esm({
|
|
|
182987
183433
|
__name(generatePreviewAlias, "generatePreviewAlias");
|
|
182988
183434
|
}
|
|
182989
183435
|
});
|
|
183436
|
+
|
|
183437
|
+
// ../deploy-helpers/src/deploy/helpers/node-compat.ts
|
|
182990
183438
|
function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibilityFlags, {
|
|
182991
183439
|
noBundle = void 0
|
|
182992
183440
|
}) {
|
|
@@ -182995,7 +183443,7 @@ function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibili
|
|
|
182995
183443
|
hasNodejsCompatFlag,
|
|
182996
183444
|
hasNodejsCompatV2Flag,
|
|
182997
183445
|
hasExperimentalNodejsCompatV2Flag
|
|
182998
|
-
} =
|
|
183446
|
+
} = getNodeCompat(compatibilityDateStr, compatibilityFlags);
|
|
182999
183447
|
if (hasExperimentalNodejsCompatV2Flag) {
|
|
183000
183448
|
throw new UserError(
|
|
183001
183449
|
"The `experimental:` prefix on `nodejs_compat_v2` is no longer valid. Please remove it and try again.",
|
|
@@ -183015,10 +183463,11 @@ function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibili
|
|
|
183015
183463
|
}
|
|
183016
183464
|
return mode;
|
|
183017
183465
|
}
|
|
183018
|
-
var
|
|
183466
|
+
var init_node_compat2 = __esm({
|
|
183019
183467
|
"../deploy-helpers/src/deploy/helpers/node-compat.ts"() {
|
|
183020
183468
|
init_import_meta_url();
|
|
183021
183469
|
init_src();
|
|
183470
|
+
init_node_compat();
|
|
183022
183471
|
init_context();
|
|
183023
183472
|
__name(validateNodeCompatMode, "validateNodeCompatMode");
|
|
183024
183473
|
}
|
|
@@ -183844,7 +184293,7 @@ async function prepareContainersForPreview(config2, workerName, previewSlug, opt
|
|
|
183844
184293
|
}
|
|
183845
184294
|
return { scopedContainerConfig, normalisedContainerConfig };
|
|
183846
184295
|
}
|
|
183847
|
-
function
|
|
184296
|
+
function isCustomDomainRoute2(route) {
|
|
183848
184297
|
return typeof route === "object" && route.custom_domain === true;
|
|
183849
184298
|
}
|
|
183850
184299
|
function formatPreviewConfigUpdate(config2, update) {
|
|
@@ -183858,8 +184307,8 @@ function formatPreviewConfigUpdate(config2, update) {
|
|
|
183858
184307
|
).trimEnd();
|
|
183859
184308
|
}
|
|
183860
184309
|
function formatNoActivePreviewUrlsMessage(config2, deployCommand2 = "your deploy command", previewCommand2 = "the preview command") {
|
|
183861
|
-
const customDomainRouteEntries = (config2.routes ?? []).filter(
|
|
183862
|
-
if (config2.route &&
|
|
184310
|
+
const customDomainRouteEntries = (config2.routes ?? []).filter(isCustomDomainRoute2).map((route) => ({ route, singular: false }));
|
|
184311
|
+
if (config2.route && isCustomDomainRoute2(config2.route)) {
|
|
183863
184312
|
customDomainRouteEntries.push({ route: config2.route, singular: true });
|
|
183864
184313
|
}
|
|
183865
184314
|
const customDomainRouteEntry = customDomainRouteEntries.find(
|
|
@@ -184182,7 +184631,7 @@ function formatPreviewDeploymentSummary(config2, previewResource, deployment, is
|
|
|
184182
184631
|
function getPreviewCustomDomainHostnames(config2) {
|
|
184183
184632
|
const routes = config2.routes ?? (config2.route ? [config2.route] : []);
|
|
184184
184633
|
return routes.filter(
|
|
184185
|
-
(route) =>
|
|
184634
|
+
(route) => isCustomDomainRoute2(route) && route.previews_enabled === true
|
|
184186
184635
|
).map((route) => normalizeHostname(route.pattern));
|
|
184187
184636
|
}
|
|
184188
184637
|
function normalizeHostname(hostname4) {
|
|
@@ -184501,7 +184950,7 @@ var init_preview2 = __esm({
|
|
|
184501
184950
|
__name(getPreviewExports, "getPreviewExports");
|
|
184502
184951
|
__name(prepareContainersForPreview, "prepareContainersForPreview");
|
|
184503
184952
|
NO_ACTIVE_PREVIEW_URLS_MESSAGE = "Note: This Preview deployment has no active URLs.";
|
|
184504
|
-
__name(
|
|
184953
|
+
__name(isCustomDomainRoute2, "isCustomDomainRoute");
|
|
184505
184954
|
__name(formatPreviewConfigUpdate, "formatPreviewConfigUpdate");
|
|
184506
184955
|
__name(formatNoActivePreviewUrlsMessage, "formatNoActivePreviewUrlsMessage");
|
|
184507
184956
|
__name(getPreviewMigrationsToUpload, "getPreviewMigrationsToUpload");
|
|
@@ -184603,9 +185052,9 @@ var init_src3 = __esm({
|
|
|
184603
185052
|
init_deploy_wfp();
|
|
184604
185053
|
init_deploy_confirm();
|
|
184605
185054
|
init_preview_alias();
|
|
184606
|
-
|
|
185055
|
+
init_sourcemap2();
|
|
184607
185056
|
init_bundle_reporter();
|
|
184608
|
-
|
|
185057
|
+
init_node_compat2();
|
|
184609
185058
|
init_validate_routes();
|
|
184610
185059
|
init_environments();
|
|
184611
185060
|
init_friendly_validator_errors();
|
|
@@ -184636,7 +185085,7 @@ var init_src3 = __esm({
|
|
|
184636
185085
|
});
|
|
184637
185086
|
|
|
184638
185087
|
// src/sourcemap.ts
|
|
184639
|
-
var
|
|
185088
|
+
var init_sourcemap3 = __esm({
|
|
184640
185089
|
"src/sourcemap.ts"() {
|
|
184641
185090
|
init_import_meta_url();
|
|
184642
185091
|
init_src3();
|
|
@@ -185049,7 +185498,7 @@ function buildMiniflareBindingOptions(config2, remoteProxyConnectionString) {
|
|
|
185049
185498
|
(b11) => isUnsafeServiceBindingWithDevCfg(b11[1])
|
|
185050
185499
|
);
|
|
185051
185500
|
for (const [name2, unsafeBinding] of unsafeBindingsWithLocalDev) {
|
|
185052
|
-
|
|
185501
|
+
assert39__default.default(isUnsafeServiceBindingWithDevCfg(unsafeBinding));
|
|
185053
185502
|
const {
|
|
185054
185503
|
type,
|
|
185055
185504
|
dev: {
|
|
@@ -185490,7 +185939,7 @@ var init_miniflare = __esm({
|
|
|
185490
185939
|
init_source_url();
|
|
185491
185940
|
init_logger2();
|
|
185492
185941
|
init_metrics2();
|
|
185493
|
-
|
|
185942
|
+
init_sourcemap3();
|
|
185494
185943
|
init_update_check2();
|
|
185495
185944
|
init_class_names_sqlite();
|
|
185496
185945
|
EXTERNAL_SERVICE_WORKER_NAME = "__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER";
|
|
@@ -185664,8 +186113,8 @@ function createDeferred(previousDeferred) {
|
|
|
185664
186113
|
resolve38 = _resolve;
|
|
185665
186114
|
reject = _reject;
|
|
185666
186115
|
});
|
|
185667
|
-
|
|
185668
|
-
|
|
186116
|
+
assert39__default.default(resolve38);
|
|
186117
|
+
assert39__default.default(reject);
|
|
185669
186118
|
previousDeferred?.resolve(newPromise);
|
|
185670
186119
|
return {
|
|
185671
186120
|
promise: newPromise,
|
|
@@ -186820,8 +187269,8 @@ function createDeferred2(previousDeferred) {
|
|
|
186820
187269
|
resolve38 = _resolve;
|
|
186821
187270
|
reject = _reject;
|
|
186822
187271
|
});
|
|
186823
|
-
|
|
186824
|
-
|
|
187272
|
+
assert39__default.default(resolve38);
|
|
187273
|
+
assert39__default.default(reject);
|
|
186825
187274
|
previousDeferred?.resolve(newPromise);
|
|
186826
187275
|
return {
|
|
186827
187276
|
promise: newPromise,
|
|
@@ -186929,7 +187378,7 @@ function isAbortError(err) {
|
|
|
186929
187378
|
return legacyAbortErroCheck || abortErrorCheck;
|
|
186930
187379
|
}
|
|
186931
187380
|
function handlePreviewSessionUploadError(err, accountId) {
|
|
186932
|
-
|
|
187381
|
+
assert39__default.default(err && typeof err === "object");
|
|
186933
187382
|
if (!isAbortError(err)) {
|
|
186934
187383
|
if ("code" in err && err.code === 10049) {
|
|
186935
187384
|
logger4.log("Preview token expired, fetching a new one");
|
|
@@ -186939,7 +187388,7 @@ function handlePreviewSessionUploadError(err, accountId) {
|
|
|
186939
187388
|
return false;
|
|
186940
187389
|
}
|
|
186941
187390
|
function handlePreviewSessionCreationError(err, accountId) {
|
|
186942
|
-
|
|
187391
|
+
assert39__default.default(err && typeof err === "object");
|
|
186943
187392
|
if (handleUserFriendlyError(err, accountId)) return;
|
|
186944
187393
|
if ("cause" in err && err.cause?.code === "ENOTFOUND") logger4.error(`Could not access \`${err.cause.hostname}\`. Make sure the domain is set up to be proxied by Cloudflare.
|
|
186945
187394
|
For more details, refer to https://developers.cloudflare.com/workers/configuration/routing/routes/#set-up-a-route`);
|
|
@@ -187165,7 +187614,7 @@ async function maybeStartOrUpdateRemoteProxySession(workerConfigObject, preExist
|
|
|
187165
187614
|
}
|
|
187166
187615
|
function deepStrictEqual(source, target) {
|
|
187167
187616
|
try {
|
|
187168
|
-
|
|
187617
|
+
assert39__default.default.deepStrictEqual(source, target);
|
|
187169
187618
|
return true;
|
|
187170
187619
|
} catch {
|
|
187171
187620
|
return false;
|
|
@@ -187184,7 +187633,7 @@ var init_dist14 = __esm({
|
|
|
187184
187633
|
init_wrapper();
|
|
187185
187634
|
init_create_worker_upload_form();
|
|
187186
187635
|
import_undici14 = __toESM(require_undici(), 1);
|
|
187187
|
-
version3 = "0.0.
|
|
187636
|
+
version3 = "0.0.59";
|
|
187188
187637
|
NoDefaultValueProvided2 = class extends UserError {
|
|
187189
187638
|
static {
|
|
187190
187639
|
__name(this, "NoDefaultValueProvided");
|
|
@@ -187222,7 +187671,7 @@ var init_dist14 = __esm({
|
|
|
187222
187671
|
}
|
|
187223
187672
|
createProxyWorker() {
|
|
187224
187673
|
if (this._torndown || this.proxyWorker) return;
|
|
187225
|
-
|
|
187674
|
+
assert39__default.default(this.latestConfig !== void 0);
|
|
187226
187675
|
const proxyWorker = new miniflare.Miniflare(miniflare.convertV4MiniflareOptions({
|
|
187227
187676
|
host: this.latestConfig.server.hostname,
|
|
187228
187677
|
port: this.latestConfig.server.port,
|
|
@@ -187258,7 +187707,7 @@ var init_dist14 = __esm({
|
|
|
187258
187707
|
}));
|
|
187259
187708
|
this.proxyWorker = proxyWorker;
|
|
187260
187709
|
proxyWorker.ready.then((url4) => {
|
|
187261
|
-
|
|
187710
|
+
assert39__default.default(url4);
|
|
187262
187711
|
this.emitReadyEvent(proxyWorker, url4);
|
|
187263
187712
|
}).catch((error64) => {
|
|
187264
187713
|
if (this._torndown) return;
|
|
@@ -188645,11 +189094,11 @@ function hasOverlappingRules(routes) {
|
|
|
188645
189094
|
const endingSplatRoutes = routes.filter((route) => route.endsWith("/*"));
|
|
188646
189095
|
for (let i8 = 0; i8 < endingSplatRoutes.length; i8++) {
|
|
188647
189096
|
const crrRoute = endingSplatRoutes[i8];
|
|
188648
|
-
|
|
189097
|
+
assert39__default.default(crrRoute);
|
|
188649
189098
|
const crrRouteTrimmed = crrRoute.substring(0, crrRoute.length - 1);
|
|
188650
189099
|
for (let j8 = 0; j8 < routes.length; j8++) {
|
|
188651
189100
|
const nextRoute = routes[j8];
|
|
188652
|
-
|
|
189101
|
+
assert39__default.default(nextRoute);
|
|
188653
189102
|
if (nextRoute !== crrRoute && nextRoute.startsWith(crrRouteTrimmed)) {
|
|
188654
189103
|
return true;
|
|
188655
189104
|
}
|
|
@@ -188900,8 +189349,8 @@ function readConfig(args, options = {}) {
|
|
|
188900
189349
|
redirected
|
|
188901
189350
|
} = exports.experimental_readRawConfig(args, options);
|
|
188902
189351
|
if (redirected) {
|
|
188903
|
-
|
|
188904
|
-
|
|
189352
|
+
assert39__default.default(configPath, "Redirected config found without a configPath");
|
|
189353
|
+
assert39__default.default(
|
|
188905
189354
|
deployConfigPath,
|
|
188906
189355
|
"Redirected config found without a deployConfigPath"
|
|
188907
189356
|
);
|
|
@@ -188936,8 +189385,8 @@ function readPagesConfig(args, options = {}) {
|
|
|
188936
189385
|
try {
|
|
188937
189386
|
({ rawConfig, configPath, userConfigPath, deployConfigPath, redirected } = exports.experimental_readRawConfig(args, options));
|
|
188938
189387
|
if (redirected) {
|
|
188939
|
-
|
|
188940
|
-
|
|
189388
|
+
assert39__default.default(configPath, "Redirected config found without a configPath");
|
|
189389
|
+
assert39__default.default(
|
|
188941
189390
|
deployConfigPath,
|
|
188942
189391
|
"Redirected config found without a deployConfigPath"
|
|
188943
189392
|
);
|
|
@@ -190834,7 +191283,7 @@ var init_paths = __esm({
|
|
|
190834
191283
|
function dedent3(strings, ...values) {
|
|
190835
191284
|
const raw = String.raw({ raw: strings }, ...values);
|
|
190836
191285
|
let lines = raw.split("\n");
|
|
190837
|
-
|
|
191286
|
+
assert39__default.default(lines.length > 0);
|
|
190838
191287
|
if (lines[lines.length - 1].trim() === "") {
|
|
190839
191288
|
lines = lines.slice(0, lines.length - 1);
|
|
190840
191289
|
}
|
|
@@ -190981,12 +191430,12 @@ function getEntryPointFromMetafile(entryFile, metafile) {
|
|
|
190981
191430
|
);
|
|
190982
191431
|
if (entryPoints.length !== 1) {
|
|
190983
191432
|
const entryPointList = entryPoints.map(([_input, output2]) => output2.entryPoint).join("\n");
|
|
190984
|
-
|
|
191433
|
+
assert39__default.default(
|
|
190985
191434
|
entryPoints.length > 0,
|
|
190986
191435
|
`Cannot find entry-point "${entryFile}" in generated bundle.
|
|
190987
191436
|
${entryPointList}`
|
|
190988
191437
|
);
|
|
190989
|
-
|
|
191438
|
+
assert39__default.default(
|
|
190990
191439
|
entryPoints.length < 2,
|
|
190991
191440
|
`More than one entry-point found for generated bundle.
|
|
190992
191441
|
${entryPointList}`
|
|
@@ -191237,7 +191686,7 @@ function handleNodeJSGlobals(build5, inject, polyfill2) {
|
|
|
191237
191686
|
);
|
|
191238
191687
|
}
|
|
191239
191688
|
const moduleInjects = injectsByModule.get(module2);
|
|
191240
|
-
|
|
191689
|
+
assert39__default.default(moduleInjects);
|
|
191241
191690
|
moduleInjects.push({ injectedName, exportName, importName });
|
|
191242
191691
|
}
|
|
191243
191692
|
build5.initialOptions.inject = [
|
|
@@ -191252,9 +191701,9 @@ function handleNodeJSGlobals(build5, inject, polyfill2) {
|
|
|
191252
191701
|
}));
|
|
191253
191702
|
build5.onLoad({ filter: UNENV_VIRTUAL_MODULE_RE }, ({ path: path111 }) => {
|
|
191254
191703
|
const module2 = virtualModulePathToSpecifier.get(path111);
|
|
191255
|
-
|
|
191704
|
+
assert39__default.default(module2, `Expected ${path111} to be mapped to a module specifier`);
|
|
191256
191705
|
const injects = injectsByModule.get(module2);
|
|
191257
|
-
|
|
191706
|
+
assert39__default.default(injects, `Expected ${module2} to inject values`);
|
|
191258
191707
|
const imports = injects.map(
|
|
191259
191708
|
({ exportName, importName }) => importName === exportName ? exportName : `${exportName} as ${importName}`
|
|
191260
191709
|
);
|
|
@@ -193269,7 +193718,7 @@ var init_dev = __esm({
|
|
|
193269
193718
|
...args,
|
|
193270
193719
|
showLocalExplorerAgentHint
|
|
193271
193720
|
});
|
|
193272
|
-
|
|
193721
|
+
assert39__default.default(devInstance.devEnv !== void 0);
|
|
193273
193722
|
await events__default.default.once(devInstance.devEnv, "teardown");
|
|
193274
193723
|
await Promise.all(devInstance.secondary.map((d9) => d9.teardown()));
|
|
193275
193724
|
devInstance.unregisterHotKeys?.();
|
|
@@ -193416,7 +193865,7 @@ function runBuild({
|
|
|
193416
193865
|
async function updateBundle() {
|
|
193417
193866
|
const newAdditionalModules = await getAdditionalModules();
|
|
193418
193867
|
setBundle((previousBundle) => {
|
|
193419
|
-
|
|
193868
|
+
assert39__default.default(
|
|
193420
193869
|
previousBundle,
|
|
193421
193870
|
"Rebuild triggered with no previous build available"
|
|
193422
193871
|
);
|
|
@@ -193755,7 +194204,7 @@ var init_BundlerController = __esm({
|
|
|
193755
194204
|
}
|
|
193756
194205
|
}
|
|
193757
194206
|
}
|
|
193758
|
-
|
|
194207
|
+
assert39__default.default(this.#tmpDir);
|
|
193759
194208
|
if (!config2.build?.bundle) {
|
|
193760
194209
|
const destinationDir = this.#tmpDir.path;
|
|
193761
194210
|
fs14.writeFileSync(
|
|
@@ -193880,7 +194329,7 @@ var init_BundlerController = __esm({
|
|
|
193880
194329
|
return;
|
|
193881
194330
|
}
|
|
193882
194331
|
const pathsToWatch = config2.build.custom.watch;
|
|
193883
|
-
|
|
194332
|
+
assert39__default.default(pathsToWatch, "config.build.custom.watch");
|
|
193884
194333
|
if (config2.dev.watch === false) {
|
|
193885
194334
|
await this.#scheduleCustomBuild(
|
|
193886
194335
|
config2,
|
|
@@ -193934,7 +194383,7 @@ var init_BundlerController = __esm({
|
|
|
193934
194383
|
if (config2.build?.custom?.command) {
|
|
193935
194384
|
return;
|
|
193936
194385
|
}
|
|
193937
|
-
|
|
194386
|
+
assert39__default.default(this.#tmpDir);
|
|
193938
194387
|
const entry = {
|
|
193939
194388
|
file: config2.entrypoint,
|
|
193940
194389
|
projectRoot: config2.projectRoot,
|
|
@@ -194633,10 +195082,10 @@ var init_CommandRegistry = __esm({
|
|
|
194633
195082
|
* console.log(subtree); // Output: empty Map if 'wrangler hello' has no further subcommands
|
|
194634
195083
|
*/
|
|
194635
195084
|
#resolveDefinitionNode(node3) {
|
|
194636
|
-
|
|
195085
|
+
assert39__default.default(node3.definition);
|
|
194637
195086
|
const chain2 = this.#resolveDefinitionChain(node3.definition);
|
|
194638
195087
|
const resolvedDef = chain2.find((def) => def.type !== "alias");
|
|
194639
|
-
|
|
195088
|
+
assert39__default.default(resolvedDef);
|
|
194640
195089
|
const { subtree } = node3.definition.type !== "alias" ? node3 : this.#findNodeFor(resolvedDef.command) ?? node3;
|
|
194641
195090
|
const definition = {
|
|
194642
195091
|
// take all properties from the resolved alias
|
|
@@ -204132,7 +204581,7 @@ var init_commands2 = __esm({
|
|
|
204132
204581
|
"",
|
|
204133
204582
|
(api) => api.list()
|
|
204134
204583
|
)).map((key) => {
|
|
204135
|
-
|
|
204584
|
+
assert39__default.default(key.metadata, "metadata is always present in API list response");
|
|
204136
204585
|
return {
|
|
204137
204586
|
id: key.metadata.uuid,
|
|
204138
204587
|
store_id: args.storeId,
|
|
@@ -205603,8 +206052,8 @@ var init_config7 = __esm({
|
|
|
205603
206052
|
if (isDurableObjectContainerApp(container)) {
|
|
205604
206053
|
continue;
|
|
205605
206054
|
}
|
|
205606
|
-
|
|
205607
|
-
|
|
206055
|
+
assert39__default.default(container.name, "container name should have been set by validation");
|
|
206056
|
+
assert39__default.default(
|
|
205608
206057
|
container.image,
|
|
205609
206058
|
"container image should have been set by validation"
|
|
205610
206059
|
);
|
|
@@ -205716,12 +206165,12 @@ var init_config7 = __esm({
|
|
|
205716
206165
|
}
|
|
205717
206166
|
const maybeDockerfile = isDockerfile(container.image, config2.configPath);
|
|
205718
206167
|
if (maybeDockerfile) {
|
|
205719
|
-
|
|
206168
|
+
assert39__default.default(
|
|
205720
206169
|
path29__namespace.default.isAbsolute(container.image),
|
|
205721
206170
|
"Dockerfile path should be absolute"
|
|
205722
206171
|
);
|
|
205723
206172
|
const imageBuildContext = container.image_build_context ?? path29.dirname(container.image);
|
|
205724
|
-
|
|
206173
|
+
assert39__default.default(
|
|
205725
206174
|
path29__namespace.default.isAbsolute(imageBuildContext),
|
|
205726
206175
|
"resolved image_build_context should be defined"
|
|
205727
206176
|
);
|
|
@@ -205935,7 +206384,7 @@ var init_entry = __esm({
|
|
|
205935
206384
|
});
|
|
205936
206385
|
|
|
205937
206386
|
// src/deployment-bundle/node-compat.ts
|
|
205938
|
-
var
|
|
206387
|
+
var init_node_compat3 = __esm({
|
|
205939
206388
|
"src/deployment-bundle/node-compat.ts"() {
|
|
205940
206389
|
init_import_meta_url();
|
|
205941
206390
|
init_src3();
|
|
@@ -209443,6 +209892,8 @@ var init_runtime2 = __esm({
|
|
|
209443
209892
|
__name(generateRuntimeTypes2, "generateRuntimeTypes");
|
|
209444
209893
|
}
|
|
209445
209894
|
});
|
|
209895
|
+
|
|
209896
|
+
// src/process-env.ts
|
|
209446
209897
|
function isProcessEnvPopulated(compatibility_date, compatibility_flags = []) {
|
|
209447
209898
|
if (compatibility_flags.includes("nodejs_compat_populate_process_env") && compatibility_flags.includes("nodejs_compat_do_not_populate_process_env")) {
|
|
209448
209899
|
throw new UserError(
|
|
@@ -209452,7 +209903,7 @@ function isProcessEnvPopulated(compatibility_date, compatibility_flags = []) {
|
|
|
209452
209903
|
}
|
|
209453
209904
|
);
|
|
209454
209905
|
}
|
|
209455
|
-
const { isNodejsCompatEnabled } =
|
|
209906
|
+
const { isNodejsCompatEnabled } = getNodeCompat(
|
|
209456
209907
|
compatibility_date,
|
|
209457
209908
|
compatibility_flags
|
|
209458
209909
|
);
|
|
@@ -209468,6 +209919,7 @@ var init_process_env = __esm({
|
|
|
209468
209919
|
"src/process-env.ts"() {
|
|
209469
209920
|
init_import_meta_url();
|
|
209470
209921
|
init_src();
|
|
209922
|
+
init_node_compat();
|
|
209471
209923
|
__name(isProcessEnvPopulated, "isProcessEnvPopulated");
|
|
209472
209924
|
}
|
|
209473
209925
|
});
|
|
@@ -209689,7 +210141,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
|
|
|
209689
210141
|
const timeoutPromise = timersPromises.setTimeout(12e4, "timeout", { signal });
|
|
209690
210142
|
const serverPromise = new Promise((resolve38, reject) => {
|
|
209691
210143
|
const server = http__namespace.default.createServer(async (request4, response) => {
|
|
209692
|
-
|
|
210144
|
+
assert39__default.default(request4.url, "This request doesn't have a URL");
|
|
209693
210145
|
if (request4.method !== "GET") {
|
|
209694
210146
|
response.writeHead(405);
|
|
209695
210147
|
response.end("Method not allowed.");
|
|
@@ -212834,6 +213286,7 @@ var init_type_generation = __esm({
|
|
|
212834
213286
|
init_import_meta_url();
|
|
212835
213287
|
init_src5();
|
|
212836
213288
|
init_src();
|
|
213289
|
+
init_node_compat();
|
|
212837
213290
|
init_source();
|
|
212838
213291
|
init_find();
|
|
212839
213292
|
import_glob_to_regexp3 = __toESM(require_glob_to_regexp());
|
|
@@ -212993,7 +213446,7 @@ var init_type_generation = __esm({
|
|
|
212993
213446
|
const configPath = config2.configPath;
|
|
212994
213447
|
const tsconfigPath = config2.tsconfig ?? path29.join(path29.dirname(configPath), "tsconfig.json");
|
|
212995
213448
|
const tsconfigTypes = readTsconfigTypes(tsconfigPath);
|
|
212996
|
-
const { mode } =
|
|
213449
|
+
const { mode } = getNodeCompat(
|
|
212997
213450
|
config2.compatibility_date,
|
|
212998
213451
|
config2.compatibility_flags
|
|
212999
213452
|
);
|
|
@@ -213806,7 +214259,7 @@ async function resolveDevConfig(config2, input2) {
|
|
|
213806
214259
|
);
|
|
213807
214260
|
if (input2.dev?.remote) {
|
|
213808
214261
|
const { accountId } = await auth2();
|
|
213809
|
-
|
|
214262
|
+
assert39__default.default(accountId, "Account ID must be provided for remote dev");
|
|
213810
214263
|
await getZoneIdForPreview(config2, { host, routes, accountId });
|
|
213811
214264
|
}
|
|
213812
214265
|
const initialIp = input2.dev?.server?.hostname ?? config2.dev.ip;
|
|
@@ -214165,7 +214618,7 @@ var init_ConfigController = __esm({
|
|
|
214165
214618
|
init_containers3();
|
|
214166
214619
|
init_config7();
|
|
214167
214620
|
init_entry();
|
|
214168
|
-
|
|
214621
|
+
init_node_compat3();
|
|
214169
214622
|
init_dev();
|
|
214170
214623
|
init_class_names_sqlite();
|
|
214171
214624
|
init_get_local_persistence_path();
|
|
@@ -214219,7 +214672,7 @@ var init_ConfigController = __esm({
|
|
|
214219
214672
|
return;
|
|
214220
214673
|
}
|
|
214221
214674
|
logger2.debug(`${path29__namespace.default.basename(changedPath)} changed...`);
|
|
214222
|
-
|
|
214675
|
+
assert39__default.default(
|
|
214223
214676
|
this.latestInput,
|
|
214224
214677
|
"Cannot be watching config without having first set an input"
|
|
214225
214678
|
);
|
|
@@ -214244,7 +214697,7 @@ var init_ConfigController = __esm({
|
|
|
214244
214697
|
}
|
|
214245
214698
|
patch(input2) {
|
|
214246
214699
|
logger2.debug("patching config");
|
|
214247
|
-
|
|
214700
|
+
assert39__default.default(
|
|
214248
214701
|
this.latestInput,
|
|
214249
214702
|
"Cannot call updateConfig without previously calling setConfig"
|
|
214250
214703
|
);
|
|
@@ -214436,7 +214889,7 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
|
214436
214889
|
return;
|
|
214437
214890
|
}
|
|
214438
214891
|
const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
|
|
214439
|
-
|
|
214892
|
+
assert39__default.default(sourceMappingURLMatch !== null);
|
|
214440
214893
|
const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
|
|
214441
214894
|
const sourceURL = Url.pathToFileURL(sourcePath);
|
|
214442
214895
|
try {
|
|
@@ -214609,7 +215062,7 @@ var init_inspect = __esm({
|
|
|
214609
215062
|
init_open();
|
|
214610
215063
|
init_bundle_allowed_paths();
|
|
214611
215064
|
init_logger2();
|
|
214612
|
-
|
|
215065
|
+
init_sourcemap3();
|
|
214613
215066
|
mapConsoleAPIMessageTypeToConsoleMethod = {
|
|
214614
215067
|
log: "log",
|
|
214615
215068
|
debug: "debug",
|
|
@@ -214750,7 +215203,7 @@ var init_ProxyController = __esm({
|
|
|
214750
215203
|
init_miniflare();
|
|
214751
215204
|
init_https_options();
|
|
214752
215205
|
init_logger2();
|
|
214753
|
-
|
|
215206
|
+
init_sourcemap3();
|
|
214754
215207
|
init_is_bun();
|
|
214755
215208
|
init_BaseController();
|
|
214756
215209
|
init_events7();
|
|
@@ -214771,7 +215224,7 @@ var init_ProxyController = __esm({
|
|
|
214771
215224
|
if (this._torndown) {
|
|
214772
215225
|
return;
|
|
214773
215226
|
}
|
|
214774
|
-
|
|
215227
|
+
assert39__default.default(this.latestConfig !== void 0);
|
|
214775
215228
|
const cert = this.latestConfig.dev?.server?.secure || this.inspectorEnabled && this.latestConfig.dev?.inspector && this.latestConfig.dev?.inspector?.secure ? validateHttpsOptions(
|
|
214776
215229
|
this.latestConfig.dev.server?.httpsKeyPath,
|
|
214777
215230
|
this.latestConfig.dev.server?.httpsCertPath
|
|
@@ -214836,7 +215289,7 @@ var init_ProxyController = __esm({
|
|
|
214836
215289
|
handleStructuredLogs
|
|
214837
215290
|
};
|
|
214838
215291
|
if (this.inspectorEnabled) {
|
|
214839
|
-
|
|
215292
|
+
assert39__default.default(this.latestConfig.dev?.inspector);
|
|
214840
215293
|
proxyWorkerOptions.workers.push({
|
|
214841
215294
|
name: "InspectorProxyWorker",
|
|
214842
215295
|
compatibilityDate: "2023-12-18",
|
|
@@ -214903,7 +215356,7 @@ var init_ProxyController = __esm({
|
|
|
214903
215356
|
inspectorUrl
|
|
214904
215357
|
]);
|
|
214905
215358
|
}).then(([url4, inspectorUrl]) => {
|
|
214906
|
-
|
|
215359
|
+
assert39__default.default(url4);
|
|
214907
215360
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
|
214908
215361
|
}).catch((error64) => {
|
|
214909
215362
|
if (this._torndown) {
|
|
@@ -214920,7 +215373,7 @@ var init_ProxyController = __esm({
|
|
|
214920
215373
|
if (this._torndown) {
|
|
214921
215374
|
return;
|
|
214922
215375
|
}
|
|
214923
|
-
|
|
215376
|
+
assert39__default.default(
|
|
214924
215377
|
this.latestConfig?.dev.inspector !== false,
|
|
214925
215378
|
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
|
214926
215379
|
);
|
|
@@ -214931,7 +215384,7 @@ var init_ProxyController = __esm({
|
|
|
214931
215384
|
this.inspectorProxyWorkerWebSocket = createDeferred();
|
|
214932
215385
|
let webSocket = null;
|
|
214933
215386
|
try {
|
|
214934
|
-
|
|
215387
|
+
assert39__default.default(this.proxyWorker);
|
|
214935
215388
|
const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
|
|
214936
215389
|
"InspectorProxyWorker"
|
|
214937
215390
|
);
|
|
@@ -214951,12 +215404,12 @@ var init_ProxyController = __esm({
|
|
|
214951
215404
|
this.emitErrorEvent("Could not connect to InspectorProxyWorker", error64);
|
|
214952
215405
|
return;
|
|
214953
215406
|
}
|
|
214954
|
-
|
|
215407
|
+
assert39__default.default(
|
|
214955
215408
|
webSocket,
|
|
214956
215409
|
"Expected webSocket on response from inspectorProxyWorker"
|
|
214957
215410
|
);
|
|
214958
215411
|
webSocket.addEventListener("message", (event) => {
|
|
214959
|
-
|
|
215412
|
+
assert39__default.default(typeof event.data === "string");
|
|
214960
215413
|
this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
|
|
214961
215414
|
});
|
|
214962
215415
|
webSocket.addEventListener("close", () => {
|
|
@@ -215011,13 +215464,13 @@ var init_ProxyController = __esm({
|
|
|
215011
215464
|
if (this._torndown) {
|
|
215012
215465
|
return;
|
|
215013
215466
|
}
|
|
215014
|
-
|
|
215467
|
+
assert39__default.default(
|
|
215015
215468
|
this.latestConfig?.dev.inspector !== false,
|
|
215016
215469
|
"Trying to send message to inspector proxy worker when inspector is disabled"
|
|
215017
215470
|
);
|
|
215018
215471
|
try {
|
|
215019
215472
|
const websocket = await this.reconnectInspectorProxyWorker();
|
|
215020
|
-
|
|
215473
|
+
assert39__default.default(websocket);
|
|
215021
215474
|
websocket.send(JSON.stringify(message));
|
|
215022
215475
|
} catch (cause) {
|
|
215023
215476
|
if (this._torndown) {
|
|
@@ -215097,7 +215550,7 @@ var init_ProxyController = __esm({
|
|
|
215097
215550
|
}
|
|
215098
215551
|
}
|
|
215099
215552
|
onInspectorProxyWorkerMessage(message) {
|
|
215100
|
-
|
|
215553
|
+
assert39__default.default(
|
|
215101
215554
|
this.latestConfig?.dev.inspector !== false,
|
|
215102
215555
|
"Trying to handle inspector message when inspector is disabled"
|
|
215103
215556
|
);
|
|
@@ -215127,7 +215580,7 @@ var init_ProxyController = __esm({
|
|
|
215127
215580
|
}
|
|
215128
215581
|
}
|
|
215129
215582
|
async onInspectorProxyWorkerRequest(message) {
|
|
215130
|
-
|
|
215583
|
+
assert39__default.default(
|
|
215131
215584
|
this.latestConfig?.dev.inspector !== false,
|
|
215132
215585
|
"Trying to handle inspector request when inspector is disabled"
|
|
215133
215586
|
);
|
|
@@ -215148,8 +215601,8 @@ var init_ProxyController = __esm({
|
|
|
215148
215601
|
logger2.debug("[InspectorProxyWorker]", ...message.args);
|
|
215149
215602
|
break;
|
|
215150
215603
|
case "load-network-resource": {
|
|
215151
|
-
|
|
215152
|
-
|
|
215604
|
+
assert39__default.default(this.latestConfig !== void 0);
|
|
215605
|
+
assert39__default.default(this.latestBundle !== void 0);
|
|
215153
215606
|
let maybeContents;
|
|
215154
215607
|
if (message.url.startsWith("wrangler-file:")) {
|
|
215155
215608
|
maybeContents = maybeHandleNetworkLoadResource(
|
|
@@ -221194,7 +221647,7 @@ async function getKVNamespaceId({ namespace, preview: preview2, binding, "namesp
|
|
|
221194
221647
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
221195
221648
|
} else if (previewIsDefined) {
|
|
221196
221649
|
if (getFlag("RESOURCES_PROVISION")) {
|
|
221197
|
-
|
|
221650
|
+
assert39__default.default(binding);
|
|
221198
221651
|
const nsId = await getIdFromSettings(config2, binding, isLocal2);
|
|
221199
221652
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
221200
221653
|
}
|
|
@@ -221206,10 +221659,10 @@ async function getKVNamespaceId({ namespace, preview: preview2, binding, "namesp
|
|
|
221206
221659
|
const bindingHasOnlyOneId = configNamespace.id && !configNamespace.preview_id || !configNamespace.id && configNamespace.preview_id;
|
|
221207
221660
|
if (bindingHasOnlyOneId) {
|
|
221208
221661
|
const nsId = configNamespace.id || configNamespace.preview_id;
|
|
221209
|
-
|
|
221662
|
+
assert39__default.default(nsId);
|
|
221210
221663
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
221211
221664
|
} else if (getFlag("RESOURCES_PROVISION") && !configNamespace.id && !configNamespace.preview_id) {
|
|
221212
|
-
|
|
221665
|
+
assert39__default.default(binding);
|
|
221213
221666
|
const nsId = await getIdFromSettings(config2, binding, isLocal2);
|
|
221214
221667
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
221215
221668
|
} else {
|
|
@@ -221333,7 +221786,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
|
221333
221786
|
logger2.log("(Note: doing a dry run, not uploading or deleting anything.)");
|
|
221334
221787
|
return { manifest: void 0, namespace: void 0 };
|
|
221335
221788
|
}
|
|
221336
|
-
|
|
221789
|
+
assert39__default.default(accountId, "Missing accountId");
|
|
221337
221790
|
const title = `__${scriptName}-workers_sites_assets${preview2 ? "_preview" : ""}`;
|
|
221338
221791
|
const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
|
|
221339
221792
|
complianceConfig,
|
|
@@ -222636,7 +223089,7 @@ async function listDeploymentsAndChoose(deployments, args = {}) {
|
|
|
222636
223089
|
label: "deployment"
|
|
222637
223090
|
});
|
|
222638
223091
|
const chosenDeployment = deployments.find((d9) => d9.id === deployment);
|
|
222639
|
-
|
|
223092
|
+
assert39__default.default(chosenDeployment);
|
|
222640
223093
|
return chosenDeployment;
|
|
222641
223094
|
}
|
|
222642
223095
|
async function pickDeployment(deploymentIdPrefix) {
|
|
@@ -223249,7 +223702,7 @@ async function getLocation2(args, options = {}) {
|
|
|
223249
223702
|
const pops = locationToPops[location];
|
|
223250
223703
|
if (pops.length === 1) {
|
|
223251
223704
|
const pop = pops.pop();
|
|
223252
|
-
|
|
223705
|
+
assert39__default.default(pop);
|
|
223253
223706
|
return pop.location;
|
|
223254
223707
|
}
|
|
223255
223708
|
const chosenPop = await inputPrompt({
|
|
@@ -226702,7 +227155,7 @@ var init_t_DYl0qC9V = __esm({
|
|
|
226702
227155
|
this.complete(n10);
|
|
226703
227156
|
}
|
|
226704
227157
|
setup(a8, o8, s8) {
|
|
226705
|
-
switch (
|
|
227158
|
+
switch (assert39__default.default(s8 === `zsh` || s8 === `bash` || s8 === `fish` || s8 === `powershell`, `Unsupported shell`), s8) {
|
|
226706
227159
|
case `zsh`: {
|
|
226707
227160
|
let e11 = t5(a8, o8);
|
|
226708
227161
|
console.log(e11);
|
|
@@ -238869,323 +239322,6 @@ var require_md5_file = __commonJS({
|
|
|
238869
239322
|
module2.exports.sync = md5FileSync;
|
|
238870
239323
|
}
|
|
238871
239324
|
});
|
|
238872
|
-
|
|
238873
|
-
// src/d1/trimmer.ts
|
|
238874
|
-
function trimSqlQuery(sql) {
|
|
238875
|
-
if (!mayContainTransaction(sql)) {
|
|
238876
|
-
return sql;
|
|
238877
|
-
}
|
|
238878
|
-
const trimmedSql = sql.replace("BEGIN TRANSACTION;", "").replace("COMMIT;", "");
|
|
238879
|
-
if (mayContainTransaction(trimmedSql)) {
|
|
238880
|
-
throw new UserError(
|
|
238881
|
-
"Wrangler could not process the provided SQL file, as it contains several transactions.\nD1 runs your SQL in a transaction for you.\nPlease export an SQL file from your SQLite database and try again.",
|
|
238882
|
-
{
|
|
238883
|
-
telemetryMessage: "d1 execute sql file contains multiple transactions"
|
|
238884
|
-
}
|
|
238885
|
-
);
|
|
238886
|
-
}
|
|
238887
|
-
return trimmedSql;
|
|
238888
|
-
}
|
|
238889
|
-
function mayContainTransaction(sql) {
|
|
238890
|
-
return sql.includes("BEGIN TRANSACTION");
|
|
238891
|
-
}
|
|
238892
|
-
var init_trimmer = __esm({
|
|
238893
|
-
"src/d1/trimmer.ts"() {
|
|
238894
|
-
init_import_meta_url();
|
|
238895
|
-
init_src();
|
|
238896
|
-
__name(trimSqlQuery, "trimSqlQuery");
|
|
238897
|
-
__name(mayContainTransaction, "mayContainTransaction");
|
|
238898
|
-
}
|
|
238899
|
-
});
|
|
238900
|
-
|
|
238901
|
-
// src/d1/splitter.ts
|
|
238902
|
-
function mayContainMultipleStatements(sql) {
|
|
238903
|
-
const trimmed = sql.trimEnd();
|
|
238904
|
-
const semiColonIndex = trimmed.indexOf(";");
|
|
238905
|
-
return semiColonIndex !== -1 && semiColonIndex !== trimmed.length - 1;
|
|
238906
|
-
}
|
|
238907
|
-
function splitSqlQuery(sql) {
|
|
238908
|
-
const trimmedSql = trimSqlQuery(sql);
|
|
238909
|
-
if (!mayContainMultipleStatements(trimmedSql)) {
|
|
238910
|
-
return [trimmedSql];
|
|
238911
|
-
}
|
|
238912
|
-
const split = splitSqlIntoStatements(trimmedSql);
|
|
238913
|
-
if (split.length === 0) {
|
|
238914
|
-
return [trimmedSql];
|
|
238915
|
-
} else {
|
|
238916
|
-
return split;
|
|
238917
|
-
}
|
|
238918
|
-
}
|
|
238919
|
-
function normalizeSqlLineEndings(sql) {
|
|
238920
|
-
let normalized = "";
|
|
238921
|
-
let quoteEnd;
|
|
238922
|
-
let inLineComment = false;
|
|
238923
|
-
let inBlockComment = false;
|
|
238924
|
-
for (let index = 0; index < sql.length; index++) {
|
|
238925
|
-
const char = sql[index];
|
|
238926
|
-
const nextChar = sql[index + 1];
|
|
238927
|
-
if (quoteEnd !== void 0) {
|
|
238928
|
-
normalized += char;
|
|
238929
|
-
if (char === quoteEnd) {
|
|
238930
|
-
if (nextChar === quoteEnd) {
|
|
238931
|
-
normalized += nextChar;
|
|
238932
|
-
index++;
|
|
238933
|
-
} else {
|
|
238934
|
-
quoteEnd = void 0;
|
|
238935
|
-
}
|
|
238936
|
-
}
|
|
238937
|
-
continue;
|
|
238938
|
-
}
|
|
238939
|
-
if (inLineComment) {
|
|
238940
|
-
if (char === "\r" && nextChar === "\n") {
|
|
238941
|
-
normalized += "\n";
|
|
238942
|
-
index++;
|
|
238943
|
-
inLineComment = false;
|
|
238944
|
-
} else {
|
|
238945
|
-
normalized += char;
|
|
238946
|
-
inLineComment = char !== "\n";
|
|
238947
|
-
}
|
|
238948
|
-
continue;
|
|
238949
|
-
}
|
|
238950
|
-
if (inBlockComment) {
|
|
238951
|
-
if (char === "\r" && nextChar === "\n") {
|
|
238952
|
-
normalized += "\n";
|
|
238953
|
-
index++;
|
|
238954
|
-
} else {
|
|
238955
|
-
normalized += char;
|
|
238956
|
-
if (char === "*" && nextChar === "/") {
|
|
238957
|
-
normalized += nextChar;
|
|
238958
|
-
index++;
|
|
238959
|
-
inBlockComment = false;
|
|
238960
|
-
}
|
|
238961
|
-
}
|
|
238962
|
-
continue;
|
|
238963
|
-
}
|
|
238964
|
-
if (char === "-" && nextChar === "-") {
|
|
238965
|
-
normalized += "--";
|
|
238966
|
-
index++;
|
|
238967
|
-
inLineComment = true;
|
|
238968
|
-
continue;
|
|
238969
|
-
}
|
|
238970
|
-
if (char === "/" && nextChar === "*") {
|
|
238971
|
-
normalized += "/*";
|
|
238972
|
-
index++;
|
|
238973
|
-
inBlockComment = true;
|
|
238974
|
-
continue;
|
|
238975
|
-
}
|
|
238976
|
-
if (char === "'" || char === '"' || char === "`") {
|
|
238977
|
-
normalized += char;
|
|
238978
|
-
quoteEnd = char;
|
|
238979
|
-
continue;
|
|
238980
|
-
}
|
|
238981
|
-
if (char === "[") {
|
|
238982
|
-
normalized += char;
|
|
238983
|
-
quoteEnd = "]";
|
|
238984
|
-
continue;
|
|
238985
|
-
}
|
|
238986
|
-
if (char === "\r" && nextChar === "\n") {
|
|
238987
|
-
normalized += "\n";
|
|
238988
|
-
index++;
|
|
238989
|
-
continue;
|
|
238990
|
-
}
|
|
238991
|
-
normalized += char;
|
|
238992
|
-
}
|
|
238993
|
-
return normalized;
|
|
238994
|
-
}
|
|
238995
|
-
function splitSqlIntoStatements(sql) {
|
|
238996
|
-
const statements = [];
|
|
238997
|
-
let start = 0;
|
|
238998
|
-
while (start < sql.length) {
|
|
238999
|
-
const { end, hasUsefulToken } = findCompleteStatementEnd(sql, start);
|
|
239000
|
-
if (end === void 0) {
|
|
239001
|
-
if (hasUsefulToken) {
|
|
239002
|
-
statements.push(sql.slice(start).trim());
|
|
239003
|
-
}
|
|
239004
|
-
break;
|
|
239005
|
-
}
|
|
239006
|
-
const statement = sql.slice(start, end - 1).trim();
|
|
239007
|
-
if (hasUsefulToken && statement.length > 0) {
|
|
239008
|
-
statements.push(statement);
|
|
239009
|
-
}
|
|
239010
|
-
start = end;
|
|
239011
|
-
}
|
|
239012
|
-
return statements;
|
|
239013
|
-
}
|
|
239014
|
-
function findCompleteStatementEnd(sql, start) {
|
|
239015
|
-
let state3 = "INVALID";
|
|
239016
|
-
let hasUsefulToken = false;
|
|
239017
|
-
for (let index = start; index < sql.length; index++) {
|
|
239018
|
-
const char = sql[index];
|
|
239019
|
-
let token;
|
|
239020
|
-
if (char === ";") {
|
|
239021
|
-
token = "tkSEMI";
|
|
239022
|
-
} else if (char === " " || char === "\r" || char === " " || char === "\n" || char === "\f") {
|
|
239023
|
-
token = "tkWS";
|
|
239024
|
-
} else if (char === "/" && sql[index + 1] === "*") {
|
|
239025
|
-
const end = sql.indexOf("*/", index + 2);
|
|
239026
|
-
if (end === -1) {
|
|
239027
|
-
return { end: void 0, hasUsefulToken };
|
|
239028
|
-
}
|
|
239029
|
-
index = end + 1;
|
|
239030
|
-
token = "tkWS";
|
|
239031
|
-
} else if (char === "-" && sql[index + 1] === "-") {
|
|
239032
|
-
const end = sql.indexOf("\n", index + 2);
|
|
239033
|
-
if (end === -1) {
|
|
239034
|
-
return { end: void 0, hasUsefulToken };
|
|
239035
|
-
}
|
|
239036
|
-
index = end;
|
|
239037
|
-
token = "tkWS";
|
|
239038
|
-
} else if (char === "[") {
|
|
239039
|
-
const end = sql.indexOf("]", index + 1);
|
|
239040
|
-
if (end === -1) {
|
|
239041
|
-
return { end: void 0, hasUsefulToken: true };
|
|
239042
|
-
}
|
|
239043
|
-
index = end;
|
|
239044
|
-
token = "tkOTHER";
|
|
239045
|
-
} else if (char === "'" || char === '"' || char === "`") {
|
|
239046
|
-
const end = sql.indexOf(char, index + 1);
|
|
239047
|
-
if (end === -1) {
|
|
239048
|
-
return { end: void 0, hasUsefulToken: true };
|
|
239049
|
-
}
|
|
239050
|
-
index = end;
|
|
239051
|
-
token = "tkOTHER";
|
|
239052
|
-
} else if (isIdentifierChar(char)) {
|
|
239053
|
-
const identifierStart = index;
|
|
239054
|
-
while (index + 1 < sql.length && isIdentifierChar(sql[index + 1])) {
|
|
239055
|
-
index++;
|
|
239056
|
-
}
|
|
239057
|
-
token = classifyIdentifier(sql.slice(identifierStart, index + 1));
|
|
239058
|
-
} else {
|
|
239059
|
-
token = "tkOTHER";
|
|
239060
|
-
}
|
|
239061
|
-
hasUsefulToken ||= token !== "tkSEMI" && token !== "tkWS";
|
|
239062
|
-
state3 = getNextState(state3, token);
|
|
239063
|
-
if (state3 === "START") {
|
|
239064
|
-
return { end: index + 1, hasUsefulToken };
|
|
239065
|
-
}
|
|
239066
|
-
}
|
|
239067
|
-
return { end: void 0, hasUsefulToken };
|
|
239068
|
-
}
|
|
239069
|
-
function getNextState(state3, token) {
|
|
239070
|
-
return transitions[state3][token];
|
|
239071
|
-
}
|
|
239072
|
-
function isIdentifierChar(char) {
|
|
239073
|
-
return /[A-Za-z0-9_$\u0080-\uffff]/.test(char);
|
|
239074
|
-
}
|
|
239075
|
-
function classifyIdentifier(identifier) {
|
|
239076
|
-
switch (identifier.toLowerCase()) {
|
|
239077
|
-
case "explain":
|
|
239078
|
-
return "tkEXPLAIN";
|
|
239079
|
-
case "create":
|
|
239080
|
-
return "tkCREATE";
|
|
239081
|
-
case "temp":
|
|
239082
|
-
case "temporary":
|
|
239083
|
-
return "tkTEMP";
|
|
239084
|
-
case "trigger":
|
|
239085
|
-
return "tkTRIGGER";
|
|
239086
|
-
case "end":
|
|
239087
|
-
return "tkEND";
|
|
239088
|
-
default:
|
|
239089
|
-
return "tkOTHER";
|
|
239090
|
-
}
|
|
239091
|
-
}
|
|
239092
|
-
var transitions;
|
|
239093
|
-
var init_splitter = __esm({
|
|
239094
|
-
"src/d1/splitter.ts"() {
|
|
239095
|
-
init_import_meta_url();
|
|
239096
|
-
init_trimmer();
|
|
239097
|
-
__name(mayContainMultipleStatements, "mayContainMultipleStatements");
|
|
239098
|
-
__name(splitSqlQuery, "splitSqlQuery");
|
|
239099
|
-
__name(normalizeSqlLineEndings, "normalizeSqlLineEndings");
|
|
239100
|
-
__name(splitSqlIntoStatements, "splitSqlIntoStatements");
|
|
239101
|
-
transitions = {
|
|
239102
|
-
INVALID: {
|
|
239103
|
-
tkSEMI: "START",
|
|
239104
|
-
tkWS: "INVALID",
|
|
239105
|
-
tkOTHER: "NORMAL",
|
|
239106
|
-
tkEXPLAIN: "EXPLAIN",
|
|
239107
|
-
tkCREATE: "CREATE",
|
|
239108
|
-
tkTEMP: "NORMAL",
|
|
239109
|
-
tkTRIGGER: "NORMAL",
|
|
239110
|
-
tkEND: "NORMAL"
|
|
239111
|
-
},
|
|
239112
|
-
START: {
|
|
239113
|
-
tkSEMI: "START",
|
|
239114
|
-
tkWS: "START",
|
|
239115
|
-
tkOTHER: "NORMAL",
|
|
239116
|
-
tkEXPLAIN: "EXPLAIN",
|
|
239117
|
-
tkCREATE: "CREATE",
|
|
239118
|
-
tkTEMP: "NORMAL",
|
|
239119
|
-
tkTRIGGER: "NORMAL",
|
|
239120
|
-
tkEND: "NORMAL"
|
|
239121
|
-
},
|
|
239122
|
-
NORMAL: {
|
|
239123
|
-
tkSEMI: "START",
|
|
239124
|
-
tkWS: "NORMAL",
|
|
239125
|
-
tkOTHER: "NORMAL",
|
|
239126
|
-
tkEXPLAIN: "NORMAL",
|
|
239127
|
-
tkCREATE: "NORMAL",
|
|
239128
|
-
tkTEMP: "NORMAL",
|
|
239129
|
-
tkTRIGGER: "NORMAL",
|
|
239130
|
-
tkEND: "NORMAL"
|
|
239131
|
-
},
|
|
239132
|
-
EXPLAIN: {
|
|
239133
|
-
tkSEMI: "START",
|
|
239134
|
-
tkWS: "EXPLAIN",
|
|
239135
|
-
tkOTHER: "EXPLAIN",
|
|
239136
|
-
tkEXPLAIN: "NORMAL",
|
|
239137
|
-
tkCREATE: "CREATE",
|
|
239138
|
-
tkTEMP: "NORMAL",
|
|
239139
|
-
tkTRIGGER: "NORMAL",
|
|
239140
|
-
tkEND: "NORMAL"
|
|
239141
|
-
},
|
|
239142
|
-
CREATE: {
|
|
239143
|
-
tkSEMI: "START",
|
|
239144
|
-
tkWS: "CREATE",
|
|
239145
|
-
tkOTHER: "NORMAL",
|
|
239146
|
-
tkEXPLAIN: "NORMAL",
|
|
239147
|
-
tkCREATE: "NORMAL",
|
|
239148
|
-
tkTEMP: "CREATE",
|
|
239149
|
-
tkTRIGGER: "TRIGGER",
|
|
239150
|
-
tkEND: "NORMAL"
|
|
239151
|
-
},
|
|
239152
|
-
TRIGGER: {
|
|
239153
|
-
tkSEMI: "SEMI",
|
|
239154
|
-
tkWS: "TRIGGER",
|
|
239155
|
-
tkOTHER: "TRIGGER",
|
|
239156
|
-
tkEXPLAIN: "TRIGGER",
|
|
239157
|
-
tkCREATE: "TRIGGER",
|
|
239158
|
-
tkTEMP: "TRIGGER",
|
|
239159
|
-
tkTRIGGER: "TRIGGER",
|
|
239160
|
-
tkEND: "TRIGGER"
|
|
239161
|
-
},
|
|
239162
|
-
SEMI: {
|
|
239163
|
-
tkSEMI: "SEMI",
|
|
239164
|
-
tkWS: "SEMI",
|
|
239165
|
-
tkOTHER: "TRIGGER",
|
|
239166
|
-
tkEXPLAIN: "TRIGGER",
|
|
239167
|
-
tkCREATE: "TRIGGER",
|
|
239168
|
-
tkTEMP: "TRIGGER",
|
|
239169
|
-
tkTRIGGER: "TRIGGER",
|
|
239170
|
-
tkEND: "END"
|
|
239171
|
-
},
|
|
239172
|
-
END: {
|
|
239173
|
-
tkSEMI: "START",
|
|
239174
|
-
tkWS: "END",
|
|
239175
|
-
tkOTHER: "TRIGGER",
|
|
239176
|
-
tkEXPLAIN: "TRIGGER",
|
|
239177
|
-
tkCREATE: "TRIGGER",
|
|
239178
|
-
tkTEMP: "TRIGGER",
|
|
239179
|
-
tkTRIGGER: "TRIGGER",
|
|
239180
|
-
tkEND: "TRIGGER"
|
|
239181
|
-
}
|
|
239182
|
-
};
|
|
239183
|
-
__name(findCompleteStatementEnd, "findCompleteStatementEnd");
|
|
239184
|
-
__name(getNextState, "getNextState");
|
|
239185
|
-
__name(isIdentifierChar, "isIdentifierChar");
|
|
239186
|
-
__name(classifyIdentifier, "classifyIdentifier");
|
|
239187
|
-
}
|
|
239188
|
-
});
|
|
239189
239325
|
async function executeSql({
|
|
239190
239326
|
local,
|
|
239191
239327
|
remote,
|
|
@@ -239304,7 +239440,7 @@ async function executeLocally({
|
|
|
239304
239440
|
} finally {
|
|
239305
239441
|
await mf.dispose();
|
|
239306
239442
|
}
|
|
239307
|
-
|
|
239443
|
+
assert39__default.default(Array.isArray(results));
|
|
239308
239444
|
const allResults = results.map((result) => ({
|
|
239309
239445
|
results: (result.results ?? []).map(
|
|
239310
239446
|
(row) => Object.fromEntries(
|
|
@@ -239587,7 +239723,6 @@ var init_execute = __esm({
|
|
|
239587
239723
|
init_logger2();
|
|
239588
239724
|
init_paths();
|
|
239589
239725
|
init_user3();
|
|
239590
|
-
init_splitter();
|
|
239591
239726
|
init_utils8();
|
|
239592
239727
|
d1ExecuteCommand = createCommand({
|
|
239593
239728
|
metadata: {
|
|
@@ -241474,6 +241609,100 @@ In-flight queries and transactions will be cancelled.
|
|
|
241474
241609
|
}, "handleRestore");
|
|
241475
241610
|
}
|
|
241476
241611
|
});
|
|
241612
|
+
|
|
241613
|
+
// src/containers/worker-applications.ts
|
|
241614
|
+
async function findWorkerContainerApplications(config2, accountId, scriptName) {
|
|
241615
|
+
initContainersSharedContext({ logger: logger2, fetchPagedListResult: fetchPagedListResult2, fetchResult: fetchResult2 });
|
|
241616
|
+
const namespaces = await listDurableObjects(config2, accountId);
|
|
241617
|
+
const ownedNamespaceIds = new Set(
|
|
241618
|
+
namespaces.filter(
|
|
241619
|
+
(namespace) => namespace.script === scriptName && namespace.preview === void 0 && namespace.dispatch_namespace === void 0
|
|
241620
|
+
).map((namespace) => namespace.id)
|
|
241621
|
+
);
|
|
241622
|
+
if (ownedNamespaceIds.size === 0) {
|
|
241623
|
+
return [];
|
|
241624
|
+
}
|
|
241625
|
+
await fillOpenAPIConfiguration(config2, containersScope);
|
|
241626
|
+
const applications = await ApplicationsService.listApplications();
|
|
241627
|
+
return applications.filter(
|
|
241628
|
+
(application) => application.durable_objects !== void 0 && ownedNamespaceIds.has(application.durable_objects.namespace_id)
|
|
241629
|
+
).map(({ id, name: name2 }) => ({ id, name: name2 }));
|
|
241630
|
+
}
|
|
241631
|
+
async function deleteContainerApplication(applicationId) {
|
|
241632
|
+
await ApplicationsService.deleteApplication(applicationId);
|
|
241633
|
+
}
|
|
241634
|
+
var init_worker_applications = __esm({
|
|
241635
|
+
"src/containers/worker-applications.ts"() {
|
|
241636
|
+
init_import_meta_url();
|
|
241637
|
+
init_dist9();
|
|
241638
|
+
init_cfetch2();
|
|
241639
|
+
init_common();
|
|
241640
|
+
init_logger2();
|
|
241641
|
+
init_containers3();
|
|
241642
|
+
__name(findWorkerContainerApplications, "findWorkerContainerApplications");
|
|
241643
|
+
__name(deleteContainerApplication, "deleteContainerApplication");
|
|
241644
|
+
}
|
|
241645
|
+
});
|
|
241646
|
+
async function tryFindWorkerContainerApplications(config2, accountId, scriptName) {
|
|
241647
|
+
try {
|
|
241648
|
+
return await findWorkerContainerApplications(config2, accountId, scriptName);
|
|
241649
|
+
} catch (error64) {
|
|
241650
|
+
logger2.warn(
|
|
241651
|
+
`Could not check whether "${scriptName}" owns any Cloudflare Container applications: ${error64 instanceof Error ? error64.message : String(error64)}
|
|
241652
|
+
If it deployed any, they will keep running and billing after this delete.`
|
|
241653
|
+
);
|
|
241654
|
+
return [];
|
|
241655
|
+
}
|
|
241656
|
+
}
|
|
241657
|
+
async function handleContainerApplications(scriptName, applications, force) {
|
|
241658
|
+
if (applications.length === 0) {
|
|
241659
|
+
return;
|
|
241660
|
+
}
|
|
241661
|
+
const count = applications.length;
|
|
241662
|
+
const noun = count === 1 ? "application" : "applications";
|
|
241663
|
+
const pronoun = count === 1 ? "it" : "them";
|
|
241664
|
+
const verb = count === 1 ? "keeps" : "keep";
|
|
241665
|
+
const summary = applications.map((application) => `- ${application.name} (${application.id})`).join("\n");
|
|
241666
|
+
if (force || isNonInteractiveOrCI()) {
|
|
241667
|
+
logger2.warn(
|
|
241668
|
+
`${scriptName} owned ${count} Cloudflare Container ${noun}, which ${verb} running and billing now that the Worker is gone:
|
|
241669
|
+
${summary}
|
|
241670
|
+
|
|
241671
|
+
Delete ${pronoun} with: wrangler containers delete <id>`
|
|
241672
|
+
);
|
|
241673
|
+
return;
|
|
241674
|
+
}
|
|
241675
|
+
const alsoDelete = await confirm2(
|
|
241676
|
+
`${scriptName} also created ${count} Cloudflare Container ${noun}, which will keep running and billing after the Worker is deleted:
|
|
241677
|
+
${summary}
|
|
241678
|
+
|
|
241679
|
+
Delete ${pronoun} as well?`,
|
|
241680
|
+
{ defaultValue: false }
|
|
241681
|
+
);
|
|
241682
|
+
if (!alsoDelete) {
|
|
241683
|
+
logger2.warn(
|
|
241684
|
+
`Left ${count} Container ${noun} running. Delete ${pronoun} with: wrangler containers delete <id>`
|
|
241685
|
+
);
|
|
241686
|
+
return;
|
|
241687
|
+
}
|
|
241688
|
+
let deleted = 0;
|
|
241689
|
+
for (const application of applications) {
|
|
241690
|
+
try {
|
|
241691
|
+
await deleteContainerApplication(application.id);
|
|
241692
|
+
deleted++;
|
|
241693
|
+
logger2.log(`\u{1F5D1}\uFE0F Deleted Container application "${application.name}"`);
|
|
241694
|
+
} catch (error64) {
|
|
241695
|
+
logger2.warn(
|
|
241696
|
+
`Could not delete Container application "${application.name}" (${application.id}): ${error64 instanceof Error ? error64.message : String(error64)}`
|
|
241697
|
+
);
|
|
241698
|
+
}
|
|
241699
|
+
}
|
|
241700
|
+
if (deleted > 0) {
|
|
241701
|
+
logger2.log(
|
|
241702
|
+
deleted === 1 ? "Deleted 1 Container application. Its instances may take a while to shut down." : `Deleted ${deleted} Container applications. Their instances may take a while to shut down.`
|
|
241703
|
+
);
|
|
241704
|
+
}
|
|
241705
|
+
}
|
|
241477
241706
|
async function deleteSiteNamespaceIfExisting(complianceConfig, scriptName, accountId) {
|
|
241478
241707
|
const title = `__${scriptName}-workers_sites_assets`;
|
|
241479
241708
|
const previewTitle = `__${scriptName}-workers_sites_assets_preview`;
|
|
@@ -241610,6 +241839,7 @@ var init_delete6 = __esm({
|
|
|
241610
241839
|
init_import_meta_url();
|
|
241611
241840
|
init_src();
|
|
241612
241841
|
init_cfetch2();
|
|
241842
|
+
init_worker_applications();
|
|
241613
241843
|
init_create_command();
|
|
241614
241844
|
init_dialogs();
|
|
241615
241845
|
init_helpers5();
|
|
@@ -241678,7 +241908,7 @@ var init_delete6 = __esm({
|
|
|
241678
241908
|
logger2.log(`--dry-run: exiting now.`);
|
|
241679
241909
|
return;
|
|
241680
241910
|
}
|
|
241681
|
-
|
|
241911
|
+
assert39__default.default(accountId, "Missing accountId");
|
|
241682
241912
|
const confirmed = args.force || await confirm2(
|
|
241683
241913
|
`Are you sure you want to delete ${scriptName}? This action cannot be undone.`
|
|
241684
241914
|
);
|
|
@@ -241691,17 +241921,32 @@ var init_delete6 = __esm({
|
|
|
241691
241921
|
if (needsForceDelete === null) {
|
|
241692
241922
|
return;
|
|
241693
241923
|
}
|
|
241924
|
+
const containerApplications = await tryFindWorkerContainerApplications(
|
|
241925
|
+
config2,
|
|
241926
|
+
accountId,
|
|
241927
|
+
scriptName
|
|
241928
|
+
);
|
|
241694
241929
|
await fetchResult2(
|
|
241695
241930
|
config2,
|
|
241696
241931
|
`/accounts/${accountId}/workers/services/${scriptName}`,
|
|
241697
241932
|
{ method: "DELETE" },
|
|
241698
241933
|
new URLSearchParams({ force: needsForceDelete.toString() })
|
|
241699
241934
|
);
|
|
241700
|
-
|
|
241701
|
-
|
|
241935
|
+
try {
|
|
241936
|
+
await deleteSiteNamespaceIfExisting(config2, scriptName, accountId);
|
|
241937
|
+
logger2.log("Successfully deleted", scriptName);
|
|
241938
|
+
} finally {
|
|
241939
|
+
await handleContainerApplications(
|
|
241940
|
+
scriptName,
|
|
241941
|
+
containerApplications,
|
|
241942
|
+
Boolean(args.force)
|
|
241943
|
+
);
|
|
241944
|
+
}
|
|
241702
241945
|
}
|
|
241703
241946
|
}
|
|
241704
241947
|
});
|
|
241948
|
+
__name(tryFindWorkerContainerApplications, "tryFindWorkerContainerApplications");
|
|
241949
|
+
__name(handleContainerApplications, "handleContainerApplications");
|
|
241705
241950
|
__name(deleteSiteNamespaceIfExisting, "deleteSiteNamespaceIfExisting");
|
|
241706
241951
|
__name(isPermissionDeniedAPIError2, "isPermissionDeniedAPIError");
|
|
241707
241952
|
__name(renderScriptName, "renderScriptName");
|
|
@@ -253062,13 +253307,13 @@ var require_esprima2 = __commonJS({
|
|
|
253062
253307
|
/***/
|
|
253063
253308
|
function(module3, exports3) {
|
|
253064
253309
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
253065
|
-
function
|
|
253310
|
+
function assert72(condition, message) {
|
|
253066
253311
|
if (!condition) {
|
|
253067
253312
|
throw new Error("ASSERT: " + message);
|
|
253068
253313
|
}
|
|
253069
253314
|
}
|
|
253070
|
-
__name(
|
|
253071
|
-
exports3.assert =
|
|
253315
|
+
__name(assert72, "assert");
|
|
253316
|
+
exports3.assert = assert72;
|
|
253072
253317
|
},
|
|
253073
253318
|
/* 10 */
|
|
253074
253319
|
/***/
|
|
@@ -266789,12 +267034,12 @@ var require_lib5 = __commonJS({
|
|
|
266789
267034
|
return x7;
|
|
266790
267035
|
}
|
|
266791
267036
|
__name(nonNull, "nonNull");
|
|
266792
|
-
function
|
|
267037
|
+
function assert72(x7) {
|
|
266793
267038
|
if (!x7) {
|
|
266794
267039
|
throw new Error("Assert fail");
|
|
266795
267040
|
}
|
|
266796
267041
|
}
|
|
266797
|
-
__name(
|
|
267042
|
+
__name(assert72, "assert");
|
|
266798
267043
|
var TSErrors = ParseErrorEnum`typescript`({
|
|
266799
267044
|
AbstractMethodHasImplementation: /* @__PURE__ */ __name(({
|
|
266800
267045
|
methodName
|
|
@@ -267822,7 +268067,7 @@ var require_lib5 = __commonJS({
|
|
|
267822
268067
|
return this.finishNode(t14, "TSTypeAnnotation");
|
|
267823
268068
|
}
|
|
267824
268069
|
tsParseType() {
|
|
267825
|
-
|
|
268070
|
+
assert72(this.state.inType);
|
|
267826
268071
|
const type = this.tsParseNonConditionalType();
|
|
267827
268072
|
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
|
|
267828
268073
|
return type;
|
|
@@ -268870,7 +269115,7 @@ var require_lib5 = __commonJS({
|
|
|
268870
269115
|
return arrow.node;
|
|
268871
269116
|
}
|
|
268872
269117
|
if (!jsx2) {
|
|
268873
|
-
|
|
269118
|
+
assert72(!this.hasPlugin("jsx"));
|
|
268874
269119
|
typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state3);
|
|
268875
269120
|
if (!typeCast.error) return typeCast.node;
|
|
268876
269121
|
}
|
|
@@ -273625,7 +273870,7 @@ var init_framework_class = __esm({
|
|
|
273625
273870
|
supportsMode = false;
|
|
273626
273871
|
#frameworkVersion;
|
|
273627
273872
|
get frameworkVersion() {
|
|
273628
|
-
|
|
273873
|
+
assert39__default.default(
|
|
273629
273874
|
this.#frameworkVersion,
|
|
273630
273875
|
`The version for ${JSON.stringify(this.name)} is unexpectedly missing`
|
|
273631
273876
|
);
|
|
@@ -273657,7 +273902,7 @@ var init_framework_class = __esm({
|
|
|
273657
273902
|
frameworkPackageInfo.name,
|
|
273658
273903
|
projectPath
|
|
273659
273904
|
);
|
|
273660
|
-
|
|
273905
|
+
assert39__default.default(
|
|
273661
273906
|
frameworkVersion,
|
|
273662
273907
|
`Unable to detect the version of the \`${frameworkPackageInfo.name}\` package`
|
|
273663
273908
|
);
|
|
@@ -274486,7 +274731,7 @@ var init_packages3 = __esm({
|
|
|
274486
274731
|
const pkgJsonPath = path29__namespace.default.join(cwd2, "package.json");
|
|
274487
274732
|
const pkgJson = parsePackageJSON(readFileSync(pkgJsonPath), pkgJsonPath);
|
|
274488
274733
|
const deps = config2.dev ? pkgJson.devDependencies : pkgJson.dependencies;
|
|
274489
|
-
|
|
274734
|
+
assert39__default.default(deps, "dependencies should be defined");
|
|
274490
274735
|
for (const pkg of packages) {
|
|
274491
274736
|
const versionMarker = pkg.lastIndexOf("@");
|
|
274492
274737
|
if (versionMarker > 0) {
|
|
@@ -274513,7 +274758,7 @@ async function updateAngularJson(projectName, angularJson, frameworkVersion) {
|
|
|
274513
274758
|
const architectSection = angularJson.projects[projectName].architect;
|
|
274514
274759
|
architectSection.build.options.outputPath = "dist";
|
|
274515
274760
|
architectSection.build.options.outputMode = "server";
|
|
274516
|
-
|
|
274761
|
+
assert39__default.default(architectSection.build.options.ssr);
|
|
274517
274762
|
if (typeof architectSection.build.options.ssr === "boolean") {
|
|
274518
274763
|
architectSection.build.options.ssr = {};
|
|
274519
274764
|
}
|
|
@@ -275502,13 +275747,13 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
|
|
|
275502
275747
|
}`
|
|
275503
275748
|
);
|
|
275504
275749
|
}
|
|
275505
|
-
|
|
275750
|
+
assert39__default.default(node3.type === "ObjectExpression");
|
|
275506
275751
|
const futureKey = node3.properties.findIndex(
|
|
275507
275752
|
(p8) => p8.type === "ObjectProperty" && p8.key.type === "Identifier" && p8.key.name === "future" && p8.value.type === "ObjectExpression"
|
|
275508
275753
|
);
|
|
275509
275754
|
if (futureKey !== -1) {
|
|
275510
275755
|
const future = node3.properties[futureKey];
|
|
275511
|
-
|
|
275756
|
+
assert39__default.default(
|
|
275512
275757
|
future.type === "ObjectProperty" && future.value.type === "ObjectExpression"
|
|
275513
275758
|
);
|
|
275514
275759
|
const viteEnvironment = future.value.properties.findIndex(
|
|
@@ -275516,7 +275761,7 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
|
|
|
275516
275761
|
);
|
|
275517
275762
|
if (viteEnvironment !== -1) {
|
|
275518
275763
|
const prop = future.value.properties[viteEnvironment];
|
|
275519
|
-
|
|
275764
|
+
assert39__default.default(
|
|
275520
275765
|
prop.type === "ObjectProperty" && prop.value.type === "BooleanLiteral"
|
|
275521
275766
|
);
|
|
275522
275767
|
prop.value.value = true;
|
|
@@ -276050,7 +276295,7 @@ function addVikePhotonToVikeConfigExportObject(n10, programNode) {
|
|
|
276050
276295
|
);
|
|
276051
276296
|
configObject.properties.push(configTargetProp);
|
|
276052
276297
|
}
|
|
276053
|
-
|
|
276298
|
+
assert39__default.default(configTargetProp && t7.ArrayExpression.check(configTargetProp.value));
|
|
276054
276299
|
const vikePhotonLocalName = getVikePhotonImportLocalName(programNode) ?? "vikePhoton";
|
|
276055
276300
|
if (!configTargetProp.value.elements.some(
|
|
276056
276301
|
(el) => el?.type === "Identifier" && el.name === vikePhotonLocalName
|
|
@@ -276342,15 +276587,15 @@ async function updateWakuConfig(projectPath) {
|
|
|
276342
276587
|
return this.traverse(n10);
|
|
276343
276588
|
}
|
|
276344
276589
|
const config2 = n10.node.arguments[0];
|
|
276345
|
-
|
|
276590
|
+
assert39__default.default(t8.ObjectExpression.check(config2));
|
|
276346
276591
|
const viteConfig = config2.properties.find(
|
|
276347
276592
|
(prop) => isViteProp(prop)
|
|
276348
276593
|
)?.value;
|
|
276349
|
-
|
|
276594
|
+
assert39__default.default(t8.ObjectExpression.check(viteConfig));
|
|
276350
276595
|
const pluginsProp = viteConfig.properties.find(
|
|
276351
276596
|
(prop) => isPluginsProp2(prop)
|
|
276352
276597
|
);
|
|
276353
|
-
|
|
276598
|
+
assert39__default.default(pluginsProp && t8.ArrayExpression.check(pluginsProp.value));
|
|
276354
276599
|
if (!pluginsProp.value.elements.some(
|
|
276355
276600
|
(el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
|
|
276356
276601
|
)) {
|
|
@@ -276682,13 +276927,13 @@ function getFrameworkPackageInfo(frameworkId, target) {
|
|
|
276682
276927
|
const targetedFramework = getAllKnownFrameworks(target).find(
|
|
276683
276928
|
(framework) => framework.id === frameworkId
|
|
276684
276929
|
);
|
|
276685
|
-
|
|
276930
|
+
assert39__default.default(
|
|
276686
276931
|
targetedFramework,
|
|
276687
276932
|
`Could not determine framework package info for ${JSON.stringify(
|
|
276688
276933
|
frameworkId
|
|
276689
276934
|
)}`
|
|
276690
276935
|
);
|
|
276691
|
-
|
|
276936
|
+
assert39__default.default(
|
|
276692
276937
|
targetedFramework.supported,
|
|
276693
276938
|
`Framework unexpectedly not supported ${JSON.stringify(frameworkId)}`
|
|
276694
276939
|
);
|
|
@@ -276758,7 +277003,7 @@ function isFrameworkSupported(frameworkId, target = "cf") {
|
|
|
276758
277003
|
const targetedFramework = getAllFrameworksInfos(target).find(
|
|
276759
277004
|
(framework) => framework.id === frameworkId
|
|
276760
277005
|
);
|
|
276761
|
-
|
|
277006
|
+
assert39__default.default(
|
|
276762
277007
|
targetedFramework,
|
|
276763
277008
|
`Unexpected unknown framework id: ${JSON.stringify(frameworkId)}`
|
|
276764
277009
|
);
|
|
@@ -296456,7 +296701,7 @@ var init_framework_detection = __esm({
|
|
|
296456
296701
|
}
|
|
296457
296702
|
});
|
|
296458
296703
|
function assertNonConfigured(details) {
|
|
296459
|
-
|
|
296704
|
+
assert39__default.default(
|
|
296460
296705
|
details.configured === false,
|
|
296461
296706
|
"Error: expected the current project not to be already configured"
|
|
296462
296707
|
);
|
|
@@ -296910,7 +297155,7 @@ async function runAutoConfig(autoConfigDetails, autoConfigOptions) {
|
|
|
296910
297155
|
);
|
|
296911
297156
|
}
|
|
296912
297157
|
}
|
|
296913
|
-
|
|
297158
|
+
assert39__default.default(
|
|
296914
297159
|
autoConfigDetails.outputDir,
|
|
296915
297160
|
"The Output Directory is unexpectedly missing"
|
|
296916
297161
|
);
|
|
@@ -297786,7 +298031,7 @@ async function maybeDelegateToOpenNextDeployCommand(projectRoot) {
|
|
|
297786
298031
|
"OpenNext project detected, calling `opennextjs-cloudflare deploy`"
|
|
297787
298032
|
);
|
|
297788
298033
|
const deployArgIdx = process.argv.findIndex((arg) => arg === "deploy");
|
|
297789
|
-
|
|
298034
|
+
assert39__default.default(deployArgIdx !== -1, "Could not find `deploy` argument");
|
|
297790
298035
|
const deployArguments = process.argv.slice(deployArgIdx + 1);
|
|
297791
298036
|
const { npx } = await getPackageManager();
|
|
297792
298037
|
await runCommand2(
|
|
@@ -298287,8 +298532,8 @@ async function runSearch(searchTerm) {
|
|
|
298287
298532
|
hitsPerPage: "1",
|
|
298288
298533
|
getRankingInfo: "0"
|
|
298289
298534
|
});
|
|
298290
|
-
|
|
298291
|
-
|
|
298535
|
+
assert39__default.default(id, "Missing Algolia App ID");
|
|
298536
|
+
assert39__default.default(key, "Missing Algolia Key");
|
|
298292
298537
|
const searchResp = await (0, import_undici25.fetch)(
|
|
298293
298538
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
|
298294
298539
|
{
|
|
@@ -303734,7 +303979,7 @@ function getOriginFromArgs(allowPartialOrigin, args) {
|
|
|
303734
303979
|
};
|
|
303735
303980
|
}
|
|
303736
303981
|
if (!allowPartialOrigin) {
|
|
303737
|
-
|
|
303982
|
+
assert39__default.default(args.originScheme, "Expected --origin-scheme to be set");
|
|
303738
303983
|
if (!args.database) {
|
|
303739
303984
|
throw new UserError(
|
|
303740
303985
|
"Missing required option --database. Specify the name of the database on the origin server, e.g. --database=mydb. Alternatively, use --connection-string to provide all origin details at once.",
|
|
@@ -304256,13 +304501,15 @@ var init_create_batches = __esm({
|
|
|
304256
304501
|
});
|
|
304257
304502
|
|
|
304258
304503
|
// src/utils/download-worker-config.ts
|
|
304259
|
-
async function downloadWorkerConfig2(complianceConfig, workerName, environment, entrypoint, accountId) {
|
|
304504
|
+
async function downloadWorkerConfig2(complianceConfig, workerName, environment, entrypoint, accountId, fetchRoutes, fetchCustomDomains) {
|
|
304260
304505
|
return downloadWorkerConfig(
|
|
304261
304506
|
complianceConfig,
|
|
304262
304507
|
workerName,
|
|
304263
304508
|
environment,
|
|
304264
304509
|
entrypoint,
|
|
304265
|
-
accountId
|
|
304510
|
+
accountId,
|
|
304511
|
+
fetchRoutes,
|
|
304512
|
+
fetchCustomDomains
|
|
304266
304513
|
);
|
|
304267
304514
|
}
|
|
304268
304515
|
var init_download_worker_config2 = __esm({
|
|
@@ -304746,7 +304993,9 @@ async function downloadWorker(accountId, workerName) {
|
|
|
304746
304993
|
workerName,
|
|
304747
304994
|
defaultEnvironment,
|
|
304748
304995
|
entrypoint,
|
|
304749
|
-
accountId
|
|
304996
|
+
accountId,
|
|
304997
|
+
true,
|
|
304998
|
+
true
|
|
304750
304999
|
);
|
|
304751
305000
|
if (config2.assets) {
|
|
304752
305001
|
throw new FatalError(
|
|
@@ -305585,7 +305834,7 @@ This action is irreversible and will permanently delete all data in the KV names
|
|
|
305585
305834
|
}
|
|
305586
305835
|
namespaceId = namespace.id;
|
|
305587
305836
|
}
|
|
305588
|
-
|
|
305837
|
+
assert39.strict(namespaceId, "namespaceId should be defined");
|
|
305589
305838
|
logger2.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
|
|
305590
305839
|
const updatedNamespace = await updateKVNamespace(
|
|
305591
305840
|
config2,
|
|
@@ -305698,7 +305947,7 @@ This action is irreversible and will permanently delete all data in the KV names
|
|
|
305698
305947
|
localMode
|
|
305699
305948
|
);
|
|
305700
305949
|
const value = args.path ? readFileSyncToBuffer(args.path) : args.value;
|
|
305701
|
-
|
|
305950
|
+
assert39.strict(value);
|
|
305702
305951
|
const metadataLog = metadata3 ? ` with metadata "${JSON.stringify(metadata3)}"` : "";
|
|
305703
305952
|
if (args.path) {
|
|
305704
305953
|
logger2.log(
|
|
@@ -307404,7 +307653,7 @@ var init_build4 = __esm({
|
|
|
307404
307653
|
init_create_command();
|
|
307405
307654
|
init_bundle();
|
|
307406
307655
|
init_find_additional_modules();
|
|
307407
|
-
|
|
307656
|
+
init_node_compat3();
|
|
307408
307657
|
init_logger2();
|
|
307409
307658
|
init_metrics2();
|
|
307410
307659
|
init_navigator_user_agent();
|
|
@@ -308779,7 +309028,7 @@ var init_deploy4 = __esm({
|
|
|
308779
309028
|
init_cfetch2();
|
|
308780
309029
|
init_config6();
|
|
308781
309030
|
init_bundle();
|
|
308782
|
-
|
|
309031
|
+
init_node_compat3();
|
|
308783
309032
|
init_logger2();
|
|
308784
309033
|
init_navigator_user_agent();
|
|
308785
309034
|
init_buildFunctions();
|
|
@@ -311792,7 +312041,7 @@ var init_dev2 = __esm({
|
|
|
311792
312041
|
init_build_failures();
|
|
311793
312042
|
init_bundle();
|
|
311794
312043
|
init_alias_external();
|
|
311795
|
-
|
|
312044
|
+
init_node_compat3();
|
|
311796
312045
|
init_start_dev();
|
|
311797
312046
|
init_experimental_flags();
|
|
311798
312047
|
init_logger2();
|
|
@@ -361489,13 +361738,13 @@ ${ZERO_WIDTH_SPACE} Message: ${version7.annotations?.["workers/message"]
|
|
|
361489
361738
|
},
|
|
361490
361739
|
renderers: {
|
|
361491
361740
|
submit({ value: versionIds }) {
|
|
361492
|
-
|
|
361741
|
+
assert39__default.default(Array.isArray(versionIds));
|
|
361493
361742
|
const label = brandColor2(
|
|
361494
361743
|
`${versionIds.length} Worker Version(s) selected`
|
|
361495
361744
|
);
|
|
361496
361745
|
const versions2 = versionIds?.map((versionId, i8) => {
|
|
361497
361746
|
const version7 = versionCache.get(versionId);
|
|
361498
|
-
|
|
361747
|
+
assert39__default.default(version7);
|
|
361499
361748
|
return `${grayBar}
|
|
361500
361749
|
${leftT} ${white2(` Worker Version ${i8 + 1}: `, version7.id)}
|
|
361501
361750
|
${grayBar} ${gray(" Created: ", version7.metadata.created_on)}
|
|
@@ -362333,7 +362582,7 @@ var init_list32 = __esm({
|
|
|
362333
362582
|
const formattedDeployments = deployments.map((deployment) => {
|
|
362334
362583
|
const formattedVersions = deployment.versions.map((traffic) => {
|
|
362335
362584
|
const version7 = versionCache.get(traffic.version_id);
|
|
362336
|
-
|
|
362585
|
+
assert39__default.default(version7);
|
|
362337
362586
|
const percentage = brandColor2(`(${traffic.percentage}%)`);
|
|
362338
362587
|
const details = formatLabelledValues(
|
|
362339
362588
|
{
|
|
@@ -362442,7 +362691,7 @@ var init_status3 = __esm({
|
|
|
362442
362691
|
);
|
|
362443
362692
|
const formattedVersions = latestDeployment.versions.map((traffic) => {
|
|
362444
362693
|
const version7 = versionCache.get(traffic.version_id);
|
|
362445
|
-
|
|
362694
|
+
assert39__default.default(version7);
|
|
362446
362695
|
const percentage = brandColor2(`(${traffic.percentage}%)`);
|
|
362447
362696
|
const details = formatLabelledValues(
|
|
362448
362697
|
{
|
|
@@ -371251,7 +371500,7 @@ Error: ${errorMessage}
|
|
|
371251
371500
|
if (e11.cause instanceof ApiError) {
|
|
371252
371501
|
logger2.error(e11.cause);
|
|
371253
371502
|
} else {
|
|
371254
|
-
|
|
371503
|
+
assert39__default.default(isAuthenticationError2(e11));
|
|
371255
371504
|
logger2.error(e11);
|
|
371256
371505
|
}
|
|
371257
371506
|
const envAuth = getAuthFromEnv2();
|
|
@@ -371392,7 +371641,7 @@ var init_bundle_reporter2 = __esm({
|
|
|
371392
371641
|
}
|
|
371393
371642
|
});
|
|
371394
371643
|
function handlePreviewSessionUploadError2(err, accountId) {
|
|
371395
|
-
|
|
371644
|
+
assert39__default.default(err && typeof err === "object");
|
|
371396
371645
|
if (!isAbortError2(err)) {
|
|
371397
371646
|
if ("code" in err && err.code === 10049) {
|
|
371398
371647
|
logger2.log("Preview token expired, fetching a new one");
|
|
@@ -371404,7 +371653,7 @@ function handlePreviewSessionUploadError2(err, accountId) {
|
|
|
371404
371653
|
return false;
|
|
371405
371654
|
}
|
|
371406
371655
|
function handlePreviewSessionCreationError2(err, accountId) {
|
|
371407
|
-
|
|
371656
|
+
assert39__default.default(err && typeof err === "object");
|
|
371408
371657
|
if (isAuthenticationError2(err)) {
|
|
371409
371658
|
throw new RemoteSessionAuthenticationError2(err);
|
|
371410
371659
|
} else if ("code" in err && err.code === 10063) {
|
|
@@ -371893,7 +372142,7 @@ var init_RemoteRuntimeController = __esm({
|
|
|
371893
372142
|
if (!config2.dev?.auth) {
|
|
371894
372143
|
throw new MissingConfigError("config.dev.auth");
|
|
371895
372144
|
}
|
|
371896
|
-
|
|
372145
|
+
assert39__default.default(config2.dev.auth);
|
|
371897
372146
|
const auth2 = await unwrapHook(config2.dev.auth);
|
|
371898
372147
|
this.#latestConfig = config2;
|
|
371899
372148
|
this.#latestBundle = bundle;
|
|
@@ -371930,7 +372179,7 @@ var init_RemoteRuntimeController = __esm({
|
|
|
371930
372179
|
const abortSignal = this.#abortController.signal;
|
|
371931
372180
|
const shouldRetry = /* @__PURE__ */ __name(() => bundleId === this.#currentBundleId && !abortSignal.aborted && !this.tearingDown, "shouldRetry");
|
|
371932
372181
|
try {
|
|
371933
|
-
|
|
372182
|
+
assert39__default.default(this.#latestConfig.dev.auth);
|
|
371934
372183
|
const auth2 = await unwrapHook(this.#latestConfig.dev.auth);
|
|
371935
372184
|
this.#session = await this.#getPreviewSession(
|
|
371936
372185
|
this.#latestConfig,
|
|
@@ -372048,7 +372297,7 @@ function createWorkerObject(devEnv) {
|
|
|
372048
372297
|
return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
|
|
372049
372298
|
},
|
|
372050
372299
|
get config() {
|
|
372051
|
-
|
|
372300
|
+
assert39__default.default(devEnv.config.latestConfig);
|
|
372052
372301
|
return devEnv.config.latestConfig;
|
|
372053
372302
|
},
|
|
372054
372303
|
async setConfig(config2, throwErrors) {
|
|
@@ -372063,7 +372312,7 @@ function createWorkerObject(devEnv) {
|
|
|
372063
372312
|
return proxyWorker.dispatchFetch(...args);
|
|
372064
372313
|
},
|
|
372065
372314
|
async queue(...args) {
|
|
372066
|
-
|
|
372315
|
+
assert39__default.default(
|
|
372067
372316
|
this.config.name,
|
|
372068
372317
|
"Worker name must be defined to use `Worker.queue()`"
|
|
372069
372318
|
);
|
|
@@ -372072,7 +372321,7 @@ function createWorkerObject(devEnv) {
|
|
|
372072
372321
|
return w8.queue(...args);
|
|
372073
372322
|
},
|
|
372074
372323
|
async scheduled(...args) {
|
|
372075
|
-
|
|
372324
|
+
assert39__default.default(
|
|
372076
372325
|
this.config.name,
|
|
372077
372326
|
"Worker name must be defined to use `Worker.scheduled()`"
|
|
372078
372327
|
);
|
|
@@ -372742,7 +372991,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
372742
372991
|
if (!this.containerImageTagsSeen.size) {
|
|
372743
372992
|
return;
|
|
372744
372993
|
}
|
|
372745
|
-
|
|
372994
|
+
assert39__default.default(
|
|
372746
372995
|
this.dockerPath,
|
|
372747
372996
|
"Docker path should have been set if containers are enabled"
|
|
372748
372997
|
);
|
|
@@ -372857,7 +373106,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
372857
373106
|
}
|
|
372858
373107
|
#mergedMfOptions() {
|
|
372859
373108
|
const primary = [...this.#options.values()].find((o8) => o8.primary);
|
|
372860
|
-
|
|
373109
|
+
assert39__default.default(primary !== void 0);
|
|
372861
373110
|
const secondary = [...this.#options.values()].filter((o8) => !o8.primary);
|
|
372862
373111
|
const containerEngine = [...this.#options.values()].map((o8) => o8.options.containerEngine).find((engine) => engine !== void 0);
|
|
372863
373112
|
return {
|
|
@@ -377147,12 +377396,12 @@ var init_assets7 = __esm({
|
|
|
377147
377396
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
|
377148
377397
|
*/
|
|
377149
377398
|
static reinstateHostHeader(headers, host) {
|
|
377150
|
-
|
|
377151
|
-
|
|
377399
|
+
assert39__default.default(headers, "Expected all proxy requests to contain headers.");
|
|
377400
|
+
assert39__default.default(
|
|
377152
377401
|
!Array.isArray(headers),
|
|
377153
377402
|
"Expected proxy request headers to be a hash object"
|
|
377154
377403
|
);
|
|
377155
|
-
|
|
377404
|
+
assert39__default.default(
|
|
377156
377405
|
Object.keys(headers).every((h7) => h7.toLowerCase() !== "host"),
|
|
377157
377406
|
"Expected Host header to have been deleted."
|
|
377158
377407
|
);
|
|
@@ -377182,7 +377431,7 @@ async function startDev(args) {
|
|
|
377182
377431
|
unregisterHotKeys?.();
|
|
377183
377432
|
accountId = await requireAuth(config2);
|
|
377184
377433
|
if (hotkeysDisplayed) {
|
|
377185
|
-
|
|
377434
|
+
assert39__default.default(devEnv !== void 0);
|
|
377186
377435
|
unregisterHotKeys = registerDevHotKeys(
|
|
377187
377436
|
Array.isArray(devEnv) ? devEnv : [devEnv],
|
|
377188
377437
|
args,
|
|
@@ -377467,7 +377716,7 @@ var init_start_dev = __esm({
|
|
|
377467
377716
|
init_binding_utils2();
|
|
377468
377717
|
init_MultiworkerRuntimeController();
|
|
377469
377718
|
init_NoOpProxyController();
|
|
377470
|
-
|
|
377719
|
+
init_node_compat3();
|
|
377471
377720
|
init_hotkeys();
|
|
377472
377721
|
init_is_non_interactive_turborepo();
|
|
377473
377722
|
init_logger2();
|
|
@@ -378146,7 +378395,7 @@ function createTestHarness(options) {
|
|
|
378146
378395
|
if (startPromise) {
|
|
378147
378396
|
return await startPromise;
|
|
378148
378397
|
}
|
|
378149
|
-
|
|
378398
|
+
assert39__default.default(
|
|
378150
378399
|
serverSession,
|
|
378151
378400
|
"Server has not been started. Start it with server.listen() before calling this method."
|
|
378152
378401
|
);
|
|
@@ -378156,7 +378405,7 @@ function createTestHarness(options) {
|
|
|
378156
378405
|
function resolveWorkerName2(session, workerName) {
|
|
378157
378406
|
if (workerName === void 0) {
|
|
378158
378407
|
const primaryWorkerName = session.primaryDevEnv.config.latestConfig?.name;
|
|
378159
|
-
|
|
378408
|
+
assert39__default.default(
|
|
378160
378409
|
primaryWorkerName,
|
|
378161
378410
|
"Primary Worker name is not available. Add a Worker `name` or call server.getWorker(name)."
|
|
378162
378411
|
);
|
|
@@ -378177,7 +378426,7 @@ function createTestHarness(options) {
|
|
|
378177
378426
|
const workerConfig = session.devEnvs.find(
|
|
378178
378427
|
(devEnv) => devEnv.config.latestConfig?.name === workerName
|
|
378179
378428
|
)?.config.latestWranglerConfig;
|
|
378180
|
-
|
|
378429
|
+
assert39__default.default(
|
|
378181
378430
|
workerConfig,
|
|
378182
378431
|
`Worker ${JSON.stringify(workerName)} config is not available.`
|
|
378183
378432
|
);
|
|
@@ -378336,7 +378585,7 @@ function createTestHarness(options) {
|
|
|
378336
378585
|
__name(isErrorEvent4, "isErrorEvent");
|
|
378337
378586
|
async function getRuntimeMiniflare(session) {
|
|
378338
378587
|
const miniflare = session.primaryDevEnv.runtimes[0].mf;
|
|
378339
|
-
|
|
378588
|
+
assert39__default.default(miniflare, "Worker runtime is not available.");
|
|
378340
378589
|
return miniflare;
|
|
378341
378590
|
}
|
|
378342
378591
|
__name(getRuntimeMiniflare, "getRuntimeMiniflare");
|
|
@@ -378344,7 +378593,7 @@ function createTestHarness(options) {
|
|
|
378344
378593
|
const devEnv = session.devEnvs.find(
|
|
378345
378594
|
(d9) => d9.config.latestConfig?.name === workerName
|
|
378346
378595
|
);
|
|
378347
|
-
|
|
378596
|
+
assert39__default.default(
|
|
378348
378597
|
devEnv,
|
|
378349
378598
|
`Worker ${JSON.stringify(workerName)} config is not available.`
|
|
378350
378599
|
);
|
|
@@ -378406,7 +378655,7 @@ function createTestHarness(options) {
|
|
|
378406
378655
|
async fetch(input2, init4) {
|
|
378407
378656
|
const session = await resolveSession();
|
|
378408
378657
|
const miniflare = session.primaryDevEnv.proxy.proxyWorker;
|
|
378409
|
-
|
|
378658
|
+
assert39__default.default(
|
|
378410
378659
|
miniflare,
|
|
378411
378660
|
"The proxy worker is not available yet. Did you call server.listen()?"
|
|
378412
378661
|
);
|
|
@@ -378538,11 +378787,11 @@ function createTestHarness(options) {
|
|
|
378538
378787
|
const miniflare = await getRuntimeMiniflare(session);
|
|
378539
378788
|
const workerName = resolveWorkerName2(session, name2);
|
|
378540
378789
|
const workerConfig = getWorkerDevEnv(session, workerName).config.latestWranglerConfig;
|
|
378541
|
-
|
|
378790
|
+
assert39__default.default(
|
|
378542
378791
|
workerConfig,
|
|
378543
378792
|
`Worker ${JSON.stringify(workerName)} config is not available.`
|
|
378544
378793
|
);
|
|
378545
|
-
|
|
378794
|
+
assert39__default.default(
|
|
378546
378795
|
workerConfig.configPath,
|
|
378547
378796
|
`Worker ${JSON.stringify(workerName)} config path is not available.`
|
|
378548
378797
|
);
|
|
@@ -378688,7 +378937,7 @@ function createTestHarness(options) {
|
|
|
378688
378937
|
async update(updateInput) {
|
|
378689
378938
|
let nextOptions;
|
|
378690
378939
|
if (typeof updateInput === "function") {
|
|
378691
|
-
|
|
378940
|
+
assert39__default.default(
|
|
378692
378941
|
currentOptions,
|
|
378693
378942
|
"Cannot update test harness options with a function before options have been configured. Pass options to createTestHarness() or call server.update(options) first."
|
|
378694
378943
|
);
|
|
@@ -378723,7 +378972,7 @@ function createTestHarness(options) {
|
|
|
378723
378972
|
},
|
|
378724
378973
|
async reset() {
|
|
378725
378974
|
const session = await resolveSession();
|
|
378726
|
-
|
|
378975
|
+
assert39__default.default(
|
|
378727
378976
|
initialOptions,
|
|
378728
378977
|
"Server has not been started. Start it with server.listen() before calling this method."
|
|
378729
378978
|
);
|
|
@@ -378749,9 +378998,8 @@ var init_test_harness = __esm({
|
|
|
378749
378998
|
init_introspection();
|
|
378750
378999
|
init_config6();
|
|
378751
379000
|
init_helpers6();
|
|
378752
|
-
init_splitter();
|
|
378753
379001
|
init_utils8();
|
|
378754
|
-
|
|
379002
|
+
init_node_compat3();
|
|
378755
379003
|
init_class_names_sqlite();
|
|
378756
379004
|
init_logger2();
|
|
378757
379005
|
init_user3();
|
|
@@ -379082,7 +379330,6 @@ var init_platform = __esm({
|
|
|
379082
379330
|
init_assets6();
|
|
379083
379331
|
init_config6();
|
|
379084
379332
|
init_entry();
|
|
379085
|
-
init_rules13();
|
|
379086
379333
|
init_dev();
|
|
379087
379334
|
init_class_names_sqlite();
|
|
379088
379335
|
init_miniflare();
|
|
@@ -379365,7 +379612,6 @@ function parseBuildArgs(argv) {
|
|
|
379365
379612
|
__name(parseBuildArgs, "parseBuildArgs");
|
|
379366
379613
|
|
|
379367
379614
|
// src/cli.ts
|
|
379368
|
-
init_splitter();
|
|
379369
379615
|
init_src();
|
|
379370
379616
|
init_src();
|
|
379371
379617
|
init_experimental_commands_api();
|
|
@@ -379377,6 +379623,10 @@ if (typeof vitest === "undefined" && __require.main === module) {
|
|
|
379377
379623
|
process17__default.default.exit(exitCode);
|
|
379378
379624
|
});
|
|
379379
379625
|
}
|
|
379626
|
+
function unstable_splitSqlQuery(sql) {
|
|
379627
|
+
return splitSqlQuery(sql);
|
|
379628
|
+
}
|
|
379629
|
+
__name(unstable_splitSqlQuery, "unstable_splitSqlQuery");
|
|
379380
379630
|
var unstable_generateASSETSBinding = (
|
|
379381
379631
|
/* eslint-disable-next-line @typescript-eslint/no-require-imports --
|
|
379382
379632
|
We `require` instead of `import`ing here to avoid polluting the main
|
|
@@ -380048,5 +380298,5 @@ exports.unstable_getVarsForDev = getVarsForDev;
|
|
|
380048
380298
|
exports.unstable_printBindings = printBindings;
|
|
380049
380299
|
exports.unstable_readConfig = readConfig;
|
|
380050
380300
|
exports.unstable_resolveNamedTunnel = resolveNamedTunnel2;
|
|
380051
|
-
exports.unstable_splitSqlQuery =
|
|
380301
|
+
exports.unstable_splitSqlQuery = unstable_splitSqlQuery;
|
|
380052
380302
|
exports.unstable_startWorker = startWorker;
|