wrangler 3.107.0 → 3.107.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/config-schema.json +0 -42
- package/package.json +6 -7
- package/wrangler-dist/cli.d.ts +0 -17
- package/wrangler-dist/cli.js +151 -447
- package/wrangler-dist/cli.js.map +0 -7
package/wrangler-dist/cli.js
CHANGED
@@ -4603,7 +4603,7 @@ var require_file = __commonJS({
|
|
4603
4603
|
var { parseMIMEType, serializeAMimeType } = require_dataURL();
|
4604
4604
|
var { kEnumerableProperty } = require_util();
|
4605
4605
|
var encoder = new TextEncoder();
|
4606
|
-
var
|
4606
|
+
var File7 = class extends Blob6 {
|
4607
4607
|
constructor(fileBits, fileName, options30 = {}) {
|
4608
4608
|
webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" });
|
4609
4609
|
fileBits = webidl.converters["sequence<BlobPart>"](fileBits);
|
@@ -4631,19 +4631,19 @@ var require_file = __commonJS({
|
|
4631
4631
|
};
|
4632
4632
|
}
|
4633
4633
|
get name() {
|
4634
|
-
webidl.brandCheck(this,
|
4634
|
+
webidl.brandCheck(this, File7);
|
4635
4635
|
return this[kState].name;
|
4636
4636
|
}
|
4637
4637
|
get lastModified() {
|
4638
|
-
webidl.brandCheck(this,
|
4638
|
+
webidl.brandCheck(this, File7);
|
4639
4639
|
return this[kState].lastModified;
|
4640
4640
|
}
|
4641
4641
|
get type() {
|
4642
|
-
webidl.brandCheck(this,
|
4642
|
+
webidl.brandCheck(this, File7);
|
4643
4643
|
return this[kState].type;
|
4644
4644
|
}
|
4645
4645
|
};
|
4646
|
-
__name(
|
4646
|
+
__name(File7, "File");
|
4647
4647
|
var FileLike = class {
|
4648
4648
|
constructor(blobLike, fileName, options30 = {}) {
|
4649
4649
|
const n6 = fileName;
|
@@ -4693,7 +4693,7 @@ var require_file = __commonJS({
|
|
4693
4693
|
}
|
4694
4694
|
};
|
4695
4695
|
__name(FileLike, "FileLike");
|
4696
|
-
Object.defineProperties(
|
4696
|
+
Object.defineProperties(File7.prototype, {
|
4697
4697
|
[Symbol.toStringTag]: {
|
4698
4698
|
value: "File",
|
4699
4699
|
configurable: true
|
@@ -4775,10 +4775,10 @@ var require_file = __commonJS({
|
|
4775
4775
|
}
|
4776
4776
|
__name(convertLineEndingsNative, "convertLineEndingsNative");
|
4777
4777
|
function isFileLike(object) {
|
4778
|
-
return NativeFile && object instanceof NativeFile || object instanceof
|
4778
|
+
return NativeFile && object instanceof NativeFile || object instanceof File7 || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File";
|
4779
4779
|
}
|
4780
4780
|
__name(isFileLike, "isFileLike");
|
4781
|
-
module3.exports = { File:
|
4781
|
+
module3.exports = { File: File7, FileLike, isFileLike };
|
4782
4782
|
}
|
4783
4783
|
});
|
4784
4784
|
|
@@ -4792,7 +4792,7 @@ var require_formdata = __commonJS({
|
|
4792
4792
|
var { File: UndiciFile, FileLike, isFileLike } = require_file();
|
4793
4793
|
var { webidl } = require_webidl();
|
4794
4794
|
var { Blob: Blob6, File: NativeFile } = require("buffer");
|
4795
|
-
var
|
4795
|
+
var File7 = NativeFile ?? UndiciFile;
|
4796
4796
|
var FormData11 = class {
|
4797
4797
|
constructor(form) {
|
4798
4798
|
if (form !== void 0) {
|
@@ -4924,14 +4924,14 @@ var require_formdata = __commonJS({
|
|
4924
4924
|
value = Buffer.from(value).toString("utf8");
|
4925
4925
|
} else {
|
4926
4926
|
if (!isFileLike(value)) {
|
4927
|
-
value = value instanceof Blob6 ? new
|
4927
|
+
value = value instanceof Blob6 ? new File7([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type });
|
4928
4928
|
}
|
4929
4929
|
if (filename !== void 0) {
|
4930
4930
|
const options30 = {
|
4931
4931
|
type: value.type,
|
4932
4932
|
lastModified: value.lastModified
|
4933
4933
|
};
|
4934
|
-
value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new
|
4934
|
+
value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File7([value], filename, options30) : new FileLike(value, filename, options30);
|
4935
4935
|
}
|
4936
4936
|
}
|
4937
4937
|
return { name: name2, value };
|
@@ -4968,7 +4968,7 @@ var require_body = __commonJS({
|
|
4968
4968
|
var { File: UndiciFile } = require_file();
|
4969
4969
|
var { parseMIMEType, serializeAMimeType } = require_dataURL();
|
4970
4970
|
var ReadableStream3 = globalThis.ReadableStream;
|
4971
|
-
var
|
4971
|
+
var File7 = NativeFile ?? UndiciFile;
|
4972
4972
|
var textEncoder = new TextEncoder();
|
4973
4973
|
var textDecoder = new TextDecoder();
|
4974
4974
|
function extractBody(object, keepalive = false) {
|
@@ -5209,14 +5209,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
5209
5209
|
});
|
5210
5210
|
value.on("end", () => {
|
5211
5211
|
chunks.push(Buffer.from(base64chunk, "base64"));
|
5212
|
-
responseFormData.append(name2, new
|
5212
|
+
responseFormData.append(name2, new File7(chunks, filename, { type: mimeType }));
|
5213
5213
|
});
|
5214
5214
|
} else {
|
5215
5215
|
value.on("data", (chunk) => {
|
5216
5216
|
chunks.push(chunk);
|
5217
5217
|
});
|
5218
5218
|
value.on("end", () => {
|
5219
|
-
responseFormData.append(name2, new
|
5219
|
+
responseFormData.append(name2, new File7(chunks, filename, { type: mimeType }));
|
5220
5220
|
});
|
5221
5221
|
}
|
5222
5222
|
});
|
@@ -11837,11 +11837,11 @@ var require_response = __commonJS({
|
|
11837
11837
|
var { types } = require("util");
|
11838
11838
|
var ReadableStream3 = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
11839
11839
|
var textEncoder = new TextEncoder("utf-8");
|
11840
|
-
var
|
11840
|
+
var Response10 = class {
|
11841
11841
|
// Creates network error Response.
|
11842
11842
|
static error() {
|
11843
11843
|
const relevantRealm = { settingsObject: {} };
|
11844
|
-
const responseObject = new
|
11844
|
+
const responseObject = new Response10();
|
11845
11845
|
responseObject[kState] = makeNetworkError();
|
11846
11846
|
responseObject[kRealm] = relevantRealm;
|
11847
11847
|
responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList;
|
@@ -11860,7 +11860,7 @@ var require_response = __commonJS({
|
|
11860
11860
|
);
|
11861
11861
|
const body = extractBody(bytes);
|
11862
11862
|
const relevantRealm = { settingsObject: {} };
|
11863
|
-
const responseObject = new
|
11863
|
+
const responseObject = new Response10();
|
11864
11864
|
responseObject[kRealm] = relevantRealm;
|
11865
11865
|
responseObject[kHeaders][kGuard] = "response";
|
11866
11866
|
responseObject[kHeaders][kRealm] = relevantRealm;
|
@@ -11884,7 +11884,7 @@ var require_response = __commonJS({
|
|
11884
11884
|
if (!redirectStatusSet.has(status2)) {
|
11885
11885
|
throw new RangeError("Invalid status code " + status2);
|
11886
11886
|
}
|
11887
|
-
const responseObject = new
|
11887
|
+
const responseObject = new Response10();
|
11888
11888
|
responseObject[kRealm] = relevantRealm;
|
11889
11889
|
responseObject[kHeaders][kGuard] = "immutable";
|
11890
11890
|
responseObject[kHeaders][kRealm] = relevantRealm;
|
@@ -11914,12 +11914,12 @@ var require_response = __commonJS({
|
|
11914
11914
|
}
|
11915
11915
|
// Returns response’s type, e.g., "cors".
|
11916
11916
|
get type() {
|
11917
|
-
webidl.brandCheck(this,
|
11917
|
+
webidl.brandCheck(this, Response10);
|
11918
11918
|
return this[kState].type;
|
11919
11919
|
}
|
11920
11920
|
// Returns response’s URL, if it has one; otherwise the empty string.
|
11921
11921
|
get url() {
|
11922
|
-
webidl.brandCheck(this,
|
11922
|
+
webidl.brandCheck(this, Response10);
|
11923
11923
|
const urlList = this[kState].urlList;
|
11924
11924
|
const url4 = urlList[urlList.length - 1] ?? null;
|
11925
11925
|
if (url4 === null) {
|
@@ -11929,40 +11929,40 @@ var require_response = __commonJS({
|
|
11929
11929
|
}
|
11930
11930
|
// Returns whether response was obtained through a redirect.
|
11931
11931
|
get redirected() {
|
11932
|
-
webidl.brandCheck(this,
|
11932
|
+
webidl.brandCheck(this, Response10);
|
11933
11933
|
return this[kState].urlList.length > 1;
|
11934
11934
|
}
|
11935
11935
|
// Returns response’s status.
|
11936
11936
|
get status() {
|
11937
|
-
webidl.brandCheck(this,
|
11937
|
+
webidl.brandCheck(this, Response10);
|
11938
11938
|
return this[kState].status;
|
11939
11939
|
}
|
11940
11940
|
// Returns whether response’s status is an ok status.
|
11941
11941
|
get ok() {
|
11942
|
-
webidl.brandCheck(this,
|
11942
|
+
webidl.brandCheck(this, Response10);
|
11943
11943
|
return this[kState].status >= 200 && this[kState].status <= 299;
|
11944
11944
|
}
|
11945
11945
|
// Returns response’s status message.
|
11946
11946
|
get statusText() {
|
11947
|
-
webidl.brandCheck(this,
|
11947
|
+
webidl.brandCheck(this, Response10);
|
11948
11948
|
return this[kState].statusText;
|
11949
11949
|
}
|
11950
11950
|
// Returns response’s headers as Headers.
|
11951
11951
|
get headers() {
|
11952
|
-
webidl.brandCheck(this,
|
11952
|
+
webidl.brandCheck(this, Response10);
|
11953
11953
|
return this[kHeaders];
|
11954
11954
|
}
|
11955
11955
|
get body() {
|
11956
|
-
webidl.brandCheck(this,
|
11956
|
+
webidl.brandCheck(this, Response10);
|
11957
11957
|
return this[kState].body ? this[kState].body.stream : null;
|
11958
11958
|
}
|
11959
11959
|
get bodyUsed() {
|
11960
|
-
webidl.brandCheck(this,
|
11960
|
+
webidl.brandCheck(this, Response10);
|
11961
11961
|
return !!this[kState].body && util5.isDisturbed(this[kState].body.stream);
|
11962
11962
|
}
|
11963
11963
|
// Returns a clone of response.
|
11964
11964
|
clone() {
|
11965
|
-
webidl.brandCheck(this,
|
11965
|
+
webidl.brandCheck(this, Response10);
|
11966
11966
|
if (this.bodyUsed || this.body && this.body.locked) {
|
11967
11967
|
throw webidl.errors.exception({
|
11968
11968
|
header: "Response.clone",
|
@@ -11970,7 +11970,7 @@ var require_response = __commonJS({
|
|
11970
11970
|
});
|
11971
11971
|
}
|
11972
11972
|
const clonedResponse = cloneResponse(this[kState]);
|
11973
|
-
const clonedResponseObject = new
|
11973
|
+
const clonedResponseObject = new Response10();
|
11974
11974
|
clonedResponseObject[kState] = clonedResponse;
|
11975
11975
|
clonedResponseObject[kRealm] = this[kRealm];
|
11976
11976
|
clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList;
|
@@ -11979,9 +11979,9 @@ var require_response = __commonJS({
|
|
11979
11979
|
return clonedResponseObject;
|
11980
11980
|
}
|
11981
11981
|
};
|
11982
|
-
__name(
|
11983
|
-
mixinBody(
|
11984
|
-
Object.defineProperties(
|
11982
|
+
__name(Response10, "Response");
|
11983
|
+
mixinBody(Response10);
|
11984
|
+
Object.defineProperties(Response10.prototype, {
|
11985
11985
|
type: kEnumerableProperty,
|
11986
11986
|
url: kEnumerableProperty,
|
11987
11987
|
status: kEnumerableProperty,
|
@@ -11997,7 +11997,7 @@ var require_response = __commonJS({
|
|
11997
11997
|
configurable: true
|
11998
11998
|
}
|
11999
11999
|
});
|
12000
|
-
Object.defineProperties(
|
12000
|
+
Object.defineProperties(Response10, {
|
12001
12001
|
json: kEnumerableProperty,
|
12002
12002
|
redirect: kEnumerableProperty,
|
12003
12003
|
error: kEnumerableProperty
|
@@ -12186,7 +12186,7 @@ var require_response = __commonJS({
|
|
12186
12186
|
makeResponse,
|
12187
12187
|
makeAppropriateNetworkError,
|
12188
12188
|
filterResponse,
|
12189
|
-
Response:
|
12189
|
+
Response: Response10,
|
12190
12190
|
cloneResponse
|
12191
12191
|
};
|
12192
12192
|
}
|
@@ -12841,7 +12841,7 @@ var require_fetch = __commonJS({
|
|
12841
12841
|
"use strict";
|
12842
12842
|
init_import_meta_url();
|
12843
12843
|
var {
|
12844
|
-
Response:
|
12844
|
+
Response: Response10,
|
12845
12845
|
makeNetworkError,
|
12846
12846
|
makeAppropriateNetworkError,
|
12847
12847
|
filterResponse,
|
@@ -12982,7 +12982,7 @@ var require_fetch = __commonJS({
|
|
12982
12982
|
);
|
12983
12983
|
return Promise.resolve();
|
12984
12984
|
}
|
12985
|
-
responseObject = new
|
12985
|
+
responseObject = new Response10();
|
12986
12986
|
responseObject[kState] = response;
|
12987
12987
|
responseObject[kRealm] = relevantRealm;
|
12988
12988
|
responseObject[kHeaders][kHeadersList] = response.headersList;
|
@@ -14773,7 +14773,7 @@ var require_cache = __commonJS({
|
|
14773
14773
|
var { kEnumerableProperty, isDisturbed } = require_util();
|
14774
14774
|
var { kHeadersList } = require_symbols();
|
14775
14775
|
var { webidl } = require_webidl();
|
14776
|
-
var { Response:
|
14776
|
+
var { Response: Response10, cloneResponse } = require_response();
|
14777
14777
|
var { Request: Request4 } = require_request2();
|
14778
14778
|
var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
|
14779
14779
|
var { fetching } = require_fetch();
|
@@ -14832,7 +14832,7 @@ var require_cache = __commonJS({
|
|
14832
14832
|
}
|
14833
14833
|
const responseList = [];
|
14834
14834
|
for (const response of responses) {
|
14835
|
-
const responseObject = new
|
14835
|
+
const responseObject = new Response10(response.body?.source ?? null);
|
14836
14836
|
const body = responseObject[kState].body;
|
14837
14837
|
responseObject[kState] = response;
|
14838
14838
|
responseObject[kState].body = body;
|
@@ -15289,7 +15289,7 @@ var require_cache = __commonJS({
|
|
15289
15289
|
converter: webidl.converters.DOMString
|
15290
15290
|
}
|
15291
15291
|
]);
|
15292
|
-
webidl.converters.Response = webidl.interfaceConverter(
|
15292
|
+
webidl.converters.Response = webidl.interfaceConverter(Response10);
|
15293
15293
|
webidl.converters["sequence<RequestInfo>"] = webidl.sequenceConverter(
|
15294
15294
|
webidl.converters.RequestInfo
|
15295
15295
|
);
|
@@ -71460,7 +71460,7 @@ var require_src5 = __commonJS({
|
|
71460
71460
|
QueueEvent: () => QueueEvent,
|
71461
71461
|
ReloadEvent: () => ReloadEvent,
|
71462
71462
|
Request: () => Request4,
|
71463
|
-
Response: () =>
|
71463
|
+
Response: () => Response10,
|
71464
71464
|
Router: () => Router,
|
71465
71465
|
RouterError: () => RouterError,
|
71466
71466
|
ScheduledController: () => ScheduledController,
|
@@ -72419,14 +72419,14 @@ var require_src5 = __commonJS({
|
|
72419
72419
|
"statusText",
|
72420
72420
|
"status"
|
72421
72421
|
];
|
72422
|
-
var
|
72422
|
+
var Response10 = /* @__PURE__ */ __name(class extends Body {
|
72423
72423
|
static redirect(url4, status2 = 302) {
|
72424
72424
|
const res = import_undici26.Response.redirect(url4, status2);
|
72425
|
-
return new
|
72425
|
+
return new Response10(res.body, res);
|
72426
72426
|
}
|
72427
72427
|
static json(data, init2) {
|
72428
72428
|
const res = import_undici26.Response.json(data, init2);
|
72429
|
-
return new
|
72429
|
+
return new Response10(res.body, res);
|
72430
72430
|
}
|
72431
72431
|
#encodeBody;
|
72432
72432
|
#status;
|
@@ -72446,7 +72446,7 @@ var require_src5 = __commonJS({
|
|
72446
72446
|
if (body instanceof import_web3.ReadableStream && _isByteStream(body)) {
|
72447
72447
|
body = convertToRegularStream(body);
|
72448
72448
|
}
|
72449
|
-
if (init2 instanceof
|
72449
|
+
if (init2 instanceof Response10) {
|
72450
72450
|
encodeBody = init2.#encodeBody;
|
72451
72451
|
status2 = init2.#status;
|
72452
72452
|
webSocket = init2.#webSocket;
|
@@ -72476,7 +72476,7 @@ var require_src5 = __commonJS({
|
|
72476
72476
|
if (contentLength !== void 0) {
|
72477
72477
|
this.headers.set("content-length", contentLength.toString());
|
72478
72478
|
}
|
72479
|
-
makeEnumerable(
|
72479
|
+
makeEnumerable(Response10.prototype, this, enumerableResponseKeys);
|
72480
72480
|
Object.defineProperty(this, kWaitUntil, nonEnumerable);
|
72481
72481
|
}
|
72482
72482
|
clone() {
|
@@ -72485,7 +72485,7 @@ var require_src5 = __commonJS({
|
|
72485
72485
|
}
|
72486
72486
|
const innerClone = this[_kInner].clone();
|
72487
72487
|
this[kBodyStream] = void 0;
|
72488
|
-
const clone = new
|
72488
|
+
const clone = new Response10(innerClone.body, innerClone);
|
72489
72489
|
clone[kInputGated] = this[kInputGated];
|
72490
72490
|
clone[kFormDataFiles] = this[kFormDataFiles];
|
72491
72491
|
clone.#encodeBody = this.#encodeBody;
|
@@ -72527,7 +72527,7 @@ var require_src5 = __commonJS({
|
|
72527
72527
|
}
|
72528
72528
|
}, "Response");
|
72529
72529
|
function withWaitUntil(res, waitUntil) {
|
72530
|
-
const resWaitUntil = res instanceof
|
72530
|
+
const resWaitUntil = res instanceof Response10 ? res : new Response10(res.body, res);
|
72531
72531
|
resWaitUntil[kWaitUntil] = waitUntil;
|
72532
72532
|
return resWaitUntil;
|
72533
72533
|
}
|
@@ -72537,7 +72537,7 @@ var require_src5 = __commonJS({
|
|
72537
72537
|
}
|
72538
72538
|
__name(_getURLList, "_getURLList");
|
72539
72539
|
function _getBodyLength(res) {
|
72540
|
-
if (res instanceof
|
72540
|
+
if (res instanceof Response10)
|
72541
72541
|
res = res[_kInner];
|
72542
72542
|
return res[fetchSymbols.kState]?.body?.length ?? void 0;
|
72543
72543
|
}
|
@@ -72609,7 +72609,7 @@ var require_src5 = __commonJS({
|
|
72609
72609
|
if (urlList)
|
72610
72610
|
ctx.incrementExternalSubrequests(urlList.length - 1);
|
72611
72611
|
}
|
72612
|
-
const res = new
|
72612
|
+
const res = new Response10(nullBodyStatus.includes(baseRes.status) ? null : baseRes.body, baseRes);
|
72613
72613
|
res.headers[fetchSymbols.kGuard] = "immutable";
|
72614
72614
|
await (0, import_shared5.waitForOpenInputGate)();
|
72615
72615
|
ctx?.advanceCurrentTime();
|
@@ -72974,7 +72974,7 @@ ${SUGGEST_GLOBAL_BINDING_MODULES}`);
|
|
72974
72974
|
event[kSent] = true;
|
72975
72975
|
}
|
72976
72976
|
if (res !== void 0) {
|
72977
|
-
const validRes = res instanceof
|
72977
|
+
const validRes = res instanceof Response10 || res instanceof import_undici32.Response;
|
72978
72978
|
if (!validRes) {
|
72979
72979
|
const suggestion = this.#modules ? SUGGEST_RES_MODULES : SUGGEST_RES;
|
72980
72980
|
throw new FetchError("ERR_RESPONSE_TYPE", `Fetch handler didn't respond with a Response object.
|
@@ -73112,12 +73112,12 @@ Make sure you're ${suggestion}.`);
|
|
73112
73112
|
function getRangeResponse(requestRangeHeader, responseStatus, responseHeaders, responseBody) {
|
73113
73113
|
const ranges = parseRanges(requestRangeHeader, responseBody.byteLength);
|
73114
73114
|
if (ranges === void 0) {
|
73115
|
-
return new
|
73115
|
+
return new Response10(null, {
|
73116
73116
|
status: 416,
|
73117
73117
|
headers: { "Content-Range": `bytes */${responseBody.byteLength}` }
|
73118
73118
|
});
|
73119
73119
|
} else if (ranges.length === 0) {
|
73120
|
-
return new
|
73120
|
+
return new Response10(responseBody, {
|
73121
73121
|
status: responseStatus,
|
73122
73122
|
headers: responseHeaders
|
73123
73123
|
});
|
@@ -73125,7 +73125,7 @@ Make sure you're ${suggestion}.`);
|
|
73125
73125
|
const [start, end] = ranges[0];
|
73126
73126
|
responseHeaders.set("Content-Range", `bytes ${start}-${end}/${responseBody.byteLength}`);
|
73127
73127
|
responseHeaders.set("Content-Length", `${end - start + 1}`);
|
73128
|
-
return new
|
73128
|
+
return new Response10(responseBody.slice(start, end + 1), {
|
73129
73129
|
status: 206,
|
73130
73130
|
headers: responseHeaders
|
73131
73131
|
});
|
@@ -73152,7 +73152,7 @@ Content-Range: bytes ${start}-${end}/${responseBody.byteLength}\r
|
|
73152
73152
|
}
|
73153
73153
|
});
|
73154
73154
|
responseHeaders.set("Content-Type", `multipart/byteranges; boundary=${boundary}`);
|
73155
|
-
return new
|
73155
|
+
return new Response10(stream2, {
|
73156
73156
|
status: 206,
|
73157
73157
|
headers: responseHeaders
|
73158
73158
|
});
|
@@ -73559,7 +73559,7 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
|
|
73559
73559
|
}
|
73560
73560
|
}
|
73561
73561
|
__name(_populateBuildConfig, "_populateBuildConfig");
|
73562
|
-
var
|
73562
|
+
var import_buffer5 = __toModule(require("buffer"));
|
73563
73563
|
var import_promises210 = __toModule(require("fs/promises"));
|
73564
73564
|
var import_path42 = __toModule(require("path"));
|
73565
73565
|
var import_web5 = __toModule(require("stream/web"));
|
@@ -73784,10 +73784,10 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
|
|
73784
73784
|
}
|
73785
73785
|
const extraGlobals = {};
|
73786
73786
|
let CompatRequest = Request4;
|
73787
|
-
let CompatResponse =
|
73787
|
+
let CompatResponse = Response10;
|
73788
73788
|
if (!ctx.compat.isEnabled("formdata_parser_supports_files")) {
|
73789
73789
|
CompatRequest = proxyStringFormDataFiles(Request4);
|
73790
|
-
CompatResponse = proxyStringFormDataFiles(
|
73790
|
+
CompatResponse = proxyStringFormDataFiles(Response10);
|
73791
73791
|
}
|
73792
73792
|
if (ctx.compat.isEnabled("global_navigator")) {
|
73793
73793
|
extraGlobals.navigator = new Navigator();
|
@@ -73856,7 +73856,7 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
|
|
73856
73856
|
Request: CompatRequest,
|
73857
73857
|
Response: CompatResponse,
|
73858
73858
|
FormData: import_undici42.FormData,
|
73859
|
-
Blob:
|
73859
|
+
Blob: import_buffer5.Blob,
|
73860
73860
|
File: import_undici42.File,
|
73861
73861
|
URL: import_url22.URL,
|
73862
73862
|
URLSearchParams: import_url22.URLSearchParams,
|
@@ -76846,17 +76846,17 @@ async function generateASSETSBinding(options30) {
|
|
76846
76846
|
try {
|
76847
76847
|
const url4 = new URL(miniflareRequest.url);
|
76848
76848
|
url4.host = `localhost:${options30.proxyPort}`;
|
76849
|
-
const proxyRequest = new
|
76849
|
+
const proxyRequest = new import_miniflare17.Request(url4, miniflareRequest);
|
76850
76850
|
if (proxyRequest.headers.get("Upgrade") === "websocket") {
|
76851
76851
|
proxyRequest.headers.delete("Sec-WebSocket-Accept");
|
76852
76852
|
proxyRequest.headers.delete("Sec-WebSocket-Key");
|
76853
76853
|
}
|
76854
|
-
return await (0,
|
76854
|
+
return await (0, import_miniflare17.fetch)(proxyRequest, {
|
76855
76855
|
dispatcher: new ProxyDispatcher(miniflareRequest.headers.get("Host"))
|
76856
76856
|
});
|
76857
76857
|
} catch (thrown) {
|
76858
76858
|
options30.log.error(new Error(`Could not proxy request: ${thrown}`));
|
76859
|
-
return new
|
76859
|
+
return new import_miniflare17.Response(`[wrangler] Could not proxy request: ${thrown}`, {
|
76860
76860
|
status: 502
|
76861
76861
|
});
|
76862
76862
|
}
|
@@ -76865,7 +76865,7 @@ async function generateASSETSBinding(options30) {
|
|
76865
76865
|
return await assetsFetch(miniflareRequest);
|
76866
76866
|
} catch (thrown) {
|
76867
76867
|
options30.log.error(new Error(`Could not serve static asset: ${thrown}`));
|
76868
|
-
return new
|
76868
|
+
return new import_miniflare17.Response(
|
76869
76869
|
`[wrangler] Could not serve static asset: ${thrown}`,
|
76870
76870
|
{ status: 502 }
|
76871
76871
|
);
|
@@ -76977,11 +76977,11 @@ async function generateAssetsFetch(directory, log2) {
|
|
76977
76977
|
});
|
76978
76978
|
}, "generateResponse");
|
76979
76979
|
return async (input, init2) => {
|
76980
|
-
const request4 = new
|
76980
|
+
const request4 = new import_miniflare17.Request(input, init2);
|
76981
76981
|
return await generateResponse(request4);
|
76982
76982
|
};
|
76983
76983
|
}
|
76984
|
-
var import_node_assert18, import_node_fs20, import_node_path37, import_mime3,
|
76984
|
+
var import_node_assert18, import_node_fs20, import_node_path37, import_mime3, import_miniflare17, import_undici8, ProxyDispatcher, invalidAssetsFetch;
|
76985
76985
|
var init_assets = __esm({
|
76986
76986
|
"src/miniflare-cli/assets.ts"() {
|
76987
76987
|
init_import_meta_url();
|
@@ -76993,7 +76993,7 @@ var init_assets = __esm({
|
|
76993
76993
|
init_parseRedirects();
|
76994
76994
|
init_esm2();
|
76995
76995
|
import_mime3 = __toESM(require_mime());
|
76996
|
-
|
76996
|
+
import_miniflare17 = require("miniflare");
|
76997
76997
|
import_undici8 = __toESM(require_undici());
|
76998
76998
|
init_hash();
|
76999
76999
|
__name(generateASSETSBinding, "generateASSETSBinding");
|
@@ -79765,23 +79765,23 @@ var init_dist_es5 = __esm({
|
|
79765
79765
|
});
|
79766
79766
|
|
79767
79767
|
// ../../node_modules/.pnpm/@smithy+util-buffer-from@3.0.0/node_modules/@smithy/util-buffer-from/dist-es/index.js
|
79768
|
-
var
|
79768
|
+
var import_buffer, fromArrayBuffer, fromString;
|
79769
79769
|
var init_dist_es6 = __esm({
|
79770
79770
|
"../../node_modules/.pnpm/@smithy+util-buffer-from@3.0.0/node_modules/@smithy/util-buffer-from/dist-es/index.js"() {
|
79771
79771
|
init_import_meta_url();
|
79772
79772
|
init_dist_es5();
|
79773
|
-
|
79773
|
+
import_buffer = require("buffer");
|
79774
79774
|
fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => {
|
79775
79775
|
if (!isArrayBuffer(input)) {
|
79776
79776
|
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
|
79777
79777
|
}
|
79778
|
-
return
|
79778
|
+
return import_buffer.Buffer.from(input, offset, length);
|
79779
79779
|
}, "fromArrayBuffer");
|
79780
79780
|
fromString = /* @__PURE__ */ __name((input, encoding) => {
|
79781
79781
|
if (typeof input !== "string") {
|
79782
79782
|
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
|
79783
79783
|
}
|
79784
|
-
return encoding ?
|
79784
|
+
return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input);
|
79785
79785
|
}, "fromString");
|
79786
79786
|
}
|
79787
79787
|
});
|
@@ -88965,19 +88965,19 @@ function httpRequest(options30) {
|
|
88965
88965
|
chunks.push(chunk);
|
88966
88966
|
});
|
88967
88967
|
res.on("end", () => {
|
88968
|
-
resolve24(
|
88968
|
+
resolve24(import_buffer3.Buffer.concat(chunks));
|
88969
88969
|
req.destroy();
|
88970
88970
|
});
|
88971
88971
|
});
|
88972
88972
|
req.end();
|
88973
88973
|
});
|
88974
88974
|
}
|
88975
|
-
var
|
88975
|
+
var import_buffer3, import_http2;
|
88976
88976
|
var init_httpRequest2 = __esm({
|
88977
88977
|
"../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js"() {
|
88978
88978
|
init_import_meta_url();
|
88979
88979
|
init_dist_es16();
|
88980
|
-
|
88980
|
+
import_buffer3 = require("buffer");
|
88981
88981
|
import_http2 = require("http");
|
88982
88982
|
__name(httpRequest, "httpRequest");
|
88983
88983
|
}
|
@@ -89958,7 +89958,7 @@ var init_dist_es41 = __esm({
|
|
89958
89958
|
|
89959
89959
|
// ../../node_modules/.pnpm/@smithy+hash-node@3.0.11/node_modules/@smithy/hash-node/dist-es/index.js
|
89960
89960
|
function castSourceData(toCast, encoding) {
|
89961
|
-
if (
|
89961
|
+
if (import_buffer4.Buffer.isBuffer(toCast)) {
|
89962
89962
|
return toCast;
|
89963
89963
|
}
|
89964
89964
|
if (typeof toCast === "string") {
|
@@ -89969,13 +89969,13 @@ function castSourceData(toCast, encoding) {
|
|
89969
89969
|
}
|
89970
89970
|
return fromArrayBuffer(toCast);
|
89971
89971
|
}
|
89972
|
-
var
|
89972
|
+
var import_buffer4, import_crypto5, Hash;
|
89973
89973
|
var init_dist_es42 = __esm({
|
89974
89974
|
"../../node_modules/.pnpm/@smithy+hash-node@3.0.11/node_modules/@smithy/hash-node/dist-es/index.js"() {
|
89975
89975
|
init_import_meta_url();
|
89976
89976
|
init_dist_es6();
|
89977
89977
|
init_dist_es7();
|
89978
|
-
|
89978
|
+
import_buffer4 = require("buffer");
|
89979
89979
|
import_crypto5 = require("crypto");
|
89980
89980
|
Hash = class {
|
89981
89981
|
constructor(algorithmIdentifier, secret3) {
|
@@ -98088,14 +98088,14 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
98088
98088
|
var source_default = chalk;
|
98089
98089
|
|
98090
98090
|
// src/api/startDevWorker/MultiworkerRuntimeController.ts
|
98091
|
-
var
|
98091
|
+
var import_miniflare7 = require("miniflare");
|
98092
98092
|
|
98093
98093
|
// src/dev/miniflare.ts
|
98094
98094
|
init_import_meta_url();
|
98095
98095
|
var import_node_assert5 = __toESM(require("node:assert"));
|
98096
98096
|
var import_node_crypto4 = require("node:crypto");
|
98097
98097
|
var import_node_path14 = __toESM(require("node:path"));
|
98098
|
-
var
|
98098
|
+
var import_miniflare5 = require("miniflare");
|
98099
98099
|
|
98100
98100
|
// src/ai/fetcher.ts
|
98101
98101
|
init_import_meta_url();
|
@@ -98108,7 +98108,7 @@ var import_undici3 = __toESM(require_undici());
|
|
98108
98108
|
|
98109
98109
|
// package.json
|
98110
98110
|
var name = "wrangler";
|
98111
|
-
var version = "3.107.
|
98111
|
+
var version = "3.107.2";
|
98112
98112
|
|
98113
98113
|
// src/environment-variables/misc-variables.ts
|
98114
98114
|
init_import_meta_url();
|
@@ -100873,7 +100873,6 @@ var friendlyBindingNames = {
|
|
100873
100873
|
text_blobs: "Text Blobs",
|
100874
100874
|
browser: "Browser",
|
100875
100875
|
ai: "AI",
|
100876
|
-
images: "Images",
|
100877
100876
|
version_metadata: "Worker Version Metadata",
|
100878
100877
|
unsafe: "Unsafe Metadata",
|
100879
100878
|
vars: "Vars",
|
@@ -100912,7 +100911,6 @@ function printBindings(bindings, context2 = {}) {
|
|
100912
100911
|
text_blobs,
|
100913
100912
|
browser,
|
100914
100913
|
ai: ai3,
|
100915
|
-
images,
|
100916
100914
|
version_metadata,
|
100917
100915
|
unsafe,
|
100918
100916
|
vars,
|
@@ -101125,17 +101123,6 @@ function printBindings(bindings, context2 = {}) {
|
|
101125
101123
|
entries: [{ key: "Name", value: browser.binding }]
|
101126
101124
|
});
|
101127
101125
|
}
|
101128
|
-
if (images !== void 0) {
|
101129
|
-
output.push({
|
101130
|
-
name: friendlyBindingNames.images,
|
101131
|
-
entries: [
|
101132
|
-
{
|
101133
|
-
key: "Name",
|
101134
|
-
value: addLocalSuffix(images.binding, !!context2.imagesLocalMode)
|
101135
|
-
}
|
101136
|
-
]
|
101137
|
-
});
|
101138
|
-
}
|
101139
101126
|
if (ai3 !== void 0) {
|
101140
101127
|
const entries = [
|
101141
101128
|
{ key: "Name", value: ai3.binding }
|
@@ -102071,10 +102058,15 @@ Read more: https://developers.cloudflare.com/workers/static-assets/binding/#run_
|
|
102071
102058
|
false
|
102072
102059
|
// Leave in for the moment, to be removed in a future release
|
102073
102060
|
);
|
102074
|
-
validateAssetsConfig(diagnostics, "assets", rawEnv.assets, topLevelEnv);
|
102075
|
-
return rawEnv.assets;
|
102076
102061
|
}
|
102077
|
-
return
|
102062
|
+
return inheritable(
|
102063
|
+
diagnostics,
|
102064
|
+
topLevelEnv,
|
102065
|
+
rawEnv,
|
102066
|
+
"assets",
|
102067
|
+
validateAssetsConfig,
|
102068
|
+
void 0
|
102069
|
+
);
|
102078
102070
|
}
|
102079
102071
|
__name(normalizeAndValidateAssets, "normalizeAndValidateAssets");
|
102080
102072
|
function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryPoint) {
|
@@ -102818,7 +102810,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
102818
102810
|
rawEnv,
|
102819
102811
|
envName,
|
102820
102812
|
"browser",
|
102821
|
-
|
102813
|
+
validateBrowserBinding(envName),
|
102822
102814
|
void 0
|
102823
102815
|
),
|
102824
102816
|
ai: notInheritable(
|
@@ -102831,16 +102823,6 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
102831
102823
|
validateAIBinding(envName),
|
102832
102824
|
void 0
|
102833
102825
|
),
|
102834
|
-
images: notInheritable(
|
102835
|
-
diagnostics,
|
102836
|
-
topLevelEnv,
|
102837
|
-
rawConfig,
|
102838
|
-
rawEnv,
|
102839
|
-
envName,
|
102840
|
-
"images",
|
102841
|
-
validateNamedSimpleBinding(envName),
|
102842
|
-
void 0
|
102843
|
-
),
|
102844
102826
|
pipelines: notInheritable(
|
102845
102827
|
diagnostics,
|
102846
102828
|
topLevelEnv,
|
@@ -103396,7 +103378,7 @@ var validateAssetsConfig = /* @__PURE__ */ __name((diagnostics, field, value) =>
|
|
103396
103378
|
]) && isValid2;
|
103397
103379
|
return isValid2;
|
103398
103380
|
}, "validateAssetsConfig");
|
103399
|
-
var
|
103381
|
+
var validateBrowserBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {
|
103400
103382
|
const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
|
103401
103383
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
103402
103384
|
diagnostics.errors.push(
|
@@ -103415,7 +103397,7 @@ var validateNamedSimpleBinding = /* @__PURE__ */ __name((envName) => (diagnostic
|
|
103415
103397
|
"binding"
|
103416
103398
|
]);
|
103417
103399
|
return isValid2;
|
103418
|
-
}, "
|
103400
|
+
}, "validateBrowserBinding");
|
103419
103401
|
var validateAIBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {
|
103420
103402
|
const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
|
103421
103403
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
@@ -104561,7 +104543,6 @@ var defaultWranglerConfig = {
|
|
104561
104543
|
services: [],
|
104562
104544
|
analytics_engine_datasets: [],
|
104563
104545
|
ai: void 0,
|
104564
|
-
images: void 0,
|
104565
104546
|
version_metadata: void 0,
|
104566
104547
|
/*====================================================*/
|
104567
104548
|
/* Fields supported by Workers only */
|
@@ -108963,218 +108944,12 @@ function withSourceURLs(entrypointPath, entrypointSource, modules) {
|
|
108963
108944
|
}
|
108964
108945
|
__name(withSourceURLs, "withSourceURLs");
|
108965
108946
|
|
108966
|
-
// src/images/fetcher.ts
|
108967
|
-
init_import_meta_url();
|
108968
|
-
var import_miniflare3 = require("miniflare");
|
108969
|
-
|
108970
|
-
// src/images/local.ts
|
108971
|
-
init_import_meta_url();
|
108972
|
-
var import_buffer = require("buffer");
|
108973
|
-
var import_sharp = __toESM(require("sharp"));
|
108974
|
-
function validateTransforms(inputTransforms) {
|
108975
|
-
if (!Array.isArray(inputTransforms)) {
|
108976
|
-
return null;
|
108977
|
-
}
|
108978
|
-
for (const transform of inputTransforms) {
|
108979
|
-
for (const key of ["imageIndex", "rotate", "width", "height"]) {
|
108980
|
-
if (transform[key] !== void 0 && typeof transform[key] != "number") {
|
108981
|
-
return null;
|
108982
|
-
}
|
108983
|
-
}
|
108984
|
-
}
|
108985
|
-
return inputTransforms;
|
108986
|
-
}
|
108987
|
-
__name(validateTransforms, "validateTransforms");
|
108988
|
-
async function imagesLocalFetcher(request4) {
|
108989
|
-
const data = await request4.formData();
|
108990
|
-
const body = data.get("image");
|
108991
|
-
if (!body || !(body instanceof import_buffer.File)) {
|
108992
|
-
return errorResponse(
|
108993
|
-
400,
|
108994
|
-
9523,
|
108995
|
-
`ERROR: Internal Images binding error: expected image in request, got ${body}`
|
108996
|
-
);
|
108997
|
-
}
|
108998
|
-
const transformer = (0, import_sharp.default)(await body.arrayBuffer(), {});
|
108999
|
-
const url4 = new URL(request4.url);
|
109000
|
-
if (url4.pathname == "/info") {
|
109001
|
-
return runInfo(transformer);
|
109002
|
-
} else {
|
109003
|
-
const badTransformsResponse = errorResponse(
|
109004
|
-
400,
|
109005
|
-
9523,
|
109006
|
-
"ERROR: Internal Images binding error: Expected JSON array of valid transforms in transforms field"
|
109007
|
-
);
|
109008
|
-
try {
|
109009
|
-
const transformsJson = data.get("transforms");
|
109010
|
-
if (typeof transformsJson !== "string") {
|
109011
|
-
return badTransformsResponse;
|
109012
|
-
}
|
109013
|
-
const transforms = validateTransforms(JSON.parse(transformsJson));
|
109014
|
-
if (transforms === null) {
|
109015
|
-
return badTransformsResponse;
|
109016
|
-
}
|
109017
|
-
const outputFormat = data.get("output_format");
|
109018
|
-
if (outputFormat != null && typeof outputFormat !== "string") {
|
109019
|
-
return errorResponse(
|
109020
|
-
400,
|
109021
|
-
9523,
|
109022
|
-
"ERROR: Internal Images binding error: Expected output format to be a string if provided"
|
109023
|
-
);
|
109024
|
-
}
|
109025
|
-
return runTransform(transformer, transforms, outputFormat);
|
109026
|
-
} catch (e7) {
|
109027
|
-
return badTransformsResponse;
|
109028
|
-
}
|
109029
|
-
}
|
109030
|
-
}
|
109031
|
-
__name(imagesLocalFetcher, "imagesLocalFetcher");
|
109032
|
-
async function runInfo(transformer) {
|
109033
|
-
const metadata = await transformer.metadata();
|
109034
|
-
let mime = null;
|
109035
|
-
switch (metadata.format) {
|
109036
|
-
case "jpeg":
|
109037
|
-
mime = "image/jpeg";
|
109038
|
-
break;
|
109039
|
-
case "svg":
|
109040
|
-
mime = "image/svg+xml";
|
109041
|
-
break;
|
109042
|
-
case "png":
|
109043
|
-
mime = "image/png";
|
109044
|
-
break;
|
109045
|
-
case "webp":
|
109046
|
-
mime = "image/webp";
|
109047
|
-
break;
|
109048
|
-
case "gif":
|
109049
|
-
mime = "image/gif";
|
109050
|
-
break;
|
109051
|
-
case "avif":
|
109052
|
-
mime = "image/avif";
|
109053
|
-
break;
|
109054
|
-
default:
|
109055
|
-
return errorResponse(
|
109056
|
-
415,
|
109057
|
-
9520,
|
109058
|
-
`ERROR: Unsupported image type ${metadata.format}, expected one of: JPEG, SVG, PNG, WebP, GIF or AVIF`
|
109059
|
-
);
|
109060
|
-
}
|
109061
|
-
let resp;
|
109062
|
-
if (mime == "image/svg+xml") {
|
109063
|
-
resp = {
|
109064
|
-
format: mime
|
109065
|
-
};
|
109066
|
-
} else {
|
109067
|
-
if (!metadata.size || !metadata.width || !metadata.height) {
|
109068
|
-
return errorResponse(
|
109069
|
-
500,
|
109070
|
-
9523,
|
109071
|
-
"ERROR: Internal Images binding error: Expected size, width and height for bitmap input"
|
109072
|
-
);
|
109073
|
-
}
|
109074
|
-
resp = {
|
109075
|
-
format: mime,
|
109076
|
-
fileSize: metadata.size,
|
109077
|
-
width: metadata.width,
|
109078
|
-
height: metadata.height
|
109079
|
-
};
|
109080
|
-
}
|
109081
|
-
return Response.json(resp);
|
109082
|
-
}
|
109083
|
-
__name(runInfo, "runInfo");
|
109084
|
-
async function runTransform(transformer, transforms, outputFormat) {
|
109085
|
-
for (const transform of transforms) {
|
109086
|
-
if (transform.imageIndex !== void 0 && transform.imageIndex !== 0) {
|
109087
|
-
continue;
|
109088
|
-
}
|
109089
|
-
if (transform.rotate !== void 0) {
|
109090
|
-
transformer.rotate(transform.rotate);
|
109091
|
-
}
|
109092
|
-
if (transform.width !== void 0 || transform.height !== void 0) {
|
109093
|
-
transformer.resize(transform.width || null, transform.height || null, {
|
109094
|
-
fit: "contain"
|
109095
|
-
});
|
109096
|
-
}
|
109097
|
-
}
|
109098
|
-
switch (outputFormat) {
|
109099
|
-
case "image/avif":
|
109100
|
-
transformer.avif();
|
109101
|
-
break;
|
109102
|
-
case "image/gif":
|
109103
|
-
return errorResponse(
|
109104
|
-
415,
|
109105
|
-
9520,
|
109106
|
-
"ERROR: GIF output is not supported in local mode"
|
109107
|
-
);
|
109108
|
-
case "image/jpeg":
|
109109
|
-
transformer.jpeg();
|
109110
|
-
break;
|
109111
|
-
case "image/png":
|
109112
|
-
transformer.png();
|
109113
|
-
break;
|
109114
|
-
case "image/webp":
|
109115
|
-
transformer.webp();
|
109116
|
-
break;
|
109117
|
-
case "rgb":
|
109118
|
-
case "rgba":
|
109119
|
-
return errorResponse(
|
109120
|
-
415,
|
109121
|
-
9520,
|
109122
|
-
"ERROR: RGB/RGBA output is not supported in local mode"
|
109123
|
-
);
|
109124
|
-
default:
|
109125
|
-
outputFormat = "image/jpeg";
|
109126
|
-
break;
|
109127
|
-
}
|
109128
|
-
return new Response(transformer, {
|
109129
|
-
headers: {
|
109130
|
-
"content-type": outputFormat
|
109131
|
-
}
|
109132
|
-
});
|
109133
|
-
}
|
109134
|
-
__name(runTransform, "runTransform");
|
109135
|
-
function errorResponse(status2, code, message) {
|
109136
|
-
return new Response(`ERROR ${code}: ${message}`, {
|
109137
|
-
status: status2,
|
109138
|
-
headers: {
|
109139
|
-
"content-type": "text/plain",
|
109140
|
-
"cf-images-binding": `err=${code}`
|
109141
|
-
}
|
109142
|
-
});
|
109143
|
-
}
|
109144
|
-
__name(errorResponse, "errorResponse");
|
109145
|
-
|
109146
|
-
// src/images/fetcher.ts
|
109147
|
-
var EXTERNAL_IMAGES_WORKER_NAME = "__WRANGLER_EXTERNAL_IMAGES_WORKER";
|
109148
|
-
var EXTERNAL_IMAGES_WORKER_SCRIPT = `
|
109149
|
-
import makeBinding from 'cloudflare-internal:images-api'
|
109150
|
-
|
109151
|
-
export default function (env) {
|
109152
|
-
return makeBinding({
|
109153
|
-
fetcher: env.FETCHER,
|
109154
|
-
});
|
109155
|
-
}
|
109156
|
-
`;
|
109157
|
-
async function imagesRemoteFetcher(request4) {
|
109158
|
-
const accountId = await getAccountId();
|
109159
|
-
const url4 = `/accounts/${accountId}/images_edge/v2/binding/preview${new URL(request4.url).pathname}`;
|
109160
|
-
const res = await performApiFetch(url4, {
|
109161
|
-
method: request4.method,
|
109162
|
-
body: request4.body,
|
109163
|
-
duplex: "half",
|
109164
|
-
headers: {
|
109165
|
-
"content-type": request4.headers.get("content-type") || ""
|
109166
|
-
}
|
109167
|
-
});
|
109168
|
-
return new import_miniflare3.Response(res.body, { headers: res.headers });
|
109169
|
-
}
|
109170
|
-
__name(imagesRemoteFetcher, "imagesRemoteFetcher");
|
109171
|
-
|
109172
108947
|
// src/sourcemap.ts
|
109173
108948
|
init_import_meta_url();
|
109174
108949
|
var import_node_assert4 = __toESM(require("node:assert"));
|
109175
108950
|
var import_node_fs8 = __toESM(require("node:fs"));
|
109176
108951
|
var import_node_url5 = __toESM(require("node:url"));
|
109177
|
-
var
|
108952
|
+
var import_miniflare3 = require("miniflare");
|
109178
108953
|
function maybeGetFile(filePath) {
|
109179
108954
|
try {
|
109180
108955
|
return import_node_fs8.default.readFileSync(filePath, "utf8");
|
@@ -109222,7 +108997,7 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
|
|
109222
108997
|
if (sourceMappingPrepareStackTrace !== void 0) {
|
109223
108998
|
return sourceMappingPrepareStackTrace;
|
109224
108999
|
}
|
109225
|
-
const support = (0,
|
109000
|
+
const support = (0, import_miniflare3.getFreshSourceMapSupport)();
|
109226
109001
|
const originalPrepareStackTrace = Error.prepareStackTrace;
|
109227
109002
|
support.install({
|
109228
109003
|
environment: "node",
|
@@ -109429,7 +109204,7 @@ __name(updateCheck, "updateCheck");
|
|
109429
109204
|
|
109430
109205
|
// src/vectorize/fetcher.ts
|
109431
109206
|
init_import_meta_url();
|
109432
|
-
var
|
109207
|
+
var import_miniflare4 = require("miniflare");
|
109433
109208
|
var EXTERNAL_VECTORIZE_WORKER_NAME = "__WRANGLER_EXTERNAL_VECTORIZE_WORKER";
|
109434
109209
|
var EXTERNAL_VECTORIZE_WORKER_SCRIPT = `
|
109435
109210
|
import makeBinding from 'cloudflare-internal:vectorize-api'
|
@@ -109462,7 +109237,7 @@ function MakeVectorizeFetcher(indexId) {
|
|
109462
109237
|
body: request4.body,
|
109463
109238
|
duplex: "half"
|
109464
109239
|
});
|
109465
|
-
const respHeaders = new
|
109240
|
+
const respHeaders = new import_miniflare4.Headers(res.headers);
|
109466
109241
|
respHeaders.delete("Host");
|
109467
109242
|
respHeaders.delete("Content-Length");
|
109468
109243
|
const apiResponse = await res.json();
|
@@ -109470,7 +109245,7 @@ function MakeVectorizeFetcher(indexId) {
|
|
109470
109245
|
error: apiResponse.errors[0].message,
|
109471
109246
|
code: apiResponse.errors[0].code
|
109472
109247
|
};
|
109473
|
-
return new
|
109248
|
+
return new import_miniflare4.Response(JSON.stringify(newResponse), {
|
109474
109249
|
status: res.status,
|
109475
109250
|
headers: respHeaders
|
109476
109251
|
});
|
@@ -109628,7 +109403,7 @@ export default {
|
|
109628
109403
|
}
|
109629
109404
|
}
|
109630
109405
|
`;
|
109631
|
-
var WranglerLog = class extends
|
109406
|
+
var WranglerLog = class extends import_miniflare5.Log {
|
109632
109407
|
#warnedCompatibilityDateFallback = false;
|
109633
109408
|
log(message) {
|
109634
109409
|
if (message.includes(EXTERNAL_SERVICE_WORKER_NAME)) {
|
@@ -109673,13 +109448,13 @@ function castLogLevel(level) {
|
|
109673
109448
|
if (key === "LOG") {
|
109674
109449
|
key = "INFO";
|
109675
109450
|
}
|
109676
|
-
return
|
109451
|
+
return import_miniflare5.LogLevel[key];
|
109677
109452
|
}
|
109678
109453
|
__name(castLogLevel, "castLogLevel");
|
109679
109454
|
function buildLog() {
|
109680
109455
|
let level = castLogLevel(logger.loggerLevel);
|
109681
|
-
if (level <=
|
109682
|
-
level = Math.min(level,
|
109456
|
+
if (level <= import_miniflare5.LogLevel.DEBUG) {
|
109457
|
+
level = Math.min(level, import_miniflare5.LogLevel.WARN);
|
109683
109458
|
}
|
109684
109459
|
return new WranglerLog(level, { prefix: "wrangler-UserWorker" });
|
109685
109460
|
}
|
@@ -109819,7 +109594,7 @@ function buildMiniflareBindingOptions(config) {
|
|
109819
109594
|
};
|
109820
109595
|
} else {
|
109821
109596
|
let address;
|
109822
|
-
let style =
|
109597
|
+
let style = import_miniflare5.HttpOptions_Style.PROXY;
|
109823
109598
|
if (service.entrypoint !== void 0) {
|
109824
109599
|
if (target.entrypointAddresses === void 0) {
|
109825
109600
|
throw new UserError(
|
@@ -109842,7 +109617,7 @@ function buildMiniflareBindingOptions(config) {
|
|
109842
109617
|
);
|
109843
109618
|
}
|
109844
109619
|
address = `${target.host}:${target.port}`;
|
109845
|
-
style =
|
109620
|
+
style = import_miniflare5.HttpOptions_Style.HOST;
|
109846
109621
|
} else {
|
109847
109622
|
address = `${defaultEntrypointAddress.host}:${defaultEntrypointAddress.port}`;
|
109848
109623
|
}
|
@@ -109852,7 +109627,7 @@ function buildMiniflareBindingOptions(config) {
|
|
109852
109627
|
address,
|
109853
109628
|
http: {
|
109854
109629
|
style,
|
109855
|
-
cfBlobHeader:
|
109630
|
+
cfBlobHeader: import_miniflare5.CoreHeaders.CF_BLOB
|
109856
109631
|
}
|
109857
109632
|
}
|
109858
109633
|
};
|
@@ -109935,24 +109710,6 @@ function buildMiniflareBindingOptions(config) {
|
|
109935
109710
|
scriptName: EXTERNAL_AI_WORKER_NAME
|
109936
109711
|
};
|
109937
109712
|
}
|
109938
|
-
if (bindings.images?.binding) {
|
109939
|
-
externalWorkers.push({
|
109940
|
-
name: EXTERNAL_IMAGES_WORKER_NAME,
|
109941
|
-
modules: [
|
109942
|
-
{
|
109943
|
-
type: "ESModule",
|
109944
|
-
path: "index.mjs",
|
109945
|
-
contents: EXTERNAL_IMAGES_WORKER_SCRIPT
|
109946
|
-
}
|
109947
|
-
],
|
109948
|
-
serviceBindings: {
|
109949
|
-
FETCHER: config.imagesLocalMode ? imagesLocalFetcher : imagesRemoteFetcher
|
109950
|
-
}
|
109951
|
-
});
|
109952
|
-
wrappedBindings[bindings.images?.binding] = {
|
109953
|
-
scriptName: EXTERNAL_IMAGES_WORKER_NAME
|
109954
|
-
};
|
109955
|
-
}
|
109956
109713
|
if (bindings.vectorize) {
|
109957
109714
|
for (const vectorizeBinding of bindings.vectorize) {
|
109958
109715
|
const bindingName = vectorizeBinding.binding;
|
@@ -110167,7 +109924,6 @@ __name(handleRuntimeStdio, "handleRuntimeStdio");
|
|
110167
109924
|
var didWarnMiniflareCronSupport = false;
|
110168
109925
|
var didWarnMiniflareVectorizeSupport = false;
|
110169
109926
|
var didWarnAiAccountUsage = false;
|
110170
|
-
var didWarnImagesLocalModeUsage = false;
|
110171
109927
|
async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticationSecret) {
|
110172
109928
|
if (config.crons.length > 0 && !config.testScheduled) {
|
110173
109929
|
if (!didWarnMiniflareCronSupport) {
|
@@ -110199,14 +109955,6 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
|
|
110199
109955
|
);
|
110200
109956
|
}
|
110201
109957
|
}
|
110202
|
-
if (config.bindings.images && config.imagesLocalMode) {
|
110203
|
-
if (!didWarnImagesLocalModeUsage) {
|
110204
|
-
didWarnImagesLocalModeUsage = true;
|
110205
|
-
logger.info(
|
110206
|
-
"You are using Images local mode. This only supports resizing, rotating and transcoding."
|
110207
|
-
);
|
110208
|
-
}
|
110209
|
-
}
|
110210
109958
|
const upstream = typeof config.localUpstream === "string" ? `${config.upstreamProtocol}://${config.localUpstream}` : void 0;
|
110211
109959
|
const { sourceOptions, entrypointNames } = await buildSourceOptions(config);
|
110212
109960
|
const { bindingOptions, internalObjects, externalWorkers } = buildMiniflareBindingOptions(config);
|
@@ -110269,7 +110017,7 @@ __name(castErrorCause, "castErrorCause");
|
|
110269
110017
|
init_import_meta_url();
|
110270
110018
|
var import_node_crypto5 = require("node:crypto");
|
110271
110019
|
var import_promises6 = require("node:fs/promises");
|
110272
|
-
var
|
110020
|
+
var import_miniflare6 = require("miniflare");
|
110273
110021
|
|
110274
110022
|
// src/api/startDevWorker/BaseController.ts
|
110275
110023
|
init_import_meta_url();
|
@@ -110448,11 +110196,6 @@ function convertCfWorkerInitBindingstoBindings(inputBindings) {
|
|
110448
110196
|
output[binding] = { type: "ai", ...x6 };
|
110449
110197
|
break;
|
110450
110198
|
}
|
110451
|
-
case "images": {
|
110452
|
-
const { binding, ...x6 } = info;
|
110453
|
-
output[binding] = { type: "images", ...x6 };
|
110454
|
-
break;
|
110455
|
-
}
|
110456
110199
|
case "version_metadata": {
|
110457
110200
|
const { binding, ...x6 } = info;
|
110458
110201
|
output[binding] = { type: "version_metadata", ...x6 };
|
@@ -110503,7 +110246,6 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
|
|
110503
110246
|
text_blobs: void 0,
|
110504
110247
|
browser: void 0,
|
110505
110248
|
ai: void 0,
|
110506
|
-
images: void 0,
|
110507
110249
|
version_metadata: void 0,
|
110508
110250
|
data_blobs: void 0,
|
110509
110251
|
durable_objects: void 0,
|
@@ -110555,8 +110297,6 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
|
|
110555
110297
|
bindings.browser = { binding: name2 };
|
110556
110298
|
} else if (binding.type === "ai") {
|
110557
110299
|
bindings.ai = { binding: name2 };
|
110558
|
-
} else if (binding.type === "images") {
|
110559
|
-
bindings.images = { binding: name2 };
|
110560
110300
|
} else if (binding.type === "version_metadata") {
|
110561
110301
|
bindings.version_metadata = { binding: name2 };
|
110562
110302
|
} else if (binding.type === "durable_object_namespace") {
|
@@ -110728,7 +110468,6 @@ async function convertToConfigBundle(event) {
|
|
110728
110468
|
services: bindings.services,
|
110729
110469
|
serviceBindings: fetchers,
|
110730
110470
|
bindVectorizeToProd: event.config.dev?.bindVectorizeToProd ?? false,
|
110731
|
-
imagesLocalMode: event.config.dev?.imagesLocalMode ?? false,
|
110732
110471
|
testScheduled: !!event.config.dev.testScheduled
|
110733
110472
|
};
|
110734
110473
|
}
|
@@ -110746,7 +110485,7 @@ var LocalRuntimeController = class extends RuntimeController {
|
|
110746
110485
|
// `buildMiniflareOptions()` is asynchronous, meaning if multiple bundle
|
110747
110486
|
// updates were submitted, the second may apply before the first. Therefore,
|
110748
110487
|
// wrap updates in a mutex, so they're always applied in invocation order.
|
110749
|
-
#mutex = new
|
110488
|
+
#mutex = new import_miniflare6.Mutex();
|
110750
110489
|
#mf;
|
110751
110490
|
onBundleStart(_4) {
|
110752
110491
|
}
|
@@ -110760,7 +110499,7 @@ var LocalRuntimeController = class extends RuntimeController {
|
|
110760
110499
|
options30.liveReload = false;
|
110761
110500
|
if (this.#mf === void 0) {
|
110762
110501
|
logger.log(source_default.dim("\u2394 Starting local server..."));
|
110763
|
-
this.#mf = new
|
110502
|
+
this.#mf = new import_miniflare6.Miniflare(options30);
|
110764
110503
|
} else {
|
110765
110504
|
logger.log(source_default.dim("\u2394 Reloading local server..."));
|
110766
110505
|
await this.#mf.setOptions(options30);
|
@@ -110897,7 +110636,7 @@ var MultiworkerRuntimeController = class extends LocalRuntimeController {
|
|
110897
110636
|
// `buildMiniflareOptions()` is asynchronous, meaning if multiple bundle
|
110898
110637
|
// updates were submitted, the second may apply before the first. Therefore,
|
110899
110638
|
// wrap updates in a mutex, so they're always applied in invocation order.
|
110900
|
-
#mutex = new
|
110639
|
+
#mutex = new import_miniflare7.Mutex();
|
110901
110640
|
#mf;
|
110902
110641
|
#options = /* @__PURE__ */ new Map();
|
110903
110642
|
#canStartMiniflare() {
|
@@ -110935,7 +110674,7 @@ var MultiworkerRuntimeController = class extends LocalRuntimeController {
|
|
110935
110674
|
const mergedMfOptions = ensureMatchingSql(this.#mergedMfOptions());
|
110936
110675
|
if (this.#mf === void 0) {
|
110937
110676
|
logger.log(source_default.dim("\u2394 Starting local server..."));
|
110938
|
-
this.#mf = new
|
110677
|
+
this.#mf = new import_miniflare7.Miniflare(mergedMfOptions);
|
110939
110678
|
} else {
|
110940
110679
|
logger.log(source_default.dim("\u2394 Reloading local server..."));
|
110941
110680
|
await this.#mf.setOptions(mergedMfOptions);
|
@@ -111033,7 +110772,7 @@ var import_node_assert9 = __toESM(require("node:assert"));
|
|
111033
110772
|
var import_node_crypto7 = require("node:crypto");
|
111034
110773
|
var import_node_events2 = __toESM(require("node:events"));
|
111035
110774
|
var import_node_path18 = __toESM(require("node:path"));
|
111036
|
-
var
|
110775
|
+
var import_miniflare9 = require("miniflare");
|
111037
110776
|
|
111038
110777
|
// embed-worker:/home/runner/work/workers-sdk/workers-sdk/packages/wrangler/templates/startDevWorker/InspectorProxyWorker.ts
|
111039
110778
|
init_import_meta_url();
|
@@ -111344,7 +111083,7 @@ var openInspector = /* @__PURE__ */ __name(async (inspectorPort, worker) => {
|
|
111344
111083
|
init_import_meta_url();
|
111345
111084
|
var fs9 = __toESM(require("node:fs"));
|
111346
111085
|
var path20 = __toESM(require("node:path"));
|
111347
|
-
var
|
111086
|
+
var import_miniflare8 = require("miniflare");
|
111348
111087
|
var CERT_EXPIRY_DAYS = 30;
|
111349
111088
|
var ONE_DAY_IN_MS = 864e5;
|
111350
111089
|
var getHttpsKeyPathFromEnv = getEnvironmentVariableFactory({
|
@@ -111444,7 +111183,7 @@ function generateCertificate() {
|
|
111444
111183
|
name: "subjectAltName",
|
111445
111184
|
altNames: [
|
111446
111185
|
{ type: 2, value: "localhost" },
|
111447
|
-
...(0,
|
111186
|
+
...(0, import_miniflare8.getAccessibleHosts)(false).map((ip) => ({ type: 7, ip }))
|
111448
111187
|
]
|
111449
111188
|
}
|
111450
111189
|
]
|
@@ -111495,7 +111234,7 @@ var ProxyController = class extends Controller {
|
|
111495
111234
|
PROXY_CONTROLLER: async (req) => {
|
111496
111235
|
const message = await req.json();
|
111497
111236
|
this.onProxyWorkerMessage(message);
|
111498
|
-
return new
|
111237
|
+
return new import_miniflare9.Response(null, { status: 204 });
|
111499
111238
|
}
|
111500
111239
|
},
|
111501
111240
|
bindings: {
|
@@ -111556,7 +111295,7 @@ var ProxyController = class extends Controller {
|
|
111556
111295
|
proxyWorkerOptions
|
111557
111296
|
);
|
111558
111297
|
const willInstantiateMiniflareInstance = !this.proxyWorker || proxyWorkerOptionsChanged;
|
111559
|
-
this.proxyWorker ??= new
|
111298
|
+
this.proxyWorker ??= new import_miniflare9.Miniflare(proxyWorkerOptions);
|
111560
111299
|
this.proxyWorkerOptions = proxyWorkerOptions;
|
111561
111300
|
if (proxyWorkerOptionsChanged) {
|
111562
111301
|
logger.debug("ProxyWorker miniflare options changed, reinstantiating...");
|
@@ -111638,7 +111377,7 @@ var ProxyController = class extends Controller {
|
|
111638
111377
|
this.inspectorProxyWorkerWebSocket?.resolve(webSocket);
|
111639
111378
|
return webSocket;
|
111640
111379
|
}
|
111641
|
-
runtimeMessageMutex = new
|
111380
|
+
runtimeMessageMutex = new import_miniflare9.Mutex();
|
111642
111381
|
async sendMessageToProxyWorker(message, retries = 3) {
|
111643
111382
|
if (this._torndown) {
|
111644
111383
|
return;
|
@@ -111791,15 +111530,15 @@ var ProxyController = class extends Controller {
|
|
111791
111530
|
);
|
111792
111531
|
}
|
111793
111532
|
if (maybeContents === void 0) {
|
111794
|
-
return new
|
111533
|
+
return new import_miniflare9.Response(null, { status: 404 });
|
111795
111534
|
}
|
111796
|
-
return new
|
111535
|
+
return new import_miniflare9.Response(maybeContents);
|
111797
111536
|
}
|
111798
111537
|
default:
|
111799
111538
|
assertNever(message);
|
111800
|
-
return new
|
111539
|
+
return new import_miniflare9.Response(null, { status: 404 });
|
111801
111540
|
}
|
111802
|
-
return new
|
111541
|
+
return new import_miniflare9.Response(null, { status: 204 });
|
111803
111542
|
}
|
111804
111543
|
_torndown = false;
|
111805
111544
|
async teardown() {
|
@@ -111852,7 +111591,7 @@ var ProxyController = class extends Controller {
|
|
111852
111591
|
__name(ProxyController, "ProxyController");
|
111853
111592
|
var ProxyControllerLogger = class extends WranglerLog {
|
111854
111593
|
log(message) {
|
111855
|
-
if (message.includes("/cdn-cgi/") && this.level <
|
111594
|
+
if (message.includes("/cdn-cgi/") && this.level < import_miniflare9.LogLevel.DEBUG) {
|
111856
111595
|
return;
|
111857
111596
|
}
|
111858
111597
|
super.log(message);
|
@@ -116522,7 +116261,7 @@ var getDatabaseInfoFromIdOrName = /* @__PURE__ */ __name(async (accountId, datab
|
|
116522
116261
|
init_import_meta_url();
|
116523
116262
|
var import_node_buffer = require("node:buffer");
|
116524
116263
|
var import_node_url8 = require("node:url");
|
116525
|
-
var
|
116264
|
+
var import_miniflare11 = require("miniflare");
|
116526
116265
|
var import_undici4 = __toESM(require_undici());
|
116527
116266
|
|
116528
116267
|
// src/dev/get-local-persistence-path.ts
|
@@ -116793,7 +116532,7 @@ __name(getKVNamespaceId, "getKVNamespaceId");
|
|
116793
116532
|
async function usingLocalNamespace(persistTo, config, namespaceId, closure) {
|
116794
116533
|
const persist = getLocalPersistencePath(persistTo, config);
|
116795
116534
|
const persistOptions = buildPersistOptions(persist);
|
116796
|
-
const mf = new
|
116535
|
+
const mf = new import_miniflare11.Miniflare({
|
116797
116536
|
script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
|
116798
116537
|
...persistOptions,
|
116799
116538
|
kvNamespaces: { NAMESPACE: namespaceId }
|
@@ -116811,7 +116550,7 @@ __name(usingLocalNamespace, "usingLocalNamespace");
|
|
116811
116550
|
init_import_meta_url();
|
116812
116551
|
var fs10 = __toESM(require("node:fs"));
|
116813
116552
|
var import_web = require("node:stream/web");
|
116814
|
-
var
|
116553
|
+
var import_miniflare13 = require("miniflare");
|
116815
116554
|
|
116816
116555
|
// src/queues/client.ts
|
116817
116556
|
init_import_meta_url();
|
@@ -117251,7 +116990,7 @@ __name(deleteR2Object, "deleteR2Object");
|
|
117251
116990
|
async function usingLocalBucket(persistTo, config, bucketName, closure) {
|
117252
116991
|
const persist = getLocalPersistencePath(persistTo, config);
|
117253
116992
|
const persistOptions = buildPersistOptions(persist);
|
117254
|
-
const mf = new
|
116993
|
+
const mf = new import_miniflare13.Miniflare({
|
117255
116994
|
modules: true,
|
117256
116995
|
// TODO(soon): import `reduceError()` from `miniflare:shared`
|
117257
116996
|
script: `
|
@@ -117790,7 +117529,6 @@ function getBindings(config, options30) {
|
|
117790
117529
|
wasm_modules: options30?.pages ? void 0 : config?.wasm_modules,
|
117791
117530
|
browser: config?.browser,
|
117792
117531
|
ai: config?.ai,
|
117793
|
-
images: config?.images,
|
117794
117532
|
version_metadata: config?.version_metadata,
|
117795
117533
|
text_blobs: options30?.pages ? void 0 : config?.text_blobs,
|
117796
117534
|
data_blobs: options30?.pages ? void 0 : config?.data_blobs,
|
@@ -119524,12 +119262,6 @@ function createWorkerUploadForm(worker) {
|
|
119524
119262
|
type: "ai"
|
119525
119263
|
});
|
119526
119264
|
}
|
119527
|
-
if (bindings.images !== void 0) {
|
119528
|
-
metadataBindings.push({
|
119529
|
-
name: bindings.images.binding,
|
119530
|
-
type: "images"
|
119531
|
-
});
|
119532
|
-
}
|
119533
119265
|
if (bindings.version_metadata !== void 0) {
|
119534
119266
|
metadataBindings.push({
|
119535
119267
|
name: bindings.version_metadata.binding,
|
@@ -119741,7 +119473,7 @@ __name(logBuildOutput, "logBuildOutput");
|
|
119741
119473
|
|
119742
119474
|
// src/deployment-bundle/node-compat.ts
|
119743
119475
|
init_import_meta_url();
|
119744
|
-
var
|
119476
|
+
var import_miniflare15 = require("miniflare");
|
119745
119477
|
function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibilityFlags, {
|
119746
119478
|
nodeCompat: legacy = false,
|
119747
119479
|
noBundle = void 0
|
@@ -119752,7 +119484,7 @@ function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibili
|
|
119752
119484
|
hasNodejsCompatFlag,
|
119753
119485
|
hasNodejsCompatV2Flag,
|
119754
119486
|
hasExperimentalNodejsCompatV2Flag
|
119755
|
-
} = (0,
|
119487
|
+
} = (0, import_miniflare15.getNodeCompat)(compatibilityDateStr, compatibilityFlags, {
|
119756
119488
|
nodeCompat: legacy
|
119757
119489
|
});
|
119758
119490
|
if (hasExperimentalNodejsCompatV2Flag) {
|
@@ -123785,7 +123517,7 @@ init_import_meta_url();
|
|
123785
123517
|
// src/cli-hotkeys.ts
|
123786
123518
|
init_import_meta_url();
|
123787
123519
|
var import_readline = __toESM(require("readline"));
|
123788
|
-
var
|
123520
|
+
var import_miniflare16 = require("miniflare");
|
123789
123521
|
|
123790
123522
|
// src/utils/onKeyPress.ts
|
123791
123523
|
init_import_meta_url();
|
@@ -123879,16 +123611,16 @@ function cli_hotkeys_default(options30) {
|
|
123879
123611
|
__name(printInstructions, "printInstructions");
|
123880
123612
|
Logger.registerBeforeLogHook(clearPreviousInstructions);
|
123881
123613
|
Logger.registerAfterLogHook(printInstructions);
|
123882
|
-
|
123883
|
-
|
123614
|
+
import_miniflare16.Log.unstable_registerBeforeLogHook(clearPreviousInstructions);
|
123615
|
+
import_miniflare16.Log.unstable_registerAfterLogHook(printInstructions);
|
123884
123616
|
printInstructions();
|
123885
123617
|
return () => {
|
123886
123618
|
unregisterKeyPress();
|
123887
123619
|
clearPreviousInstructions();
|
123888
123620
|
Logger.registerBeforeLogHook(void 0);
|
123889
123621
|
Logger.registerAfterLogHook(void 0);
|
123890
|
-
|
123891
|
-
|
123622
|
+
import_miniflare16.Log.unstable_registerBeforeLogHook(void 0);
|
123623
|
+
import_miniflare16.Log.unstable_registerAfterLogHook(void 0);
|
123892
123624
|
};
|
123893
123625
|
}
|
123894
123626
|
__name(cli_hotkeys_default, "default");
|
@@ -124269,11 +124001,6 @@ var dev = createCommand({
|
|
124269
124001
|
type: "boolean",
|
124270
124002
|
describe: "Bind to production Vectorize indexes in local development mode",
|
124271
124003
|
default: false
|
124272
|
-
},
|
124273
|
-
"experimental-images-local-mode": {
|
124274
|
-
type: "boolean",
|
124275
|
-
describe: "Use a local lower-fidelity implementation of the Images binding",
|
124276
|
-
default: false
|
124277
124004
|
}
|
124278
124005
|
},
|
124279
124006
|
async validateArgs(args) {
|
@@ -124413,7 +124140,6 @@ async function setupDevEnv(devEnv, configPath, auth, args) {
|
|
124413
124140
|
text_blobs: void 0,
|
124414
124141
|
browser: void 0,
|
124415
124142
|
ai: args.ai,
|
124416
|
-
images: void 0,
|
124417
124143
|
version_metadata: args.version_metadata,
|
124418
124144
|
data_blobs: void 0,
|
124419
124145
|
durable_objects: { bindings: args.durableObjects ?? [] },
|
@@ -124456,7 +124182,6 @@ async function setupDevEnv(devEnv, configPath, auth, args) {
|
|
124456
124182
|
logLevel: args.logLevel,
|
124457
124183
|
registry: args.disableDevRegistry ? null : devEnv.config.latestConfig?.dev.registry,
|
124458
124184
|
bindVectorizeToProd: args.experimentalVectorizeBindToProd,
|
124459
|
-
imagesLocalMode: args.experimentalImagesLocalMode,
|
124460
124185
|
multiworkerPrimary: args.multiworkerPrimary
|
124461
124186
|
},
|
124462
124187
|
legacy: {
|
@@ -124818,7 +124543,6 @@ function getBindings2(configParam, env7, local, args) {
|
|
124818
124543
|
analytics_engine_datasets: configParam.analytics_engine_datasets,
|
124819
124544
|
browser: configParam.browser,
|
124820
124545
|
ai: args.ai || configParam.ai,
|
124821
|
-
images: configParam.images,
|
124822
124546
|
version_metadata: args.version_metadata || configParam.version_metadata,
|
124823
124547
|
unsafe: {
|
124824
124548
|
bindings: configParam.unsafe.bindings,
|
@@ -124877,7 +124601,6 @@ async function unstable_dev(script, options30, apiOptions) {
|
|
124877
124601
|
testMode,
|
124878
124602
|
testScheduled,
|
124879
124603
|
vectorizeBindToProd,
|
124880
|
-
imagesLocalMode,
|
124881
124604
|
// 2. options for alpha/beta products/libs
|
124882
124605
|
d1Databases,
|
124883
124606
|
enablePagesAssetsServiceBinding
|
@@ -124968,7 +124691,6 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
124968
124691
|
port: options30?.port ?? 0,
|
124969
124692
|
experimentalProvision: void 0,
|
124970
124693
|
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
|
124971
|
-
experimentalImagesLocalMode: imagesLocalMode ?? false,
|
124972
124694
|
enableIpc: options30?.experimental?.enableIpc
|
124973
124695
|
};
|
124974
124696
|
const devServer = await run(
|
@@ -127530,8 +127252,7 @@ async function resolveDevConfig(config, input) {
|
|
127530
127252
|
persist: localPersistencePath,
|
127531
127253
|
registry: input.dev?.registry,
|
127532
127254
|
bindVectorizeToProd: input.dev?.bindVectorizeToProd ?? false,
|
127533
|
-
multiworkerPrimary: input.dev?.multiworkerPrimary
|
127534
|
-
imagesLocalMode: input.dev?.imagesLocalMode ?? false
|
127255
|
+
multiworkerPrimary: input.dev?.multiworkerPrimary
|
127535
127256
|
};
|
127536
127257
|
}
|
127537
127258
|
__name(resolveDevConfig, "resolveDevConfig");
|
@@ -127566,7 +127287,6 @@ async function resolveBindings(config, input) {
|
|
127566
127287
|
{
|
127567
127288
|
registry: input.dev?.registry,
|
127568
127289
|
local: !input.dev?.remote,
|
127569
|
-
imagesLocalMode: input.dev?.imagesLocalMode,
|
127570
127290
|
name: config.name
|
127571
127291
|
}
|
127572
127292
|
);
|
@@ -127820,7 +127540,7 @@ __name(ConfigController, "ConfigController");
|
|
127820
127540
|
|
127821
127541
|
// src/api/startDevWorker/RemoteRuntimeController.ts
|
127822
127542
|
init_import_meta_url();
|
127823
|
-
var
|
127543
|
+
var import_miniflare18 = require("miniflare");
|
127824
127544
|
|
127825
127545
|
// src/dev/create-worker-preview.ts
|
127826
127546
|
init_import_meta_url();
|
@@ -128174,7 +127894,7 @@ __name(notImplemented, "notImplemented");
|
|
128174
127894
|
var RemoteRuntimeController = class extends RuntimeController {
|
128175
127895
|
#abortController = new AbortController();
|
128176
127896
|
#currentBundleId = 0;
|
128177
|
-
#mutex = new
|
127897
|
+
#mutex = new import_miniflare18.Mutex();
|
128178
127898
|
#session;
|
128179
127899
|
async #previewSession(props) {
|
128180
127900
|
try {
|
@@ -128567,7 +128287,7 @@ init_import_meta_url();
|
|
128567
128287
|
|
128568
128288
|
// src/api/integrations/platform/index.ts
|
128569
128289
|
init_import_meta_url();
|
128570
|
-
var
|
128290
|
+
var import_miniflare20 = require("miniflare");
|
128571
128291
|
|
128572
128292
|
// src/api/integrations/platform/caches.ts
|
128573
128293
|
init_import_meta_url();
|
@@ -128628,7 +128348,7 @@ __name(ExecutionContext, "ExecutionContext");
|
|
128628
128348
|
|
128629
128349
|
// src/api/integrations/platform/services.ts
|
128630
128350
|
init_import_meta_url();
|
128631
|
-
var
|
128351
|
+
var import_miniflare19 = require("miniflare");
|
128632
128352
|
var import_undici13 = __toESM(require_undici());
|
128633
128353
|
async function getServiceBindings(services = []) {
|
128634
128354
|
if (services.length === 0) {
|
@@ -128680,9 +128400,9 @@ function getServiceBindingProxyFetch({
|
|
128680
128400
|
try {
|
128681
128401
|
const resp = await (0, import_undici13.fetch)(newUrl, request4);
|
128682
128402
|
const respBody = await resp.arrayBuffer();
|
128683
|
-
return new
|
128403
|
+
return new import_miniflare19.Response(respBody, resp);
|
128684
128404
|
} catch {
|
128685
|
-
return new
|
128405
|
+
return new import_miniflare19.Response(
|
128686
128406
|
`Error: Unable to fetch from external service (${serviceName} bound with ${bindingName} binding), please make sure that the service is still running with \`wrangler dev\``,
|
128687
128407
|
{ status: 500 }
|
128688
128408
|
);
|
@@ -128713,7 +128433,7 @@ async function getPlatformProxy(options30 = {}) {
|
|
128713
128433
|
},
|
128714
128434
|
() => getMiniflareOptionsFromConfig(rawConfig, env7, options30)
|
128715
128435
|
);
|
128716
|
-
const mf = new
|
128436
|
+
const mf = new import_miniflare20.Miniflare({
|
128717
128437
|
script: "",
|
128718
128438
|
modules: true,
|
128719
128439
|
...miniflareOptions
|
@@ -128744,8 +128464,7 @@ async function getMiniflareOptionsFromConfig(rawConfig, env7, options30) {
|
|
128744
128464
|
queueConsumers: void 0,
|
128745
128465
|
services: rawConfig.services,
|
128746
128466
|
serviceBindings: {},
|
128747
|
-
migrations: rawConfig.migrations
|
128748
|
-
imagesLocalMode: false
|
128467
|
+
migrations: rawConfig.migrations
|
128749
128468
|
});
|
128750
128469
|
const persistOptions = getMiniflarePersistOptions(options30.persist);
|
128751
128470
|
const serviceBindings = await getServiceBindings(bindings.services);
|
@@ -128812,13 +128531,12 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env7) {
|
|
128812
128531
|
queueConsumers: config.queues.consumers,
|
128813
128532
|
services: [],
|
128814
128533
|
serviceBindings: {},
|
128815
|
-
migrations: config.migrations
|
128816
|
-
imagesLocalMode: false
|
128534
|
+
migrations: config.migrations
|
128817
128535
|
});
|
128818
128536
|
if (bindings.services !== void 0) {
|
128819
128537
|
bindingOptions.serviceBindings = Object.fromEntries(
|
128820
128538
|
bindings.services.map((binding) => {
|
128821
|
-
const name2 = binding.service === config.name ?
|
128539
|
+
const name2 = binding.service === config.name ? import_miniflare20.kCurrentWorker : binding.service;
|
128822
128540
|
return [binding.binding, { name: name2, entrypoint: binding.entrypoint }];
|
128823
128541
|
})
|
128824
128542
|
);
|
@@ -140471,7 +140189,7 @@ var import_fs13 = require("fs");
|
|
140471
140189
|
var import_node_assert25 = __toESM(require("node:assert"));
|
140472
140190
|
var import_node_path54 = __toESM(require("node:path"));
|
140473
140191
|
var import_md5_file = __toESM(require_md5_file());
|
140474
|
-
var
|
140192
|
+
var import_miniflare22 = require("miniflare");
|
140475
140193
|
var import_undici16 = __toESM(require_undici());
|
140476
140194
|
|
140477
140195
|
// src/d1/splitter.ts
|
@@ -140807,7 +140525,7 @@ async function executeLocally({
|
|
140807
140525
|
logger.log(
|
140808
140526
|
"\u{1F300} To execute on your remote database, add a --remote flag to your wrangler command."
|
140809
140527
|
);
|
140810
|
-
const mf = new
|
140528
|
+
const mf = new import_miniflare22.Miniflare({
|
140811
140529
|
modules: true,
|
140812
140530
|
script: "",
|
140813
140531
|
d1Persist,
|
@@ -141070,7 +140788,7 @@ __name(checkForSQLiteBinary, "checkForSQLiteBinary");
|
|
141070
140788
|
init_import_meta_url();
|
141071
140789
|
var import_promises24 = __toESM(require("node:fs/promises"));
|
141072
140790
|
var import_node_path55 = __toESM(require("node:path"));
|
141073
|
-
var
|
140791
|
+
var import_miniflare23 = require("miniflare");
|
141074
140792
|
var import_undici17 = __toESM(require_undici());
|
141075
140793
|
function Options7(yargs) {
|
141076
140794
|
return Name(yargs).option("local", {
|
@@ -141139,7 +140857,7 @@ async function exportLocal(config, name2, output, tables, noSchema, noData) {
|
|
141139
140857
|
logger.log(
|
141140
140858
|
"\u{1F300} To export your remote database, add a --remote flag to your wrangler command."
|
141141
140859
|
);
|
141142
|
-
const mf = new
|
140860
|
+
const mf = new import_miniflare23.Miniflare({
|
141143
140861
|
modules: true,
|
141144
140862
|
script: "export default {}",
|
141145
140863
|
d1Persist,
|
@@ -144068,13 +143786,6 @@ async function mapBindings(accountId, bindings) {
|
|
144068
143786
|
};
|
144069
143787
|
}
|
144070
143788
|
break;
|
144071
|
-
case "images":
|
144072
|
-
{
|
144073
|
-
configObj.images = {
|
144074
|
-
binding: binding.name
|
144075
|
-
};
|
144076
|
-
}
|
144077
|
-
break;
|
144078
143789
|
case "r2_bucket":
|
144079
143790
|
{
|
144080
143791
|
configObj.r2_buckets = [
|
@@ -147703,11 +147414,6 @@ function Options14(yargs) {
|
|
147703
147414
|
type: "boolean",
|
147704
147415
|
describe: "Bind to production Vectorize indexes in local development mode",
|
147705
147416
|
default: false
|
147706
|
-
},
|
147707
|
-
"experimental-images-local-mode": {
|
147708
|
-
type: "boolean",
|
147709
|
-
describe: "Use a local lower-fidelity implementation of the Images binding",
|
147710
|
-
default: false
|
147711
147417
|
}
|
147712
147418
|
});
|
147713
147419
|
}
|
@@ -148148,7 +147854,6 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
148148
147854
|
logLevel: args.logLevel ?? "log",
|
148149
147855
|
experimentalProvision: void 0,
|
148150
147856
|
experimentalVectorizeBindToProd: false,
|
148151
|
-
experimentalImagesLocalMode: false,
|
148152
147857
|
enableIpc: true,
|
148153
147858
|
config: Array.isArray(args.config) ? args.config : void 0,
|
148154
147859
|
legacyAssets: void 0,
|
@@ -148434,12 +148139,12 @@ init_import_meta_url();
|
|
148434
148139
|
var import_fs14 = require("fs");
|
148435
148140
|
var import_promises28 = require("node:fs/promises");
|
148436
148141
|
var import_toml8 = __toESM(require_toml());
|
148437
|
-
var
|
148142
|
+
var import_miniflare24 = require("miniflare");
|
148438
148143
|
async function toEnvironment(deploymentConfig, accountId) {
|
148439
148144
|
const configObj = {};
|
148440
148145
|
configObj.compatibility_date = deploymentConfig.compatibility_date ?? (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
148441
148146
|
if (deploymentConfig.always_use_latest_compatibility_date) {
|
148442
|
-
configObj.compatibility_date =
|
148147
|
+
configObj.compatibility_date = import_miniflare24.supportedCompatibilityDate;
|
148443
148148
|
}
|
148444
148149
|
if (deploymentConfig.compatibility_flags?.length) {
|
148445
148150
|
configObj.compatibility_flags = deploymentConfig.compatibility_flags;
|
@@ -148797,7 +148502,6 @@ async function createDraftWorker({
|
|
148797
148502
|
wasm_modules: {},
|
148798
148503
|
browser: void 0,
|
148799
148504
|
ai: void 0,
|
148800
|
-
images: void 0,
|
148801
148505
|
version_metadata: void 0,
|
148802
148506
|
text_blobs: {},
|
148803
148507
|
data_blobs: {},
|
@@ -149821,12 +149525,12 @@ init_import_meta_url();
|
|
149821
149525
|
init_import_meta_url();
|
149822
149526
|
|
149823
149527
|
// ../../node_modules/.pnpm/@smithy+util-buffer-from@2.2.0/node_modules/@smithy/util-buffer-from/dist-es/index.js
|
149824
|
-
var
|
149528
|
+
var import_buffer2 = require("buffer");
|
149825
149529
|
var fromString2 = /* @__PURE__ */ __name((input, encoding) => {
|
149826
149530
|
if (typeof input !== "string") {
|
149827
149531
|
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
|
149828
149532
|
}
|
149829
|
-
return encoding ?
|
149533
|
+
return encoding ? import_buffer2.Buffer.from(input, encoding) : import_buffer2.Buffer.from(input);
|
149830
149534
|
}, "fromString");
|
149831
149535
|
|
149832
149536
|
// ../../node_modules/.pnpm/@smithy+util-utf8@2.3.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
|
@@ -166215,13 +165919,13 @@ __name(triggersDeployHandler, "triggersDeployHandler");
|
|
166215
165919
|
init_import_meta_url();
|
166216
165920
|
var fs28 = __toESM(require("node:fs"));
|
166217
165921
|
var import_node_path66 = require("node:path");
|
166218
|
-
var
|
165922
|
+
var import_miniflare26 = require("miniflare");
|
166219
165923
|
|
166220
165924
|
// src/type-generation/runtime/index.ts
|
166221
165925
|
init_import_meta_url();
|
166222
165926
|
var import_fs23 = require("fs");
|
166223
165927
|
var import_promises32 = require("fs/promises");
|
166224
|
-
var
|
165928
|
+
var import_miniflare25 = require("miniflare");
|
166225
165929
|
var import_workerd = require("workerd");
|
166226
165930
|
var DEFAULT_OUTFILE_RELATIVE_PATH = "./.wrangler/types/runtime.d.ts";
|
166227
165931
|
async function generateRuntimeTypes({
|
@@ -166263,7 +165967,7 @@ async function generate({
|
|
166263
165967
|
compatibilityFlags = []
|
166264
165968
|
}) {
|
166265
165969
|
const worker = (0, import_fs23.readFileSync)(require.resolve("workerd/worker.mjs")).toString();
|
166266
|
-
const mf = new
|
165970
|
+
const mf = new import_miniflare25.Miniflare({
|
166267
165971
|
compatibilityDate: "2024-01-01",
|
166268
165972
|
compatibilityFlags: ["nodejs_compat", "rtti_api"],
|
166269
165973
|
modules: true,
|
@@ -166405,7 +166109,7 @@ var typesCommand = createCommand({
|
|
166405
166109
|
});
|
166406
166110
|
const tsconfigPath = config.tsconfig ?? (0, import_node_path66.join)((0, import_node_path66.dirname)(config.configPath), "tsconfig.json");
|
166407
166111
|
const tsconfigTypes = readTsconfigTypes(tsconfigPath);
|
166408
|
-
const { mode } = (0,
|
166112
|
+
const { mode } = (0, import_miniflare26.getNodeCompat)(
|
166409
166113
|
config.compatibility_date,
|
166410
166114
|
config.compatibility_flags,
|
166411
166115
|
{
|