wrangler 4.24.0 → 4.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/wrangler-dist/cli.d.ts +2 -2
- package/wrangler-dist/cli.js +223 -201
- package/wrangler-dist/metafile-cjs.json +1 -1
package/wrangler-dist/cli.js
CHANGED
@@ -13467,7 +13467,7 @@ var require_headers = __commonJS({
|
|
13467
13467
|
return headers;
|
13468
13468
|
}
|
13469
13469
|
};
|
13470
|
-
var
|
13470
|
+
var Headers5 = class _Headers {
|
13471
13471
|
static {
|
13472
13472
|
__name(this, "Headers");
|
13473
13473
|
}
|
@@ -13665,8 +13665,8 @@ var require_headers = __commonJS({
|
|
13665
13665
|
return this[kHeadersList];
|
13666
13666
|
}
|
13667
13667
|
};
|
13668
|
-
|
13669
|
-
Object.defineProperties(
|
13668
|
+
Headers5.prototype[Symbol.iterator] = Headers5.prototype.entries;
|
13669
|
+
Object.defineProperties(Headers5.prototype, {
|
13670
13670
|
append: kEnumerableProperty,
|
13671
13671
|
delete: kEnumerableProperty,
|
13672
13672
|
get: kEnumerableProperty,
|
@@ -13698,7 +13698,7 @@ var require_headers = __commonJS({
|
|
13698
13698
|
};
|
13699
13699
|
module3.exports = {
|
13700
13700
|
fill: fill2,
|
13701
|
-
Headers:
|
13701
|
+
Headers: Headers5,
|
13702
13702
|
HeadersList
|
13703
13703
|
};
|
13704
13704
|
}
|
@@ -13709,7 +13709,7 @@ var require_response = __commonJS({
|
|
13709
13709
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/response.js"(exports2, module3) {
|
13710
13710
|
"use strict";
|
13711
13711
|
init_import_meta_url();
|
13712
|
-
var { Headers:
|
13712
|
+
var { Headers: Headers5, HeadersList, fill: fill2 } = require_headers();
|
13713
13713
|
var { extractBody, cloneBody, mixinBody } = require_body();
|
13714
13714
|
var util5 = require_util();
|
13715
13715
|
var { kEnumerableProperty } = util5;
|
@@ -13737,7 +13737,7 @@ var require_response = __commonJS({
|
|
13737
13737
|
var { types } = require("util");
|
13738
13738
|
var ReadableStream3 = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
13739
13739
|
var textEncoder = new TextEncoder("utf-8");
|
13740
|
-
var
|
13740
|
+
var Response12 = class _Response {
|
13741
13741
|
static {
|
13742
13742
|
__name(this, "Response");
|
13743
13743
|
}
|
@@ -13804,7 +13804,7 @@ var require_response = __commonJS({
|
|
13804
13804
|
init3 = webidl.converters.ResponseInit(init3);
|
13805
13805
|
this[kRealm] = { settingsObject: {} };
|
13806
13806
|
this[kState] = makeResponse({});
|
13807
|
-
this[kHeaders] = new
|
13807
|
+
this[kHeaders] = new Headers5(kConstruct);
|
13808
13808
|
this[kHeaders][kGuard] = "response";
|
13809
13809
|
this[kHeaders][kHeadersList] = this[kState].headersList;
|
13810
13810
|
this[kHeaders][kRealm] = this[kRealm];
|
@@ -13882,8 +13882,8 @@ var require_response = __commonJS({
|
|
13882
13882
|
return clonedResponseObject;
|
13883
13883
|
}
|
13884
13884
|
};
|
13885
|
-
mixinBody(
|
13886
|
-
Object.defineProperties(
|
13885
|
+
mixinBody(Response12);
|
13886
|
+
Object.defineProperties(Response12.prototype, {
|
13887
13887
|
type: kEnumerableProperty,
|
13888
13888
|
url: kEnumerableProperty,
|
13889
13889
|
status: kEnumerableProperty,
|
@@ -13899,7 +13899,7 @@ var require_response = __commonJS({
|
|
13899
13899
|
configurable: true
|
13900
13900
|
}
|
13901
13901
|
});
|
13902
|
-
Object.defineProperties(
|
13902
|
+
Object.defineProperties(Response12, {
|
13903
13903
|
json: kEnumerableProperty,
|
13904
13904
|
redirect: kEnumerableProperty,
|
13905
13905
|
error: kEnumerableProperty
|
@@ -14088,7 +14088,7 @@ var require_response = __commonJS({
|
|
14088
14088
|
makeResponse,
|
14089
14089
|
makeAppropriateNetworkError,
|
14090
14090
|
filterResponse,
|
14091
|
-
Response:
|
14091
|
+
Response: Response12,
|
14092
14092
|
cloneResponse
|
14093
14093
|
};
|
14094
14094
|
}
|
@@ -14100,7 +14100,7 @@ var require_request2 = __commonJS({
|
|
14100
14100
|
"use strict";
|
14101
14101
|
init_import_meta_url();
|
14102
14102
|
var { extractBody, mixinBody, cloneBody } = require_body();
|
14103
|
-
var { Headers:
|
14103
|
+
var { Headers: Headers5, fill: fillHeaders, HeadersList } = require_headers();
|
14104
14104
|
var { FinalizationRegistry } = require_dispatcher_weakref()();
|
14105
14105
|
var util5 = require_util();
|
14106
14106
|
var {
|
@@ -14347,7 +14347,7 @@ var require_request2 = __commonJS({
|
|
14347
14347
|
requestFinalizer.register(ac2, { signal, abort });
|
14348
14348
|
}
|
14349
14349
|
}
|
14350
|
-
this[kHeaders] = new
|
14350
|
+
this[kHeaders] = new Headers5(kConstruct);
|
14351
14351
|
this[kHeaders][kHeadersList] = request4.headersList;
|
14352
14352
|
this[kHeaders][kGuard] = "request";
|
14353
14353
|
this[kHeaders][kRealm] = this[kRealm];
|
@@ -14546,7 +14546,7 @@ var require_request2 = __commonJS({
|
|
14546
14546
|
const clonedRequestObject = new _Request(kConstruct);
|
14547
14547
|
clonedRequestObject[kState] = clonedRequest;
|
14548
14548
|
clonedRequestObject[kRealm] = this[kRealm];
|
14549
|
-
clonedRequestObject[kHeaders] = new
|
14549
|
+
clonedRequestObject[kHeaders] = new Headers5(kConstruct);
|
14550
14550
|
clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList;
|
14551
14551
|
clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard];
|
14552
14552
|
clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm];
|
@@ -14745,13 +14745,13 @@ var require_fetch = __commonJS({
|
|
14745
14745
|
"use strict";
|
14746
14746
|
init_import_meta_url();
|
14747
14747
|
var {
|
14748
|
-
Response:
|
14748
|
+
Response: Response12,
|
14749
14749
|
makeNetworkError,
|
14750
14750
|
makeAppropriateNetworkError,
|
14751
14751
|
filterResponse,
|
14752
14752
|
makeResponse
|
14753
14753
|
} = require_response();
|
14754
|
-
var { Headers:
|
14754
|
+
var { Headers: Headers5 } = require_headers();
|
14755
14755
|
var { Request: Request4, makeRequest } = require_request2();
|
14756
14756
|
var zlib2 = require("zlib");
|
14757
14757
|
var {
|
@@ -14841,7 +14841,7 @@ var require_fetch = __commonJS({
|
|
14841
14841
|
this.emit("terminated", error2);
|
14842
14842
|
}
|
14843
14843
|
};
|
14844
|
-
function
|
14844
|
+
function fetch14(input, init3 = {}) {
|
14845
14845
|
webidl.argumentLengthCheck(arguments, 1, { header: "globalThis.fetch" });
|
14846
14846
|
const p6 = createDeferredPromise();
|
14847
14847
|
let requestObject;
|
@@ -14888,7 +14888,7 @@ var require_fetch = __commonJS({
|
|
14888
14888
|
);
|
14889
14889
|
return Promise.resolve();
|
14890
14890
|
}
|
14891
|
-
responseObject = new
|
14891
|
+
responseObject = new Response12();
|
14892
14892
|
responseObject[kState] = response;
|
14893
14893
|
responseObject[kRealm] = relevantRealm;
|
14894
14894
|
responseObject[kHeaders][kHeadersList] = response.headersList;
|
@@ -14905,7 +14905,7 @@ var require_fetch = __commonJS({
|
|
14905
14905
|
});
|
14906
14906
|
return p6.promise;
|
14907
14907
|
}
|
14908
|
-
__name(
|
14908
|
+
__name(fetch14, "fetch");
|
14909
14909
|
function finalizeAndReportTiming(response, initiatorType = "other") {
|
14910
14910
|
if (response.type === "error" && response.aborted) {
|
14911
14911
|
return;
|
@@ -15680,7 +15680,7 @@ var require_fetch = __commonJS({
|
|
15680
15680
|
}
|
15681
15681
|
let codings = [];
|
15682
15682
|
let location = "";
|
15683
|
-
const headers = new
|
15683
|
+
const headers = new Headers5();
|
15684
15684
|
if (Array.isArray(headersList)) {
|
15685
15685
|
for (let n6 = 0; n6 < headersList.length; n6 += 2) {
|
15686
15686
|
const key = headersList[n6 + 0].toString("latin1");
|
@@ -15765,7 +15765,7 @@ var require_fetch = __commonJS({
|
|
15765
15765
|
if (status2 !== 101) {
|
15766
15766
|
return;
|
15767
15767
|
}
|
15768
|
-
const headers = new
|
15768
|
+
const headers = new Headers5();
|
15769
15769
|
for (let n6 = 0; n6 < headersList.length; n6 += 2) {
|
15770
15770
|
const key = headersList[n6 + 0].toString("latin1");
|
15771
15771
|
const val2 = headersList[n6 + 1].toString("latin1");
|
@@ -15786,7 +15786,7 @@ var require_fetch = __commonJS({
|
|
15786
15786
|
}
|
15787
15787
|
__name(httpNetworkFetch, "httpNetworkFetch");
|
15788
15788
|
module3.exports = {
|
15789
|
-
fetch:
|
15789
|
+
fetch: fetch14,
|
15790
15790
|
Fetch,
|
15791
15791
|
fetching,
|
15792
15792
|
finalizeAndReportTiming
|
@@ -16683,7 +16683,7 @@ var require_cache = __commonJS({
|
|
16683
16683
|
var { kEnumerableProperty, isDisturbed } = require_util();
|
16684
16684
|
var { kHeadersList } = require_symbols();
|
16685
16685
|
var { webidl } = require_webidl();
|
16686
|
-
var { Response:
|
16686
|
+
var { Response: Response12, cloneResponse } = require_response();
|
16687
16687
|
var { Request: Request4 } = require_request2();
|
16688
16688
|
var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
|
16689
16689
|
var { fetching } = require_fetch();
|
@@ -16744,7 +16744,7 @@ var require_cache = __commonJS({
|
|
16744
16744
|
}
|
16745
16745
|
const responseList = [];
|
16746
16746
|
for (const response of responses) {
|
16747
|
-
const responseObject = new
|
16747
|
+
const responseObject = new Response12(response.body?.source ?? null);
|
16748
16748
|
const body = responseObject[kState].body;
|
16749
16749
|
responseObject[kState] = response;
|
16750
16750
|
responseObject[kState].body = body;
|
@@ -17199,7 +17199,7 @@ var require_cache = __commonJS({
|
|
17199
17199
|
converter: webidl.converters.DOMString
|
17200
17200
|
}
|
17201
17201
|
]);
|
17202
|
-
webidl.converters.Response = webidl.interfaceConverter(
|
17202
|
+
webidl.converters.Response = webidl.interfaceConverter(Response12);
|
17203
17203
|
webidl.converters["sequence<RequestInfo>"] = webidl.sequenceConverter(
|
17204
17204
|
webidl.converters.RequestInfo
|
17205
17205
|
);
|
@@ -17653,10 +17653,10 @@ var require_cookies = __commonJS({
|
|
17653
17653
|
var { parseSetCookie } = require_parse();
|
17654
17654
|
var { stringify, getHeadersList } = require_util6();
|
17655
17655
|
var { webidl } = require_webidl();
|
17656
|
-
var { Headers:
|
17656
|
+
var { Headers: Headers5 } = require_headers();
|
17657
17657
|
function getCookies(headers) {
|
17658
17658
|
webidl.argumentLengthCheck(arguments, 1, { header: "getCookies" });
|
17659
|
-
webidl.brandCheck(headers,
|
17659
|
+
webidl.brandCheck(headers, Headers5, { strict: false });
|
17660
17660
|
const cookie = headers.get("cookie");
|
17661
17661
|
const out = {};
|
17662
17662
|
if (!cookie) {
|
@@ -17671,7 +17671,7 @@ var require_cookies = __commonJS({
|
|
17671
17671
|
__name(getCookies, "getCookies");
|
17672
17672
|
function deleteCookie(headers, name2, attributes) {
|
17673
17673
|
webidl.argumentLengthCheck(arguments, 2, { header: "deleteCookie" });
|
17674
|
-
webidl.brandCheck(headers,
|
17674
|
+
webidl.brandCheck(headers, Headers5, { strict: false });
|
17675
17675
|
name2 = webidl.converters.DOMString(name2);
|
17676
17676
|
attributes = webidl.converters.DeleteCookieAttributes(attributes);
|
17677
17677
|
setCookie(headers, {
|
@@ -17684,7 +17684,7 @@ var require_cookies = __commonJS({
|
|
17684
17684
|
__name(deleteCookie, "deleteCookie");
|
17685
17685
|
function getSetCookies(headers) {
|
17686
17686
|
webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" });
|
17687
|
-
webidl.brandCheck(headers,
|
17687
|
+
webidl.brandCheck(headers, Headers5, { strict: false });
|
17688
17688
|
const cookies = getHeadersList(headers).cookies;
|
17689
17689
|
if (!cookies) {
|
17690
17690
|
return [];
|
@@ -17694,7 +17694,7 @@ var require_cookies = __commonJS({
|
|
17694
17694
|
__name(getSetCookies, "getSetCookies");
|
17695
17695
|
function setCookie(headers, cookie) {
|
17696
17696
|
webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" });
|
17697
|
-
webidl.brandCheck(headers,
|
17697
|
+
webidl.brandCheck(headers, Headers5, { strict: false });
|
17698
17698
|
cookie = webidl.converters.Cookie(cookie);
|
17699
17699
|
const str = stringify(cookie);
|
17700
17700
|
if (str) {
|
@@ -18210,7 +18210,7 @@ var require_connection = __commonJS({
|
|
18210
18210
|
var { CloseEvent } = require_events();
|
18211
18211
|
var { makeRequest } = require_request2();
|
18212
18212
|
var { fetching } = require_fetch();
|
18213
|
-
var { Headers:
|
18213
|
+
var { Headers: Headers5 } = require_headers();
|
18214
18214
|
var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();
|
18215
18215
|
var { kHeadersList } = require_symbols();
|
18216
18216
|
var channels = {};
|
@@ -18235,7 +18235,7 @@ var require_connection = __commonJS({
|
|
18235
18235
|
redirect: "error"
|
18236
18236
|
});
|
18237
18237
|
if (options.headers) {
|
18238
|
-
const headersList = new
|
18238
|
+
const headersList = new Headers5(options.headers)[kHeadersList];
|
18239
18239
|
request4.headersList = headersList;
|
18240
18240
|
}
|
18241
18241
|
const keyValue = crypto8.randomBytes(16).toString("base64");
|
@@ -19145,7 +19145,7 @@ var require_undici = __commonJS({
|
|
19145
19145
|
module3.exports.getGlobalDispatcher = getGlobalDispatcher2;
|
19146
19146
|
if (util5.nodeMajor > 16 || util5.nodeMajor === 16 && util5.nodeMinor >= 8) {
|
19147
19147
|
let fetchImpl = null;
|
19148
|
-
module3.exports.fetch = /* @__PURE__ */ __name(async function
|
19148
|
+
module3.exports.fetch = /* @__PURE__ */ __name(async function fetch14(resource) {
|
19149
19149
|
if (!fetchImpl) {
|
19150
19150
|
fetchImpl = require_fetch().fetch;
|
19151
19151
|
}
|
@@ -20469,11 +20469,10 @@ var init_UpdateApplicationRolloutRequest = __esm({
|
|
20469
20469
|
});
|
20470
20470
|
|
20471
20471
|
// ../containers-shared/src/client/core/request.ts
|
20472
|
-
var
|
20472
|
+
var isDefined, isString, isStringWithValue, isBlob, base64, getQueryString, getUrl, getFormData, resolve5, getHeaders, getRequestBody, isResponseSchemaV4, parseResponseSchemaV4, sendRequest, getResponseHeader, getResponseBody, catchErrorCodes, request;
|
20473
20473
|
var init_request = __esm({
|
20474
20474
|
"../containers-shared/src/client/core/request.ts"() {
|
20475
20475
|
init_import_meta_url();
|
20476
|
-
import_undici = __toESM(require_undici());
|
20477
20476
|
init_ApiError();
|
20478
20477
|
init_CancelablePromise();
|
20479
20478
|
isDefined = /* @__PURE__ */ __name((value) => {
|
@@ -20539,7 +20538,7 @@ var init_request = __esm({
|
|
20539
20538
|
}, "getUrl");
|
20540
20539
|
getFormData = /* @__PURE__ */ __name((options) => {
|
20541
20540
|
if (options.formData) {
|
20542
|
-
const formData = new
|
20541
|
+
const formData = new FormData();
|
20543
20542
|
const process11 = /* @__PURE__ */ __name((key, value) => {
|
20544
20543
|
if (isString(value) || isBlob(value)) {
|
20545
20544
|
formData.append(key, value);
|
@@ -20598,7 +20597,7 @@ var init_request = __esm({
|
|
20598
20597
|
headers["Content-Type"] = "application/json";
|
20599
20598
|
}
|
20600
20599
|
}
|
20601
|
-
return new
|
20600
|
+
return new Headers(headers);
|
20602
20601
|
}, "getHeaders");
|
20603
20602
|
getRequestBody = /* @__PURE__ */ __name((options) => {
|
20604
20603
|
if (options.body !== void 0) {
|
@@ -20642,14 +20641,13 @@ var init_request = __esm({
|
|
20642
20641
|
headers,
|
20643
20642
|
body: body ?? formData,
|
20644
20643
|
method: options.method,
|
20645
|
-
signal: controller.signal
|
20646
|
-
dispatcher: config.AGENT ?? void 0
|
20644
|
+
signal: controller.signal
|
20647
20645
|
};
|
20648
20646
|
if (config.WITH_CREDENTIALS) {
|
20649
20647
|
request4.credentials = config.CREDENTIALS;
|
20650
20648
|
}
|
20651
20649
|
onCancel(() => controller.abort());
|
20652
|
-
return await
|
20650
|
+
return await fetch(url4, request4);
|
20653
20651
|
}, "sendRequest");
|
20654
20652
|
getResponseHeader = /* @__PURE__ */ __name((response, responseHeader) => {
|
20655
20653
|
if (responseHeader) {
|
@@ -22242,10 +22240,11 @@ async function checkExposedPorts(dockerPath, options) {
|
|
22242
22240
|
imageTag: options.imageTag,
|
22243
22241
|
formatString: "{{ len .Config.ExposedPorts }}"
|
22244
22242
|
});
|
22245
|
-
if (output === "0"
|
22243
|
+
if (output === "0") {
|
22246
22244
|
throw new Error(
|
22247
|
-
`The container "${options.class_name}" does not expose any ports.
|
22248
|
-
|
22245
|
+
`The container "${options.class_name}" does not expose any ports. In your Dockerfile, please expose any ports you intend to connect to.
|
22246
|
+
For additional information please see: https://developers.cloudflare.com/containers/local-dev/#exposing-ports.
|
22247
|
+
`
|
22249
22248
|
);
|
22250
22249
|
}
|
22251
22250
|
}
|
@@ -22415,6 +22414,21 @@ To use an existing image from another repository, see https://developers.cloudfl
|
|
22415
22414
|
await checkExposedPorts(dockerPath, options);
|
22416
22415
|
}
|
22417
22416
|
}
|
22417
|
+
async function resolveImageName(accountId, image) {
|
22418
|
+
let url4;
|
22419
|
+
try {
|
22420
|
+
url4 = new URL(`http://${image}`);
|
22421
|
+
} catch (_4) {
|
22422
|
+
return image;
|
22423
|
+
}
|
22424
|
+
if (url4.hostname !== getCloudflareContainerRegistry()) {
|
22425
|
+
return image;
|
22426
|
+
}
|
22427
|
+
if (url4.pathname.startsWith(`/${accountId}`)) {
|
22428
|
+
return image;
|
22429
|
+
}
|
22430
|
+
return `${url4.hostname}/${accountId}${url4.pathname}`;
|
22431
|
+
}
|
22418
22432
|
var init_images = __esm({
|
22419
22433
|
"../containers-shared/src/images.ts"() {
|
22420
22434
|
init_import_meta_url();
|
@@ -22424,6 +22438,7 @@ var init_images = __esm({
|
|
22424
22438
|
init_utils();
|
22425
22439
|
__name(pullImage, "pullImage");
|
22426
22440
|
__name(prepareContainerImagesForDev, "prepareContainerImagesForDev");
|
22441
|
+
__name(resolveImageName, "resolveImageName");
|
22427
22442
|
}
|
22428
22443
|
});
|
22429
22444
|
|
@@ -29500,7 +29515,7 @@ var name, version;
|
|
29500
29515
|
var init_package = __esm({
|
29501
29516
|
"package.json"() {
|
29502
29517
|
name = "wrangler";
|
29503
|
-
version = "4.24.
|
29518
|
+
version = "4.24.2";
|
29504
29519
|
}
|
29505
29520
|
});
|
29506
29521
|
|
@@ -49134,7 +49149,7 @@ async function domainUsesAccess(domain2) {
|
|
49134
49149
|
const cancel3 = setTimeout(() => {
|
49135
49150
|
controller.abort();
|
49136
49151
|
}, 1e3);
|
49137
|
-
const output = await (0,
|
49152
|
+
const output = await (0, import_undici.fetch)(`https://${domain2}`, {
|
49138
49153
|
redirect: "manual",
|
49139
49154
|
signal: controller.signal
|
49140
49155
|
});
|
@@ -49169,12 +49184,12 @@ async function getAccessToken(domain2) {
|
|
49169
49184
|
}
|
49170
49185
|
throw new Error("Failed to authenticate with Cloudflare Access");
|
49171
49186
|
}
|
49172
|
-
var import_child_process4,
|
49187
|
+
var import_child_process4, import_undici, cache, usesAccessCache;
|
49173
49188
|
var init_access = __esm({
|
49174
49189
|
"src/user/access.ts"() {
|
49175
49190
|
init_import_meta_url();
|
49176
49191
|
import_child_process4 = require("child_process");
|
49177
|
-
|
49192
|
+
import_undici = __toESM(require_undici());
|
49178
49193
|
init_errors();
|
49179
49194
|
init_logger();
|
49180
49195
|
cache = {};
|
@@ -49764,7 +49779,7 @@ async function logout() {
|
|
49764
49779
|
return;
|
49765
49780
|
}
|
49766
49781
|
const body2 = `client_id=${encodeURIComponent(getClientIdFromEnv())}&token_type_hint=refresh_token&token=${encodeURIComponent(LocalState.refreshToken?.value || "")}`;
|
49767
|
-
const response2 = await (0,
|
49782
|
+
const response2 = await (0, import_undici2.fetch)(getRevokeUrlFromEnv(), {
|
49768
49783
|
method: "POST",
|
49769
49784
|
body: body2,
|
49770
49785
|
headers: {
|
@@ -49777,7 +49792,7 @@ async function logout() {
|
|
49777
49792
|
);
|
49778
49793
|
}
|
49779
49794
|
const body = `client_id=${encodeURIComponent(getClientIdFromEnv())}&token_type_hint=refresh_token&token=${encodeURIComponent(LocalState.refreshToken?.value || "")}`;
|
49780
|
-
const response = await (0,
|
49795
|
+
const response = await (0, import_undici2.fetch)(getRevokeUrlFromEnv(), {
|
49781
49796
|
method: "POST",
|
49782
49797
|
body,
|
49783
49798
|
headers: {
|
@@ -49878,7 +49893,7 @@ async function fetchAuthToken(body) {
|
|
49878
49893
|
if (await domainUsesAccess(getAuthDomainFromEnv())) {
|
49879
49894
|
headers["Cookie"] = `CF_Authorization=${await getCloudflareAccessToken()}`;
|
49880
49895
|
}
|
49881
|
-
return await (0,
|
49896
|
+
return await (0, import_undici2.fetch)(getTokenUrlFromEnv(), {
|
49882
49897
|
method: "POST",
|
49883
49898
|
body: body.toString(),
|
49884
49899
|
headers
|
@@ -49906,7 +49921,7 @@ async function getJSONFromResponse(response) {
|
|
49906
49921
|
);
|
49907
49922
|
}
|
49908
49923
|
}
|
49909
|
-
var import_node_assert2, import_node_crypto2, import_node_fs6, import_node_http, import_node_path12, import_node_url4, import_node_util2, import_toml3,
|
49924
|
+
var import_node_assert2, import_node_crypto2, import_node_fs6, import_node_http, import_node_path12, import_node_url4, import_node_util2, import_toml3, import_undici2, USER_AUTH_CONFIG_PATH, DefaultScopes, DefaultScopeKeys, LocalState, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, RawErrorToErrorClassMap, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET;
|
49910
49925
|
var init_user = __esm({
|
49911
49926
|
"src/user/user.ts"() {
|
49912
49927
|
init_import_meta_url();
|
@@ -49919,7 +49934,7 @@ var init_user = __esm({
|
|
49919
49934
|
import_node_util2 = require("util");
|
49920
49935
|
import_toml3 = __toESM(require_toml());
|
49921
49936
|
init_esm2();
|
49922
|
-
|
49937
|
+
import_undici2 = __toESM(require_undici());
|
49923
49938
|
init_config2();
|
49924
49939
|
init_config_cache();
|
49925
49940
|
init_dialogs();
|
@@ -50184,16 +50199,16 @@ async function performApiFetch(complianceConfig, resource, init3 = {}, queryPara
|
|
50184
50199
|
delete logHeaders["Authorization"];
|
50185
50200
|
logger.debugWithSanitization("HEADERS:", JSON.stringify(logHeaders, null, 2));
|
50186
50201
|
logger.debugWithSanitization("INIT:", JSON.stringify({ ...init3 }, null, 2));
|
50187
|
-
if (init3.body instanceof
|
50202
|
+
if (init3.body instanceof import_undici3.FormData) {
|
50188
50203
|
logger.debugWithSanitization(
|
50189
50204
|
"BODY:",
|
50190
|
-
await new
|
50205
|
+
await new import_undici3.Response(init3.body).text(),
|
50191
50206
|
null,
|
50192
50207
|
2
|
50193
50208
|
);
|
50194
50209
|
}
|
50195
50210
|
logger.debug("-- END CF API REQUEST");
|
50196
|
-
return await (0,
|
50211
|
+
return await (0, import_undici3.fetch)(
|
50197
50212
|
`${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`,
|
50198
50213
|
{
|
50199
50214
|
method,
|
@@ -50252,7 +50267,7 @@ function truncate(text, maxLength) {
|
|
50252
50267
|
return `${text.substring(0, maxLength)}... (length = ${length})`;
|
50253
50268
|
}
|
50254
50269
|
function cloneHeaders(headers) {
|
50255
|
-
return headers instanceof
|
50270
|
+
return headers instanceof import_undici3.Headers ? Object.fromEntries(headers.entries()) : Array.isArray(headers) ? Object.fromEntries(headers) : { ...headers };
|
50256
50271
|
}
|
50257
50272
|
async function requireLoggedIn(complianceConfig) {
|
50258
50273
|
const loggedIn = await loginOrRefreshIfRequired(complianceConfig);
|
@@ -50279,7 +50294,7 @@ async function fetchKVGetValue(complianceConfig, accountId, namespaceId, key) {
|
|
50279
50294
|
const headers = {};
|
50280
50295
|
addAuthorizationHeaderIfUnspecified(headers, auth);
|
50281
50296
|
const resource = `${getCloudflareApiBaseUrl(complianceConfig)}/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${key}`;
|
50282
|
-
const response = await (0,
|
50297
|
+
const response = await (0, import_undici3.fetch)(resource, {
|
50283
50298
|
method: "GET",
|
50284
50299
|
headers
|
50285
50300
|
});
|
@@ -50297,7 +50312,7 @@ async function fetchR2Objects(complianceConfig, resource, bodyInit = {}) {
|
|
50297
50312
|
const headers = cloneHeaders(bodyInit.headers);
|
50298
50313
|
addAuthorizationHeaderIfUnspecified(headers, auth);
|
50299
50314
|
addUserAgent(headers);
|
50300
|
-
const response = await (0,
|
50315
|
+
const response = await (0, import_undici3.fetch)(
|
50301
50316
|
`${getCloudflareApiBaseUrl(complianceConfig)}${resource}`,
|
50302
50317
|
{
|
50303
50318
|
...bodyInit,
|
@@ -50320,7 +50335,7 @@ async function fetchWorkerDefinitionFromDash(complianceConfig, resource, bodyIni
|
|
50320
50335
|
const headers = cloneHeaders(bodyInit.headers);
|
50321
50336
|
addAuthorizationHeaderIfUnspecified(headers, auth);
|
50322
50337
|
addUserAgent(headers);
|
50323
|
-
let response = await (0,
|
50338
|
+
let response = await (0, import_undici3.fetch)(
|
50324
50339
|
`${getCloudflareApiBaseUrl(complianceConfig)}${resource}`,
|
50325
50340
|
{
|
50326
50341
|
...bodyInit,
|
@@ -50336,11 +50351,11 @@ async function fetchWorkerDefinitionFromDash(complianceConfig, resource, bodyIni
|
|
50336
50351
|
const usesModules = response.headers.get("content-type")?.startsWith("multipart");
|
50337
50352
|
if (usesModules) {
|
50338
50353
|
if (!response.formData) {
|
50339
|
-
response = new
|
50354
|
+
response = new import_undici3.Response(await response.text(), response);
|
50340
50355
|
}
|
50341
50356
|
const form = await response.formData();
|
50342
50357
|
const files = Array.from(form.entries()).map(
|
50343
|
-
([filename, contents]) => contents instanceof
|
50358
|
+
([filename, contents]) => contents instanceof import_undici3.File ? contents : new import_undici3.File([contents], filename)
|
50344
50359
|
);
|
50345
50360
|
return {
|
50346
50361
|
entrypoint: response.headers.get("cf-entrypoint") ?? "src/index.js",
|
@@ -50348,19 +50363,19 @@ async function fetchWorkerDefinitionFromDash(complianceConfig, resource, bodyIni
|
|
50348
50363
|
};
|
50349
50364
|
} else {
|
50350
50365
|
const contents = await response.text();
|
50351
|
-
const file = new
|
50366
|
+
const file = new import_undici3.File([contents], "index.js", { type: "text" });
|
50352
50367
|
return {
|
50353
50368
|
entrypoint: "index.js",
|
50354
50369
|
modules: [file]
|
50355
50370
|
};
|
50356
50371
|
}
|
50357
50372
|
}
|
50358
|
-
var import_node_assert3,
|
50373
|
+
var import_node_assert3, import_undici3;
|
50359
50374
|
var init_internal = __esm({
|
50360
50375
|
"src/cfetch/internal.ts"() {
|
50361
50376
|
init_import_meta_url();
|
50362
50377
|
import_node_assert3 = __toESM(require("assert"));
|
50363
|
-
|
50378
|
+
import_undici3 = __toESM(require_undici());
|
50364
50379
|
init_package();
|
50365
50380
|
init_misc_variables();
|
50366
50381
|
init_errors();
|
@@ -62550,7 +62565,7 @@ function resolveMemory(args, config) {
|
|
62550
62565
|
}
|
62551
62566
|
return void 0;
|
62552
62567
|
}
|
62553
|
-
function resolveAppDiskSize(
|
62568
|
+
function resolveAppDiskSize(app) {
|
62554
62569
|
if (app === void 0) {
|
62555
62570
|
return void 0;
|
62556
62571
|
}
|
@@ -62698,12 +62713,7 @@ function pushYargs(yargs) {
|
|
62698
62713
|
}
|
62699
62714
|
async function buildAndMaybePush(args, pathToDocker, push, configPath, containerConfig) {
|
62700
62715
|
try {
|
62701
|
-
const
|
62702
|
-
const cloudflareAccountID = account.external_account_id;
|
62703
|
-
const imageTag = getCloudflareRegistryWithAccountNamespace(
|
62704
|
-
cloudflareAccountID,
|
62705
|
-
args.tag
|
62706
|
-
);
|
62716
|
+
const imageTag = `${getCloudflareContainerRegistry()}/${args.tag}`;
|
62707
62717
|
const { buildCmd, dockerfile } = await constructBuildCommand(
|
62708
62718
|
{
|
62709
62719
|
tag: imageTag,
|
@@ -62725,17 +62735,18 @@ async function buildAndMaybePush(args, pathToDocker, push, configPath, container
|
|
62725
62735
|
formatString: "{{ .Size }} {{ len .RootFS.Layers }} {{json .RepoDigests}}"
|
62726
62736
|
});
|
62727
62737
|
const [sizeStr, layerStr, repoDigests] = inspectOutput.split(" ");
|
62728
|
-
const size = parseInt(sizeStr, 10);
|
62729
|
-
const layers = parseInt(layerStr, 10);
|
62730
|
-
const MiB = 1024 * 1024;
|
62731
|
-
const requiredSize = Math.ceil(size * 1.1 + layers * 16 * MiB);
|
62732
|
-
await ensureDiskLimits({
|
62733
|
-
requiredSize,
|
62734
|
-
account,
|
62735
|
-
containerApp: containerConfig
|
62736
|
-
});
|
62737
62738
|
let pushed = false;
|
62738
62739
|
if (push) {
|
62740
|
+
const account = await loadAccount();
|
62741
|
+
const size = parseInt(sizeStr, 10);
|
62742
|
+
const layers = parseInt(layerStr, 10);
|
62743
|
+
const MiB = 1024 * 1024;
|
62744
|
+
const requiredSize = Math.ceil(size * 1.1 + layers * 16 * MiB);
|
62745
|
+
await ensureDiskLimits({
|
62746
|
+
requiredSize,
|
62747
|
+
account,
|
62748
|
+
containerApp: containerConfig
|
62749
|
+
});
|
62739
62750
|
await dockerLoginManagedRegistry(pathToDocker);
|
62740
62751
|
try {
|
62741
62752
|
const parsedDigests = JSON.parse(repoDigests);
|
@@ -62745,33 +62756,47 @@ async function buildAndMaybePush(args, pathToDocker, push, configPath, container
|
|
62745
62756
|
);
|
62746
62757
|
}
|
62747
62758
|
const repositoryOnly = imageTag.split(":")[0];
|
62748
|
-
const
|
62759
|
+
const [digest, ...rest] = parsedDigests.filter(
|
62749
62760
|
(d6) => typeof d6 === "string" && d6.split("@")[0] === repositoryOnly
|
62750
62761
|
);
|
62751
|
-
if (
|
62762
|
+
if (rest.length > 0) {
|
62752
62763
|
throw new Error(
|
62753
|
-
`Expected there to only be 1 valid digests for this repository: ${repositoryOnly} but there were ${
|
62764
|
+
`Expected there to only be 1 valid digests for this repository: ${repositoryOnly} but there were ${rest.length + 1}`
|
62754
62765
|
);
|
62755
62766
|
}
|
62767
|
+
const [image, hash] = digest.split("@");
|
62768
|
+
const resolvedImage = await resolveImageName(
|
62769
|
+
account.external_account_id,
|
62770
|
+
image
|
62771
|
+
);
|
62772
|
+
const remoteDigest = `${resolvedImage}@${hash}`;
|
62756
62773
|
await runDockerCmd(
|
62757
62774
|
pathToDocker,
|
62758
|
-
["manifest", "inspect",
|
62775
|
+
["manifest", "inspect", remoteDigest],
|
62759
62776
|
"ignore"
|
62760
62777
|
);
|
62761
62778
|
logger.log("Image already exists remotely, skipping push");
|
62762
62779
|
logger.debug(
|
62763
|
-
`Untagging built image: ${
|
62780
|
+
`Untagging built image: ${args.tag} since there was no change.`
|
62764
62781
|
);
|
62765
62782
|
await runDockerCmd(pathToDocker, ["image", "rm", imageTag]);
|
62766
|
-
return { image:
|
62783
|
+
return { image: remoteDigest, pushed: false };
|
62767
62784
|
} catch (error2) {
|
62768
|
-
logger.log(`Image does not exist remotely, pushing: ${imageTag}`);
|
62769
62785
|
if (error2 instanceof Error) {
|
62770
62786
|
logger.debug(
|
62771
|
-
`Checking for local image ${
|
62787
|
+
`Checking for local image ${args.tag} failed with error: ${error2.message}`
|
62772
62788
|
);
|
62773
62789
|
}
|
62774
|
-
|
62790
|
+
const namespacedImageTag = getCloudflareRegistryWithAccountNamespace(
|
62791
|
+
account.external_account_id,
|
62792
|
+
args.tag
|
62793
|
+
);
|
62794
|
+
logger.log(
|
62795
|
+
`Image does not exist remotely, pushing: ${namespacedImageTag}`
|
62796
|
+
);
|
62797
|
+
await runDockerCmd(pathToDocker, ["tag", imageTag, namespacedImageTag]);
|
62798
|
+
await runDockerCmd(pathToDocker, ["push", namespacedImageTag]);
|
62799
|
+
await runDockerCmd(pathToDocker, ["image", "rm", namespacedImageTag]);
|
62775
62800
|
pushed = true;
|
62776
62801
|
}
|
62777
62802
|
}
|
@@ -62807,12 +62832,12 @@ async function buildCommand(args, config) {
|
|
62807
62832
|
);
|
62808
62833
|
}
|
62809
62834
|
}
|
62810
|
-
async function pushCommand(args,
|
62835
|
+
async function pushCommand(args, config) {
|
62811
62836
|
try {
|
62812
62837
|
await dockerLoginManagedRegistry(args.pathToDocker);
|
62813
|
-
const
|
62838
|
+
const accountId = config.account_id || await getAccountId(config);
|
62814
62839
|
const newTag = getCloudflareRegistryWithAccountNamespace(
|
62815
|
-
|
62840
|
+
accountId,
|
62816
62841
|
args.TAG
|
62817
62842
|
);
|
62818
62843
|
const dockerPath = args.pathToDocker ?? getDockerPath();
|
@@ -62829,7 +62854,7 @@ async function pushCommand(args, _4) {
|
|
62829
62854
|
async function ensureDiskLimits(options) {
|
62830
62855
|
const MB = 1e3 * 1e3;
|
62831
62856
|
const MiB = 1024 * 1024;
|
62832
|
-
const appDiskSize = resolveAppDiskSize(options.
|
62857
|
+
const appDiskSize = resolveAppDiskSize(options.containerApp);
|
62833
62858
|
const accountDiskSize = (options.account.limits.disk_mb_per_deployment ?? 2e3) * MB;
|
62834
62859
|
if (appDiskSize && appDiskSize > accountDiskSize) {
|
62835
62860
|
throw new UserError(
|
@@ -62856,6 +62881,7 @@ var init_build2 = __esm({
|
|
62856
62881
|
init_misc_variables();
|
62857
62882
|
init_errors();
|
62858
62883
|
init_logger();
|
62884
|
+
init_user2();
|
62859
62885
|
init_common();
|
62860
62886
|
init_locations();
|
62861
62887
|
__name(buildYargs, "buildYargs");
|
@@ -63975,22 +64001,6 @@ function sortObjectRecursive(object) {
|
|
63975
64001
|
}
|
63976
64002
|
return sortObjectKeys(objectCopy);
|
63977
64003
|
}
|
63978
|
-
async function resolveImageName(config, image) {
|
63979
|
-
let url4;
|
63980
|
-
try {
|
63981
|
-
url4 = new URL(`http://${image}`);
|
63982
|
-
} catch (_4) {
|
63983
|
-
return image;
|
63984
|
-
}
|
63985
|
-
if (url4.hostname !== getCloudflareContainerRegistry()) {
|
63986
|
-
return image;
|
63987
|
-
}
|
63988
|
-
const accountId = config.account_id || await getAccountId(config);
|
63989
|
-
if (url4.pathname.startsWith(`/${accountId}`)) {
|
63990
|
-
return image;
|
63991
|
-
}
|
63992
|
-
return `${url4.hostname}/${accountId}${url4.pathname}`;
|
63993
|
-
}
|
63994
64004
|
async function apply(args, config) {
|
63995
64005
|
startSection(
|
63996
64006
|
"Deploy a container application",
|
@@ -64169,13 +64179,14 @@ async function apply(args, config) {
|
|
64169
64179
|
s5.split("\n").map((line) => line.trim()).forEach((el) => {
|
64170
64180
|
printLine(el, " ");
|
64171
64181
|
});
|
64182
|
+
const accountId = config.account_id || await getAccountId(config);
|
64172
64183
|
const configToPush = {
|
64173
64184
|
...appConfig,
|
64174
64185
|
configuration: {
|
64175
64186
|
...appConfig.configuration,
|
64176
64187
|
// De-sugar image name. We do it here so that the user
|
64177
64188
|
// sees the simplified image name in diffs.
|
64178
|
-
image: await resolveImageName(
|
64189
|
+
image: await resolveImageName(accountId, appConfig.configuration.image)
|
64179
64190
|
}
|
64180
64191
|
};
|
64181
64192
|
actions.push({
|
@@ -64352,7 +64363,6 @@ var init_apply = __esm({
|
|
64352
64363
|
__name(stripUndefined, "stripUndefined");
|
64353
64364
|
__name(sortObjectKeys, "sortObjectKeys");
|
64354
64365
|
__name(sortObjectRecursive, "sortObjectRecursive");
|
64355
|
-
__name(resolveImageName, "resolveImageName");
|
64356
64366
|
__name(apply, "apply");
|
64357
64367
|
__name(applyCommand, "applyCommand");
|
64358
64368
|
}
|
@@ -64800,7 +64810,7 @@ function unexpectedKVKeyValueProps(keyValue) {
|
|
64800
64810
|
return props.filter((prop) => !KeyValueKeys.has(prop));
|
64801
64811
|
}
|
64802
64812
|
function asFormData(fields) {
|
64803
|
-
const formData = new
|
64813
|
+
const formData = new import_undici4.FormData();
|
64804
64814
|
for (const [name2, value] of Object.entries(fields)) {
|
64805
64815
|
formData.append(name2, Buffer.isBuffer(value) ? new import_node_buffer2.Blob([value]) : value);
|
64806
64816
|
}
|
@@ -64979,14 +64989,14 @@ async function usingLocalNamespace(persistTo, config, namespaceId, closure) {
|
|
64979
64989
|
await mf.dispose();
|
64980
64990
|
}
|
64981
64991
|
}
|
64982
|
-
var import_node_buffer2, import_node_url8, import_miniflare9,
|
64992
|
+
var import_node_buffer2, import_node_url8, import_miniflare9, import_undici4, API_MAX, BATCH_KEY_MAX, BATCH_MAX_ERRORS_WARNINGS, KeyValueKeys, formatNumber;
|
64983
64993
|
var init_helpers4 = __esm({
|
64984
64994
|
"src/kv/helpers.ts"() {
|
64985
64995
|
init_import_meta_url();
|
64986
64996
|
import_node_buffer2 = require("buffer");
|
64987
64997
|
import_node_url8 = require("url");
|
64988
64998
|
import_miniflare9 = require("miniflare");
|
64989
|
-
|
64999
|
+
import_undici4 = __toESM(require_undici());
|
64990
65000
|
init_cfetch();
|
64991
65001
|
init_get_local_persistence_path();
|
64992
65002
|
init_miniflare();
|
@@ -65373,7 +65383,7 @@ function getMetricsDispatcher(options) {
|
|
65373
65383
|
return;
|
65374
65384
|
}
|
65375
65385
|
logger.debug(`Metrics dispatcher: Posting data ${JSON.stringify(body)}`);
|
65376
|
-
const request4 = (0,
|
65386
|
+
const request4 = (0, import_undici5.fetch)(`${SPARROW_URL}/api/v1/event`, {
|
65377
65387
|
method: "POST",
|
65378
65388
|
headers: {
|
65379
65389
|
Accept: "*/*",
|
@@ -65414,12 +65424,12 @@ Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more
|
|
65414
65424
|
}
|
65415
65425
|
__name(printMetricsBanner, "printMetricsBanner");
|
65416
65426
|
}
|
65417
|
-
var
|
65427
|
+
var import_undici5, SPARROW_URL, normalise, exclude, sanitiseUserInput, getAllowedArgs, redactArgValues;
|
65418
65428
|
var init_metrics_dispatcher = __esm({
|
65419
65429
|
"src/metrics/metrics-dispatcher.ts"() {
|
65420
65430
|
init_import_meta_url();
|
65421
65431
|
init_source();
|
65422
|
-
|
65432
|
+
import_undici5 = __toESM(require_undici());
|
65423
65433
|
init_config2();
|
65424
65434
|
init_is_interactive();
|
65425
65435
|
init_logger();
|
@@ -66276,7 +66286,7 @@ function fromMimeType(mimeType) {
|
|
66276
66286
|
return moduleType;
|
66277
66287
|
}
|
66278
66288
|
function createWorkerUploadForm(worker) {
|
66279
|
-
const formData = new
|
66289
|
+
const formData = new import_undici6.FormData();
|
66280
66290
|
const {
|
66281
66291
|
main: main2,
|
66282
66292
|
sourceMaps,
|
@@ -66312,6 +66322,7 @@ function createWorkerUploadForm(worker) {
|
|
66312
66322
|
jwt: assets.jwt,
|
66313
66323
|
config: assetConfig
|
66314
66324
|
},
|
66325
|
+
...annotations && { annotations },
|
66315
66326
|
...compatibility_date && { compatibility_date },
|
66316
66327
|
...compatibility_flags && { compatibility_flags }
|
66317
66328
|
})
|
@@ -66529,7 +66540,7 @@ function createWorkerUploadForm(worker) {
|
|
66529
66540
|
});
|
66530
66541
|
formData.set(
|
66531
66542
|
name2,
|
66532
|
-
new
|
66543
|
+
new import_undici6.File(
|
66533
66544
|
[typeof source === "string" ? (0, import_node_fs14.readFileSync)(source) : source],
|
66534
66545
|
typeof source === "string" ? source : name2,
|
66535
66546
|
{
|
@@ -66581,7 +66592,7 @@ function createWorkerUploadForm(worker) {
|
|
66581
66592
|
if (name2 !== "__STATIC_CONTENT_MANIFEST") {
|
66582
66593
|
formData.set(
|
66583
66594
|
name2,
|
66584
|
-
new
|
66595
|
+
new import_undici6.File([(0, import_node_fs14.readFileSync)(filePath)], filePath, {
|
66585
66596
|
type: "text/plain"
|
66586
66597
|
})
|
66587
66598
|
);
|
@@ -66595,7 +66606,7 @@ function createWorkerUploadForm(worker) {
|
|
66595
66606
|
});
|
66596
66607
|
formData.set(
|
66597
66608
|
name2,
|
66598
|
-
new
|
66609
|
+
new import_undici6.File(
|
66599
66610
|
[typeof source === "string" ? (0, import_node_fs14.readFileSync)(source) : source],
|
66600
66611
|
typeof source === "string" ? source : name2,
|
66601
66612
|
{
|
@@ -66630,7 +66641,7 @@ function createWorkerUploadForm(worker) {
|
|
66630
66641
|
if (module3.name === "__STATIC_CONTENT_MANIFEST") {
|
66631
66642
|
formData.set(
|
66632
66643
|
module3.name,
|
66633
|
-
new
|
66644
|
+
new import_undici6.File([module3.content], module3.name, {
|
66634
66645
|
type: "text/plain"
|
66635
66646
|
})
|
66636
66647
|
);
|
@@ -66644,7 +66655,7 @@ function createWorkerUploadForm(worker) {
|
|
66644
66655
|
});
|
66645
66656
|
formData.set(
|
66646
66657
|
name2,
|
66647
|
-
new
|
66658
|
+
new import_undici6.File([module3.content], module3.name, {
|
66648
66659
|
type: module3.type === "compiled-wasm" ? "application/wasm" : module3.type === "text" ? "text/plain" : "application/octet-stream"
|
66649
66660
|
})
|
66650
66661
|
);
|
@@ -66661,7 +66672,7 @@ function createWorkerUploadForm(worker) {
|
|
66661
66672
|
capnpSchemaOutputFile = `./capnp-${Date.now()}.compiled`;
|
66662
66673
|
formData.set(
|
66663
66674
|
capnpSchemaOutputFile,
|
66664
|
-
new
|
66675
|
+
new import_undici6.File([capnpOutput], capnpSchemaOutputFile, {
|
66665
66676
|
type: "application/octet-stream"
|
66666
66677
|
})
|
66667
66678
|
);
|
@@ -66718,7 +66729,7 @@ function createWorkerUploadForm(worker) {
|
|
66718
66729
|
for (const module3 of [main2].concat(modules || [])) {
|
66719
66730
|
formData.set(
|
66720
66731
|
module3.name,
|
66721
|
-
new
|
66732
|
+
new import_undici6.File([module3.content], module3.name, {
|
66722
66733
|
type: toMimeType(module3.type ?? main2.type ?? "esm")
|
66723
66734
|
})
|
66724
66735
|
);
|
@@ -66726,21 +66737,21 @@ function createWorkerUploadForm(worker) {
|
|
66726
66737
|
for (const sourceMap of sourceMaps || []) {
|
66727
66738
|
formData.set(
|
66728
66739
|
sourceMap.name,
|
66729
|
-
new
|
66740
|
+
new import_undici6.File([sourceMap.content], sourceMap.name, {
|
66730
66741
|
type: "application/source-map"
|
66731
66742
|
})
|
66732
66743
|
);
|
66733
66744
|
}
|
66734
66745
|
return formData;
|
66735
66746
|
}
|
66736
|
-
var import_node_assert13, import_node_fs14, import_node_path26,
|
66747
|
+
var import_node_assert13, import_node_fs14, import_node_path26, import_undici6, moduleTypeMimeType;
|
66737
66748
|
var init_create_worker_upload_form = __esm({
|
66738
66749
|
"src/deployment-bundle/create-worker-upload-form.ts"() {
|
66739
66750
|
init_import_meta_url();
|
66740
66751
|
import_node_assert13 = __toESM(require("assert"));
|
66741
66752
|
import_node_fs14 = require("fs");
|
66742
66753
|
import_node_path26 = __toESM(require("path"));
|
66743
|
-
|
66754
|
+
import_undici6 = __toESM(require_undici());
|
66744
66755
|
init_errors();
|
66745
66756
|
init_bindings();
|
66746
66757
|
init_capnp();
|
@@ -75016,13 +75027,13 @@ var init_utils5 = __esm({
|
|
75016
75027
|
});
|
75017
75028
|
|
75018
75029
|
// src/ai/createFinetune.ts
|
75019
|
-
var import_fs14, import_path12,
|
75030
|
+
var import_fs14, import_path12, import_undici7, requiredAssets, aiFineTuneCreateCommand;
|
75020
75031
|
var init_createFinetune = __esm({
|
75021
75032
|
"src/ai/createFinetune.ts"() {
|
75022
75033
|
init_import_meta_url();
|
75023
75034
|
import_fs14 = __toESM(require("fs"));
|
75024
75035
|
import_path12 = __toESM(require("path"));
|
75025
|
-
|
75036
|
+
import_undici7 = __toESM(require_undici());
|
75026
75037
|
init_cfetch();
|
75027
75038
|
init_create_command();
|
75028
75039
|
init_logger();
|
@@ -75086,7 +75097,7 @@ var init_createFinetune = __esm({
|
|
75086
75097
|
`\u{1F300} Uploading file "${filePath}" to "${finetune_name}"...`
|
75087
75098
|
);
|
75088
75099
|
try {
|
75089
|
-
const formdata = new
|
75100
|
+
const formdata = new import_undici7.FormData();
|
75090
75101
|
formdata.set("file_name", file.name);
|
75091
75102
|
formdata.set("file", new Blob([import_fs14.default.readFileSync(filePath)]));
|
75092
75103
|
await fetchResult(
|
@@ -78443,7 +78454,7 @@ async function uploadAndBeginIngestion(complianceConfig, accountId, db, file, et
|
|
78443
78454
|
const { upload_url, filename } = initResponse;
|
78444
78455
|
const { size } = await import_fs15.promises.stat(file);
|
78445
78456
|
const uploadResponse = await spinnerWhile({
|
78446
|
-
promise: (0,
|
78457
|
+
promise: (0, import_undici8.fetch)(upload_url, {
|
78447
78458
|
method: "PUT",
|
78448
78459
|
headers: {
|
78449
78460
|
"Content-length": `${size}`
|
@@ -78556,7 +78567,7 @@ async function checkForSQLiteBinary(filename) {
|
|
78556
78567
|
);
|
78557
78568
|
}
|
78558
78569
|
}
|
78559
|
-
var import_fs15, import_node_assert16, import_node_path27, import_md5_file, import_miniflare12,
|
78570
|
+
var import_fs15, import_node_assert16, import_node_path27, import_md5_file, import_miniflare12, import_undici8, d1ExecuteCommand;
|
78560
78571
|
var init_execute = __esm({
|
78561
78572
|
"src/d1/execute.ts"() {
|
78562
78573
|
init_import_meta_url();
|
@@ -78567,7 +78578,7 @@ var init_execute = __esm({
|
|
78567
78578
|
init_source();
|
78568
78579
|
import_md5_file = __toESM(require_md5_file());
|
78569
78580
|
import_miniflare12 = require("miniflare");
|
78570
|
-
|
78581
|
+
import_undici8 = __toESM(require_undici());
|
78571
78582
|
init_cfetch();
|
78572
78583
|
init_config2();
|
78573
78584
|
init_create_command();
|
@@ -78789,7 +78800,7 @@ async function exportRemotely(config, name2, output, tables, noSchema, noData) {
|
|
78789
78800
|
await spinnerWhile({
|
78790
78801
|
startMessage: `Downloading SQL to ${output}`,
|
78791
78802
|
async promise() {
|
78792
|
-
const contents = await (0,
|
78803
|
+
const contents = await (0, import_undici9.fetch)(finalResponse.result.signed_url);
|
78793
78804
|
if (!contents.ok) {
|
78794
78805
|
throw new Error(
|
78795
78806
|
`There was an error while downloading from the presigned URL with status code: ${contents.status}`
|
@@ -78846,7 +78857,7 @@ async function pollExport(s5, complianceConfig, accountId, db, dumpOptions, curr
|
|
78846
78857
|
);
|
78847
78858
|
}
|
78848
78859
|
}
|
78849
|
-
var import_promises12, import_node_path28, import_miniflare13,
|
78860
|
+
var import_promises12, import_node_path28, import_miniflare13, import_undici9, d1ExportCommand;
|
78850
78861
|
var init_export = __esm({
|
78851
78862
|
"src/d1/export.ts"() {
|
78852
78863
|
init_import_meta_url();
|
@@ -78855,7 +78866,7 @@ var init_export = __esm({
|
|
78855
78866
|
init_interactive();
|
78856
78867
|
init_source();
|
78857
78868
|
import_miniflare13 = require("miniflare");
|
78858
|
-
|
78869
|
+
import_undici9 = __toESM(require_undici());
|
78859
78870
|
init_cfetch();
|
78860
78871
|
init_config2();
|
78861
78872
|
init_create_command();
|
@@ -81222,7 +81233,7 @@ async function runSearch(searchTerm) {
|
|
81222
81233
|
});
|
81223
81234
|
(0, import_node_assert18.default)(id, "Missing Algolia App ID");
|
81224
81235
|
(0, import_node_assert18.default)(key, "Missing Algolia Key");
|
81225
|
-
const searchResp = await (0,
|
81236
|
+
const searchResp = await (0, import_undici10.fetch)(
|
81226
81237
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
81227
81238
|
{
|
81228
81239
|
method: "POST",
|
@@ -81250,12 +81261,12 @@ async function runSearch(searchTerm) {
|
|
81250
81261
|
return;
|
81251
81262
|
}
|
81252
81263
|
}
|
81253
|
-
var import_node_assert18,
|
81264
|
+
var import_node_assert18, import_undici10;
|
81254
81265
|
var init_helpers7 = __esm({
|
81255
81266
|
"src/docs/helpers.ts"() {
|
81256
81267
|
init_import_meta_url();
|
81257
81268
|
import_node_assert18 = __toESM(require("assert"));
|
81258
|
-
|
81269
|
+
import_undici10 = __toESM(require_undici());
|
81259
81270
|
init_logger();
|
81260
81271
|
__name(runSearch, "runSearch");
|
81261
81272
|
}
|
@@ -84405,7 +84416,7 @@ async function createUploadWorkerBundleContents(workerBundle, config) {
|
|
84405
84416
|
delete metadata.bindings;
|
84406
84417
|
}
|
84407
84418
|
workerBundleFormData.set("metadata", JSON.stringify(metadata));
|
84408
|
-
return await new
|
84419
|
+
return await new import_undici11.Response(workerBundleFormData).blob();
|
84409
84420
|
}
|
84410
84421
|
function createWorkerBundleFormData(workerBundle, config) {
|
84411
84422
|
const mainModule = {
|
@@ -84437,13 +84448,13 @@ function createWorkerBundleFormData(workerBundle, config) {
|
|
84437
84448
|
observability: void 0
|
84438
84449
|
});
|
84439
84450
|
}
|
84440
|
-
var import_node_fs19, import_node_path34,
|
84451
|
+
var import_node_fs19, import_node_path34, import_undici11;
|
84441
84452
|
var init_create_worker_bundle_contents = __esm({
|
84442
84453
|
"src/api/pages/create-worker-bundle-contents.ts"() {
|
84443
84454
|
init_import_meta_url();
|
84444
84455
|
import_node_fs19 = require("fs");
|
84445
84456
|
import_node_path34 = __toESM(require("path"));
|
84446
|
-
|
84457
|
+
import_undici11 = __toESM(require_undici());
|
84447
84458
|
init_bindings();
|
84448
84459
|
init_create_worker_upload_form();
|
84449
84460
|
init_source_maps();
|
@@ -87416,7 +87427,7 @@ async function deploy2({
|
|
87416
87427
|
projectName,
|
87417
87428
|
skipCaching: skipCaching ?? false
|
87418
87429
|
});
|
87419
|
-
const formData = new
|
87430
|
+
const formData = new import_undici12.FormData();
|
87420
87431
|
formData.append("manifest", JSON.stringify(manifest));
|
87421
87432
|
if (branch) {
|
87422
87433
|
formData.append("branch", branch);
|
@@ -87431,17 +87442,17 @@ async function deploy2({
|
|
87431
87442
|
formData.append("commit_dirty", commitDirty);
|
87432
87443
|
}
|
87433
87444
|
if (_headers) {
|
87434
|
-
formData.append("_headers", new
|
87445
|
+
formData.append("_headers", new import_undici12.File([_headers], "_headers"));
|
87435
87446
|
logger.log(`\u2728 Uploading _headers`);
|
87436
87447
|
}
|
87437
87448
|
if (_redirects) {
|
87438
|
-
formData.append("_redirects", new
|
87449
|
+
formData.append("_redirects", new import_undici12.File([_redirects], "_redirects"));
|
87439
87450
|
logger.log(`\u2728 Uploading _redirects`);
|
87440
87451
|
}
|
87441
87452
|
if (filepathRoutingConfig) {
|
87442
87453
|
formData.append(
|
87443
87454
|
"functions-filepath-routing-config.json",
|
87444
|
-
new
|
87455
|
+
new import_undici12.File(
|
87445
87456
|
[filepathRoutingConfig],
|
87446
87457
|
"functions-filepath-routing-config.json"
|
87447
87458
|
)
|
@@ -87504,7 +87515,7 @@ async function deploy2({
|
|
87504
87515
|
);
|
87505
87516
|
formData.append(
|
87506
87517
|
"_worker.bundle",
|
87507
|
-
new
|
87518
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
87508
87519
|
);
|
87509
87520
|
logger.log(`\u2728 Uploading Worker bundle`);
|
87510
87521
|
if (_routesCustom) {
|
@@ -87513,7 +87524,7 @@ async function deploy2({
|
|
87513
87524
|
validateRoutes(routesCustomJSON, (0, import_node_path46.join)(directory, "_routes.json"));
|
87514
87525
|
formData.append(
|
87515
87526
|
"_routes.json",
|
87516
|
-
new
|
87527
|
+
new import_undici12.File([_routesCustom], "_routes.json")
|
87517
87528
|
);
|
87518
87529
|
logger.log(`\u2728 Uploading _routes.json`);
|
87519
87530
|
} catch (err) {
|
@@ -87530,7 +87541,7 @@ async function deploy2({
|
|
87530
87541
|
);
|
87531
87542
|
formData.append(
|
87532
87543
|
"_worker.bundle",
|
87533
|
-
new
|
87544
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
87534
87545
|
);
|
87535
87546
|
logger.log(`\u2728 Uploading Functions bundle`);
|
87536
87547
|
if (_routesCustom) {
|
@@ -87539,7 +87550,7 @@ async function deploy2({
|
|
87539
87550
|
validateRoutes(routesCustomJSON, (0, import_node_path46.join)(directory, "_routes.json"));
|
87540
87551
|
formData.append(
|
87541
87552
|
"_routes.json",
|
87542
|
-
new
|
87553
|
+
new import_undici12.File([_routesCustom], "_routes.json")
|
87543
87554
|
);
|
87544
87555
|
logger.log(`\u2728 Uploading _routes.json`);
|
87545
87556
|
} catch (err) {
|
@@ -87553,7 +87564,7 @@ async function deploy2({
|
|
87553
87564
|
if (_routesGenerated) {
|
87554
87565
|
formData.append(
|
87555
87566
|
"_routes.json",
|
87556
|
-
new
|
87567
|
+
new import_undici12.File([_routesGenerated], "_routes.json")
|
87557
87568
|
);
|
87558
87569
|
}
|
87559
87570
|
} catch {
|
@@ -87588,7 +87599,7 @@ async function deploy2({
|
|
87588
87599
|
}
|
87589
87600
|
throw lastErr;
|
87590
87601
|
}
|
87591
|
-
var import_node_crypto9, import_node_fs24, import_promises21, import_node_path46, import_node_process11,
|
87602
|
+
var import_node_crypto9, import_node_fs24, import_promises21, import_node_path46, import_node_process11, import_undici12;
|
87592
87603
|
var init_deploy4 = __esm({
|
87593
87604
|
"src/api/pages/deploy.ts"() {
|
87594
87605
|
init_import_meta_url();
|
@@ -87597,7 +87608,7 @@ var init_deploy4 = __esm({
|
|
87597
87608
|
import_promises21 = require("fs/promises");
|
87598
87609
|
import_node_path46 = __toESM(require("path"));
|
87599
87610
|
import_node_process11 = require("process");
|
87600
|
-
|
87611
|
+
import_undici12 = __toESM(require_undici());
|
87601
87612
|
init_cfetch();
|
87602
87613
|
init_config2();
|
87603
87614
|
init_bundle();
|
@@ -91722,14 +91733,14 @@ async function parseBulkInputToObject(input) {
|
|
91722
91733
|
}
|
91723
91734
|
return content;
|
91724
91735
|
}
|
91725
|
-
var import_node_path50, import_node_readline2, import_dotenv2,
|
91736
|
+
var import_node_path50, import_node_readline2, import_dotenv2, import_undici13, VERSION_NOT_DEPLOYED_ERR_CODE, secretNamespace, secretPutCommand, secretDeleteCommand, secretListCommand, secretBulkCommand;
|
91726
91737
|
var init_secret = __esm({
|
91727
91738
|
"src/secret/index.ts"() {
|
91728
91739
|
init_import_meta_url();
|
91729
91740
|
import_node_path50 = __toESM(require("path"));
|
91730
91741
|
import_node_readline2 = __toESM(require("readline"));
|
91731
91742
|
import_dotenv2 = __toESM(require_main2());
|
91732
|
-
|
91743
|
+
import_undici13 = __toESM(require_undici());
|
91733
91744
|
init_cfetch();
|
91734
91745
|
init_config2();
|
91735
91746
|
init_create_command();
|
@@ -92014,7 +92025,7 @@ var init_secret = __esm({
|
|
92014
92025
|
__name(getSettings2, "getSettings");
|
92015
92026
|
function putBindingsSettings(bindings) {
|
92016
92027
|
const url4 = !args.env || isLegacyEnv(config) ? `/accounts/${accountId}/workers/scripts/${scriptName}/settings` : `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/settings`;
|
92017
|
-
const data = new
|
92028
|
+
const data = new import_undici13.FormData();
|
92018
92029
|
data.set("settings", JSON.stringify({ bindings }));
|
92019
92030
|
return fetchResult(config, url4, {
|
92020
92031
|
method: "PATCH",
|
@@ -141919,13 +141930,13 @@ async function closeSentry() {
|
|
141919
141930
|
await close();
|
141920
141931
|
}
|
141921
141932
|
}
|
141922
|
-
var
|
141933
|
+
var import_undici16, sentryReportingAllowed, makeSentry10Transport, disabledDefaultIntegrations;
|
141923
141934
|
var init_sentry = __esm({
|
141924
141935
|
"src/sentry/index.ts"() {
|
141925
141936
|
init_import_meta_url();
|
141926
141937
|
init_esm9();
|
141927
141938
|
init_esm6();
|
141928
|
-
|
141939
|
+
import_undici16 = __toESM(require_undici());
|
141929
141940
|
init_package();
|
141930
141941
|
init_dialogs();
|
141931
141942
|
init_logger();
|
@@ -141942,9 +141953,9 @@ var init_sentry = __esm({
|
|
141942
141953
|
const eventsToSend = [...eventQueue];
|
141943
141954
|
eventQueue = [];
|
141944
141955
|
for (const event of eventsToSend) {
|
141945
|
-
await (0,
|
141956
|
+
await (0, import_undici16.fetch)(event[0], event[1]);
|
141946
141957
|
}
|
141947
|
-
const response = await (0,
|
141958
|
+
const response = await (0, import_undici16.fetch)(
|
141948
141959
|
`https://platform.dash.cloudflare.com/sentry/envelope`,
|
141949
141960
|
{
|
141950
141961
|
method: "POST",
|
@@ -144281,13 +144292,13 @@ var init_info4 = __esm({
|
|
144281
144292
|
});
|
144282
144293
|
|
144283
144294
|
// src/vectorize/insert.ts
|
144284
|
-
var import_node_fs28, import_node_readline3,
|
144295
|
+
var import_node_fs28, import_node_readline3, import_undici17, vectorizeInsertCommand;
|
144285
144296
|
var init_insert = __esm({
|
144286
144297
|
"src/vectorize/insert.ts"() {
|
144287
144298
|
init_import_meta_url();
|
144288
144299
|
import_node_fs28 = require("fs");
|
144289
144300
|
import_node_readline3 = require("readline");
|
144290
|
-
|
144301
|
+
import_undici17 = __toESM(require_undici());
|
144291
144302
|
init_create_command();
|
144292
144303
|
init_errors();
|
144293
144304
|
init_logger();
|
@@ -144348,10 +144359,10 @@ var init_insert = __esm({
|
|
144348
144359
|
}
|
144349
144360
|
let vectorInsertCount = 0;
|
144350
144361
|
for await (const batch of getBatchFromFile(rl, args.batchSize)) {
|
144351
|
-
const formData = new
|
144362
|
+
const formData = new import_undici17.FormData();
|
144352
144363
|
formData.append(
|
144353
144364
|
"vectors",
|
144354
|
-
new
|
144365
|
+
new import_undici17.File([batch.join(`
|
144355
144366
|
`)], "vectors.ndjson", {
|
144356
144367
|
type: "application/x-ndjson"
|
144357
144368
|
})
|
@@ -144706,13 +144717,13 @@ var init_query = __esm({
|
|
144706
144717
|
});
|
144707
144718
|
|
144708
144719
|
// src/vectorize/upsert.ts
|
144709
|
-
var import_node_fs29, import_node_readline4,
|
144720
|
+
var import_node_fs29, import_node_readline4, import_undici18, vectorizeUpsertCommand;
|
144710
144721
|
var init_upsert = __esm({
|
144711
144722
|
"src/vectorize/upsert.ts"() {
|
144712
144723
|
init_import_meta_url();
|
144713
144724
|
import_node_fs29 = require("fs");
|
144714
144725
|
import_node_readline4 = require("readline");
|
144715
|
-
|
144726
|
+
import_undici18 = __toESM(require_undici());
|
144716
144727
|
init_create_command();
|
144717
144728
|
init_errors();
|
144718
144729
|
init_logger();
|
@@ -144764,10 +144775,10 @@ var init_upsert = __esm({
|
|
144764
144775
|
}
|
144765
144776
|
let vectorUpsertCount = 0;
|
144766
144777
|
for await (const batch of getBatchFromFile(rl, args.batchSize)) {
|
144767
|
-
const formData = new
|
144778
|
+
const formData = new import_undici18.FormData();
|
144768
144779
|
formData.append(
|
144769
144780
|
"vectors",
|
144770
|
-
new
|
144781
|
+
new import_undici18.File([batch.join(`
|
144771
144782
|
`)], "vectors.ndjson", {
|
144772
144783
|
type: "application/x-ndjson"
|
144773
144784
|
})
|
@@ -147397,17 +147408,20 @@ var init_view2 = __esm({
|
|
147397
147408
|
Message: version5.annotations?.["workers/message"] || BLANK_INPUT5
|
147398
147409
|
})
|
147399
147410
|
);
|
147400
|
-
|
147401
|
-
|
147402
|
-
Handlers
|
147403
|
-
}
|
147411
|
+
const scriptInfo = {};
|
147412
|
+
if (version5.resources.script.handlers) {
|
147413
|
+
scriptInfo.Handlers = version5.resources.script.handlers.join(", ");
|
147414
|
+
}
|
147404
147415
|
if (version5.resources.script_runtime.compatibility_date) {
|
147405
147416
|
scriptInfo["Compatibility Date"] = version5.resources.script_runtime.compatibility_date;
|
147406
147417
|
}
|
147407
147418
|
if (version5.resources.script_runtime.compatibility_flags) {
|
147408
147419
|
scriptInfo["Compatibility Flags"] = version5.resources.script_runtime.compatibility_flags.join(", ");
|
147409
147420
|
}
|
147410
|
-
|
147421
|
+
if (Object.keys(scriptInfo).length > 0) {
|
147422
|
+
logRaw("------------------------------------------------------------");
|
147423
|
+
logRaw(formatLabelledValues(scriptInfo));
|
147424
|
+
}
|
147411
147425
|
const secrets = version5.resources.bindings.filter(
|
147412
147426
|
(binding) => binding.type === "secret_text"
|
147413
147427
|
);
|
@@ -152289,7 +152303,7 @@ ${tryRunningItIn}${oneOfThese}`
|
|
152289
152303
|
}
|
152290
152304
|
}
|
152291
152305
|
}
|
152292
|
-
var import_node_assert22, import_node_os7, import_promises31,
|
152306
|
+
var import_node_assert22, import_node_os7, import_promises31, import_undici19;
|
152293
152307
|
var init_src = __esm({
|
152294
152308
|
"src/index.ts"() {
|
152295
152309
|
init_import_meta_url();
|
@@ -152298,7 +152312,7 @@ var init_src = __esm({
|
|
152298
152312
|
import_promises31 = require("timers/promises");
|
152299
152313
|
init_containers_shared();
|
152300
152314
|
init_source();
|
152301
|
-
|
152315
|
+
import_undici19 = __toESM(require_undici());
|
152302
152316
|
init_yargs();
|
152303
152317
|
init_package();
|
152304
152318
|
init_ai();
|
@@ -152455,7 +152469,7 @@ var init_src = __esm({
|
|
152455
152469
|
init_trigger();
|
152456
152470
|
init_wrangler_banner();
|
152457
152471
|
if (proxy) {
|
152458
|
-
(0,
|
152472
|
+
(0, import_undici19.setGlobalDispatcher)(new import_undici19.ProxyAgent(proxy));
|
152459
152473
|
logger.log(
|
152460
152474
|
`Proxy environment variables detected. We'll use your proxy for fetch requests.`
|
152461
152475
|
);
|
@@ -153151,7 +153165,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
153151
153165
|
let workerBundle;
|
153152
153166
|
const dockerPath = getDockerPath();
|
153153
153167
|
if (config.containers) {
|
153154
|
-
const hasDockerfiles = config.containers
|
153168
|
+
const hasDockerfiles = config.containers.some(
|
153155
153169
|
(container) => isDockerfile(
|
153156
153170
|
container.image ?? container.configuration?.image,
|
153157
153171
|
config.configPath
|
@@ -153329,7 +153343,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
153329
153343
|
}
|
153330
153344
|
if (props.outFile) {
|
153331
153345
|
(0, import_node_fs31.mkdirSync)(import_node_path56.default.dirname(props.outFile), { recursive: true });
|
153332
|
-
const serializedFormData = await new
|
153346
|
+
const serializedFormData = await new import_undici20.Response(workerBundle).arrayBuffer();
|
153333
153347
|
(0, import_node_fs31.writeFileSync)(props.outFile, Buffer.from(serializedFormData));
|
153334
153348
|
}
|
153335
153349
|
} finally {
|
@@ -153595,7 +153609,7 @@ async function updateQueueConsumers(scriptName, config) {
|
|
153595
153609
|
}
|
153596
153610
|
return updateConsumers;
|
153597
153611
|
}
|
153598
|
-
var import_node_assert23, import_node_fs31, import_node_path56, import_node_url9,
|
153612
|
+
var import_node_assert23, import_node_fs31, import_node_path56, import_node_url9, import_undici20, validateRoutes3;
|
153599
153613
|
var init_deploy7 = __esm({
|
153600
153614
|
"src/deploy/deploy.ts"() {
|
153601
153615
|
init_import_meta_url();
|
@@ -153606,7 +153620,7 @@ var init_deploy7 = __esm({
|
|
153606
153620
|
init_cli();
|
153607
153621
|
init_containers_shared();
|
153608
153622
|
init_dist2();
|
153609
|
-
|
153623
|
+
import_undici20 = __toESM(require_undici());
|
153610
153624
|
init_assets();
|
153611
153625
|
init_cfetch();
|
153612
153626
|
init_deploy();
|
@@ -153843,7 +153857,7 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
|
|
153843
153857
|
}
|
153844
153858
|
}
|
153845
153859
|
}
|
153846
|
-
var import_node_assert24, import_node_fs32, import_promises35, path60,
|
153860
|
+
var import_node_assert24, import_node_fs32, import_promises35, path60, import_undici21, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
|
153847
153861
|
var init_assets = __esm({
|
153848
153862
|
"src/assets.ts"() {
|
153849
153863
|
init_import_meta_url();
|
@@ -153857,7 +153871,7 @@ var init_assets = __esm({
|
|
153857
153871
|
init_source();
|
153858
153872
|
init_dist2();
|
153859
153873
|
init_pretty_bytes();
|
153860
|
-
|
153874
|
+
import_undici21 = __toESM(require_undici());
|
153861
153875
|
init_cfetch();
|
153862
153876
|
init_deploy7();
|
153863
153877
|
init_errors();
|
@@ -153933,14 +153947,14 @@ var init_assets = __esm({
|
|
153933
153947
|
attempts = 0;
|
153934
153948
|
let gatewayErrors = 0;
|
153935
153949
|
const doUpload = /* @__PURE__ */ __name(async () => {
|
153936
|
-
const payload = new
|
153950
|
+
const payload = new import_undici21.FormData();
|
153937
153951
|
const uploadedFiles = [];
|
153938
153952
|
for (const manifestEntry of bucket) {
|
153939
153953
|
const absFilePath = path60.join(assetDirectory, manifestEntry[0]);
|
153940
153954
|
uploadedFiles.push(manifestEntry[0]);
|
153941
153955
|
payload.append(
|
153942
153956
|
manifestEntry[1].hash,
|
153943
|
-
new
|
153957
|
+
new import_undici21.File(
|
153944
153958
|
[(await (0, import_promises35.readFile)(absFilePath)).toString("base64")],
|
153945
153959
|
manifestEntry[1].hash,
|
153946
153960
|
{
|
@@ -173777,7 +173791,7 @@ async function createPreviewSession(complianceConfig, account, ctx, abortSignal)
|
|
173777
173791
|
` GET ${switchedExchangeUrl}`
|
173778
173792
|
);
|
173779
173793
|
logger.debug("-- END EXCHANGE API REQUEST");
|
173780
|
-
const exchangeResponse = await (0,
|
173794
|
+
const exchangeResponse = await (0, import_undici22.fetch)(switchedExchangeUrl, {
|
173781
173795
|
signal: abortSignal
|
173782
173796
|
});
|
173783
173797
|
const bodyText = await exchangeResponse.text();
|
@@ -173869,7 +173883,7 @@ async function createWorkerPreview(complianceConfig, init3, account, ctx, sessio
|
|
173869
173883
|
if (accessToken) {
|
173870
173884
|
headers.cookie = `CF_Authorization=${accessToken}`;
|
173871
173885
|
}
|
173872
|
-
(0,
|
173886
|
+
(0, import_undici22.fetch)(token.prewarmUrl.href, {
|
173873
173887
|
method: "POST",
|
173874
173888
|
signal: abortSignal,
|
173875
173889
|
headers
|
@@ -173887,13 +173901,13 @@ async function createWorkerPreview(complianceConfig, init3, account, ctx, sessio
|
|
173887
173901
|
);
|
173888
173902
|
return token;
|
173889
173903
|
}
|
173890
|
-
var import_node_crypto13, import_node_url12,
|
173904
|
+
var import_node_crypto13, import_node_url12, import_undici22;
|
173891
173905
|
var init_create_worker_preview = __esm({
|
173892
173906
|
"src/dev/create-worker-preview.ts"() {
|
173893
173907
|
init_import_meta_url();
|
173894
173908
|
import_node_crypto13 = __toESM(require("crypto"));
|
173895
173909
|
import_node_url12 = require("url");
|
173896
|
-
|
173910
|
+
import_undici22 = __toESM(require_undici());
|
173897
173911
|
init_cfetch();
|
173898
173912
|
init_create_worker_upload_form();
|
173899
173913
|
init_errors();
|
@@ -175634,7 +175648,10 @@ function registerDevHotKeys(devEnv, args) {
|
|
175634
175648
|
}
|
175635
175649
|
});
|
175636
175650
|
await devEnv.config.patch({
|
175637
|
-
dev: {
|
175651
|
+
dev: {
|
175652
|
+
...devEnv.config.latestConfig?.dev,
|
175653
|
+
containerBuildId: newContainerBuildId
|
175654
|
+
}
|
175638
175655
|
});
|
175639
175656
|
}, "handler")
|
175640
175657
|
},
|
@@ -177264,6 +177281,7 @@ async function generateHandler({
|
|
177264
177281
|
metadata,
|
177265
177282
|
xServerEnvHeader,
|
177266
177283
|
xDeploymentIdHeader,
|
177284
|
+
xWebAnalyticsHeader,
|
177267
177285
|
logError,
|
177268
177286
|
setMetrics,
|
177269
177287
|
findAssetEntryForPath,
|
@@ -177620,6 +177638,9 @@ async function generateHandler({
|
|
177620
177638
|
);
|
177621
177639
|
}
|
177622
177640
|
if (isHTMLContentType(asset.contentType) && metadata.analytics?.version === ANALYTICS_VERSION2) {
|
177641
|
+
if (xWebAnalyticsHeader) {
|
177642
|
+
response.headers.set("x-cf-pages-analytics", "1");
|
177643
|
+
}
|
177623
177644
|
return new HTMLRewriter().on("body", {
|
177624
177645
|
element(e7) {
|
177625
177646
|
e7.append(
|
@@ -177882,6 +177903,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
177882
177903
|
request: request4,
|
177883
177904
|
metadata,
|
177884
177905
|
xServerEnvHeader: "dev",
|
177906
|
+
xWebAnalyticsHeader: false,
|
177885
177907
|
logError: console.error,
|
177886
177908
|
findAssetEntryForPath: /* @__PURE__ */ __name(async (path72) => {
|
177887
177909
|
const filepath = (0, import_node_path66.resolve)((0, import_node_path66.join)(directory, path72));
|
@@ -177932,7 +177954,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
177932
177954
|
return await generateResponse(request4);
|
177933
177955
|
};
|
177934
177956
|
}
|
177935
|
-
var import_node_assert33, import_node_fs35, import_node_path66, import_mime3, import_miniflare29,
|
177957
|
+
var import_node_assert33, import_node_fs35, import_node_path66, import_mime3, import_miniflare29, import_undici23, ProxyDispatcher, invalidAssetsFetch;
|
177936
177958
|
var init_assets2 = __esm({
|
177937
177959
|
"src/miniflare-cli/assets.ts"() {
|
177938
177960
|
init_import_meta_url();
|
@@ -177944,10 +177966,10 @@ var init_assets2 = __esm({
|
|
177944
177966
|
init_esm4();
|
177945
177967
|
import_mime3 = __toESM(require_mime());
|
177946
177968
|
import_miniflare29 = require("miniflare");
|
177947
|
-
|
177969
|
+
import_undici23 = __toESM(require_undici());
|
177948
177970
|
init_hash();
|
177949
177971
|
__name(generateASSETSBinding, "generateASSETSBinding");
|
177950
|
-
ProxyDispatcher = class _ProxyDispatcher extends
|
177972
|
+
ProxyDispatcher = class _ProxyDispatcher extends import_undici23.Dispatcher {
|
177951
177973
|
constructor(host) {
|
177952
177974
|
super();
|
177953
177975
|
this.host = host;
|
@@ -177955,7 +177977,7 @@ var init_assets2 = __esm({
|
|
177955
177977
|
static {
|
177956
177978
|
__name(this, "ProxyDispatcher");
|
177957
177979
|
}
|
177958
|
-
dispatcher = (0,
|
177980
|
+
dispatcher = (0, import_undici23.getGlobalDispatcher)();
|
177959
177981
|
dispatch(options, handler) {
|
177960
177982
|
if (this.host !== null) {
|
177961
177983
|
_ProxyDispatcher.reinstateHostHeader(options.headers, this.host);
|
@@ -178956,7 +178978,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
178956
178978
|
devServer.unregisterHotKeys?.();
|
178957
178979
|
}, "stop"),
|
178958
178980
|
fetch: /* @__PURE__ */ __name(async (input, init3) => {
|
178959
|
-
return await (0,
|
178981
|
+
return await (0, import_undici24.fetch)(
|
178960
178982
|
...parseRequestInput(address, port, input, init3, options?.localProtocol)
|
178961
178983
|
);
|
178962
178984
|
}, "fetch"),
|
@@ -178969,7 +178991,7 @@ function parseRequestInput(readyAddress, readyPort, input = "/", init3, protocol
|
|
178969
178991
|
if (typeof input === "string") {
|
178970
178992
|
input = new URL(input, "http://placeholder");
|
178971
178993
|
}
|
178972
|
-
const forward = new
|
178994
|
+
const forward = new import_undici24.Request(input, init3);
|
178973
178995
|
const url4 = new URL(forward.url);
|
178974
178996
|
forward.headers.set("MF-Original-URL", url4.toString());
|
178975
178997
|
forward.headers.set("MF-Disable-Pretty-Error", "true");
|
@@ -178981,12 +179003,12 @@ function parseRequestInput(readyAddress, readyPort, input = "/", init3, protocol
|
|
178981
179003
|
}
|
178982
179004
|
return [url4, forward];
|
178983
179005
|
}
|
178984
|
-
var import_node_events7,
|
179006
|
+
var import_node_events7, import_undici24;
|
178985
179007
|
var init_dev3 = __esm({
|
178986
179008
|
"src/api/dev.ts"() {
|
178987
179009
|
init_import_meta_url();
|
178988
179010
|
import_node_events7 = __toESM(require("events"));
|
178989
|
-
|
179011
|
+
import_undici24 = __toESM(require_undici());
|
178990
179012
|
init_dev2();
|
178991
179013
|
init_misc_variables();
|
178992
179014
|
init_experimental_flags();
|
@@ -179131,7 +179153,7 @@ function getServiceBindingProxyFetch({
|
|
179131
179153
|
return async (request4) => {
|
179132
179154
|
const newUrl = getExternalUrl(request4);
|
179133
179155
|
try {
|
179134
|
-
const resp = await (0,
|
179156
|
+
const resp = await (0, import_undici25.fetch)(newUrl, request4);
|
179135
179157
|
const respBody = await resp.arrayBuffer();
|
179136
179158
|
return new import_miniflare30.Response(respBody, resp);
|
179137
179159
|
} catch {
|
@@ -179149,12 +179171,12 @@ async function maybeGetRegisteredWorkers() {
|
|
179149
179171
|
return void 0;
|
179150
179172
|
}
|
179151
179173
|
}
|
179152
|
-
var import_miniflare30,
|
179174
|
+
var import_miniflare30, import_undici25;
|
179153
179175
|
var init_services = __esm({
|
179154
179176
|
"src/api/integrations/platform/services.ts"() {
|
179155
179177
|
init_import_meta_url();
|
179156
179178
|
import_miniflare30 = require("miniflare");
|
179157
|
-
|
179179
|
+
import_undici25 = __toESM(require_undici());
|
179158
179180
|
init_dev_registry();
|
179159
179181
|
__name(getServiceBindings, "getServiceBindings");
|
179160
179182
|
__name(getServiceBindingProxyFetch, "getServiceBindingProxyFetch");
|