wrangler 4.96.0 → 4.97.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/package.json +24 -24
- package/wrangler-dist/cli.d.ts +8 -8
- package/wrangler-dist/cli.js +1063 -802
- package/wrangler-dist/metafile-cjs.json +1 -1
package/wrangler-dist/cli.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var assert55 = require('assert');
|
|
4
4
|
var fs4 = require('fs');
|
|
5
5
|
var path3 = require('path');
|
|
6
6
|
var os5 = require('os');
|
|
7
7
|
var childProcess = require('child_process');
|
|
8
8
|
var crypto2 = require('crypto');
|
|
9
|
+
var Url = require('url');
|
|
9
10
|
var timersPromises = require('timers/promises');
|
|
10
11
|
var util3 = require('util');
|
|
11
|
-
var Url = require('url');
|
|
12
12
|
var process7 = require('process');
|
|
13
13
|
var tty = require('tty');
|
|
14
14
|
var fs$1 = require('fs/promises');
|
|
@@ -53,15 +53,15 @@ function _interopNamespace(e) {
|
|
|
53
53
|
return Object.freeze(n);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
var
|
|
56
|
+
var assert55__default = /*#__PURE__*/_interopDefault(assert55);
|
|
57
57
|
var fs4__namespace = /*#__PURE__*/_interopNamespace(fs4);
|
|
58
58
|
var path3__namespace = /*#__PURE__*/_interopNamespace(path3);
|
|
59
59
|
var os5__namespace = /*#__PURE__*/_interopNamespace(os5);
|
|
60
60
|
var childProcess__default = /*#__PURE__*/_interopDefault(childProcess);
|
|
61
61
|
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
|
|
62
|
+
var Url__default = /*#__PURE__*/_interopDefault(Url);
|
|
62
63
|
var timersPromises__namespace = /*#__PURE__*/_interopNamespace(timersPromises);
|
|
63
64
|
var util3__namespace = /*#__PURE__*/_interopNamespace(util3);
|
|
64
|
-
var Url__default = /*#__PURE__*/_interopDefault(Url);
|
|
65
65
|
var process7__default = /*#__PURE__*/_interopDefault(process7);
|
|
66
66
|
var tty__default = /*#__PURE__*/_interopDefault(tty);
|
|
67
67
|
var fs$1__namespace = /*#__PURE__*/_interopNamespace(fs$1);
|
|
@@ -246,7 +246,7 @@ function isCompatDate(str) {
|
|
|
246
246
|
}
|
|
247
247
|
function formatCompatibilityDate(date) {
|
|
248
248
|
const compatDate = date.toISOString().slice(0, 10);
|
|
249
|
-
|
|
249
|
+
assert55__default.default(isCompatDate(compatDate));
|
|
250
250
|
return compatDate;
|
|
251
251
|
}
|
|
252
252
|
function getTodaysCompatDate() {
|
|
@@ -269,8 +269,7 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
269
269
|
{
|
|
270
270
|
configObj.vars = {
|
|
271
271
|
...configObj.vars ?? {},
|
|
272
|
-
name: binding.
|
|
273
|
-
json: binding.json
|
|
272
|
+
[binding.name]: binding.json
|
|
274
273
|
};
|
|
275
274
|
}
|
|
276
275
|
break;
|
|
@@ -748,8 +747,8 @@ function constructWranglerConfig(workerOrWorkers) {
|
|
|
748
747
|
}
|
|
749
748
|
return combinedConfig;
|
|
750
749
|
}
|
|
751
|
-
var
|
|
752
|
-
"../workers-utils/dist/chunk-
|
|
750
|
+
var init_chunk_UFU4JGIG = __esm({
|
|
751
|
+
"../workers-utils/dist/chunk-UFU4JGIG.mjs"() {
|
|
753
752
|
init_import_meta_url();
|
|
754
753
|
init_chunk_OZQVB3L3();
|
|
755
754
|
init_chunk_DCOBXSFB();
|
|
@@ -4853,7 +4852,7 @@ var require_tree = __commonJS({
|
|
|
4853
4852
|
var require_util = __commonJS({
|
|
4854
4853
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/core/util.js"(exports, module2) {
|
|
4855
4854
|
init_import_meta_url();
|
|
4856
|
-
var
|
|
4855
|
+
var assert64 = __require("assert");
|
|
4857
4856
|
var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
|
|
4858
4857
|
var { IncomingMessage } = __require("http");
|
|
4859
4858
|
var stream2 = __require("stream");
|
|
@@ -4874,7 +4873,7 @@ var require_util = __commonJS({
|
|
|
4874
4873
|
this[kBodyUsed] = false;
|
|
4875
4874
|
}
|
|
4876
4875
|
async *[Symbol.asyncIterator]() {
|
|
4877
|
-
|
|
4876
|
+
assert64(!this[kBodyUsed], "disturbed");
|
|
4878
4877
|
this[kBodyUsed] = true;
|
|
4879
4878
|
yield* this[kBody];
|
|
4880
4879
|
}
|
|
@@ -4886,7 +4885,7 @@ var require_util = __commonJS({
|
|
|
4886
4885
|
if (isStream2(body)) {
|
|
4887
4886
|
if (bodyLength(body) === 0) {
|
|
4888
4887
|
body.on("data", function() {
|
|
4889
|
-
|
|
4888
|
+
assert64(false);
|
|
4890
4889
|
});
|
|
4891
4890
|
}
|
|
4892
4891
|
if (typeof body.readableDidRead !== "boolean") {
|
|
@@ -5006,7 +5005,7 @@ var require_util = __commonJS({
|
|
|
5006
5005
|
function getHostname(host) {
|
|
5007
5006
|
if (host[0] === "[") {
|
|
5008
5007
|
const idx2 = host.indexOf("]");
|
|
5009
|
-
|
|
5008
|
+
assert64(idx2 !== -1);
|
|
5010
5009
|
return host.substring(1, idx2);
|
|
5011
5010
|
}
|
|
5012
5011
|
const idx = host.indexOf(":");
|
|
@@ -5018,7 +5017,7 @@ var require_util = __commonJS({
|
|
|
5018
5017
|
if (!host) {
|
|
5019
5018
|
return null;
|
|
5020
5019
|
}
|
|
5021
|
-
|
|
5020
|
+
assert64(typeof host === "string");
|
|
5022
5021
|
const servername = getHostname(host);
|
|
5023
5022
|
if (net3.isIP(servername)) {
|
|
5024
5023
|
return "";
|
|
@@ -5576,7 +5575,7 @@ var require_util = __commonJS({
|
|
|
5576
5575
|
function errorRequest(client, request4, err) {
|
|
5577
5576
|
try {
|
|
5578
5577
|
request4.onError(err);
|
|
5579
|
-
|
|
5578
|
+
assert64(request4.aborted);
|
|
5580
5579
|
} catch (err2) {
|
|
5581
5580
|
client.emit("error", err2);
|
|
5582
5581
|
}
|
|
@@ -5982,7 +5981,7 @@ var require_request = __commonJS({
|
|
|
5982
5981
|
InvalidArgumentError,
|
|
5983
5982
|
NotSupportedError
|
|
5984
5983
|
} = require_errors();
|
|
5985
|
-
var
|
|
5984
|
+
var assert64 = __require("assert");
|
|
5986
5985
|
var {
|
|
5987
5986
|
isValidHTTPToken,
|
|
5988
5987
|
isValidHeaderValue,
|
|
@@ -6171,8 +6170,8 @@ var require_request = __commonJS({
|
|
|
6171
6170
|
}
|
|
6172
6171
|
}
|
|
6173
6172
|
onConnect(abort) {
|
|
6174
|
-
|
|
6175
|
-
|
|
6173
|
+
assert64(!this.aborted);
|
|
6174
|
+
assert64(!this.completed);
|
|
6176
6175
|
if (this.error) {
|
|
6177
6176
|
abort(this.error);
|
|
6178
6177
|
} else {
|
|
@@ -6184,8 +6183,8 @@ var require_request = __commonJS({
|
|
|
6184
6183
|
return this[kHandler].onResponseStarted?.();
|
|
6185
6184
|
}
|
|
6186
6185
|
onHeaders(statusCode, headers, resume, statusText) {
|
|
6187
|
-
|
|
6188
|
-
|
|
6186
|
+
assert64(!this.aborted);
|
|
6187
|
+
assert64(!this.completed);
|
|
6189
6188
|
if (channels.headers.hasSubscribers) {
|
|
6190
6189
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
6191
6190
|
}
|
|
@@ -6196,8 +6195,8 @@ var require_request = __commonJS({
|
|
|
6196
6195
|
}
|
|
6197
6196
|
}
|
|
6198
6197
|
onData(chunk) {
|
|
6199
|
-
|
|
6200
|
-
|
|
6198
|
+
assert64(!this.aborted);
|
|
6199
|
+
assert64(!this.completed);
|
|
6201
6200
|
if (channels.bodyChunkReceived.hasSubscribers) {
|
|
6202
6201
|
channels.bodyChunkReceived.publish({ request: this, chunk });
|
|
6203
6202
|
}
|
|
@@ -6209,14 +6208,14 @@ var require_request = __commonJS({
|
|
|
6209
6208
|
}
|
|
6210
6209
|
}
|
|
6211
6210
|
onUpgrade(statusCode, headers, socket) {
|
|
6212
|
-
|
|
6213
|
-
|
|
6211
|
+
assert64(!this.aborted);
|
|
6212
|
+
assert64(!this.completed);
|
|
6214
6213
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
|
6215
6214
|
}
|
|
6216
6215
|
onComplete(trailers) {
|
|
6217
6216
|
this.onFinally();
|
|
6218
|
-
|
|
6219
|
-
|
|
6217
|
+
assert64(!this.aborted);
|
|
6218
|
+
assert64(!this.completed);
|
|
6220
6219
|
this.completed = true;
|
|
6221
6220
|
if (channels.trailers.hasSubscribers) {
|
|
6222
6221
|
channels.trailers.publish({ request: this, trailers });
|
|
@@ -6701,7 +6700,7 @@ var require_connect = __commonJS({
|
|
|
6701
6700
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/core/connect.js"(exports, module2) {
|
|
6702
6701
|
init_import_meta_url();
|
|
6703
6702
|
var net3 = __require("net");
|
|
6704
|
-
var
|
|
6703
|
+
var assert64 = __require("assert");
|
|
6705
6704
|
var util4 = require_util();
|
|
6706
6705
|
var { InvalidArgumentError } = require_errors();
|
|
6707
6706
|
var tls;
|
|
@@ -6750,7 +6749,7 @@ var require_connect = __commonJS({
|
|
|
6750
6749
|
}
|
|
6751
6750
|
servername = servername || options.servername || util4.getServerName(host) || null;
|
|
6752
6751
|
const sessionKey = servername || hostname2;
|
|
6753
|
-
|
|
6752
|
+
assert64(sessionKey);
|
|
6754
6753
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
|
6755
6754
|
port = port || 443;
|
|
6756
6755
|
socket = tls.connect({
|
|
@@ -6770,7 +6769,7 @@ var require_connect = __commonJS({
|
|
|
6770
6769
|
sessionCache.set(sessionKey, session2);
|
|
6771
6770
|
});
|
|
6772
6771
|
} else {
|
|
6773
|
-
|
|
6772
|
+
assert64(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
6774
6773
|
port = port || 80;
|
|
6775
6774
|
socket = net3.connect({
|
|
6776
6775
|
highWaterMark: 64 * 1024,
|
|
@@ -7770,7 +7769,7 @@ var require_encoding = __commonJS({
|
|
|
7770
7769
|
var require_infra = __commonJS({
|
|
7771
7770
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/infra/index.js"(exports, module2) {
|
|
7772
7771
|
init_import_meta_url();
|
|
7773
|
-
var
|
|
7772
|
+
var assert64 = __require("assert");
|
|
7774
7773
|
var { utf8DecodeBytes } = require_encoding();
|
|
7775
7774
|
function collectASequenceOfCodePoints(condition, input, position) {
|
|
7776
7775
|
let result = "";
|
|
@@ -7841,7 +7840,7 @@ var require_infra = __commonJS({
|
|
|
7841
7840
|
__name(isomorphicDecode, "isomorphicDecode");
|
|
7842
7841
|
var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
|
|
7843
7842
|
function isomorphicEncode(input) {
|
|
7844
|
-
|
|
7843
|
+
assert64(!invalidIsomorphicEncodeValueRegex.test(input));
|
|
7845
7844
|
return input;
|
|
7846
7845
|
}
|
|
7847
7846
|
__name(isomorphicEncode, "isomorphicEncode");
|
|
@@ -7870,7 +7869,7 @@ var require_infra = __commonJS({
|
|
|
7870
7869
|
if (result === void 0) {
|
|
7871
7870
|
throw new TypeError("Value is not JSON serializable");
|
|
7872
7871
|
}
|
|
7873
|
-
|
|
7872
|
+
assert64(typeof result === "string");
|
|
7874
7873
|
return result;
|
|
7875
7874
|
}
|
|
7876
7875
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
|
@@ -7893,14 +7892,14 @@ var require_infra = __commonJS({
|
|
|
7893
7892
|
var require_data_url = __commonJS({
|
|
7894
7893
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/data-url.js"(exports, module2) {
|
|
7895
7894
|
init_import_meta_url();
|
|
7896
|
-
var
|
|
7895
|
+
var assert64 = __require("assert");
|
|
7897
7896
|
var { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra();
|
|
7898
7897
|
var encoder2 = new TextEncoder();
|
|
7899
7898
|
var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u;
|
|
7900
7899
|
var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u;
|
|
7901
7900
|
var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;
|
|
7902
7901
|
function dataURLProcessor(dataURL) {
|
|
7903
|
-
|
|
7902
|
+
assert64(dataURL.protocol === "data:");
|
|
7904
7903
|
let input = URLSerializer(dataURL, true);
|
|
7905
7904
|
input = input.slice(5);
|
|
7906
7905
|
const position = { position: 0 };
|
|
@@ -8072,7 +8071,7 @@ var require_data_url = __commonJS({
|
|
|
8072
8071
|
function collectAnHTTPQuotedString(input, position, extractValue3 = false) {
|
|
8073
8072
|
const positionStart = position.position;
|
|
8074
8073
|
let value = "";
|
|
8075
|
-
|
|
8074
|
+
assert64(input[position.position] === '"');
|
|
8076
8075
|
position.position++;
|
|
8077
8076
|
while (true) {
|
|
8078
8077
|
value += collectASequenceOfCodePoints(
|
|
@@ -8093,7 +8092,7 @@ var require_data_url = __commonJS({
|
|
|
8093
8092
|
value += input[position.position];
|
|
8094
8093
|
position.position++;
|
|
8095
8094
|
} else {
|
|
8096
|
-
|
|
8095
|
+
assert64(quoteOrBackslash === '"');
|
|
8097
8096
|
break;
|
|
8098
8097
|
}
|
|
8099
8098
|
}
|
|
@@ -8104,7 +8103,7 @@ var require_data_url = __commonJS({
|
|
|
8104
8103
|
}
|
|
8105
8104
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
|
8106
8105
|
function serializeAMimeType(mimeType) {
|
|
8107
|
-
|
|
8106
|
+
assert64(mimeType !== "failure");
|
|
8108
8107
|
const { parameters, essence } = mimeType;
|
|
8109
8108
|
let serialization = essence;
|
|
8110
8109
|
for (let [name2, value] of parameters.entries()) {
|
|
@@ -8292,7 +8291,7 @@ var require_runtime_features = __commonJS({
|
|
|
8292
8291
|
var require_webidl = __commonJS({
|
|
8293
8292
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/webidl/index.js"(exports, module2) {
|
|
8294
8293
|
init_import_meta_url();
|
|
8295
|
-
var
|
|
8294
|
+
var assert64 = __require("assert");
|
|
8296
8295
|
var { types: types13, inspect: inspect4 } = __require("util");
|
|
8297
8296
|
var { runtimeFeatures } = require_runtime_features();
|
|
8298
8297
|
var UNDEFINED = 1;
|
|
@@ -8648,7 +8647,7 @@ var require_webidl = __commonJS({
|
|
|
8648
8647
|
offset = jsBufferSource.byteOffset;
|
|
8649
8648
|
length = jsBufferSource.byteLength;
|
|
8650
8649
|
} else {
|
|
8651
|
-
|
|
8650
|
+
assert64(types13.isAnyArrayBuffer(jsBufferSource));
|
|
8652
8651
|
length = jsBufferSource.byteLength;
|
|
8653
8652
|
}
|
|
8654
8653
|
if (jsArrayBuffer.detached) {
|
|
@@ -8901,7 +8900,7 @@ var require_util2 = __commonJS({
|
|
|
8901
8900
|
var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
|
|
8902
8901
|
var { performance: performance2 } = __require("perf_hooks");
|
|
8903
8902
|
var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
|
|
8904
|
-
var
|
|
8903
|
+
var assert64 = __require("assert");
|
|
8905
8904
|
var { isUint8Array } = __require("util/types");
|
|
8906
8905
|
var { webidl } = require_webidl();
|
|
8907
8906
|
var { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require_infra();
|
|
@@ -9104,7 +9103,7 @@ var require_util2 = __commonJS({
|
|
|
9104
9103
|
__name(clonePolicyContainer, "clonePolicyContainer");
|
|
9105
9104
|
function determineRequestsReferrer(request4) {
|
|
9106
9105
|
const policy = request4.referrerPolicy;
|
|
9107
|
-
|
|
9106
|
+
assert64(policy);
|
|
9108
9107
|
let referrerSource = null;
|
|
9109
9108
|
if (request4.referrer === "client") {
|
|
9110
9109
|
const globalOrigin = getGlobalOrigin();
|
|
@@ -9168,7 +9167,7 @@ var require_util2 = __commonJS({
|
|
|
9168
9167
|
}
|
|
9169
9168
|
__name(determineRequestsReferrer, "determineRequestsReferrer");
|
|
9170
9169
|
function stripURLForReferrer(url4, originOnly = false) {
|
|
9171
|
-
|
|
9170
|
+
assert64(webidl.is.URL(url4));
|
|
9172
9171
|
url4 = new URL(url4);
|
|
9173
9172
|
if (urlIsLocal(url4)) {
|
|
9174
9173
|
return "no-referrer";
|
|
@@ -9432,7 +9431,7 @@ var require_util2 = __commonJS({
|
|
|
9432
9431
|
}
|
|
9433
9432
|
__name(readAllBytes, "readAllBytes");
|
|
9434
9433
|
function urlIsLocal(url4) {
|
|
9435
|
-
|
|
9434
|
+
assert64("protocol" in url4);
|
|
9436
9435
|
const protocol = url4.protocol;
|
|
9437
9436
|
return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
|
9438
9437
|
}
|
|
@@ -9442,7 +9441,7 @@ var require_util2 = __commonJS({
|
|
|
9442
9441
|
}
|
|
9443
9442
|
__name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
|
9444
9443
|
function urlIsHttpHttpsScheme(url4) {
|
|
9445
|
-
|
|
9444
|
+
assert64("protocol" in url4);
|
|
9446
9445
|
const protocol = url4.protocol;
|
|
9447
9446
|
return protocol === "http:" || protocol === "https:";
|
|
9448
9447
|
}
|
|
@@ -9615,7 +9614,7 @@ var require_util2 = __commonJS({
|
|
|
9615
9614
|
continue;
|
|
9616
9615
|
}
|
|
9617
9616
|
} else {
|
|
9618
|
-
|
|
9617
|
+
assert64(input.charCodeAt(position.position) === 44);
|
|
9619
9618
|
position.position++;
|
|
9620
9619
|
}
|
|
9621
9620
|
}
|
|
@@ -9725,7 +9724,7 @@ var require_formdata = __commonJS({
|
|
|
9725
9724
|
var { kEnumerableProperty } = require_util();
|
|
9726
9725
|
var { webidl } = require_webidl();
|
|
9727
9726
|
var nodeUtil = __require("util");
|
|
9728
|
-
var
|
|
9727
|
+
var FormData13 = class _FormData {
|
|
9729
9728
|
static {
|
|
9730
9729
|
__name(this, "FormData");
|
|
9731
9730
|
}
|
|
@@ -9845,11 +9844,11 @@ var require_formdata = __commonJS({
|
|
|
9845
9844
|
formData.#state = newState;
|
|
9846
9845
|
}
|
|
9847
9846
|
};
|
|
9848
|
-
var { getFormDataState, setFormDataState } =
|
|
9849
|
-
Reflect.deleteProperty(
|
|
9850
|
-
Reflect.deleteProperty(
|
|
9851
|
-
iteratorMixin("FormData",
|
|
9852
|
-
Object.defineProperties(
|
|
9847
|
+
var { getFormDataState, setFormDataState } = FormData13;
|
|
9848
|
+
Reflect.deleteProperty(FormData13, "getFormDataState");
|
|
9849
|
+
Reflect.deleteProperty(FormData13, "setFormDataState");
|
|
9850
|
+
iteratorMixin("FormData", FormData13, getFormDataState, "name", "value");
|
|
9851
|
+
Object.defineProperties(FormData13.prototype, {
|
|
9853
9852
|
append: kEnumerableProperty,
|
|
9854
9853
|
delete: kEnumerableProperty,
|
|
9855
9854
|
get: kEnumerableProperty,
|
|
@@ -9877,8 +9876,8 @@ var require_formdata = __commonJS({
|
|
|
9877
9876
|
return { name: name2, value };
|
|
9878
9877
|
}
|
|
9879
9878
|
__name(makeEntry, "makeEntry");
|
|
9880
|
-
webidl.is.FormData = webidl.util.MakeTypeAssertion(
|
|
9881
|
-
module2.exports = { FormData:
|
|
9879
|
+
webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData13);
|
|
9880
|
+
module2.exports = { FormData: FormData13, makeEntry, setFormDataState };
|
|
9882
9881
|
}
|
|
9883
9882
|
});
|
|
9884
9883
|
|
|
@@ -9890,7 +9889,7 @@ var require_formdata_parser = __commonJS({
|
|
|
9890
9889
|
var { HTTP_TOKEN_CODEPOINTS } = require_data_url();
|
|
9891
9890
|
var { makeEntry } = require_formdata();
|
|
9892
9891
|
var { webidl } = require_webidl();
|
|
9893
|
-
var
|
|
9892
|
+
var assert64 = __require("assert");
|
|
9894
9893
|
var { isomorphicDecode } = require_infra();
|
|
9895
9894
|
var dd = Buffer.from("--");
|
|
9896
9895
|
var decoder2 = new TextDecoder();
|
|
@@ -9919,7 +9918,7 @@ var require_formdata_parser = __commonJS({
|
|
|
9919
9918
|
}
|
|
9920
9919
|
__name(validateBoundary, "validateBoundary");
|
|
9921
9920
|
function multipartFormDataParser(input, mimeType) {
|
|
9922
|
-
|
|
9921
|
+
assert64(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
|
|
9923
9922
|
const boundaryString = mimeType.parameters.get("boundary");
|
|
9924
9923
|
if (boundaryString === void 0) {
|
|
9925
9924
|
throw parsingError("missing boundary in content-type header");
|
|
@@ -9975,8 +9974,8 @@ var require_formdata_parser = __commonJS({
|
|
|
9975
9974
|
} else {
|
|
9976
9975
|
value = decoderIgnoreBOM.decode(Buffer.from(body));
|
|
9977
9976
|
}
|
|
9978
|
-
|
|
9979
|
-
|
|
9977
|
+
assert64(webidl.is.USVString(name2));
|
|
9978
|
+
assert64(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
|
|
9980
9979
|
entryList.push(makeEntry(name2, value, filename));
|
|
9981
9980
|
}
|
|
9982
9981
|
}
|
|
@@ -10249,9 +10248,9 @@ var require_body = __commonJS({
|
|
|
10249
10248
|
fullyReadBody,
|
|
10250
10249
|
extractMimeType
|
|
10251
10250
|
} = require_util2();
|
|
10252
|
-
var { FormData:
|
|
10251
|
+
var { FormData: FormData13, setFormDataState } = require_formdata();
|
|
10253
10252
|
var { webidl } = require_webidl();
|
|
10254
|
-
var
|
|
10253
|
+
var assert64 = __require("assert");
|
|
10255
10254
|
var { isErrored, isDisturbed } = __require("stream");
|
|
10256
10255
|
var { isUint8Array } = __require("util/types");
|
|
10257
10256
|
var { serializeAMimeType } = require_data_url();
|
|
@@ -10290,7 +10289,7 @@ var require_body = __commonJS({
|
|
|
10290
10289
|
type: "bytes"
|
|
10291
10290
|
});
|
|
10292
10291
|
}
|
|
10293
|
-
|
|
10292
|
+
assert64(webidl.is.ReadableStream(stream2));
|
|
10294
10293
|
let action = null;
|
|
10295
10294
|
let source = null;
|
|
10296
10295
|
let length = null;
|
|
@@ -10398,8 +10397,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
10398
10397
|
__name(extractBody, "extractBody");
|
|
10399
10398
|
function safelyExtractBody(object, keepalive = false) {
|
|
10400
10399
|
if (webidl.is.ReadableStream(object)) {
|
|
10401
|
-
|
|
10402
|
-
|
|
10400
|
+
assert64(!util4.isDisturbed(object), "The body has already been consumed.");
|
|
10401
|
+
assert64(!object.locked, "The stream is locked.");
|
|
10403
10402
|
}
|
|
10404
10403
|
return extractBody(object, keepalive);
|
|
10405
10404
|
}
|
|
@@ -10445,13 +10444,13 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
10445
10444
|
switch (mimeType.essence) {
|
|
10446
10445
|
case "multipart/form-data": {
|
|
10447
10446
|
const parsed = multipartFormDataParser(value, mimeType);
|
|
10448
|
-
const fd = new
|
|
10447
|
+
const fd = new FormData13();
|
|
10449
10448
|
setFormDataState(fd, parsed);
|
|
10450
10449
|
return fd;
|
|
10451
10450
|
}
|
|
10452
10451
|
case "application/x-www-form-urlencoded": {
|
|
10453
10452
|
const entries2 = new URLSearchParams(value.toString());
|
|
10454
|
-
const fd = new
|
|
10453
|
+
const fd = new FormData13();
|
|
10455
10454
|
for (const [name2, value2] of entries2) {
|
|
10456
10455
|
fd.append(name2, value2);
|
|
10457
10456
|
}
|
|
@@ -10533,7 +10532,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
10533
10532
|
var require_client_h1 = __commonJS({
|
|
10534
10533
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/dispatcher/client-h1.js"(exports, module2) {
|
|
10535
10534
|
init_import_meta_url();
|
|
10536
|
-
var
|
|
10535
|
+
var assert64 = __require("assert");
|
|
10537
10536
|
var util4 = require_util();
|
|
10538
10537
|
var { channels } = require_diagnostics();
|
|
10539
10538
|
var timers = require_timers();
|
|
@@ -10624,7 +10623,7 @@ var require_client_h1 = __commonJS({
|
|
|
10624
10623
|
* @returns {number}
|
|
10625
10624
|
*/
|
|
10626
10625
|
wasm_on_status: /* @__PURE__ */ __name((p7, at4, len) => {
|
|
10627
|
-
|
|
10626
|
+
assert64(currentParser.ptr === p7);
|
|
10628
10627
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
10629
10628
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
10630
10629
|
}, "wasm_on_status"),
|
|
@@ -10633,7 +10632,7 @@ var require_client_h1 = __commonJS({
|
|
|
10633
10632
|
* @returns {number}
|
|
10634
10633
|
*/
|
|
10635
10634
|
wasm_on_message_begin: /* @__PURE__ */ __name((p7) => {
|
|
10636
|
-
|
|
10635
|
+
assert64(currentParser.ptr === p7);
|
|
10637
10636
|
return currentParser.onMessageBegin();
|
|
10638
10637
|
}, "wasm_on_message_begin"),
|
|
10639
10638
|
/**
|
|
@@ -10643,7 +10642,7 @@ var require_client_h1 = __commonJS({
|
|
|
10643
10642
|
* @returns {number}
|
|
10644
10643
|
*/
|
|
10645
10644
|
wasm_on_header_field: /* @__PURE__ */ __name((p7, at4, len) => {
|
|
10646
|
-
|
|
10645
|
+
assert64(currentParser.ptr === p7);
|
|
10647
10646
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
10648
10647
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
10649
10648
|
}, "wasm_on_header_field"),
|
|
@@ -10654,7 +10653,7 @@ var require_client_h1 = __commonJS({
|
|
|
10654
10653
|
* @returns {number}
|
|
10655
10654
|
*/
|
|
10656
10655
|
wasm_on_header_value: /* @__PURE__ */ __name((p7, at4, len) => {
|
|
10657
|
-
|
|
10656
|
+
assert64(currentParser.ptr === p7);
|
|
10658
10657
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
10659
10658
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
10660
10659
|
}, "wasm_on_header_value"),
|
|
@@ -10666,7 +10665,7 @@ var require_client_h1 = __commonJS({
|
|
|
10666
10665
|
* @returns {number}
|
|
10667
10666
|
*/
|
|
10668
10667
|
wasm_on_headers_complete: /* @__PURE__ */ __name((p7, statusCode, upgrade, shouldKeepAlive) => {
|
|
10669
|
-
|
|
10668
|
+
assert64(currentParser.ptr === p7);
|
|
10670
10669
|
return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
|
|
10671
10670
|
}, "wasm_on_headers_complete"),
|
|
10672
10671
|
/**
|
|
@@ -10676,7 +10675,7 @@ var require_client_h1 = __commonJS({
|
|
|
10676
10675
|
* @returns {number}
|
|
10677
10676
|
*/
|
|
10678
10677
|
wasm_on_body: /* @__PURE__ */ __name((p7, at4, len) => {
|
|
10679
|
-
|
|
10678
|
+
assert64(currentParser.ptr === p7);
|
|
10680
10679
|
const start = at4 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
10681
10680
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
10682
10681
|
}, "wasm_on_body"),
|
|
@@ -10685,7 +10684,7 @@ var require_client_h1 = __commonJS({
|
|
|
10685
10684
|
* @returns {number}
|
|
10686
10685
|
*/
|
|
10687
10686
|
wasm_on_message_complete: /* @__PURE__ */ __name((p7) => {
|
|
10688
|
-
|
|
10687
|
+
assert64(currentParser.ptr === p7);
|
|
10689
10688
|
return currentParser.onMessageComplete();
|
|
10690
10689
|
}, "wasm_on_message_complete")
|
|
10691
10690
|
}
|
|
@@ -10760,10 +10759,10 @@ var require_client_h1 = __commonJS({
|
|
|
10760
10759
|
if (this.socket.destroyed || !this.paused) {
|
|
10761
10760
|
return;
|
|
10762
10761
|
}
|
|
10763
|
-
|
|
10764
|
-
|
|
10762
|
+
assert64(this.ptr != null);
|
|
10763
|
+
assert64(currentParser === null);
|
|
10765
10764
|
this.llhttp.llhttp_resume(this.ptr);
|
|
10766
|
-
|
|
10765
|
+
assert64(this.timeoutType === TIMEOUT_BODY);
|
|
10767
10766
|
if (this.timeout) {
|
|
10768
10767
|
if (this.timeout.refresh) {
|
|
10769
10768
|
this.timeout.refresh();
|
|
@@ -10786,9 +10785,9 @@ var require_client_h1 = __commonJS({
|
|
|
10786
10785
|
* @param {Buffer} chunk
|
|
10787
10786
|
*/
|
|
10788
10787
|
execute(chunk) {
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10788
|
+
assert64(currentParser === null);
|
|
10789
|
+
assert64(this.ptr != null);
|
|
10790
|
+
assert64(!this.paused);
|
|
10792
10791
|
const { socket, llhttp } = this;
|
|
10793
10792
|
if (chunk.length > currentBufferSize) {
|
|
10794
10793
|
if (currentBufferPtr) {
|
|
@@ -10830,8 +10829,8 @@ var require_client_h1 = __commonJS({
|
|
|
10830
10829
|
}
|
|
10831
10830
|
}
|
|
10832
10831
|
destroy() {
|
|
10833
|
-
|
|
10834
|
-
|
|
10832
|
+
assert64(currentParser === null);
|
|
10833
|
+
assert64(this.ptr != null);
|
|
10835
10834
|
this.llhttp.llhttp_free(this.ptr);
|
|
10836
10835
|
this.ptr = null;
|
|
10837
10836
|
this.timeout && timers.clearTimeout(this.timeout);
|
|
@@ -10917,14 +10916,14 @@ var require_client_h1 = __commonJS({
|
|
|
10917
10916
|
*/
|
|
10918
10917
|
onUpgrade(head) {
|
|
10919
10918
|
const { upgrade, client, socket, headers, statusCode } = this;
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10919
|
+
assert64(upgrade);
|
|
10920
|
+
assert64(client[kSocket] === socket);
|
|
10921
|
+
assert64(!socket.destroyed);
|
|
10922
|
+
assert64(!this.paused);
|
|
10923
|
+
assert64((headers.length & 1) === 0);
|
|
10925
10924
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
10926
|
-
|
|
10927
|
-
|
|
10925
|
+
assert64(request4);
|
|
10926
|
+
assert64(request4.upgrade || request4.method === "CONNECT");
|
|
10928
10927
|
this.statusCode = 0;
|
|
10929
10928
|
this.statusText = "";
|
|
10930
10929
|
this.shouldKeepAlive = false;
|
|
@@ -10962,8 +10961,8 @@ var require_client_h1 = __commonJS({
|
|
|
10962
10961
|
if (!request4) {
|
|
10963
10962
|
return -1;
|
|
10964
10963
|
}
|
|
10965
|
-
|
|
10966
|
-
|
|
10964
|
+
assert64(!this.upgrade);
|
|
10965
|
+
assert64(this.statusCode < 200);
|
|
10967
10966
|
if (statusCode === 100) {
|
|
10968
10967
|
util4.destroy(socket, new SocketError("bad response", util4.getSocketInfo(socket)));
|
|
10969
10968
|
return -1;
|
|
@@ -10972,7 +10971,7 @@ var require_client_h1 = __commonJS({
|
|
|
10972
10971
|
util4.destroy(socket, new SocketError("bad upgrade", util4.getSocketInfo(socket)));
|
|
10973
10972
|
return -1;
|
|
10974
10973
|
}
|
|
10975
|
-
|
|
10974
|
+
assert64(this.timeoutType === TIMEOUT_HEADERS);
|
|
10976
10975
|
this.statusCode = statusCode;
|
|
10977
10976
|
this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
|
10978
10977
|
request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
|
@@ -10985,16 +10984,16 @@ var require_client_h1 = __commonJS({
|
|
|
10985
10984
|
}
|
|
10986
10985
|
}
|
|
10987
10986
|
if (request4.method === "CONNECT") {
|
|
10988
|
-
|
|
10987
|
+
assert64(client[kRunning] === 1);
|
|
10989
10988
|
this.upgrade = true;
|
|
10990
10989
|
return 2;
|
|
10991
10990
|
}
|
|
10992
10991
|
if (upgrade) {
|
|
10993
|
-
|
|
10992
|
+
assert64(client[kRunning] === 1);
|
|
10994
10993
|
this.upgrade = true;
|
|
10995
10994
|
return 2;
|
|
10996
10995
|
}
|
|
10997
|
-
|
|
10996
|
+
assert64((this.headers.length & 1) === 0);
|
|
10998
10997
|
this.headers = [];
|
|
10999
10998
|
this.headersSize = 0;
|
|
11000
10999
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
|
@@ -11041,14 +11040,14 @@ var require_client_h1 = __commonJS({
|
|
|
11041
11040
|
return -1;
|
|
11042
11041
|
}
|
|
11043
11042
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
11044
|
-
|
|
11045
|
-
|
|
11043
|
+
assert64(request4);
|
|
11044
|
+
assert64(this.timeoutType === TIMEOUT_BODY);
|
|
11046
11045
|
if (this.timeout) {
|
|
11047
11046
|
if (this.timeout.refresh) {
|
|
11048
11047
|
this.timeout.refresh();
|
|
11049
11048
|
}
|
|
11050
11049
|
}
|
|
11051
|
-
|
|
11050
|
+
assert64(statusCode >= 200);
|
|
11052
11051
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
|
11053
11052
|
util4.destroy(socket, new ResponseExceededMaxSizeError());
|
|
11054
11053
|
return -1;
|
|
@@ -11070,10 +11069,10 @@ var require_client_h1 = __commonJS({
|
|
|
11070
11069
|
if (upgrade) {
|
|
11071
11070
|
return 0;
|
|
11072
11071
|
}
|
|
11073
|
-
|
|
11074
|
-
|
|
11072
|
+
assert64(statusCode >= 100);
|
|
11073
|
+
assert64((this.headers.length & 1) === 0);
|
|
11075
11074
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
11076
|
-
|
|
11075
|
+
assert64(request4);
|
|
11077
11076
|
this.statusCode = 0;
|
|
11078
11077
|
this.statusText = "";
|
|
11079
11078
|
this.bytesRead = 0;
|
|
@@ -11092,7 +11091,7 @@ var require_client_h1 = __commonJS({
|
|
|
11092
11091
|
request4.onComplete(headers);
|
|
11093
11092
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
11094
11093
|
if (socket[kWriting]) {
|
|
11095
|
-
|
|
11094
|
+
assert64(client[kRunning] === 0);
|
|
11096
11095
|
util4.destroy(socket, new InformationalError("reset"));
|
|
11097
11096
|
return constants6.ERROR.PAUSED;
|
|
11098
11097
|
} else if (!shouldKeepAlive) {
|
|
@@ -11117,7 +11116,7 @@ var require_client_h1 = __commonJS({
|
|
|
11117
11116
|
const { socket, timeoutType, client, paused } = parser2;
|
|
11118
11117
|
if (timeoutType === TIMEOUT_HEADERS) {
|
|
11119
11118
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
|
11120
|
-
|
|
11119
|
+
assert64(!paused, "cannot be paused while waiting for headers");
|
|
11121
11120
|
util4.destroy(socket, new HeadersTimeoutError());
|
|
11122
11121
|
}
|
|
11123
11122
|
} else if (timeoutType === TIMEOUT_BODY) {
|
|
@@ -11125,7 +11124,7 @@ var require_client_h1 = __commonJS({
|
|
|
11125
11124
|
util4.destroy(socket, new BodyTimeoutError());
|
|
11126
11125
|
}
|
|
11127
11126
|
} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
|
|
11128
|
-
|
|
11127
|
+
assert64(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
|
11129
11128
|
util4.destroy(socket, new InformationalError("socket idle timeout"));
|
|
11130
11129
|
}
|
|
11131
11130
|
}
|
|
@@ -11204,7 +11203,7 @@ var require_client_h1 = __commonJS({
|
|
|
11204
11203
|
}
|
|
11205
11204
|
__name(connectH1, "connectH1");
|
|
11206
11205
|
function onHttpSocketError(err) {
|
|
11207
|
-
|
|
11206
|
+
assert64(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
11208
11207
|
const parser2 = this[kParser];
|
|
11209
11208
|
if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
|
|
11210
11209
|
parser2.onMessageComplete();
|
|
@@ -11241,7 +11240,7 @@ var require_client_h1 = __commonJS({
|
|
|
11241
11240
|
client[kSocket] = null;
|
|
11242
11241
|
client[kHTTPContext] = null;
|
|
11243
11242
|
if (client.destroyed) {
|
|
11244
|
-
|
|
11243
|
+
assert64(client[kPending] === 0);
|
|
11245
11244
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
11246
11245
|
for (let i7 = 0; i7 < requests.length; i7++) {
|
|
11247
11246
|
const request4 = requests[i7];
|
|
@@ -11253,7 +11252,7 @@ var require_client_h1 = __commonJS({
|
|
|
11253
11252
|
util4.errorRequest(client, request4, err);
|
|
11254
11253
|
}
|
|
11255
11254
|
client[kPendingIdx] = client[kRunningIdx];
|
|
11256
|
-
|
|
11255
|
+
assert64(client[kRunning] === 0);
|
|
11257
11256
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
11258
11257
|
client[kResume]();
|
|
11259
11258
|
}
|
|
@@ -11412,13 +11411,13 @@ upgrade: ${upgrade}\r
|
|
|
11412
11411
|
} else if (util4.isIterable(body)) {
|
|
11413
11412
|
writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
|
|
11414
11413
|
} else {
|
|
11415
|
-
|
|
11414
|
+
assert64(false);
|
|
11416
11415
|
}
|
|
11417
11416
|
return true;
|
|
11418
11417
|
}
|
|
11419
11418
|
__name(writeH1, "writeH1");
|
|
11420
11419
|
function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
11421
|
-
|
|
11420
|
+
assert64(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
11422
11421
|
let finished = false;
|
|
11423
11422
|
const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
|
|
11424
11423
|
const onData = /* @__PURE__ */ __name(function(chunk) {
|
|
@@ -11455,7 +11454,7 @@ upgrade: ${upgrade}\r
|
|
|
11455
11454
|
return;
|
|
11456
11455
|
}
|
|
11457
11456
|
finished = true;
|
|
11458
|
-
|
|
11457
|
+
assert64(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
|
11459
11458
|
socket.off("drain", onDrain).off("error", onFinished);
|
|
11460
11459
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
|
|
11461
11460
|
if (!err) {
|
|
@@ -11495,12 +11494,12 @@ upgrade: ${upgrade}\r
|
|
|
11495
11494
|
\r
|
|
11496
11495
|
`, "latin1");
|
|
11497
11496
|
} else {
|
|
11498
|
-
|
|
11497
|
+
assert64(contentLength === null, "no body must not have content length");
|
|
11499
11498
|
socket.write(`${header}\r
|
|
11500
11499
|
`, "latin1");
|
|
11501
11500
|
}
|
|
11502
11501
|
} else if (util4.isBuffer(body)) {
|
|
11503
|
-
|
|
11502
|
+
assert64(contentLength === body.byteLength, "buffer body must have content length");
|
|
11504
11503
|
socket.cork();
|
|
11505
11504
|
socket.write(`${header}content-length: ${contentLength}\r
|
|
11506
11505
|
\r
|
|
@@ -11520,7 +11519,7 @@ upgrade: ${upgrade}\r
|
|
|
11520
11519
|
}
|
|
11521
11520
|
__name(writeBuffer, "writeBuffer");
|
|
11522
11521
|
async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
11523
|
-
|
|
11522
|
+
assert64(contentLength === body.size, "blob body must have content length");
|
|
11524
11523
|
try {
|
|
11525
11524
|
if (contentLength != null && contentLength !== body.size) {
|
|
11526
11525
|
throw new RequestContentLengthMismatchError();
|
|
@@ -11544,7 +11543,7 @@ upgrade: ${upgrade}\r
|
|
|
11544
11543
|
}
|
|
11545
11544
|
__name(writeBlob, "writeBlob");
|
|
11546
11545
|
async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
11547
|
-
|
|
11546
|
+
assert64(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
11548
11547
|
let callback2 = null;
|
|
11549
11548
|
function onDrain() {
|
|
11550
11549
|
if (callback2) {
|
|
@@ -11555,7 +11554,7 @@ upgrade: ${upgrade}\r
|
|
|
11555
11554
|
}
|
|
11556
11555
|
__name(onDrain, "onDrain");
|
|
11557
11556
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve33, reject) => {
|
|
11558
|
-
|
|
11557
|
+
assert64(callback2 === null);
|
|
11559
11558
|
if (socket[kError]) {
|
|
11560
11559
|
reject(socket[kError]);
|
|
11561
11560
|
} else {
|
|
@@ -11708,7 +11707,7 @@ ${len.toString(16)}\r
|
|
|
11708
11707
|
const { socket, client, abort } = this;
|
|
11709
11708
|
socket[kWriting] = false;
|
|
11710
11709
|
if (err) {
|
|
11711
|
-
|
|
11710
|
+
assert64(client[kRunning] <= 1, "pipeline should only contain this request");
|
|
11712
11711
|
abort(err);
|
|
11713
11712
|
}
|
|
11714
11713
|
}
|
|
@@ -11721,7 +11720,7 @@ ${len.toString(16)}\r
|
|
|
11721
11720
|
var require_client_h2 = __commonJS({
|
|
11722
11721
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module2) {
|
|
11723
11722
|
init_import_meta_url();
|
|
11724
|
-
var
|
|
11723
|
+
var assert64 = __require("assert");
|
|
11725
11724
|
var { pipeline: pipeline2 } = __require("stream");
|
|
11726
11725
|
var util4 = require_util();
|
|
11727
11726
|
var {
|
|
@@ -11947,7 +11946,7 @@ var require_client_h2 = __commonJS({
|
|
|
11947
11946
|
}
|
|
11948
11947
|
__name(onHttp2SendPing, "onHttp2SendPing");
|
|
11949
11948
|
function onHttp2SessionError(err) {
|
|
11950
|
-
|
|
11949
|
+
assert64(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
11951
11950
|
this[kSocket][kError] = err;
|
|
11952
11951
|
this[kClient][kOnError](err);
|
|
11953
11952
|
}
|
|
@@ -11980,7 +11979,7 @@ var require_client_h2 = __commonJS({
|
|
|
11980
11979
|
util4.errorRequest(client, request4, err);
|
|
11981
11980
|
client[kPendingIdx] = client[kRunningIdx];
|
|
11982
11981
|
}
|
|
11983
|
-
|
|
11982
|
+
assert64(client[kRunning] === 0);
|
|
11984
11983
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
11985
11984
|
client.emit("connectionError", client[kUrl], [client], err);
|
|
11986
11985
|
client[kResume]();
|
|
@@ -11997,7 +11996,7 @@ var require_client_h2 = __commonJS({
|
|
|
11997
11996
|
state3.ping.interval = null;
|
|
11998
11997
|
}
|
|
11999
11998
|
if (client.destroyed) {
|
|
12000
|
-
|
|
11999
|
+
assert64(client[kPending] === 0);
|
|
12001
12000
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
12002
12001
|
for (let i7 = 0; i7 < requests.length; i7++) {
|
|
12003
12002
|
const request4 = requests[i7];
|
|
@@ -12015,13 +12014,13 @@ var require_client_h2 = __commonJS({
|
|
|
12015
12014
|
this[kHTTP2Session].destroy(err);
|
|
12016
12015
|
}
|
|
12017
12016
|
client[kPendingIdx] = client[kRunningIdx];
|
|
12018
|
-
|
|
12017
|
+
assert64(client[kRunning] === 0);
|
|
12019
12018
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
12020
12019
|
client[kResume]();
|
|
12021
12020
|
}
|
|
12022
12021
|
__name(onHttp2SocketClose, "onHttp2SocketClose");
|
|
12023
12022
|
function onHttp2SocketError(err) {
|
|
12024
|
-
|
|
12023
|
+
assert64(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
12025
12024
|
this[kError] = err;
|
|
12026
12025
|
this[kClient][kOnError](err);
|
|
12027
12026
|
}
|
|
@@ -12178,7 +12177,7 @@ var require_client_h2 = __commonJS({
|
|
|
12178
12177
|
process.emitWarning(new RequestContentLengthMismatchError());
|
|
12179
12178
|
}
|
|
12180
12179
|
if (contentLength != null) {
|
|
12181
|
-
|
|
12180
|
+
assert64(body || contentLength === 0, "no body must not have content length");
|
|
12182
12181
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
|
|
12183
12182
|
}
|
|
12184
12183
|
session.ref();
|
|
@@ -12347,7 +12346,7 @@ var require_client_h2 = __commonJS({
|
|
|
12347
12346
|
expectsPayload
|
|
12348
12347
|
);
|
|
12349
12348
|
} else {
|
|
12350
|
-
|
|
12349
|
+
assert64(false);
|
|
12351
12350
|
}
|
|
12352
12351
|
}
|
|
12353
12352
|
}
|
|
@@ -12355,7 +12354,7 @@ var require_client_h2 = __commonJS({
|
|
|
12355
12354
|
function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
12356
12355
|
try {
|
|
12357
12356
|
if (body != null && util4.isBuffer(body)) {
|
|
12358
|
-
|
|
12357
|
+
assert64(contentLength === body.byteLength, "buffer body must have content length");
|
|
12359
12358
|
h2stream.cork();
|
|
12360
12359
|
h2stream.write(body);
|
|
12361
12360
|
h2stream.uncork();
|
|
@@ -12373,7 +12372,7 @@ var require_client_h2 = __commonJS({
|
|
|
12373
12372
|
}
|
|
12374
12373
|
__name(writeBuffer, "writeBuffer");
|
|
12375
12374
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
|
|
12376
|
-
|
|
12375
|
+
assert64(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
12377
12376
|
const pipe = pipeline2(
|
|
12378
12377
|
body,
|
|
12379
12378
|
h2stream,
|
|
@@ -12399,7 +12398,7 @@ var require_client_h2 = __commonJS({
|
|
|
12399
12398
|
}
|
|
12400
12399
|
__name(writeStream, "writeStream");
|
|
12401
12400
|
async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
12402
|
-
|
|
12401
|
+
assert64(contentLength === body.size, "blob body must have content length");
|
|
12403
12402
|
try {
|
|
12404
12403
|
if (contentLength != null && contentLength !== body.size) {
|
|
12405
12404
|
throw new RequestContentLengthMismatchError();
|
|
@@ -12421,7 +12420,7 @@ var require_client_h2 = __commonJS({
|
|
|
12421
12420
|
}
|
|
12422
12421
|
__name(writeBlob, "writeBlob");
|
|
12423
12422
|
async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
12424
|
-
|
|
12423
|
+
assert64(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
12425
12424
|
let callback2 = null;
|
|
12426
12425
|
function onDrain() {
|
|
12427
12426
|
if (callback2) {
|
|
@@ -12432,7 +12431,7 @@ var require_client_h2 = __commonJS({
|
|
|
12432
12431
|
}
|
|
12433
12432
|
__name(onDrain, "onDrain");
|
|
12434
12433
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve33, reject) => {
|
|
12435
|
-
|
|
12434
|
+
assert64(callback2 === null);
|
|
12436
12435
|
if (socket[kError]) {
|
|
12437
12436
|
reject(socket[kError]);
|
|
12438
12437
|
} else {
|
|
@@ -12472,7 +12471,7 @@ var require_client_h2 = __commonJS({
|
|
|
12472
12471
|
var require_client = __commonJS({
|
|
12473
12472
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/dispatcher/client.js"(exports, module2) {
|
|
12474
12473
|
init_import_meta_url();
|
|
12475
|
-
var
|
|
12474
|
+
var assert64 = __require("assert");
|
|
12476
12475
|
var net3 = __require("net");
|
|
12477
12476
|
var http6 = __require("http");
|
|
12478
12477
|
var util4 = require_util();
|
|
@@ -12785,25 +12784,25 @@ var require_client = __commonJS({
|
|
|
12785
12784
|
};
|
|
12786
12785
|
function onError(client, err) {
|
|
12787
12786
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
|
12788
|
-
|
|
12787
|
+
assert64(client[kPendingIdx] === client[kRunningIdx]);
|
|
12789
12788
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
12790
12789
|
for (let i7 = 0; i7 < requests.length; i7++) {
|
|
12791
12790
|
const request4 = requests[i7];
|
|
12792
12791
|
util4.errorRequest(client, request4, err);
|
|
12793
12792
|
}
|
|
12794
|
-
|
|
12793
|
+
assert64(client[kSize] === 0);
|
|
12795
12794
|
}
|
|
12796
12795
|
}
|
|
12797
12796
|
__name(onError, "onError");
|
|
12798
12797
|
function connect(client) {
|
|
12799
|
-
|
|
12800
|
-
|
|
12798
|
+
assert64(!client[kConnecting]);
|
|
12799
|
+
assert64(!client[kHTTPContext]);
|
|
12801
12800
|
let { host, hostname: hostname2, protocol, port } = client[kUrl];
|
|
12802
12801
|
if (hostname2[0] === "[") {
|
|
12803
12802
|
const idx = hostname2.indexOf("]");
|
|
12804
|
-
|
|
12803
|
+
assert64(idx !== -1);
|
|
12805
12804
|
const ip = hostname2.substring(1, idx);
|
|
12806
|
-
|
|
12805
|
+
assert64(net3.isIPv6(ip));
|
|
12807
12806
|
hostname2 = ip;
|
|
12808
12807
|
}
|
|
12809
12808
|
client[kConnecting] = true;
|
|
@@ -12840,7 +12839,7 @@ var require_client = __commonJS({
|
|
|
12840
12839
|
client[kResume]();
|
|
12841
12840
|
return;
|
|
12842
12841
|
}
|
|
12843
|
-
|
|
12842
|
+
assert64(socket);
|
|
12844
12843
|
try {
|
|
12845
12844
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
|
|
12846
12845
|
} catch (err2) {
|
|
@@ -12899,7 +12898,7 @@ var require_client = __commonJS({
|
|
|
12899
12898
|
});
|
|
12900
12899
|
}
|
|
12901
12900
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
|
12902
|
-
|
|
12901
|
+
assert64(client[kRunning] === 0);
|
|
12903
12902
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
|
12904
12903
|
const request4 = client[kQueue][client[kPendingIdx]++];
|
|
12905
12904
|
util4.errorRequest(client, request4, err);
|
|
@@ -12932,7 +12931,7 @@ var require_client = __commonJS({
|
|
|
12932
12931
|
function _resume(client, sync) {
|
|
12933
12932
|
while (true) {
|
|
12934
12933
|
if (client.destroyed) {
|
|
12935
|
-
|
|
12934
|
+
assert64(client[kPending] === 0);
|
|
12936
12935
|
return;
|
|
12937
12936
|
}
|
|
12938
12937
|
if (client[kClosedResolve] && !client[kSize]) {
|
|
@@ -14841,7 +14840,7 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
14841
14840
|
var require_retry_handler = __commonJS({
|
|
14842
14841
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/handler/retry-handler.js"(exports, module2) {
|
|
14843
14842
|
init_import_meta_url();
|
|
14844
|
-
var
|
|
14843
|
+
var assert64 = __require("assert");
|
|
14845
14844
|
var { kRetryHandlerDefaultRetry } = require_symbols();
|
|
14846
14845
|
var { RequestRetryError } = require_errors();
|
|
14847
14846
|
var WrapHandler = require_wrap_handler();
|
|
@@ -15028,8 +15027,8 @@ var require_retry_handler = __commonJS({
|
|
|
15028
15027
|
});
|
|
15029
15028
|
}
|
|
15030
15029
|
const { start, size, end = size ? size - 1 : null } = contentRange;
|
|
15031
|
-
|
|
15032
|
-
|
|
15030
|
+
assert64(this.start === start, "content-range mismatch");
|
|
15031
|
+
assert64(this.end == null || this.end === end, "content-range mismatch");
|
|
15033
15032
|
return;
|
|
15034
15033
|
}
|
|
15035
15034
|
if (this.end == null) {
|
|
@@ -15046,11 +15045,11 @@ var require_retry_handler = __commonJS({
|
|
|
15046
15045
|
return;
|
|
15047
15046
|
}
|
|
15048
15047
|
const { start, size, end = size ? size - 1 : null } = range2;
|
|
15049
|
-
|
|
15048
|
+
assert64(
|
|
15050
15049
|
start != null && Number.isFinite(start),
|
|
15051
15050
|
"content-range mismatch"
|
|
15052
15051
|
);
|
|
15053
|
-
|
|
15052
|
+
assert64(end != null && Number.isFinite(end), "invalid content-length");
|
|
15054
15053
|
this.start = start;
|
|
15055
15054
|
this.end = end;
|
|
15056
15055
|
}
|
|
@@ -15058,8 +15057,8 @@ var require_retry_handler = __commonJS({
|
|
|
15058
15057
|
const contentLength = headers["content-length"];
|
|
15059
15058
|
this.end = contentLength != null ? Number(contentLength) - 1 : null;
|
|
15060
15059
|
}
|
|
15061
|
-
|
|
15062
|
-
|
|
15060
|
+
assert64(Number.isFinite(this.start));
|
|
15061
|
+
assert64(
|
|
15063
15062
|
this.end == null || Number.isFinite(this.end),
|
|
15064
15063
|
"invalid content-length"
|
|
15065
15064
|
);
|
|
@@ -15240,7 +15239,7 @@ var require_h2c_client = __commonJS({
|
|
|
15240
15239
|
var require_readable = __commonJS({
|
|
15241
15240
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/api/readable.js"(exports, module2) {
|
|
15242
15241
|
init_import_meta_url();
|
|
15243
|
-
var
|
|
15242
|
+
var assert64 = __require("assert");
|
|
15244
15243
|
var { Readable: Readable13 } = __require("stream");
|
|
15245
15244
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
|
|
15246
15245
|
var util4 = require_util();
|
|
@@ -15437,7 +15436,7 @@ var require_readable = __commonJS({
|
|
|
15437
15436
|
this[kBody] = ReadableStreamFrom(this);
|
|
15438
15437
|
if (this[kConsume]) {
|
|
15439
15438
|
this[kBody].getReader();
|
|
15440
|
-
|
|
15439
|
+
assert64(this[kBody].locked);
|
|
15441
15440
|
}
|
|
15442
15441
|
}
|
|
15443
15442
|
return this[kBody];
|
|
@@ -15508,7 +15507,7 @@ var require_readable = __commonJS({
|
|
|
15508
15507
|
}
|
|
15509
15508
|
__name(isUnusable, "isUnusable");
|
|
15510
15509
|
function consume(stream2, type) {
|
|
15511
|
-
|
|
15510
|
+
assert64(!stream2[kConsume]);
|
|
15512
15511
|
return new Promise((resolve33, reject) => {
|
|
15513
15512
|
if (isUnusable(stream2)) {
|
|
15514
15513
|
const rState = stream2._readableState;
|
|
@@ -15654,7 +15653,7 @@ var require_readable = __commonJS({
|
|
|
15654
15653
|
var require_api_request = __commonJS({
|
|
15655
15654
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/api/api-request.js"(exports, module2) {
|
|
15656
15655
|
init_import_meta_url();
|
|
15657
|
-
var
|
|
15656
|
+
var assert64 = __require("assert");
|
|
15658
15657
|
var { AsyncResource } = __require("async_hooks");
|
|
15659
15658
|
var { Readable: Readable13 } = require_readable();
|
|
15660
15659
|
var { InvalidArgumentError, RequestAbortedError } = require_errors();
|
|
@@ -15725,7 +15724,7 @@ var require_api_request = __commonJS({
|
|
|
15725
15724
|
abort(this.reason);
|
|
15726
15725
|
return;
|
|
15727
15726
|
}
|
|
15728
|
-
|
|
15727
|
+
assert64(this.callback);
|
|
15729
15728
|
this.abort = abort;
|
|
15730
15729
|
this.context = context2;
|
|
15731
15730
|
}
|
|
@@ -15892,7 +15891,7 @@ var require_abort_signal = __commonJS({
|
|
|
15892
15891
|
var require_api_stream = __commonJS({
|
|
15893
15892
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/api/api-stream.js"(exports, module2) {
|
|
15894
15893
|
init_import_meta_url();
|
|
15895
|
-
var
|
|
15894
|
+
var assert64 = __require("assert");
|
|
15896
15895
|
var { finished } = __require("stream");
|
|
15897
15896
|
var { AsyncResource } = __require("async_hooks");
|
|
15898
15897
|
var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
|
|
@@ -15955,7 +15954,7 @@ var require_api_stream = __commonJS({
|
|
|
15955
15954
|
abort(this.reason);
|
|
15956
15955
|
return;
|
|
15957
15956
|
}
|
|
15958
|
-
|
|
15957
|
+
assert64(this.callback);
|
|
15959
15958
|
this.abort = abort;
|
|
15960
15959
|
this.context = context2;
|
|
15961
15960
|
}
|
|
@@ -16063,7 +16062,7 @@ var require_api_pipeline = __commonJS({
|
|
|
16063
16062
|
Duplex: Duplex2,
|
|
16064
16063
|
PassThrough: PassThrough4
|
|
16065
16064
|
} = __require("stream");
|
|
16066
|
-
var
|
|
16065
|
+
var assert64 = __require("assert");
|
|
16067
16066
|
var { AsyncResource } = __require("async_hooks");
|
|
16068
16067
|
var {
|
|
16069
16068
|
InvalidArgumentError,
|
|
@@ -16187,7 +16186,7 @@ var require_api_pipeline = __commonJS({
|
|
|
16187
16186
|
abort(this.reason);
|
|
16188
16187
|
return;
|
|
16189
16188
|
}
|
|
16190
|
-
|
|
16189
|
+
assert64(!res, "pipeline cannot be retried");
|
|
16191
16190
|
this.abort = abort;
|
|
16192
16191
|
this.context = context2;
|
|
16193
16192
|
}
|
|
@@ -16272,7 +16271,7 @@ var require_api_upgrade = __commonJS({
|
|
|
16272
16271
|
init_import_meta_url();
|
|
16273
16272
|
var { InvalidArgumentError, SocketError } = require_errors();
|
|
16274
16273
|
var { AsyncResource } = __require("async_hooks");
|
|
16275
|
-
var
|
|
16274
|
+
var assert64 = __require("assert");
|
|
16276
16275
|
var util4 = require_util();
|
|
16277
16276
|
var { kHTTP2Stream } = require_symbols();
|
|
16278
16277
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
@@ -16304,7 +16303,7 @@ var require_api_upgrade = __commonJS({
|
|
|
16304
16303
|
abort(this.reason);
|
|
16305
16304
|
return;
|
|
16306
16305
|
}
|
|
16307
|
-
|
|
16306
|
+
assert64(this.callback);
|
|
16308
16307
|
this.abort = abort;
|
|
16309
16308
|
this.context = null;
|
|
16310
16309
|
}
|
|
@@ -16312,7 +16311,7 @@ var require_api_upgrade = __commonJS({
|
|
|
16312
16311
|
throw new SocketError("bad upgrade", null);
|
|
16313
16312
|
}
|
|
16314
16313
|
onUpgrade(statusCode, rawHeaders, socket) {
|
|
16315
|
-
|
|
16314
|
+
assert64(socket[kHTTP2Stream] === true ? statusCode === 200 : statusCode === 101);
|
|
16316
16315
|
const { callback: callback2, opaque, context: context2 } = this;
|
|
16317
16316
|
removeSignal(this);
|
|
16318
16317
|
this.callback = null;
|
|
@@ -16368,7 +16367,7 @@ var require_api_upgrade = __commonJS({
|
|
|
16368
16367
|
var require_api_connect = __commonJS({
|
|
16369
16368
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/api/api-connect.js"(exports, module2) {
|
|
16370
16369
|
init_import_meta_url();
|
|
16371
|
-
var
|
|
16370
|
+
var assert64 = __require("assert");
|
|
16372
16371
|
var { AsyncResource } = __require("async_hooks");
|
|
16373
16372
|
var { InvalidArgumentError, SocketError } = require_errors();
|
|
16374
16373
|
var util4 = require_util();
|
|
@@ -16400,7 +16399,7 @@ var require_api_connect = __commonJS({
|
|
|
16400
16399
|
abort(this.reason);
|
|
16401
16400
|
return;
|
|
16402
16401
|
}
|
|
16403
|
-
|
|
16402
|
+
assert64(this.callback);
|
|
16404
16403
|
this.abort = abort;
|
|
16405
16404
|
this.context = context2;
|
|
16406
16405
|
}
|
|
@@ -18495,7 +18494,7 @@ var require_global2 = __commonJS({
|
|
|
18495
18494
|
var require_decorator_handler = __commonJS({
|
|
18496
18495
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/handler/decorator-handler.js"(exports, module2) {
|
|
18497
18496
|
init_import_meta_url();
|
|
18498
|
-
var
|
|
18497
|
+
var assert64 = __require("assert");
|
|
18499
18498
|
var WrapHandler = require_wrap_handler();
|
|
18500
18499
|
module2.exports = class DecoratorHandler {
|
|
18501
18500
|
static {
|
|
@@ -18515,25 +18514,25 @@ var require_decorator_handler = __commonJS({
|
|
|
18515
18514
|
this.#handler.onRequestStart?.(...args);
|
|
18516
18515
|
}
|
|
18517
18516
|
onRequestUpgrade(...args) {
|
|
18518
|
-
|
|
18519
|
-
|
|
18517
|
+
assert64(!this.#onCompleteCalled);
|
|
18518
|
+
assert64(!this.#onErrorCalled);
|
|
18520
18519
|
return this.#handler.onRequestUpgrade?.(...args);
|
|
18521
18520
|
}
|
|
18522
18521
|
onResponseStart(...args) {
|
|
18523
|
-
|
|
18524
|
-
|
|
18525
|
-
|
|
18522
|
+
assert64(!this.#onCompleteCalled);
|
|
18523
|
+
assert64(!this.#onErrorCalled);
|
|
18524
|
+
assert64(!this.#onResponseStartCalled);
|
|
18526
18525
|
this.#onResponseStartCalled = true;
|
|
18527
18526
|
return this.#handler.onResponseStart?.(...args);
|
|
18528
18527
|
}
|
|
18529
18528
|
onResponseData(...args) {
|
|
18530
|
-
|
|
18531
|
-
|
|
18529
|
+
assert64(!this.#onCompleteCalled);
|
|
18530
|
+
assert64(!this.#onErrorCalled);
|
|
18532
18531
|
return this.#handler.onResponseData?.(...args);
|
|
18533
18532
|
}
|
|
18534
18533
|
onResponseEnd(...args) {
|
|
18535
|
-
|
|
18536
|
-
|
|
18534
|
+
assert64(!this.#onCompleteCalled);
|
|
18535
|
+
assert64(!this.#onErrorCalled);
|
|
18537
18536
|
this.#onCompleteCalled = true;
|
|
18538
18537
|
return this.#handler.onResponseEnd?.(...args);
|
|
18539
18538
|
}
|
|
@@ -18556,7 +18555,7 @@ var require_redirect_handler = __commonJS({
|
|
|
18556
18555
|
init_import_meta_url();
|
|
18557
18556
|
var util4 = require_util();
|
|
18558
18557
|
var { kBodyUsed } = require_symbols();
|
|
18559
|
-
var
|
|
18558
|
+
var assert64 = __require("assert");
|
|
18560
18559
|
var { InvalidArgumentError } = require_errors();
|
|
18561
18560
|
var EE = __require("events");
|
|
18562
18561
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
@@ -18572,7 +18571,7 @@ var require_redirect_handler = __commonJS({
|
|
|
18572
18571
|
this[kBodyUsed] = false;
|
|
18573
18572
|
}
|
|
18574
18573
|
async *[Symbol.asyncIterator]() {
|
|
18575
|
-
|
|
18574
|
+
assert64(!this[kBodyUsed], "disturbed");
|
|
18576
18575
|
this[kBodyUsed] = true;
|
|
18577
18576
|
yield* this[kBody];
|
|
18578
18577
|
}
|
|
@@ -18602,7 +18601,7 @@ var require_redirect_handler = __commonJS({
|
|
|
18602
18601
|
if (util4.isStream(this.opts.body)) {
|
|
18603
18602
|
if (util4.bodyLength(this.opts.body) === 0) {
|
|
18604
18603
|
this.opts.body.on("data", function() {
|
|
18605
|
-
|
|
18604
|
+
assert64(false);
|
|
18606
18605
|
});
|
|
18607
18606
|
}
|
|
18608
18607
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
|
@@ -18708,7 +18707,7 @@ var require_redirect_handler = __commonJS({
|
|
|
18708
18707
|
}
|
|
18709
18708
|
}
|
|
18710
18709
|
} else {
|
|
18711
|
-
|
|
18710
|
+
assert64(headers == null, "headers must be an object or an array");
|
|
18712
18711
|
}
|
|
18713
18712
|
return ret;
|
|
18714
18713
|
}
|
|
@@ -20746,7 +20745,7 @@ var require_memory_cache_store = __commonJS({
|
|
|
20746
20745
|
var require_cache_revalidation_handler = __commonJS({
|
|
20747
20746
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports, module2) {
|
|
20748
20747
|
init_import_meta_url();
|
|
20749
|
-
var
|
|
20748
|
+
var assert64 = __require("assert");
|
|
20750
20749
|
var CacheRevalidationHandler = class {
|
|
20751
20750
|
static {
|
|
20752
20751
|
__name(this, "CacheRevalidationHandler");
|
|
@@ -20786,7 +20785,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
|
20786
20785
|
this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
|
|
20787
20786
|
}
|
|
20788
20787
|
onResponseStart(controller, statusCode, headers, statusMessage) {
|
|
20789
|
-
|
|
20788
|
+
assert64(this.#callback != null);
|
|
20790
20789
|
this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
|
|
20791
20790
|
this.#callback(this.#successful, this.#context);
|
|
20792
20791
|
this.#callback = null;
|
|
@@ -20836,7 +20835,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
|
20836
20835
|
var require_cache2 = __commonJS({
|
|
20837
20836
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/interceptor/cache.js"(exports, module2) {
|
|
20838
20837
|
init_import_meta_url();
|
|
20839
|
-
var
|
|
20838
|
+
var assert64 = __require("assert");
|
|
20840
20839
|
var { Readable: Readable13 } = __require("stream");
|
|
20841
20840
|
var util4 = require_util();
|
|
20842
20841
|
var CacheHandler = require_cache_handler();
|
|
@@ -20932,8 +20931,8 @@ var require_cache2 = __commonJS({
|
|
|
20932
20931
|
__name(handleUncachedResponse, "handleUncachedResponse");
|
|
20933
20932
|
function sendCachedValue(handler, opts, result, age, context2, isStale2) {
|
|
20934
20933
|
const stream2 = util4.isStream(result.body) ? result.body : Readable13.from(result.body ?? []);
|
|
20935
|
-
|
|
20936
|
-
|
|
20934
|
+
assert64(!stream2.destroyed, "stream should not be destroyed");
|
|
20935
|
+
assert64(!stream2.readableDidRead, "stream should not be readableDidRead");
|
|
20937
20936
|
const controller = {
|
|
20938
20937
|
resume() {
|
|
20939
20938
|
stream2.resume();
|
|
@@ -22215,7 +22214,7 @@ var require_headers = __commonJS({
|
|
|
22215
22214
|
isValidHeaderValue
|
|
22216
22215
|
} = require_util2();
|
|
22217
22216
|
var { webidl } = require_webidl();
|
|
22218
|
-
var
|
|
22217
|
+
var assert64 = __require("assert");
|
|
22219
22218
|
var util4 = __require("util");
|
|
22220
22219
|
function isHTTPWhiteSpaceCharCode(code) {
|
|
22221
22220
|
return code === 10 || code === 13 || code === 9 || code === 32;
|
|
@@ -22440,11 +22439,11 @@ var require_headers = __commonJS({
|
|
|
22440
22439
|
const iterator = this.headersMap[Symbol.iterator]();
|
|
22441
22440
|
const firstValue = iterator.next().value;
|
|
22442
22441
|
array[0] = [firstValue[0], firstValue[1].value];
|
|
22443
|
-
|
|
22442
|
+
assert64(firstValue[1].value !== null);
|
|
22444
22443
|
for (let i7 = 1, j7 = 0, right2 = 0, left2 = 0, pivot = 0, x6, value; i7 < size; ++i7) {
|
|
22445
22444
|
value = iterator.next().value;
|
|
22446
22445
|
x6 = array[i7] = [value[0], value[1].value];
|
|
22447
|
-
|
|
22446
|
+
assert64(x6[1] !== null);
|
|
22448
22447
|
left2 = 0;
|
|
22449
22448
|
right2 = i7;
|
|
22450
22449
|
while (left2 < right2) {
|
|
@@ -22471,13 +22470,13 @@ var require_headers = __commonJS({
|
|
|
22471
22470
|
let i7 = 0;
|
|
22472
22471
|
for (const { 0: name2, 1: { value } } of this.headersMap) {
|
|
22473
22472
|
array[i7++] = [name2, value];
|
|
22474
|
-
|
|
22473
|
+
assert64(value !== null);
|
|
22475
22474
|
}
|
|
22476
22475
|
return array.sort(compareHeaderName);
|
|
22477
22476
|
}
|
|
22478
22477
|
}
|
|
22479
22478
|
};
|
|
22480
|
-
var
|
|
22479
|
+
var Headers6 = class _Headers {
|
|
22481
22480
|
static {
|
|
22482
22481
|
__name(this, "Headers");
|
|
22483
22482
|
}
|
|
@@ -22621,13 +22620,13 @@ var require_headers = __commonJS({
|
|
|
22621
22620
|
target.#headersList = list;
|
|
22622
22621
|
}
|
|
22623
22622
|
};
|
|
22624
|
-
var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } =
|
|
22625
|
-
Reflect.deleteProperty(
|
|
22626
|
-
Reflect.deleteProperty(
|
|
22627
|
-
Reflect.deleteProperty(
|
|
22628
|
-
Reflect.deleteProperty(
|
|
22629
|
-
iteratorMixin("Headers",
|
|
22630
|
-
Object.defineProperties(
|
|
22623
|
+
var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers6;
|
|
22624
|
+
Reflect.deleteProperty(Headers6, "getHeadersGuard");
|
|
22625
|
+
Reflect.deleteProperty(Headers6, "setHeadersGuard");
|
|
22626
|
+
Reflect.deleteProperty(Headers6, "getHeadersList");
|
|
22627
|
+
Reflect.deleteProperty(Headers6, "setHeadersList");
|
|
22628
|
+
iteratorMixin("Headers", Headers6, headersListSortAndCombine, 0, 1);
|
|
22629
|
+
Object.defineProperties(Headers6.prototype, {
|
|
22631
22630
|
append: kEnumerableProperty,
|
|
22632
22631
|
delete: kEnumerableProperty,
|
|
22633
22632
|
get: kEnumerableProperty,
|
|
@@ -22645,7 +22644,7 @@ var require_headers = __commonJS({
|
|
|
22645
22644
|
webidl.converters.HeadersInit = function(V4, prefix, argument) {
|
|
22646
22645
|
if (webidl.util.Type(V4) === webidl.util.Types.OBJECT) {
|
|
22647
22646
|
const iterator = Reflect.get(V4, Symbol.iterator);
|
|
22648
|
-
if (!util4.types.isProxy(V4) && iterator ===
|
|
22647
|
+
if (!util4.types.isProxy(V4) && iterator === Headers6.prototype.entries) {
|
|
22649
22648
|
try {
|
|
22650
22649
|
return getHeadersList(V4).entriesList;
|
|
22651
22650
|
} catch {
|
|
@@ -22666,7 +22665,7 @@ var require_headers = __commonJS({
|
|
|
22666
22665
|
fill: fill2,
|
|
22667
22666
|
// for test.
|
|
22668
22667
|
compareHeaderName,
|
|
22669
|
-
Headers:
|
|
22668
|
+
Headers: Headers6,
|
|
22670
22669
|
HeadersList,
|
|
22671
22670
|
getHeadersGuard,
|
|
22672
22671
|
setHeadersGuard,
|
|
@@ -22680,7 +22679,7 @@ var require_headers = __commonJS({
|
|
|
22680
22679
|
var require_response = __commonJS({
|
|
22681
22680
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js"(exports, module2) {
|
|
22682
22681
|
init_import_meta_url();
|
|
22683
|
-
var { Headers:
|
|
22682
|
+
var { Headers: Headers6, HeadersList, fill: fill2, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers();
|
|
22684
22683
|
var { extractBody, cloneBody, mixinBody, streamRegistry, bodyUnusable } = require_body();
|
|
22685
22684
|
var util4 = require_util();
|
|
22686
22685
|
var nodeUtil = __require("util");
|
|
@@ -22699,10 +22698,10 @@ var require_response = __commonJS({
|
|
|
22699
22698
|
var { webidl } = require_webidl();
|
|
22700
22699
|
var { URLSerializer } = require_data_url();
|
|
22701
22700
|
var { kConstruct } = require_symbols();
|
|
22702
|
-
var
|
|
22701
|
+
var assert64 = __require("assert");
|
|
22703
22702
|
var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra();
|
|
22704
22703
|
var textEncoder = new TextEncoder("utf-8");
|
|
22705
|
-
var
|
|
22704
|
+
var Response12 = class _Response {
|
|
22706
22705
|
static {
|
|
22707
22706
|
__name(this, "Response");
|
|
22708
22707
|
}
|
|
@@ -22759,7 +22758,7 @@ var require_response = __commonJS({
|
|
|
22759
22758
|
}
|
|
22760
22759
|
init4 = webidl.converters.ResponseInit(init4);
|
|
22761
22760
|
this.#state = makeResponse({});
|
|
22762
|
-
this.#headers = new
|
|
22761
|
+
this.#headers = new Headers6(kConstruct);
|
|
22763
22762
|
setHeadersGuard(this.#headers, "response");
|
|
22764
22763
|
setHeadersList(this.#headers, this.#state.headersList);
|
|
22765
22764
|
let bodyWithType = null;
|
|
@@ -22877,13 +22876,13 @@ var require_response = __commonJS({
|
|
|
22877
22876
|
response.#state = newState;
|
|
22878
22877
|
}
|
|
22879
22878
|
};
|
|
22880
|
-
var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } =
|
|
22881
|
-
Reflect.deleteProperty(
|
|
22882
|
-
Reflect.deleteProperty(
|
|
22883
|
-
Reflect.deleteProperty(
|
|
22884
|
-
Reflect.deleteProperty(
|
|
22885
|
-
mixinBody(
|
|
22886
|
-
Object.defineProperties(
|
|
22879
|
+
var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response12;
|
|
22880
|
+
Reflect.deleteProperty(Response12, "getResponseHeaders");
|
|
22881
|
+
Reflect.deleteProperty(Response12, "setResponseHeaders");
|
|
22882
|
+
Reflect.deleteProperty(Response12, "getResponseState");
|
|
22883
|
+
Reflect.deleteProperty(Response12, "setResponseState");
|
|
22884
|
+
mixinBody(Response12, getResponseState);
|
|
22885
|
+
Object.defineProperties(Response12.prototype, {
|
|
22887
22886
|
type: kEnumerableProperty,
|
|
22888
22887
|
url: kEnumerableProperty,
|
|
22889
22888
|
status: kEnumerableProperty,
|
|
@@ -22899,7 +22898,7 @@ var require_response = __commonJS({
|
|
|
22899
22898
|
configurable: true
|
|
22900
22899
|
}
|
|
22901
22900
|
});
|
|
22902
|
-
Object.defineProperties(
|
|
22901
|
+
Object.defineProperties(Response12, {
|
|
22903
22902
|
json: kEnumerableProperty,
|
|
22904
22903
|
redirect: kEnumerableProperty,
|
|
22905
22904
|
error: kEnumerableProperty
|
|
@@ -22963,7 +22962,7 @@ var require_response = __commonJS({
|
|
|
22963
22962
|
return p7 in state3 ? state3[p7] : target[p7];
|
|
22964
22963
|
},
|
|
22965
22964
|
set(target, p7, value) {
|
|
22966
|
-
|
|
22965
|
+
assert64(!(p7 in state3));
|
|
22967
22966
|
target[p7] = value;
|
|
22968
22967
|
return true;
|
|
22969
22968
|
}
|
|
@@ -22998,12 +22997,12 @@ var require_response = __commonJS({
|
|
|
22998
22997
|
body: null
|
|
22999
22998
|
});
|
|
23000
22999
|
} else {
|
|
23001
|
-
|
|
23000
|
+
assert64(false);
|
|
23002
23001
|
}
|
|
23003
23002
|
}
|
|
23004
23003
|
__name(filterResponse, "filterResponse");
|
|
23005
23004
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
|
23006
|
-
|
|
23005
|
+
assert64(isCancelled(fetchParams));
|
|
23007
23006
|
return isAborted3(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
|
|
23008
23007
|
}
|
|
23009
23008
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
|
@@ -23040,9 +23039,9 @@ var require_response = __commonJS({
|
|
|
23040
23039
|
}
|
|
23041
23040
|
__name(initializeResponse, "initializeResponse");
|
|
23042
23041
|
function fromInnerResponse(innerResponse, guard) {
|
|
23043
|
-
const response = new
|
|
23042
|
+
const response = new Response12(kConstruct);
|
|
23044
23043
|
setResponseState(response, innerResponse);
|
|
23045
|
-
const headers = new
|
|
23044
|
+
const headers = new Headers6(kConstruct);
|
|
23046
23045
|
setResponseHeaders(response, headers);
|
|
23047
23046
|
setHeadersList(headers, innerResponse.headersList);
|
|
23048
23047
|
setHeadersGuard(headers, guard);
|
|
@@ -23095,14 +23094,14 @@ var require_response = __commonJS({
|
|
|
23095
23094
|
converter: webidl.converters.HeadersInit
|
|
23096
23095
|
}
|
|
23097
23096
|
]);
|
|
23098
|
-
webidl.is.Response = webidl.util.MakeTypeAssertion(
|
|
23097
|
+
webidl.is.Response = webidl.util.MakeTypeAssertion(Response12);
|
|
23099
23098
|
module2.exports = {
|
|
23100
23099
|
isNetworkError,
|
|
23101
23100
|
makeNetworkError,
|
|
23102
23101
|
makeResponse,
|
|
23103
23102
|
makeAppropriateNetworkError,
|
|
23104
23103
|
filterResponse,
|
|
23105
|
-
Response:
|
|
23104
|
+
Response: Response12,
|
|
23106
23105
|
cloneResponse,
|
|
23107
23106
|
fromInnerResponse,
|
|
23108
23107
|
getResponseState
|
|
@@ -23115,7 +23114,7 @@ var require_request2 = __commonJS({
|
|
|
23115
23114
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js"(exports, module2) {
|
|
23116
23115
|
init_import_meta_url();
|
|
23117
23116
|
var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body();
|
|
23118
|
-
var { Headers:
|
|
23117
|
+
var { Headers: Headers6, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers();
|
|
23119
23118
|
var util4 = require_util();
|
|
23120
23119
|
var nodeUtil = __require("util");
|
|
23121
23120
|
var {
|
|
@@ -23137,7 +23136,7 @@ var require_request2 = __commonJS({
|
|
|
23137
23136
|
var { webidl } = require_webidl();
|
|
23138
23137
|
var { URLSerializer } = require_data_url();
|
|
23139
23138
|
var { kConstruct } = require_symbols();
|
|
23140
|
-
var
|
|
23139
|
+
var assert64 = __require("assert");
|
|
23141
23140
|
var { getMaxListeners, setMaxListeners, defaultMaxListeners } = __require("events");
|
|
23142
23141
|
var kAbortController = Symbol("abortController");
|
|
23143
23142
|
var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
|
|
@@ -23217,7 +23216,7 @@ var require_request2 = __commonJS({
|
|
|
23217
23216
|
request4 = makeRequest({ urlList: [parsedURL] });
|
|
23218
23217
|
fallbackMode = "cors";
|
|
23219
23218
|
} else {
|
|
23220
|
-
|
|
23219
|
+
assert64(webidl.is.Request(input));
|
|
23221
23220
|
request4 = input.#state;
|
|
23222
23221
|
signal = input.#signal;
|
|
23223
23222
|
this.#dispatcher = init4.dispatcher || input.#dispatcher;
|
|
@@ -23388,7 +23387,7 @@ var require_request2 = __commonJS({
|
|
|
23388
23387
|
requestFinalizer.register(ac2, { signal, abort }, abort);
|
|
23389
23388
|
}
|
|
23390
23389
|
}
|
|
23391
|
-
this.#headers = new
|
|
23390
|
+
this.#headers = new Headers6(kConstruct);
|
|
23392
23391
|
setHeadersList(this.#headers, request4.headersList);
|
|
23393
23392
|
setHeadersGuard(this.#headers, "request");
|
|
23394
23393
|
if (mode === "no-cors") {
|
|
@@ -23731,7 +23730,7 @@ var require_request2 = __commonJS({
|
|
|
23731
23730
|
setRequestState(request4, innerRequest);
|
|
23732
23731
|
setRequestDispatcher(request4, dispatcher);
|
|
23733
23732
|
setRequestSignal(request4, signal);
|
|
23734
|
-
const headers = new
|
|
23733
|
+
const headers = new Headers6(kConstruct);
|
|
23735
23734
|
setRequestHeaders(request4, headers);
|
|
23736
23735
|
setHeadersList(headers, innerRequest.headersList);
|
|
23737
23736
|
setHeadersGuard(headers, guard);
|
|
@@ -23877,7 +23876,7 @@ var require_request2 = __commonJS({
|
|
|
23877
23876
|
var require_subresource_integrity = __commonJS({
|
|
23878
23877
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js"(exports, module2) {
|
|
23879
23878
|
init_import_meta_url();
|
|
23880
|
-
var
|
|
23879
|
+
var assert64 = __require("assert");
|
|
23881
23880
|
var { runtimeFeatures } = require_runtime_features();
|
|
23882
23881
|
var validSRIHashAlgorithmTokenSet = /* @__PURE__ */ new Map([["sha256", 0], ["sha384", 1], ["sha512", 2]]);
|
|
23883
23882
|
var crypto9;
|
|
@@ -23925,7 +23924,7 @@ var require_subresource_integrity = __commonJS({
|
|
|
23925
23924
|
const result = [];
|
|
23926
23925
|
let strongest = null;
|
|
23927
23926
|
for (const item of metadataList) {
|
|
23928
|
-
|
|
23927
|
+
assert64(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token");
|
|
23929
23928
|
if (result.length === 0) {
|
|
23930
23929
|
result.push(item);
|
|
23931
23930
|
strongest = item;
|
|
@@ -24064,7 +24063,7 @@ var require_fetch = __commonJS({
|
|
|
24064
24063
|
includesCredentials,
|
|
24065
24064
|
isTraversableNavigable
|
|
24066
24065
|
} = require_util2();
|
|
24067
|
-
var
|
|
24066
|
+
var assert64 = __require("assert");
|
|
24068
24067
|
var { safelyExtractBody, extractBody } = require_body();
|
|
24069
24068
|
var {
|
|
24070
24069
|
redirectStatusSet,
|
|
@@ -24151,7 +24150,7 @@ var require_fetch = __commonJS({
|
|
|
24151
24150
|
requestObject.signal,
|
|
24152
24151
|
() => {
|
|
24153
24152
|
locallyAborted = true;
|
|
24154
|
-
|
|
24153
|
+
assert64(controller != null);
|
|
24155
24154
|
controller.abort(requestObject.signal.reason);
|
|
24156
24155
|
const realResponse = responseObject?.deref();
|
|
24157
24156
|
abortFetch(p7, request4, realResponse, requestObject.signal.reason, controller.controller);
|
|
@@ -24257,7 +24256,7 @@ var require_fetch = __commonJS({
|
|
|
24257
24256
|
requestObject = null
|
|
24258
24257
|
// Keep alive to prevent AbortController GC, see #4627
|
|
24259
24258
|
}) {
|
|
24260
|
-
|
|
24259
|
+
assert64(dispatcher);
|
|
24261
24260
|
let taskDestination = null;
|
|
24262
24261
|
let crossOriginIsolatedCapability = false;
|
|
24263
24262
|
if (request4.client != null) {
|
|
@@ -24282,7 +24281,7 @@ var require_fetch = __commonJS({
|
|
|
24282
24281
|
// Keep requestObject alive to prevent its AbortController from being GC'd
|
|
24283
24282
|
requestObject
|
|
24284
24283
|
};
|
|
24285
|
-
|
|
24284
|
+
assert64(!request4.body || request4.body.stream);
|
|
24286
24285
|
if (request4.window === "client") {
|
|
24287
24286
|
request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
|
|
24288
24287
|
}
|
|
@@ -24370,7 +24369,7 @@ var require_fetch = __commonJS({
|
|
|
24370
24369
|
} else if (request4.responseTainting === "opaque") {
|
|
24371
24370
|
response = filterResponse(response, "opaque");
|
|
24372
24371
|
} else {
|
|
24373
|
-
|
|
24372
|
+
assert64(false);
|
|
24374
24373
|
}
|
|
24375
24374
|
}
|
|
24376
24375
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
|
@@ -24603,7 +24602,7 @@ var require_fetch = __commonJS({
|
|
|
24603
24602
|
} else if (request4.redirect === "follow") {
|
|
24604
24603
|
response = await httpRedirectFetch(fetchParams, response);
|
|
24605
24604
|
} else {
|
|
24606
|
-
|
|
24605
|
+
assert64(false);
|
|
24607
24606
|
}
|
|
24608
24607
|
}
|
|
24609
24608
|
response.timingInfo = timingInfo;
|
|
@@ -24657,7 +24656,7 @@ var require_fetch = __commonJS({
|
|
|
24657
24656
|
request4.headersList.delete("host", true);
|
|
24658
24657
|
}
|
|
24659
24658
|
if (request4.body != null) {
|
|
24660
|
-
|
|
24659
|
+
assert64(request4.body.source != null);
|
|
24661
24660
|
request4.body = safelyExtractBody(request4.body.source)[0];
|
|
24662
24661
|
}
|
|
24663
24662
|
const timingInfo = fetchParams.timingInfo;
|
|
@@ -24809,7 +24808,7 @@ var require_fetch = __commonJS({
|
|
|
24809
24808
|
}
|
|
24810
24809
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
|
24811
24810
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
|
24812
|
-
|
|
24811
|
+
assert64(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
|
24813
24812
|
fetchParams.controller.connection = {
|
|
24814
24813
|
abort: null,
|
|
24815
24814
|
destroyed: false,
|
|
@@ -25163,7 +25162,7 @@ var require_fetch = __commonJS({
|
|
|
25163
25162
|
var require_util3 = __commonJS({
|
|
25164
25163
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/cache/util.js"(exports, module2) {
|
|
25165
25164
|
init_import_meta_url();
|
|
25166
|
-
var
|
|
25165
|
+
var assert64 = __require("assert");
|
|
25167
25166
|
var { URLSerializer } = require_data_url();
|
|
25168
25167
|
var { isValidHeaderName } = require_util2();
|
|
25169
25168
|
function urlEquals(A5, B4, excludeFragment = false) {
|
|
@@ -25173,7 +25172,7 @@ var require_util3 = __commonJS({
|
|
|
25173
25172
|
}
|
|
25174
25173
|
__name(urlEquals, "urlEquals");
|
|
25175
25174
|
function getFieldValues(header) {
|
|
25176
|
-
|
|
25175
|
+
assert64(header !== null);
|
|
25177
25176
|
const values = [];
|
|
25178
25177
|
for (let value of header.split(",")) {
|
|
25179
25178
|
value = value.trim();
|
|
@@ -25195,7 +25194,7 @@ var require_util3 = __commonJS({
|
|
|
25195
25194
|
var require_cache3 = __commonJS({
|
|
25196
25195
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/cache/cache.js"(exports, module2) {
|
|
25197
25196
|
init_import_meta_url();
|
|
25198
|
-
var
|
|
25197
|
+
var assert64 = __require("assert");
|
|
25199
25198
|
var { kConstruct } = require_symbols();
|
|
25200
25199
|
var { urlEquals, getFieldValues } = require_util3();
|
|
25201
25200
|
var { kEnumerableProperty, isDisturbed } = require_util();
|
|
@@ -25448,7 +25447,7 @@ var require_cache3 = __commonJS({
|
|
|
25448
25447
|
return false;
|
|
25449
25448
|
}
|
|
25450
25449
|
} else {
|
|
25451
|
-
|
|
25450
|
+
assert64(typeof request4 === "string");
|
|
25452
25451
|
r8 = getRequestState(new Request7(request4));
|
|
25453
25452
|
}
|
|
25454
25453
|
const operations = [];
|
|
@@ -25559,7 +25558,7 @@ var require_cache3 = __commonJS({
|
|
|
25559
25558
|
}
|
|
25560
25559
|
for (const requestResponse of requestResponses) {
|
|
25561
25560
|
const idx = cache5.indexOf(requestResponse);
|
|
25562
|
-
|
|
25561
|
+
assert64(idx !== -1);
|
|
25563
25562
|
cache5.splice(idx, 1);
|
|
25564
25563
|
}
|
|
25565
25564
|
} else if (operation.type === "put") {
|
|
@@ -25591,7 +25590,7 @@ var require_cache3 = __commonJS({
|
|
|
25591
25590
|
requestResponses = this.#queryCache(operation.request);
|
|
25592
25591
|
for (const requestResponse of requestResponses) {
|
|
25593
25592
|
const idx = cache5.indexOf(requestResponse);
|
|
25594
|
-
|
|
25593
|
+
assert64(idx !== -1);
|
|
25595
25594
|
cache5.splice(idx, 1);
|
|
25596
25595
|
}
|
|
25597
25596
|
cache5.push([operation.request, operation.response]);
|
|
@@ -26054,7 +26053,7 @@ var require_parse = __commonJS({
|
|
|
26054
26053
|
var { collectASequenceOfCodePointsFast } = require_infra();
|
|
26055
26054
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
|
|
26056
26055
|
var { isCTLExcludingHtab } = require_util4();
|
|
26057
|
-
var
|
|
26056
|
+
var assert64 = __require("assert");
|
|
26058
26057
|
var { unescape: qsUnescape } = __require("querystring");
|
|
26059
26058
|
function parseSetCookie(header) {
|
|
26060
26059
|
if (isCTLExcludingHtab(header)) {
|
|
@@ -26098,7 +26097,7 @@ var require_parse = __commonJS({
|
|
|
26098
26097
|
if (unparsedAttributes.length === 0) {
|
|
26099
26098
|
return cookieAttributeList;
|
|
26100
26099
|
}
|
|
26101
|
-
|
|
26100
|
+
assert64(unparsedAttributes[0] === ";");
|
|
26102
26101
|
unparsedAttributes = unparsedAttributes.slice(1);
|
|
26103
26102
|
let cookieAv = "";
|
|
26104
26103
|
if (unparsedAttributes.includes(";")) {
|
|
@@ -26197,8 +26196,8 @@ var require_cookies = __commonJS({
|
|
|
26197
26196
|
var { parseSetCookie } = require_parse();
|
|
26198
26197
|
var { stringify: stringify4 } = require_util4();
|
|
26199
26198
|
var { webidl } = require_webidl();
|
|
26200
|
-
var { Headers:
|
|
26201
|
-
var brandChecks = webidl.brandCheckMultiple([
|
|
26199
|
+
var { Headers: Headers6 } = require_headers();
|
|
26200
|
+
var brandChecks = webidl.brandCheckMultiple([Headers6, globalThis.Headers].filter(Boolean));
|
|
26202
26201
|
function getCookies(headers) {
|
|
26203
26202
|
webidl.argumentLengthCheck(arguments, 1, "getCookies");
|
|
26204
26203
|
brandChecks(headers);
|
|
@@ -26974,10 +26973,10 @@ var require_connection = __commonJS({
|
|
|
26974
26973
|
var { parseExtensions, isClosed, isClosing, isEstablished, isConnecting, validateCloseCodeAndReason } = require_util5();
|
|
26975
26974
|
var { makeRequest } = require_request2();
|
|
26976
26975
|
var { fetching } = require_fetch();
|
|
26977
|
-
var { Headers:
|
|
26976
|
+
var { Headers: Headers6, getHeadersList } = require_headers();
|
|
26978
26977
|
var { getDecodeSplit } = require_util2();
|
|
26979
26978
|
var { WebsocketFrameSend } = require_frame();
|
|
26980
|
-
var
|
|
26979
|
+
var assert64 = __require("assert");
|
|
26981
26980
|
var { runtimeFeatures } = require_runtime_features();
|
|
26982
26981
|
var crypto9 = runtimeFeatures.has("crypto") ? __require("crypto") : null;
|
|
26983
26982
|
var warningEmitted2 = false;
|
|
@@ -26996,7 +26995,7 @@ var require_connection = __commonJS({
|
|
|
26996
26995
|
useURLCredentials: true
|
|
26997
26996
|
});
|
|
26998
26997
|
if (options.headers) {
|
|
26999
|
-
const headersList = getHeadersList(new
|
|
26998
|
+
const headersList = getHeadersList(new Headers6(options.headers));
|
|
27000
26999
|
request4.headersList = headersList;
|
|
27001
27000
|
}
|
|
27002
27001
|
const keyValue = crypto9.randomBytes(16).toString("base64");
|
|
@@ -27083,7 +27082,7 @@ var require_connection = __commonJS({
|
|
|
27083
27082
|
if (reason.length !== 0 && code === null) {
|
|
27084
27083
|
code = 1e3;
|
|
27085
27084
|
}
|
|
27086
|
-
|
|
27085
|
+
assert64(code === null || Number.isInteger(code));
|
|
27087
27086
|
if (code === null && reason.length === 0) {
|
|
27088
27087
|
frame.frameData = emptyBuffer;
|
|
27089
27088
|
} else if (code !== null && reason === null) {
|
|
@@ -27225,7 +27224,7 @@ var require_receiver = __commonJS({
|
|
|
27225
27224
|
"../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/websocket/receiver.js"(exports, module2) {
|
|
27226
27225
|
init_import_meta_url();
|
|
27227
27226
|
var { Writable: Writable6 } = __require("stream");
|
|
27228
|
-
var
|
|
27227
|
+
var assert64 = __require("assert");
|
|
27229
27228
|
var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
|
|
27230
27229
|
var {
|
|
27231
27230
|
isValidStatusCode,
|
|
@@ -27471,7 +27470,7 @@ var require_receiver = __commonJS({
|
|
|
27471
27470
|
return output;
|
|
27472
27471
|
}
|
|
27473
27472
|
parseCloseBody(data) {
|
|
27474
|
-
|
|
27473
|
+
assert64(data.length !== 1);
|
|
27475
27474
|
let code;
|
|
27476
27475
|
if (data.length >= 2) {
|
|
27477
27476
|
code = data.readUInt16BE(0);
|
|
@@ -29678,7 +29677,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
|
|
|
29678
29677
|
);
|
|
29679
29678
|
}
|
|
29680
29679
|
const envName = args.env ?? getCloudflareEnv();
|
|
29681
|
-
|
|
29680
|
+
assert55__default.default(envName === void 0 || typeof envName === "string");
|
|
29682
29681
|
let activeEnv = topLevelEnv;
|
|
29683
29682
|
if (envName) {
|
|
29684
29683
|
if (isRedirectedConfig2) {
|
|
@@ -29883,7 +29882,7 @@ function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
|
|
|
29883
29882
|
}
|
|
29884
29883
|
}
|
|
29885
29884
|
function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
29886
|
-
|
|
29885
|
+
assert55__default.default(typeof args === "object" && args !== null && !Array.isArray(args));
|
|
29887
29886
|
const {
|
|
29888
29887
|
localProtocol: localProtocolArg,
|
|
29889
29888
|
upstreamProtocol: upstreamProtocolArg,
|
|
@@ -29891,17 +29890,17 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
|
29891
29890
|
enableContainers: enableContainersArg,
|
|
29892
29891
|
generateTypes: generateTypesArg
|
|
29893
29892
|
} = args;
|
|
29894
|
-
|
|
29893
|
+
assert55__default.default(
|
|
29895
29894
|
localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
|
|
29896
29895
|
);
|
|
29897
|
-
|
|
29896
|
+
assert55__default.default(
|
|
29898
29897
|
upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https"
|
|
29899
29898
|
);
|
|
29900
|
-
|
|
29901
|
-
|
|
29899
|
+
assert55__default.default(remoteArg === void 0 || typeof remoteArg === "boolean");
|
|
29900
|
+
assert55__default.default(
|
|
29902
29901
|
enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
|
|
29903
29902
|
);
|
|
29904
|
-
|
|
29903
|
+
assert55__default.default(
|
|
29905
29904
|
generateTypesArg === void 0 || typeof generateTypesArg === "boolean"
|
|
29906
29905
|
);
|
|
29907
29906
|
const {
|
|
@@ -32379,7 +32378,7 @@ function startTunnel(options) {
|
|
|
32379
32378
|
return;
|
|
32380
32379
|
}
|
|
32381
32380
|
logger4?.log(
|
|
32382
|
-
`${publicURL ? `
|
|
32381
|
+
`${publicURL ? `Tunnel still open, expires in ${formatTunnelDuration(remainingMs)}: ${publicURL}` : `The tunnel is still open. It expires in ${formatTunnelDuration(remainingMs)}.`}${options.extendHint ? ` ${options.extendHint}` : ""}`
|
|
32383
32382
|
);
|
|
32384
32383
|
}, reminderIntervalMs);
|
|
32385
32384
|
reminderInterval.unref?.();
|
|
@@ -32529,13 +32528,328 @@ function createTunnelStartupError(message, stderrOutput, origin) {
|
|
|
32529
32528
|
cloudflared output:
|
|
32530
32529
|
${stderrOutput || "(no output)"}
|
|
32531
32530
|
|
|
32532
|
-
The local dev server started at ${origin.href}
|
|
32531
|
+
The local dev server started at ${origin.href}
|
|
32533
32532
|
` + (isQuickTunnelRateLimited ? "Cloudflare Quick Tunnel creation was rate limited. Try again in a few minutes, or use a named tunnel if you need more reliable access." : `Check the cloudflared output above for more details, and verify that ${origin.href} is reachable from this machine if this keeps happening.`);
|
|
32534
32533
|
if (isQuickTunnelRateLimited) {
|
|
32535
32534
|
return new UserError(errorMessage, { telemetryMessage: false });
|
|
32536
32535
|
}
|
|
32537
32536
|
return new Error(errorMessage);
|
|
32538
32537
|
}
|
|
32538
|
+
function buildDetailedError(message, ...extra) {
|
|
32539
|
+
return new ParseError({
|
|
32540
|
+
text: message,
|
|
32541
|
+
notes: extra.map((text) => ({ text })),
|
|
32542
|
+
telemetryMessage: false
|
|
32543
|
+
});
|
|
32544
|
+
}
|
|
32545
|
+
function maybeThrowFriendlyError(error3) {
|
|
32546
|
+
if (error3.message === "workers.api.error.email_verification_required") {
|
|
32547
|
+
throw buildDetailedError(
|
|
32548
|
+
"Please verify your account's email address and try again.",
|
|
32549
|
+
"Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one."
|
|
32550
|
+
);
|
|
32551
|
+
}
|
|
32552
|
+
}
|
|
32553
|
+
function logHeaders(headers, logger4) {
|
|
32554
|
+
const clone2 = cloneHeaders(headers);
|
|
32555
|
+
clone2.delete("Authorization");
|
|
32556
|
+
logger4.debugWithSanitization(
|
|
32557
|
+
"HEADERS:",
|
|
32558
|
+
JSON.stringify(Object.fromEntries(clone2), null, 2)
|
|
32559
|
+
);
|
|
32560
|
+
}
|
|
32561
|
+
async function performApiFetchBase(complianceConfig, resource, init4 = {}, userAgent, logger4, queryParams, abortSignal, credentials) {
|
|
32562
|
+
assert55__default.default(credentials, "credentials are required for performApiFetch");
|
|
32563
|
+
const method = init4.method ?? "GET";
|
|
32564
|
+
assert55__default.default(
|
|
32565
|
+
resource.startsWith("/"),
|
|
32566
|
+
`CF API fetch - resource path must start with a "/" but got "${resource}"`
|
|
32567
|
+
);
|
|
32568
|
+
const headers = cloneHeaders(new import_undici.Headers(init4.headers));
|
|
32569
|
+
addAuthorizationHeader(headers, credentials);
|
|
32570
|
+
headers.set("User-Agent", userAgent);
|
|
32571
|
+
maybeAddTraceHeader(headers);
|
|
32572
|
+
const queryString = queryParams ? `?${queryParams.toString()}` : "";
|
|
32573
|
+
logger4.debug(
|
|
32574
|
+
`-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`
|
|
32575
|
+
);
|
|
32576
|
+
logger4.debugWithSanitization("QUERY STRING:", queryString);
|
|
32577
|
+
logHeaders(headers, logger4);
|
|
32578
|
+
logger4.debugWithSanitization("INIT:", JSON.stringify({ ...init4 }, null, 2));
|
|
32579
|
+
if (init4.body instanceof import_undici.FormData) {
|
|
32580
|
+
logger4.debugWithSanitization(
|
|
32581
|
+
"BODY:",
|
|
32582
|
+
await new import_undici.Response(init4.body).text(),
|
|
32583
|
+
null,
|
|
32584
|
+
2
|
|
32585
|
+
);
|
|
32586
|
+
}
|
|
32587
|
+
logger4.debug("-- END CF API REQUEST");
|
|
32588
|
+
return await (0, import_undici.fetch)(
|
|
32589
|
+
`${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`,
|
|
32590
|
+
{
|
|
32591
|
+
method,
|
|
32592
|
+
...init4,
|
|
32593
|
+
headers,
|
|
32594
|
+
signal: abortSignal
|
|
32595
|
+
}
|
|
32596
|
+
);
|
|
32597
|
+
}
|
|
32598
|
+
async function fetchInternalBase(complianceConfig, resource, init4 = {}, userAgent, logger4, queryParams, abortSignal, credentials) {
|
|
32599
|
+
const method = init4.method ?? "GET";
|
|
32600
|
+
const response = await performApiFetchBase(
|
|
32601
|
+
complianceConfig,
|
|
32602
|
+
resource,
|
|
32603
|
+
init4,
|
|
32604
|
+
userAgent,
|
|
32605
|
+
logger4,
|
|
32606
|
+
queryParams,
|
|
32607
|
+
abortSignal,
|
|
32608
|
+
credentials
|
|
32609
|
+
);
|
|
32610
|
+
const jsonText = await response.text();
|
|
32611
|
+
logger4.debug(
|
|
32612
|
+
"-- START CF API RESPONSE:",
|
|
32613
|
+
response.statusText,
|
|
32614
|
+
response.status
|
|
32615
|
+
);
|
|
32616
|
+
logHeaders(response.headers, logger4);
|
|
32617
|
+
logger4.debugWithSanitization("RESPONSE:", jsonText);
|
|
32618
|
+
logger4.debug("-- END CF API RESPONSE");
|
|
32619
|
+
if (!jsonText && (response.status === 204 || response.status === 205)) {
|
|
32620
|
+
return {
|
|
32621
|
+
response: {
|
|
32622
|
+
result: {},
|
|
32623
|
+
success: true,
|
|
32624
|
+
errors: [],
|
|
32625
|
+
messages: []
|
|
32626
|
+
},
|
|
32627
|
+
status: response.status
|
|
32628
|
+
};
|
|
32629
|
+
}
|
|
32630
|
+
if (isWAFBlockResponse(response.headers)) {
|
|
32631
|
+
throwWAFBlockError(
|
|
32632
|
+
response.headers,
|
|
32633
|
+
method,
|
|
32634
|
+
resource,
|
|
32635
|
+
response.status,
|
|
32636
|
+
response.statusText
|
|
32637
|
+
);
|
|
32638
|
+
}
|
|
32639
|
+
try {
|
|
32640
|
+
const json = parseJSON(jsonText);
|
|
32641
|
+
return { response: json, status: response.status };
|
|
32642
|
+
} catch {
|
|
32643
|
+
const rayId = extractWAFBlockRayId(response.headers);
|
|
32644
|
+
throw new APIError({
|
|
32645
|
+
text: "Received a malformed response from the API",
|
|
32646
|
+
notes: [
|
|
32647
|
+
{
|
|
32648
|
+
text: truncate(jsonText, 100)
|
|
32649
|
+
},
|
|
32650
|
+
{
|
|
32651
|
+
text: `${method} ${resource} -> ${response.status} ${response.statusText}`
|
|
32652
|
+
},
|
|
32653
|
+
...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : []
|
|
32654
|
+
],
|
|
32655
|
+
status: response.status,
|
|
32656
|
+
telemetryMessage: false
|
|
32657
|
+
});
|
|
32658
|
+
}
|
|
32659
|
+
}
|
|
32660
|
+
async function fetchResultBase(complianceConfig, resource, init4 = {}, userAgent, logger4, queryParams, abortSignal, credentials) {
|
|
32661
|
+
const { response: json, status: status2 } = await fetchInternalBase(
|
|
32662
|
+
complianceConfig,
|
|
32663
|
+
resource,
|
|
32664
|
+
init4,
|
|
32665
|
+
userAgent,
|
|
32666
|
+
logger4,
|
|
32667
|
+
queryParams,
|
|
32668
|
+
abortSignal,
|
|
32669
|
+
credentials
|
|
32670
|
+
);
|
|
32671
|
+
if (json.success) {
|
|
32672
|
+
return json.result;
|
|
32673
|
+
} else {
|
|
32674
|
+
throwFetchError(resource, json, status2);
|
|
32675
|
+
}
|
|
32676
|
+
}
|
|
32677
|
+
async function fetchListResultBase(complianceConfig, resource, init4 = {}, userAgent, logger4, queryParams, credentials) {
|
|
32678
|
+
const results = [];
|
|
32679
|
+
let getMoreResults = true;
|
|
32680
|
+
let cursor;
|
|
32681
|
+
while (getMoreResults) {
|
|
32682
|
+
if (cursor) {
|
|
32683
|
+
queryParams = new Url.URLSearchParams(queryParams);
|
|
32684
|
+
queryParams.set("cursor", cursor);
|
|
32685
|
+
}
|
|
32686
|
+
const { response: json, status: status2 } = await fetchInternalBase(
|
|
32687
|
+
complianceConfig,
|
|
32688
|
+
resource,
|
|
32689
|
+
init4,
|
|
32690
|
+
userAgent,
|
|
32691
|
+
logger4,
|
|
32692
|
+
queryParams,
|
|
32693
|
+
void 0,
|
|
32694
|
+
credentials
|
|
32695
|
+
);
|
|
32696
|
+
if (json.success) {
|
|
32697
|
+
results.push(...json.result);
|
|
32698
|
+
if (hasCursor(json.result_info)) {
|
|
32699
|
+
cursor = json.result_info?.cursor;
|
|
32700
|
+
} else {
|
|
32701
|
+
getMoreResults = false;
|
|
32702
|
+
}
|
|
32703
|
+
} else {
|
|
32704
|
+
throwFetchError(resource, json, status2);
|
|
32705
|
+
}
|
|
32706
|
+
}
|
|
32707
|
+
return results;
|
|
32708
|
+
}
|
|
32709
|
+
function truncate(text, maxLength) {
|
|
32710
|
+
const { length } = text;
|
|
32711
|
+
if (length <= maxLength) {
|
|
32712
|
+
return text;
|
|
32713
|
+
}
|
|
32714
|
+
return `${text.substring(0, maxLength)}... (length = ${length})`;
|
|
32715
|
+
}
|
|
32716
|
+
function isWAFBlockResponse(headers) {
|
|
32717
|
+
return headers.get("cf-mitigated") === "challenge";
|
|
32718
|
+
}
|
|
32719
|
+
function extractWAFBlockRayId(headers) {
|
|
32720
|
+
return headers.get("cf-ray") ?? void 0;
|
|
32721
|
+
}
|
|
32722
|
+
function extractAccountTag(resource) {
|
|
32723
|
+
const re2 = new RegExp("/accounts/([a-zA-Z0-9]+)/?");
|
|
32724
|
+
const matches = re2.exec(resource);
|
|
32725
|
+
return matches?.[1];
|
|
32726
|
+
}
|
|
32727
|
+
function hasMorePages(result_info) {
|
|
32728
|
+
const page = result_info?.page;
|
|
32729
|
+
const per_page = result_info?.per_page;
|
|
32730
|
+
const total = result_info?.total_count;
|
|
32731
|
+
return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total;
|
|
32732
|
+
}
|
|
32733
|
+
function renderError(err, level = 0) {
|
|
32734
|
+
const indent = " ".repeat(level);
|
|
32735
|
+
const message = err.message ?? "";
|
|
32736
|
+
const chainedMessages = "error_chain" in err ? err.error_chain?.map(
|
|
32737
|
+
(chainedError) => `
|
|
32738
|
+
|
|
32739
|
+
${indent}- ${renderError(chainedError, level + 1)}`
|
|
32740
|
+
).join("\n") ?? "" : "";
|
|
32741
|
+
return (err.code ? `${message} [code: ${err.code}]` : message) + (err.documentation_url ? `
|
|
32742
|
+
${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
|
|
32743
|
+
}
|
|
32744
|
+
function addAuthorizationHeader(headers, auth, overrideExisting = false) {
|
|
32745
|
+
if (!headers.has("Authorization") || overrideExisting) {
|
|
32746
|
+
if ("apiToken" in auth) {
|
|
32747
|
+
const authorizationHeader = `Bearer ${auth.apiToken}`;
|
|
32748
|
+
validateAuthorizationHeaderValue(authorizationHeader);
|
|
32749
|
+
headers.set("Authorization", authorizationHeader);
|
|
32750
|
+
} else {
|
|
32751
|
+
headers.set("X-Auth-Key", auth.authKey);
|
|
32752
|
+
headers.set("X-Auth-Email", auth.authEmail);
|
|
32753
|
+
}
|
|
32754
|
+
}
|
|
32755
|
+
}
|
|
32756
|
+
function validateAuthorizationHeaderValue(value) {
|
|
32757
|
+
for (const character of value) {
|
|
32758
|
+
const codePoint = character.codePointAt(0);
|
|
32759
|
+
if (codePoint === void 0 || codePoint > 255) {
|
|
32760
|
+
throw new UserError(
|
|
32761
|
+
`The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${formatAuthorizationHeaderCharacter(character, codePoint)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`,
|
|
32762
|
+
{
|
|
32763
|
+
telemetryMessage: "cfetch auth invalid authorization header"
|
|
32764
|
+
}
|
|
32765
|
+
);
|
|
32766
|
+
}
|
|
32767
|
+
}
|
|
32768
|
+
}
|
|
32769
|
+
function formatAuthorizationHeaderCharacter(character, codePoint) {
|
|
32770
|
+
if (codePoint === void 0) {
|
|
32771
|
+
return '"\\u{unknown}"';
|
|
32772
|
+
}
|
|
32773
|
+
const codePointLabel = `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")}`;
|
|
32774
|
+
const characterLabel = isPrintableCharacter(character) ? `"${character}"` : `"${escapeCharacter(character)}"`;
|
|
32775
|
+
return `${characterLabel} (${codePointLabel})`;
|
|
32776
|
+
}
|
|
32777
|
+
function isPrintableCharacter(character) {
|
|
32778
|
+
return !/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(character);
|
|
32779
|
+
}
|
|
32780
|
+
function escapeCharacter(character) {
|
|
32781
|
+
return Array.from(character).map((c8) => {
|
|
32782
|
+
const codePoint = c8.codePointAt(0);
|
|
32783
|
+
if (codePoint === void 0) {
|
|
32784
|
+
return "";
|
|
32785
|
+
}
|
|
32786
|
+
return codePoint <= 65535 ? `\\u${codePoint.toString(16).toUpperCase().padStart(4, "0")}` : `\\u{${codePoint.toString(16).toUpperCase()}}`;
|
|
32787
|
+
}).join("");
|
|
32788
|
+
}
|
|
32789
|
+
function throwFetchError(resource, response, status2) {
|
|
32790
|
+
const errors = response.errors ?? [];
|
|
32791
|
+
for (const error22 of errors) {
|
|
32792
|
+
maybeThrowFriendlyError(error22);
|
|
32793
|
+
}
|
|
32794
|
+
const notes = [
|
|
32795
|
+
...errors.map((err) => ({ text: renderError(err) })),
|
|
32796
|
+
...response.messages?.map((msg) => ({
|
|
32797
|
+
text: typeof msg === "string" ? msg : msg.message ?? String(msg)
|
|
32798
|
+
})) ?? []
|
|
32799
|
+
];
|
|
32800
|
+
if (notes.length === 0) {
|
|
32801
|
+
const raw = response;
|
|
32802
|
+
const fallbackMessage = typeof raw.error === "string" ? `${raw.error}${raw.code ? ` [code: ${raw.code}]` : ""}` : void 0;
|
|
32803
|
+
if (fallbackMessage) {
|
|
32804
|
+
notes.push({ text: fallbackMessage });
|
|
32805
|
+
}
|
|
32806
|
+
}
|
|
32807
|
+
const error3 = new APIError({
|
|
32808
|
+
text: `A request to the Cloudflare API (${resource}) failed.`,
|
|
32809
|
+
notes,
|
|
32810
|
+
status: status2,
|
|
32811
|
+
telemetryMessage: false
|
|
32812
|
+
});
|
|
32813
|
+
const code = errors[0]?.code;
|
|
32814
|
+
if (code) {
|
|
32815
|
+
error3.code = code;
|
|
32816
|
+
}
|
|
32817
|
+
error3.accountTag = extractAccountTag(resource);
|
|
32818
|
+
throw error3;
|
|
32819
|
+
}
|
|
32820
|
+
function throwWAFBlockError(headers, method, resource, status2, statusText) {
|
|
32821
|
+
const rayId = extractWAFBlockRayId(headers);
|
|
32822
|
+
throw new APIError({
|
|
32823
|
+
text: "The Cloudflare API responded with a WAF block page instead of the expected JSON response",
|
|
32824
|
+
notes: [
|
|
32825
|
+
{
|
|
32826
|
+
text: "Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive."
|
|
32827
|
+
},
|
|
32828
|
+
...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : [],
|
|
32829
|
+
{
|
|
32830
|
+
text: rayId ? "If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above." : "If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser."
|
|
32831
|
+
},
|
|
32832
|
+
{
|
|
32833
|
+
text: `${method} ${resource} -> ${status2} ${statusText}`
|
|
32834
|
+
}
|
|
32835
|
+
],
|
|
32836
|
+
status: status2,
|
|
32837
|
+
telemetryMessage: false
|
|
32838
|
+
});
|
|
32839
|
+
}
|
|
32840
|
+
function hasCursor(result_info) {
|
|
32841
|
+
const cursor = result_info?.cursor;
|
|
32842
|
+
return cursor !== void 0 && cursor !== null && cursor !== "";
|
|
32843
|
+
}
|
|
32844
|
+
function maybeAddTraceHeader(headers) {
|
|
32845
|
+
const traceHeader = getTraceHeader();
|
|
32846
|
+
if (traceHeader) {
|
|
32847
|
+
headers.set("Cf-Trace-Id", traceHeader);
|
|
32848
|
+
}
|
|
32849
|
+
}
|
|
32850
|
+
function cloneHeaders(headers) {
|
|
32851
|
+
return new import_undici.Headers(headers);
|
|
32852
|
+
}
|
|
32539
32853
|
async function fetchLatestNpmVersion(name2, version5) {
|
|
32540
32854
|
let result = null;
|
|
32541
32855
|
try {
|
|
@@ -32565,7 +32879,7 @@ var import_undici, require_XDGAppPaths, require_XDG, require_OSPaths, require_no
|
|
|
32565
32879
|
var init_dist = __esm({
|
|
32566
32880
|
"../workers-utils/dist/index.mjs"() {
|
|
32567
32881
|
init_import_meta_url();
|
|
32568
|
-
|
|
32882
|
+
init_chunk_UFU4JGIG();
|
|
32569
32883
|
init_chunk_GMTGAG26();
|
|
32570
32884
|
init_chunk_GMTGAG26();
|
|
32571
32885
|
init_chunk_OZQVB3L3();
|
|
@@ -33132,7 +33446,7 @@ var init_dist = __esm({
|
|
|
33132
33446
|
};
|
|
33133
33447
|
};
|
|
33134
33448
|
} else {
|
|
33135
|
-
|
|
33449
|
+
assert310 = __require2("assert");
|
|
33136
33450
|
signals = require_signals();
|
|
33137
33451
|
isWin = /^win/i.test(process22.platform);
|
|
33138
33452
|
EE = __require2("events");
|
|
@@ -33155,7 +33469,7 @@ var init_dist = __esm({
|
|
|
33155
33469
|
return function() {
|
|
33156
33470
|
};
|
|
33157
33471
|
}
|
|
33158
|
-
|
|
33472
|
+
assert310.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
|
33159
33473
|
if (loaded === false) {
|
|
33160
33474
|
load();
|
|
33161
33475
|
}
|
|
@@ -33261,7 +33575,7 @@ var init_dist = __esm({
|
|
|
33261
33575
|
}
|
|
33262
33576
|
}, "processEmit2"), "processEmit");
|
|
33263
33577
|
}
|
|
33264
|
-
var
|
|
33578
|
+
var assert310;
|
|
33265
33579
|
var signals;
|
|
33266
33580
|
var isWin;
|
|
33267
33581
|
var EE;
|
|
@@ -41826,6 +42140,52 @@ ${resolution}`);
|
|
|
41826
42140
|
__name2(waitForQuickTunnelReady, "waitForQuickTunnelReady");
|
|
41827
42141
|
__name(createTunnelStartupError, "createTunnelStartupError");
|
|
41828
42142
|
__name2(createTunnelStartupError, "createTunnelStartupError");
|
|
42143
|
+
__name(buildDetailedError, "buildDetailedError");
|
|
42144
|
+
__name2(buildDetailedError, "buildDetailedError");
|
|
42145
|
+
__name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
|
|
42146
|
+
__name2(maybeThrowFriendlyError, "maybeThrowFriendlyError");
|
|
42147
|
+
__name(logHeaders, "logHeaders");
|
|
42148
|
+
__name2(logHeaders, "logHeaders");
|
|
42149
|
+
__name(performApiFetchBase, "performApiFetchBase");
|
|
42150
|
+
__name2(performApiFetchBase, "performApiFetchBase");
|
|
42151
|
+
__name(fetchInternalBase, "fetchInternalBase");
|
|
42152
|
+
__name2(fetchInternalBase, "fetchInternalBase");
|
|
42153
|
+
__name(fetchResultBase, "fetchResultBase");
|
|
42154
|
+
__name2(fetchResultBase, "fetchResultBase");
|
|
42155
|
+
__name(fetchListResultBase, "fetchListResultBase");
|
|
42156
|
+
__name2(fetchListResultBase, "fetchListResultBase");
|
|
42157
|
+
__name(truncate, "truncate");
|
|
42158
|
+
__name2(truncate, "truncate");
|
|
42159
|
+
__name(isWAFBlockResponse, "isWAFBlockResponse");
|
|
42160
|
+
__name2(isWAFBlockResponse, "isWAFBlockResponse");
|
|
42161
|
+
__name(extractWAFBlockRayId, "extractWAFBlockRayId");
|
|
42162
|
+
__name2(extractWAFBlockRayId, "extractWAFBlockRayId");
|
|
42163
|
+
__name(extractAccountTag, "extractAccountTag");
|
|
42164
|
+
__name2(extractAccountTag, "extractAccountTag");
|
|
42165
|
+
__name(hasMorePages, "hasMorePages");
|
|
42166
|
+
__name2(hasMorePages, "hasMorePages");
|
|
42167
|
+
__name(renderError, "renderError");
|
|
42168
|
+
__name2(renderError, "renderError");
|
|
42169
|
+
__name(addAuthorizationHeader, "addAuthorizationHeader");
|
|
42170
|
+
__name2(addAuthorizationHeader, "addAuthorizationHeader");
|
|
42171
|
+
__name(validateAuthorizationHeaderValue, "validateAuthorizationHeaderValue");
|
|
42172
|
+
__name2(validateAuthorizationHeaderValue, "validateAuthorizationHeaderValue");
|
|
42173
|
+
__name(formatAuthorizationHeaderCharacter, "formatAuthorizationHeaderCharacter");
|
|
42174
|
+
__name2(formatAuthorizationHeaderCharacter, "formatAuthorizationHeaderCharacter");
|
|
42175
|
+
__name(isPrintableCharacter, "isPrintableCharacter");
|
|
42176
|
+
__name2(isPrintableCharacter, "isPrintableCharacter");
|
|
42177
|
+
__name(escapeCharacter, "escapeCharacter");
|
|
42178
|
+
__name2(escapeCharacter, "escapeCharacter");
|
|
42179
|
+
__name(throwFetchError, "throwFetchError");
|
|
42180
|
+
__name2(throwFetchError, "throwFetchError");
|
|
42181
|
+
__name(throwWAFBlockError, "throwWAFBlockError");
|
|
42182
|
+
__name2(throwWAFBlockError, "throwWAFBlockError");
|
|
42183
|
+
__name(hasCursor, "hasCursor");
|
|
42184
|
+
__name2(hasCursor, "hasCursor");
|
|
42185
|
+
__name(maybeAddTraceHeader, "maybeAddTraceHeader");
|
|
42186
|
+
__name2(maybeAddTraceHeader, "maybeAddTraceHeader");
|
|
42187
|
+
__name(cloneHeaders, "cloneHeaders");
|
|
42188
|
+
__name2(cloneHeaders, "cloneHeaders");
|
|
41829
42189
|
import_update_check = __toESM2(require_update_check());
|
|
41830
42190
|
UPDATE_CHECK_TIMEOUT_MS = 3e3;
|
|
41831
42191
|
TIMED_OUT = Symbol("timed_out");
|
|
@@ -43550,8 +43910,8 @@ var init_esm = __esm({
|
|
|
43550
43910
|
mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules"));
|
|
43551
43911
|
esm_default2 = {
|
|
43552
43912
|
assert: {
|
|
43553
|
-
notStrictEqual:
|
|
43554
|
-
strictEqual:
|
|
43913
|
+
notStrictEqual: assert55.notStrictEqual,
|
|
43914
|
+
strictEqual: assert55.strictEqual
|
|
43555
43915
|
},
|
|
43556
43916
|
cliui: ui,
|
|
43557
43917
|
findUp: sync_default,
|
|
@@ -47178,8 +47538,8 @@ function createDeferred(previousDeferred) {
|
|
|
47178
47538
|
resolve33 = _resolve;
|
|
47179
47539
|
reject = _reject;
|
|
47180
47540
|
});
|
|
47181
|
-
|
|
47182
|
-
|
|
47541
|
+
assert55__default.default(resolve33);
|
|
47542
|
+
assert55__default.default(reject);
|
|
47183
47543
|
previousDeferred?.resolve(newPromise);
|
|
47184
47544
|
return {
|
|
47185
47545
|
promise: newPromise,
|
|
@@ -48334,7 +48694,7 @@ var require_async = __commonJS({
|
|
|
48334
48694
|
var path92 = __require("path");
|
|
48335
48695
|
var caller = require_caller();
|
|
48336
48696
|
var nodeModulesPaths = require_node_modules_paths();
|
|
48337
|
-
var
|
|
48697
|
+
var normalizeOptions2 = require_normalize_options();
|
|
48338
48698
|
var isCore = require_is_core_module();
|
|
48339
48699
|
var realpathFS = process.platform !== "win32" && fs34.realpath && typeof fs34.realpath.native === "function" ? fs34.realpath.native : fs34.realpath;
|
|
48340
48700
|
var homedir3 = getHomedir();
|
|
@@ -48408,7 +48768,7 @@ var require_async = __commonJS({
|
|
|
48408
48768
|
cb2(err);
|
|
48409
48769
|
});
|
|
48410
48770
|
}
|
|
48411
|
-
opts =
|
|
48771
|
+
opts = normalizeOptions2(x6, opts);
|
|
48412
48772
|
var isFile3 = opts.isFile || defaultIsFile;
|
|
48413
48773
|
var isDirectory2 = opts.isDirectory || defaultIsDir;
|
|
48414
48774
|
var readFile20 = opts.readFile || fs34.readFile;
|
|
@@ -48836,7 +49196,7 @@ var require_sync = __commonJS({
|
|
|
48836
49196
|
var getHomedir = require_homedir();
|
|
48837
49197
|
var caller = require_caller();
|
|
48838
49198
|
var nodeModulesPaths = require_node_modules_paths();
|
|
48839
|
-
var
|
|
49199
|
+
var normalizeOptions2 = require_normalize_options();
|
|
48840
49200
|
var realpathFS = process.platform !== "win32" && fs34.realpathSync && typeof fs34.realpathSync.native === "function" ? fs34.realpathSync.native : fs34.realpathSync;
|
|
48841
49201
|
var homedir3 = getHomedir();
|
|
48842
49202
|
var defaultPaths = /* @__PURE__ */ __name(function() {
|
|
@@ -48898,7 +49258,7 @@ var require_sync = __commonJS({
|
|
|
48898
49258
|
if (typeof x6 !== "string") {
|
|
48899
49259
|
throw new TypeError("Path must be a string.");
|
|
48900
49260
|
}
|
|
48901
|
-
var opts =
|
|
49261
|
+
var opts = normalizeOptions2(x6, options);
|
|
48902
49262
|
var isFile3 = opts.isFile || defaultIsFile;
|
|
48903
49263
|
var readFileSync39 = opts.readFileSync || fs34.readFileSync;
|
|
48904
49264
|
var isDirectory2 = opts.isDirectory || defaultIsDir;
|
|
@@ -50978,7 +51338,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
50978
51338
|
};
|
|
50979
51339
|
};
|
|
50980
51340
|
} else {
|
|
50981
|
-
|
|
51341
|
+
assert64 = __require("assert");
|
|
50982
51342
|
signals = require_signals2();
|
|
50983
51343
|
isWin = /^win/i.test(process19.platform);
|
|
50984
51344
|
EE = __require("events");
|
|
@@ -51001,7 +51361,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
51001
51361
|
return function() {
|
|
51002
51362
|
};
|
|
51003
51363
|
}
|
|
51004
|
-
|
|
51364
|
+
assert64.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
|
51005
51365
|
if (loaded === false) {
|
|
51006
51366
|
load();
|
|
51007
51367
|
}
|
|
@@ -51107,7 +51467,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
51107
51467
|
}
|
|
51108
51468
|
}, "processEmit");
|
|
51109
51469
|
}
|
|
51110
|
-
var
|
|
51470
|
+
var assert64;
|
|
51111
51471
|
var signals;
|
|
51112
51472
|
var isWin;
|
|
51113
51473
|
var EE;
|
|
@@ -51574,23 +51934,27 @@ function tryAttachSourcemapToModule(module2) {
|
|
|
51574
51934
|
}
|
|
51575
51935
|
function getSourceMappingUrl(module2) {
|
|
51576
51936
|
const content = typeof module2.content === "string" ? module2.content : new TextDecoder().decode(module2.content);
|
|
51577
|
-
const trimmed = content.trimEnd();
|
|
51578
|
-
const lines = trimmed.split("\n");
|
|
51579
|
-
while (lines.at(-1)?.trim().length === 0) {
|
|
51580
|
-
lines.pop();
|
|
51581
|
-
}
|
|
51582
51937
|
const commentPrefix = "//# sourceMappingURL=";
|
|
51583
|
-
const
|
|
51584
|
-
|
|
51585
|
-
|
|
51586
|
-
|
|
51587
|
-
|
|
51588
|
-
|
|
51589
|
-
|
|
51590
|
-
|
|
51591
|
-
|
|
51938
|
+
const lines = content.split("\n");
|
|
51939
|
+
for (let i7 = lines.length - 1; i7 >= 0; i7--) {
|
|
51940
|
+
const line = lines[i7].trim();
|
|
51941
|
+
if (line.length === 0) {
|
|
51942
|
+
continue;
|
|
51943
|
+
}
|
|
51944
|
+
if (line.startsWith(commentPrefix)) {
|
|
51945
|
+
const commentPath = stripPrefix(commentPrefix, line).trim();
|
|
51946
|
+
if (commentPath.startsWith("data:")) {
|
|
51947
|
+
throw new Error(
|
|
51948
|
+
`Unsupported source map path in ${module2.filePath}: expected file path but found data URL.`
|
|
51949
|
+
);
|
|
51950
|
+
}
|
|
51951
|
+
return commentPath;
|
|
51952
|
+
}
|
|
51953
|
+
if (!line.startsWith("//#") && !line.startsWith("//@")) {
|
|
51954
|
+
return void 0;
|
|
51955
|
+
}
|
|
51592
51956
|
}
|
|
51593
|
-
return
|
|
51957
|
+
return void 0;
|
|
51594
51958
|
}
|
|
51595
51959
|
function sourceMapForModule(module2) {
|
|
51596
51960
|
if (module2.filePath === void 0) {
|
|
@@ -51972,7 +52336,7 @@ function createModuleCollector(props) {
|
|
|
51972
52336
|
)}". This will stop working in the future. Replace references to "${args.path}" with "./${args.path}";`
|
|
51973
52337
|
);
|
|
51974
52338
|
const cleanedPath = stripQueryString(args.path);
|
|
51975
|
-
|
|
52339
|
+
assert55__default.default(props.wrangler1xLegacyModuleReferences);
|
|
51976
52340
|
const filePath = path3__namespace.default.join(
|
|
51977
52341
|
props.wrangler1xLegacyModuleReferences.rootDirectory,
|
|
51978
52342
|
cleanedPath
|
|
@@ -52314,18 +52678,14 @@ var init_dist2 = __esm({
|
|
|
52314
52678
|
}
|
|
52315
52679
|
});
|
|
52316
52680
|
|
|
52317
|
-
// ../../node_modules/.pnpm/am-i-vibing@0.
|
|
52681
|
+
// ../../node_modules/.pnpm/am-i-vibing@0.4.0/node_modules/am-i-vibing/dist/detector-Boc_-HQ9.mjs
|
|
52318
52682
|
function checkEnvVar(envVarDef, env6 = process.env) {
|
|
52319
52683
|
const [envVar, expectedValue] = typeof envVarDef === "string" ? [envVarDef, void 0] : envVarDef;
|
|
52320
52684
|
const actualValue = env6[envVar];
|
|
52321
52685
|
return Boolean(actualValue && (!expectedValue || actualValue === expectedValue));
|
|
52322
52686
|
}
|
|
52323
52687
|
function checkProcess(processName, processAncestry) {
|
|
52324
|
-
|
|
52325
|
-
const ancestry = processAncestry ?? getProcessAncestry();
|
|
52326
|
-
for (const ancestorProcess of ancestry) if (ancestorProcess.command?.includes(processName)) return true;
|
|
52327
|
-
} catch (error3) {
|
|
52328
|
-
}
|
|
52688
|
+
for (const ancestorProcess of processAncestry) if (ancestorProcess.command?.includes(processName)) return true;
|
|
52329
52689
|
return false;
|
|
52330
52690
|
}
|
|
52331
52691
|
function checkEnvVars(definition, env6 = process.env) {
|
|
@@ -52353,19 +52713,37 @@ function createDetectedResult(provider) {
|
|
|
52353
52713
|
type: provider.type
|
|
52354
52714
|
};
|
|
52355
52715
|
}
|
|
52356
|
-
function
|
|
52716
|
+
function normalizeOptions(envOrOptions, legacyAncestry) {
|
|
52717
|
+
if (envOrOptions != null && typeof envOrOptions === "object" && ("env" in envOrOptions || "processAncestry" in envOrOptions || "checkProcesses" in envOrOptions)) {
|
|
52718
|
+
const opts = envOrOptions;
|
|
52719
|
+
return {
|
|
52720
|
+
env: opts.env ?? process.env,
|
|
52721
|
+
processAncestry: opts.processAncestry,
|
|
52722
|
+
checkProcesses: opts.checkProcesses ?? opts.processAncestry !== void 0
|
|
52723
|
+
};
|
|
52724
|
+
}
|
|
52725
|
+
return {
|
|
52726
|
+
env: envOrOptions ?? process.env,
|
|
52727
|
+
processAncestry: legacyAncestry,
|
|
52728
|
+
checkProcesses: legacyAncestry !== void 0
|
|
52729
|
+
};
|
|
52730
|
+
}
|
|
52731
|
+
function detectAgenticEnvironment(envOrOptions, legacyAncestry) {
|
|
52732
|
+
const { env: env6, processAncestry, checkProcesses } = normalizeOptions(envOrOptions, legacyAncestry);
|
|
52357
52733
|
for (const provider of providers) if (provider.envVars?.some((group) => checkEnvVars(group, env6))) return createDetectedResult(provider);
|
|
52358
|
-
let cachedAncestry = processAncestry;
|
|
52359
|
-
const getAncestry = /* @__PURE__ */ __name(() => {
|
|
52360
|
-
if (cachedAncestry === void 0) try {
|
|
52361
|
-
cachedAncestry = getProcessAncestry();
|
|
52362
|
-
} catch {
|
|
52363
|
-
cachedAncestry = [];
|
|
52364
|
-
}
|
|
52365
|
-
return cachedAncestry;
|
|
52366
|
-
}, "getAncestry");
|
|
52367
|
-
for (const provider of providers) if (provider.processChecks?.some((processName) => checkProcess(processName, getAncestry()))) return createDetectedResult(provider);
|
|
52368
52734
|
for (const provider of providers) if (runCustomDetectors(provider)) return createDetectedResult(provider);
|
|
52735
|
+
if (checkProcesses) {
|
|
52736
|
+
let cachedAncestry = processAncestry;
|
|
52737
|
+
const getAncestry = /* @__PURE__ */ __name(() => {
|
|
52738
|
+
if (cachedAncestry === void 0) try {
|
|
52739
|
+
cachedAncestry = getProcessAncestry();
|
|
52740
|
+
} catch {
|
|
52741
|
+
cachedAncestry = [];
|
|
52742
|
+
}
|
|
52743
|
+
return cachedAncestry;
|
|
52744
|
+
}, "getAncestry");
|
|
52745
|
+
for (const provider of providers) if (provider.processChecks?.some((processName) => checkProcess(processName, getAncestry()))) return createDetectedResult(provider);
|
|
52746
|
+
}
|
|
52369
52747
|
return {
|
|
52370
52748
|
isAgentic: false,
|
|
52371
52749
|
id: null,
|
|
@@ -52374,8 +52752,8 @@ function detectAgenticEnvironment(env6 = process.env, processAncestry) {
|
|
|
52374
52752
|
};
|
|
52375
52753
|
}
|
|
52376
52754
|
var providers;
|
|
52377
|
-
var
|
|
52378
|
-
"../../node_modules/.pnpm/am-i-vibing@0.
|
|
52755
|
+
var init_detector_Boc_HQ9 = __esm({
|
|
52756
|
+
"../../node_modules/.pnpm/am-i-vibing@0.4.0/node_modules/am-i-vibing/dist/detector-Boc_-HQ9.mjs"() {
|
|
52379
52757
|
init_import_meta_url();
|
|
52380
52758
|
init_dist2();
|
|
52381
52759
|
providers = [
|
|
@@ -52415,16 +52793,24 @@ var init_detector_CddkGnEB = __esm({
|
|
|
52415
52793
|
type: "interactive",
|
|
52416
52794
|
envVars: ["CURSOR_TRACE_ID"]
|
|
52417
52795
|
},
|
|
52796
|
+
{
|
|
52797
|
+
id: "antigravity",
|
|
52798
|
+
name: "Antigravity",
|
|
52799
|
+
type: "agent",
|
|
52800
|
+
envVars: [{ any: ["ANTIGRAVITY_AGENT", "ANTIGRAVITY_PROJECT_ID"] }]
|
|
52801
|
+
},
|
|
52418
52802
|
{
|
|
52419
52803
|
id: "gemini-agent",
|
|
52420
|
-
name: "Gemini
|
|
52804
|
+
name: "Gemini CLI",
|
|
52421
52805
|
type: "agent",
|
|
52806
|
+
envVars: [["GEMINI_CLI", "1"]],
|
|
52422
52807
|
processChecks: ["gemini"]
|
|
52423
52808
|
},
|
|
52424
52809
|
{
|
|
52425
52810
|
id: "codex",
|
|
52426
52811
|
name: "OpenAI Codex",
|
|
52427
52812
|
type: "agent",
|
|
52813
|
+
envVars: ["CODEX_THREAD_ID"],
|
|
52428
52814
|
processChecks: ["codex"]
|
|
52429
52815
|
},
|
|
52430
52816
|
{
|
|
@@ -52495,8 +52881,31 @@ var init_detector_CddkGnEB = __esm({
|
|
|
52495
52881
|
id: "crush",
|
|
52496
52882
|
name: "Crush",
|
|
52497
52883
|
type: "agent",
|
|
52884
|
+
envVars: [{ any: [
|
|
52885
|
+
["CRUSH", "1"],
|
|
52886
|
+
["AGENT", "crush"],
|
|
52887
|
+
["AI_AGENT", "crush"]
|
|
52888
|
+
] }],
|
|
52498
52889
|
processChecks: ["crush"]
|
|
52499
52890
|
},
|
|
52891
|
+
{
|
|
52892
|
+
id: "amp",
|
|
52893
|
+
name: "Amp",
|
|
52894
|
+
type: "agent",
|
|
52895
|
+
envVars: [{ any: ["AMP_CURRENT_THREAD_ID", ["AGENT", "amp"]] }]
|
|
52896
|
+
},
|
|
52897
|
+
{
|
|
52898
|
+
id: "auggie",
|
|
52899
|
+
name: "Auggie",
|
|
52900
|
+
type: "agent",
|
|
52901
|
+
envVars: [["AUGMENT_AGENT", "1"]]
|
|
52902
|
+
},
|
|
52903
|
+
{
|
|
52904
|
+
id: "qwen-code",
|
|
52905
|
+
name: "Qwen Code",
|
|
52906
|
+
type: "agent",
|
|
52907
|
+
envVars: [["QWEN_CODE", "1"]]
|
|
52908
|
+
},
|
|
52500
52909
|
{
|
|
52501
52910
|
id: "vscode-copilot-agent",
|
|
52502
52911
|
name: "GitHub Copilot in VS Code",
|
|
@@ -52514,6 +52923,18 @@ var init_detector_CddkGnEB = __esm({
|
|
|
52514
52923
|
name: "Octofriend",
|
|
52515
52924
|
type: "agent",
|
|
52516
52925
|
processChecks: ["octofriend"]
|
|
52926
|
+
},
|
|
52927
|
+
{
|
|
52928
|
+
id: "devin",
|
|
52929
|
+
name: "Devin",
|
|
52930
|
+
type: "agent",
|
|
52931
|
+
processChecks: ["devin"]
|
|
52932
|
+
},
|
|
52933
|
+
{
|
|
52934
|
+
id: "droid",
|
|
52935
|
+
name: "Factory Droid",
|
|
52936
|
+
type: "agent",
|
|
52937
|
+
processChecks: ["droid"]
|
|
52517
52938
|
}
|
|
52518
52939
|
];
|
|
52519
52940
|
__name(checkEnvVar, "checkEnvVar");
|
|
@@ -52521,15 +52942,16 @@ var init_detector_CddkGnEB = __esm({
|
|
|
52521
52942
|
__name(checkEnvVars, "checkEnvVars");
|
|
52522
52943
|
__name(runCustomDetectors, "runCustomDetectors");
|
|
52523
52944
|
__name(createDetectedResult, "createDetectedResult");
|
|
52945
|
+
__name(normalizeOptions, "normalizeOptions");
|
|
52524
52946
|
__name(detectAgenticEnvironment, "detectAgenticEnvironment");
|
|
52525
52947
|
}
|
|
52526
52948
|
});
|
|
52527
52949
|
|
|
52528
|
-
// ../../node_modules/.pnpm/am-i-vibing@0.
|
|
52950
|
+
// ../../node_modules/.pnpm/am-i-vibing@0.4.0/node_modules/am-i-vibing/dist/index.mjs
|
|
52529
52951
|
var init_dist3 = __esm({
|
|
52530
|
-
"../../node_modules/.pnpm/am-i-vibing@0.
|
|
52952
|
+
"../../node_modules/.pnpm/am-i-vibing@0.4.0/node_modules/am-i-vibing/dist/index.mjs"() {
|
|
52531
52953
|
init_import_meta_url();
|
|
52532
|
-
|
|
52954
|
+
init_detector_Boc_HQ9();
|
|
52533
52955
|
}
|
|
52534
52956
|
});
|
|
52535
52957
|
|
|
@@ -66981,7 +67403,7 @@ var name, version;
|
|
|
66981
67403
|
var init_package = __esm({
|
|
66982
67404
|
"package.json"() {
|
|
66983
67405
|
name = "wrangler";
|
|
66984
|
-
version = "4.
|
|
67406
|
+
version = "4.97.0";
|
|
66985
67407
|
}
|
|
66986
67408
|
});
|
|
66987
67409
|
function getWranglerVersion() {
|
|
@@ -67209,12 +67631,17 @@ function getMetricsDispatcher(options) {
|
|
|
67209
67631
|
argsCombination
|
|
67210
67632
|
};
|
|
67211
67633
|
trackDispatch(
|
|
67212
|
-
|
|
67213
|
-
|
|
67214
|
-
|
|
67215
|
-
|
|
67216
|
-
|
|
67217
|
-
|
|
67634
|
+
telemetryCurrentAgentSkillsInstalled().catch(() => null).then((currentAgentSkillsInstalled) => {
|
|
67635
|
+
return dispatch2({
|
|
67636
|
+
name: name2,
|
|
67637
|
+
properties: {
|
|
67638
|
+
...commonCommandEventProperties,
|
|
67639
|
+
...properties,
|
|
67640
|
+
currentAgentSkillsInstalled
|
|
67641
|
+
}
|
|
67642
|
+
});
|
|
67643
|
+
}).catch((err) => {
|
|
67644
|
+
logger.debug("Error sending command metrics event", err);
|
|
67218
67645
|
})
|
|
67219
67646
|
);
|
|
67220
67647
|
} catch (err) {
|
|
@@ -73822,7 +74249,7 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
|
|
|
73822
74249
|
}
|
|
73823
74250
|
});
|
|
73824
74251
|
sourceMappingPrepareStackTrace = Error.prepareStackTrace;
|
|
73825
|
-
|
|
74252
|
+
assert55__default.default(sourceMappingPrepareStackTrace !== void 0);
|
|
73826
74253
|
Error.prepareStackTrace = originalPrepareStackTrace;
|
|
73827
74254
|
return sourceMappingPrepareStackTrace;
|
|
73828
74255
|
}
|
|
@@ -73865,7 +74292,7 @@ function getSourceMappedString(value, retrieveSourceMap) {
|
|
|
73865
74292
|
}
|
|
73866
74293
|
const callSiteLine = callSiteLines[i7][0];
|
|
73867
74294
|
const callSiteAtIndex = callSiteLine.indexOf("at");
|
|
73868
|
-
|
|
74295
|
+
assert55__default.default(callSiteAtIndex !== -1);
|
|
73869
74296
|
const callSiteLineLeftPad = callSiteLine.substring(0, callSiteAtIndex);
|
|
73870
74297
|
value = value.replace(
|
|
73871
74298
|
callSiteLine,
|
|
@@ -75281,7 +75708,7 @@ function buildMiniflareBindingOptions(config, remoteProxyConnectionString) {
|
|
|
75281
75708
|
(b10) => isUnsafeServiceBindingWithDevCfg(b10[1])
|
|
75282
75709
|
);
|
|
75283
75710
|
for (const [name2, unsafeBinding] of unsafeBindingsWithLocalDev) {
|
|
75284
|
-
|
|
75711
|
+
assert55__default.default(isUnsafeServiceBindingWithDevCfg(unsafeBinding));
|
|
75285
75712
|
const {
|
|
75286
75713
|
type,
|
|
75287
75714
|
dev: {
|
|
@@ -75649,7 +76076,7 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
|
|
|
75649
76076
|
return options;
|
|
75650
76077
|
}
|
|
75651
76078
|
function getImageNameFromDOClassName(options) {
|
|
75652
|
-
|
|
76079
|
+
assert55__default.default(
|
|
75653
76080
|
options.containerBuildId,
|
|
75654
76081
|
"Build ID should be set if containers are defined and enabled"
|
|
75655
76082
|
);
|
|
@@ -76076,8 +76503,8 @@ function readConfig(args, options = {}) {
|
|
|
76076
76503
|
redirected
|
|
76077
76504
|
} = exports.experimental_readRawConfig(args, options);
|
|
76078
76505
|
if (redirected) {
|
|
76079
|
-
|
|
76080
|
-
|
|
76506
|
+
assert55__default.default(configPath, "Redirected config found without a configPath");
|
|
76507
|
+
assert55__default.default(
|
|
76081
76508
|
deployConfigPath,
|
|
76082
76509
|
"Redirected config found without a deployConfigPath"
|
|
76083
76510
|
);
|
|
@@ -76112,8 +76539,8 @@ function readPagesConfig(args, options = {}) {
|
|
|
76112
76539
|
try {
|
|
76113
76540
|
({ rawConfig, configPath, userConfigPath, deployConfigPath, redirected } = exports.experimental_readRawConfig(args, options));
|
|
76114
76541
|
if (redirected) {
|
|
76115
|
-
|
|
76116
|
-
|
|
76542
|
+
assert55__default.default(configPath, "Redirected config found without a configPath");
|
|
76543
|
+
assert55__default.default(
|
|
76117
76544
|
deployConfigPath,
|
|
76118
76545
|
"Redirected config found without a deployConfigPath"
|
|
76119
76546
|
);
|
|
@@ -78134,31 +78561,6 @@ var init_access = __esm({
|
|
|
78134
78561
|
}
|
|
78135
78562
|
});
|
|
78136
78563
|
|
|
78137
|
-
// src/cfetch/errors.ts
|
|
78138
|
-
function buildDetailedError(message, ...extra) {
|
|
78139
|
-
return new ParseError({
|
|
78140
|
-
text: message,
|
|
78141
|
-
notes: extra.map((text) => ({ text })),
|
|
78142
|
-
telemetryMessage: false
|
|
78143
|
-
});
|
|
78144
|
-
}
|
|
78145
|
-
function maybeThrowFriendlyError(error3) {
|
|
78146
|
-
if (error3.message === "workers.api.error.email_verification_required") {
|
|
78147
|
-
throw buildDetailedError(
|
|
78148
|
-
"Please verify your account's email address and try again.",
|
|
78149
|
-
"Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one."
|
|
78150
|
-
);
|
|
78151
|
-
}
|
|
78152
|
-
}
|
|
78153
|
-
var init_errors3 = __esm({
|
|
78154
|
-
"src/cfetch/errors.ts"() {
|
|
78155
|
-
init_import_meta_url();
|
|
78156
|
-
init_dist();
|
|
78157
|
-
__name(buildDetailedError, "buildDetailedError");
|
|
78158
|
-
__name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
|
|
78159
|
-
}
|
|
78160
|
-
});
|
|
78161
|
-
|
|
78162
78564
|
// ../../node_modules/.pnpm/cloudflare@5.2.0_encoding@0.1.13/node_modules/cloudflare/internal/qs/formats.mjs
|
|
78163
78565
|
var default_format, formatters, RFC1738;
|
|
78164
78566
|
var init_formats = __esm({
|
|
@@ -84523,7 +84925,7 @@ function exportNodeCompatibleHeaders(headers) {
|
|
|
84523
84925
|
return obj;
|
|
84524
84926
|
}
|
|
84525
84927
|
function createHeadersLenient(obj) {
|
|
84526
|
-
const headers = new
|
|
84928
|
+
const headers = new Headers4();
|
|
84527
84929
|
for (const name2 of Object.keys(obj)) {
|
|
84528
84930
|
if (invalidTokenRegex.test(name2)) {
|
|
84529
84931
|
continue;
|
|
@@ -84560,7 +84962,7 @@ function isAbortSignal(signal) {
|
|
|
84560
84962
|
}
|
|
84561
84963
|
function getNodeRequestOptions(request4) {
|
|
84562
84964
|
const parsedURL = request4[INTERNALS$2].parsedURL;
|
|
84563
|
-
const headers = new
|
|
84965
|
+
const headers = new Headers4(request4[INTERNALS$2].headers);
|
|
84564
84966
|
if (!headers.has("Accept")) {
|
|
84565
84967
|
headers.set("Accept", "*/*");
|
|
84566
84968
|
}
|
|
@@ -84721,7 +85123,7 @@ function fetch7(url4, opts) {
|
|
|
84721
85123
|
return;
|
|
84722
85124
|
}
|
|
84723
85125
|
const requestOpts = {
|
|
84724
|
-
headers: new
|
|
85126
|
+
headers: new Headers4(request4.headers),
|
|
84725
85127
|
follow: request4.follow,
|
|
84726
85128
|
counter: request4.counter + 1,
|
|
84727
85129
|
agent: request4.agent,
|
|
@@ -84767,7 +85169,7 @@ function fetch7(url4, opts) {
|
|
|
84767
85169
|
};
|
|
84768
85170
|
const codings = headers.get("Content-Encoding");
|
|
84769
85171
|
if (!request4.compress || request4.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
|
|
84770
|
-
response = new
|
|
85172
|
+
response = new Response4(body, response_options);
|
|
84771
85173
|
resolve33(response);
|
|
84772
85174
|
return;
|
|
84773
85175
|
}
|
|
@@ -84777,7 +85179,7 @@ function fetch7(url4, opts) {
|
|
|
84777
85179
|
};
|
|
84778
85180
|
if (codings == "gzip" || codings == "x-gzip") {
|
|
84779
85181
|
body = body.pipe(zlib2__namespace.default.createGunzip(zlibOptions));
|
|
84780
|
-
response = new
|
|
85182
|
+
response = new Response4(body, response_options);
|
|
84781
85183
|
resolve33(response);
|
|
84782
85184
|
return;
|
|
84783
85185
|
}
|
|
@@ -84789,12 +85191,12 @@ function fetch7(url4, opts) {
|
|
|
84789
85191
|
} else {
|
|
84790
85192
|
body = body.pipe(zlib2__namespace.default.createInflateRaw());
|
|
84791
85193
|
}
|
|
84792
|
-
response = new
|
|
85194
|
+
response = new Response4(body, response_options);
|
|
84793
85195
|
resolve33(response);
|
|
84794
85196
|
});
|
|
84795
85197
|
raw.on("end", function() {
|
|
84796
85198
|
if (!response) {
|
|
84797
|
-
response = new
|
|
85199
|
+
response = new Response4(body, response_options);
|
|
84798
85200
|
resolve33(response);
|
|
84799
85201
|
}
|
|
84800
85202
|
});
|
|
@@ -84802,11 +85204,11 @@ function fetch7(url4, opts) {
|
|
|
84802
85204
|
}
|
|
84803
85205
|
if (codings == "br" && typeof zlib2__namespace.default.createBrotliDecompress === "function") {
|
|
84804
85206
|
body = body.pipe(zlib2__namespace.default.createBrotliDecompress());
|
|
84805
|
-
response = new
|
|
85207
|
+
response = new Response4(body, response_options);
|
|
84806
85208
|
resolve33(response);
|
|
84807
85209
|
return;
|
|
84808
85210
|
}
|
|
84809
|
-
response = new
|
|
85211
|
+
response = new Response4(body, response_options);
|
|
84810
85212
|
resolve33(response);
|
|
84811
85213
|
});
|
|
84812
85214
|
writeToStream(req, request4);
|
|
@@ -84839,7 +85241,7 @@ function destroyStream(stream2, err) {
|
|
|
84839
85241
|
stream2.end();
|
|
84840
85242
|
}
|
|
84841
85243
|
}
|
|
84842
|
-
var import_whatwg_url, Readable3, BUFFER, TYPE, Blob3, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP,
|
|
85244
|
+
var import_whatwg_url, Readable3, BUFFER, TYPE, Blob3, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers4, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response4, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request3, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default2;
|
|
84843
85245
|
var init_lib4 = __esm({
|
|
84844
85246
|
"../../node_modules/.pnpm/node-fetch@2.7.0_encoding@0.1.13/node_modules/node-fetch/lib/index.mjs"() {
|
|
84845
85247
|
init_import_meta_url();
|
|
@@ -85071,7 +85473,7 @@ var init_lib4 = __esm({
|
|
|
85071
85473
|
__name(validateValue, "validateValue");
|
|
85072
85474
|
__name(find, "find");
|
|
85073
85475
|
MAP = Symbol("map");
|
|
85074
|
-
|
|
85476
|
+
Headers4 = class _Headers {
|
|
85075
85477
|
static {
|
|
85076
85478
|
__name(this, "Headers");
|
|
85077
85479
|
}
|
|
@@ -85252,14 +85654,14 @@ var init_lib4 = __esm({
|
|
|
85252
85654
|
return createHeadersIterator(this, "key+value");
|
|
85253
85655
|
}
|
|
85254
85656
|
};
|
|
85255
|
-
|
|
85256
|
-
Object.defineProperty(
|
|
85657
|
+
Headers4.prototype.entries = Headers4.prototype[Symbol.iterator];
|
|
85658
|
+
Object.defineProperty(Headers4.prototype, Symbol.toStringTag, {
|
|
85257
85659
|
value: "Headers",
|
|
85258
85660
|
writable: false,
|
|
85259
85661
|
enumerable: false,
|
|
85260
85662
|
configurable: true
|
|
85261
85663
|
});
|
|
85262
|
-
Object.defineProperties(
|
|
85664
|
+
Object.defineProperties(Headers4.prototype, {
|
|
85263
85665
|
get: { enumerable: true },
|
|
85264
85666
|
forEach: { enumerable: true },
|
|
85265
85667
|
set: { enumerable: true },
|
|
@@ -85305,7 +85707,7 @@ var init_lib4 = __esm({
|
|
|
85305
85707
|
__name(createHeadersLenient, "createHeadersLenient");
|
|
85306
85708
|
INTERNALS$1 = Symbol("Response internals");
|
|
85307
85709
|
STATUS_CODES = http__namespace.default.STATUS_CODES;
|
|
85308
|
-
|
|
85710
|
+
Response4 = class _Response {
|
|
85309
85711
|
static {
|
|
85310
85712
|
__name(this, "Response");
|
|
85311
85713
|
}
|
|
@@ -85314,7 +85716,7 @@ var init_lib4 = __esm({
|
|
|
85314
85716
|
let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
85315
85717
|
Body.call(this, body, opts);
|
|
85316
85718
|
const status2 = opts.status || 200;
|
|
85317
|
-
const headers = new
|
|
85719
|
+
const headers = new Headers4(opts.headers);
|
|
85318
85720
|
if (body != null && !headers.has("Content-Type")) {
|
|
85319
85721
|
const contentType = extractContentType(body);
|
|
85320
85722
|
if (contentType) {
|
|
@@ -85366,8 +85768,8 @@ var init_lib4 = __esm({
|
|
|
85366
85768
|
});
|
|
85367
85769
|
}
|
|
85368
85770
|
};
|
|
85369
|
-
Body.mixIn(
|
|
85370
|
-
Object.defineProperties(
|
|
85771
|
+
Body.mixIn(Response4.prototype);
|
|
85772
|
+
Object.defineProperties(Response4.prototype, {
|
|
85371
85773
|
url: { enumerable: true },
|
|
85372
85774
|
status: { enumerable: true },
|
|
85373
85775
|
ok: { enumerable: true },
|
|
@@ -85376,7 +85778,7 @@ var init_lib4 = __esm({
|
|
|
85376
85778
|
headers: { enumerable: true },
|
|
85377
85779
|
clone: { enumerable: true }
|
|
85378
85780
|
});
|
|
85379
|
-
Object.defineProperty(
|
|
85781
|
+
Object.defineProperty(Response4.prototype, Symbol.toStringTag, {
|
|
85380
85782
|
value: "Response",
|
|
85381
85783
|
writable: false,
|
|
85382
85784
|
enumerable: false,
|
|
@@ -85417,7 +85819,7 @@ var init_lib4 = __esm({
|
|
|
85417
85819
|
timeout: init4.timeout || input.timeout || 0,
|
|
85418
85820
|
size: init4.size || input.size || 0
|
|
85419
85821
|
});
|
|
85420
|
-
const headers = new
|
|
85822
|
+
const headers = new Headers4(init4.headers || input.headers || {});
|
|
85421
85823
|
if (inputBody != null && !headers.has("Content-Type")) {
|
|
85422
85824
|
const contentType = extractContentType(inputBody);
|
|
85423
85825
|
if (contentType) {
|
|
@@ -87838,7 +88240,7 @@ var init_deprecateConstructorEntries = __esm({
|
|
|
87838
88240
|
}, 'Constructor "entries" argument is not spec-compliant and will be removed in next major release.');
|
|
87839
88241
|
}
|
|
87840
88242
|
});
|
|
87841
|
-
var __classPrivateFieldGet4, _FormData_instances, _FormData_entries, _FormData_setEntry,
|
|
88243
|
+
var __classPrivateFieldGet4, _FormData_instances, _FormData_entries, _FormData_setEntry, FormData4;
|
|
87842
88244
|
var init_FormData = __esm({
|
|
87843
88245
|
"../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/FormData.js"() {
|
|
87844
88246
|
init_import_meta_url();
|
|
@@ -87852,7 +88254,7 @@ var init_FormData = __esm({
|
|
|
87852
88254
|
if (typeof state3 === "function" ? receiver !== state3 || !f7 : !state3.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
87853
88255
|
return kind2 === "m" ? f7 : kind2 === "a" ? f7.call(receiver) : f7 ? f7.value : state3.get(receiver);
|
|
87854
88256
|
};
|
|
87855
|
-
|
|
88257
|
+
FormData4 = class {
|
|
87856
88258
|
static {
|
|
87857
88259
|
__name(this, "FormData");
|
|
87858
88260
|
}
|
|
@@ -89641,9 +90043,9 @@ function getRuntime2() {
|
|
|
89641
90043
|
kind: "node",
|
|
89642
90044
|
fetch: lib_default2,
|
|
89643
90045
|
Request: Request3,
|
|
89644
|
-
Response:
|
|
89645
|
-
Headers:
|
|
89646
|
-
FormData:
|
|
90046
|
+
Response: Response4,
|
|
90047
|
+
Headers: Headers4,
|
|
90048
|
+
FormData: FormData4,
|
|
89647
90049
|
Blob: Blob4,
|
|
89648
90050
|
File: File3,
|
|
89649
90051
|
ReadableStream: web.ReadableStream,
|
|
@@ -137772,9 +138174,11 @@ var init_cloudflare = __esm({
|
|
|
137772
138174
|
cloudflare_default = Cloudflare;
|
|
137773
138175
|
}
|
|
137774
138176
|
});
|
|
138177
|
+
|
|
138178
|
+
// src/cfetch/internal.ts
|
|
137775
138179
|
async function logRequest(request4, init4) {
|
|
137776
138180
|
logger.debug(`-- START CF API REQUEST: ${request4.method} ${request4.url}`);
|
|
137777
|
-
const logRequestHeaders =
|
|
138181
|
+
const logRequestHeaders = cloneHeaders2(request4.headers);
|
|
137778
138182
|
logRequestHeaders.delete("Authorization");
|
|
137779
138183
|
logger.debugWithSanitization(
|
|
137780
138184
|
"HEADERS:",
|
|
@@ -137798,7 +138202,7 @@ async function logResponse(response) {
|
|
|
137798
138202
|
response.statusText,
|
|
137799
138203
|
response.status
|
|
137800
138204
|
);
|
|
137801
|
-
const logResponseHeaders =
|
|
138205
|
+
const logResponseHeaders = cloneHeaders2(response.headers);
|
|
137802
138206
|
logResponseHeaders.delete("Authorization");
|
|
137803
138207
|
logger.debugWithSanitization(
|
|
137804
138208
|
"HEADERS:",
|
|
@@ -137829,147 +138233,38 @@ function createCloudflareClient(complianceConfig) {
|
|
|
137829
138233
|
});
|
|
137830
138234
|
}
|
|
137831
138235
|
async function performApiFetch(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
|
|
137832
|
-
|
|
137833
|
-
|
|
137834
|
-
|
|
137835
|
-
|
|
137836
|
-
|
|
137837
|
-
|
|
137838
|
-
|
|
137839
|
-
|
|
137840
|
-
|
|
137841
|
-
|
|
137842
|
-
maybeAddTraceHeader(headers);
|
|
137843
|
-
const queryString = queryParams ? `?${queryParams.toString()}` : "";
|
|
137844
|
-
logger.debug(
|
|
137845
|
-
`-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`
|
|
137846
|
-
);
|
|
137847
|
-
logger.debugWithSanitization("QUERY STRING:", queryString);
|
|
137848
|
-
logHeaders(headers);
|
|
137849
|
-
logger.debugWithSanitization("INIT:", JSON.stringify({ ...init4 }, null, 2));
|
|
137850
|
-
if (init4.body instanceof import_undici5.FormData) {
|
|
137851
|
-
logger.debugWithSanitization(
|
|
137852
|
-
"BODY:",
|
|
137853
|
-
await new import_undici5.Response(init4.body).text(),
|
|
137854
|
-
null,
|
|
137855
|
-
2
|
|
137856
|
-
);
|
|
137857
|
-
}
|
|
137858
|
-
logger.debug("-- END CF API REQUEST");
|
|
137859
|
-
return await (0, import_undici5.fetch)(
|
|
137860
|
-
`${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`,
|
|
137861
|
-
{
|
|
137862
|
-
method,
|
|
137863
|
-
...init4,
|
|
137864
|
-
headers,
|
|
137865
|
-
signal: abortSignal
|
|
137866
|
-
}
|
|
137867
|
-
);
|
|
137868
|
-
}
|
|
137869
|
-
function logHeaders(headers) {
|
|
137870
|
-
headers = cloneHeaders(headers);
|
|
137871
|
-
headers.delete("Authorization");
|
|
137872
|
-
logger.debugWithSanitization(
|
|
137873
|
-
"HEADERS:",
|
|
137874
|
-
JSON.stringify(Object.fromEntries(headers), null, 2)
|
|
138236
|
+
apiToken = await resolveCredentials(complianceConfig, apiToken);
|
|
138237
|
+
return performApiFetchBase(
|
|
138238
|
+
complianceConfig,
|
|
138239
|
+
resource,
|
|
138240
|
+
init4,
|
|
138241
|
+
`wrangler/${version}`,
|
|
138242
|
+
logger,
|
|
138243
|
+
queryParams,
|
|
138244
|
+
abortSignal,
|
|
138245
|
+
apiToken
|
|
137875
138246
|
);
|
|
137876
138247
|
}
|
|
137877
138248
|
async function fetchInternal(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
|
|
137878
|
-
|
|
137879
|
-
|
|
138249
|
+
apiToken = await resolveCredentials(complianceConfig, apiToken);
|
|
138250
|
+
return fetchInternalBase(
|
|
137880
138251
|
complianceConfig,
|
|
137881
138252
|
resource,
|
|
137882
138253
|
init4,
|
|
138254
|
+
`wrangler/${version}`,
|
|
138255
|
+
logger,
|
|
137883
138256
|
queryParams,
|
|
137884
138257
|
abortSignal,
|
|
137885
138258
|
apiToken
|
|
137886
138259
|
);
|
|
137887
|
-
const jsonText = await response.text();
|
|
137888
|
-
logger.debug(
|
|
137889
|
-
"-- START CF API RESPONSE:",
|
|
137890
|
-
response.statusText,
|
|
137891
|
-
response.status
|
|
137892
|
-
);
|
|
137893
|
-
logHeaders(response.headers);
|
|
137894
|
-
logger.debugWithSanitization("RESPONSE:", jsonText);
|
|
137895
|
-
logger.debug("-- END CF API RESPONSE");
|
|
137896
|
-
if (!jsonText && (response.status === 204 || response.status === 205)) {
|
|
137897
|
-
return {
|
|
137898
|
-
response: {
|
|
137899
|
-
result: {},
|
|
137900
|
-
success: true,
|
|
137901
|
-
errors: [],
|
|
137902
|
-
messages: []
|
|
137903
|
-
},
|
|
137904
|
-
status: response.status
|
|
137905
|
-
};
|
|
137906
|
-
}
|
|
137907
|
-
if (isWAFBlockResponse(response.headers)) {
|
|
137908
|
-
throwWAFBlockError(
|
|
137909
|
-
response.headers,
|
|
137910
|
-
method,
|
|
137911
|
-
resource,
|
|
137912
|
-
response.status,
|
|
137913
|
-
response.statusText
|
|
137914
|
-
);
|
|
137915
|
-
}
|
|
137916
|
-
try {
|
|
137917
|
-
const json = parseJSON(jsonText);
|
|
137918
|
-
return { response: json, status: response.status };
|
|
137919
|
-
} catch {
|
|
137920
|
-
const rayId = extractWAFBlockRayId(response.headers);
|
|
137921
|
-
throw new APIError({
|
|
137922
|
-
text: "Received a malformed response from the API",
|
|
137923
|
-
notes: [
|
|
137924
|
-
{
|
|
137925
|
-
text: truncate(jsonText, 100)
|
|
137926
|
-
},
|
|
137927
|
-
{
|
|
137928
|
-
text: `${method} ${resource} -> ${response.status} ${response.statusText}`
|
|
137929
|
-
},
|
|
137930
|
-
...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : []
|
|
137931
|
-
],
|
|
137932
|
-
status: response.status,
|
|
137933
|
-
telemetryMessage: false
|
|
137934
|
-
});
|
|
137935
|
-
}
|
|
137936
|
-
}
|
|
137937
|
-
function truncate(text, maxLength) {
|
|
137938
|
-
const { length } = text;
|
|
137939
|
-
if (length <= maxLength) {
|
|
137940
|
-
return text;
|
|
137941
|
-
}
|
|
137942
|
-
return `${text.substring(0, maxLength)}... (length = ${length})`;
|
|
137943
|
-
}
|
|
137944
|
-
function isWAFBlockResponse(headers) {
|
|
137945
|
-
return headers.get("cf-mitigated") === "challenge";
|
|
137946
|
-
}
|
|
137947
|
-
function extractWAFBlockRayId(headers) {
|
|
137948
|
-
return headers.get("cf-ray") ?? void 0;
|
|
137949
138260
|
}
|
|
137950
|
-
function
|
|
137951
|
-
const rayId = extractWAFBlockRayId(headers);
|
|
137952
|
-
throw new APIError({
|
|
137953
|
-
text: "The Cloudflare API responded with a WAF block page instead of the expected JSON response",
|
|
137954
|
-
notes: [
|
|
137955
|
-
{
|
|
137956
|
-
text: "Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive."
|
|
137957
|
-
},
|
|
137958
|
-
...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : [],
|
|
137959
|
-
{
|
|
137960
|
-
text: rayId ? "If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above." : "If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser."
|
|
137961
|
-
},
|
|
137962
|
-
{
|
|
137963
|
-
text: `${method} ${resource} -> ${status2} ${statusText}`
|
|
137964
|
-
}
|
|
137965
|
-
],
|
|
137966
|
-
status: status2,
|
|
137967
|
-
telemetryMessage: false
|
|
137968
|
-
});
|
|
137969
|
-
}
|
|
137970
|
-
function cloneHeaders(headers) {
|
|
138261
|
+
function cloneHeaders2(headers) {
|
|
137971
138262
|
return new import_undici5.Headers(headers);
|
|
137972
138263
|
}
|
|
138264
|
+
async function resolveCredentials(complianceConfig, apiToken) {
|
|
138265
|
+
await requireLoggedIn(complianceConfig);
|
|
138266
|
+
return apiToken ?? requireApiToken();
|
|
138267
|
+
}
|
|
137973
138268
|
async function requireLoggedIn(complianceConfig) {
|
|
137974
138269
|
const loggedIn = await loginOrRefreshIfRequired(complianceConfig);
|
|
137975
138270
|
if (!loggedIn) {
|
|
@@ -137978,60 +138273,9 @@ async function requireLoggedIn(complianceConfig) {
|
|
|
137978
138273
|
});
|
|
137979
138274
|
}
|
|
137980
138275
|
}
|
|
137981
|
-
function addAuthorizationHeader(headers, auth, overrideExisting = false) {
|
|
137982
|
-
if (!headers.has("Authorization") || overrideExisting) {
|
|
137983
|
-
if ("apiToken" in auth) {
|
|
137984
|
-
const authorizationHeader = `Bearer ${auth.apiToken}`;
|
|
137985
|
-
validateAuthorizationHeaderValue(authorizationHeader);
|
|
137986
|
-
headers.set("Authorization", authorizationHeader);
|
|
137987
|
-
} else {
|
|
137988
|
-
headers.set("X-Auth-Key", auth.authKey);
|
|
137989
|
-
headers.set("X-Auth-Email", auth.authEmail);
|
|
137990
|
-
}
|
|
137991
|
-
}
|
|
137992
|
-
}
|
|
137993
|
-
function validateAuthorizationHeaderValue(value) {
|
|
137994
|
-
for (const character of value) {
|
|
137995
|
-
const codePoint = character.codePointAt(0);
|
|
137996
|
-
if (codePoint === void 0 || codePoint > 255) {
|
|
137997
|
-
throw new UserError(
|
|
137998
|
-
`The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${formatAuthorizationHeaderCharacter(character, codePoint)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`,
|
|
137999
|
-
{
|
|
138000
|
-
telemetryMessage: "cfetch auth invalid authorization header"
|
|
138001
|
-
}
|
|
138002
|
-
);
|
|
138003
|
-
}
|
|
138004
|
-
}
|
|
138005
|
-
}
|
|
138006
|
-
function formatAuthorizationHeaderCharacter(character, codePoint) {
|
|
138007
|
-
if (codePoint === void 0) {
|
|
138008
|
-
return '"\\u{unknown}"';
|
|
138009
|
-
}
|
|
138010
|
-
const codePointLabel = `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")}`;
|
|
138011
|
-
const characterLabel = isPrintableCharacter(character) ? `"${character}"` : `"${escapeCharacter(character)}"`;
|
|
138012
|
-
return `${characterLabel} (${codePointLabel})`;
|
|
138013
|
-
}
|
|
138014
|
-
function isPrintableCharacter(character) {
|
|
138015
|
-
return !/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(character);
|
|
138016
|
-
}
|
|
138017
|
-
function escapeCharacter(character) {
|
|
138018
|
-
return Array.from(character).map((c8) => {
|
|
138019
|
-
const codePoint = c8.codePointAt(0);
|
|
138020
|
-
if (codePoint === void 0) {
|
|
138021
|
-
return "";
|
|
138022
|
-
}
|
|
138023
|
-
return codePoint <= 65535 ? `\\u${codePoint.toString(16).toUpperCase().padStart(4, "0")}` : `\\u{${codePoint.toString(16).toUpperCase()}}`;
|
|
138024
|
-
}).join("");
|
|
138025
|
-
}
|
|
138026
138276
|
function addUserAgent(headers) {
|
|
138027
138277
|
headers.set("User-Agent", `wrangler/${version}`);
|
|
138028
138278
|
}
|
|
138029
|
-
function maybeAddTraceHeader(headers) {
|
|
138030
|
-
const traceHeader = getTraceHeader();
|
|
138031
|
-
if (traceHeader) {
|
|
138032
|
-
headers.set("Cf-Trace-Id", traceHeader);
|
|
138033
|
-
}
|
|
138034
|
-
}
|
|
138035
138279
|
async function fetchKVGetValue(complianceConfig, accountId, namespaceId, key) {
|
|
138036
138280
|
await requireLoggedIn(complianceConfig);
|
|
138037
138281
|
const auth = requireApiToken();
|
|
@@ -138053,7 +138297,7 @@ async function fetchKVGetValue(complianceConfig, accountId, namespaceId, key) {
|
|
|
138053
138297
|
async function fetchR2Objects(complianceConfig, resource, bodyInit = {}) {
|
|
138054
138298
|
await requireLoggedIn(complianceConfig);
|
|
138055
138299
|
const auth = requireApiToken();
|
|
138056
|
-
const headers =
|
|
138300
|
+
const headers = cloneHeaders2(bodyInit.headers);
|
|
138057
138301
|
addAuthorizationHeader(headers, auth);
|
|
138058
138302
|
addUserAgent(headers);
|
|
138059
138303
|
const response = await (0, import_undici5.fetch)(
|
|
@@ -138095,7 +138339,7 @@ async function fetchR2Objects(complianceConfig, resource, bodyInit = {}) {
|
|
|
138095
138339
|
async function fetchWorkerDefinitionFromDash(complianceConfig, resource, bodyInit = {}) {
|
|
138096
138340
|
await requireLoggedIn(complianceConfig);
|
|
138097
138341
|
const auth = requireApiToken();
|
|
138098
|
-
const headers =
|
|
138342
|
+
const headers = cloneHeaders2(bodyInit.headers);
|
|
138099
138343
|
addAuthorizationHeader(headers, auth);
|
|
138100
138344
|
addUserAgent(headers);
|
|
138101
138345
|
let response = await (0, import_undici5.fetch)(
|
|
@@ -138147,33 +138391,28 @@ var init_internal = __esm({
|
|
|
138147
138391
|
__name(logResponse, "logResponse");
|
|
138148
138392
|
__name(createCloudflareClient, "createCloudflareClient");
|
|
138149
138393
|
__name(performApiFetch, "performApiFetch");
|
|
138150
|
-
__name(logHeaders, "logHeaders");
|
|
138151
138394
|
__name(fetchInternal, "fetchInternal");
|
|
138152
|
-
__name(
|
|
138153
|
-
__name(
|
|
138154
|
-
__name(extractWAFBlockRayId, "extractWAFBlockRayId");
|
|
138155
|
-
__name(throwWAFBlockError, "throwWAFBlockError");
|
|
138156
|
-
__name(cloneHeaders, "cloneHeaders");
|
|
138395
|
+
__name(cloneHeaders2, "cloneHeaders");
|
|
138396
|
+
__name(resolveCredentials, "resolveCredentials");
|
|
138157
138397
|
__name(requireLoggedIn, "requireLoggedIn");
|
|
138158
|
-
__name(addAuthorizationHeader, "addAuthorizationHeader");
|
|
138159
|
-
__name(validateAuthorizationHeaderValue, "validateAuthorizationHeaderValue");
|
|
138160
|
-
__name(formatAuthorizationHeaderCharacter, "formatAuthorizationHeaderCharacter");
|
|
138161
|
-
__name(isPrintableCharacter, "isPrintableCharacter");
|
|
138162
|
-
__name(escapeCharacter, "escapeCharacter");
|
|
138163
138398
|
__name(addUserAgent, "addUserAgent");
|
|
138164
|
-
__name(maybeAddTraceHeader, "maybeAddTraceHeader");
|
|
138165
138399
|
__name(fetchKVGetValue, "fetchKVGetValue");
|
|
138166
138400
|
__name(fetchR2Objects, "fetchR2Objects");
|
|
138167
138401
|
__name(fetchWorkerDefinitionFromDash, "fetchWorkerDefinitionFromDash");
|
|
138168
138402
|
}
|
|
138169
138403
|
});
|
|
138170
138404
|
async function fetchResult(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
|
|
138171
|
-
|
|
138172
|
-
|
|
138173
|
-
|
|
138174
|
-
|
|
138175
|
-
|
|
138176
|
-
|
|
138405
|
+
apiToken = await resolveCredentials(complianceConfig, apiToken);
|
|
138406
|
+
return fetchResultBase(
|
|
138407
|
+
complianceConfig,
|
|
138408
|
+
resource,
|
|
138409
|
+
init4,
|
|
138410
|
+
`wrangler/${version}`,
|
|
138411
|
+
logger,
|
|
138412
|
+
queryParams,
|
|
138413
|
+
abortSignal,
|
|
138414
|
+
apiToken
|
|
138415
|
+
);
|
|
138177
138416
|
}
|
|
138178
138417
|
async function fetchGraphqlResult(complianceConfig, init4 = {}, abortSignal) {
|
|
138179
138418
|
const { response: json } = await fetchInternal(
|
|
@@ -138191,27 +138430,16 @@ async function fetchGraphqlResult(complianceConfig, init4 = {}, abortSignal) {
|
|
|
138191
138430
|
}
|
|
138192
138431
|
}
|
|
138193
138432
|
async function fetchListResult(complianceConfig, resource, init4 = {}, queryParams) {
|
|
138194
|
-
const
|
|
138195
|
-
|
|
138196
|
-
|
|
138197
|
-
|
|
138198
|
-
|
|
138199
|
-
|
|
138200
|
-
|
|
138201
|
-
|
|
138202
|
-
|
|
138203
|
-
|
|
138204
|
-
results.push(...json.result);
|
|
138205
|
-
if (hasCursor(json.result_info)) {
|
|
138206
|
-
cursor = json.result_info?.cursor;
|
|
138207
|
-
} else {
|
|
138208
|
-
getMoreResults = false;
|
|
138209
|
-
}
|
|
138210
|
-
} else {
|
|
138211
|
-
throwFetchError(resource, json, status2);
|
|
138212
|
-
}
|
|
138213
|
-
}
|
|
138214
|
-
return results;
|
|
138433
|
+
const credentials = await resolveCredentials(complianceConfig);
|
|
138434
|
+
return fetchListResultBase(
|
|
138435
|
+
complianceConfig,
|
|
138436
|
+
resource,
|
|
138437
|
+
init4,
|
|
138438
|
+
`wrangler/${version}`,
|
|
138439
|
+
logger,
|
|
138440
|
+
queryParams,
|
|
138441
|
+
credentials
|
|
138442
|
+
);
|
|
138215
138443
|
}
|
|
138216
138444
|
async function fetchPagedListResult(complianceConfig, resource, init4 = {}, queryParams) {
|
|
138217
138445
|
const results = [];
|
|
@@ -138263,70 +138491,12 @@ async function fetchCursorPage(complianceConfig, resource, init4 = {}, queryPara
|
|
|
138263
138491
|
}
|
|
138264
138492
|
return results;
|
|
138265
138493
|
}
|
|
138266
|
-
function hasMorePages(result_info) {
|
|
138267
|
-
const page = result_info?.page;
|
|
138268
|
-
const per_page = result_info?.per_page;
|
|
138269
|
-
const total = result_info?.total_count;
|
|
138270
|
-
return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total;
|
|
138271
|
-
}
|
|
138272
|
-
function throwFetchError(resource, response, status2) {
|
|
138273
|
-
if (typeof vitest !== "undefined" && !("errors" in response)) {
|
|
138274
|
-
throw response;
|
|
138275
|
-
}
|
|
138276
|
-
const errors = response.errors ?? [];
|
|
138277
|
-
for (const error4 of errors) {
|
|
138278
|
-
maybeThrowFriendlyError(error4);
|
|
138279
|
-
}
|
|
138280
|
-
const notes = [
|
|
138281
|
-
...errors.map((err) => ({ text: renderError(err) })),
|
|
138282
|
-
...response.messages?.map((msg) => ({
|
|
138283
|
-
text: typeof msg === "string" ? msg : msg.message ?? String(msg)
|
|
138284
|
-
})) ?? []
|
|
138285
|
-
];
|
|
138286
|
-
if (notes.length === 0) {
|
|
138287
|
-
const raw = response;
|
|
138288
|
-
const fallbackMessage = typeof raw.error === "string" ? `${raw.error}${raw.code ? ` [code: ${raw.code}]` : ""}` : void 0;
|
|
138289
|
-
if (fallbackMessage) {
|
|
138290
|
-
notes.push({ text: fallbackMessage });
|
|
138291
|
-
}
|
|
138292
|
-
}
|
|
138293
|
-
const error3 = new APIError({
|
|
138294
|
-
text: `A request to the Cloudflare API (${resource}) failed.`,
|
|
138295
|
-
notes,
|
|
138296
|
-
status: status2,
|
|
138297
|
-
telemetryMessage: false
|
|
138298
|
-
});
|
|
138299
|
-
const code = errors[0]?.code;
|
|
138300
|
-
if (code) {
|
|
138301
|
-
error3.code = code;
|
|
138302
|
-
}
|
|
138303
|
-
error3.accountTag = extractAccountTag(resource);
|
|
138304
|
-
throw error3;
|
|
138305
|
-
}
|
|
138306
|
-
function extractAccountTag(resource) {
|
|
138307
|
-
const re2 = new RegExp("/accounts/([a-zA-Z0-9]+)/?");
|
|
138308
|
-
const matches = re2.exec(resource);
|
|
138309
|
-
return matches?.[1];
|
|
138310
|
-
}
|
|
138311
|
-
function hasCursor(result_info) {
|
|
138312
|
-
const cursor = result_info?.cursor;
|
|
138313
|
-
return cursor !== void 0 && cursor !== null && cursor !== "";
|
|
138314
|
-
}
|
|
138315
|
-
function renderError(err, level = 0) {
|
|
138316
|
-
const indent = " ".repeat(level);
|
|
138317
|
-
const chainedMessages = "error_chain" in err ? err.error_chain?.map(
|
|
138318
|
-
(chainedError) => `
|
|
138319
|
-
|
|
138320
|
-
${indent}- ${renderError(chainedError, level + 1)}`
|
|
138321
|
-
).join("\n") ?? "" : "";
|
|
138322
|
-
return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + (err.documentation_url ? `
|
|
138323
|
-
${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
|
|
138324
|
-
}
|
|
138325
138494
|
var init_cfetch = __esm({
|
|
138326
138495
|
"src/cfetch/index.ts"() {
|
|
138327
138496
|
init_import_meta_url();
|
|
138328
138497
|
init_dist();
|
|
138329
|
-
|
|
138498
|
+
init_package();
|
|
138499
|
+
init_logger();
|
|
138330
138500
|
init_internal();
|
|
138331
138501
|
init_internal();
|
|
138332
138502
|
__name(fetchResult, "fetchResult");
|
|
@@ -138334,11 +138504,6 @@ var init_cfetch = __esm({
|
|
|
138334
138504
|
__name(fetchListResult, "fetchListResult");
|
|
138335
138505
|
__name(fetchPagedListResult, "fetchPagedListResult");
|
|
138336
138506
|
__name(fetchCursorPage, "fetchCursorPage");
|
|
138337
|
-
__name(hasMorePages, "hasMorePages");
|
|
138338
|
-
__name(throwFetchError, "throwFetchError");
|
|
138339
|
-
__name(extractAccountTag, "extractAccountTag");
|
|
138340
|
-
__name(hasCursor, "hasCursor");
|
|
138341
|
-
__name(renderError, "renderError");
|
|
138342
138507
|
}
|
|
138343
138508
|
});
|
|
138344
138509
|
|
|
@@ -138372,14 +138537,14 @@ async function fetchAllAccounts(complianceConfig, options = {}) {
|
|
|
138372
138537
|
throw new UserError(
|
|
138373
138538
|
`Failed to automatically retrieve account IDs for the logged in user.
|
|
138374
138539
|
You may have incorrect permissions on your API token, or an environment variable such as CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY, or CLOUDFLARE_EMAIL may be set to an invalid value.
|
|
138375
|
-
Check your environment and unset or correct any Cloudflare credential variables, or run \`wrangler
|
|
138540
|
+
Check your environment and unset or correct any Cloudflare credential variables, or run \`wrangler login\` to re-authenticate.
|
|
138376
138541
|
You can also skip this account check by adding an \`account_id\` in your ${configFileName(void 0)} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,
|
|
138377
138542
|
{ telemetryMessage: "user account fetch permission denied" }
|
|
138378
138543
|
);
|
|
138379
138544
|
}
|
|
138380
138545
|
throw new UserError(
|
|
138381
138546
|
`Failed to automatically retrieve account IDs for the logged in user.
|
|
138382
|
-
You may have incorrect permissions on your API token. You can skip this account check by adding an \`account_id\` in your ${configFileName(void 0)} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,
|
|
138547
|
+
You may have incorrect permissions on your API token, or your authentication may have expired. Try running \`wrangler login\` to re-authenticate. You can also skip this account check by adding an \`account_id\` in your ${configFileName(void 0)} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,
|
|
138383
138548
|
{ telemetryMessage: "user account fetch permission denied" }
|
|
138384
138549
|
);
|
|
138385
138550
|
} else {
|
|
@@ -138393,7 +138558,8 @@ You may have incorrect permissions on your API token. You can skip this account
|
|
|
138393
138558
|
if (usableAccounts.length === 0 && throwOnEmpty) {
|
|
138394
138559
|
throw new UserError(
|
|
138395
138560
|
`Failed to automatically retrieve account IDs for the logged in user.
|
|
138396
|
-
In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your ${configFileName(void 0)} file
|
|
138561
|
+
In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your ${configFileName(void 0)} file.
|
|
138562
|
+
Alternatively, try running \`wrangler login\` to re-authenticate.`,
|
|
138397
138563
|
{ telemetryMessage: "user account fetch empty" }
|
|
138398
138564
|
);
|
|
138399
138565
|
}
|
|
@@ -138577,7 +138743,7 @@ function isReturningFromAuthServer(query) {
|
|
|
138577
138743
|
telemetryMessage: "user oauth invalid returned state"
|
|
138578
138744
|
});
|
|
138579
138745
|
}
|
|
138580
|
-
|
|
138746
|
+
assert55__default.default(!Array.isArray(code));
|
|
138581
138747
|
oauthFlowState.authorizationCode = code;
|
|
138582
138748
|
oauthFlowState.hasAuthCodeBeenExchangedForAccessToken = false;
|
|
138583
138749
|
return true;
|
|
@@ -138787,13 +138953,13 @@ async function getOauthToken(options) {
|
|
|
138787
138953
|
if (error3 || closeErr) {
|
|
138788
138954
|
reject(error3 || closeErr);
|
|
138789
138955
|
} else {
|
|
138790
|
-
|
|
138956
|
+
assert55__default.default(token);
|
|
138791
138957
|
resolve33(token);
|
|
138792
138958
|
}
|
|
138793
138959
|
});
|
|
138794
138960
|
}
|
|
138795
138961
|
__name(finish, "finish");
|
|
138796
|
-
|
|
138962
|
+
assert55__default.default(req.url, "This request doesn't have a URL");
|
|
138797
138963
|
const { pathname, query } = Url__default.default.parse(req.url, true);
|
|
138798
138964
|
if (req.method !== "GET") {
|
|
138799
138965
|
return res.end("OK");
|
|
@@ -138999,7 +139165,7 @@ async function getOrSelectAccountId(config) {
|
|
|
138999
139165
|
}))
|
|
139000
139166
|
});
|
|
139001
139167
|
const account = accounts.find((a7) => a7.id === accountID);
|
|
139002
|
-
|
|
139168
|
+
assert55__default.default(account, "Selected account not found in accounts list");
|
|
139003
139169
|
saveAccountToCache({ id: account.id, name: account.name });
|
|
139004
139170
|
return accountID;
|
|
139005
139171
|
} catch (e9) {
|
|
@@ -141161,7 +141327,7 @@ var init_paths = __esm({
|
|
|
141161
141327
|
function dedent3(strings, ...values) {
|
|
141162
141328
|
const raw = String.raw({ raw: strings }, ...values);
|
|
141163
141329
|
let lines = raw.split("\n");
|
|
141164
|
-
|
|
141330
|
+
assert55__default.default(lines.length > 0);
|
|
141165
141331
|
if (lines[lines.length - 1].trim() === "") {
|
|
141166
141332
|
lines = lines.slice(0, lines.length - 1);
|
|
141167
141333
|
}
|
|
@@ -141301,12 +141467,12 @@ function getEntryPointFromMetafile(entryFile, metafile) {
|
|
|
141301
141467
|
);
|
|
141302
141468
|
if (entryPoints.length !== 1) {
|
|
141303
141469
|
const entryPointList = entryPoints.map(([_input, output]) => output.entryPoint).join("\n");
|
|
141304
|
-
|
|
141470
|
+
assert55__default.default(
|
|
141305
141471
|
entryPoints.length > 0,
|
|
141306
141472
|
`Cannot find entry-point "${entryFile}" in generated bundle.
|
|
141307
141473
|
${entryPointList}`
|
|
141308
141474
|
);
|
|
141309
|
-
|
|
141475
|
+
assert55__default.default(
|
|
141310
141476
|
entryPoints.length < 2,
|
|
141311
141477
|
`More than one entry-point found for generated bundle.
|
|
141312
141478
|
${entryPointList}`
|
|
@@ -141354,7 +141520,7 @@ var init_cloudflare_internal = __esm({
|
|
|
141354
141520
|
Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
|
|
141355
141521
|
Did you mean to create a ES Module format Worker?
|
|
141356
141522
|
If so, try adding \`export default { ... }\` in your entry-point.
|
|
141357
|
-
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers
|
|
141523
|
+
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
|
|
141358
141524
|
`
|
|
141359
141525
|
}
|
|
141360
141526
|
]
|
|
@@ -141468,7 +141634,7 @@ function errorOnServiceWorkerFormat(build5, nodeJsModuleRegexp) {
|
|
|
141468
141634
|
Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
|
|
141469
141635
|
Did you mean to create a ES Module format Worker?
|
|
141470
141636
|
If so, try adding \`export default { ... }\` in your entry-point.
|
|
141471
|
-
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers
|
|
141637
|
+
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
|
|
141472
141638
|
`
|
|
141473
141639
|
}
|
|
141474
141640
|
]
|
|
@@ -141557,7 +141723,7 @@ function handleNodeJSGlobals(build5, inject, polyfill2) {
|
|
|
141557
141723
|
);
|
|
141558
141724
|
}
|
|
141559
141725
|
const moduleInjects = injectsByModule.get(module2);
|
|
141560
|
-
|
|
141726
|
+
assert55__default.default(moduleInjects);
|
|
141561
141727
|
moduleInjects.push({ injectedName, exportName, importName });
|
|
141562
141728
|
}
|
|
141563
141729
|
build5.initialOptions.inject = [
|
|
@@ -141572,9 +141738,9 @@ function handleNodeJSGlobals(build5, inject, polyfill2) {
|
|
|
141572
141738
|
}));
|
|
141573
141739
|
build5.onLoad({ filter: UNENV_VIRTUAL_MODULE_RE }, ({ path: path92 }) => {
|
|
141574
141740
|
const module2 = virtualModulePathToSpecifier.get(path92);
|
|
141575
|
-
|
|
141741
|
+
assert55__default.default(module2, `Expected ${path92} to be mapped to a module specifier`);
|
|
141576
141742
|
const injects = injectsByModule.get(module2);
|
|
141577
|
-
|
|
141743
|
+
assert55__default.default(injects, `Expected ${module2} to inject values`);
|
|
141578
141744
|
const imports = injects.map(
|
|
141579
141745
|
({ exportName, importName }) => importName === exportName ? exportName : `${exportName} as ${importName}`
|
|
141580
141746
|
);
|
|
@@ -141655,7 +141821,7 @@ var init_nodejs_compat = __esm({
|
|
|
141655
141821
|
Your worker has no default export, which means it is assumed to be a Service Worker format Worker.
|
|
141656
141822
|
Did you mean to create a ES Module format Worker?
|
|
141657
141823
|
If so, try adding \`export default { ... }\` in your entry-point.
|
|
141658
|
-
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers
|
|
141824
|
+
See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
|
|
141659
141825
|
`
|
|
141660
141826
|
}
|
|
141661
141827
|
]
|
|
@@ -143920,10 +144086,10 @@ var init_CommandRegistry = __esm({
|
|
|
143920
144086
|
* console.log(subtree); // Output: empty Map if 'wrangler hello' has no further subcommands
|
|
143921
144087
|
*/
|
|
143922
144088
|
#resolveDefinitionNode(node2) {
|
|
143923
|
-
|
|
144089
|
+
assert55__default.default(node2.definition);
|
|
143924
144090
|
const chain2 = this.#resolveDefinitionChain(node2.definition);
|
|
143925
144091
|
const resolvedDef = chain2.find((def) => def.type !== "alias");
|
|
143926
|
-
|
|
144092
|
+
assert55__default.default(resolvedDef);
|
|
143927
144093
|
const { subtree } = node2.definition.type !== "alias" ? node2 : this.#findNodeFor(resolvedDef.command) ?? node2;
|
|
143928
144094
|
const definition = {
|
|
143929
144095
|
// take all properties from the resolved alias
|
|
@@ -157780,7 +157946,7 @@ var init_commands2 = __esm({
|
|
|
157780
157946
|
"",
|
|
157781
157947
|
(api) => api.list()
|
|
157782
157948
|
)).map((key) => {
|
|
157783
|
-
|
|
157949
|
+
assert55__default.default(key.metadata, "metadata is always present in API list response");
|
|
157784
157950
|
return {
|
|
157785
157951
|
id: key.metadata.uuid,
|
|
157786
157952
|
store_id: args.storeId,
|
|
@@ -158806,7 +158972,7 @@ async function deployContainers(config, normalisedContainerConfig, { versionId,
|
|
|
158806
158972
|
}
|
|
158807
158973
|
);
|
|
158808
158974
|
}
|
|
158809
|
-
|
|
158975
|
+
assert55__default.default(
|
|
158810
158976
|
targetDurableObject && targetDurableObject.namespace_id !== void 0
|
|
158811
158977
|
);
|
|
158812
158978
|
await apply(
|
|
@@ -158822,7 +158988,7 @@ async function deployContainers(config, normalisedContainerConfig, { versionId,
|
|
|
158822
158988
|
const targetDurableObject = maybeAllDurableObjects.find(
|
|
158823
158989
|
(durableObject) => durableObject.class === container.class_name && durableObject.script === scriptName
|
|
158824
158990
|
);
|
|
158825
|
-
|
|
158991
|
+
assert55__default.default(targetDurableObject, "Durable Object not returned from list API");
|
|
158826
158992
|
await apply(
|
|
158827
158993
|
{
|
|
158828
158994
|
imageRef,
|
|
@@ -160198,7 +160364,7 @@ var init_config5 = __esm({
|
|
|
160198
160364
|
}
|
|
160199
160365
|
const normalizedContainers = [];
|
|
160200
160366
|
for (const container of config.containers) {
|
|
160201
|
-
|
|
160367
|
+
assert55__default.default(container.name, "container name should have been set by validation");
|
|
160202
160368
|
const allDOs = getDurableObjectClassNameToUseSQLiteMap(config.migrations);
|
|
160203
160369
|
if (!allDOs.has(container.class_name) && config.durable_objects.bindings.find(
|
|
160204
160370
|
(doBinding) => doBinding.class_name === container.class_name
|
|
@@ -160278,12 +160444,12 @@ var init_config5 = __esm({
|
|
|
160278
160444
|
}
|
|
160279
160445
|
const maybeDockerfile = isDockerfile(container.image, config.configPath);
|
|
160280
160446
|
if (maybeDockerfile) {
|
|
160281
|
-
|
|
160447
|
+
assert55__default.default(
|
|
160282
160448
|
path3__namespace.default.isAbsolute(container.image),
|
|
160283
160449
|
"Dockerfile path should be absolute"
|
|
160284
160450
|
);
|
|
160285
160451
|
const imageBuildContext = container.image_build_context ?? path3.dirname(container.image);
|
|
160286
|
-
|
|
160452
|
+
assert55__default.default(
|
|
160287
160453
|
path3__namespace.default.isAbsolute(imageBuildContext),
|
|
160288
160454
|
"resolved image_build_context should be defined"
|
|
160289
160455
|
);
|
|
@@ -168525,7 +168691,7 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
168525
168691
|
const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
|
|
168526
168692
|
const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
|
|
168527
168693
|
if (hasManifest && main2.type === "esm") {
|
|
168528
|
-
|
|
168694
|
+
assert55__default.default(modules !== void 0);
|
|
168529
168695
|
const subDirs = new Set(
|
|
168530
168696
|
modules.map((module2) => path3__namespace.default.posix.dirname(module2.name))
|
|
168531
168697
|
);
|
|
@@ -169065,7 +169231,7 @@ async function listDeploymentsAndChoose(deployments, args = {}) {
|
|
|
169065
169231
|
label: "deployment"
|
|
169066
169232
|
});
|
|
169067
169233
|
const chosenDeployment = deployments.find((d8) => d8.id === deployment);
|
|
169068
|
-
|
|
169234
|
+
assert55__default.default(chosenDeployment);
|
|
169069
169235
|
return chosenDeployment;
|
|
169070
169236
|
}
|
|
169071
169237
|
async function pickDeployment(deploymentIdPrefix) {
|
|
@@ -169678,7 +169844,7 @@ async function getLocation(args, options = {}) {
|
|
|
169678
169844
|
const pops = locationToPops[location];
|
|
169679
169845
|
if (pops.length === 1) {
|
|
169680
169846
|
const pop = pops.pop();
|
|
169681
|
-
|
|
169847
|
+
assert55__default.default(pop);
|
|
169682
169848
|
return pop.location;
|
|
169683
169849
|
}
|
|
169684
169850
|
const chosenPop = await inputPrompt({
|
|
@@ -172916,7 +173082,7 @@ var init_t_DYl0qC9V = __esm({
|
|
|
172916
173082
|
this.complete(n8);
|
|
172917
173083
|
}
|
|
172918
173084
|
setup(a7, o7, s7) {
|
|
172919
|
-
switch (
|
|
173085
|
+
switch (assert55__default.default(s7 === `zsh` || s7 === `bash` || s7 === `fish` || s7 === `powershell`, `Unsupported shell`), s7) {
|
|
172920
173086
|
case `zsh`: {
|
|
172921
173087
|
let e9 = t2(a7, o7);
|
|
172922
173088
|
console.log(e9);
|
|
@@ -173075,7 +173241,8 @@ var init_complete = __esm({
|
|
|
173075
173241
|
},
|
|
173076
173242
|
behaviour: {
|
|
173077
173243
|
printBanner: false,
|
|
173078
|
-
provideConfig: false
|
|
173244
|
+
provideConfig: false,
|
|
173245
|
+
skipSkillsPrompt: true
|
|
173079
173246
|
},
|
|
173080
173247
|
positionalArgs: ["shell"],
|
|
173081
173248
|
args: {
|
|
@@ -177367,7 +177534,7 @@ function errorCallback() {
|
|
|
177367
177534
|
}
|
|
177368
177535
|
}
|
|
177369
177536
|
var errorsInstrumented;
|
|
177370
|
-
var
|
|
177537
|
+
var init_errors3 = __esm({
|
|
177371
177538
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/errors.js"() {
|
|
177372
177539
|
init_import_meta_url();
|
|
177373
177540
|
init_esm7();
|
|
@@ -178389,7 +178556,7 @@ var init_hubextensions = __esm({
|
|
|
178389
178556
|
init_esm7();
|
|
178390
178557
|
init_debug_build2();
|
|
178391
178558
|
init_hub();
|
|
178392
|
-
|
|
178559
|
+
init_errors3();
|
|
178393
178560
|
init_sampling();
|
|
178394
178561
|
init_transaction();
|
|
178395
178562
|
__name(traceHeaders, "traceHeaders");
|
|
@@ -184750,7 +184917,9 @@ function createHandler(def, argv) {
|
|
|
184750
184917
|
if (bannerEnabled) {
|
|
184751
184918
|
await printWranglerBanner();
|
|
184752
184919
|
}
|
|
184753
|
-
|
|
184920
|
+
if (!def.behaviour?.skipSkillsPrompt || args.installSkills) {
|
|
184921
|
+
await maybeInstallCloudflareSkillsGlobally(args.installSkills);
|
|
184922
|
+
}
|
|
184754
184923
|
if (!getWranglerHideBanner()) {
|
|
184755
184924
|
if (def.metadata.deprecated) {
|
|
184756
184925
|
logger.warn(def.metadata.deprecatedMessage);
|
|
@@ -185659,7 +185828,7 @@ async function executeLocally({
|
|
|
185659
185828
|
} finally {
|
|
185660
185829
|
await mf.dispose();
|
|
185661
185830
|
}
|
|
185662
|
-
|
|
185831
|
+
assert55__default.default(Array.isArray(results));
|
|
185663
185832
|
const allResults = results.map((result) => ({
|
|
185664
185833
|
results: (result.results ?? []).map(
|
|
185665
185834
|
(row) => Object.fromEntries(
|
|
@@ -187723,7 +187892,7 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
|
|
|
187723
187892
|
requireRemote
|
|
187724
187893
|
);
|
|
187725
187894
|
if (pendingResources.length > 0) {
|
|
187726
|
-
|
|
187895
|
+
assert55__default.default(
|
|
187727
187896
|
configPath,
|
|
187728
187897
|
"Provisioning resources is not possible without a config file"
|
|
187729
187898
|
);
|
|
@@ -188016,7 +188185,7 @@ var init_bindings2 = __esm({
|
|
|
188016
188185
|
);
|
|
188017
188186
|
}
|
|
188018
188187
|
async isConnectedToExistingResource() {
|
|
188019
|
-
|
|
188188
|
+
assert55__default.default(typeof this.binding.bucket_name !== "symbol");
|
|
188020
188189
|
if (!this.binding.bucket_name) {
|
|
188021
188190
|
return false;
|
|
188022
188191
|
}
|
|
@@ -188063,7 +188232,7 @@ var init_bindings2 = __esm({
|
|
|
188063
188232
|
);
|
|
188064
188233
|
}
|
|
188065
188234
|
async isConnectedToExistingResource() {
|
|
188066
|
-
|
|
188235
|
+
assert55__default.default(typeof this.binding.namespace !== "symbol");
|
|
188067
188236
|
if (!this.binding.namespace) {
|
|
188068
188237
|
return false;
|
|
188069
188238
|
}
|
|
@@ -188106,7 +188275,7 @@ var init_bindings2 = __esm({
|
|
|
188106
188275
|
);
|
|
188107
188276
|
}
|
|
188108
188277
|
async isConnectedToExistingResource() {
|
|
188109
|
-
|
|
188278
|
+
assert55__default.default(typeof this.binding.namespace !== "symbol");
|
|
188110
188279
|
if (!this.binding.namespace) {
|
|
188111
188280
|
return false;
|
|
188112
188281
|
}
|
|
@@ -188192,7 +188361,7 @@ var init_bindings2 = __esm({
|
|
|
188192
188361
|
return false;
|
|
188193
188362
|
}
|
|
188194
188363
|
async isConnectedToExistingResource() {
|
|
188195
|
-
|
|
188364
|
+
assert55__default.default(typeof this.binding.database_name !== "symbol");
|
|
188196
188365
|
if (!this.binding.database_name) {
|
|
188197
188366
|
return false;
|
|
188198
188367
|
}
|
|
@@ -188601,7 +188770,7 @@ async function getKVNamespaceId({ namespace, preview, binding, "namespace-id": n
|
|
|
188601
188770
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
188602
188771
|
} else if (previewIsDefined) {
|
|
188603
188772
|
if (getFlag("RESOURCES_PROVISION")) {
|
|
188604
|
-
|
|
188773
|
+
assert55__default.default(binding);
|
|
188605
188774
|
const nsId = await getIdFromSettings(config, binding, isLocal2);
|
|
188606
188775
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
188607
188776
|
}
|
|
@@ -188613,10 +188782,10 @@ async function getKVNamespaceId({ namespace, preview, binding, "namespace-id": n
|
|
|
188613
188782
|
const bindingHasOnlyOneId = configNamespace.id && !configNamespace.preview_id || !configNamespace.id && configNamespace.preview_id;
|
|
188614
188783
|
if (bindingHasOnlyOneId) {
|
|
188615
188784
|
const nsId = configNamespace.id || configNamespace.preview_id;
|
|
188616
|
-
|
|
188785
|
+
assert55__default.default(nsId);
|
|
188617
188786
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
188618
188787
|
} else if (getFlag("RESOURCES_PROVISION") && !configNamespace.id && !configNamespace.preview_id) {
|
|
188619
|
-
|
|
188788
|
+
assert55__default.default(binding);
|
|
188620
188789
|
const nsId = await getIdFromSettings(config, binding, isLocal2);
|
|
188621
188790
|
return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
|
|
188622
188791
|
} else {
|
|
@@ -188868,7 +189037,7 @@ var init_delete6 = __esm({
|
|
|
188868
189037
|
logger.log(`--dry-run: exiting now.`);
|
|
188869
189038
|
return;
|
|
188870
189039
|
}
|
|
188871
|
-
|
|
189040
|
+
assert55__default.default(accountId, "Missing accountId");
|
|
188872
189041
|
const confirmed = args.force || await confirm(
|
|
188873
189042
|
`Are you sure you want to delete ${scriptName}? This action cannot be undone.`
|
|
188874
189043
|
);
|
|
@@ -189505,7 +189674,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
|
189505
189674
|
logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
|
|
189506
189675
|
return { manifest: void 0, namespace: void 0 };
|
|
189507
189676
|
}
|
|
189508
|
-
|
|
189677
|
+
assert55__default.default(accountId, "Missing accountId");
|
|
189509
189678
|
const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
|
|
189510
189679
|
const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
|
|
189511
189680
|
complianceConfig,
|
|
@@ -200650,13 +200819,13 @@ var require_esprima2 = __commonJS({
|
|
|
200650
200819
|
/***/
|
|
200651
200820
|
function(module3, exports2) {
|
|
200652
200821
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
200653
|
-
function
|
|
200822
|
+
function assert64(condition, message) {
|
|
200654
200823
|
if (!condition) {
|
|
200655
200824
|
throw new Error("ASSERT: " + message);
|
|
200656
200825
|
}
|
|
200657
200826
|
}
|
|
200658
|
-
__name(
|
|
200659
|
-
exports2.assert =
|
|
200827
|
+
__name(assert64, "assert");
|
|
200828
|
+
exports2.assert = assert64;
|
|
200660
200829
|
},
|
|
200661
200830
|
/* 10 */
|
|
200662
200831
|
/***/
|
|
@@ -214377,12 +214546,12 @@ var require_lib4 = __commonJS({
|
|
|
214377
214546
|
return x6;
|
|
214378
214547
|
}
|
|
214379
214548
|
__name(nonNull, "nonNull");
|
|
214380
|
-
function
|
|
214549
|
+
function assert64(x6) {
|
|
214381
214550
|
if (!x6) {
|
|
214382
214551
|
throw new Error("Assert fail");
|
|
214383
214552
|
}
|
|
214384
214553
|
}
|
|
214385
|
-
__name(
|
|
214554
|
+
__name(assert64, "assert");
|
|
214386
214555
|
var TSErrors = ParseErrorEnum`typescript`({
|
|
214387
214556
|
AbstractMethodHasImplementation: /* @__PURE__ */ __name(({
|
|
214388
214557
|
methodName
|
|
@@ -215410,7 +215579,7 @@ var require_lib4 = __commonJS({
|
|
|
215410
215579
|
return this.finishNode(t12, "TSTypeAnnotation");
|
|
215411
215580
|
}
|
|
215412
215581
|
tsParseType() {
|
|
215413
|
-
|
|
215582
|
+
assert64(this.state.inType);
|
|
215414
215583
|
const type = this.tsParseNonConditionalType();
|
|
215415
215584
|
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
|
|
215416
215585
|
return type;
|
|
@@ -216458,7 +216627,7 @@ var require_lib4 = __commonJS({
|
|
|
216458
216627
|
return arrow.node;
|
|
216459
216628
|
}
|
|
216460
216629
|
if (!jsx2) {
|
|
216461
|
-
|
|
216630
|
+
assert64(!this.hasPlugin("jsx"));
|
|
216462
216631
|
typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state3);
|
|
216463
216632
|
if (!typeCast.error) return typeCast.node;
|
|
216464
216633
|
}
|
|
@@ -221171,7 +221340,7 @@ var init_dist11 = __esm({
|
|
|
221171
221340
|
|
|
221172
221341
|
// src/autoconfig/errors.ts
|
|
221173
221342
|
var AutoConfigFrameworkConfigurationError;
|
|
221174
|
-
var
|
|
221343
|
+
var init_errors4 = __esm({
|
|
221175
221344
|
"src/autoconfig/errors.ts"() {
|
|
221176
221345
|
init_import_meta_url();
|
|
221177
221346
|
init_dist();
|
|
@@ -221239,7 +221408,7 @@ var init_framework_class = __esm({
|
|
|
221239
221408
|
init_import_meta_url();
|
|
221240
221409
|
init_semiver();
|
|
221241
221410
|
init_logger();
|
|
221242
|
-
|
|
221411
|
+
init_errors4();
|
|
221243
221412
|
init_packages2();
|
|
221244
221413
|
exports.experimental_AutoConfigFramework = class {
|
|
221245
221414
|
static {
|
|
@@ -221249,7 +221418,7 @@ var init_framework_class = __esm({
|
|
|
221249
221418
|
name;
|
|
221250
221419
|
#frameworkVersion;
|
|
221251
221420
|
get frameworkVersion() {
|
|
221252
|
-
|
|
221421
|
+
assert55__default.default(
|
|
221253
221422
|
this.#frameworkVersion,
|
|
221254
221423
|
`The version for ${JSON.stringify(this.name)} is unexpectedly missing`
|
|
221255
221424
|
);
|
|
@@ -221278,7 +221447,7 @@ var init_framework_class = __esm({
|
|
|
221278
221447
|
frameworkPackageInfo.name,
|
|
221279
221448
|
projectPath
|
|
221280
221449
|
);
|
|
221281
|
-
|
|
221450
|
+
assert55__default.default(
|
|
221282
221451
|
frameworkVersion,
|
|
221283
221452
|
`Unable to detect the version of the \`${frameworkPackageInfo.name}\` package`
|
|
221284
221453
|
);
|
|
@@ -221569,7 +221738,7 @@ var init_packages3 = __esm({
|
|
|
221569
221738
|
const pkgJsonPath = path3__namespace.default.join(process.cwd(), "package.json");
|
|
221570
221739
|
const pkgJson = parsePackageJSON(readFileSync(pkgJsonPath), pkgJsonPath);
|
|
221571
221740
|
const deps = config.dev ? pkgJson.devDependencies : pkgJson.dependencies;
|
|
221572
|
-
|
|
221741
|
+
assert55__default.default(deps, "dependencies should be defined");
|
|
221573
221742
|
for (const pkg of packages) {
|
|
221574
221743
|
const versionMarker = pkg.lastIndexOf("@");
|
|
221575
221744
|
if (versionMarker > 0) {
|
|
@@ -221595,7 +221764,7 @@ async function updateAngularJson(projectName, angularJson) {
|
|
|
221595
221764
|
const architectSection = angularJson.projects[projectName].architect;
|
|
221596
221765
|
architectSection.build.options.outputPath = "dist";
|
|
221597
221766
|
architectSection.build.options.outputMode = "server";
|
|
221598
|
-
|
|
221767
|
+
assert55__default.default(architectSection.build.options.ssr);
|
|
221599
221768
|
if (typeof architectSection.build.options.ssr === "boolean") {
|
|
221600
221769
|
architectSection.build.options.ssr = {};
|
|
221601
221770
|
}
|
|
@@ -222479,13 +222648,13 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
|
|
|
222479
222648
|
}`
|
|
222480
222649
|
);
|
|
222481
222650
|
}
|
|
222482
|
-
|
|
222651
|
+
assert55__default.default(node2.type === "ObjectExpression");
|
|
222483
222652
|
const futureKey = node2.properties.findIndex(
|
|
222484
222653
|
(p7) => p7.type === "ObjectProperty" && p7.key.type === "Identifier" && p7.key.name === "future" && p7.value.type === "ObjectExpression"
|
|
222485
222654
|
);
|
|
222486
222655
|
if (futureKey !== -1) {
|
|
222487
222656
|
const future = node2.properties[futureKey];
|
|
222488
|
-
|
|
222657
|
+
assert55__default.default(
|
|
222489
222658
|
future.type === "ObjectProperty" && future.value.type === "ObjectExpression"
|
|
222490
222659
|
);
|
|
222491
222660
|
const viteEnvironment = future.value.properties.findIndex(
|
|
@@ -222493,7 +222662,7 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
|
|
|
222493
222662
|
);
|
|
222494
222663
|
if (viteEnvironment !== -1) {
|
|
222495
222664
|
const prop = future.value.properties[viteEnvironment];
|
|
222496
|
-
|
|
222665
|
+
assert55__default.default(
|
|
222497
222666
|
prop.type === "ObjectProperty" && prop.value.type === "BooleanLiteral"
|
|
222498
222667
|
);
|
|
222499
222668
|
prop.value.value = true;
|
|
@@ -223001,7 +223170,7 @@ function addVikePhotonToVikeConfigExportObject(n8, programNode) {
|
|
|
223001
223170
|
);
|
|
223002
223171
|
configObject.properties.push(configTargetProp);
|
|
223003
223172
|
}
|
|
223004
|
-
|
|
223173
|
+
assert55__default.default(configTargetProp && t5.ArrayExpression.check(configTargetProp.value));
|
|
223005
223174
|
const vikePhotonLocalName = getVikePhotonImportLocalName(programNode) ?? "vikePhoton";
|
|
223006
223175
|
if (!configTargetProp.value.elements.some(
|
|
223007
223176
|
(el) => el?.type === "Identifier" && el.name === vikePhotonLocalName
|
|
@@ -223279,15 +223448,15 @@ async function updateWakuConfig(projectPath) {
|
|
|
223279
223448
|
return this.traverse(n8);
|
|
223280
223449
|
}
|
|
223281
223450
|
const config = n8.node.arguments[0];
|
|
223282
|
-
|
|
223451
|
+
assert55__default.default(t6.ObjectExpression.check(config));
|
|
223283
223452
|
const viteConfig = config.properties.find(
|
|
223284
223453
|
(prop) => isViteProp(prop)
|
|
223285
223454
|
)?.value;
|
|
223286
|
-
|
|
223455
|
+
assert55__default.default(t6.ObjectExpression.check(viteConfig));
|
|
223287
223456
|
const pluginsProp = viteConfig.properties.find(
|
|
223288
223457
|
(prop) => isPluginsProp2(prop)
|
|
223289
223458
|
);
|
|
223290
|
-
|
|
223459
|
+
assert55__default.default(pluginsProp && t6.ArrayExpression.check(pluginsProp.value));
|
|
223291
223460
|
if (!pluginsProp.value.elements.some(
|
|
223292
223461
|
(el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
|
|
223293
223462
|
)) {
|
|
@@ -223389,13 +223558,13 @@ function getFrameworkPackageInfo(frameworkId) {
|
|
|
223389
223558
|
const targetedFramework = allKnownFrameworks.find(
|
|
223390
223559
|
(framework) => framework.id === frameworkId
|
|
223391
223560
|
);
|
|
223392
|
-
|
|
223561
|
+
assert55__default.default(
|
|
223393
223562
|
targetedFramework,
|
|
223394
223563
|
`Could not determine framework package info for ${JSON.stringify(
|
|
223395
223564
|
frameworkId
|
|
223396
223565
|
)}`
|
|
223397
223566
|
);
|
|
223398
|
-
|
|
223567
|
+
assert55__default.default(
|
|
223399
223568
|
targetedFramework.supported,
|
|
223400
223569
|
`Framework unexpectedly not supported ${JSON.stringify(frameworkId)}`
|
|
223401
223570
|
);
|
|
@@ -223663,7 +223832,7 @@ function isFrameworkSupported(frameworkId) {
|
|
|
223663
223832
|
const targetedFramework = allFrameworksInfos.find(
|
|
223664
223833
|
(framework) => framework.id === frameworkId
|
|
223665
223834
|
);
|
|
223666
|
-
|
|
223835
|
+
assert55__default.default(
|
|
223667
223836
|
targetedFramework,
|
|
223668
223837
|
`Unexpected unknown framework id: ${JSON.stringify(frameworkId)}`
|
|
223669
223838
|
);
|
|
@@ -235823,7 +235992,7 @@ var init_framework_detection = __esm({
|
|
|
235823
235992
|
}
|
|
235824
235993
|
});
|
|
235825
235994
|
function assertNonConfigured(details) {
|
|
235826
|
-
|
|
235995
|
+
assert55__default.default(
|
|
235827
235996
|
details.configured === false,
|
|
235828
235997
|
"Error: expected the current project not to be already configured"
|
|
235829
235998
|
);
|
|
@@ -236225,7 +236394,7 @@ async function runAutoConfig(autoConfigDetails, autoConfigOptions = {}) {
|
|
|
236225
236394
|
);
|
|
236226
236395
|
}
|
|
236227
236396
|
}
|
|
236228
|
-
|
|
236397
|
+
assert55__default.default(
|
|
236229
236398
|
autoConfigDetails.outputDir,
|
|
236230
236399
|
"The Output Directory is unexpectedly missing"
|
|
236231
236400
|
);
|
|
@@ -236731,7 +236900,7 @@ async function maybeDelegateToOpenNextDeployCommand(projectRoot) {
|
|
|
236731
236900
|
"OpenNext project detected, calling `opennextjs-cloudflare deploy`"
|
|
236732
236901
|
);
|
|
236733
236902
|
const deployArgIdx = process.argv.findIndex((arg) => arg === "deploy");
|
|
236734
|
-
|
|
236903
|
+
assert55__default.default(deployArgIdx !== -1, "Could not find `deploy` argument");
|
|
236735
236904
|
const deployArguments = process.argv.slice(deployArgIdx + 1);
|
|
236736
236905
|
const { npx } = await getPackageManager();
|
|
236737
236906
|
await runCommand2(
|
|
@@ -236936,7 +237105,7 @@ var init_deploy2 = __esm({
|
|
|
236936
237105
|
);
|
|
236937
237106
|
}
|
|
236938
237107
|
if (!args.dryRun) {
|
|
236939
|
-
|
|
237108
|
+
assert55__default.default(accountId, "Missing account ID");
|
|
236940
237109
|
await verifyWorkerMatchesCITag(
|
|
236941
237110
|
config,
|
|
236942
237111
|
accountId,
|
|
@@ -237217,8 +237386,8 @@ async function runSearch(searchTerm) {
|
|
|
237217
237386
|
hitsPerPage: "1",
|
|
237218
237387
|
getRankingInfo: "0"
|
|
237219
237388
|
});
|
|
237220
|
-
|
|
237221
|
-
|
|
237389
|
+
assert55__default.default(id, "Missing Algolia App ID");
|
|
237390
|
+
assert55__default.default(key, "Missing Algolia Key");
|
|
237222
237391
|
const searchResp = await (0, import_undici17.fetch)(
|
|
237223
237392
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
|
237224
237393
|
{
|
|
@@ -240736,7 +240905,7 @@ This action is irreversible and will permanently delete all data in the KV names
|
|
|
240736
240905
|
}
|
|
240737
240906
|
namespaceId = namespace.id;
|
|
240738
240907
|
}
|
|
240739
|
-
|
|
240908
|
+
assert55.strict(namespaceId, "namespaceId should be defined");
|
|
240740
240909
|
logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
|
|
240741
240910
|
const updatedNamespace = await updateKVNamespace(
|
|
240742
240911
|
config,
|
|
@@ -240776,10 +240945,22 @@ This action is irreversible and will permanently delete all data in the KV names
|
|
|
240776
240945
|
type: "string",
|
|
240777
240946
|
describe: "Arbitrary JSON that is associated with a key",
|
|
240778
240947
|
coerce: /* @__PURE__ */ __name((jsonStr) => {
|
|
240948
|
+
let parsed;
|
|
240779
240949
|
try {
|
|
240780
|
-
|
|
240950
|
+
parsed = JSON.parse(jsonStr);
|
|
240781
240951
|
} catch {
|
|
240952
|
+
throw new CommandLineArgsError(
|
|
240953
|
+
`--metadata must be valid JSON. Received: ${jsonStr}`,
|
|
240954
|
+
{ telemetryMessage: "kv key put --metadata not valid JSON" }
|
|
240955
|
+
);
|
|
240782
240956
|
}
|
|
240957
|
+
if (parsed === null || Array.isArray(parsed) || typeof parsed !== "object") {
|
|
240958
|
+
throw new CommandLineArgsError(
|
|
240959
|
+
`--metadata must be a JSON object. Received: ${jsonStr}`,
|
|
240960
|
+
{ telemetryMessage: "kv key put --metadata not a JSON object" }
|
|
240961
|
+
);
|
|
240962
|
+
}
|
|
240963
|
+
return parsed;
|
|
240783
240964
|
}, "coerce")
|
|
240784
240965
|
},
|
|
240785
240966
|
local: {
|
|
@@ -240836,7 +241017,7 @@ This action is irreversible and will permanently delete all data in the KV names
|
|
|
240836
241017
|
localMode
|
|
240837
241018
|
);
|
|
240838
241019
|
const value = args.path ? readFileSyncToBuffer(args.path) : args.value;
|
|
240839
|
-
|
|
241020
|
+
assert55.strict(value);
|
|
240840
241021
|
const metadataLog = metadata2 ? ` with metadata "${JSON.stringify(metadata2)}"` : "";
|
|
240841
241022
|
if (args.path) {
|
|
240842
241023
|
logger.log(
|
|
@@ -248997,10 +249178,11 @@ async function parseBulkInputToObject(input, includeNull = false) {
|
|
|
248997
249178
|
secretSource = "stdin";
|
|
248998
249179
|
try {
|
|
248999
249180
|
const rl = readline__default.default.createInterface({ input: process.stdin });
|
|
249000
|
-
|
|
249181
|
+
const pipedInputLines = [];
|
|
249001
249182
|
for await (const line of rl) {
|
|
249002
|
-
|
|
249183
|
+
pipedInputLines.push(line);
|
|
249003
249184
|
}
|
|
249185
|
+
const pipedInput = pipedInputLines.join("\n");
|
|
249004
249186
|
try {
|
|
249005
249187
|
content = parseJSON(pipedInput);
|
|
249006
249188
|
secretFormat = "json";
|
|
@@ -282421,7 +282603,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
|
|
|
282421
282603
|
const timeoutPromise = timersPromises.setTimeout(12e4, "timeout", { signal });
|
|
282422
282604
|
const serverPromise = new Promise((resolve33, reject) => {
|
|
282423
282605
|
const server = http__namespace.default.createServer(async (request4, response) => {
|
|
282424
|
-
|
|
282606
|
+
assert55__default.default(request4.url, "This request doesn't have a URL");
|
|
282425
282607
|
if (request4.method !== "GET") {
|
|
282426
282608
|
response.writeHead(405);
|
|
282427
282609
|
response.end("Method not allowed.");
|
|
@@ -287717,10 +287899,10 @@ var require_difflib = __commonJS({
|
|
|
287717
287899
|
"../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js"(exports) {
|
|
287718
287900
|
init_import_meta_url();
|
|
287719
287901
|
(function() {
|
|
287720
|
-
var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has,
|
|
287902
|
+
var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert64, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff2, indexOf = [].indexOf;
|
|
287721
287903
|
({ floor, max, min } = Math);
|
|
287722
287904
|
Heap = require_heap2();
|
|
287723
|
-
|
|
287905
|
+
assert64 = __require("assert");
|
|
287724
287906
|
_calculateRatio = /* @__PURE__ */ __name(function(matches, length) {
|
|
287725
287907
|
if (length) {
|
|
287726
287908
|
return 2 * matches / length;
|
|
@@ -288291,7 +288473,7 @@ var require_difflib = __commonJS({
|
|
|
288291
288473
|
}
|
|
288292
288474
|
_plainReplace(a7, alo, ahi, b10, blo, bhi) {
|
|
288293
288475
|
var first, g6, l7, len, len1, line, lines, m6, ref, second;
|
|
288294
|
-
|
|
288476
|
+
assert64(alo < ahi && blo < bhi);
|
|
288295
288477
|
if (bhi - blo < ahi - alo) {
|
|
288296
288478
|
first = this._dump("+", b10, blo, bhi);
|
|
288297
288479
|
second = this._dump("-", a7, alo, ahi);
|
|
@@ -296352,7 +296534,6 @@ var init_sql = __esm({
|
|
|
296352
296534
|
init_dist();
|
|
296353
296535
|
init_pretty_bytes();
|
|
296354
296536
|
import_undici20 = __toESM(require_undici());
|
|
296355
|
-
init_internal();
|
|
296356
296537
|
init_create_command();
|
|
296357
296538
|
init_logger();
|
|
296358
296539
|
init_auth_variables();
|
|
@@ -297417,7 +297598,9 @@ ${dashLink}`, {
|
|
|
297417
297598
|
script_name: scriptName,
|
|
297418
297599
|
class_name: workflow.class_name,
|
|
297419
297600
|
...workflow.limits && { limits: workflow.limits },
|
|
297420
|
-
...workflow.schedules && {
|
|
297601
|
+
...workflow.schedules && {
|
|
297602
|
+
schedules: (Array.isArray(workflow.schedules) ? workflow.schedules : [workflow.schedules]).map((cron) => ({ cron }))
|
|
297603
|
+
}
|
|
297421
297604
|
}),
|
|
297422
297605
|
headers: {
|
|
297423
297606
|
"Content-Type": "application/json"
|
|
@@ -302037,7 +302220,7 @@ function printTokenPermissions(user) {
|
|
|
302037
302220
|
const permissions = user.tokenPermissions?.map((scope) => scope.split(":")) ?? [];
|
|
302038
302221
|
if (user.authType !== "OAuth Token") {
|
|
302039
302222
|
return void logger.log(
|
|
302040
|
-
`\u{1F513} To see token permissions
|
|
302223
|
+
`\u{1F513} To see token permissions visit https://dash.cloudflare.com/${user.authType === "User API Token" ? "profile" : user.accounts[0].id}/api-tokens`
|
|
302041
302224
|
);
|
|
302042
302225
|
}
|
|
302043
302226
|
logger.log(`\u{1F513} Token Permissions:`);
|
|
@@ -303942,13 +304125,13 @@ ${ZERO_WIDTH_SPACE} Message: ${version5.annotations?.["workers/message"]
|
|
|
303942
304125
|
},
|
|
303943
304126
|
renderers: {
|
|
303944
304127
|
submit({ value: versionIds }) {
|
|
303945
|
-
|
|
304128
|
+
assert55__default.default(Array.isArray(versionIds));
|
|
303946
304129
|
const label = brandColor(
|
|
303947
304130
|
`${versionIds.length} Worker Version(s) selected`
|
|
303948
304131
|
);
|
|
303949
304132
|
const versions2 = versionIds?.map((versionId, i7) => {
|
|
303950
304133
|
const version5 = versionCache.get(versionId);
|
|
303951
|
-
|
|
304134
|
+
assert55__default.default(version5);
|
|
303952
304135
|
return `${grayBar}
|
|
303953
304136
|
${leftT} ${white(` Worker Version ${i7 + 1}: `, version5.id)}
|
|
303954
304137
|
${grayBar} ${gray(" Created: ", version5.metadata.created_on)}
|
|
@@ -304591,7 +304774,7 @@ var init_list25 = __esm({
|
|
|
304591
304774
|
const formattedDeployments = deployments.map((deployment) => {
|
|
304592
304775
|
const formattedVersions = deployment.versions.map((traffic) => {
|
|
304593
304776
|
const version5 = versionCache.get(traffic.version_id);
|
|
304594
|
-
|
|
304777
|
+
assert55__default.default(version5);
|
|
304595
304778
|
const percentage = brandColor(`(${traffic.percentage}%)`);
|
|
304596
304779
|
const details = formatLabelledValues(
|
|
304597
304780
|
{
|
|
@@ -304698,7 +304881,7 @@ var init_status3 = __esm({
|
|
|
304698
304881
|
);
|
|
304699
304882
|
const formattedVersions = latestDeployment.versions.map((traffic) => {
|
|
304700
304883
|
const version5 = versionCache.get(traffic.version_id);
|
|
304701
|
-
|
|
304884
|
+
assert55__default.default(version5);
|
|
304702
304885
|
const percentage = brandColor(`(${traffic.percentage}%)`);
|
|
304703
304886
|
const details = formatLabelledValues(
|
|
304704
304887
|
{
|
|
@@ -305650,7 +305833,7 @@ var init_secrets_validation = __esm({
|
|
|
305650
305833
|
});
|
|
305651
305834
|
async function getMigrationsToUpload(scriptName, props) {
|
|
305652
305835
|
const { config, accountId } = props;
|
|
305653
|
-
|
|
305836
|
+
assert55__default.default(accountId, "Missing accountId");
|
|
305654
305837
|
let migrations;
|
|
305655
305838
|
if (config.migrations.length > 0) {
|
|
305656
305839
|
let script;
|
|
@@ -306088,7 +306271,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
306088
306271
|
{ unsafeMetadata: config.unsafe?.metadata }
|
|
306089
306272
|
);
|
|
306090
306273
|
} else {
|
|
306091
|
-
|
|
306274
|
+
assert55__default.default(accountId, "Missing accountId");
|
|
306092
306275
|
if (getFlag("RESOURCES_PROVISION")) {
|
|
306093
306276
|
await provisionBindings(
|
|
306094
306277
|
bindings,
|
|
@@ -306411,7 +306594,7 @@ var init_upload5 = __esm({
|
|
|
306411
306594
|
}
|
|
306412
306595
|
const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
|
|
306413
306596
|
if (!args.dryRun) {
|
|
306414
|
-
|
|
306597
|
+
assert55__default.default(accountId, "Missing account ID");
|
|
306415
306598
|
await verifyWorkerMatchesCITag(
|
|
306416
306599
|
config,
|
|
306417
306600
|
accountId,
|
|
@@ -307402,14 +307585,15 @@ async function getLocalInstanceIdFromArgs(port, args) {
|
|
|
307402
307585
|
}
|
|
307403
307586
|
return id;
|
|
307404
307587
|
}
|
|
307405
|
-
async function updateLocalInstanceStatus(port, workflowName, instanceId, action) {
|
|
307588
|
+
async function updateLocalInstanceStatus(port, workflowName, instanceId, action, from) {
|
|
307589
|
+
const body = from ? { action, from } : { action };
|
|
307406
307590
|
await fetchLocalResult(
|
|
307407
307591
|
port,
|
|
307408
307592
|
`/workflows/${encodeURIComponent(workflowName)}/instances/${encodeURIComponent(instanceId)}/status`,
|
|
307409
307593
|
{
|
|
307410
307594
|
method: "PATCH",
|
|
307411
307595
|
headers: { "Content-Type": "application/json" },
|
|
307412
|
-
body: JSON.stringify(
|
|
307596
|
+
body: JSON.stringify(body)
|
|
307413
307597
|
}
|
|
307414
307598
|
);
|
|
307415
307599
|
}
|
|
@@ -310360,7 +310544,8 @@ async function getInstanceIdFromArgs(accountId, args, config) {
|
|
|
310360
310544
|
}
|
|
310361
310545
|
return id;
|
|
310362
310546
|
}
|
|
310363
|
-
async function updateInstanceStatus(config, accountId, workflowName, instanceId, status2) {
|
|
310547
|
+
async function updateInstanceStatus(config, accountId, workflowName, instanceId, status2, from) {
|
|
310548
|
+
const body = from ? { status: status2, from } : { status: status2 };
|
|
310364
310549
|
await fetchResult(
|
|
310365
310550
|
config,
|
|
310366
310551
|
`/accounts/${accountId}/workflows/${workflowName}/instances/${instanceId}/status`,
|
|
@@ -310369,7 +310554,7 @@ async function updateInstanceStatus(config, accountId, workflowName, instanceId,
|
|
|
310369
310554
|
headers: {
|
|
310370
310555
|
"Content-Type": "application/json"
|
|
310371
310556
|
},
|
|
310372
|
-
body: JSON.stringify(
|
|
310557
|
+
body: JSON.stringify(body)
|
|
310373
310558
|
}
|
|
310374
310559
|
);
|
|
310375
310560
|
}
|
|
@@ -310546,7 +310731,7 @@ function logStep(args, step) {
|
|
|
310546
310731
|
const latestAttempt = step.attempts.at(-1);
|
|
310547
310732
|
let delay = step.config.retries.delay;
|
|
310548
310733
|
if (latestAttempt !== void 0 && latestAttempt.success === false) {
|
|
310549
|
-
|
|
310734
|
+
assert55__default.default(
|
|
310550
310735
|
latestAttempt.end,
|
|
310551
310736
|
"end date always exists in the API for completed attempts"
|
|
310552
310737
|
);
|
|
@@ -310865,15 +311050,40 @@ var init_pause = __esm({
|
|
|
310865
311050
|
});
|
|
310866
311051
|
|
|
310867
311052
|
// src/workflows/commands/instances/restart.ts
|
|
311053
|
+
function getRestartFrom(args) {
|
|
311054
|
+
if (!args.fromStepName) {
|
|
311055
|
+
if (args.fromStepCount !== void 0 || args.fromStepType !== void 0) {
|
|
311056
|
+
throw new UserError(
|
|
311057
|
+
"--from-step-name is required when using --from-step-count or --from-step-type",
|
|
311058
|
+
{
|
|
311059
|
+
telemetryMessage: "workflows instances restart missing from step name"
|
|
311060
|
+
}
|
|
311061
|
+
);
|
|
311062
|
+
}
|
|
311063
|
+
return void 0;
|
|
311064
|
+
}
|
|
311065
|
+
if (args.fromStepCount !== void 0 && (!Number.isInteger(args.fromStepCount) || args.fromStepCount < 1)) {
|
|
311066
|
+
throw new UserError("--from-step-count must be a positive integer", {
|
|
311067
|
+
telemetryMessage: "workflows instances restart invalid from step count"
|
|
311068
|
+
});
|
|
311069
|
+
}
|
|
311070
|
+
return {
|
|
311071
|
+
name: args.fromStepName,
|
|
311072
|
+
...args.fromStepCount !== void 0 ? { count: args.fromStepCount } : {},
|
|
311073
|
+
...args.fromStepType !== void 0 ? { type: args.fromStepType } : {}
|
|
311074
|
+
};
|
|
311075
|
+
}
|
|
310868
311076
|
var workflowsInstancesRestartCommand;
|
|
310869
311077
|
var init_restart = __esm({
|
|
310870
311078
|
"src/workflows/commands/instances/restart.ts"() {
|
|
310871
311079
|
init_import_meta_url();
|
|
311080
|
+
init_dist();
|
|
310872
311081
|
init_create_command();
|
|
310873
311082
|
init_logger();
|
|
310874
311083
|
init_user3();
|
|
310875
311084
|
init_local();
|
|
310876
311085
|
init_utils22();
|
|
311086
|
+
__name(getRestartFrom, "getRestartFrom");
|
|
310877
311087
|
workflowsInstancesRestartCommand = createCommand({
|
|
310878
311088
|
metadata: {
|
|
310879
311089
|
description: "Restart a workflow instance",
|
|
@@ -310892,17 +311102,47 @@ var init_restart = __esm({
|
|
|
310892
311102
|
describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it",
|
|
310893
311103
|
type: "string",
|
|
310894
311104
|
demandOption: true
|
|
311105
|
+
},
|
|
311106
|
+
"from-step-name": {
|
|
311107
|
+
describe: "Name of the step to restart from",
|
|
311108
|
+
type: "string",
|
|
311109
|
+
demandOption: false
|
|
311110
|
+
},
|
|
311111
|
+
"from-step-count": {
|
|
311112
|
+
describe: "1-based occurrence of the step name/type to restart from (defaults to 1)",
|
|
311113
|
+
type: "number",
|
|
311114
|
+
demandOption: false
|
|
311115
|
+
},
|
|
311116
|
+
"from-step-type": {
|
|
311117
|
+
describe: "Step type to restart from, used when the same name is shared across step types (defaults to do)",
|
|
311118
|
+
type: "string",
|
|
311119
|
+
choices: ["do", "sleep", "waitForEvent"],
|
|
311120
|
+
demandOption: false
|
|
310895
311121
|
}
|
|
310896
311122
|
},
|
|
310897
311123
|
async handler(args, { config }) {
|
|
310898
311124
|
let id;
|
|
311125
|
+
const from = getRestartFrom(args);
|
|
310899
311126
|
if (args.local) {
|
|
310900
311127
|
id = await getLocalInstanceIdFromArgs(args.port, args);
|
|
310901
|
-
await updateLocalInstanceStatus(
|
|
311128
|
+
await updateLocalInstanceStatus(
|
|
311129
|
+
args.port,
|
|
311130
|
+
args.name,
|
|
311131
|
+
id,
|
|
311132
|
+
"restart",
|
|
311133
|
+
from
|
|
311134
|
+
);
|
|
310902
311135
|
} else {
|
|
310903
311136
|
const accountId = await requireAuth(config);
|
|
310904
311137
|
id = await getInstanceIdFromArgs(accountId, args, config);
|
|
310905
|
-
await updateInstanceStatus(
|
|
311138
|
+
await updateInstanceStatus(
|
|
311139
|
+
config,
|
|
311140
|
+
accountId,
|
|
311141
|
+
args.name,
|
|
311142
|
+
id,
|
|
311143
|
+
"restart",
|
|
311144
|
+
from
|
|
311145
|
+
);
|
|
310906
311146
|
}
|
|
310907
311147
|
logger.info(
|
|
310908
311148
|
`\u{1F977} The instance "${id}" from ${args.name} was restarted successfully`
|
|
@@ -313640,7 +313880,7 @@ Error: ${errorMessage}
|
|
|
313640
313880
|
if (e9.cause instanceof ApiError) {
|
|
313641
313881
|
logger.error(e9.cause);
|
|
313642
313882
|
} else {
|
|
313643
|
-
|
|
313883
|
+
assert55__default.default(isAuthenticationError(e9));
|
|
313644
313884
|
logger.error(e9);
|
|
313645
313885
|
}
|
|
313646
313886
|
const envAuth = getAuthFromEnv();
|
|
@@ -313731,7 +313971,6 @@ var init_handle_errors = __esm({
|
|
|
313731
313971
|
init_cloudflare();
|
|
313732
313972
|
init_esm2();
|
|
313733
313973
|
init_src2();
|
|
313734
|
-
init_cfetch();
|
|
313735
313974
|
init_config();
|
|
313736
313975
|
init_build_failures();
|
|
313737
313976
|
init_logger();
|
|
@@ -314252,10 +314491,10 @@ function populateConfigPatch(diff, patchObj, targetEnvironment) {
|
|
|
314252
314491
|
return;
|
|
314253
314492
|
}
|
|
314254
314493
|
if (Array.isArray(diff)) {
|
|
314255
|
-
|
|
314494
|
+
assert55__default.default(Array.isArray(patchObj));
|
|
314256
314495
|
return populateConfigPatchArray(diff, patchObj);
|
|
314257
314496
|
}
|
|
314258
|
-
|
|
314497
|
+
assert55__default.default(!Array.isArray(patchObj));
|
|
314259
314498
|
return populateConfigPatchObject(diff, patchObj, targetEnvironment);
|
|
314260
314499
|
}
|
|
314261
314500
|
function populateConfigPatchArray(diff, patchArray) {
|
|
@@ -314663,7 +314902,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
314663
314902
|
);
|
|
314664
314903
|
}
|
|
314665
314904
|
const scriptName = props.name;
|
|
314666
|
-
|
|
314905
|
+
assert55__default.default(
|
|
314667
314906
|
!config.site || config.site.bucket,
|
|
314668
314907
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
314669
314908
|
);
|
|
@@ -314969,7 +315208,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
314969
315208
|
{ warnIfNoBindings: true, unsafeMetadata: config.unsafe?.metadata }
|
|
314970
315209
|
);
|
|
314971
315210
|
} else {
|
|
314972
|
-
|
|
315211
|
+
assert55__default.default(accountId, "Missing accountId");
|
|
314973
315212
|
if (getFlag("RESOURCES_PROVISION")) {
|
|
314974
315213
|
await provisionBindings(
|
|
314975
315214
|
bindings ?? {},
|
|
@@ -315181,7 +315420,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
315181
315420
|
const uploadMs = Date.now() - start;
|
|
315182
315421
|
logger.log("Uploaded", workerName, formatTime2(uploadMs));
|
|
315183
315422
|
if (normalisedContainerConfig.length && props.containersRollout !== "none") {
|
|
315184
|
-
|
|
315423
|
+
assert55__default.default(versionId && accountId);
|
|
315185
315424
|
await deployContainers(config, normalisedContainerConfig, {
|
|
315186
315425
|
versionId,
|
|
315187
315426
|
accountId,
|
|
@@ -315698,7 +315937,7 @@ var init_assets5 = __esm({
|
|
|
315698
315937
|
MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
|
|
315699
315938
|
MAX_DIFF_LINES2 = 100;
|
|
315700
315939
|
syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
|
|
315701
|
-
|
|
315940
|
+
assert55__default.default(accountId, "Missing accountId");
|
|
315702
315941
|
logger.info("\u{1F300} Building list of assets...");
|
|
315703
315942
|
const manifest = await buildAssetManifest(assetDirectory);
|
|
315704
315943
|
const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
|
|
@@ -316329,7 +316568,7 @@ var init_dev2 = __esm({
|
|
|
316329
316568
|
},
|
|
316330
316569
|
async handler(args) {
|
|
316331
316570
|
const devInstance = await startDev(args);
|
|
316332
|
-
|
|
316571
|
+
assert55__default.default(devInstance.devEnv !== void 0);
|
|
316333
316572
|
await events__default.default.once(devInstance.devEnv, "teardown");
|
|
316334
316573
|
await Promise.all(devInstance.secondary.map((d8) => d8.teardown()));
|
|
316335
316574
|
devInstance.unregisterHotKeys?.();
|
|
@@ -316397,7 +316636,7 @@ function runBuild({
|
|
|
316397
316636
|
async function updateBundle() {
|
|
316398
316637
|
const newAdditionalModules = await getAdditionalModules();
|
|
316399
316638
|
setBundle((previousBundle) => {
|
|
316400
|
-
|
|
316639
|
+
assert55__default.default(
|
|
316401
316640
|
previousBundle,
|
|
316402
316641
|
"Rebuild triggered with no previous build available"
|
|
316403
316642
|
);
|
|
@@ -316552,7 +316791,7 @@ var init_BundlerController = __esm({
|
|
|
316552
316791
|
if (buildAborter.signal.aborted) {
|
|
316553
316792
|
return;
|
|
316554
316793
|
}
|
|
316555
|
-
|
|
316794
|
+
assert55__default.default(this.#tmpDir);
|
|
316556
316795
|
if (!config.build?.bundle) {
|
|
316557
316796
|
const destinationDir = this.#tmpDir.path;
|
|
316558
316797
|
fs4.writeFileSync(
|
|
@@ -316669,7 +316908,7 @@ var init_BundlerController = __esm({
|
|
|
316669
316908
|
return;
|
|
316670
316909
|
}
|
|
316671
316910
|
const pathsToWatch = config.build.custom.watch;
|
|
316672
|
-
|
|
316911
|
+
assert55__default.default(pathsToWatch, "config.build.custom.watch");
|
|
316673
316912
|
this.#customBuildWatcher = watch(pathsToWatch, {
|
|
316674
316913
|
persistent: true,
|
|
316675
316914
|
// The initial custom build is always done in getEntry()
|
|
@@ -316693,7 +316932,7 @@ var init_BundlerController = __esm({
|
|
|
316693
316932
|
if (config.build?.custom?.command) {
|
|
316694
316933
|
return;
|
|
316695
316934
|
}
|
|
316696
|
-
|
|
316935
|
+
assert55__default.default(this.#tmpDir);
|
|
316697
316936
|
const entry = {
|
|
316698
316937
|
file: config.entrypoint,
|
|
316699
316938
|
projectRoot: config.projectRoot,
|
|
@@ -316778,14 +317017,36 @@ var init_BundlerController = __esm({
|
|
|
316778
317017
|
}
|
|
316779
317018
|
});
|
|
316780
317019
|
if (config.assets?.directory) {
|
|
316781
|
-
|
|
317020
|
+
const assetsDir = config.assets.directory;
|
|
317021
|
+
const watcher = watch(assetsDir, {
|
|
316782
317022
|
persistent: true,
|
|
316783
317023
|
ignoreInitial: true
|
|
316784
317024
|
}).on("all", async (eventName, filePath) => {
|
|
316785
317025
|
const message = getAssetChangeMessage(eventName, filePath);
|
|
316786
317026
|
logger.debug(`\u{1F300} ${message}...`);
|
|
316787
317027
|
debouncedRefreshBundle();
|
|
317028
|
+
}).on("error", (err) => {
|
|
317029
|
+
const errnoError = err;
|
|
317030
|
+
if (errnoError.code === "EMFILE") {
|
|
317031
|
+
logger.warn(
|
|
317032
|
+
`Assets directory watcher hit a platform limit and has been disabled.
|
|
317033
|
+
Hot-reloading will not reflect changes to files in ${assetsDir}.
|
|
317034
|
+
This can occur when watching very large assets directory trees.
|
|
317035
|
+
To work around this, reduce the number of subdirectories under ${assetsDir} by flattening or restructuring the assets directory.`
|
|
317036
|
+
);
|
|
317037
|
+
} else {
|
|
317038
|
+
logger.warn(
|
|
317039
|
+
`Assets directory watcher encountered an error and has been disabled.
|
|
317040
|
+
Hot-reloading will not reflect changes to files in ${assetsDir}.
|
|
317041
|
+
Watcher error: ${err.message}`
|
|
317042
|
+
);
|
|
317043
|
+
}
|
|
317044
|
+
void watcher.close();
|
|
317045
|
+
if (this.#assetsWatcher === watcher) {
|
|
317046
|
+
this.#assetsWatcher = void 0;
|
|
317047
|
+
}
|
|
316788
317048
|
});
|
|
317049
|
+
this.#assetsWatcher = watcher;
|
|
316789
317050
|
}
|
|
316790
317051
|
}
|
|
316791
317052
|
#tmpDir;
|
|
@@ -317091,7 +317352,7 @@ async function resolveDevConfig(config, input) {
|
|
|
317091
317352
|
);
|
|
317092
317353
|
if (input.dev?.remote) {
|
|
317093
317354
|
const { accountId } = await auth();
|
|
317094
|
-
|
|
317355
|
+
assert55__default.default(accountId, "Account ID must be provided for remote dev");
|
|
317095
317356
|
await getZoneIdForPreview(config, { host, routes, accountId });
|
|
317096
317357
|
}
|
|
317097
317358
|
const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
|
|
@@ -317302,7 +317563,7 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
|
|
|
317302
317563
|
}
|
|
317303
317564
|
if (!resolved.dev?.origin?.secure && resolved.dev?.remote) {
|
|
317304
317565
|
logger.once.warn(
|
|
317305
|
-
"Setting upstream-protocol to http is not currently supported for remote mode.\nIf this is required in your project, please add your use case to the following issue:\nhttps://github.com/cloudflare/workers-sdk/issues/583
|
|
317566
|
+
"Setting upstream-protocol to http is not currently supported for remote mode.\nIf this is required in your project, please add your use case to the following issue:\nhttps://github.com/cloudflare/workers-sdk/issues/583"
|
|
317306
317567
|
);
|
|
317307
317568
|
}
|
|
317308
317569
|
const needsPulling = resolved.containers.some(
|
|
@@ -317405,7 +317666,7 @@ var init_ConfigController = __esm({
|
|
|
317405
317666
|
return;
|
|
317406
317667
|
}
|
|
317407
317668
|
logger.debug(`${path3__namespace.default.basename(configPath)} changed...`);
|
|
317408
|
-
|
|
317669
|
+
assert55__default.default(
|
|
317409
317670
|
this.latestInput,
|
|
317410
317671
|
"Cannot be watching config without having first set an input"
|
|
317411
317672
|
);
|
|
@@ -317431,7 +317692,7 @@ var init_ConfigController = __esm({
|
|
|
317431
317692
|
}
|
|
317432
317693
|
patch(input) {
|
|
317433
317694
|
logger.debug("patching config");
|
|
317434
|
-
|
|
317695
|
+
assert55__default.default(
|
|
317435
317696
|
this.latestInput,
|
|
317436
317697
|
"Cannot call updateConfig without previously calling setConfig"
|
|
317437
317698
|
);
|
|
@@ -317595,7 +317856,7 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
|
317595
317856
|
return;
|
|
317596
317857
|
}
|
|
317597
317858
|
const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
|
|
317598
|
-
|
|
317859
|
+
assert55__default.default(sourceMappingURLMatch !== null);
|
|
317599
317860
|
const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
|
|
317600
317861
|
const sourceURL = Url.pathToFileURL(sourcePath);
|
|
317601
317862
|
try {
|
|
@@ -317916,7 +318177,7 @@ var init_ProxyController = __esm({
|
|
|
317916
318177
|
if (this._torndown) {
|
|
317917
318178
|
return;
|
|
317918
318179
|
}
|
|
317919
|
-
|
|
318180
|
+
assert55__default.default(this.latestConfig !== void 0);
|
|
317920
318181
|
const cert = this.latestConfig.dev?.server?.secure || this.inspectorEnabled && this.latestConfig.dev?.inspector && this.latestConfig.dev?.inspector?.secure ? validateHttpsOptions(
|
|
317921
318182
|
this.latestConfig.dev.server?.httpsKeyPath,
|
|
317922
318183
|
this.latestConfig.dev.server?.httpsCertPath
|
|
@@ -317976,7 +318237,7 @@ var init_ProxyController = __esm({
|
|
|
317976
318237
|
liveReload: false
|
|
317977
318238
|
};
|
|
317978
318239
|
if (this.inspectorEnabled) {
|
|
317979
|
-
|
|
318240
|
+
assert55__default.default(this.latestConfig.dev?.inspector);
|
|
317980
318241
|
proxyWorkerOptions.workers.push({
|
|
317981
318242
|
name: "InspectorProxyWorker",
|
|
317982
318243
|
compatibilityDate: "2023-12-18",
|
|
@@ -318041,7 +318302,7 @@ var init_ProxyController = __esm({
|
|
|
318041
318302
|
inspectorUrl
|
|
318042
318303
|
]);
|
|
318043
318304
|
}).then(([url4, inspectorUrl]) => {
|
|
318044
|
-
|
|
318305
|
+
assert55__default.default(url4);
|
|
318045
318306
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
|
318046
318307
|
}).catch((error3) => {
|
|
318047
318308
|
if (this._torndown) {
|
|
@@ -318058,7 +318319,7 @@ var init_ProxyController = __esm({
|
|
|
318058
318319
|
if (this._torndown) {
|
|
318059
318320
|
return;
|
|
318060
318321
|
}
|
|
318061
|
-
|
|
318322
|
+
assert55__default.default(
|
|
318062
318323
|
this.latestConfig?.dev.inspector !== false,
|
|
318063
318324
|
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
|
318064
318325
|
);
|
|
@@ -318069,7 +318330,7 @@ var init_ProxyController = __esm({
|
|
|
318069
318330
|
this.inspectorProxyWorkerWebSocket = createDeferred();
|
|
318070
318331
|
let webSocket = null;
|
|
318071
318332
|
try {
|
|
318072
|
-
|
|
318333
|
+
assert55__default.default(this.proxyWorker);
|
|
318073
318334
|
const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
|
|
318074
318335
|
"InspectorProxyWorker"
|
|
318075
318336
|
);
|
|
@@ -318089,12 +318350,12 @@ var init_ProxyController = __esm({
|
|
|
318089
318350
|
this.emitErrorEvent("Could not connect to InspectorProxyWorker", error3);
|
|
318090
318351
|
return;
|
|
318091
318352
|
}
|
|
318092
|
-
|
|
318353
|
+
assert55__default.default(
|
|
318093
318354
|
webSocket,
|
|
318094
318355
|
"Expected webSocket on response from inspectorProxyWorker"
|
|
318095
318356
|
);
|
|
318096
318357
|
webSocket.addEventListener("message", (event) => {
|
|
318097
|
-
|
|
318358
|
+
assert55__default.default(typeof event.data === "string");
|
|
318098
318359
|
this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
|
|
318099
318360
|
});
|
|
318100
318361
|
webSocket.addEventListener("close", () => {
|
|
@@ -318149,13 +318410,13 @@ var init_ProxyController = __esm({
|
|
|
318149
318410
|
if (this._torndown) {
|
|
318150
318411
|
return;
|
|
318151
318412
|
}
|
|
318152
|
-
|
|
318413
|
+
assert55__default.default(
|
|
318153
318414
|
this.latestConfig?.dev.inspector !== false,
|
|
318154
318415
|
"Trying to send message to inspector proxy worker when inspector is disabled"
|
|
318155
318416
|
);
|
|
318156
318417
|
try {
|
|
318157
318418
|
const websocket = await this.reconnectInspectorProxyWorker();
|
|
318158
|
-
|
|
318419
|
+
assert55__default.default(websocket);
|
|
318159
318420
|
websocket.send(JSON.stringify(message));
|
|
318160
318421
|
} catch (cause) {
|
|
318161
318422
|
if (this._torndown) {
|
|
@@ -318235,7 +318496,7 @@ var init_ProxyController = __esm({
|
|
|
318235
318496
|
}
|
|
318236
318497
|
}
|
|
318237
318498
|
onInspectorProxyWorkerMessage(message) {
|
|
318238
|
-
|
|
318499
|
+
assert55__default.default(
|
|
318239
318500
|
this.latestConfig?.dev.inspector !== false,
|
|
318240
318501
|
"Trying to handle inspector message when inspector is disabled"
|
|
318241
318502
|
);
|
|
@@ -318258,7 +318519,7 @@ var init_ProxyController = __esm({
|
|
|
318258
318519
|
}
|
|
318259
318520
|
}
|
|
318260
318521
|
async onInspectorProxyWorkerRequest(message) {
|
|
318261
|
-
|
|
318522
|
+
assert55__default.default(
|
|
318262
318523
|
this.latestConfig?.dev.inspector !== false,
|
|
318263
318524
|
"Trying to handle inspector request when inspector is disabled"
|
|
318264
318525
|
);
|
|
@@ -318279,8 +318540,8 @@ var init_ProxyController = __esm({
|
|
|
318279
318540
|
logger.debug("[InspectorProxyWorker]", ...message.args);
|
|
318280
318541
|
break;
|
|
318281
318542
|
case "load-network-resource": {
|
|
318282
|
-
|
|
318283
|
-
|
|
318543
|
+
assert55__default.default(this.latestConfig !== void 0);
|
|
318544
|
+
assert55__default.default(this.latestBundle !== void 0);
|
|
318284
318545
|
let maybeContents;
|
|
318285
318546
|
if (message.url.startsWith("wrangler-file:")) {
|
|
318286
318547
|
maybeContents = maybeHandleNetworkLoadResource(
|
|
@@ -318546,7 +318807,7 @@ var init_isAbortError = __esm({
|
|
|
318546
318807
|
}
|
|
318547
318808
|
});
|
|
318548
318809
|
function handlePreviewSessionUploadError(err, accountId) {
|
|
318549
|
-
|
|
318810
|
+
assert55__default.default(err && typeof err === "object");
|
|
318550
318811
|
if (!isAbortError(err)) {
|
|
318551
318812
|
if ("code" in err && err.code === 10049) {
|
|
318552
318813
|
logger.log("Preview token expired, fetching a new one");
|
|
@@ -318558,7 +318819,7 @@ function handlePreviewSessionUploadError(err, accountId) {
|
|
|
318558
318819
|
return false;
|
|
318559
318820
|
}
|
|
318560
318821
|
function handlePreviewSessionCreationError(err, accountId) {
|
|
318561
|
-
|
|
318822
|
+
assert55__default.default(err && typeof err === "object");
|
|
318562
318823
|
if ("code" in err && err.code === 10063) {
|
|
318563
318824
|
logger.error(
|
|
318564
318825
|
`You need to register a workers.dev subdomain before running the dev command in remote mode. You can either enable local mode by pressing l, or register a workers.dev subdomain here: https://dash.cloudflare.com/${accountId}/workers/onboarding`
|
|
@@ -318997,7 +319258,7 @@ var init_RemoteRuntimeController = __esm({
|
|
|
318997
319258
|
if (!config.dev?.auth) {
|
|
318998
319259
|
throw new MissingConfigError("config.dev.auth");
|
|
318999
319260
|
}
|
|
319000
|
-
|
|
319261
|
+
assert55__default.default(config.dev.auth);
|
|
319001
319262
|
const auth = await unwrapHook(config.dev.auth);
|
|
319002
319263
|
this.#latestConfig = config;
|
|
319003
319264
|
this.#latestBundle = bundle;
|
|
@@ -319031,7 +319292,7 @@ var init_RemoteRuntimeController = __esm({
|
|
|
319031
319292
|
return;
|
|
319032
319293
|
}
|
|
319033
319294
|
try {
|
|
319034
|
-
|
|
319295
|
+
assert55__default.default(this.#latestConfig.dev.auth);
|
|
319035
319296
|
const auth = await unwrapHook(this.#latestConfig.dev.auth);
|
|
319036
319297
|
this.#session = await this.#getPreviewSession(
|
|
319037
319298
|
this.#latestConfig,
|
|
@@ -319125,7 +319386,7 @@ function createWorkerObject(devEnv) {
|
|
|
319125
319386
|
return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
|
|
319126
319387
|
},
|
|
319127
319388
|
get config() {
|
|
319128
|
-
|
|
319389
|
+
assert55__default.default(devEnv.config.latestConfig);
|
|
319129
319390
|
return devEnv.config.latestConfig;
|
|
319130
319391
|
},
|
|
319131
319392
|
async setConfig(config, throwErrors) {
|
|
@@ -319140,7 +319401,7 @@ function createWorkerObject(devEnv) {
|
|
|
319140
319401
|
return proxyWorker.dispatchFetch(...args);
|
|
319141
319402
|
},
|
|
319142
319403
|
async queue(...args) {
|
|
319143
|
-
|
|
319404
|
+
assert55__default.default(
|
|
319144
319405
|
this.config.name,
|
|
319145
319406
|
"Worker name must be defined to use `Worker.queue()`"
|
|
319146
319407
|
);
|
|
@@ -319149,7 +319410,7 @@ function createWorkerObject(devEnv) {
|
|
|
319149
319410
|
return w7.queue(...args);
|
|
319150
319411
|
},
|
|
319151
319412
|
async scheduled(...args) {
|
|
319152
|
-
|
|
319413
|
+
assert55__default.default(
|
|
319153
319414
|
this.config.name,
|
|
319154
319415
|
"Worker name must be defined to use `Worker.scheduled()`"
|
|
319155
319416
|
);
|
|
@@ -319593,7 +319854,7 @@ function getAuthHook(auth, config) {
|
|
|
319593
319854
|
}
|
|
319594
319855
|
function deepStrictEqual(source, target) {
|
|
319595
319856
|
try {
|
|
319596
|
-
|
|
319857
|
+
assert55__default.default.deepStrictEqual(source, target);
|
|
319597
319858
|
return true;
|
|
319598
319859
|
} catch {
|
|
319599
319860
|
return false;
|
|
@@ -319857,7 +320118,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
319857
320118
|
}
|
|
319858
320119
|
if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
|
319859
320120
|
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
|
|
319860
|
-
|
|
320121
|
+
assert55__default.default(
|
|
319861
320122
|
data.config.dev.containerBuildId,
|
|
319862
320123
|
"Build ID should be set if containers are enabled and defined"
|
|
319863
320124
|
);
|
|
@@ -319986,7 +320247,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
319986
320247
|
if (!this.containerImageTagsSeen.size) {
|
|
319987
320248
|
return;
|
|
319988
320249
|
}
|
|
319989
|
-
|
|
320250
|
+
assert55__default.default(
|
|
319990
320251
|
this.dockerPath,
|
|
319991
320252
|
"Docker path should have been set if containers are enabled"
|
|
319992
320253
|
);
|
|
@@ -320094,7 +320355,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
320094
320355
|
}
|
|
320095
320356
|
#mergedMfOptions() {
|
|
320096
320357
|
const primary = [...this.#options.values()].find((o7) => o7.primary);
|
|
320097
|
-
|
|
320358
|
+
assert55__default.default(primary !== void 0);
|
|
320098
320359
|
const secondary = [...this.#options.values()].filter((o7) => !o7.primary);
|
|
320099
320360
|
return {
|
|
320100
320361
|
...primary.options,
|
|
@@ -320129,7 +320390,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
320129
320390
|
}
|
|
320130
320391
|
if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
|
320131
320392
|
logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
|
|
320132
|
-
|
|
320393
|
+
assert55__default.default(
|
|
320133
320394
|
data.config.dev.containerBuildId,
|
|
320134
320395
|
"Build ID should be set if containers are enabled and defined"
|
|
320135
320396
|
);
|
|
@@ -324378,12 +324639,12 @@ var init_assets6 = __esm({
|
|
|
324378
324639
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
|
324379
324640
|
*/
|
|
324380
324641
|
static reinstateHostHeader(headers, host) {
|
|
324381
|
-
|
|
324382
|
-
|
|
324642
|
+
assert55__default.default(headers, "Expected all proxy requests to contain headers.");
|
|
324643
|
+
assert55__default.default(
|
|
324383
324644
|
!Array.isArray(headers),
|
|
324384
324645
|
"Expected proxy request headers to be a hash object"
|
|
324385
324646
|
);
|
|
324386
|
-
|
|
324647
|
+
assert55__default.default(
|
|
324387
324648
|
Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"),
|
|
324388
324649
|
"Expected Host header to have been deleted."
|
|
324389
324650
|
);
|
|
@@ -324413,7 +324674,7 @@ async function startDev(args) {
|
|
|
324413
324674
|
unregisterHotKeys?.();
|
|
324414
324675
|
accountId = await requireAuth(config);
|
|
324415
324676
|
if (hotkeysDisplayed) {
|
|
324416
|
-
|
|
324677
|
+
assert55__default.default(devEnv !== void 0);
|
|
324417
324678
|
unregisterHotKeys = registerDevHotKeys(
|
|
324418
324679
|
Array.isArray(devEnv) ? devEnv : [devEnv],
|
|
324419
324680
|
args,
|