wrangler 4.24.0 → 4.24.1
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 +214 -196
- 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.1";
|
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,
|
@@ -66529,7 +66539,7 @@ function createWorkerUploadForm(worker) {
|
|
66529
66539
|
});
|
66530
66540
|
formData.set(
|
66531
66541
|
name2,
|
66532
|
-
new
|
66542
|
+
new import_undici6.File(
|
66533
66543
|
[typeof source === "string" ? (0, import_node_fs14.readFileSync)(source) : source],
|
66534
66544
|
typeof source === "string" ? source : name2,
|
66535
66545
|
{
|
@@ -66581,7 +66591,7 @@ function createWorkerUploadForm(worker) {
|
|
66581
66591
|
if (name2 !== "__STATIC_CONTENT_MANIFEST") {
|
66582
66592
|
formData.set(
|
66583
66593
|
name2,
|
66584
|
-
new
|
66594
|
+
new import_undici6.File([(0, import_node_fs14.readFileSync)(filePath)], filePath, {
|
66585
66595
|
type: "text/plain"
|
66586
66596
|
})
|
66587
66597
|
);
|
@@ -66595,7 +66605,7 @@ function createWorkerUploadForm(worker) {
|
|
66595
66605
|
});
|
66596
66606
|
formData.set(
|
66597
66607
|
name2,
|
66598
|
-
new
|
66608
|
+
new import_undici6.File(
|
66599
66609
|
[typeof source === "string" ? (0, import_node_fs14.readFileSync)(source) : source],
|
66600
66610
|
typeof source === "string" ? source : name2,
|
66601
66611
|
{
|
@@ -66630,7 +66640,7 @@ function createWorkerUploadForm(worker) {
|
|
66630
66640
|
if (module3.name === "__STATIC_CONTENT_MANIFEST") {
|
66631
66641
|
formData.set(
|
66632
66642
|
module3.name,
|
66633
|
-
new
|
66643
|
+
new import_undici6.File([module3.content], module3.name, {
|
66634
66644
|
type: "text/plain"
|
66635
66645
|
})
|
66636
66646
|
);
|
@@ -66644,7 +66654,7 @@ function createWorkerUploadForm(worker) {
|
|
66644
66654
|
});
|
66645
66655
|
formData.set(
|
66646
66656
|
name2,
|
66647
|
-
new
|
66657
|
+
new import_undici6.File([module3.content], module3.name, {
|
66648
66658
|
type: module3.type === "compiled-wasm" ? "application/wasm" : module3.type === "text" ? "text/plain" : "application/octet-stream"
|
66649
66659
|
})
|
66650
66660
|
);
|
@@ -66661,7 +66671,7 @@ function createWorkerUploadForm(worker) {
|
|
66661
66671
|
capnpSchemaOutputFile = `./capnp-${Date.now()}.compiled`;
|
66662
66672
|
formData.set(
|
66663
66673
|
capnpSchemaOutputFile,
|
66664
|
-
new
|
66674
|
+
new import_undici6.File([capnpOutput], capnpSchemaOutputFile, {
|
66665
66675
|
type: "application/octet-stream"
|
66666
66676
|
})
|
66667
66677
|
);
|
@@ -66718,7 +66728,7 @@ function createWorkerUploadForm(worker) {
|
|
66718
66728
|
for (const module3 of [main2].concat(modules || [])) {
|
66719
66729
|
formData.set(
|
66720
66730
|
module3.name,
|
66721
|
-
new
|
66731
|
+
new import_undici6.File([module3.content], module3.name, {
|
66722
66732
|
type: toMimeType(module3.type ?? main2.type ?? "esm")
|
66723
66733
|
})
|
66724
66734
|
);
|
@@ -66726,21 +66736,21 @@ function createWorkerUploadForm(worker) {
|
|
66726
66736
|
for (const sourceMap of sourceMaps || []) {
|
66727
66737
|
formData.set(
|
66728
66738
|
sourceMap.name,
|
66729
|
-
new
|
66739
|
+
new import_undici6.File([sourceMap.content], sourceMap.name, {
|
66730
66740
|
type: "application/source-map"
|
66731
66741
|
})
|
66732
66742
|
);
|
66733
66743
|
}
|
66734
66744
|
return formData;
|
66735
66745
|
}
|
66736
|
-
var import_node_assert13, import_node_fs14, import_node_path26,
|
66746
|
+
var import_node_assert13, import_node_fs14, import_node_path26, import_undici6, moduleTypeMimeType;
|
66737
66747
|
var init_create_worker_upload_form = __esm({
|
66738
66748
|
"src/deployment-bundle/create-worker-upload-form.ts"() {
|
66739
66749
|
init_import_meta_url();
|
66740
66750
|
import_node_assert13 = __toESM(require("assert"));
|
66741
66751
|
import_node_fs14 = require("fs");
|
66742
66752
|
import_node_path26 = __toESM(require("path"));
|
66743
|
-
|
66753
|
+
import_undici6 = __toESM(require_undici());
|
66744
66754
|
init_errors();
|
66745
66755
|
init_bindings();
|
66746
66756
|
init_capnp();
|
@@ -75016,13 +75026,13 @@ var init_utils5 = __esm({
|
|
75016
75026
|
});
|
75017
75027
|
|
75018
75028
|
// src/ai/createFinetune.ts
|
75019
|
-
var import_fs14, import_path12,
|
75029
|
+
var import_fs14, import_path12, import_undici7, requiredAssets, aiFineTuneCreateCommand;
|
75020
75030
|
var init_createFinetune = __esm({
|
75021
75031
|
"src/ai/createFinetune.ts"() {
|
75022
75032
|
init_import_meta_url();
|
75023
75033
|
import_fs14 = __toESM(require("fs"));
|
75024
75034
|
import_path12 = __toESM(require("path"));
|
75025
|
-
|
75035
|
+
import_undici7 = __toESM(require_undici());
|
75026
75036
|
init_cfetch();
|
75027
75037
|
init_create_command();
|
75028
75038
|
init_logger();
|
@@ -75086,7 +75096,7 @@ var init_createFinetune = __esm({
|
|
75086
75096
|
`\u{1F300} Uploading file "${filePath}" to "${finetune_name}"...`
|
75087
75097
|
);
|
75088
75098
|
try {
|
75089
|
-
const formdata = new
|
75099
|
+
const formdata = new import_undici7.FormData();
|
75090
75100
|
formdata.set("file_name", file.name);
|
75091
75101
|
formdata.set("file", new Blob([import_fs14.default.readFileSync(filePath)]));
|
75092
75102
|
await fetchResult(
|
@@ -78443,7 +78453,7 @@ async function uploadAndBeginIngestion(complianceConfig, accountId, db, file, et
|
|
78443
78453
|
const { upload_url, filename } = initResponse;
|
78444
78454
|
const { size } = await import_fs15.promises.stat(file);
|
78445
78455
|
const uploadResponse = await spinnerWhile({
|
78446
|
-
promise: (0,
|
78456
|
+
promise: (0, import_undici8.fetch)(upload_url, {
|
78447
78457
|
method: "PUT",
|
78448
78458
|
headers: {
|
78449
78459
|
"Content-length": `${size}`
|
@@ -78556,7 +78566,7 @@ async function checkForSQLiteBinary(filename) {
|
|
78556
78566
|
);
|
78557
78567
|
}
|
78558
78568
|
}
|
78559
|
-
var import_fs15, import_node_assert16, import_node_path27, import_md5_file, import_miniflare12,
|
78569
|
+
var import_fs15, import_node_assert16, import_node_path27, import_md5_file, import_miniflare12, import_undici8, d1ExecuteCommand;
|
78560
78570
|
var init_execute = __esm({
|
78561
78571
|
"src/d1/execute.ts"() {
|
78562
78572
|
init_import_meta_url();
|
@@ -78567,7 +78577,7 @@ var init_execute = __esm({
|
|
78567
78577
|
init_source();
|
78568
78578
|
import_md5_file = __toESM(require_md5_file());
|
78569
78579
|
import_miniflare12 = require("miniflare");
|
78570
|
-
|
78580
|
+
import_undici8 = __toESM(require_undici());
|
78571
78581
|
init_cfetch();
|
78572
78582
|
init_config2();
|
78573
78583
|
init_create_command();
|
@@ -78789,7 +78799,7 @@ async function exportRemotely(config, name2, output, tables, noSchema, noData) {
|
|
78789
78799
|
await spinnerWhile({
|
78790
78800
|
startMessage: `Downloading SQL to ${output}`,
|
78791
78801
|
async promise() {
|
78792
|
-
const contents = await (0,
|
78802
|
+
const contents = await (0, import_undici9.fetch)(finalResponse.result.signed_url);
|
78793
78803
|
if (!contents.ok) {
|
78794
78804
|
throw new Error(
|
78795
78805
|
`There was an error while downloading from the presigned URL with status code: ${contents.status}`
|
@@ -78846,7 +78856,7 @@ async function pollExport(s5, complianceConfig, accountId, db, dumpOptions, curr
|
|
78846
78856
|
);
|
78847
78857
|
}
|
78848
78858
|
}
|
78849
|
-
var import_promises12, import_node_path28, import_miniflare13,
|
78859
|
+
var import_promises12, import_node_path28, import_miniflare13, import_undici9, d1ExportCommand;
|
78850
78860
|
var init_export = __esm({
|
78851
78861
|
"src/d1/export.ts"() {
|
78852
78862
|
init_import_meta_url();
|
@@ -78855,7 +78865,7 @@ var init_export = __esm({
|
|
78855
78865
|
init_interactive();
|
78856
78866
|
init_source();
|
78857
78867
|
import_miniflare13 = require("miniflare");
|
78858
|
-
|
78868
|
+
import_undici9 = __toESM(require_undici());
|
78859
78869
|
init_cfetch();
|
78860
78870
|
init_config2();
|
78861
78871
|
init_create_command();
|
@@ -81222,7 +81232,7 @@ async function runSearch(searchTerm) {
|
|
81222
81232
|
});
|
81223
81233
|
(0, import_node_assert18.default)(id, "Missing Algolia App ID");
|
81224
81234
|
(0, import_node_assert18.default)(key, "Missing Algolia Key");
|
81225
|
-
const searchResp = await (0,
|
81235
|
+
const searchResp = await (0, import_undici10.fetch)(
|
81226
81236
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
81227
81237
|
{
|
81228
81238
|
method: "POST",
|
@@ -81250,12 +81260,12 @@ async function runSearch(searchTerm) {
|
|
81250
81260
|
return;
|
81251
81261
|
}
|
81252
81262
|
}
|
81253
|
-
var import_node_assert18,
|
81263
|
+
var import_node_assert18, import_undici10;
|
81254
81264
|
var init_helpers7 = __esm({
|
81255
81265
|
"src/docs/helpers.ts"() {
|
81256
81266
|
init_import_meta_url();
|
81257
81267
|
import_node_assert18 = __toESM(require("assert"));
|
81258
|
-
|
81268
|
+
import_undici10 = __toESM(require_undici());
|
81259
81269
|
init_logger();
|
81260
81270
|
__name(runSearch, "runSearch");
|
81261
81271
|
}
|
@@ -84405,7 +84415,7 @@ async function createUploadWorkerBundleContents(workerBundle, config) {
|
|
84405
84415
|
delete metadata.bindings;
|
84406
84416
|
}
|
84407
84417
|
workerBundleFormData.set("metadata", JSON.stringify(metadata));
|
84408
|
-
return await new
|
84418
|
+
return await new import_undici11.Response(workerBundleFormData).blob();
|
84409
84419
|
}
|
84410
84420
|
function createWorkerBundleFormData(workerBundle, config) {
|
84411
84421
|
const mainModule = {
|
@@ -84437,13 +84447,13 @@ function createWorkerBundleFormData(workerBundle, config) {
|
|
84437
84447
|
observability: void 0
|
84438
84448
|
});
|
84439
84449
|
}
|
84440
|
-
var import_node_fs19, import_node_path34,
|
84450
|
+
var import_node_fs19, import_node_path34, import_undici11;
|
84441
84451
|
var init_create_worker_bundle_contents = __esm({
|
84442
84452
|
"src/api/pages/create-worker-bundle-contents.ts"() {
|
84443
84453
|
init_import_meta_url();
|
84444
84454
|
import_node_fs19 = require("fs");
|
84445
84455
|
import_node_path34 = __toESM(require("path"));
|
84446
|
-
|
84456
|
+
import_undici11 = __toESM(require_undici());
|
84447
84457
|
init_bindings();
|
84448
84458
|
init_create_worker_upload_form();
|
84449
84459
|
init_source_maps();
|
@@ -87416,7 +87426,7 @@ async function deploy2({
|
|
87416
87426
|
projectName,
|
87417
87427
|
skipCaching: skipCaching ?? false
|
87418
87428
|
});
|
87419
|
-
const formData = new
|
87429
|
+
const formData = new import_undici12.FormData();
|
87420
87430
|
formData.append("manifest", JSON.stringify(manifest));
|
87421
87431
|
if (branch) {
|
87422
87432
|
formData.append("branch", branch);
|
@@ -87431,17 +87441,17 @@ async function deploy2({
|
|
87431
87441
|
formData.append("commit_dirty", commitDirty);
|
87432
87442
|
}
|
87433
87443
|
if (_headers) {
|
87434
|
-
formData.append("_headers", new
|
87444
|
+
formData.append("_headers", new import_undici12.File([_headers], "_headers"));
|
87435
87445
|
logger.log(`\u2728 Uploading _headers`);
|
87436
87446
|
}
|
87437
87447
|
if (_redirects) {
|
87438
|
-
formData.append("_redirects", new
|
87448
|
+
formData.append("_redirects", new import_undici12.File([_redirects], "_redirects"));
|
87439
87449
|
logger.log(`\u2728 Uploading _redirects`);
|
87440
87450
|
}
|
87441
87451
|
if (filepathRoutingConfig) {
|
87442
87452
|
formData.append(
|
87443
87453
|
"functions-filepath-routing-config.json",
|
87444
|
-
new
|
87454
|
+
new import_undici12.File(
|
87445
87455
|
[filepathRoutingConfig],
|
87446
87456
|
"functions-filepath-routing-config.json"
|
87447
87457
|
)
|
@@ -87504,7 +87514,7 @@ async function deploy2({
|
|
87504
87514
|
);
|
87505
87515
|
formData.append(
|
87506
87516
|
"_worker.bundle",
|
87507
|
-
new
|
87517
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
87508
87518
|
);
|
87509
87519
|
logger.log(`\u2728 Uploading Worker bundle`);
|
87510
87520
|
if (_routesCustom) {
|
@@ -87513,7 +87523,7 @@ async function deploy2({
|
|
87513
87523
|
validateRoutes(routesCustomJSON, (0, import_node_path46.join)(directory, "_routes.json"));
|
87514
87524
|
formData.append(
|
87515
87525
|
"_routes.json",
|
87516
|
-
new
|
87526
|
+
new import_undici12.File([_routesCustom], "_routes.json")
|
87517
87527
|
);
|
87518
87528
|
logger.log(`\u2728 Uploading _routes.json`);
|
87519
87529
|
} catch (err) {
|
@@ -87530,7 +87540,7 @@ async function deploy2({
|
|
87530
87540
|
);
|
87531
87541
|
formData.append(
|
87532
87542
|
"_worker.bundle",
|
87533
|
-
new
|
87543
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
87534
87544
|
);
|
87535
87545
|
logger.log(`\u2728 Uploading Functions bundle`);
|
87536
87546
|
if (_routesCustom) {
|
@@ -87539,7 +87549,7 @@ async function deploy2({
|
|
87539
87549
|
validateRoutes(routesCustomJSON, (0, import_node_path46.join)(directory, "_routes.json"));
|
87540
87550
|
formData.append(
|
87541
87551
|
"_routes.json",
|
87542
|
-
new
|
87552
|
+
new import_undici12.File([_routesCustom], "_routes.json")
|
87543
87553
|
);
|
87544
87554
|
logger.log(`\u2728 Uploading _routes.json`);
|
87545
87555
|
} catch (err) {
|
@@ -87553,7 +87563,7 @@ async function deploy2({
|
|
87553
87563
|
if (_routesGenerated) {
|
87554
87564
|
formData.append(
|
87555
87565
|
"_routes.json",
|
87556
|
-
new
|
87566
|
+
new import_undici12.File([_routesGenerated], "_routes.json")
|
87557
87567
|
);
|
87558
87568
|
}
|
87559
87569
|
} catch {
|
@@ -87588,7 +87598,7 @@ async function deploy2({
|
|
87588
87598
|
}
|
87589
87599
|
throw lastErr;
|
87590
87600
|
}
|
87591
|
-
var import_node_crypto9, import_node_fs24, import_promises21, import_node_path46, import_node_process11,
|
87601
|
+
var import_node_crypto9, import_node_fs24, import_promises21, import_node_path46, import_node_process11, import_undici12;
|
87592
87602
|
var init_deploy4 = __esm({
|
87593
87603
|
"src/api/pages/deploy.ts"() {
|
87594
87604
|
init_import_meta_url();
|
@@ -87597,7 +87607,7 @@ var init_deploy4 = __esm({
|
|
87597
87607
|
import_promises21 = require("fs/promises");
|
87598
87608
|
import_node_path46 = __toESM(require("path"));
|
87599
87609
|
import_node_process11 = require("process");
|
87600
|
-
|
87610
|
+
import_undici12 = __toESM(require_undici());
|
87601
87611
|
init_cfetch();
|
87602
87612
|
init_config2();
|
87603
87613
|
init_bundle();
|
@@ -91722,14 +91732,14 @@ async function parseBulkInputToObject(input) {
|
|
91722
91732
|
}
|
91723
91733
|
return content;
|
91724
91734
|
}
|
91725
|
-
var import_node_path50, import_node_readline2, import_dotenv2,
|
91735
|
+
var import_node_path50, import_node_readline2, import_dotenv2, import_undici13, VERSION_NOT_DEPLOYED_ERR_CODE, secretNamespace, secretPutCommand, secretDeleteCommand, secretListCommand, secretBulkCommand;
|
91726
91736
|
var init_secret = __esm({
|
91727
91737
|
"src/secret/index.ts"() {
|
91728
91738
|
init_import_meta_url();
|
91729
91739
|
import_node_path50 = __toESM(require("path"));
|
91730
91740
|
import_node_readline2 = __toESM(require("readline"));
|
91731
91741
|
import_dotenv2 = __toESM(require_main2());
|
91732
|
-
|
91742
|
+
import_undici13 = __toESM(require_undici());
|
91733
91743
|
init_cfetch();
|
91734
91744
|
init_config2();
|
91735
91745
|
init_create_command();
|
@@ -92014,7 +92024,7 @@ var init_secret = __esm({
|
|
92014
92024
|
__name(getSettings2, "getSettings");
|
92015
92025
|
function putBindingsSettings(bindings) {
|
92016
92026
|
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
|
92027
|
+
const data = new import_undici13.FormData();
|
92018
92028
|
data.set("settings", JSON.stringify({ bindings }));
|
92019
92029
|
return fetchResult(config, url4, {
|
92020
92030
|
method: "PATCH",
|
@@ -141919,13 +141929,13 @@ async function closeSentry() {
|
|
141919
141929
|
await close();
|
141920
141930
|
}
|
141921
141931
|
}
|
141922
|
-
var
|
141932
|
+
var import_undici16, sentryReportingAllowed, makeSentry10Transport, disabledDefaultIntegrations;
|
141923
141933
|
var init_sentry = __esm({
|
141924
141934
|
"src/sentry/index.ts"() {
|
141925
141935
|
init_import_meta_url();
|
141926
141936
|
init_esm9();
|
141927
141937
|
init_esm6();
|
141928
|
-
|
141938
|
+
import_undici16 = __toESM(require_undici());
|
141929
141939
|
init_package();
|
141930
141940
|
init_dialogs();
|
141931
141941
|
init_logger();
|
@@ -141942,9 +141952,9 @@ var init_sentry = __esm({
|
|
141942
141952
|
const eventsToSend = [...eventQueue];
|
141943
141953
|
eventQueue = [];
|
141944
141954
|
for (const event of eventsToSend) {
|
141945
|
-
await (0,
|
141955
|
+
await (0, import_undici16.fetch)(event[0], event[1]);
|
141946
141956
|
}
|
141947
|
-
const response = await (0,
|
141957
|
+
const response = await (0, import_undici16.fetch)(
|
141948
141958
|
`https://platform.dash.cloudflare.com/sentry/envelope`,
|
141949
141959
|
{
|
141950
141960
|
method: "POST",
|
@@ -144281,13 +144291,13 @@ var init_info4 = __esm({
|
|
144281
144291
|
});
|
144282
144292
|
|
144283
144293
|
// src/vectorize/insert.ts
|
144284
|
-
var import_node_fs28, import_node_readline3,
|
144294
|
+
var import_node_fs28, import_node_readline3, import_undici17, vectorizeInsertCommand;
|
144285
144295
|
var init_insert = __esm({
|
144286
144296
|
"src/vectorize/insert.ts"() {
|
144287
144297
|
init_import_meta_url();
|
144288
144298
|
import_node_fs28 = require("fs");
|
144289
144299
|
import_node_readline3 = require("readline");
|
144290
|
-
|
144300
|
+
import_undici17 = __toESM(require_undici());
|
144291
144301
|
init_create_command();
|
144292
144302
|
init_errors();
|
144293
144303
|
init_logger();
|
@@ -144348,10 +144358,10 @@ var init_insert = __esm({
|
|
144348
144358
|
}
|
144349
144359
|
let vectorInsertCount = 0;
|
144350
144360
|
for await (const batch of getBatchFromFile(rl, args.batchSize)) {
|
144351
|
-
const formData = new
|
144361
|
+
const formData = new import_undici17.FormData();
|
144352
144362
|
formData.append(
|
144353
144363
|
"vectors",
|
144354
|
-
new
|
144364
|
+
new import_undici17.File([batch.join(`
|
144355
144365
|
`)], "vectors.ndjson", {
|
144356
144366
|
type: "application/x-ndjson"
|
144357
144367
|
})
|
@@ -144706,13 +144716,13 @@ var init_query = __esm({
|
|
144706
144716
|
});
|
144707
144717
|
|
144708
144718
|
// src/vectorize/upsert.ts
|
144709
|
-
var import_node_fs29, import_node_readline4,
|
144719
|
+
var import_node_fs29, import_node_readline4, import_undici18, vectorizeUpsertCommand;
|
144710
144720
|
var init_upsert = __esm({
|
144711
144721
|
"src/vectorize/upsert.ts"() {
|
144712
144722
|
init_import_meta_url();
|
144713
144723
|
import_node_fs29 = require("fs");
|
144714
144724
|
import_node_readline4 = require("readline");
|
144715
|
-
|
144725
|
+
import_undici18 = __toESM(require_undici());
|
144716
144726
|
init_create_command();
|
144717
144727
|
init_errors();
|
144718
144728
|
init_logger();
|
@@ -144764,10 +144774,10 @@ var init_upsert = __esm({
|
|
144764
144774
|
}
|
144765
144775
|
let vectorUpsertCount = 0;
|
144766
144776
|
for await (const batch of getBatchFromFile(rl, args.batchSize)) {
|
144767
|
-
const formData = new
|
144777
|
+
const formData = new import_undici18.FormData();
|
144768
144778
|
formData.append(
|
144769
144779
|
"vectors",
|
144770
|
-
new
|
144780
|
+
new import_undici18.File([batch.join(`
|
144771
144781
|
`)], "vectors.ndjson", {
|
144772
144782
|
type: "application/x-ndjson"
|
144773
144783
|
})
|
@@ -152289,7 +152299,7 @@ ${tryRunningItIn}${oneOfThese}`
|
|
152289
152299
|
}
|
152290
152300
|
}
|
152291
152301
|
}
|
152292
|
-
var import_node_assert22, import_node_os7, import_promises31,
|
152302
|
+
var import_node_assert22, import_node_os7, import_promises31, import_undici19;
|
152293
152303
|
var init_src = __esm({
|
152294
152304
|
"src/index.ts"() {
|
152295
152305
|
init_import_meta_url();
|
@@ -152298,7 +152308,7 @@ var init_src = __esm({
|
|
152298
152308
|
import_promises31 = require("timers/promises");
|
152299
152309
|
init_containers_shared();
|
152300
152310
|
init_source();
|
152301
|
-
|
152311
|
+
import_undici19 = __toESM(require_undici());
|
152302
152312
|
init_yargs();
|
152303
152313
|
init_package();
|
152304
152314
|
init_ai();
|
@@ -152455,7 +152465,7 @@ var init_src = __esm({
|
|
152455
152465
|
init_trigger();
|
152456
152466
|
init_wrangler_banner();
|
152457
152467
|
if (proxy) {
|
152458
|
-
(0,
|
152468
|
+
(0, import_undici19.setGlobalDispatcher)(new import_undici19.ProxyAgent(proxy));
|
152459
152469
|
logger.log(
|
152460
152470
|
`Proxy environment variables detected. We'll use your proxy for fetch requests.`
|
152461
152471
|
);
|
@@ -153151,7 +153161,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
153151
153161
|
let workerBundle;
|
153152
153162
|
const dockerPath = getDockerPath();
|
153153
153163
|
if (config.containers) {
|
153154
|
-
const hasDockerfiles = config.containers
|
153164
|
+
const hasDockerfiles = config.containers.some(
|
153155
153165
|
(container) => isDockerfile(
|
153156
153166
|
container.image ?? container.configuration?.image,
|
153157
153167
|
config.configPath
|
@@ -153329,7 +153339,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
153329
153339
|
}
|
153330
153340
|
if (props.outFile) {
|
153331
153341
|
(0, import_node_fs31.mkdirSync)(import_node_path56.default.dirname(props.outFile), { recursive: true });
|
153332
|
-
const serializedFormData = await new
|
153342
|
+
const serializedFormData = await new import_undici20.Response(workerBundle).arrayBuffer();
|
153333
153343
|
(0, import_node_fs31.writeFileSync)(props.outFile, Buffer.from(serializedFormData));
|
153334
153344
|
}
|
153335
153345
|
} finally {
|
@@ -153595,7 +153605,7 @@ async function updateQueueConsumers(scriptName, config) {
|
|
153595
153605
|
}
|
153596
153606
|
return updateConsumers;
|
153597
153607
|
}
|
153598
|
-
var import_node_assert23, import_node_fs31, import_node_path56, import_node_url9,
|
153608
|
+
var import_node_assert23, import_node_fs31, import_node_path56, import_node_url9, import_undici20, validateRoutes3;
|
153599
153609
|
var init_deploy7 = __esm({
|
153600
153610
|
"src/deploy/deploy.ts"() {
|
153601
153611
|
init_import_meta_url();
|
@@ -153606,7 +153616,7 @@ var init_deploy7 = __esm({
|
|
153606
153616
|
init_cli();
|
153607
153617
|
init_containers_shared();
|
153608
153618
|
init_dist2();
|
153609
|
-
|
153619
|
+
import_undici20 = __toESM(require_undici());
|
153610
153620
|
init_assets();
|
153611
153621
|
init_cfetch();
|
153612
153622
|
init_deploy();
|
@@ -153843,7 +153853,7 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
|
|
153843
153853
|
}
|
153844
153854
|
}
|
153845
153855
|
}
|
153846
|
-
var import_node_assert24, import_node_fs32, import_promises35, path60,
|
153856
|
+
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
153857
|
var init_assets = __esm({
|
153848
153858
|
"src/assets.ts"() {
|
153849
153859
|
init_import_meta_url();
|
@@ -153857,7 +153867,7 @@ var init_assets = __esm({
|
|
153857
153867
|
init_source();
|
153858
153868
|
init_dist2();
|
153859
153869
|
init_pretty_bytes();
|
153860
|
-
|
153870
|
+
import_undici21 = __toESM(require_undici());
|
153861
153871
|
init_cfetch();
|
153862
153872
|
init_deploy7();
|
153863
153873
|
init_errors();
|
@@ -153933,14 +153943,14 @@ var init_assets = __esm({
|
|
153933
153943
|
attempts = 0;
|
153934
153944
|
let gatewayErrors = 0;
|
153935
153945
|
const doUpload = /* @__PURE__ */ __name(async () => {
|
153936
|
-
const payload = new
|
153946
|
+
const payload = new import_undici21.FormData();
|
153937
153947
|
const uploadedFiles = [];
|
153938
153948
|
for (const manifestEntry of bucket) {
|
153939
153949
|
const absFilePath = path60.join(assetDirectory, manifestEntry[0]);
|
153940
153950
|
uploadedFiles.push(manifestEntry[0]);
|
153941
153951
|
payload.append(
|
153942
153952
|
manifestEntry[1].hash,
|
153943
|
-
new
|
153953
|
+
new import_undici21.File(
|
153944
153954
|
[(await (0, import_promises35.readFile)(absFilePath)).toString("base64")],
|
153945
153955
|
manifestEntry[1].hash,
|
153946
153956
|
{
|
@@ -173777,7 +173787,7 @@ async function createPreviewSession(complianceConfig, account, ctx, abortSignal)
|
|
173777
173787
|
` GET ${switchedExchangeUrl}`
|
173778
173788
|
);
|
173779
173789
|
logger.debug("-- END EXCHANGE API REQUEST");
|
173780
|
-
const exchangeResponse = await (0,
|
173790
|
+
const exchangeResponse = await (0, import_undici22.fetch)(switchedExchangeUrl, {
|
173781
173791
|
signal: abortSignal
|
173782
173792
|
});
|
173783
173793
|
const bodyText = await exchangeResponse.text();
|
@@ -173869,7 +173879,7 @@ async function createWorkerPreview(complianceConfig, init3, account, ctx, sessio
|
|
173869
173879
|
if (accessToken) {
|
173870
173880
|
headers.cookie = `CF_Authorization=${accessToken}`;
|
173871
173881
|
}
|
173872
|
-
(0,
|
173882
|
+
(0, import_undici22.fetch)(token.prewarmUrl.href, {
|
173873
173883
|
method: "POST",
|
173874
173884
|
signal: abortSignal,
|
173875
173885
|
headers
|
@@ -173887,13 +173897,13 @@ async function createWorkerPreview(complianceConfig, init3, account, ctx, sessio
|
|
173887
173897
|
);
|
173888
173898
|
return token;
|
173889
173899
|
}
|
173890
|
-
var import_node_crypto13, import_node_url12,
|
173900
|
+
var import_node_crypto13, import_node_url12, import_undici22;
|
173891
173901
|
var init_create_worker_preview = __esm({
|
173892
173902
|
"src/dev/create-worker-preview.ts"() {
|
173893
173903
|
init_import_meta_url();
|
173894
173904
|
import_node_crypto13 = __toESM(require("crypto"));
|
173895
173905
|
import_node_url12 = require("url");
|
173896
|
-
|
173906
|
+
import_undici22 = __toESM(require_undici());
|
173897
173907
|
init_cfetch();
|
173898
173908
|
init_create_worker_upload_form();
|
173899
173909
|
init_errors();
|
@@ -175634,7 +175644,10 @@ function registerDevHotKeys(devEnv, args) {
|
|
175634
175644
|
}
|
175635
175645
|
});
|
175636
175646
|
await devEnv.config.patch({
|
175637
|
-
dev: {
|
175647
|
+
dev: {
|
175648
|
+
...devEnv.config.latestConfig?.dev,
|
175649
|
+
containerBuildId: newContainerBuildId
|
175650
|
+
}
|
175638
175651
|
});
|
175639
175652
|
}, "handler")
|
175640
175653
|
},
|
@@ -177264,6 +177277,7 @@ async function generateHandler({
|
|
177264
177277
|
metadata,
|
177265
177278
|
xServerEnvHeader,
|
177266
177279
|
xDeploymentIdHeader,
|
177280
|
+
xWebAnalyticsHeader,
|
177267
177281
|
logError,
|
177268
177282
|
setMetrics,
|
177269
177283
|
findAssetEntryForPath,
|
@@ -177620,6 +177634,9 @@ async function generateHandler({
|
|
177620
177634
|
);
|
177621
177635
|
}
|
177622
177636
|
if (isHTMLContentType(asset.contentType) && metadata.analytics?.version === ANALYTICS_VERSION2) {
|
177637
|
+
if (xWebAnalyticsHeader) {
|
177638
|
+
response.headers.set("x-cf-pages-analytics", "1");
|
177639
|
+
}
|
177623
177640
|
return new HTMLRewriter().on("body", {
|
177624
177641
|
element(e7) {
|
177625
177642
|
e7.append(
|
@@ -177882,6 +177899,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
177882
177899
|
request: request4,
|
177883
177900
|
metadata,
|
177884
177901
|
xServerEnvHeader: "dev",
|
177902
|
+
xWebAnalyticsHeader: false,
|
177885
177903
|
logError: console.error,
|
177886
177904
|
findAssetEntryForPath: /* @__PURE__ */ __name(async (path72) => {
|
177887
177905
|
const filepath = (0, import_node_path66.resolve)((0, import_node_path66.join)(directory, path72));
|
@@ -177932,7 +177950,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
177932
177950
|
return await generateResponse(request4);
|
177933
177951
|
};
|
177934
177952
|
}
|
177935
|
-
var import_node_assert33, import_node_fs35, import_node_path66, import_mime3, import_miniflare29,
|
177953
|
+
var import_node_assert33, import_node_fs35, import_node_path66, import_mime3, import_miniflare29, import_undici23, ProxyDispatcher, invalidAssetsFetch;
|
177936
177954
|
var init_assets2 = __esm({
|
177937
177955
|
"src/miniflare-cli/assets.ts"() {
|
177938
177956
|
init_import_meta_url();
|
@@ -177944,10 +177962,10 @@ var init_assets2 = __esm({
|
|
177944
177962
|
init_esm4();
|
177945
177963
|
import_mime3 = __toESM(require_mime());
|
177946
177964
|
import_miniflare29 = require("miniflare");
|
177947
|
-
|
177965
|
+
import_undici23 = __toESM(require_undici());
|
177948
177966
|
init_hash();
|
177949
177967
|
__name(generateASSETSBinding, "generateASSETSBinding");
|
177950
|
-
ProxyDispatcher = class _ProxyDispatcher extends
|
177968
|
+
ProxyDispatcher = class _ProxyDispatcher extends import_undici23.Dispatcher {
|
177951
177969
|
constructor(host) {
|
177952
177970
|
super();
|
177953
177971
|
this.host = host;
|
@@ -177955,7 +177973,7 @@ var init_assets2 = __esm({
|
|
177955
177973
|
static {
|
177956
177974
|
__name(this, "ProxyDispatcher");
|
177957
177975
|
}
|
177958
|
-
dispatcher = (0,
|
177976
|
+
dispatcher = (0, import_undici23.getGlobalDispatcher)();
|
177959
177977
|
dispatch(options, handler) {
|
177960
177978
|
if (this.host !== null) {
|
177961
177979
|
_ProxyDispatcher.reinstateHostHeader(options.headers, this.host);
|
@@ -178956,7 +178974,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
178956
178974
|
devServer.unregisterHotKeys?.();
|
178957
178975
|
}, "stop"),
|
178958
178976
|
fetch: /* @__PURE__ */ __name(async (input, init3) => {
|
178959
|
-
return await (0,
|
178977
|
+
return await (0, import_undici24.fetch)(
|
178960
178978
|
...parseRequestInput(address, port, input, init3, options?.localProtocol)
|
178961
178979
|
);
|
178962
178980
|
}, "fetch"),
|
@@ -178969,7 +178987,7 @@ function parseRequestInput(readyAddress, readyPort, input = "/", init3, protocol
|
|
178969
178987
|
if (typeof input === "string") {
|
178970
178988
|
input = new URL(input, "http://placeholder");
|
178971
178989
|
}
|
178972
|
-
const forward = new
|
178990
|
+
const forward = new import_undici24.Request(input, init3);
|
178973
178991
|
const url4 = new URL(forward.url);
|
178974
178992
|
forward.headers.set("MF-Original-URL", url4.toString());
|
178975
178993
|
forward.headers.set("MF-Disable-Pretty-Error", "true");
|
@@ -178981,12 +178999,12 @@ function parseRequestInput(readyAddress, readyPort, input = "/", init3, protocol
|
|
178981
178999
|
}
|
178982
179000
|
return [url4, forward];
|
178983
179001
|
}
|
178984
|
-
var import_node_events7,
|
179002
|
+
var import_node_events7, import_undici24;
|
178985
179003
|
var init_dev3 = __esm({
|
178986
179004
|
"src/api/dev.ts"() {
|
178987
179005
|
init_import_meta_url();
|
178988
179006
|
import_node_events7 = __toESM(require("events"));
|
178989
|
-
|
179007
|
+
import_undici24 = __toESM(require_undici());
|
178990
179008
|
init_dev2();
|
178991
179009
|
init_misc_variables();
|
178992
179010
|
init_experimental_flags();
|
@@ -179131,7 +179149,7 @@ function getServiceBindingProxyFetch({
|
|
179131
179149
|
return async (request4) => {
|
179132
179150
|
const newUrl = getExternalUrl(request4);
|
179133
179151
|
try {
|
179134
|
-
const resp = await (0,
|
179152
|
+
const resp = await (0, import_undici25.fetch)(newUrl, request4);
|
179135
179153
|
const respBody = await resp.arrayBuffer();
|
179136
179154
|
return new import_miniflare30.Response(respBody, resp);
|
179137
179155
|
} catch {
|
@@ -179149,12 +179167,12 @@ async function maybeGetRegisteredWorkers() {
|
|
179149
179167
|
return void 0;
|
179150
179168
|
}
|
179151
179169
|
}
|
179152
|
-
var import_miniflare30,
|
179170
|
+
var import_miniflare30, import_undici25;
|
179153
179171
|
var init_services = __esm({
|
179154
179172
|
"src/api/integrations/platform/services.ts"() {
|
179155
179173
|
init_import_meta_url();
|
179156
179174
|
import_miniflare30 = require("miniflare");
|
179157
|
-
|
179175
|
+
import_undici25 = __toESM(require_undici());
|
179158
179176
|
init_dev_registry();
|
179159
179177
|
__name(getServiceBindings, "getServiceBindings");
|
179160
179178
|
__name(getServiceBindingProxyFetch, "getServiceBindingProxyFetch");
|