wrangler 2.5.0 → 2.6.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/miniflare-dist/index.mjs +99 -56
- package/package.json +3 -3
- package/src/__tests__/configuration.test.ts +211 -0
- package/src/__tests__/dev.test.tsx +17 -0
- package/src/__tests__/init.test.ts +18 -3
- package/src/__tests__/metrics.test.ts +88 -43
- package/src/__tests__/pages-deployment-tail.test.ts +165 -101
- package/src/__tests__/publish.test.ts +94 -7
- package/src/__tests__/pubsub.test.ts +208 -88
- package/src/__tests__/tail.test.ts +1 -1
- package/src/__tests__/type-generation.test.ts +7 -0
- package/src/config/environment.ts +16 -0
- package/src/config/index.ts +31 -8
- package/src/config/validation.ts +49 -0
- package/src/create-worker-upload-form.ts +9 -0
- package/src/dev/local.tsx +48 -18
- package/src/dev/start-server.ts +1 -5
- package/src/dev.tsx +23 -2
- package/src/git-client.ts +15 -4
- package/src/index.tsx +1 -0
- package/src/init.ts +8 -0
- package/src/miniflare-cli/assets.ts +55 -29
- package/src/miniflare-cli/index.ts +1 -0
- package/src/pages/dev.tsx +7 -0
- package/src/publish/publish.ts +1 -0
- package/src/secret/index.ts +1 -0
- package/src/type-generation.ts +10 -2
- package/src/worker.ts +6 -0
- package/wrangler-dist/cli.d.ts +15 -0
- package/wrangler-dist/cli.js +1844 -473
package/wrangler-dist/cli.js
CHANGED
|
@@ -447,7 +447,7 @@ var require_util = __commonJS({
|
|
|
447
447
|
const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);
|
|
448
448
|
return m ? parseInt(m[1], 10) * 1e3 : null;
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function parseHeaders2(headers, obj = {}) {
|
|
451
451
|
for (let i2 = 0; i2 < headers.length; i2 += 2) {
|
|
452
452
|
const key2 = headers[i2].toString().toLowerCase();
|
|
453
453
|
let val = obj[key2];
|
|
@@ -582,7 +582,7 @@ var require_util = __commonJS({
|
|
|
582
582
|
isAsyncIterable,
|
|
583
583
|
isDestroyed,
|
|
584
584
|
parseRawHeaders,
|
|
585
|
-
parseHeaders,
|
|
585
|
+
parseHeaders: parseHeaders2,
|
|
586
586
|
parseKeepAliveTimeout,
|
|
587
587
|
destroy,
|
|
588
588
|
bodyLength,
|
|
@@ -11037,7 +11037,7 @@ var require_headers = __commonJS({
|
|
|
11037
11037
|
return this[kHeadersMap][Symbol.iterator]();
|
|
11038
11038
|
}
|
|
11039
11039
|
};
|
|
11040
|
-
var
|
|
11040
|
+
var Headers3 = class {
|
|
11041
11041
|
constructor(init = void 0) {
|
|
11042
11042
|
this[kHeadersList] = new HeadersList();
|
|
11043
11043
|
this[kGuard] = "none";
|
|
@@ -11050,7 +11050,7 @@ var require_headers = __commonJS({
|
|
|
11050
11050
|
return this.constructor.name;
|
|
11051
11051
|
}
|
|
11052
11052
|
append(name, value) {
|
|
11053
|
-
if (!(this instanceof
|
|
11053
|
+
if (!(this instanceof Headers3)) {
|
|
11054
11054
|
throw new TypeError("Illegal invocation");
|
|
11055
11055
|
}
|
|
11056
11056
|
if (arguments.length < 2) {
|
|
@@ -11081,7 +11081,7 @@ var require_headers = __commonJS({
|
|
|
11081
11081
|
return this[kHeadersList].append(name, value);
|
|
11082
11082
|
}
|
|
11083
11083
|
delete(name) {
|
|
11084
|
-
if (!(this instanceof
|
|
11084
|
+
if (!(this instanceof Headers3)) {
|
|
11085
11085
|
throw new TypeError("Illegal invocation");
|
|
11086
11086
|
}
|
|
11087
11087
|
if (arguments.length < 1) {
|
|
@@ -11107,7 +11107,7 @@ var require_headers = __commonJS({
|
|
|
11107
11107
|
return this[kHeadersList].delete(name);
|
|
11108
11108
|
}
|
|
11109
11109
|
get(name) {
|
|
11110
|
-
if (!(this instanceof
|
|
11110
|
+
if (!(this instanceof Headers3)) {
|
|
11111
11111
|
throw new TypeError("Illegal invocation");
|
|
11112
11112
|
}
|
|
11113
11113
|
if (arguments.length < 1) {
|
|
@@ -11126,7 +11126,7 @@ var require_headers = __commonJS({
|
|
|
11126
11126
|
return this[kHeadersList].get(name);
|
|
11127
11127
|
}
|
|
11128
11128
|
has(name) {
|
|
11129
|
-
if (!(this instanceof
|
|
11129
|
+
if (!(this instanceof Headers3)) {
|
|
11130
11130
|
throw new TypeError("Illegal invocation");
|
|
11131
11131
|
}
|
|
11132
11132
|
if (arguments.length < 1) {
|
|
@@ -11145,7 +11145,7 @@ var require_headers = __commonJS({
|
|
|
11145
11145
|
return this[kHeadersList].contains(name);
|
|
11146
11146
|
}
|
|
11147
11147
|
set(name, value) {
|
|
11148
|
-
if (!(this instanceof
|
|
11148
|
+
if (!(this instanceof Headers3)) {
|
|
11149
11149
|
throw new TypeError("Illegal invocation");
|
|
11150
11150
|
}
|
|
11151
11151
|
if (arguments.length < 2) {
|
|
@@ -11182,25 +11182,25 @@ var require_headers = __commonJS({
|
|
|
11182
11182
|
return this[kHeadersList][kHeadersSortedMap];
|
|
11183
11183
|
}
|
|
11184
11184
|
keys() {
|
|
11185
|
-
if (!(this instanceof
|
|
11185
|
+
if (!(this instanceof Headers3)) {
|
|
11186
11186
|
throw new TypeError("Illegal invocation");
|
|
11187
11187
|
}
|
|
11188
11188
|
return makeIterator(this[kHeadersSortedMap].keys(), "Headers");
|
|
11189
11189
|
}
|
|
11190
11190
|
values() {
|
|
11191
|
-
if (!(this instanceof
|
|
11191
|
+
if (!(this instanceof Headers3)) {
|
|
11192
11192
|
throw new TypeError("Illegal invocation");
|
|
11193
11193
|
}
|
|
11194
11194
|
return makeIterator(this[kHeadersSortedMap].values(), "Headers");
|
|
11195
11195
|
}
|
|
11196
11196
|
entries() {
|
|
11197
|
-
if (!(this instanceof
|
|
11197
|
+
if (!(this instanceof Headers3)) {
|
|
11198
11198
|
throw new TypeError("Illegal invocation");
|
|
11199
11199
|
}
|
|
11200
11200
|
return makeIterator(this[kHeadersSortedMap].entries(), "Headers");
|
|
11201
11201
|
}
|
|
11202
11202
|
forEach(callbackFn, thisArg = globalThis) {
|
|
11203
|
-
if (!(this instanceof
|
|
11203
|
+
if (!(this instanceof Headers3)) {
|
|
11204
11204
|
throw new TypeError("Illegal invocation");
|
|
11205
11205
|
}
|
|
11206
11206
|
if (arguments.length < 1) {
|
|
@@ -11218,14 +11218,14 @@ var require_headers = __commonJS({
|
|
|
11218
11218
|
}
|
|
11219
11219
|
}
|
|
11220
11220
|
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
11221
|
-
if (!(this instanceof
|
|
11221
|
+
if (!(this instanceof Headers3)) {
|
|
11222
11222
|
throw new TypeError("Illegal invocation");
|
|
11223
11223
|
}
|
|
11224
11224
|
return this[kHeadersList];
|
|
11225
11225
|
}
|
|
11226
11226
|
};
|
|
11227
|
-
|
|
11228
|
-
Object.defineProperties(
|
|
11227
|
+
Headers3.prototype[Symbol.iterator] = Headers3.prototype.entries;
|
|
11228
|
+
Object.defineProperties(Headers3.prototype, {
|
|
11229
11229
|
append: kEnumerableProperty,
|
|
11230
11230
|
delete: kEnumerableProperty,
|
|
11231
11231
|
get: kEnumerableProperty,
|
|
@@ -11251,7 +11251,7 @@ var require_headers = __commonJS({
|
|
|
11251
11251
|
};
|
|
11252
11252
|
module2.exports = {
|
|
11253
11253
|
fill,
|
|
11254
|
-
Headers:
|
|
11254
|
+
Headers: Headers3,
|
|
11255
11255
|
HeadersList
|
|
11256
11256
|
};
|
|
11257
11257
|
}
|
|
@@ -11302,7 +11302,7 @@ var require_response = __commonJS({
|
|
|
11302
11302
|
"node_modules/undici/lib/fetch/response.js"(exports2, module2) {
|
|
11303
11303
|
"use strict";
|
|
11304
11304
|
init_import_meta_url();
|
|
11305
|
-
var { Headers:
|
|
11305
|
+
var { Headers: Headers3, HeadersList, fill } = require_headers();
|
|
11306
11306
|
var { extractBody, cloneBody, mixinBody } = require_body();
|
|
11307
11307
|
var util3 = require_util();
|
|
11308
11308
|
var { kEnumerableProperty } = util3;
|
|
@@ -11328,10 +11328,10 @@ var require_response = __commonJS({
|
|
|
11328
11328
|
var assert14 = require("assert");
|
|
11329
11329
|
var { types } = require("util");
|
|
11330
11330
|
var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
|
11331
|
-
var
|
|
11331
|
+
var Response2 = class {
|
|
11332
11332
|
static error() {
|
|
11333
11333
|
const relevantRealm = { settingsObject: {} };
|
|
11334
|
-
const responseObject = new
|
|
11334
|
+
const responseObject = new Response2();
|
|
11335
11335
|
responseObject[kState] = makeNetworkError();
|
|
11336
11336
|
responseObject[kRealm] = relevantRealm;
|
|
11337
11337
|
responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList;
|
|
@@ -11353,7 +11353,7 @@ var require_response = __commonJS({
|
|
|
11353
11353
|
);
|
|
11354
11354
|
const body = extractBody(bytes);
|
|
11355
11355
|
const relevantRealm = { settingsObject: {} };
|
|
11356
|
-
const responseObject = new
|
|
11356
|
+
const responseObject = new Response2();
|
|
11357
11357
|
responseObject[kRealm] = relevantRealm;
|
|
11358
11358
|
responseObject[kHeaders][kGuard] = "response";
|
|
11359
11359
|
responseObject[kHeaders][kRealm] = relevantRealm;
|
|
@@ -11380,7 +11380,7 @@ var require_response = __commonJS({
|
|
|
11380
11380
|
if (!redirectStatus.includes(status)) {
|
|
11381
11381
|
throw new RangeError("Invalid status code");
|
|
11382
11382
|
}
|
|
11383
|
-
const responseObject = new
|
|
11383
|
+
const responseObject = new Response2();
|
|
11384
11384
|
responseObject[kRealm] = relevantRealm;
|
|
11385
11385
|
responseObject[kHeaders][kGuard] = "immutable";
|
|
11386
11386
|
responseObject[kHeaders][kRealm] = relevantRealm;
|
|
@@ -11396,7 +11396,7 @@ var require_response = __commonJS({
|
|
|
11396
11396
|
init = webidl.converters.ResponseInit(init);
|
|
11397
11397
|
this[kRealm] = { settingsObject: {} };
|
|
11398
11398
|
this[kState] = makeResponse({});
|
|
11399
|
-
this[kHeaders] = new
|
|
11399
|
+
this[kHeaders] = new Headers3();
|
|
11400
11400
|
this[kHeaders][kGuard] = "response";
|
|
11401
11401
|
this[kHeaders][kHeadersList] = this[kState].headersList;
|
|
11402
11402
|
this[kHeaders][kRealm] = this[kRealm];
|
|
@@ -11411,13 +11411,13 @@ var require_response = __commonJS({
|
|
|
11411
11411
|
return this.constructor.name;
|
|
11412
11412
|
}
|
|
11413
11413
|
get type() {
|
|
11414
|
-
if (!(this instanceof
|
|
11414
|
+
if (!(this instanceof Response2)) {
|
|
11415
11415
|
throw new TypeError("Illegal invocation");
|
|
11416
11416
|
}
|
|
11417
11417
|
return this[kState].type;
|
|
11418
11418
|
}
|
|
11419
11419
|
get url() {
|
|
11420
|
-
if (!(this instanceof
|
|
11420
|
+
if (!(this instanceof Response2)) {
|
|
11421
11421
|
throw new TypeError("Illegal invocation");
|
|
11422
11422
|
}
|
|
11423
11423
|
let url3 = responseURL(this[kState]);
|
|
@@ -11431,37 +11431,37 @@ var require_response = __commonJS({
|
|
|
11431
11431
|
return url3.toString();
|
|
11432
11432
|
}
|
|
11433
11433
|
get redirected() {
|
|
11434
|
-
if (!(this instanceof
|
|
11434
|
+
if (!(this instanceof Response2)) {
|
|
11435
11435
|
throw new TypeError("Illegal invocation");
|
|
11436
11436
|
}
|
|
11437
11437
|
return this[kState].urlList.length > 1;
|
|
11438
11438
|
}
|
|
11439
11439
|
get status() {
|
|
11440
|
-
if (!(this instanceof
|
|
11440
|
+
if (!(this instanceof Response2)) {
|
|
11441
11441
|
throw new TypeError("Illegal invocation");
|
|
11442
11442
|
}
|
|
11443
11443
|
return this[kState].status;
|
|
11444
11444
|
}
|
|
11445
11445
|
get ok() {
|
|
11446
|
-
if (!(this instanceof
|
|
11446
|
+
if (!(this instanceof Response2)) {
|
|
11447
11447
|
throw new TypeError("Illegal invocation");
|
|
11448
11448
|
}
|
|
11449
11449
|
return this[kState].status >= 200 && this[kState].status <= 299;
|
|
11450
11450
|
}
|
|
11451
11451
|
get statusText() {
|
|
11452
|
-
if (!(this instanceof
|
|
11452
|
+
if (!(this instanceof Response2)) {
|
|
11453
11453
|
throw new TypeError("Illegal invocation");
|
|
11454
11454
|
}
|
|
11455
11455
|
return this[kState].statusText;
|
|
11456
11456
|
}
|
|
11457
11457
|
get headers() {
|
|
11458
|
-
if (!(this instanceof
|
|
11458
|
+
if (!(this instanceof Response2)) {
|
|
11459
11459
|
throw new TypeError("Illegal invocation");
|
|
11460
11460
|
}
|
|
11461
11461
|
return this[kHeaders];
|
|
11462
11462
|
}
|
|
11463
11463
|
clone() {
|
|
11464
|
-
if (!(this instanceof
|
|
11464
|
+
if (!(this instanceof Response2)) {
|
|
11465
11465
|
throw new TypeError("Illegal invocation");
|
|
11466
11466
|
}
|
|
11467
11467
|
if (this.bodyUsed || this.body && this.body.locked) {
|
|
@@ -11471,7 +11471,7 @@ var require_response = __commonJS({
|
|
|
11471
11471
|
});
|
|
11472
11472
|
}
|
|
11473
11473
|
const clonedResponse = cloneResponse(this[kState]);
|
|
11474
|
-
const clonedResponseObject = new
|
|
11474
|
+
const clonedResponseObject = new Response2();
|
|
11475
11475
|
clonedResponseObject[kState] = clonedResponse;
|
|
11476
11476
|
clonedResponseObject[kRealm] = this[kRealm];
|
|
11477
11477
|
clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList;
|
|
@@ -11480,8 +11480,8 @@ var require_response = __commonJS({
|
|
|
11480
11480
|
return clonedResponseObject;
|
|
11481
11481
|
}
|
|
11482
11482
|
};
|
|
11483
|
-
mixinBody(
|
|
11484
|
-
Object.defineProperties(
|
|
11483
|
+
mixinBody(Response2);
|
|
11484
|
+
Object.defineProperties(Response2.prototype, {
|
|
11485
11485
|
type: kEnumerableProperty,
|
|
11486
11486
|
url: kEnumerableProperty,
|
|
11487
11487
|
status: kEnumerableProperty,
|
|
@@ -11670,7 +11670,7 @@ var require_response = __commonJS({
|
|
|
11670
11670
|
makeResponse,
|
|
11671
11671
|
makeAppropriateNetworkError,
|
|
11672
11672
|
filterResponse,
|
|
11673
|
-
Response
|
|
11673
|
+
Response: Response2
|
|
11674
11674
|
};
|
|
11675
11675
|
}
|
|
11676
11676
|
});
|
|
@@ -11681,7 +11681,7 @@ var require_request2 = __commonJS({
|
|
|
11681
11681
|
"use strict";
|
|
11682
11682
|
init_import_meta_url();
|
|
11683
11683
|
var { extractBody, mixinBody, cloneBody } = require_body();
|
|
11684
|
-
var { Headers:
|
|
11684
|
+
var { Headers: Headers3, fill: fillHeaders, HeadersList } = require_headers();
|
|
11685
11685
|
var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()();
|
|
11686
11686
|
var util3 = require_util();
|
|
11687
11687
|
var {
|
|
@@ -11901,7 +11901,7 @@ var require_request2 = __commonJS({
|
|
|
11901
11901
|
requestFinalizer.register(this, { signal, abort: abort2 });
|
|
11902
11902
|
}
|
|
11903
11903
|
}
|
|
11904
|
-
this[kHeaders] = new
|
|
11904
|
+
this[kHeaders] = new Headers3();
|
|
11905
11905
|
this[kHeaders][kHeadersList] = request.headersList;
|
|
11906
11906
|
this[kHeaders][kGuard] = "request";
|
|
11907
11907
|
this[kHeaders][kRealm] = this[kRealm];
|
|
@@ -11914,7 +11914,7 @@ var require_request2 = __commonJS({
|
|
|
11914
11914
|
this[kHeaders][kGuard] = "request-no-cors";
|
|
11915
11915
|
}
|
|
11916
11916
|
if (Object.keys(init).length !== 0) {
|
|
11917
|
-
let headers = new
|
|
11917
|
+
let headers = new Headers3(this[kHeaders]);
|
|
11918
11918
|
if (init.headers !== void 0) {
|
|
11919
11919
|
headers = init.headers;
|
|
11920
11920
|
}
|
|
@@ -12078,7 +12078,7 @@ var require_request2 = __commonJS({
|
|
|
12078
12078
|
const clonedRequestObject = new Request2(kInit);
|
|
12079
12079
|
clonedRequestObject[kState] = clonedRequest;
|
|
12080
12080
|
clonedRequestObject[kRealm] = this[kRealm];
|
|
12081
|
-
clonedRequestObject[kHeaders] = new
|
|
12081
|
+
clonedRequestObject[kHeaders] = new Headers3();
|
|
12082
12082
|
clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList;
|
|
12083
12083
|
clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard];
|
|
12084
12084
|
clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm];
|
|
@@ -12537,13 +12537,13 @@ var require_fetch = __commonJS({
|
|
|
12537
12537
|
"use strict";
|
|
12538
12538
|
init_import_meta_url();
|
|
12539
12539
|
var {
|
|
12540
|
-
Response,
|
|
12540
|
+
Response: Response2,
|
|
12541
12541
|
makeNetworkError,
|
|
12542
12542
|
makeAppropriateNetworkError,
|
|
12543
12543
|
filterResponse,
|
|
12544
12544
|
makeResponse
|
|
12545
12545
|
} = require_response();
|
|
12546
|
-
var { Headers:
|
|
12546
|
+
var { Headers: Headers3 } = require_headers();
|
|
12547
12547
|
var { Request: Request2, makeRequest } = require_request2();
|
|
12548
12548
|
var zlib = require("zlib");
|
|
12549
12549
|
var {
|
|
@@ -12672,7 +12672,7 @@ var require_fetch = __commonJS({
|
|
|
12672
12672
|
);
|
|
12673
12673
|
return;
|
|
12674
12674
|
}
|
|
12675
|
-
responseObject = new
|
|
12675
|
+
responseObject = new Response2();
|
|
12676
12676
|
responseObject[kState] = response;
|
|
12677
12677
|
responseObject[kRealm] = relevantRealm;
|
|
12678
12678
|
responseObject[kHeaders][kHeadersList] = response.headersList;
|
|
@@ -13415,7 +13415,7 @@ var require_fetch = __commonJS({
|
|
|
13415
13415
|
}
|
|
13416
13416
|
let codings = [];
|
|
13417
13417
|
let location = "";
|
|
13418
|
-
const headers = new
|
|
13418
|
+
const headers = new Headers3();
|
|
13419
13419
|
for (let n = 0; n < headersList.length; n += 2) {
|
|
13420
13420
|
const key2 = headersList[n + 0].toString("latin1");
|
|
13421
13421
|
const val = headersList[n + 1].toString("latin1");
|
|
@@ -18797,7 +18797,7 @@ var require_lodash = __commonJS({
|
|
|
18797
18797
|
}
|
|
18798
18798
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
18799
18799
|
});
|
|
18800
|
-
function
|
|
18800
|
+
function join14(array, separator) {
|
|
18801
18801
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
18802
18802
|
}
|
|
18803
18803
|
function last(array) {
|
|
@@ -20716,7 +20716,7 @@ var require_lodash = __commonJS({
|
|
|
20716
20716
|
lodash.isUndefined = isUndefined;
|
|
20717
20717
|
lodash.isWeakMap = isWeakMap;
|
|
20718
20718
|
lodash.isWeakSet = isWeakSet;
|
|
20719
|
-
lodash.join =
|
|
20719
|
+
lodash.join = join14;
|
|
20720
20720
|
lodash.kebabCase = kebabCase;
|
|
20721
20721
|
lodash.last = last;
|
|
20722
20722
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -28941,14 +28941,14 @@ var require_nbind = __commonJS({
|
|
|
28941
28941
|
function reportProblem(problem, id, kind, structureType, place) {
|
|
28942
28942
|
throw new Error(problem + " type " + kind.replace("X", id + "?") + (structureType ? " with flag " + structureType : "") + " in " + place);
|
|
28943
28943
|
}
|
|
28944
|
-
function getComplexType(id, constructType2,
|
|
28944
|
+
function getComplexType(id, constructType2, getType4, queryType2, place, kind, prevStructure, depth) {
|
|
28945
28945
|
if (kind === void 0) {
|
|
28946
28946
|
kind = "X";
|
|
28947
28947
|
}
|
|
28948
28948
|
if (depth === void 0) {
|
|
28949
28949
|
depth = 1;
|
|
28950
28950
|
}
|
|
28951
|
-
var result =
|
|
28951
|
+
var result = getType4(id);
|
|
28952
28952
|
if (result)
|
|
28953
28953
|
return result;
|
|
28954
28954
|
var query = queryType2(id);
|
|
@@ -28967,7 +28967,7 @@ var require_nbind = __commonJS({
|
|
|
28967
28967
|
if (problem)
|
|
28968
28968
|
reportProblem(problem, id, kind, structureType, place || "?");
|
|
28969
28969
|
var subId = query.paramList[0];
|
|
28970
|
-
var subType = getComplexType(subId, constructType2,
|
|
28970
|
+
var subType = getComplexType(subId, constructType2, getType4, queryType2, place, kind, structure, depth + 1);
|
|
28971
28971
|
var srcSpec;
|
|
28972
28972
|
var spec = { flags: structure[0], id, name: "", paramList: [subType] };
|
|
28973
28973
|
var argList2 = [];
|
|
@@ -28996,7 +28996,7 @@ var require_nbind = __commonJS({
|
|
|
28996
28996
|
case 9:
|
|
28997
28997
|
for (var _i = 0, _a2 = query.paramList[1]; _i < _a2.length; _i++) {
|
|
28998
28998
|
var paramId = _a2[_i];
|
|
28999
|
-
var paramType = getComplexType(paramId, constructType2,
|
|
28999
|
+
var paramType = getComplexType(paramId, constructType2, getType4, queryType2, place, kind, structure, depth + 1);
|
|
29000
29000
|
argList2.push(paramType.name);
|
|
29001
29001
|
spec.paramList.push(paramType);
|
|
29002
29002
|
}
|
|
@@ -75216,7 +75216,7 @@ var require_util3 = __commonJS({
|
|
|
75216
75216
|
"../../node_modules/ink/node_modules/chalk/source/util.js"(exports2, module2) {
|
|
75217
75217
|
"use strict";
|
|
75218
75218
|
init_import_meta_url();
|
|
75219
|
-
var stringReplaceAll = (string, substring,
|
|
75219
|
+
var stringReplaceAll = (string, substring, replacer2) => {
|
|
75220
75220
|
let index = string.indexOf(substring);
|
|
75221
75221
|
if (index === -1) {
|
|
75222
75222
|
return string;
|
|
@@ -75225,7 +75225,7 @@ var require_util3 = __commonJS({
|
|
|
75225
75225
|
let endIndex = 0;
|
|
75226
75226
|
let returnValue = "";
|
|
75227
75227
|
do {
|
|
75228
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring +
|
|
75228
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer2;
|
|
75229
75229
|
endIndex = index + substringLength;
|
|
75230
75230
|
index = string.indexOf(substring, endIndex);
|
|
75231
75231
|
} while (index !== -1);
|
|
@@ -99691,7 +99691,7 @@ var require_get_intrinsic = __commonJS({
|
|
|
99691
99691
|
if (arguments.length > 1 && typeof allowMissing !== "boolean") {
|
|
99692
99692
|
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
99693
99693
|
}
|
|
99694
|
-
if ($exec(/^%?[^%]
|
|
99694
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
99695
99695
|
throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
99696
99696
|
}
|
|
99697
99697
|
var parts = stringToPath(name);
|
|
@@ -103396,7 +103396,7 @@ var require_view = __commonJS({
|
|
|
103396
103396
|
var dirname12 = path41.dirname;
|
|
103397
103397
|
var basename5 = path41.basename;
|
|
103398
103398
|
var extname5 = path41.extname;
|
|
103399
|
-
var
|
|
103399
|
+
var join14 = path41.join;
|
|
103400
103400
|
var resolve15 = path41.resolve;
|
|
103401
103401
|
module2.exports = View;
|
|
103402
103402
|
function View(name, options6) {
|
|
@@ -103444,12 +103444,12 @@ var require_view = __commonJS({
|
|
|
103444
103444
|
};
|
|
103445
103445
|
View.prototype.resolve = function resolve16(dir, file) {
|
|
103446
103446
|
var ext = this.ext;
|
|
103447
|
-
var path42 =
|
|
103447
|
+
var path42 = join14(dir, file);
|
|
103448
103448
|
var stat3 = tryStat(path42);
|
|
103449
103449
|
if (stat3 && stat3.isFile()) {
|
|
103450
103450
|
return path42;
|
|
103451
103451
|
}
|
|
103452
|
-
path42 =
|
|
103452
|
+
path42 = join14(dir, basename5(file, ext), "index" + ext);
|
|
103453
103453
|
stat3 = tryStat(path42);
|
|
103454
103454
|
if (stat3 && stat3.isFile()) {
|
|
103455
103455
|
return path42;
|
|
@@ -104584,7 +104584,7 @@ var require_send = __commonJS({
|
|
|
104584
104584
|
var Stream = require("stream");
|
|
104585
104585
|
var util3 = require("util");
|
|
104586
104586
|
var extname5 = path41.extname;
|
|
104587
|
-
var
|
|
104587
|
+
var join14 = path41.join;
|
|
104588
104588
|
var normalize2 = path41.normalize;
|
|
104589
104589
|
var resolve15 = path41.resolve;
|
|
104590
104590
|
var sep2 = path41.sep;
|
|
@@ -104803,7 +104803,7 @@ var require_send = __commonJS({
|
|
|
104803
104803
|
return res;
|
|
104804
104804
|
}
|
|
104805
104805
|
parts = path42.split(sep2);
|
|
104806
|
-
path42 = normalize2(
|
|
104806
|
+
path42 = normalize2(join14(root, path42));
|
|
104807
104807
|
} else {
|
|
104808
104808
|
if (UP_PATH_REGEXP.test(path42)) {
|
|
104809
104809
|
debug('malicious path "%s"', path42);
|
|
@@ -104944,7 +104944,7 @@ var require_send = __commonJS({
|
|
|
104944
104944
|
return self2.onStatError(err2);
|
|
104945
104945
|
return self2.error(404);
|
|
104946
104946
|
}
|
|
104947
|
-
var p =
|
|
104947
|
+
var p = join14(path42, self2._index[i2]);
|
|
104948
104948
|
debug('stat "%s"', p);
|
|
104949
104949
|
fs18.stat(p, function(err3, stat3) {
|
|
104950
104950
|
if (err3)
|
|
@@ -106759,7 +106759,7 @@ var require_mediaType = __commonJS({
|
|
|
106759
106759
|
var priorities = provided.map(function getPriority(type2, index) {
|
|
106760
106760
|
return getMediaTypePriority(type2, accepts, index);
|
|
106761
106761
|
});
|
|
106762
|
-
return priorities.filter(isQuality).sort(compareSpecs).map(function
|
|
106762
|
+
return priorities.filter(isQuality).sort(compareSpecs).map(function getType4(priority) {
|
|
106763
106763
|
return provided[priorities.indexOf(priority)];
|
|
106764
106764
|
});
|
|
106765
106765
|
}
|
|
@@ -107527,9 +107527,9 @@ var require_response2 = __commonJS({
|
|
|
107527
107527
|
}
|
|
107528
107528
|
var app = this.app;
|
|
107529
107529
|
var escape2 = app.get("json escape");
|
|
107530
|
-
var
|
|
107530
|
+
var replacer2 = app.get("json replacer");
|
|
107531
107531
|
var spaces = app.get("json spaces");
|
|
107532
|
-
var body = stringify(val,
|
|
107532
|
+
var body = stringify(val, replacer2, spaces, escape2);
|
|
107533
107533
|
if (!this.get("Content-Type")) {
|
|
107534
107534
|
this.set("Content-Type", "application/json");
|
|
107535
107535
|
}
|
|
@@ -107549,9 +107549,9 @@ var require_response2 = __commonJS({
|
|
|
107549
107549
|
}
|
|
107550
107550
|
var app = this.app;
|
|
107551
107551
|
var escape2 = app.get("json escape");
|
|
107552
|
-
var
|
|
107552
|
+
var replacer2 = app.get("json replacer");
|
|
107553
107553
|
var spaces = app.get("json spaces");
|
|
107554
|
-
var body = stringify(val,
|
|
107554
|
+
var body = stringify(val, replacer2, spaces, escape2);
|
|
107555
107555
|
var callback = this.req.query[app.get("jsonp callback name")];
|
|
107556
107556
|
if (!this.get("Content-Type")) {
|
|
107557
107557
|
this.set("X-Content-Type-Options", "nosniff");
|
|
@@ -107901,8 +107901,8 @@ var require_response2 = __commonJS({
|
|
|
107901
107901
|
}
|
|
107902
107902
|
file.pipe(res2);
|
|
107903
107903
|
}
|
|
107904
|
-
function stringify(value,
|
|
107905
|
-
var json =
|
|
107904
|
+
function stringify(value, replacer2, spaces, escape2) {
|
|
107905
|
+
var json = replacer2 || spaces ? JSON.stringify(value, replacer2, spaces) : JSON.stringify(value);
|
|
107906
107906
|
if (escape2 && typeof json === "string") {
|
|
107907
107907
|
json = json.replace(/[<>&]/g, function(c) {
|
|
107908
107908
|
switch (c.charCodeAt(0)) {
|
|
@@ -118146,7 +118146,7 @@ var require_fast_safe_stringify = __commonJS({
|
|
|
118146
118146
|
edgesLimit: Number.MAX_SAFE_INTEGER
|
|
118147
118147
|
};
|
|
118148
118148
|
}
|
|
118149
|
-
function stringify(obj,
|
|
118149
|
+
function stringify(obj, replacer2, spacer, options6) {
|
|
118150
118150
|
if (typeof options6 === "undefined") {
|
|
118151
118151
|
options6 = defaultOptions();
|
|
118152
118152
|
}
|
|
@@ -118154,9 +118154,9 @@ var require_fast_safe_stringify = __commonJS({
|
|
|
118154
118154
|
var res;
|
|
118155
118155
|
try {
|
|
118156
118156
|
if (replacerStack.length === 0) {
|
|
118157
|
-
res = JSON.stringify(obj,
|
|
118157
|
+
res = JSON.stringify(obj, replacer2, spacer);
|
|
118158
118158
|
} else {
|
|
118159
|
-
res = JSON.stringify(obj, replaceGetterValues(
|
|
118159
|
+
res = JSON.stringify(obj, replaceGetterValues(replacer2), spacer);
|
|
118160
118160
|
}
|
|
118161
118161
|
} catch (_2) {
|
|
118162
118162
|
return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
|
|
@@ -118228,7 +118228,7 @@ var require_fast_safe_stringify = __commonJS({
|
|
|
118228
118228
|
}
|
|
118229
118229
|
return 0;
|
|
118230
118230
|
}
|
|
118231
|
-
function deterministicStringify(obj,
|
|
118231
|
+
function deterministicStringify(obj, replacer2, spacer, options6) {
|
|
118232
118232
|
if (typeof options6 === "undefined") {
|
|
118233
118233
|
options6 = defaultOptions();
|
|
118234
118234
|
}
|
|
@@ -118236,9 +118236,9 @@ var require_fast_safe_stringify = __commonJS({
|
|
|
118236
118236
|
var res;
|
|
118237
118237
|
try {
|
|
118238
118238
|
if (replacerStack.length === 0) {
|
|
118239
|
-
res = JSON.stringify(tmp5,
|
|
118239
|
+
res = JSON.stringify(tmp5, replacer2, spacer);
|
|
118240
118240
|
} else {
|
|
118241
|
-
res = JSON.stringify(tmp5, replaceGetterValues(
|
|
118241
|
+
res = JSON.stringify(tmp5, replaceGetterValues(replacer2), spacer);
|
|
118242
118242
|
}
|
|
118243
118243
|
} catch (_2) {
|
|
118244
118244
|
return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
|
|
@@ -118302,8 +118302,8 @@ var require_fast_safe_stringify = __commonJS({
|
|
|
118302
118302
|
stack.pop();
|
|
118303
118303
|
}
|
|
118304
118304
|
}
|
|
118305
|
-
function replaceGetterValues(
|
|
118306
|
-
|
|
118305
|
+
function replaceGetterValues(replacer2) {
|
|
118306
|
+
replacer2 = typeof replacer2 !== "undefined" ? replacer2 : function(k, v) {
|
|
118307
118307
|
return v;
|
|
118308
118308
|
};
|
|
118309
118309
|
return function(key2, val) {
|
|
@@ -118317,7 +118317,7 @@ var require_fast_safe_stringify = __commonJS({
|
|
|
118317
118317
|
}
|
|
118318
118318
|
}
|
|
118319
118319
|
}
|
|
118320
|
-
return
|
|
118320
|
+
return replacer2.call(this, key2, val);
|
|
118321
118321
|
};
|
|
118322
118322
|
}
|
|
118323
118323
|
}
|
|
@@ -118617,21 +118617,21 @@ var require_shim = __commonJS({
|
|
|
118617
118617
|
var define2 = require_define_properties();
|
|
118618
118618
|
var getPolyfill = require_polyfill();
|
|
118619
118619
|
module2.exports = function shimGlobal() {
|
|
118620
|
-
var
|
|
118620
|
+
var polyfill2 = getPolyfill();
|
|
118621
118621
|
if (define2.supportsDescriptors) {
|
|
118622
|
-
var descriptor2 = Object.getOwnPropertyDescriptor(
|
|
118623
|
-
if (!descriptor2 || descriptor2.configurable && (descriptor2.enumerable || !descriptor2.writable || globalThis !==
|
|
118624
|
-
Object.defineProperty(
|
|
118622
|
+
var descriptor2 = Object.getOwnPropertyDescriptor(polyfill2, "globalThis");
|
|
118623
|
+
if (!descriptor2 || descriptor2.configurable && (descriptor2.enumerable || !descriptor2.writable || globalThis !== polyfill2)) {
|
|
118624
|
+
Object.defineProperty(polyfill2, "globalThis", {
|
|
118625
118625
|
configurable: true,
|
|
118626
118626
|
enumerable: false,
|
|
118627
|
-
value:
|
|
118627
|
+
value: polyfill2,
|
|
118628
118628
|
writable: true
|
|
118629
118629
|
});
|
|
118630
118630
|
}
|
|
118631
|
-
} else if (typeof globalThis !== "object" || globalThis !==
|
|
118632
|
-
|
|
118631
|
+
} else if (typeof globalThis !== "object" || globalThis !== polyfill2) {
|
|
118632
|
+
polyfill2.globalThis = polyfill2;
|
|
118633
118633
|
}
|
|
118634
|
-
return
|
|
118634
|
+
return polyfill2;
|
|
118635
118635
|
};
|
|
118636
118636
|
}
|
|
118637
118637
|
});
|
|
@@ -118645,9 +118645,9 @@ var require_globalthis = __commonJS({
|
|
|
118645
118645
|
var implementation = require_implementation3();
|
|
118646
118646
|
var getPolyfill = require_polyfill();
|
|
118647
118647
|
var shim3 = require_shim();
|
|
118648
|
-
var
|
|
118648
|
+
var polyfill2 = getPolyfill();
|
|
118649
118649
|
var getGlobal = function() {
|
|
118650
|
-
return
|
|
118650
|
+
return polyfill2;
|
|
118651
118651
|
};
|
|
118652
118652
|
defineProperties(getGlobal, {
|
|
118653
118653
|
getPolyfill,
|
|
@@ -129352,6 +129352,761 @@ var require_build3 = __commonJS({
|
|
|
129352
129352
|
}
|
|
129353
129353
|
});
|
|
129354
129354
|
|
|
129355
|
+
// ../../node_modules/mime/Mime.js
|
|
129356
|
+
var require_Mime = __commonJS({
|
|
129357
|
+
"../../node_modules/mime/Mime.js"(exports2, module2) {
|
|
129358
|
+
"use strict";
|
|
129359
|
+
init_import_meta_url();
|
|
129360
|
+
function Mime() {
|
|
129361
|
+
this._types = /* @__PURE__ */ Object.create(null);
|
|
129362
|
+
this._extensions = /* @__PURE__ */ Object.create(null);
|
|
129363
|
+
for (let i2 = 0; i2 < arguments.length; i2++) {
|
|
129364
|
+
this.define(arguments[i2]);
|
|
129365
|
+
}
|
|
129366
|
+
this.define = this.define.bind(this);
|
|
129367
|
+
this.getType = this.getType.bind(this);
|
|
129368
|
+
this.getExtension = this.getExtension.bind(this);
|
|
129369
|
+
}
|
|
129370
|
+
Mime.prototype.define = function(typeMap, force) {
|
|
129371
|
+
for (let type2 in typeMap) {
|
|
129372
|
+
let extensions = typeMap[type2].map(function(t2) {
|
|
129373
|
+
return t2.toLowerCase();
|
|
129374
|
+
});
|
|
129375
|
+
type2 = type2.toLowerCase();
|
|
129376
|
+
for (let i2 = 0; i2 < extensions.length; i2++) {
|
|
129377
|
+
const ext = extensions[i2];
|
|
129378
|
+
if (ext[0] === "*") {
|
|
129379
|
+
continue;
|
|
129380
|
+
}
|
|
129381
|
+
if (!force && ext in this._types) {
|
|
129382
|
+
throw new Error(
|
|
129383
|
+
'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type2 + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type2 + '".'
|
|
129384
|
+
);
|
|
129385
|
+
}
|
|
129386
|
+
this._types[ext] = type2;
|
|
129387
|
+
}
|
|
129388
|
+
if (force || !this._extensions[type2]) {
|
|
129389
|
+
const ext = extensions[0];
|
|
129390
|
+
this._extensions[type2] = ext[0] !== "*" ? ext : ext.substr(1);
|
|
129391
|
+
}
|
|
129392
|
+
}
|
|
129393
|
+
};
|
|
129394
|
+
Mime.prototype.getType = function(path41) {
|
|
129395
|
+
path41 = String(path41);
|
|
129396
|
+
let last = path41.replace(/^.*[/\\]/, "").toLowerCase();
|
|
129397
|
+
let ext = last.replace(/^.*\./, "").toLowerCase();
|
|
129398
|
+
let hasPath = last.length < path41.length;
|
|
129399
|
+
let hasDot = ext.length < last.length - 1;
|
|
129400
|
+
return (hasDot || !hasPath) && this._types[ext] || null;
|
|
129401
|
+
};
|
|
129402
|
+
Mime.prototype.getExtension = function(type2) {
|
|
129403
|
+
type2 = /^\s*([^;\s]*)/.test(type2) && RegExp.$1;
|
|
129404
|
+
return type2 && this._extensions[type2.toLowerCase()] || null;
|
|
129405
|
+
};
|
|
129406
|
+
module2.exports = Mime;
|
|
129407
|
+
}
|
|
129408
|
+
});
|
|
129409
|
+
|
|
129410
|
+
// ../../node_modules/mime/types/standard.js
|
|
129411
|
+
var require_standard = __commonJS({
|
|
129412
|
+
"../../node_modules/mime/types/standard.js"(exports2, module2) {
|
|
129413
|
+
init_import_meta_url();
|
|
129414
|
+
module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
|
|
129415
|
+
}
|
|
129416
|
+
});
|
|
129417
|
+
|
|
129418
|
+
// ../../node_modules/mime/types/other.js
|
|
129419
|
+
var require_other = __commonJS({
|
|
129420
|
+
"../../node_modules/mime/types/other.js"(exports2, module2) {
|
|
129421
|
+
init_import_meta_url();
|
|
129422
|
+
module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
|
|
129423
|
+
}
|
|
129424
|
+
});
|
|
129425
|
+
|
|
129426
|
+
// ../../node_modules/mime/index.js
|
|
129427
|
+
var require_mime2 = __commonJS({
|
|
129428
|
+
"../../node_modules/mime/index.js"(exports2, module2) {
|
|
129429
|
+
"use strict";
|
|
129430
|
+
init_import_meta_url();
|
|
129431
|
+
var Mime = require_Mime();
|
|
129432
|
+
module2.exports = new Mime(require_standard(), require_other());
|
|
129433
|
+
}
|
|
129434
|
+
});
|
|
129435
|
+
|
|
129436
|
+
// ../pages-shared/environment-polyfills/index.ts
|
|
129437
|
+
var polyfill;
|
|
129438
|
+
var init_environment_polyfills = __esm({
|
|
129439
|
+
"../pages-shared/environment-polyfills/index.ts"() {
|
|
129440
|
+
init_import_meta_url();
|
|
129441
|
+
polyfill = (environment) => {
|
|
129442
|
+
Object.entries(environment).map(([name, value]) => {
|
|
129443
|
+
Object.defineProperty(globalThis, name, {
|
|
129444
|
+
value,
|
|
129445
|
+
configurable: true,
|
|
129446
|
+
enumerable: true,
|
|
129447
|
+
writable: true
|
|
129448
|
+
});
|
|
129449
|
+
});
|
|
129450
|
+
};
|
|
129451
|
+
}
|
|
129452
|
+
});
|
|
129453
|
+
|
|
129454
|
+
// ../pages-shared/environment-polyfills/miniflare-tre.ts
|
|
129455
|
+
var miniflare_tre_exports = {};
|
|
129456
|
+
__export(miniflare_tre_exports, {
|
|
129457
|
+
default: () => miniflare_tre_default
|
|
129458
|
+
});
|
|
129459
|
+
var miniflare_tre_default;
|
|
129460
|
+
var init_miniflare_tre = __esm({
|
|
129461
|
+
"../pages-shared/environment-polyfills/miniflare-tre.ts"() {
|
|
129462
|
+
init_import_meta_url();
|
|
129463
|
+
init_environment_polyfills();
|
|
129464
|
+
miniflare_tre_default = async () => {
|
|
129465
|
+
const mf = await import("@miniflare/tre");
|
|
129466
|
+
polyfill({
|
|
129467
|
+
fetch: mf.fetch,
|
|
129468
|
+
Headers: mf.Headers,
|
|
129469
|
+
Request: mf.Request,
|
|
129470
|
+
Response: mf.Response
|
|
129471
|
+
});
|
|
129472
|
+
};
|
|
129473
|
+
}
|
|
129474
|
+
});
|
|
129475
|
+
|
|
129476
|
+
// ../pages-shared/environment-polyfills/miniflare.ts
|
|
129477
|
+
var miniflare_exports = {};
|
|
129478
|
+
__export(miniflare_exports, {
|
|
129479
|
+
default: () => miniflare_default
|
|
129480
|
+
});
|
|
129481
|
+
var miniflare_default;
|
|
129482
|
+
var init_miniflare = __esm({
|
|
129483
|
+
"../pages-shared/environment-polyfills/miniflare.ts"() {
|
|
129484
|
+
init_import_meta_url();
|
|
129485
|
+
init_environment_polyfills();
|
|
129486
|
+
miniflare_default = async () => {
|
|
129487
|
+
const mf = await import("@miniflare/core");
|
|
129488
|
+
polyfill({
|
|
129489
|
+
fetch: mf.fetch,
|
|
129490
|
+
Headers: mf.Headers,
|
|
129491
|
+
Request: mf.Request,
|
|
129492
|
+
Response: mf.Response
|
|
129493
|
+
});
|
|
129494
|
+
};
|
|
129495
|
+
}
|
|
129496
|
+
});
|
|
129497
|
+
|
|
129498
|
+
// ../pages-shared/asset-server/responses.ts
|
|
129499
|
+
function mergeHeaders(base, extra) {
|
|
129500
|
+
base = new Headers(base ?? {});
|
|
129501
|
+
extra = new Headers(extra ?? {});
|
|
129502
|
+
return new Headers({
|
|
129503
|
+
...Object.fromEntries(base.entries()),
|
|
129504
|
+
...Object.fromEntries(extra.entries())
|
|
129505
|
+
});
|
|
129506
|
+
}
|
|
129507
|
+
var OkResponse, MovedPermanentlyResponse, FoundResponse, NotModifiedResponse, PermanentRedirectResponse, NotFoundResponse, MethodNotAllowedResponse, NotAcceptableResponse, InternalServerErrorResponse, SeeOtherResponse, TemporaryRedirectResponse;
|
|
129508
|
+
var init_responses = __esm({
|
|
129509
|
+
"../pages-shared/asset-server/responses.ts"() {
|
|
129510
|
+
init_import_meta_url();
|
|
129511
|
+
OkResponse = class extends Response {
|
|
129512
|
+
constructor(...[body, init]) {
|
|
129513
|
+
super(body, {
|
|
129514
|
+
...init,
|
|
129515
|
+
status: 200,
|
|
129516
|
+
statusText: "OK"
|
|
129517
|
+
});
|
|
129518
|
+
}
|
|
129519
|
+
};
|
|
129520
|
+
MovedPermanentlyResponse = class extends Response {
|
|
129521
|
+
constructor(location, init) {
|
|
129522
|
+
super(`Redirecting to ${location}`, {
|
|
129523
|
+
...init,
|
|
129524
|
+
status: 301,
|
|
129525
|
+
statusText: "Moved Permanently",
|
|
129526
|
+
headers: mergeHeaders(init?.headers, {
|
|
129527
|
+
location
|
|
129528
|
+
})
|
|
129529
|
+
});
|
|
129530
|
+
}
|
|
129531
|
+
};
|
|
129532
|
+
FoundResponse = class extends Response {
|
|
129533
|
+
constructor(location, init) {
|
|
129534
|
+
super(`Redirecting to ${location}`, {
|
|
129535
|
+
...init,
|
|
129536
|
+
status: 302,
|
|
129537
|
+
statusText: "Found",
|
|
129538
|
+
headers: mergeHeaders(init?.headers, {
|
|
129539
|
+
location
|
|
129540
|
+
})
|
|
129541
|
+
});
|
|
129542
|
+
}
|
|
129543
|
+
};
|
|
129544
|
+
NotModifiedResponse = class extends Response {
|
|
129545
|
+
constructor(...[_body, _init]) {
|
|
129546
|
+
super(void 0, {
|
|
129547
|
+
status: 304,
|
|
129548
|
+
statusText: "Not Modified"
|
|
129549
|
+
});
|
|
129550
|
+
}
|
|
129551
|
+
};
|
|
129552
|
+
PermanentRedirectResponse = class extends Response {
|
|
129553
|
+
constructor(location, init) {
|
|
129554
|
+
super(void 0, {
|
|
129555
|
+
...init,
|
|
129556
|
+
status: 308,
|
|
129557
|
+
statusText: "Permanent Redirect",
|
|
129558
|
+
headers: mergeHeaders(init?.headers, {
|
|
129559
|
+
location
|
|
129560
|
+
})
|
|
129561
|
+
});
|
|
129562
|
+
}
|
|
129563
|
+
};
|
|
129564
|
+
NotFoundResponse = class extends Response {
|
|
129565
|
+
constructor(...[body, init]) {
|
|
129566
|
+
super(body, {
|
|
129567
|
+
...init,
|
|
129568
|
+
status: 404,
|
|
129569
|
+
statusText: "Not Found"
|
|
129570
|
+
});
|
|
129571
|
+
}
|
|
129572
|
+
};
|
|
129573
|
+
MethodNotAllowedResponse = class extends Response {
|
|
129574
|
+
constructor(...[body, init]) {
|
|
129575
|
+
super(body, {
|
|
129576
|
+
...init,
|
|
129577
|
+
status: 405,
|
|
129578
|
+
statusText: "Method Not Allowed"
|
|
129579
|
+
});
|
|
129580
|
+
}
|
|
129581
|
+
};
|
|
129582
|
+
NotAcceptableResponse = class extends Response {
|
|
129583
|
+
constructor(...[body, init]) {
|
|
129584
|
+
super(body, {
|
|
129585
|
+
...init,
|
|
129586
|
+
status: 406,
|
|
129587
|
+
statusText: "Not Acceptable"
|
|
129588
|
+
});
|
|
129589
|
+
}
|
|
129590
|
+
};
|
|
129591
|
+
InternalServerErrorResponse = class extends Response {
|
|
129592
|
+
constructor(err2, init) {
|
|
129593
|
+
let body = void 0;
|
|
129594
|
+
if (globalThis.DEBUG) {
|
|
129595
|
+
body = `${err2.message}
|
|
129596
|
+
|
|
129597
|
+
${err2.stack}`;
|
|
129598
|
+
}
|
|
129599
|
+
super(body, {
|
|
129600
|
+
...init,
|
|
129601
|
+
status: 500,
|
|
129602
|
+
statusText: "Internal Server Error"
|
|
129603
|
+
});
|
|
129604
|
+
}
|
|
129605
|
+
};
|
|
129606
|
+
SeeOtherResponse = class extends Response {
|
|
129607
|
+
constructor(location, init) {
|
|
129608
|
+
super(`Redirecting to ${location}`, {
|
|
129609
|
+
...init,
|
|
129610
|
+
status: 303,
|
|
129611
|
+
statusText: "See Other",
|
|
129612
|
+
headers: mergeHeaders(init?.headers, { location })
|
|
129613
|
+
});
|
|
129614
|
+
}
|
|
129615
|
+
};
|
|
129616
|
+
TemporaryRedirectResponse = class extends Response {
|
|
129617
|
+
constructor(location, init) {
|
|
129618
|
+
super(`Redirecting to ${location}`, {
|
|
129619
|
+
...init,
|
|
129620
|
+
status: 307,
|
|
129621
|
+
statusText: "Temporary Redirect",
|
|
129622
|
+
headers: mergeHeaders(init?.headers, { location })
|
|
129623
|
+
});
|
|
129624
|
+
}
|
|
129625
|
+
};
|
|
129626
|
+
}
|
|
129627
|
+
});
|
|
129628
|
+
|
|
129629
|
+
// ../pages-shared/asset-server/rulesEngine.ts
|
|
129630
|
+
var ESCAPE_REGEX_CHARACTERS, escapeRegex, HOST_PLACEHOLDER_REGEX, PLACEHOLDER_REGEX2, replacer, generateRulesMatcher;
|
|
129631
|
+
var init_rulesEngine = __esm({
|
|
129632
|
+
"../pages-shared/asset-server/rulesEngine.ts"() {
|
|
129633
|
+
init_import_meta_url();
|
|
129634
|
+
ESCAPE_REGEX_CHARACTERS = /[-/\\^$*+?.()|[\]{}]/g;
|
|
129635
|
+
escapeRegex = (str) => {
|
|
129636
|
+
return str.replace(ESCAPE_REGEX_CHARACTERS, "\\$&");
|
|
129637
|
+
};
|
|
129638
|
+
HOST_PLACEHOLDER_REGEX = /(?<=^https:\\\/\\\/[^/]*?):([^\\]+)(?=\\)/g;
|
|
129639
|
+
PLACEHOLDER_REGEX2 = /:(\w+)/g;
|
|
129640
|
+
replacer = (str, replacements) => {
|
|
129641
|
+
for (const [replacement, value] of Object.entries(replacements)) {
|
|
129642
|
+
str = str.replaceAll(`:${replacement}`, value);
|
|
129643
|
+
}
|
|
129644
|
+
return str;
|
|
129645
|
+
};
|
|
129646
|
+
generateRulesMatcher = (rules, replacerFn = (match) => match) => {
|
|
129647
|
+
if (!rules)
|
|
129648
|
+
return () => [];
|
|
129649
|
+
const compiledRules = Object.entries(rules).map(([rule, match]) => {
|
|
129650
|
+
const crossHost = rule.startsWith("https://");
|
|
129651
|
+
rule = rule.split("*").map(escapeRegex).join("(?<splat>.*)");
|
|
129652
|
+
const host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
|
|
129653
|
+
for (const host_match of host_matches) {
|
|
129654
|
+
rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
|
|
129655
|
+
}
|
|
129656
|
+
const path_matches = rule.matchAll(PLACEHOLDER_REGEX2);
|
|
129657
|
+
for (const path_match of path_matches) {
|
|
129658
|
+
rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
|
|
129659
|
+
}
|
|
129660
|
+
rule = "^" + rule + "$";
|
|
129661
|
+
try {
|
|
129662
|
+
const regExp = new RegExp(rule);
|
|
129663
|
+
return [{ crossHost, regExp }, match];
|
|
129664
|
+
} catch {
|
|
129665
|
+
}
|
|
129666
|
+
}).filter((value) => value !== void 0);
|
|
129667
|
+
return ({ request }) => {
|
|
129668
|
+
const { pathname, host } = new URL(request.url);
|
|
129669
|
+
return compiledRules.map(([{ crossHost, regExp }, match]) => {
|
|
129670
|
+
const test = crossHost ? `https://${host}${pathname}` : pathname;
|
|
129671
|
+
const result = regExp.exec(test);
|
|
129672
|
+
if (result) {
|
|
129673
|
+
return replacerFn(match, result.groups || {});
|
|
129674
|
+
}
|
|
129675
|
+
}).filter((value) => value !== void 0);
|
|
129676
|
+
};
|
|
129677
|
+
};
|
|
129678
|
+
}
|
|
129679
|
+
});
|
|
129680
|
+
|
|
129681
|
+
// ../pages-shared/asset-server/url.ts
|
|
129682
|
+
function stringifyURLToRootRelativePathname(url3) {
|
|
129683
|
+
return `${url3.pathname}${url3.search}${url3.hash}`;
|
|
129684
|
+
}
|
|
129685
|
+
var init_url = __esm({
|
|
129686
|
+
"../pages-shared/asset-server/url.ts"() {
|
|
129687
|
+
init_import_meta_url();
|
|
129688
|
+
}
|
|
129689
|
+
});
|
|
129690
|
+
|
|
129691
|
+
// ../pages-shared/asset-server/handler.ts
|
|
129692
|
+
var handler_exports = {};
|
|
129693
|
+
__export(handler_exports, {
|
|
129694
|
+
ANALYTICS_VERSION: () => ANALYTICS_VERSION2,
|
|
129695
|
+
ASSET_PRESERVATION_CACHE: () => ASSET_PRESERVATION_CACHE,
|
|
129696
|
+
CACHE_CONTROL_BROWSER: () => CACHE_CONTROL_BROWSER,
|
|
129697
|
+
HEADERS_VERSION: () => HEADERS_VERSION2,
|
|
129698
|
+
HEADERS_VERSION_V1: () => HEADERS_VERSION_V1,
|
|
129699
|
+
REDIRECTS_VERSION: () => REDIRECTS_VERSION2,
|
|
129700
|
+
generateHandler: () => generateHandler,
|
|
129701
|
+
getResponseFromMatch: () => getResponseFromMatch,
|
|
129702
|
+
normaliseHeaders: () => normaliseHeaders,
|
|
129703
|
+
parseQualityWeightedList: () => parseQualityWeightedList
|
|
129704
|
+
});
|
|
129705
|
+
function normaliseHeaders(headers) {
|
|
129706
|
+
if (headers.version === HEADERS_VERSION2) {
|
|
129707
|
+
return headers.rules;
|
|
129708
|
+
} else if (headers.version === HEADERS_VERSION_V1) {
|
|
129709
|
+
return Object.keys(headers.rules).reduce(
|
|
129710
|
+
(acc, key2) => {
|
|
129711
|
+
acc[key2] = {
|
|
129712
|
+
set: headers.rules[key2]
|
|
129713
|
+
};
|
|
129714
|
+
return acc;
|
|
129715
|
+
},
|
|
129716
|
+
{}
|
|
129717
|
+
);
|
|
129718
|
+
} else {
|
|
129719
|
+
return {};
|
|
129720
|
+
}
|
|
129721
|
+
}
|
|
129722
|
+
async function generateHandler({
|
|
129723
|
+
request,
|
|
129724
|
+
metadata,
|
|
129725
|
+
xServerEnvHeader,
|
|
129726
|
+
logError,
|
|
129727
|
+
findAssetEntryForPath,
|
|
129728
|
+
getAssetKey,
|
|
129729
|
+
negotiateContent,
|
|
129730
|
+
fetchAsset,
|
|
129731
|
+
generateNotFoundResponse = async (notFoundRequest, notFoundFindAssetEntryForPath, notFoundServeAsset) => {
|
|
129732
|
+
let assetEntry;
|
|
129733
|
+
if (assetEntry = await notFoundFindAssetEntryForPath("/index.html")) {
|
|
129734
|
+
return notFoundServeAsset(assetEntry, { preserve: false });
|
|
129735
|
+
}
|
|
129736
|
+
return new NotFoundResponse();
|
|
129737
|
+
},
|
|
129738
|
+
attachAdditionalHeaders = () => {
|
|
129739
|
+
},
|
|
129740
|
+
caches,
|
|
129741
|
+
waitUntil
|
|
129742
|
+
}) {
|
|
129743
|
+
const url3 = new URL(request.url);
|
|
129744
|
+
const { protocol, host, search } = url3;
|
|
129745
|
+
let { pathname } = url3;
|
|
129746
|
+
const earlyHintsCache = metadata.deploymentId ? await caches?.open(`eh:${metadata.deploymentId}`) : void 0;
|
|
129747
|
+
const headerRules = metadata.headers ? normaliseHeaders(metadata.headers) : {};
|
|
129748
|
+
const staticRules = metadata.redirects?.version === REDIRECTS_VERSION2 ? metadata.redirects.staticRules || {} : {};
|
|
129749
|
+
const staticRedirectsMatcher = () => {
|
|
129750
|
+
const withHostMatch = staticRules[`https://${host}${pathname}`];
|
|
129751
|
+
const withoutHostMatch = staticRules[pathname];
|
|
129752
|
+
if (withHostMatch && withoutHostMatch) {
|
|
129753
|
+
if (withHostMatch.lineNumber < withoutHostMatch.lineNumber) {
|
|
129754
|
+
return withHostMatch;
|
|
129755
|
+
} else {
|
|
129756
|
+
return withoutHostMatch;
|
|
129757
|
+
}
|
|
129758
|
+
}
|
|
129759
|
+
return withHostMatch || withoutHostMatch;
|
|
129760
|
+
};
|
|
129761
|
+
const generateRedirectsMatcher = () => generateRulesMatcher(
|
|
129762
|
+
metadata.redirects?.version === REDIRECTS_VERSION2 ? metadata.redirects.rules : {},
|
|
129763
|
+
({ status, to }, replacements) => ({
|
|
129764
|
+
status,
|
|
129765
|
+
to: replacer(to, replacements)
|
|
129766
|
+
})
|
|
129767
|
+
);
|
|
129768
|
+
let assetEntry;
|
|
129769
|
+
async function generateResponse() {
|
|
129770
|
+
const match = staticRedirectsMatcher() || generateRedirectsMatcher()({ request })[0];
|
|
129771
|
+
if (match) {
|
|
129772
|
+
return getResponseFromMatch(match, url3);
|
|
129773
|
+
}
|
|
129774
|
+
if (!request.method.match(/^(get|head)$/i)) {
|
|
129775
|
+
return new MethodNotAllowedResponse();
|
|
129776
|
+
}
|
|
129777
|
+
try {
|
|
129778
|
+
pathname = globalThis.decodeURIComponent(pathname);
|
|
129779
|
+
} catch (err2) {
|
|
129780
|
+
}
|
|
129781
|
+
if (pathname.endsWith("/")) {
|
|
129782
|
+
if (assetEntry = await findAssetEntryForPath(`${pathname}index.html`)) {
|
|
129783
|
+
return serveAsset(assetEntry);
|
|
129784
|
+
} else if (pathname.endsWith("/index/")) {
|
|
129785
|
+
return new PermanentRedirectResponse(
|
|
129786
|
+
`/${pathname.slice(1, -"index/".length)}${search}`
|
|
129787
|
+
);
|
|
129788
|
+
} else if (assetEntry = await findAssetEntryForPath(
|
|
129789
|
+
`${pathname.replace(/\/$/, ".html")}`
|
|
129790
|
+
)) {
|
|
129791
|
+
return new PermanentRedirectResponse(
|
|
129792
|
+
`/${pathname.slice(1, -1)}${search}`
|
|
129793
|
+
);
|
|
129794
|
+
} else {
|
|
129795
|
+
return notFound();
|
|
129796
|
+
}
|
|
129797
|
+
}
|
|
129798
|
+
if (assetEntry = await findAssetEntryForPath(pathname)) {
|
|
129799
|
+
if (pathname.endsWith(".html")) {
|
|
129800
|
+
const extensionlessPath = pathname.slice(0, -".html".length);
|
|
129801
|
+
if (extensionlessPath.endsWith("/index")) {
|
|
129802
|
+
return new PermanentRedirectResponse(
|
|
129803
|
+
`${extensionlessPath.replace(/\/index$/, "/")}${search}`
|
|
129804
|
+
);
|
|
129805
|
+
} else if (await findAssetEntryForPath(extensionlessPath) || extensionlessPath === "/") {
|
|
129806
|
+
return serveAsset(assetEntry);
|
|
129807
|
+
} else {
|
|
129808
|
+
return new PermanentRedirectResponse(`${extensionlessPath}${search}`);
|
|
129809
|
+
}
|
|
129810
|
+
} else {
|
|
129811
|
+
return serveAsset(assetEntry);
|
|
129812
|
+
}
|
|
129813
|
+
} else if (pathname.endsWith("/index")) {
|
|
129814
|
+
return new PermanentRedirectResponse(
|
|
129815
|
+
`/${pathname.slice(1, -"index".length)}${search}`
|
|
129816
|
+
);
|
|
129817
|
+
} else if (assetEntry = await findAssetEntryForPath(`${pathname}.html`)) {
|
|
129818
|
+
return serveAsset(assetEntry);
|
|
129819
|
+
} else if (hasFileExtension(pathname)) {
|
|
129820
|
+
return notFound();
|
|
129821
|
+
}
|
|
129822
|
+
if (assetEntry = await findAssetEntryForPath(`${pathname}/index.html`)) {
|
|
129823
|
+
return new PermanentRedirectResponse(`${pathname}/${search}`);
|
|
129824
|
+
} else {
|
|
129825
|
+
return notFound();
|
|
129826
|
+
}
|
|
129827
|
+
}
|
|
129828
|
+
async function attachHeaders(response) {
|
|
129829
|
+
const existingHeaders = new Headers(response.headers);
|
|
129830
|
+
const extraHeaders = new Headers({
|
|
129831
|
+
"access-control-allow-origin": "*",
|
|
129832
|
+
"referrer-policy": "strict-origin-when-cross-origin",
|
|
129833
|
+
...existingHeaders.has("content-type") ? { "x-content-type-options": "nosniff" } : {}
|
|
129834
|
+
});
|
|
129835
|
+
const headers = new Headers({
|
|
129836
|
+
...Object.fromEntries(existingHeaders.entries()),
|
|
129837
|
+
...Object.fromEntries(extraHeaders.entries())
|
|
129838
|
+
});
|
|
129839
|
+
if (earlyHintsCache) {
|
|
129840
|
+
const preEarlyHintsHeaders = new Headers(headers);
|
|
129841
|
+
const earlyHintsCacheKey = `${protocol}//${host}${pathname}`;
|
|
129842
|
+
const earlyHintsResponse = await earlyHintsCache.match(
|
|
129843
|
+
earlyHintsCacheKey
|
|
129844
|
+
);
|
|
129845
|
+
if (earlyHintsResponse) {
|
|
129846
|
+
const earlyHintsLinkHeader = earlyHintsResponse.headers.get("Link");
|
|
129847
|
+
if (earlyHintsLinkHeader) {
|
|
129848
|
+
headers.set("Link", earlyHintsLinkHeader);
|
|
129849
|
+
}
|
|
129850
|
+
}
|
|
129851
|
+
const clonedResponse = response.clone();
|
|
129852
|
+
if (waitUntil) {
|
|
129853
|
+
waitUntil(
|
|
129854
|
+
(async () => {
|
|
129855
|
+
try {
|
|
129856
|
+
const links = [];
|
|
129857
|
+
const transformedResponse = new HTMLRewriter().on("link[rel~=preconnect],link[rel~=preload]", {
|
|
129858
|
+
element(element) {
|
|
129859
|
+
for (const [attributeName] of element.attributes) {
|
|
129860
|
+
if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes(
|
|
129861
|
+
attributeName.toLowerCase()
|
|
129862
|
+
)) {
|
|
129863
|
+
return;
|
|
129864
|
+
}
|
|
129865
|
+
}
|
|
129866
|
+
const href = element.getAttribute("href") || void 0;
|
|
129867
|
+
const rel = element.getAttribute("rel") || void 0;
|
|
129868
|
+
const as = element.getAttribute("as") || void 0;
|
|
129869
|
+
if (href && !href.startsWith("data:") && rel) {
|
|
129870
|
+
links.push({ href, rel, as });
|
|
129871
|
+
}
|
|
129872
|
+
}
|
|
129873
|
+
}).transform(clonedResponse);
|
|
129874
|
+
await transformedResponse.text();
|
|
129875
|
+
links.forEach(({ href, rel, as }) => {
|
|
129876
|
+
let link = `<${href}>; rel="${rel}"`;
|
|
129877
|
+
if (as) {
|
|
129878
|
+
link += `; as=${as}`;
|
|
129879
|
+
}
|
|
129880
|
+
preEarlyHintsHeaders.append("Link", link);
|
|
129881
|
+
});
|
|
129882
|
+
const linkHeader = preEarlyHintsHeaders.get("Link");
|
|
129883
|
+
if (linkHeader) {
|
|
129884
|
+
await earlyHintsCache.put(
|
|
129885
|
+
earlyHintsCacheKey,
|
|
129886
|
+
new Response(null, { headers: { Link: linkHeader } })
|
|
129887
|
+
);
|
|
129888
|
+
}
|
|
129889
|
+
} catch (err2) {
|
|
129890
|
+
}
|
|
129891
|
+
})()
|
|
129892
|
+
);
|
|
129893
|
+
}
|
|
129894
|
+
}
|
|
129895
|
+
const headersMatcher = generateRulesMatcher(
|
|
129896
|
+
headerRules,
|
|
129897
|
+
({ set = {}, unset = [] }, replacements) => {
|
|
129898
|
+
const replacedSet = {};
|
|
129899
|
+
Object.keys(set).forEach((key2) => {
|
|
129900
|
+
replacedSet[key2] = replacer(set[key2], replacements);
|
|
129901
|
+
});
|
|
129902
|
+
return {
|
|
129903
|
+
set: replacedSet,
|
|
129904
|
+
unset
|
|
129905
|
+
};
|
|
129906
|
+
}
|
|
129907
|
+
);
|
|
129908
|
+
const matches = headersMatcher({ request });
|
|
129909
|
+
const setMap = /* @__PURE__ */ new Set();
|
|
129910
|
+
matches.forEach(({ set = {}, unset = [] }) => {
|
|
129911
|
+
unset.forEach((key2) => {
|
|
129912
|
+
headers.delete(key2);
|
|
129913
|
+
});
|
|
129914
|
+
Object.keys(set).forEach((key2) => {
|
|
129915
|
+
if (setMap.has(key2.toLowerCase())) {
|
|
129916
|
+
headers.append(key2, set[key2]);
|
|
129917
|
+
} else {
|
|
129918
|
+
headers.set(key2, set[key2]);
|
|
129919
|
+
setMap.add(key2.toLowerCase());
|
|
129920
|
+
}
|
|
129921
|
+
});
|
|
129922
|
+
});
|
|
129923
|
+
return new Response(
|
|
129924
|
+
[101, 204, 205, 304].includes(response.status) ? null : response.body,
|
|
129925
|
+
{
|
|
129926
|
+
headers,
|
|
129927
|
+
status: response.status,
|
|
129928
|
+
statusText: response.statusText
|
|
129929
|
+
}
|
|
129930
|
+
);
|
|
129931
|
+
}
|
|
129932
|
+
return await attachHeaders(await generateResponse());
|
|
129933
|
+
async function serveAsset(servingAssetEntry, options6 = { preserve: true }) {
|
|
129934
|
+
let content;
|
|
129935
|
+
try {
|
|
129936
|
+
content = negotiateContent(request, servingAssetEntry);
|
|
129937
|
+
} catch (err2) {
|
|
129938
|
+
return new NotAcceptableResponse();
|
|
129939
|
+
}
|
|
129940
|
+
const assetKey = getAssetKey(servingAssetEntry, content);
|
|
129941
|
+
const etag = `"${assetKey}"`;
|
|
129942
|
+
const weakEtag = `W/${etag}`;
|
|
129943
|
+
const ifNoneMatch = request.headers.get("if-none-match");
|
|
129944
|
+
if (ifNoneMatch === weakEtag || ifNoneMatch === etag) {
|
|
129945
|
+
return new NotModifiedResponse();
|
|
129946
|
+
}
|
|
129947
|
+
try {
|
|
129948
|
+
const asset = await fetchAsset(assetKey);
|
|
129949
|
+
const headers = {
|
|
129950
|
+
etag,
|
|
129951
|
+
"content-type": asset.contentType
|
|
129952
|
+
};
|
|
129953
|
+
let encodeBody = "automatic";
|
|
129954
|
+
if (xServerEnvHeader) {
|
|
129955
|
+
headers["x-server-env"] = xServerEnvHeader;
|
|
129956
|
+
}
|
|
129957
|
+
if (content.encoding) {
|
|
129958
|
+
encodeBody = "manual";
|
|
129959
|
+
headers["cache-control"] = "no-transform";
|
|
129960
|
+
headers["content-encoding"] = content.encoding;
|
|
129961
|
+
}
|
|
129962
|
+
const response = new OkResponse(
|
|
129963
|
+
request.method === "HEAD" ? null : asset.body,
|
|
129964
|
+
{
|
|
129965
|
+
headers,
|
|
129966
|
+
encodeBody
|
|
129967
|
+
}
|
|
129968
|
+
);
|
|
129969
|
+
if (isCacheable(request)) {
|
|
129970
|
+
response.headers.append("cache-control", CACHE_CONTROL_BROWSER);
|
|
129971
|
+
}
|
|
129972
|
+
attachAdditionalHeaders(response, content, servingAssetEntry, asset);
|
|
129973
|
+
if (isPreview(new URL(request.url))) {
|
|
129974
|
+
response.headers.set("x-robots-tag", "noindex");
|
|
129975
|
+
}
|
|
129976
|
+
if (options6.preserve) {
|
|
129977
|
+
const preservedResponse = new Response(
|
|
129978
|
+
[101, 204, 205, 304].includes(response.status) ? null : response.clone().body,
|
|
129979
|
+
response
|
|
129980
|
+
);
|
|
129981
|
+
preservedResponse.headers.set(
|
|
129982
|
+
"cache-control",
|
|
129983
|
+
CACHE_CONTROL_PRESERVATION
|
|
129984
|
+
);
|
|
129985
|
+
preservedResponse.headers.set("x-robots-tag", "noindex");
|
|
129986
|
+
if (waitUntil && caches) {
|
|
129987
|
+
waitUntil(
|
|
129988
|
+
caches.open(ASSET_PRESERVATION_CACHE).then(
|
|
129989
|
+
(assetPreservationCache) => assetPreservationCache.put(request.url, preservedResponse)
|
|
129990
|
+
).catch((err2) => {
|
|
129991
|
+
logError(err2);
|
|
129992
|
+
})
|
|
129993
|
+
);
|
|
129994
|
+
}
|
|
129995
|
+
}
|
|
129996
|
+
if (asset.contentType.startsWith("text/html") && metadata.analytics?.version === ANALYTICS_VERSION2) {
|
|
129997
|
+
return new HTMLRewriter().on("body", {
|
|
129998
|
+
element(e2) {
|
|
129999
|
+
e2.append(
|
|
130000
|
+
`<!-- Cloudflare Pages Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "${metadata.analytics?.token}"}'><\/script><!-- Cloudflare Pages Analytics -->`,
|
|
130001
|
+
{ html: true }
|
|
130002
|
+
);
|
|
130003
|
+
}
|
|
130004
|
+
}).transform(response);
|
|
130005
|
+
}
|
|
130006
|
+
return response;
|
|
130007
|
+
} catch (err2) {
|
|
130008
|
+
logError(err2);
|
|
130009
|
+
return new InternalServerErrorResponse(err2);
|
|
130010
|
+
}
|
|
130011
|
+
}
|
|
130012
|
+
async function notFound() {
|
|
130013
|
+
if (caches) {
|
|
130014
|
+
const assetPreservationCache = await caches.open(
|
|
130015
|
+
ASSET_PRESERVATION_CACHE
|
|
130016
|
+
);
|
|
130017
|
+
const preservedResponse = await assetPreservationCache.match(request.url);
|
|
130018
|
+
if (preservedResponse) {
|
|
130019
|
+
return preservedResponse;
|
|
130020
|
+
}
|
|
130021
|
+
}
|
|
130022
|
+
let cwd2 = pathname;
|
|
130023
|
+
while (cwd2) {
|
|
130024
|
+
cwd2 = cwd2.slice(0, cwd2.lastIndexOf("/"));
|
|
130025
|
+
if (assetEntry = await findAssetEntryForPath(`${cwd2}/404.html`)) {
|
|
130026
|
+
let content;
|
|
130027
|
+
try {
|
|
130028
|
+
content = negotiateContent(request, assetEntry);
|
|
130029
|
+
} catch (err2) {
|
|
130030
|
+
return new NotAcceptableResponse();
|
|
130031
|
+
}
|
|
130032
|
+
const assetKey = getAssetKey(assetEntry, content);
|
|
130033
|
+
try {
|
|
130034
|
+
const { body, contentType } = await fetchAsset(assetKey);
|
|
130035
|
+
const response = new NotFoundResponse(body);
|
|
130036
|
+
response.headers.set("content-type", contentType);
|
|
130037
|
+
return response;
|
|
130038
|
+
} catch (err2) {
|
|
130039
|
+
logError(err2);
|
|
130040
|
+
return new InternalServerErrorResponse(err2);
|
|
130041
|
+
}
|
|
130042
|
+
}
|
|
130043
|
+
}
|
|
130044
|
+
return await generateNotFoundResponse(
|
|
130045
|
+
request,
|
|
130046
|
+
findAssetEntryForPath,
|
|
130047
|
+
serveAsset
|
|
130048
|
+
);
|
|
130049
|
+
}
|
|
130050
|
+
}
|
|
130051
|
+
function getResponseFromMatch({
|
|
130052
|
+
status,
|
|
130053
|
+
to
|
|
130054
|
+
}, requestUrl) {
|
|
130055
|
+
const destination = new URL(to, requestUrl);
|
|
130056
|
+
destination.search = destination.search || requestUrl.search;
|
|
130057
|
+
const location = destination.origin === requestUrl.origin ? stringifyURLToRootRelativePathname(destination) : destination.toString();
|
|
130058
|
+
switch (status) {
|
|
130059
|
+
case 301:
|
|
130060
|
+
return new MovedPermanentlyResponse(location);
|
|
130061
|
+
case 303:
|
|
130062
|
+
return new SeeOtherResponse(location);
|
|
130063
|
+
case 307:
|
|
130064
|
+
return new TemporaryRedirectResponse(location);
|
|
130065
|
+
case 308:
|
|
130066
|
+
return new PermanentRedirectResponse(location);
|
|
130067
|
+
case 302:
|
|
130068
|
+
default:
|
|
130069
|
+
return new FoundResponse(location);
|
|
130070
|
+
}
|
|
130071
|
+
}
|
|
130072
|
+
function parseQualityWeightedList(list = "") {
|
|
130073
|
+
const items = {};
|
|
130074
|
+
list.replace(/\s/g, "").split(",").forEach((el) => {
|
|
130075
|
+
const [item, weight] = el.split(";q=");
|
|
130076
|
+
items[item] = weight ? parseFloat(weight) : 1;
|
|
130077
|
+
});
|
|
130078
|
+
return items;
|
|
130079
|
+
}
|
|
130080
|
+
function isCacheable(request) {
|
|
130081
|
+
return !request.headers.has("authorization") && !request.headers.has("range");
|
|
130082
|
+
}
|
|
130083
|
+
function hasFileExtension(path41) {
|
|
130084
|
+
return /\/.+\.[a-z0-9]+$/i.test(path41);
|
|
130085
|
+
}
|
|
130086
|
+
function isPreview(url3) {
|
|
130087
|
+
if (url3.hostname.endsWith(".pages.dev")) {
|
|
130088
|
+
return url3.hostname.split(".").length > 3 ? true : false;
|
|
130089
|
+
}
|
|
130090
|
+
return false;
|
|
130091
|
+
}
|
|
130092
|
+
var ASSET_PRESERVATION_CACHE, CACHE_CONTROL_PRESERVATION, CACHE_CONTROL_BROWSER, REDIRECTS_VERSION2, HEADERS_VERSION2, HEADERS_VERSION_V1, ANALYTICS_VERSION2, ALLOWED_EARLY_HINT_LINK_ATTRIBUTES;
|
|
130093
|
+
var init_handler = __esm({
|
|
130094
|
+
"../pages-shared/asset-server/handler.ts"() {
|
|
130095
|
+
init_import_meta_url();
|
|
130096
|
+
init_responses();
|
|
130097
|
+
init_rulesEngine();
|
|
130098
|
+
init_url();
|
|
130099
|
+
ASSET_PRESERVATION_CACHE = "assetPreservationCache";
|
|
130100
|
+
CACHE_CONTROL_PRESERVATION = "public, s-maxage=604800";
|
|
130101
|
+
CACHE_CONTROL_BROWSER = "public, max-age=0, must-revalidate";
|
|
130102
|
+
REDIRECTS_VERSION2 = 1;
|
|
130103
|
+
HEADERS_VERSION2 = 2;
|
|
130104
|
+
HEADERS_VERSION_V1 = 1;
|
|
130105
|
+
ANALYTICS_VERSION2 = 1;
|
|
130106
|
+
ALLOWED_EARLY_HINT_LINK_ATTRIBUTES = ["rel", "as", "href"];
|
|
130107
|
+
}
|
|
130108
|
+
});
|
|
130109
|
+
|
|
129355
130110
|
// ../../node_modules/glob-to-regexp/index.js
|
|
129356
130111
|
var require_glob_to_regexp = __commonJS({
|
|
129357
130112
|
"../../node_modules/glob-to-regexp/index.js"(exports2, module2) {
|
|
@@ -130941,7 +131696,7 @@ var require_util5 = __commonJS({
|
|
|
130941
131696
|
"../../node_modules/ink-text-input/node_modules/chalk/source/util.js"(exports2, module2) {
|
|
130942
131697
|
"use strict";
|
|
130943
131698
|
init_import_meta_url();
|
|
130944
|
-
var stringReplaceAll = (string, substring,
|
|
131699
|
+
var stringReplaceAll = (string, substring, replacer2) => {
|
|
130945
131700
|
let index = string.indexOf(substring);
|
|
130946
131701
|
if (index === -1) {
|
|
130947
131702
|
return string;
|
|
@@ -130950,7 +131705,7 @@ var require_util5 = __commonJS({
|
|
|
130950
131705
|
let endIndex = 0;
|
|
130951
131706
|
let returnValue = "";
|
|
130952
131707
|
do {
|
|
130953
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring +
|
|
131708
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer2;
|
|
130954
131709
|
endIndex = index + substringLength;
|
|
130955
131710
|
index = string.indexOf(substring, endIndex);
|
|
130956
131711
|
} while (index !== -1);
|
|
@@ -133072,87 +133827,6 @@ var require_build5 = __commonJS({
|
|
|
133072
133827
|
}
|
|
133073
133828
|
});
|
|
133074
133829
|
|
|
133075
|
-
// ../../node_modules/mime/Mime.js
|
|
133076
|
-
var require_Mime = __commonJS({
|
|
133077
|
-
"../../node_modules/mime/Mime.js"(exports2, module2) {
|
|
133078
|
-
"use strict";
|
|
133079
|
-
init_import_meta_url();
|
|
133080
|
-
function Mime() {
|
|
133081
|
-
this._types = /* @__PURE__ */ Object.create(null);
|
|
133082
|
-
this._extensions = /* @__PURE__ */ Object.create(null);
|
|
133083
|
-
for (let i2 = 0; i2 < arguments.length; i2++) {
|
|
133084
|
-
this.define(arguments[i2]);
|
|
133085
|
-
}
|
|
133086
|
-
this.define = this.define.bind(this);
|
|
133087
|
-
this.getType = this.getType.bind(this);
|
|
133088
|
-
this.getExtension = this.getExtension.bind(this);
|
|
133089
|
-
}
|
|
133090
|
-
Mime.prototype.define = function(typeMap, force) {
|
|
133091
|
-
for (let type2 in typeMap) {
|
|
133092
|
-
let extensions = typeMap[type2].map(function(t2) {
|
|
133093
|
-
return t2.toLowerCase();
|
|
133094
|
-
});
|
|
133095
|
-
type2 = type2.toLowerCase();
|
|
133096
|
-
for (let i2 = 0; i2 < extensions.length; i2++) {
|
|
133097
|
-
const ext = extensions[i2];
|
|
133098
|
-
if (ext[0] === "*") {
|
|
133099
|
-
continue;
|
|
133100
|
-
}
|
|
133101
|
-
if (!force && ext in this._types) {
|
|
133102
|
-
throw new Error(
|
|
133103
|
-
'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type2 + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type2 + '".'
|
|
133104
|
-
);
|
|
133105
|
-
}
|
|
133106
|
-
this._types[ext] = type2;
|
|
133107
|
-
}
|
|
133108
|
-
if (force || !this._extensions[type2]) {
|
|
133109
|
-
const ext = extensions[0];
|
|
133110
|
-
this._extensions[type2] = ext[0] !== "*" ? ext : ext.substr(1);
|
|
133111
|
-
}
|
|
133112
|
-
}
|
|
133113
|
-
};
|
|
133114
|
-
Mime.prototype.getType = function(path41) {
|
|
133115
|
-
path41 = String(path41);
|
|
133116
|
-
let last = path41.replace(/^.*[/\\]/, "").toLowerCase();
|
|
133117
|
-
let ext = last.replace(/^.*\./, "").toLowerCase();
|
|
133118
|
-
let hasPath = last.length < path41.length;
|
|
133119
|
-
let hasDot = ext.length < last.length - 1;
|
|
133120
|
-
return (hasDot || !hasPath) && this._types[ext] || null;
|
|
133121
|
-
};
|
|
133122
|
-
Mime.prototype.getExtension = function(type2) {
|
|
133123
|
-
type2 = /^\s*([^;\s]*)/.test(type2) && RegExp.$1;
|
|
133124
|
-
return type2 && this._extensions[type2.toLowerCase()] || null;
|
|
133125
|
-
};
|
|
133126
|
-
module2.exports = Mime;
|
|
133127
|
-
}
|
|
133128
|
-
});
|
|
133129
|
-
|
|
133130
|
-
// ../../node_modules/mime/types/standard.js
|
|
133131
|
-
var require_standard = __commonJS({
|
|
133132
|
-
"../../node_modules/mime/types/standard.js"(exports2, module2) {
|
|
133133
|
-
init_import_meta_url();
|
|
133134
|
-
module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
|
|
133135
|
-
}
|
|
133136
|
-
});
|
|
133137
|
-
|
|
133138
|
-
// ../../node_modules/mime/types/other.js
|
|
133139
|
-
var require_other = __commonJS({
|
|
133140
|
-
"../../node_modules/mime/types/other.js"(exports2, module2) {
|
|
133141
|
-
init_import_meta_url();
|
|
133142
|
-
module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
|
|
133143
|
-
}
|
|
133144
|
-
});
|
|
133145
|
-
|
|
133146
|
-
// ../../node_modules/mime/index.js
|
|
133147
|
-
var require_mime2 = __commonJS({
|
|
133148
|
-
"../../node_modules/mime/index.js"(exports2, module2) {
|
|
133149
|
-
"use strict";
|
|
133150
|
-
init_import_meta_url();
|
|
133151
|
-
var Mime = require_Mime();
|
|
133152
|
-
module2.exports = new Mime(require_standard(), require_other());
|
|
133153
|
-
}
|
|
133154
|
-
});
|
|
133155
|
-
|
|
133156
133830
|
// node_modules/minimatch/lib/path.js
|
|
133157
133831
|
var require_path = __commonJS({
|
|
133158
133832
|
"node_modules/minimatch/lib/path.js"(exports2, module2) {
|
|
@@ -134642,7 +135316,7 @@ var require_rc = __commonJS({
|
|
|
134642
135316
|
"../../node_modules/rc/index.js"(exports2, module2) {
|
|
134643
135317
|
init_import_meta_url();
|
|
134644
135318
|
var cc = require_utils5();
|
|
134645
|
-
var
|
|
135319
|
+
var join14 = require("path").join;
|
|
134646
135320
|
var deepExtend = require_deep_extend();
|
|
134647
135321
|
var etc = "/etc";
|
|
134648
135322
|
var win = process.platform === "win32";
|
|
@@ -134668,15 +135342,15 @@ var require_rc = __commonJS({
|
|
|
134668
135342
|
}
|
|
134669
135343
|
if (!win)
|
|
134670
135344
|
[
|
|
134671
|
-
|
|
134672
|
-
|
|
135345
|
+
join14(etc, name, "config"),
|
|
135346
|
+
join14(etc, name + "rc")
|
|
134673
135347
|
].forEach(addConfigFile);
|
|
134674
135348
|
if (home)
|
|
134675
135349
|
[
|
|
134676
|
-
|
|
134677
|
-
|
|
134678
|
-
|
|
134679
|
-
|
|
135350
|
+
join14(home, ".config", name, "config"),
|
|
135351
|
+
join14(home, ".config", name),
|
|
135352
|
+
join14(home, "." + name, "config"),
|
|
135353
|
+
join14(home, "." + name + "rc")
|
|
134680
135354
|
].forEach(addConfigFile);
|
|
134681
135355
|
addConfigFile(cc.find("." + name + "rc"));
|
|
134682
135356
|
if (env5.config)
|
|
@@ -134879,7 +135553,7 @@ var require_update_check = __commonJS({
|
|
|
134879
135553
|
"../../node_modules/update-check/index.js"(exports2, module2) {
|
|
134880
135554
|
init_import_meta_url();
|
|
134881
135555
|
var { URL: URL4 } = require("url");
|
|
134882
|
-
var { join:
|
|
135556
|
+
var { join: join14 } = require("path");
|
|
134883
135557
|
var fs18 = require("fs");
|
|
134884
135558
|
var { promisify: promisify2 } = require("util");
|
|
134885
135559
|
var { tmpdir: tmpdir4 } = require("os");
|
|
@@ -134891,7 +135565,7 @@ var require_update_check = __commonJS({
|
|
|
134891
135565
|
var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
|
|
134892
135566
|
var getFile = async (details, distTag) => {
|
|
134893
135567
|
const rootDir = tmpdir4();
|
|
134894
|
-
const subDir =
|
|
135568
|
+
const subDir = join14(rootDir, "update-check");
|
|
134895
135569
|
if (!fs18.existsSync(subDir)) {
|
|
134896
135570
|
await mkdir4(subDir);
|
|
134897
135571
|
}
|
|
@@ -134899,7 +135573,7 @@ var require_update_check = __commonJS({
|
|
|
134899
135573
|
if (details.scope) {
|
|
134900
135574
|
name = `${details.scope}-${name}`;
|
|
134901
135575
|
}
|
|
134902
|
-
return
|
|
135576
|
+
return join14(subDir, name);
|
|
134903
135577
|
};
|
|
134904
135578
|
var evaluateCache = async (file, time, interval2) => {
|
|
134905
135579
|
if (fs18.existsSync(file)) {
|
|
@@ -136694,9 +137368,9 @@ var import_undici12 = __toESM(require_undici());
|
|
|
136694
137368
|
|
|
136695
137369
|
// src/dev.tsx
|
|
136696
137370
|
init_import_meta_url();
|
|
136697
|
-
var
|
|
137371
|
+
var import_node_path39 = __toESM(require("node:path"));
|
|
136698
137372
|
var import_chalk8 = __toESM(require_chalk());
|
|
136699
|
-
var
|
|
137373
|
+
var import_chokidar5 = require("chokidar");
|
|
136700
137374
|
|
|
136701
137375
|
// ../../node_modules/get-port/index.js
|
|
136702
137376
|
init_import_meta_url();
|
|
@@ -138541,6 +139215,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, envNam
|
|
|
138541
139215
|
validateBindingArray(envName, validateServiceBinding),
|
|
138542
139216
|
[]
|
|
138543
139217
|
),
|
|
139218
|
+
analytics_engine_datasets: notInheritable(
|
|
139219
|
+
diagnostics,
|
|
139220
|
+
topLevelEnv,
|
|
139221
|
+
rawConfig,
|
|
139222
|
+
rawEnv,
|
|
139223
|
+
envName,
|
|
139224
|
+
"analytics_engine_datasets",
|
|
139225
|
+
validateBindingArray(envName, validateAnalyticsEngineBinding),
|
|
139226
|
+
[]
|
|
139227
|
+
),
|
|
138544
139228
|
dispatch_namespaces: notInheritable(
|
|
138545
139229
|
diagnostics,
|
|
138546
139230
|
topLevelEnv,
|
|
@@ -139126,6 +139810,7 @@ var validateBindingsHaveUniqueNames = (diagnostics, {
|
|
|
139126
139810
|
durable_objects,
|
|
139127
139811
|
kv_namespaces,
|
|
139128
139812
|
r2_buckets,
|
|
139813
|
+
analytics_engine_datasets,
|
|
139129
139814
|
text_blobs,
|
|
139130
139815
|
unsafe,
|
|
139131
139816
|
vars,
|
|
@@ -139138,6 +139823,7 @@ var validateBindingsHaveUniqueNames = (diagnostics, {
|
|
|
139138
139823
|
"Durable Object": getBindingNames(durable_objects),
|
|
139139
139824
|
"KV Namespace": getBindingNames(kv_namespaces),
|
|
139140
139825
|
"R2 Bucket": getBindingNames(r2_buckets),
|
|
139826
|
+
"Analytics Engine Dataset": getBindingNames(analytics_engine_datasets),
|
|
139141
139827
|
"Text Blob": getBindingNames(text_blobs),
|
|
139142
139828
|
Unsafe: getBindingNames(unsafe),
|
|
139143
139829
|
"Environment Variable": getBindingNames(vars),
|
|
@@ -139220,6 +139906,34 @@ var validateServiceBinding = (diagnostics, field, value) => {
|
|
|
139220
139906
|
}
|
|
139221
139907
|
return isValid;
|
|
139222
139908
|
};
|
|
139909
|
+
var validateAnalyticsEngineBinding = (diagnostics, field, value) => {
|
|
139910
|
+
if (typeof value !== "object" || value === null) {
|
|
139911
|
+
diagnostics.errors.push(
|
|
139912
|
+
`"analytics_engine" bindings should be objects, but got ${JSON.stringify(
|
|
139913
|
+
value
|
|
139914
|
+
)}`
|
|
139915
|
+
);
|
|
139916
|
+
return false;
|
|
139917
|
+
}
|
|
139918
|
+
let isValid = true;
|
|
139919
|
+
if (!isRequiredProperty(value, "binding", "string")) {
|
|
139920
|
+
diagnostics.errors.push(
|
|
139921
|
+
`"${field}" bindings should have a string "binding" field but got ${JSON.stringify(
|
|
139922
|
+
value
|
|
139923
|
+
)}.`
|
|
139924
|
+
);
|
|
139925
|
+
isValid = false;
|
|
139926
|
+
}
|
|
139927
|
+
if (!isOptionalProperty(value, "dataset", "string") || value.dataset?.length === 0) {
|
|
139928
|
+
diagnostics.errors.push(
|
|
139929
|
+
`"${field}" bindings should, optionally, have a string "dataset" field but got ${JSON.stringify(
|
|
139930
|
+
value
|
|
139931
|
+
)}.`
|
|
139932
|
+
);
|
|
139933
|
+
isValid = false;
|
|
139934
|
+
}
|
|
139935
|
+
return isValid;
|
|
139936
|
+
};
|
|
139223
139937
|
var validateWorkerNamespaceBinding = (diagnostics, field, value) => {
|
|
139224
139938
|
if (typeof value !== "object" || value === null) {
|
|
139225
139939
|
diagnostics.errors.push(
|
|
@@ -139383,6 +140097,7 @@ function printBindings(bindings) {
|
|
|
139383
140097
|
r2_buckets,
|
|
139384
140098
|
logfwdr,
|
|
139385
140099
|
services,
|
|
140100
|
+
analytics_engine_datasets,
|
|
139386
140101
|
text_blobs,
|
|
139387
140102
|
unsafe,
|
|
139388
140103
|
vars,
|
|
@@ -139443,12 +140158,21 @@ function printBindings(bindings) {
|
|
|
139443
140158
|
if (d1_databases !== void 0 && d1_databases.length > 0) {
|
|
139444
140159
|
output.push({
|
|
139445
140160
|
type: "D1 Databases",
|
|
139446
|
-
entries: d1_databases.map(
|
|
139447
|
-
|
|
139448
|
-
|
|
139449
|
-
|
|
139450
|
-
|
|
139451
|
-
|
|
140161
|
+
entries: d1_databases.map(
|
|
140162
|
+
({ binding, database_name, database_id, preview_database_id }) => {
|
|
140163
|
+
let databaseValue = `${database_id}`;
|
|
140164
|
+
if (database_name) {
|
|
140165
|
+
databaseValue = `${database_name} (${database_id})`;
|
|
140166
|
+
}
|
|
140167
|
+
if (preview_database_id) {
|
|
140168
|
+
databaseValue += `, Preview: (${preview_database_id})`;
|
|
140169
|
+
}
|
|
140170
|
+
return {
|
|
140171
|
+
key: removeD1BetaPrefix(binding),
|
|
140172
|
+
value: databaseValue
|
|
140173
|
+
};
|
|
140174
|
+
}
|
|
140175
|
+
)
|
|
139452
140176
|
});
|
|
139453
140177
|
}
|
|
139454
140178
|
if (r2_buckets !== void 0 && r2_buckets.length > 0) {
|
|
@@ -139488,6 +140212,17 @@ function printBindings(bindings) {
|
|
|
139488
140212
|
})
|
|
139489
140213
|
});
|
|
139490
140214
|
}
|
|
140215
|
+
if (analytics_engine_datasets !== void 0 && analytics_engine_datasets.length > 0) {
|
|
140216
|
+
output.push({
|
|
140217
|
+
type: "Analytics Engine Datasets",
|
|
140218
|
+
entries: analytics_engine_datasets.map(({ binding, dataset }) => {
|
|
140219
|
+
return {
|
|
140220
|
+
key: binding,
|
|
140221
|
+
value: dataset ?? binding
|
|
140222
|
+
};
|
|
140223
|
+
})
|
|
140224
|
+
});
|
|
140225
|
+
}
|
|
139491
140226
|
if (text_blobs !== void 0 && Object.keys(text_blobs).length > 0) {
|
|
139492
140227
|
output.push({
|
|
139493
140228
|
type: "Text Blobs",
|
|
@@ -139586,7 +140321,7 @@ init_import_meta_url();
|
|
|
139586
140321
|
var import_node_child_process3 = require("node:child_process");
|
|
139587
140322
|
var path19 = __toESM(require("node:path"));
|
|
139588
140323
|
var util = __toESM(require("node:util"));
|
|
139589
|
-
var
|
|
140324
|
+
var import_chokidar3 = require("chokidar");
|
|
139590
140325
|
|
|
139591
140326
|
// ../../node_modules/clipboardy/index.js
|
|
139592
140327
|
init_import_meta_url();
|
|
@@ -141160,7 +141895,7 @@ var import_websocket_server = __toESM(require_websocket_server2(), 1);
|
|
|
141160
141895
|
var wrapper_default = import_websocket.default;
|
|
141161
141896
|
|
|
141162
141897
|
// package.json
|
|
141163
|
-
var version = "2.
|
|
141898
|
+
var version = "2.6.1";
|
|
141164
141899
|
var package_default = {
|
|
141165
141900
|
name: "wrangler",
|
|
141166
141901
|
version,
|
|
@@ -141282,7 +142017,7 @@ var package_default = {
|
|
|
141282
142017
|
"@databases/sql": "^3.2.0",
|
|
141283
142018
|
"@iarna/toml": "^3.0.0",
|
|
141284
142019
|
"@microsoft/api-extractor": "^7.28.3",
|
|
141285
|
-
"@miniflare/tre": "^3.0.0-next.
|
|
142020
|
+
"@miniflare/tre": "^3.0.0-next.8",
|
|
141286
142021
|
"@types/better-sqlite3": "^7.6.0",
|
|
141287
142022
|
"@types/busboy": "^1.5.0",
|
|
141288
142023
|
"@types/command-exists": "^1.2.0",
|
|
@@ -141325,7 +142060,7 @@ var package_default = {
|
|
|
141325
142060
|
"jest-websocket-mock": "^2.3.0",
|
|
141326
142061
|
mime: "^3.0.0",
|
|
141327
142062
|
minimatch: "^5.1.0",
|
|
141328
|
-
msw: "^0.
|
|
142063
|
+
msw: "^0.49.1",
|
|
141329
142064
|
"npx-import": "^1.1.3",
|
|
141330
142065
|
open: "^8.4.0",
|
|
141331
142066
|
"p-queue": "^7.2.0",
|
|
@@ -142478,9 +143213,9 @@ async function openInBrowser(url3) {
|
|
|
142478
143213
|
init_import_meta_url();
|
|
142479
143214
|
var import_node_assert5 = __toESM(require("node:assert"));
|
|
142480
143215
|
var import_node_child_process2 = require("node:child_process");
|
|
142481
|
-
var
|
|
143216
|
+
var import_node_fs8 = require("node:fs");
|
|
142482
143217
|
var import_promises3 = require("node:fs/promises");
|
|
142483
|
-
var
|
|
143218
|
+
var import_node_path17 = __toESM(require("node:path"));
|
|
142484
143219
|
var import_chalk = __toESM(require_chalk());
|
|
142485
143220
|
|
|
142486
143221
|
// ../../node_modules/npx-import/lib/index.js
|
|
@@ -143789,11 +144524,590 @@ async function fetchDashboardScript(resource, bodyInit = {}) {
|
|
|
143789
144524
|
}
|
|
143790
144525
|
}
|
|
143791
144526
|
|
|
144527
|
+
// src/miniflare-cli/assets.ts
|
|
144528
|
+
init_import_meta_url();
|
|
144529
|
+
var import_node_fs7 = require("node:fs");
|
|
144530
|
+
var import_node_path15 = require("node:path");
|
|
144531
|
+
|
|
144532
|
+
// ../pages-shared/metadata-generator/createMetadataObject.ts
|
|
144533
|
+
init_import_meta_url();
|
|
144534
|
+
|
|
144535
|
+
// ../pages-shared/metadata-generator/constants.ts
|
|
144536
|
+
init_import_meta_url();
|
|
144537
|
+
var REDIRECTS_VERSION = 1;
|
|
144538
|
+
var HEADERS_VERSION = 2;
|
|
144539
|
+
var ANALYTICS_VERSION = 1;
|
|
144540
|
+
var PERMITTED_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
144541
|
+
var HEADER_SEPARATOR = ":";
|
|
144542
|
+
var MAX_LINE_LENGTH = 2e3;
|
|
144543
|
+
var MAX_HEADER_RULES = 100;
|
|
144544
|
+
var MAX_DYNAMIC_REDIRECT_RULES = 100;
|
|
144545
|
+
var MAX_STATIC_REDIRECT_RULES = 2e3;
|
|
144546
|
+
var UNSET_OPERATOR = "! ";
|
|
144547
|
+
var SPLAT_REGEX = /\*/g;
|
|
144548
|
+
var PLACEHOLDER_REGEX = /:\w+/g;
|
|
144549
|
+
|
|
144550
|
+
// ../pages-shared/metadata-generator/createMetadataObject.ts
|
|
144551
|
+
function createMetadataObject({
|
|
144552
|
+
redirects,
|
|
144553
|
+
headers,
|
|
144554
|
+
webAnalyticsToken,
|
|
144555
|
+
deploymentId,
|
|
144556
|
+
failOpen,
|
|
144557
|
+
logger: logger2 = (_message) => {
|
|
144558
|
+
}
|
|
144559
|
+
}) {
|
|
144560
|
+
return {
|
|
144561
|
+
...constructRedirects({ redirects, logger: logger2 }),
|
|
144562
|
+
...constructHeaders({ headers, logger: logger2 }),
|
|
144563
|
+
...constructWebAnalytics({ webAnalyticsToken, logger: logger2 }),
|
|
144564
|
+
deploymentId,
|
|
144565
|
+
failOpen
|
|
144566
|
+
};
|
|
144567
|
+
}
|
|
144568
|
+
function constructRedirects({
|
|
144569
|
+
redirects,
|
|
144570
|
+
logger: logger2
|
|
144571
|
+
}) {
|
|
144572
|
+
if (!redirects)
|
|
144573
|
+
return {};
|
|
144574
|
+
const num_valid = redirects.rules.length;
|
|
144575
|
+
const num_invalid = redirects.invalid.length;
|
|
144576
|
+
logger2(
|
|
144577
|
+
`Parsed ${num_valid} valid redirect rule${num_valid === 1 ? "" : "s"}.`
|
|
144578
|
+
);
|
|
144579
|
+
if (num_invalid > 0) {
|
|
144580
|
+
logger2(`Found invalid redirect lines:`);
|
|
144581
|
+
for (const { line, lineNumber, message } of redirects.invalid) {
|
|
144582
|
+
if (line)
|
|
144583
|
+
logger2(` - ${lineNumber ? `#${lineNumber}: ` : ""}${line}`);
|
|
144584
|
+
logger2(` ${message}`);
|
|
144585
|
+
}
|
|
144586
|
+
}
|
|
144587
|
+
if (num_valid === 0) {
|
|
144588
|
+
return {};
|
|
144589
|
+
}
|
|
144590
|
+
const staticRedirects = {};
|
|
144591
|
+
const dynamicRedirects = {};
|
|
144592
|
+
let canCreateStaticRule = true;
|
|
144593
|
+
for (const rule of redirects.rules) {
|
|
144594
|
+
if (!rule.from.match(SPLAT_REGEX) && !rule.from.match(PLACEHOLDER_REGEX)) {
|
|
144595
|
+
if (canCreateStaticRule) {
|
|
144596
|
+
staticRedirects[rule.from] = {
|
|
144597
|
+
status: rule.status,
|
|
144598
|
+
to: rule.to,
|
|
144599
|
+
lineNumber: rule.lineNumber
|
|
144600
|
+
};
|
|
144601
|
+
continue;
|
|
144602
|
+
} else {
|
|
144603
|
+
logger2(
|
|
144604
|
+
`Info: the redirect rule ${rule.from} \u2192 ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.`
|
|
144605
|
+
);
|
|
144606
|
+
}
|
|
144607
|
+
}
|
|
144608
|
+
dynamicRedirects[rule.from] = { status: rule.status, to: rule.to };
|
|
144609
|
+
canCreateStaticRule = false;
|
|
144610
|
+
}
|
|
144611
|
+
return {
|
|
144612
|
+
redirects: {
|
|
144613
|
+
version: REDIRECTS_VERSION,
|
|
144614
|
+
staticRules: staticRedirects,
|
|
144615
|
+
rules: dynamicRedirects
|
|
144616
|
+
}
|
|
144617
|
+
};
|
|
144618
|
+
}
|
|
144619
|
+
function constructHeaders({
|
|
144620
|
+
headers,
|
|
144621
|
+
logger: logger2
|
|
144622
|
+
}) {
|
|
144623
|
+
if (!headers)
|
|
144624
|
+
return {};
|
|
144625
|
+
const num_valid = headers.rules.length;
|
|
144626
|
+
const num_invalid = headers.invalid.length;
|
|
144627
|
+
logger2(`Parsed ${num_valid} valid header rule${num_valid === 1 ? "" : "s"}.`);
|
|
144628
|
+
if (num_invalid > 0) {
|
|
144629
|
+
logger2(`Found invalid header lines:`);
|
|
144630
|
+
for (const { line, lineNumber, message } of headers.invalid) {
|
|
144631
|
+
if (line)
|
|
144632
|
+
logger2(` - ${lineNumber ? `#${lineNumber}: ` : ""} ${line}`);
|
|
144633
|
+
logger2(` ${message}`);
|
|
144634
|
+
}
|
|
144635
|
+
}
|
|
144636
|
+
if (num_valid === 0) {
|
|
144637
|
+
return {};
|
|
144638
|
+
}
|
|
144639
|
+
const rules = {};
|
|
144640
|
+
for (const rule of headers.rules) {
|
|
144641
|
+
rules[rule.path] = {};
|
|
144642
|
+
if (Object.keys(rule.headers).length) {
|
|
144643
|
+
rules[rule.path].set = rule.headers;
|
|
144644
|
+
}
|
|
144645
|
+
if (rule.unsetHeaders.length) {
|
|
144646
|
+
rules[rule.path].unset = rule.unsetHeaders;
|
|
144647
|
+
}
|
|
144648
|
+
}
|
|
144649
|
+
return {
|
|
144650
|
+
headers: {
|
|
144651
|
+
version: HEADERS_VERSION,
|
|
144652
|
+
rules
|
|
144653
|
+
}
|
|
144654
|
+
};
|
|
144655
|
+
}
|
|
144656
|
+
function constructWebAnalytics({
|
|
144657
|
+
webAnalyticsToken
|
|
144658
|
+
}) {
|
|
144659
|
+
if (!webAnalyticsToken)
|
|
144660
|
+
return {};
|
|
144661
|
+
return {
|
|
144662
|
+
analytics: {
|
|
144663
|
+
version: ANALYTICS_VERSION,
|
|
144664
|
+
token: webAnalyticsToken
|
|
144665
|
+
}
|
|
144666
|
+
};
|
|
144667
|
+
}
|
|
144668
|
+
|
|
144669
|
+
// ../pages-shared/metadata-generator/parseHeaders.ts
|
|
144670
|
+
init_import_meta_url();
|
|
144671
|
+
|
|
144672
|
+
// ../pages-shared/metadata-generator/validateURL.ts
|
|
144673
|
+
init_import_meta_url();
|
|
144674
|
+
var extractPathname = (path41 = "/", includeSearch, includeHash) => {
|
|
144675
|
+
if (!path41.startsWith("/"))
|
|
144676
|
+
path41 = `/${path41}`;
|
|
144677
|
+
const url3 = new URL(`//${path41}`, "relative://");
|
|
144678
|
+
return `${url3.pathname}${includeSearch ? url3.search : ""}${includeHash ? url3.hash : ""}`;
|
|
144679
|
+
};
|
|
144680
|
+
var URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
|
|
144681
|
+
var PATH_REGEX = /^\//;
|
|
144682
|
+
var validateUrl = (token, onlyRelative = false, includeSearch = false, includeHash = false) => {
|
|
144683
|
+
const host = URL_REGEX.exec(token);
|
|
144684
|
+
if (host && host.groups && host.groups.host) {
|
|
144685
|
+
if (onlyRelative)
|
|
144686
|
+
return [
|
|
144687
|
+
void 0,
|
|
144688
|
+
`Only relative URLs are allowed. Skipping absolute URL ${token}.`
|
|
144689
|
+
];
|
|
144690
|
+
return [
|
|
144691
|
+
`https://${host.groups.host}${extractPathname(
|
|
144692
|
+
host.groups.path,
|
|
144693
|
+
includeSearch,
|
|
144694
|
+
includeHash
|
|
144695
|
+
)}`,
|
|
144696
|
+
void 0
|
|
144697
|
+
];
|
|
144698
|
+
} else {
|
|
144699
|
+
if (!token.startsWith("/") && onlyRelative)
|
|
144700
|
+
token = `/${token}`;
|
|
144701
|
+
const path41 = PATH_REGEX.exec(token);
|
|
144702
|
+
if (path41) {
|
|
144703
|
+
try {
|
|
144704
|
+
return [extractPathname(token, includeSearch, includeHash), void 0];
|
|
144705
|
+
} catch {
|
|
144706
|
+
return [void 0, `Error parsing URL segment ${token}. Skipping.`];
|
|
144707
|
+
}
|
|
144708
|
+
}
|
|
144709
|
+
}
|
|
144710
|
+
return [
|
|
144711
|
+
void 0,
|
|
144712
|
+
onlyRelative ? "URLs should begin with a forward-slash." : 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with "https://").'
|
|
144713
|
+
];
|
|
144714
|
+
};
|
|
144715
|
+
|
|
144716
|
+
// ../pages-shared/metadata-generator/parseHeaders.ts
|
|
144717
|
+
var LINE_IS_PROBABLY_A_PATH = new RegExp(/^([^\s]+:\/\/|^\/)/);
|
|
144718
|
+
function parseHeaders(input) {
|
|
144719
|
+
const lines = input.split("\n");
|
|
144720
|
+
const rules = [];
|
|
144721
|
+
const invalid = [];
|
|
144722
|
+
let rule = void 0;
|
|
144723
|
+
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
144724
|
+
const line = lines[i2].trim();
|
|
144725
|
+
if (line.length === 0 || line.startsWith("#"))
|
|
144726
|
+
continue;
|
|
144727
|
+
if (line.length > MAX_LINE_LENGTH) {
|
|
144728
|
+
invalid.push({
|
|
144729
|
+
message: `Ignoring line ${i2 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
|
|
144730
|
+
});
|
|
144731
|
+
continue;
|
|
144732
|
+
}
|
|
144733
|
+
if (LINE_IS_PROBABLY_A_PATH.test(line)) {
|
|
144734
|
+
if (rules.length >= MAX_HEADER_RULES) {
|
|
144735
|
+
invalid.push({
|
|
144736
|
+
message: `Maximum number of rules supported is ${MAX_HEADER_RULES}. Skipping remaining ${lines.length - i2} lines of file.`
|
|
144737
|
+
});
|
|
144738
|
+
break;
|
|
144739
|
+
}
|
|
144740
|
+
if (rule) {
|
|
144741
|
+
if (isValidRule(rule)) {
|
|
144742
|
+
rules.push({
|
|
144743
|
+
path: rule.path,
|
|
144744
|
+
headers: rule.headers,
|
|
144745
|
+
unsetHeaders: rule.unsetHeaders
|
|
144746
|
+
});
|
|
144747
|
+
} else {
|
|
144748
|
+
invalid.push({
|
|
144749
|
+
line: rule.line,
|
|
144750
|
+
lineNumber: i2 + 1,
|
|
144751
|
+
message: "No headers specified"
|
|
144752
|
+
});
|
|
144753
|
+
}
|
|
144754
|
+
}
|
|
144755
|
+
const [path41, pathError] = validateUrl(line);
|
|
144756
|
+
if (pathError) {
|
|
144757
|
+
invalid.push({
|
|
144758
|
+
line,
|
|
144759
|
+
lineNumber: i2 + 1,
|
|
144760
|
+
message: pathError
|
|
144761
|
+
});
|
|
144762
|
+
rule = void 0;
|
|
144763
|
+
continue;
|
|
144764
|
+
}
|
|
144765
|
+
rule = {
|
|
144766
|
+
path: path41,
|
|
144767
|
+
line,
|
|
144768
|
+
headers: {},
|
|
144769
|
+
unsetHeaders: []
|
|
144770
|
+
};
|
|
144771
|
+
continue;
|
|
144772
|
+
}
|
|
144773
|
+
if (!line.includes(HEADER_SEPARATOR)) {
|
|
144774
|
+
if (!rule) {
|
|
144775
|
+
invalid.push({
|
|
144776
|
+
line,
|
|
144777
|
+
lineNumber: i2 + 1,
|
|
144778
|
+
message: "Expected a path beginning with at least one forward-slash"
|
|
144779
|
+
});
|
|
144780
|
+
} else {
|
|
144781
|
+
if (line.trim().startsWith(UNSET_OPERATOR)) {
|
|
144782
|
+
rule.unsetHeaders.push(line.trim().replace(UNSET_OPERATOR, ""));
|
|
144783
|
+
} else {
|
|
144784
|
+
invalid.push({
|
|
144785
|
+
line,
|
|
144786
|
+
lineNumber: i2 + 1,
|
|
144787
|
+
message: "Expected a colon-separated header pair (e.g. name: value)"
|
|
144788
|
+
});
|
|
144789
|
+
}
|
|
144790
|
+
}
|
|
144791
|
+
continue;
|
|
144792
|
+
}
|
|
144793
|
+
const [rawName, ...rawValue] = line.split(HEADER_SEPARATOR);
|
|
144794
|
+
const name = rawName.trim().toLowerCase();
|
|
144795
|
+
if (name.includes(" ")) {
|
|
144796
|
+
invalid.push({
|
|
144797
|
+
line,
|
|
144798
|
+
lineNumber: i2 + 1,
|
|
144799
|
+
message: "Header name cannot include spaces"
|
|
144800
|
+
});
|
|
144801
|
+
continue;
|
|
144802
|
+
}
|
|
144803
|
+
const value = rawValue.join(HEADER_SEPARATOR).trim();
|
|
144804
|
+
if (name === "") {
|
|
144805
|
+
invalid.push({
|
|
144806
|
+
line,
|
|
144807
|
+
lineNumber: i2 + 1,
|
|
144808
|
+
message: "No header name specified"
|
|
144809
|
+
});
|
|
144810
|
+
continue;
|
|
144811
|
+
}
|
|
144812
|
+
if (value === "") {
|
|
144813
|
+
invalid.push({
|
|
144814
|
+
line,
|
|
144815
|
+
lineNumber: i2 + 1,
|
|
144816
|
+
message: "No header value specified"
|
|
144817
|
+
});
|
|
144818
|
+
continue;
|
|
144819
|
+
}
|
|
144820
|
+
if (!rule) {
|
|
144821
|
+
invalid.push({
|
|
144822
|
+
line,
|
|
144823
|
+
lineNumber: i2 + 1,
|
|
144824
|
+
message: `Path should come before header (${name}: ${value})`
|
|
144825
|
+
});
|
|
144826
|
+
continue;
|
|
144827
|
+
}
|
|
144828
|
+
const existingValues = rule.headers[name];
|
|
144829
|
+
rule.headers[name] = existingValues ? `${existingValues}, ${value}` : value;
|
|
144830
|
+
}
|
|
144831
|
+
if (rule) {
|
|
144832
|
+
if (isValidRule(rule)) {
|
|
144833
|
+
rules.push({
|
|
144834
|
+
path: rule.path,
|
|
144835
|
+
headers: rule.headers,
|
|
144836
|
+
unsetHeaders: rule.unsetHeaders
|
|
144837
|
+
});
|
|
144838
|
+
} else {
|
|
144839
|
+
invalid.push({ line: rule.line, message: "No headers specified" });
|
|
144840
|
+
}
|
|
144841
|
+
}
|
|
144842
|
+
return {
|
|
144843
|
+
rules,
|
|
144844
|
+
invalid
|
|
144845
|
+
};
|
|
144846
|
+
}
|
|
144847
|
+
function isValidRule(rule) {
|
|
144848
|
+
return Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0;
|
|
144849
|
+
}
|
|
144850
|
+
|
|
144851
|
+
// ../pages-shared/metadata-generator/parseRedirects.ts
|
|
144852
|
+
init_import_meta_url();
|
|
144853
|
+
function parseRedirects(input) {
|
|
144854
|
+
const lines = input.split("\n");
|
|
144855
|
+
const rules = [];
|
|
144856
|
+
const seen_paths = /* @__PURE__ */ new Set();
|
|
144857
|
+
const invalid = [];
|
|
144858
|
+
let staticRules = 0;
|
|
144859
|
+
let dynamicRules = 0;
|
|
144860
|
+
let canCreateStaticRule = true;
|
|
144861
|
+
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
144862
|
+
const line = lines[i2].trim();
|
|
144863
|
+
if (line.length === 0 || line.startsWith("#"))
|
|
144864
|
+
continue;
|
|
144865
|
+
if (line.length > MAX_LINE_LENGTH) {
|
|
144866
|
+
invalid.push({
|
|
144867
|
+
message: `Ignoring line ${i2 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
|
|
144868
|
+
});
|
|
144869
|
+
continue;
|
|
144870
|
+
}
|
|
144871
|
+
const tokens = line.split(/\s+/);
|
|
144872
|
+
if (tokens.length < 2 || tokens.length > 3) {
|
|
144873
|
+
invalid.push({
|
|
144874
|
+
line,
|
|
144875
|
+
lineNumber: i2 + 1,
|
|
144876
|
+
message: `Expected exactly 2 or 3 whitespace-separated tokens. Got ${tokens.length}.`
|
|
144877
|
+
});
|
|
144878
|
+
continue;
|
|
144879
|
+
}
|
|
144880
|
+
const [str_from, str_to, str_status = "302"] = tokens;
|
|
144881
|
+
const fromResult = validateUrl(str_from, true, false, false);
|
|
144882
|
+
if (fromResult[0] === void 0) {
|
|
144883
|
+
invalid.push({
|
|
144884
|
+
line,
|
|
144885
|
+
lineNumber: i2 + 1,
|
|
144886
|
+
message: fromResult[1]
|
|
144887
|
+
});
|
|
144888
|
+
continue;
|
|
144889
|
+
}
|
|
144890
|
+
const from = fromResult[0];
|
|
144891
|
+
if (canCreateStaticRule && !from.match(SPLAT_REGEX) && !from.match(PLACEHOLDER_REGEX)) {
|
|
144892
|
+
staticRules += 1;
|
|
144893
|
+
if (staticRules > MAX_STATIC_REDIRECT_RULES) {
|
|
144894
|
+
invalid.push({
|
|
144895
|
+
message: `Maximum number of static rules supported is ${MAX_STATIC_REDIRECT_RULES}. Skipping line.`
|
|
144896
|
+
});
|
|
144897
|
+
continue;
|
|
144898
|
+
}
|
|
144899
|
+
} else {
|
|
144900
|
+
dynamicRules += 1;
|
|
144901
|
+
canCreateStaticRule = false;
|
|
144902
|
+
if (dynamicRules > MAX_DYNAMIC_REDIRECT_RULES) {
|
|
144903
|
+
invalid.push({
|
|
144904
|
+
message: `Maximum number of dynamic rules supported is ${MAX_DYNAMIC_REDIRECT_RULES}. Skipping remaining ${lines.length - i2} lines of file.`
|
|
144905
|
+
});
|
|
144906
|
+
break;
|
|
144907
|
+
}
|
|
144908
|
+
}
|
|
144909
|
+
const toResult = validateUrl(str_to, false, true, true);
|
|
144910
|
+
if (toResult[0] === void 0) {
|
|
144911
|
+
invalid.push({
|
|
144912
|
+
line,
|
|
144913
|
+
lineNumber: i2 + 1,
|
|
144914
|
+
message: toResult[1]
|
|
144915
|
+
});
|
|
144916
|
+
continue;
|
|
144917
|
+
}
|
|
144918
|
+
const to = toResult[0];
|
|
144919
|
+
const status = Number(str_status);
|
|
144920
|
+
if (isNaN(status) || !PERMITTED_STATUS_CODES.has(status)) {
|
|
144921
|
+
invalid.push({
|
|
144922
|
+
line,
|
|
144923
|
+
lineNumber: i2 + 1,
|
|
144924
|
+
message: `Valid status codes are 301, 302 (default), 303, 307, or 308. Got ${str_status}.`
|
|
144925
|
+
});
|
|
144926
|
+
continue;
|
|
144927
|
+
}
|
|
144928
|
+
if (seen_paths.has(from)) {
|
|
144929
|
+
invalid.push({
|
|
144930
|
+
line,
|
|
144931
|
+
lineNumber: i2 + 1,
|
|
144932
|
+
message: `Ignoring duplicate rule for path ${from}.`
|
|
144933
|
+
});
|
|
144934
|
+
continue;
|
|
144935
|
+
}
|
|
144936
|
+
seen_paths.add(from);
|
|
144937
|
+
rules.push({ from, to, status, lineNumber: i2 + 1 });
|
|
144938
|
+
}
|
|
144939
|
+
return {
|
|
144940
|
+
rules,
|
|
144941
|
+
invalid
|
|
144942
|
+
};
|
|
144943
|
+
}
|
|
144944
|
+
|
|
144945
|
+
// src/miniflare-cli/assets.ts
|
|
144946
|
+
var import_chokidar = require("chokidar");
|
|
144947
|
+
var import_mime = __toESM(require_mime2());
|
|
144948
|
+
|
|
144949
|
+
// src/pages/hash.tsx
|
|
144950
|
+
init_import_meta_url();
|
|
144951
|
+
var import_node_fs6 = require("node:fs");
|
|
144952
|
+
var import_node_path14 = require("node:path");
|
|
144953
|
+
var import_blake3_wasm = require("blake3-wasm");
|
|
144954
|
+
var hashFile = (filepath) => {
|
|
144955
|
+
const contents = (0, import_node_fs6.readFileSync)(filepath);
|
|
144956
|
+
const base64Contents = contents.toString("base64");
|
|
144957
|
+
const extension = (0, import_node_path14.extname)(filepath).substring(1);
|
|
144958
|
+
return (0, import_blake3_wasm.hash)(base64Contents + extension).toString("hex").slice(0, 32);
|
|
144959
|
+
};
|
|
144960
|
+
|
|
144961
|
+
// src/miniflare-cli/assets.ts
|
|
144962
|
+
async function generateASSETSBinding(options6) {
|
|
144963
|
+
const assetsFetch = options6.directory !== void 0 ? await generateAssetsFetch(options6.directory, options6.log, options6.tre) : invalidAssetsFetch;
|
|
144964
|
+
const miniflare = options6.tre ? await import("@miniflare/tre") : await import("@miniflare/core");
|
|
144965
|
+
const Request2 = miniflare.Request;
|
|
144966
|
+
const Response2 = miniflare.Response;
|
|
144967
|
+
const fetch10 = options6.tre ? miniflare.fetch : (await import("@miniflare/web-sockets")).upgradingFetch;
|
|
144968
|
+
return async function(miniflareRequest) {
|
|
144969
|
+
if (options6.proxyPort) {
|
|
144970
|
+
try {
|
|
144971
|
+
const url3 = new URL(miniflareRequest.url);
|
|
144972
|
+
url3.host = `localhost:${options6.proxyPort}`;
|
|
144973
|
+
const proxyRequest = new Request2(url3, miniflareRequest);
|
|
144974
|
+
if (proxyRequest.headers.get("Upgrade") === "websocket") {
|
|
144975
|
+
proxyRequest.headers.delete("Sec-WebSocket-Accept");
|
|
144976
|
+
proxyRequest.headers.delete("Sec-WebSocket-Key");
|
|
144977
|
+
}
|
|
144978
|
+
return await fetch10(proxyRequest);
|
|
144979
|
+
} catch (thrown) {
|
|
144980
|
+
options6.log.error(new Error(`Could not proxy request: ${thrown}`));
|
|
144981
|
+
return new Response2(`[wrangler] Could not proxy request: ${thrown}`, {
|
|
144982
|
+
status: 502
|
|
144983
|
+
});
|
|
144984
|
+
}
|
|
144985
|
+
} else {
|
|
144986
|
+
try {
|
|
144987
|
+
return await assetsFetch(miniflareRequest);
|
|
144988
|
+
} catch (thrown) {
|
|
144989
|
+
options6.log.error(new Error(`Could not serve static asset: ${thrown}`));
|
|
144990
|
+
return new Response2(
|
|
144991
|
+
`[wrangler] Could not serve static asset: ${thrown}`,
|
|
144992
|
+
{ status: 502 }
|
|
144993
|
+
);
|
|
144994
|
+
}
|
|
144995
|
+
}
|
|
144996
|
+
};
|
|
144997
|
+
}
|
|
144998
|
+
async function generateAssetsFetch(directory, log, tre) {
|
|
144999
|
+
const polyfill2 = tre ? (await Promise.resolve().then(() => (init_miniflare_tre(), miniflare_tre_exports))).default : (await Promise.resolve().then(() => (init_miniflare(), miniflare_exports))).default;
|
|
145000
|
+
await polyfill2();
|
|
145001
|
+
const miniflare = tre ? await import("@miniflare/tre") : await import("@miniflare/core");
|
|
145002
|
+
const Request2 = miniflare.Request;
|
|
145003
|
+
const { generateHandler: generateHandler3, parseQualityWeightedList: parseQualityWeightedList2 } = await Promise.resolve().then(() => (init_handler(), handler_exports));
|
|
145004
|
+
const headersFile = (0, import_node_path15.join)(directory, "_headers");
|
|
145005
|
+
const redirectsFile = (0, import_node_path15.join)(directory, "_redirects");
|
|
145006
|
+
const workerFile = (0, import_node_path15.join)(directory, "_worker.js");
|
|
145007
|
+
const ignoredFiles = [headersFile, redirectsFile, workerFile];
|
|
145008
|
+
let redirects;
|
|
145009
|
+
if ((0, import_node_fs7.existsSync)(redirectsFile)) {
|
|
145010
|
+
const contents = (0, import_node_fs7.readFileSync)(redirectsFile, "utf-8");
|
|
145011
|
+
redirects = parseRedirects(contents);
|
|
145012
|
+
}
|
|
145013
|
+
let headers;
|
|
145014
|
+
if ((0, import_node_fs7.existsSync)(headersFile)) {
|
|
145015
|
+
const contents = (0, import_node_fs7.readFileSync)(headersFile, "utf-8");
|
|
145016
|
+
headers = parseHeaders(contents);
|
|
145017
|
+
}
|
|
145018
|
+
let metadata = createMetadataObject({
|
|
145019
|
+
redirects,
|
|
145020
|
+
headers,
|
|
145021
|
+
logger: log.warn.bind(log)
|
|
145022
|
+
});
|
|
145023
|
+
(0, import_chokidar.watch)([headersFile, redirectsFile], { persistent: true }).on(
|
|
145024
|
+
"change",
|
|
145025
|
+
(path41) => {
|
|
145026
|
+
switch (path41) {
|
|
145027
|
+
case headersFile: {
|
|
145028
|
+
log.log("_headers modified. Re-evaluating...");
|
|
145029
|
+
const contents = (0, import_node_fs7.readFileSync)(headersFile).toString();
|
|
145030
|
+
headers = parseHeaders(contents);
|
|
145031
|
+
break;
|
|
145032
|
+
}
|
|
145033
|
+
case redirectsFile: {
|
|
145034
|
+
log.log("_redirects modified. Re-evaluating...");
|
|
145035
|
+
const contents = (0, import_node_fs7.readFileSync)(redirectsFile).toString();
|
|
145036
|
+
redirects = parseRedirects(contents);
|
|
145037
|
+
break;
|
|
145038
|
+
}
|
|
145039
|
+
}
|
|
145040
|
+
metadata = createMetadataObject({
|
|
145041
|
+
redirects,
|
|
145042
|
+
headers,
|
|
145043
|
+
logger: log.warn
|
|
145044
|
+
});
|
|
145045
|
+
}
|
|
145046
|
+
);
|
|
145047
|
+
const generateResponse = async (request) => {
|
|
145048
|
+
const assetKeyEntryMap = /* @__PURE__ */ new Map();
|
|
145049
|
+
return await generateHandler3({
|
|
145050
|
+
request,
|
|
145051
|
+
metadata,
|
|
145052
|
+
xServerEnvHeader: "dev",
|
|
145053
|
+
logError: console.error,
|
|
145054
|
+
findAssetEntryForPath: async (path41) => {
|
|
145055
|
+
const filepath = (0, import_node_path15.join)(directory, path41);
|
|
145056
|
+
if ((0, import_node_fs7.existsSync)(filepath) && (0, import_node_fs7.lstatSync)(filepath).isFile() && !ignoredFiles.includes(filepath)) {
|
|
145057
|
+
const hash = hashFile(filepath);
|
|
145058
|
+
assetKeyEntryMap.set(hash, filepath);
|
|
145059
|
+
return hash;
|
|
145060
|
+
}
|
|
145061
|
+
return null;
|
|
145062
|
+
},
|
|
145063
|
+
getAssetKey: (assetEntry) => {
|
|
145064
|
+
return assetEntry;
|
|
145065
|
+
},
|
|
145066
|
+
negotiateContent: (contentRequest) => {
|
|
145067
|
+
let rawAcceptEncoding;
|
|
145068
|
+
if (contentRequest.cf && "clientAcceptEncoding" in contentRequest.cf && contentRequest.cf.clientAcceptEncoding) {
|
|
145069
|
+
rawAcceptEncoding = contentRequest.cf.clientAcceptEncoding;
|
|
145070
|
+
} else {
|
|
145071
|
+
rawAcceptEncoding = contentRequest.headers.get("Accept-Encoding") || void 0;
|
|
145072
|
+
}
|
|
145073
|
+
const acceptEncoding = parseQualityWeightedList2(rawAcceptEncoding);
|
|
145074
|
+
if (acceptEncoding["identity"] === 0 || acceptEncoding["*"] === 0 && acceptEncoding["identity"] === void 0) {
|
|
145075
|
+
throw new Error("No acceptable encodings available");
|
|
145076
|
+
}
|
|
145077
|
+
return { encoding: null };
|
|
145078
|
+
},
|
|
145079
|
+
fetchAsset: async (assetKey) => {
|
|
145080
|
+
const filepath = assetKeyEntryMap.get(assetKey);
|
|
145081
|
+
if (!filepath) {
|
|
145082
|
+
throw new Error(
|
|
145083
|
+
"Could not fetch asset. Please file an issue on GitHub (https://github.com/cloudflare/wrangler2/issues/new/choose) with reproduction steps."
|
|
145084
|
+
);
|
|
145085
|
+
}
|
|
145086
|
+
const body = (0, import_node_fs7.readFileSync)(filepath);
|
|
145087
|
+
let contentType = (0, import_mime.getType)(filepath) || "application/octet-stream";
|
|
145088
|
+
if (contentType.startsWith("text/") && !contentType.includes("charset")) {
|
|
145089
|
+
contentType = `${contentType}; charset=utf-8`;
|
|
145090
|
+
}
|
|
145091
|
+
return { body, contentType };
|
|
145092
|
+
}
|
|
145093
|
+
});
|
|
145094
|
+
};
|
|
145095
|
+
return async (input, init) => {
|
|
145096
|
+
const request = new Request2(input, init);
|
|
145097
|
+
return await generateResponse(request);
|
|
145098
|
+
};
|
|
145099
|
+
}
|
|
145100
|
+
var invalidAssetsFetch = () => {
|
|
145101
|
+
throw new Error(
|
|
145102
|
+
"Trying to fetch assets directly when there is no `directory` option specified."
|
|
145103
|
+
);
|
|
145104
|
+
};
|
|
145105
|
+
|
|
143792
145106
|
// src/module-collection.ts
|
|
143793
145107
|
init_import_meta_url();
|
|
143794
145108
|
var import_node_crypto3 = __toESM(require("node:crypto"));
|
|
143795
145109
|
var import_promises2 = require("node:fs/promises");
|
|
143796
|
-
var
|
|
145110
|
+
var import_node_path16 = __toESM(require("node:path"));
|
|
143797
145111
|
var import_glob_to_regexp = __toESM(require_glob_to_regexp());
|
|
143798
145112
|
function flipObject(obj) {
|
|
143799
145113
|
return Object.fromEntries(Object.entries(obj).map(([k, v]) => [v, k]));
|
|
@@ -143878,18 +145192,18 @@ function createModuleCollector(props) {
|
|
|
143878
145192
|
return;
|
|
143879
145193
|
}
|
|
143880
145194
|
logger.warn(
|
|
143881
|
-
`Deprecation: detected a legacy module import in "./${
|
|
145195
|
+
`Deprecation: detected a legacy module import in "./${import_node_path16.default.relative(
|
|
143882
145196
|
process.cwd(),
|
|
143883
145197
|
args.importer
|
|
143884
145198
|
)}". This will stop working in the future. Replace references to "${args.path}" with "./${args.path}";`
|
|
143885
145199
|
);
|
|
143886
|
-
const filePath =
|
|
145200
|
+
const filePath = import_node_path16.default.join(
|
|
143887
145201
|
props.wrangler1xlegacyModuleReferences.rootDirectory,
|
|
143888
145202
|
args.path
|
|
143889
145203
|
);
|
|
143890
145204
|
const fileContent = await (0, import_promises2.readFile)(filePath);
|
|
143891
145205
|
const fileHash = import_node_crypto3.default.createHash("sha1").update(fileContent).digest("hex");
|
|
143892
|
-
const fileName = `./${fileHash}-${
|
|
145206
|
+
const fileName = `./${fileHash}-${import_node_path16.default.basename(args.path)}`;
|
|
143893
145207
|
const { rule } = rulesMatchers.find(({ regex }) => regex.test(fileName)) || {};
|
|
143894
145208
|
if (rule) {
|
|
143895
145209
|
modules.push({
|
|
@@ -143914,10 +145228,10 @@ function createModuleCollector(props) {
|
|
|
143914
145228
|
build5.onResolve(
|
|
143915
145229
|
{ filter: (0, import_glob_to_regexp.default)(glob) },
|
|
143916
145230
|
async (args) => {
|
|
143917
|
-
const filePath =
|
|
145231
|
+
const filePath = import_node_path16.default.join(args.resolveDir, args.path);
|
|
143918
145232
|
const fileContent = await (0, import_promises2.readFile)(filePath);
|
|
143919
145233
|
const fileHash = import_node_crypto3.default.createHash("sha1").update(fileContent).digest("hex");
|
|
143920
|
-
const fileName = `./${fileHash}-${
|
|
145234
|
+
const fileName = `./${fileHash}-${import_node_path16.default.basename(args.path)}`;
|
|
143921
145235
|
modules.push({
|
|
143922
145236
|
name: fileName,
|
|
143923
145237
|
content: fileContent,
|
|
@@ -143986,7 +145300,6 @@ function useLocalWorker({
|
|
|
143986
145300
|
workerDefinitions,
|
|
143987
145301
|
assetPaths,
|
|
143988
145302
|
initialPort,
|
|
143989
|
-
inspectorPort,
|
|
143990
145303
|
rules,
|
|
143991
145304
|
localPersistencePath,
|
|
143992
145305
|
liveReload,
|
|
@@ -144008,6 +145321,7 @@ function useLocalWorker({
|
|
|
144008
145321
|
const removeSignalExitListener = (0, import_react5.useRef)();
|
|
144009
145322
|
const removeExperimentalLocalSignalExitListener = (0, import_react5.useRef)();
|
|
144010
145323
|
const [inspectorUrl, setInspectorUrl] = (0, import_react5.useState)();
|
|
145324
|
+
const runtimeInspectorPortRef = (0, import_react5.useRef)();
|
|
144011
145325
|
(0, import_react5.useEffect)(() => {
|
|
144012
145326
|
if (bindings.services && bindings.services.length > 0) {
|
|
144013
145327
|
logger.warn(
|
|
@@ -144028,18 +145342,13 @@ function useLocalWorker({
|
|
|
144028
145342
|
async function startLocalWorker() {
|
|
144029
145343
|
if (!bundle || !format6)
|
|
144030
145344
|
return;
|
|
144031
|
-
await waitForPortToBeAvailable(initialPort, {
|
|
144032
|
-
retryPeriod: 200,
|
|
144033
|
-
timeout: 2e3,
|
|
144034
|
-
abortSignal: abortController.signal
|
|
144035
|
-
});
|
|
144036
145345
|
for (const module2 of bundle.modules) {
|
|
144037
145346
|
await (0, import_promises3.writeFile)(
|
|
144038
|
-
|
|
145347
|
+
import_node_path17.default.join(import_node_path17.default.dirname(bundle.path), module2.name),
|
|
144039
145348
|
module2.content
|
|
144040
145349
|
);
|
|
144041
145350
|
}
|
|
144042
|
-
const scriptPath = (0,
|
|
145351
|
+
const scriptPath = (0, import_node_fs8.realpathSync)(bundle.path);
|
|
144043
145352
|
const upstream = typeof localUpstream === "string" ? `${localProtocol}://${localUpstream}` : void 0;
|
|
144044
145353
|
const {
|
|
144045
145354
|
externalDurableObjects,
|
|
@@ -144055,6 +145364,8 @@ function useLocalWorker({
|
|
|
144055
145364
|
format: format6,
|
|
144056
145365
|
bundle
|
|
144057
145366
|
});
|
|
145367
|
+
runtimeInspectorPortRef.current ??= await getPorts();
|
|
145368
|
+
const runtimeInspectorPort = runtimeInspectorPortRef.current;
|
|
144058
145369
|
const { forkOptions, miniflareCLIPath, options: options6 } = setupMiniflareOptions({
|
|
144059
145370
|
workerName,
|
|
144060
145371
|
port: initialPort,
|
|
@@ -144093,11 +145404,12 @@ function useLocalWorker({
|
|
|
144093
145404
|
format: format6,
|
|
144094
145405
|
bundle,
|
|
144095
145406
|
log,
|
|
145407
|
+
enablePagesAssetsServiceBinding,
|
|
144096
145408
|
kvNamespaces: bindings?.kv_namespaces,
|
|
144097
145409
|
r2Buckets: bindings?.r2_buckets,
|
|
144098
145410
|
authenticatedAccountId: accountId,
|
|
144099
145411
|
kvRemote: experimentalLocalRemoteKv,
|
|
144100
|
-
inspectorPort
|
|
145412
|
+
inspectorPort: runtimeInspectorPort
|
|
144101
145413
|
});
|
|
144102
145414
|
const current = experimentalLocalRef.current;
|
|
144103
145415
|
if (current === void 0) {
|
|
@@ -144119,7 +145431,7 @@ function useLocalWorker({
|
|
|
144119
145431
|
await current.setOptions(mf3Options);
|
|
144120
145432
|
}
|
|
144121
145433
|
try {
|
|
144122
|
-
const inspectorJSONArr = await (await fetch(`http://127.0.0.1:${
|
|
145434
|
+
const inspectorJSONArr = await (await fetch(`http://127.0.0.1:${runtimeInspectorPort}/json`)).json();
|
|
144123
145435
|
const foundInspectorURL = inspectorJSONArr?.find(
|
|
144124
145436
|
(inspectorJSON) => inspectorJSON.id.startsWith("core:user")
|
|
144125
145437
|
)?.webSocketDebuggerUrl;
|
|
@@ -144137,14 +145449,18 @@ function useLocalWorker({
|
|
|
144137
145449
|
}
|
|
144138
145450
|
return;
|
|
144139
145451
|
}
|
|
145452
|
+
await waitForPortToBeAvailable(initialPort, {
|
|
145453
|
+
retryPeriod: 200,
|
|
145454
|
+
timeout: 2e3,
|
|
145455
|
+
abortSignal: abortController.signal
|
|
145456
|
+
});
|
|
144140
145457
|
const nodeOptions = setupNodeOptions({
|
|
144141
145458
|
inspect: inspect2,
|
|
144142
|
-
|
|
144143
|
-
inspectorPort
|
|
145459
|
+
inspectorPort: runtimeInspectorPort
|
|
144144
145460
|
});
|
|
144145
145461
|
logger.log("\u2394 Starting a local server...");
|
|
144146
145462
|
const child = local.current = (0, import_node_child_process2.fork)(miniflareCLIPath, forkOptions, {
|
|
144147
|
-
cwd:
|
|
145463
|
+
cwd: import_node_path17.default.dirname(scriptPath),
|
|
144148
145464
|
execArgv: nodeOptions,
|
|
144149
145465
|
stdio: "pipe",
|
|
144150
145466
|
env: {
|
|
@@ -144213,7 +145529,11 @@ function useLocalWorker({
|
|
|
144213
145529
|
});
|
|
144214
145530
|
}
|
|
144215
145531
|
startLocalWorker().catch((err2) => {
|
|
144216
|
-
|
|
145532
|
+
if (err2.code === "ERR_RUNTIME_FAILURE") {
|
|
145533
|
+
logger.error(err2.message);
|
|
145534
|
+
} else {
|
|
145535
|
+
logger.error("local worker:", err2);
|
|
145536
|
+
}
|
|
144217
145537
|
});
|
|
144218
145538
|
return () => {
|
|
144219
145539
|
abortController.abort();
|
|
@@ -144230,7 +145550,6 @@ function useLocalWorker({
|
|
|
144230
145550
|
workerName,
|
|
144231
145551
|
format6,
|
|
144232
145552
|
initialPort,
|
|
144233
|
-
inspectorPort,
|
|
144234
145553
|
initialIp,
|
|
144235
145554
|
queueConsumers,
|
|
144236
145555
|
bindings.queues,
|
|
@@ -144287,15 +145606,15 @@ function setupBindings({
|
|
|
144287
145606
|
}) {
|
|
144288
145607
|
const wasmBindings = {};
|
|
144289
145608
|
for (const [name, filePath] of Object.entries(wasm_modules || {})) {
|
|
144290
|
-
wasmBindings[name] =
|
|
145609
|
+
wasmBindings[name] = import_node_path17.default.join(process.cwd(), filePath);
|
|
144291
145610
|
}
|
|
144292
145611
|
const textBlobBindings = {};
|
|
144293
145612
|
for (const [name, filePath] of Object.entries(text_blobs || {})) {
|
|
144294
|
-
textBlobBindings[name] =
|
|
145613
|
+
textBlobBindings[name] = import_node_path17.default.join(process.cwd(), filePath);
|
|
144295
145614
|
}
|
|
144296
145615
|
const dataBlobBindings = {};
|
|
144297
145616
|
for (const [name, filePath] of Object.entries(data_blobs || {})) {
|
|
144298
|
-
dataBlobBindings[name] =
|
|
145617
|
+
dataBlobBindings[name] = import_node_path17.default.join(process.cwd(), filePath);
|
|
144299
145618
|
}
|
|
144300
145619
|
if (format6 === "service-worker") {
|
|
144301
145620
|
for (const { type: type2, name } of bundle.modules) {
|
|
@@ -144414,11 +145733,11 @@ function setupMiniflareOptions({
|
|
|
144414
145733
|
),
|
|
144415
145734
|
d1Databases: d1_databases?.map((db) => db.binding),
|
|
144416
145735
|
...localPersistencePath ? {
|
|
144417
|
-
cachePersist:
|
|
144418
|
-
durableObjectsPersist:
|
|
144419
|
-
kvPersist:
|
|
144420
|
-
r2Persist:
|
|
144421
|
-
d1Persist:
|
|
145736
|
+
cachePersist: import_node_path17.default.join(localPersistencePath, "cache"),
|
|
145737
|
+
durableObjectsPersist: import_node_path17.default.join(localPersistencePath, "do"),
|
|
145738
|
+
kvPersist: import_node_path17.default.join(localPersistencePath, "kv"),
|
|
145739
|
+
r2Persist: import_node_path17.default.join(localPersistencePath, "r2"),
|
|
145740
|
+
d1Persist: import_node_path17.default.join(localPersistencePath, "d1")
|
|
144422
145741
|
} : {
|
|
144423
145742
|
cachePersist: true,
|
|
144424
145743
|
durableObjectsPersist: true,
|
|
@@ -144426,7 +145745,7 @@ function setupMiniflareOptions({
|
|
|
144426
145745
|
r2Persist: true
|
|
144427
145746
|
},
|
|
144428
145747
|
liveReload,
|
|
144429
|
-
sitePath: assetPaths?.assetDirectory ?
|
|
145748
|
+
sitePath: assetPaths?.assetDirectory ? import_node_path17.default.join(assetPaths.baseDirectory, assetPaths.assetDirectory) : void 0,
|
|
144430
145749
|
siteInclude: assetPaths?.includePatterns.length ? assetPaths?.includePatterns : void 0,
|
|
144431
145750
|
siteExclude: assetPaths?.excludePatterns.length ? assetPaths.excludePatterns : void 0,
|
|
144432
145751
|
bindings: vars,
|
|
@@ -144441,7 +145760,7 @@ function setupMiniflareOptions({
|
|
|
144441
145760
|
logOptions: logPrefix ? { prefix: logPrefix } : void 0,
|
|
144442
145761
|
enablePagesAssetsServiceBinding
|
|
144443
145762
|
};
|
|
144444
|
-
const miniflareCLIPath =
|
|
145763
|
+
const miniflareCLIPath = import_node_path17.default.resolve(
|
|
144445
145764
|
getBasePath(),
|
|
144446
145765
|
"miniflare-dist/index.mjs"
|
|
144447
145766
|
);
|
|
@@ -144454,7 +145773,6 @@ function setupMiniflareOptions({
|
|
|
144454
145773
|
}
|
|
144455
145774
|
function setupNodeOptions({
|
|
144456
145775
|
inspect: inspect2,
|
|
144457
|
-
ip: ip2,
|
|
144458
145776
|
inspectorPort
|
|
144459
145777
|
}) {
|
|
144460
145778
|
const nodeOptions = [
|
|
@@ -144462,7 +145780,7 @@ function setupNodeOptions({
|
|
|
144462
145780
|
"--no-warnings"
|
|
144463
145781
|
];
|
|
144464
145782
|
if (inspect2) {
|
|
144465
|
-
nodeOptions.push(`--inspect
|
|
145783
|
+
nodeOptions.push(`--inspect=127.0.0.1:${inspectorPort}`);
|
|
144466
145784
|
}
|
|
144467
145785
|
return nodeOptions;
|
|
144468
145786
|
}
|
|
@@ -144479,6 +145797,7 @@ async function transformMf2OptionsToMf3Options({
|
|
|
144479
145797
|
format: format6,
|
|
144480
145798
|
bundle,
|
|
144481
145799
|
log,
|
|
145800
|
+
enablePagesAssetsServiceBinding,
|
|
144482
145801
|
kvNamespaces,
|
|
144483
145802
|
r2Buckets,
|
|
144484
145803
|
authenticatedAccountId,
|
|
@@ -144507,8 +145826,18 @@ async function transformMf2OptionsToMf3Options({
|
|
|
144507
145826
|
cloudflareFetch,
|
|
144508
145827
|
log
|
|
144509
145828
|
};
|
|
145829
|
+
if (enablePagesAssetsServiceBinding !== void 0) {
|
|
145830
|
+
options6.serviceBindings = {
|
|
145831
|
+
...options6.serviceBindings,
|
|
145832
|
+
ASSETS: await generateASSETSBinding({
|
|
145833
|
+
log,
|
|
145834
|
+
...enablePagesAssetsServiceBinding,
|
|
145835
|
+
tre: true
|
|
145836
|
+
})
|
|
145837
|
+
};
|
|
145838
|
+
}
|
|
144510
145839
|
if (format6 === "modules") {
|
|
144511
|
-
const root =
|
|
145840
|
+
const root = import_node_path17.default.dirname(bundle.path);
|
|
144512
145841
|
import_node_assert5.default.strictEqual(bundle.type, "esm");
|
|
144513
145842
|
options6.modulesRoot = root;
|
|
144514
145843
|
options6.modules = [
|
|
@@ -144519,27 +145848,27 @@ async function transformMf2OptionsToMf3Options({
|
|
|
144519
145848
|
},
|
|
144520
145849
|
...bundle.modules.map((module2) => ({
|
|
144521
145850
|
type: ModuleTypeToRuleType[module2.type ?? "esm"],
|
|
144522
|
-
path:
|
|
145851
|
+
path: import_node_path17.default.resolve(root, module2.name),
|
|
144523
145852
|
contents: module2.content
|
|
144524
145853
|
}))
|
|
144525
145854
|
];
|
|
144526
145855
|
}
|
|
144527
145856
|
if (kvRemote) {
|
|
144528
145857
|
(0, import_node_assert5.default)(options6.kvPersist);
|
|
144529
|
-
const kvRemoteCache = options6.kvPersist === true ?
|
|
145858
|
+
const kvRemoteCache = options6.kvPersist === true ? import_node_path17.default.join(import_node_path17.default.dirname(bundle.path), ".mf", "kv-remote") : import_node_path17.default.join(import_node_path17.default.dirname(options6.kvPersist), "kv-remote");
|
|
144530
145859
|
options6.kvPersist = `remote:?cache=${encodeURIComponent(kvRemoteCache)}`;
|
|
144531
145860
|
}
|
|
144532
145861
|
return options6;
|
|
144533
145862
|
}
|
|
144534
145863
|
var miniflare3Module;
|
|
144535
145864
|
async function getMiniflare3() {
|
|
144536
|
-
return miniflare3Module ??= await npxImport("@miniflare/tre@3.0.0-next.
|
|
145865
|
+
return miniflare3Module ??= await npxImport("@miniflare/tre@3.0.0-next.8");
|
|
144537
145866
|
}
|
|
144538
145867
|
|
|
144539
145868
|
// src/dev/remote.tsx
|
|
144540
145869
|
init_import_meta_url();
|
|
144541
145870
|
var import_promises5 = require("node:fs/promises");
|
|
144542
|
-
var
|
|
145871
|
+
var import_node_path18 = __toESM(require("node:path"));
|
|
144543
145872
|
var import_react6 = __toESM(require_react());
|
|
144544
145873
|
var import_react_error_boundary = __toESM(require_react_error_boundary_cjs());
|
|
144545
145874
|
|
|
@@ -144594,7 +145923,7 @@ var import_undici6 = __toESM(require_undici());
|
|
|
144594
145923
|
|
|
144595
145924
|
// src/create-worker-upload-form.ts
|
|
144596
145925
|
init_import_meta_url();
|
|
144597
|
-
var
|
|
145926
|
+
var import_node_fs9 = require("node:fs");
|
|
144598
145927
|
var import_undici5 = __toESM(require_undici());
|
|
144599
145928
|
function toMimeType(type2) {
|
|
144600
145929
|
switch (type2) {
|
|
@@ -144683,6 +146012,13 @@ function createWorkerUploadForm(worker) {
|
|
|
144683
146012
|
...environment && { environment }
|
|
144684
146013
|
});
|
|
144685
146014
|
});
|
|
146015
|
+
bindings.analytics_engine_datasets?.forEach(({ binding, dataset }) => {
|
|
146016
|
+
metadataBindings.push({
|
|
146017
|
+
name: binding,
|
|
146018
|
+
type: "analytics_engine",
|
|
146019
|
+
dataset
|
|
146020
|
+
});
|
|
146021
|
+
});
|
|
144686
146022
|
bindings.dispatch_namespaces?.forEach(({ binding, namespace }) => {
|
|
144687
146023
|
metadataBindings.push({
|
|
144688
146024
|
name: binding,
|
|
@@ -144705,7 +146041,7 @@ function createWorkerUploadForm(worker) {
|
|
|
144705
146041
|
});
|
|
144706
146042
|
formData.set(
|
|
144707
146043
|
name,
|
|
144708
|
-
new import_undici5.File([(0,
|
|
146044
|
+
new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
|
|
144709
146045
|
type: "application/wasm"
|
|
144710
146046
|
})
|
|
144711
146047
|
);
|
|
@@ -144719,7 +146055,7 @@ function createWorkerUploadForm(worker) {
|
|
|
144719
146055
|
if (name !== "__STATIC_CONTENT_MANIFEST") {
|
|
144720
146056
|
formData.set(
|
|
144721
146057
|
name,
|
|
144722
|
-
new import_undici5.File([(0,
|
|
146058
|
+
new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
|
|
144723
146059
|
type: "text/plain"
|
|
144724
146060
|
})
|
|
144725
146061
|
);
|
|
@@ -144733,7 +146069,7 @@ function createWorkerUploadForm(worker) {
|
|
|
144733
146069
|
});
|
|
144734
146070
|
formData.set(
|
|
144735
146071
|
name,
|
|
144736
|
-
new import_undici5.File([(0,
|
|
146072
|
+
new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
|
|
144737
146073
|
type: "application/octet-stream"
|
|
144738
146074
|
})
|
|
144739
146075
|
);
|
|
@@ -144797,7 +146133,7 @@ function createWorkerUploadForm(worker) {
|
|
|
144797
146133
|
const filePath = bindings.logfwdr.schema;
|
|
144798
146134
|
formData.set(
|
|
144799
146135
|
filePath,
|
|
144800
|
-
new import_undici5.File([(0,
|
|
146136
|
+
new import_undici5.File([(0, import_node_fs9.readFileSync)(filePath)], filePath, {
|
|
144801
146137
|
type: "application/octet-stream"
|
|
144802
146138
|
})
|
|
144803
146139
|
);
|
|
@@ -145704,7 +147040,7 @@ ${onboardingLink}`);
|
|
|
145704
147040
|
async function createRemoteWorkerInit(props) {
|
|
145705
147041
|
const content = await (0, import_promises5.readFile)(props.bundle.path, "utf-8");
|
|
145706
147042
|
void printBundleSize(
|
|
145707
|
-
{ name:
|
|
147043
|
+
{ name: import_node_path18.default.basename(props.bundle.path), content },
|
|
145708
147044
|
props.modules
|
|
145709
147045
|
);
|
|
145710
147046
|
const assets = await syncAssets(
|
|
@@ -145717,7 +147053,7 @@ async function createRemoteWorkerInit(props) {
|
|
|
145717
147053
|
const init = {
|
|
145718
147054
|
name: props.name,
|
|
145719
147055
|
main: {
|
|
145720
|
-
name:
|
|
147056
|
+
name: import_node_path18.default.basename(props.bundle.path),
|
|
145721
147057
|
type: props.format === "modules" ? "esm" : "commonjs",
|
|
145722
147058
|
content
|
|
145723
147059
|
},
|
|
@@ -145768,7 +147104,7 @@ function getWorkerAccountAndContext(props) {
|
|
|
145768
147104
|
// src/dev/use-esbuild.ts
|
|
145769
147105
|
init_import_meta_url();
|
|
145770
147106
|
var import_node_assert8 = __toESM(require("node:assert"));
|
|
145771
|
-
var
|
|
147107
|
+
var import_chokidar2 = require("chokidar");
|
|
145772
147108
|
var import_ink3 = __toESM(require_build2());
|
|
145773
147109
|
var import_react7 = __toESM(require_react());
|
|
145774
147110
|
|
|
@@ -145809,7 +147145,7 @@ async function bundleWorker(entry, destination, options6) {
|
|
|
145809
147145
|
jsxFactory,
|
|
145810
147146
|
jsxFragment,
|
|
145811
147147
|
rules,
|
|
145812
|
-
watch:
|
|
147148
|
+
watch: watch6,
|
|
145813
147149
|
tsconfig,
|
|
145814
147150
|
minify,
|
|
145815
147151
|
nodeCompat,
|
|
@@ -145957,7 +147293,7 @@ async function bundleWorker(entry, destination, options6) {
|
|
|
145957
147293
|
...jsxFactory && { jsxFactory },
|
|
145958
147294
|
...jsxFragment && { jsxFragment },
|
|
145959
147295
|
...tsconfig && { tsconfig },
|
|
145960
|
-
watch:
|
|
147296
|
+
watch: watch6,
|
|
145961
147297
|
logLevel: "silent"
|
|
145962
147298
|
};
|
|
145963
147299
|
let result;
|
|
@@ -146375,7 +147711,7 @@ function useEsbuild({
|
|
|
146375
147711
|
});
|
|
146376
147712
|
stopWatching = stop;
|
|
146377
147713
|
if (noBundle) {
|
|
146378
|
-
const watcher = (0,
|
|
147714
|
+
const watcher = (0, import_chokidar2.watch)(entry.file, {
|
|
146379
147715
|
persistent: true
|
|
146380
147716
|
}).on("change", async (_event) => {
|
|
146381
147717
|
updateBundle();
|
|
@@ -146715,7 +148051,7 @@ function useCustomBuild(expectedEntry, build5) {
|
|
|
146715
148051
|
return;
|
|
146716
148052
|
let watcher;
|
|
146717
148053
|
if (build5.watch_dir) {
|
|
146718
|
-
watcher = (0,
|
|
148054
|
+
watcher = (0, import_chokidar3.watch)(build5.watch_dir, {
|
|
146719
148055
|
persistent: true,
|
|
146720
148056
|
ignoreInitial: true
|
|
146721
148057
|
}).on("all", (_event, filePath) => {
|
|
@@ -146875,10 +148211,10 @@ function getVarsForDev(config, env5) {
|
|
|
146875
148211
|
|
|
146876
148212
|
// src/dev/get-local-persistence-path.tsx
|
|
146877
148213
|
init_import_meta_url();
|
|
146878
|
-
var
|
|
148214
|
+
var import_node_path19 = __toESM(require("node:path"));
|
|
146879
148215
|
function getLocalPersistencePath(persistTo, doPersist, configPath) {
|
|
146880
|
-
return persistTo ?
|
|
146881
|
-
configPath ?
|
|
148216
|
+
return persistTo ? import_node_path19.default.resolve(process.cwd(), persistTo) : doPersist ? import_node_path19.default.resolve(
|
|
148217
|
+
configPath ? import_node_path19.default.dirname(configPath) : process.cwd(),
|
|
146882
148218
|
".wrangler/state"
|
|
146883
148219
|
) : null;
|
|
146884
148220
|
}
|
|
@@ -146886,7 +148222,7 @@ function getLocalPersistencePath(persistTo, doPersist, configPath) {
|
|
|
146886
148222
|
// src/dev/start-server.ts
|
|
146887
148223
|
init_import_meta_url();
|
|
146888
148224
|
var import_node_child_process4 = require("node:child_process");
|
|
146889
|
-
var
|
|
148225
|
+
var import_node_fs10 = require("node:fs");
|
|
146890
148226
|
var import_promises6 = require("node:fs/promises");
|
|
146891
148227
|
var path22 = __toESM(require("node:path"));
|
|
146892
148228
|
var util2 = __toESM(require("node:util"));
|
|
@@ -147150,7 +148486,7 @@ async function startLocalServer({
|
|
|
147150
148486
|
module2.content
|
|
147151
148487
|
);
|
|
147152
148488
|
}
|
|
147153
|
-
const scriptPath = (0,
|
|
148489
|
+
const scriptPath = (0, import_node_fs10.realpathSync)(bundle.path);
|
|
147154
148490
|
const upstream = typeof localUpstream === "string" ? `${localProtocol}://${localUpstream}` : void 0;
|
|
147155
148491
|
const {
|
|
147156
148492
|
externalDurableObjects,
|
|
@@ -147222,11 +148558,7 @@ async function startLocalServer({
|
|
|
147222
148558
|
onReady?.(runtimeURL.hostname, parseInt(runtimeURL.port ?? 8787));
|
|
147223
148559
|
return;
|
|
147224
148560
|
}
|
|
147225
|
-
const nodeOptions = setupNodeOptions({
|
|
147226
|
-
inspect: inspect2,
|
|
147227
|
-
ip: initialIp,
|
|
147228
|
-
inspectorPort
|
|
147229
|
-
});
|
|
148561
|
+
const nodeOptions = setupNodeOptions({ inspect: inspect2, inspectorPort });
|
|
147230
148562
|
logger.log("\u2394 Starting a local server...");
|
|
147231
148563
|
const child = local = (0, import_node_child_process4.fork)(miniflareCLIPath, forkOptions, {
|
|
147232
148564
|
cwd: path22.dirname(scriptPath),
|
|
@@ -147327,8 +148659,8 @@ var import_undici9 = __toESM(require_undici());
|
|
|
147327
148659
|
// src/metrics/metrics-config.ts
|
|
147328
148660
|
init_import_meta_url();
|
|
147329
148661
|
var import_node_crypto4 = require("node:crypto");
|
|
147330
|
-
var
|
|
147331
|
-
var
|
|
148662
|
+
var import_node_fs11 = require("node:fs");
|
|
148663
|
+
var import_node_path20 = __toESM(require("node:path"));
|
|
147332
148664
|
|
|
147333
148665
|
// src/dialogs.tsx
|
|
147334
148666
|
init_import_meta_url();
|
|
@@ -147476,7 +148808,7 @@ async function getMetricsConfig({
|
|
|
147476
148808
|
"Would you like to help improve Wrangler by sending usage metrics to Cloudflare?"
|
|
147477
148809
|
);
|
|
147478
148810
|
logger.log(
|
|
147479
|
-
`Your choice has been saved in the following file: ${
|
|
148811
|
+
`Your choice has been saved in the following file: ${import_node_path20.default.relative(
|
|
147480
148812
|
process.cwd(),
|
|
147481
148813
|
getMetricsConfigPath()
|
|
147482
148814
|
)}.
|
|
@@ -147496,8 +148828,8 @@ async function getMetricsConfig({
|
|
|
147496
148828
|
return { enabled, deviceId, userId };
|
|
147497
148829
|
}
|
|
147498
148830
|
function writeMetricsConfig(config) {
|
|
147499
|
-
(0,
|
|
147500
|
-
(0,
|
|
148831
|
+
(0, import_node_fs11.mkdirSync)(import_node_path20.default.dirname(getMetricsConfigPath()), { recursive: true });
|
|
148832
|
+
(0, import_node_fs11.writeFileSync)(
|
|
147501
148833
|
getMetricsConfigPath(),
|
|
147502
148834
|
JSON.stringify(
|
|
147503
148835
|
config,
|
|
@@ -147508,7 +148840,7 @@ function writeMetricsConfig(config) {
|
|
|
147508
148840
|
}
|
|
147509
148841
|
function readMetricsConfig() {
|
|
147510
148842
|
try {
|
|
147511
|
-
const config = (0,
|
|
148843
|
+
const config = (0, import_node_fs11.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
147512
148844
|
return JSON.parse(
|
|
147513
148845
|
config,
|
|
147514
148846
|
(key2, value) => key2 === "date" ? new Date(value) : value
|
|
@@ -147518,7 +148850,7 @@ function readMetricsConfig() {
|
|
|
147518
148850
|
}
|
|
147519
148851
|
}
|
|
147520
148852
|
function getMetricsConfigPath() {
|
|
147521
|
-
return
|
|
148853
|
+
return import_node_path20.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
|
|
147522
148854
|
}
|
|
147523
148855
|
function getDeviceId(config) {
|
|
147524
148856
|
const deviceId = config.deviceId ?? (0, import_node_crypto4.randomUUID)();
|
|
@@ -152994,7 +154326,7 @@ function _createClass4(Constructor, protoProps, staticProps) {
|
|
|
152994
154326
|
var TimeAgo = /* @__PURE__ */ function() {
|
|
152995
154327
|
function TimeAgo2() {
|
|
152996
154328
|
var locales = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
152997
|
-
var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
154329
|
+
var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, polyfill2 = _ref.polyfill;
|
|
152998
154330
|
_classCallCheck4(this, TimeAgo2);
|
|
152999
154331
|
if (typeof locales === "string") {
|
|
153000
154332
|
locales = [locales];
|
|
@@ -153005,7 +154337,7 @@ var TimeAgo = /* @__PURE__ */ function() {
|
|
|
153005
154337
|
this.numberFormat = new Intl.NumberFormat(this.locale);
|
|
153006
154338
|
}
|
|
153007
154339
|
}
|
|
153008
|
-
if (
|
|
154340
|
+
if (polyfill2 === false) {
|
|
153009
154341
|
this.IntlRelativeTimeFormat = Intl.RelativeTimeFormat;
|
|
153010
154342
|
this.IntlPluralRules = Intl.PluralRules;
|
|
153011
154343
|
} else {
|
|
@@ -154014,9 +155346,9 @@ var Handler3 = withConfig(
|
|
|
154014
155346
|
|
|
154015
155347
|
// src/d1/execute.tsx
|
|
154016
155348
|
init_import_meta_url();
|
|
154017
|
-
var
|
|
155349
|
+
var import_node_fs12 = require("node:fs");
|
|
154018
155350
|
var import_promises8 = require("node:fs/promises");
|
|
154019
|
-
var
|
|
155351
|
+
var import_node_path21 = __toESM(require("node:path"));
|
|
154020
155352
|
var import_chalk3 = __toESM(require_chalk());
|
|
154021
155353
|
var import_ink9 = __toESM(require_build2());
|
|
154022
155354
|
var import_ink_table4 = __toESM(require_dist2());
|
|
@@ -154122,13 +155454,13 @@ async function executeLocally(config, name, shouldPrompt, queries, persistTo) {
|
|
|
154122
155454
|
true,
|
|
154123
155455
|
config.configPath
|
|
154124
155456
|
);
|
|
154125
|
-
const dbDir =
|
|
154126
|
-
const dbPath =
|
|
155457
|
+
const dbDir = import_node_path21.default.join(persistencePath, "d1");
|
|
155458
|
+
const dbPath = import_node_path21.default.join(dbDir, `${localDB.binding}.sqlite3`);
|
|
154127
155459
|
const [{ Statement }, { createSQLiteDB }] = await npxImport(
|
|
154128
155460
|
["@miniflare/d1", "@miniflare/shared"],
|
|
154129
155461
|
logDim
|
|
154130
155462
|
);
|
|
154131
|
-
if (!(0,
|
|
155463
|
+
if (!(0, import_node_fs12.existsSync)(dbDir) && shouldPrompt) {
|
|
154132
155464
|
const ok = await confirm(
|
|
154133
155465
|
`About to create ${readableRelative(dbPath)}, ok?`
|
|
154134
155466
|
);
|
|
@@ -154240,7 +155572,7 @@ init_import_meta_url();
|
|
|
154240
155572
|
|
|
154241
155573
|
// src/d1/migrations/apply.tsx
|
|
154242
155574
|
init_import_meta_url();
|
|
154243
|
-
var
|
|
155575
|
+
var import_node_fs14 = __toESM(require("node:fs"));
|
|
154244
155576
|
var import_path6 = __toESM(require("path"));
|
|
154245
155577
|
var import_ink10 = __toESM(require_build2());
|
|
154246
155578
|
var import_ink_table5 = __toESM(require_dist2());
|
|
@@ -154248,16 +155580,16 @@ var import_react14 = __toESM(require_react());
|
|
|
154248
155580
|
|
|
154249
155581
|
// src/d1/migrations/helpers.ts
|
|
154250
155582
|
init_import_meta_url();
|
|
154251
|
-
var
|
|
155583
|
+
var import_node_fs13 = __toESM(require("node:fs"));
|
|
154252
155584
|
var import_path5 = __toESM(require("path"));
|
|
154253
155585
|
async function getMigrationsPath(projectPath, migrationsFolderPath, createIfMissing) {
|
|
154254
155586
|
const dir = import_path5.default.resolve(projectPath, migrationsFolderPath);
|
|
154255
|
-
if (
|
|
155587
|
+
if (import_node_fs13.default.existsSync(dir))
|
|
154256
155588
|
return dir;
|
|
154257
155589
|
const warning = `No migrations folder found.${migrationsFolderPath === DEFAULT_MIGRATION_PATH ? " Set `migrations_dir` in wrangler.toml to choose a different path." : ""}`;
|
|
154258
155590
|
if (createIfMissing && await confirm(`${warning}
|
|
154259
155591
|
Ok to create ${dir}?`)) {
|
|
154260
|
-
|
|
155592
|
+
import_node_fs13.default.mkdirSync(dir, { recursive: true });
|
|
154261
155593
|
return dir;
|
|
154262
155594
|
} else {
|
|
154263
155595
|
logger.warn(warning);
|
|
@@ -154302,7 +155634,7 @@ var listAppliedMigrations = async (migrationsTableName, local, config, name, per
|
|
|
154302
155634
|
};
|
|
154303
155635
|
function getMigrationNames(migrationsPath) {
|
|
154304
155636
|
const migrations = [];
|
|
154305
|
-
const dir =
|
|
155637
|
+
const dir = import_node_fs13.default.opendirSync(migrationsPath);
|
|
154306
155638
|
let dirent;
|
|
154307
155639
|
while ((dirent = dir.readSync()) !== null) {
|
|
154308
155640
|
if (dirent.name.endsWith(".sql"))
|
|
@@ -154426,7 +155758,7 @@ Your database may not be available to serve requests during the migration, conti
|
|
|
154426
155758
|
(0, import_ink10.render)(/* @__PURE__ */ import_react14.default.createElement(import_ink10.Text, null, "\u{1F552} Creating backup..."));
|
|
154427
155759
|
await createBackup(accountId, databaseInfo.uuid);
|
|
154428
155760
|
for (const migration of unappliedMigrations) {
|
|
154429
|
-
let query =
|
|
155761
|
+
let query = import_node_fs14.default.readFileSync(
|
|
154430
155762
|
`${migrationsPath}/${migration.Name}`,
|
|
154431
155763
|
"utf8"
|
|
154432
155764
|
);
|
|
@@ -154490,7 +155822,7 @@ Your database may not be available to serve requests during the migration, conti
|
|
|
154490
155822
|
|
|
154491
155823
|
// src/d1/migrations/create.tsx
|
|
154492
155824
|
init_import_meta_url();
|
|
154493
|
-
var
|
|
155825
|
+
var import_node_fs15 = __toESM(require("node:fs"));
|
|
154494
155826
|
var import_path7 = __toESM(require("path"));
|
|
154495
155827
|
var import_ink11 = __toESM(require_build2());
|
|
154496
155828
|
var import_react15 = __toESM(require_react());
|
|
@@ -154522,7 +155854,7 @@ var CreateHandler2 = withConfig(
|
|
|
154522
155854
|
const nextMigrationNumber = pad(getNextMigrationNumber(migrationsPath), 4);
|
|
154523
155855
|
const migrationName = message.replaceAll(" ", "_");
|
|
154524
155856
|
const newMigrationName = `${nextMigrationNumber}_${migrationName}.sql`;
|
|
154525
|
-
|
|
155857
|
+
import_node_fs15.default.writeFileSync(
|
|
154526
155858
|
`${migrationsPath}/${newMigrationName}`,
|
|
154527
155859
|
`-- Migration number: ${nextMigrationNumber} ${new Date().toISOString()}
|
|
154528
155860
|
`
|
|
@@ -154739,13 +156071,13 @@ async function deleteSiteNamespaceIfExisting(scriptName, accountId) {
|
|
|
154739
156071
|
|
|
154740
156072
|
// src/deployments.ts
|
|
154741
156073
|
init_import_meta_url();
|
|
154742
|
-
var
|
|
156074
|
+
var import_url3 = require("url");
|
|
154743
156075
|
async function deployments(accountId, scriptName) {
|
|
154744
156076
|
const scriptMetadata = await fetchResult(
|
|
154745
156077
|
`/accounts/${accountId}/workers/services/${scriptName}`
|
|
154746
156078
|
);
|
|
154747
156079
|
const scriptTag = scriptMetadata.default_environment.script.tag;
|
|
154748
|
-
const params = new
|
|
156080
|
+
const params = new import_url3.URLSearchParams({ order: "asc" });
|
|
154749
156081
|
const { items: deploys } = await fetchResult(
|
|
154750
156082
|
`/accounts/${accountId}/workers/deployments/by-script/${scriptTag}`,
|
|
154751
156083
|
void 0,
|
|
@@ -154779,8 +156111,8 @@ function sourceStr(source) {
|
|
|
154779
156111
|
|
|
154780
156112
|
// src/deprecated/index.ts
|
|
154781
156113
|
init_import_meta_url();
|
|
154782
|
-
var
|
|
154783
|
-
var
|
|
156114
|
+
var import_node_fs18 = __toESM(require("node:fs"));
|
|
156115
|
+
var import_node_path25 = __toESM(require("node:path"));
|
|
154784
156116
|
|
|
154785
156117
|
// src/errors.ts
|
|
154786
156118
|
init_import_meta_url();
|
|
@@ -154799,9 +156131,9 @@ var FatalError = class extends Error {
|
|
|
154799
156131
|
|
|
154800
156132
|
// src/git-client.ts
|
|
154801
156133
|
init_import_meta_url();
|
|
154802
|
-
var
|
|
156134
|
+
var import_node_fs16 = __toESM(require("node:fs"));
|
|
154803
156135
|
var import_node_os9 = __toESM(require("node:os"));
|
|
154804
|
-
var
|
|
156136
|
+
var import_node_path22 = __toESM(require("node:path"));
|
|
154805
156137
|
var import_semiver = __toESM(require_semiver());
|
|
154806
156138
|
async function isInsideGitRepo(cwd2) {
|
|
154807
156139
|
const res = await findUp(".git", { cwd: cwd2, type: "directory" });
|
|
@@ -154821,9 +156153,18 @@ async function getGitVersioon() {
|
|
|
154821
156153
|
}
|
|
154822
156154
|
async function initializeGit(cwd2) {
|
|
154823
156155
|
try {
|
|
154824
|
-
await execa5("git", [
|
|
154825
|
-
|
|
154826
|
-
|
|
156156
|
+
const { stdout: defaultBranchName } = await execa5("git", [
|
|
156157
|
+
"config",
|
|
156158
|
+
"--get",
|
|
156159
|
+
"init.defaultBranch"
|
|
156160
|
+
]);
|
|
156161
|
+
await execa5(
|
|
156162
|
+
"git",
|
|
156163
|
+
["init", "--initial-branch", defaultBranchName.trim() ?? "main"],
|
|
156164
|
+
{
|
|
156165
|
+
cwd: cwd2
|
|
156166
|
+
}
|
|
156167
|
+
);
|
|
154827
156168
|
} catch {
|
|
154828
156169
|
await execa5("git", ["init"], {
|
|
154829
156170
|
cwd: cwd2
|
|
@@ -154847,8 +156188,8 @@ async function cloneIntoDirectory(remote, targetDirectory, subdirectory) {
|
|
|
154847
156188
|
args.push("-b", remote.substring(tagIndex + 1));
|
|
154848
156189
|
args.push(remote.substring(0, tagIndex));
|
|
154849
156190
|
}
|
|
154850
|
-
const tempDir =
|
|
154851
|
-
|
|
156191
|
+
const tempDir = import_node_fs16.default.mkdtempSync(
|
|
156192
|
+
import_node_path22.default.join(import_node_os9.default.tmpdir(), `wrangler-generate-repo-`)
|
|
154852
156193
|
);
|
|
154853
156194
|
args.push(tempDir);
|
|
154854
156195
|
await execa5("git", args);
|
|
@@ -154857,13 +156198,13 @@ async function cloneIntoDirectory(remote, targetDirectory, subdirectory) {
|
|
|
154857
156198
|
cwd: tempDir
|
|
154858
156199
|
});
|
|
154859
156200
|
}
|
|
154860
|
-
const templatePath = subdirectory !== void 0 ?
|
|
156201
|
+
const templatePath = subdirectory !== void 0 ? import_node_path22.default.join(tempDir, subdirectory) : tempDir;
|
|
154861
156202
|
try {
|
|
154862
|
-
|
|
156203
|
+
import_node_fs16.default.renameSync(templatePath, targetDirectory);
|
|
154863
156204
|
} catch {
|
|
154864
156205
|
throw new Error(`Failed to find "${subdirectory}" in ${remote}`);
|
|
154865
156206
|
}
|
|
154866
|
-
|
|
156207
|
+
import_node_fs16.default.rmSync(import_node_path22.default.join(targetDirectory, ".git"), {
|
|
154867
156208
|
recursive: true,
|
|
154868
156209
|
force: true
|
|
154869
156210
|
});
|
|
@@ -154873,13 +156214,13 @@ async function cloneIntoDirectory(remote, targetDirectory, subdirectory) {
|
|
|
154873
156214
|
init_import_meta_url();
|
|
154874
156215
|
var fs12 = __toESM(require("node:fs"));
|
|
154875
156216
|
var import_promises9 = require("node:fs/promises");
|
|
154876
|
-
var
|
|
156217
|
+
var import_node_path24 = __toESM(require("node:path"));
|
|
154877
156218
|
var import_toml4 = __toESM(require_toml());
|
|
154878
156219
|
|
|
154879
156220
|
// src/package-manager.ts
|
|
154880
156221
|
init_import_meta_url();
|
|
154881
|
-
var
|
|
154882
|
-
var
|
|
156222
|
+
var import_node_fs17 = require("node:fs");
|
|
156223
|
+
var import_node_path23 = require("node:path");
|
|
154883
156224
|
var import_node_process6 = require("node:process");
|
|
154884
156225
|
async function getPackageManager2(cwd2) {
|
|
154885
156226
|
const [hasYarn, hasNpm, hasPnpm] = await Promise.all([
|
|
@@ -154887,9 +156228,9 @@ async function getPackageManager2(cwd2) {
|
|
|
154887
156228
|
supportsNpm(),
|
|
154888
156229
|
supportsPnpm()
|
|
154889
156230
|
]);
|
|
154890
|
-
const hasYarnLock = (0,
|
|
154891
|
-
const hasNpmLock = (0,
|
|
154892
|
-
const hasPnpmLock = (0,
|
|
156231
|
+
const hasYarnLock = (0, import_node_fs17.existsSync)((0, import_node_path23.join)(cwd2, "yarn.lock"));
|
|
156232
|
+
const hasNpmLock = (0, import_node_fs17.existsSync)((0, import_node_path23.join)(cwd2, "package-lock.json"));
|
|
156233
|
+
const hasPnpmLock = (0, import_node_fs17.existsSync)((0, import_node_path23.join)(cwd2, "pnpm-lock.yaml"));
|
|
154893
156234
|
const userAgent = sniffUserAgent();
|
|
154894
156235
|
if (hasNpmLock) {
|
|
154895
156236
|
if (hasNpm) {
|
|
@@ -155073,12 +156414,12 @@ async function initHandler(args) {
|
|
|
155073
156414
|
const instructions = [];
|
|
155074
156415
|
let shouldRunPackageManagerInstall = false;
|
|
155075
156416
|
const fromDashScriptName = args["from-dash"];
|
|
155076
|
-
const creationDirectory =
|
|
156417
|
+
const creationDirectory = import_node_path24.default.resolve(
|
|
155077
156418
|
process.cwd(),
|
|
155078
156419
|
(args.name ? args.name : fromDashScriptName) ?? ""
|
|
155079
156420
|
);
|
|
155080
156421
|
if (args.site) {
|
|
155081
|
-
const gitDirectory = creationDirectory !== process.cwd() ?
|
|
156422
|
+
const gitDirectory = creationDirectory !== process.cwd() ? import_node_path24.default.basename(creationDirectory) : "my-site";
|
|
155082
156423
|
const message = `The --site option is no longer supported.
|
|
155083
156424
|
If you wish to create a brand new Worker Sites project then clone the \`worker-sites-template\` starter repository:
|
|
155084
156425
|
|
|
@@ -155091,9 +156432,9 @@ Find out more about how to create and maintain Sites projects at https://develop
|
|
|
155091
156432
|
Have you considered using Cloudflare Pages instead? See https://pages.cloudflare.com/.`;
|
|
155092
156433
|
throw new CommandLineArgsError(message);
|
|
155093
156434
|
}
|
|
155094
|
-
const workerName =
|
|
156435
|
+
const workerName = import_node_path24.default.basename(creationDirectory).toLowerCase().replaceAll(/[^a-z0-9\-_]/gm, "-");
|
|
155095
156436
|
const packageManager = await getPackageManager2(creationDirectory);
|
|
155096
|
-
const wranglerTomlDestination =
|
|
156437
|
+
const wranglerTomlDestination = import_node_path24.default.join(
|
|
155097
156438
|
creationDirectory,
|
|
155098
156439
|
"./wrangler.toml"
|
|
155099
156440
|
);
|
|
@@ -155101,7 +156442,7 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
|
|
|
155101
156442
|
if (fs12.existsSync(wranglerTomlDestination)) {
|
|
155102
156443
|
let shouldContinue = false;
|
|
155103
156444
|
logger.warn(
|
|
155104
|
-
`${
|
|
156445
|
+
`${import_node_path24.default.relative(process.cwd(), wranglerTomlDestination)} already exists!`
|
|
155105
156446
|
);
|
|
155106
156447
|
if (!fromDashScriptName) {
|
|
155107
156448
|
shouldContinue = await confirm(
|
|
@@ -155123,12 +156464,12 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
|
|
|
155123
156464
|
}) + "\n"
|
|
155124
156465
|
);
|
|
155125
156466
|
logger.log(
|
|
155126
|
-
`\u2728 Created ${
|
|
156467
|
+
`\u2728 Created ${import_node_path24.default.relative(process.cwd(), wranglerTomlDestination)}`
|
|
155127
156468
|
);
|
|
155128
156469
|
justCreatedWranglerToml = true;
|
|
155129
156470
|
} catch (err2) {
|
|
155130
156471
|
throw new Error(
|
|
155131
|
-
`Failed to create ${
|
|
156472
|
+
`Failed to create ${import_node_path24.default.relative(
|
|
155132
156473
|
process.cwd(),
|
|
155133
156474
|
wranglerTomlDestination
|
|
155134
156475
|
)}.
|
|
@@ -155142,11 +156483,11 @@ ${err2.message ?? err2}`
|
|
|
155142
156483
|
if (shouldInitGit) {
|
|
155143
156484
|
await initializeGit(creationDirectory);
|
|
155144
156485
|
await (0, import_promises9.writeFile)(
|
|
155145
|
-
|
|
155146
|
-
readFileSync5(
|
|
156486
|
+
import_node_path24.default.join(creationDirectory, ".gitignore"),
|
|
156487
|
+
readFileSync5(import_node_path24.default.join(getBasePath(), "templates/gitignore"))
|
|
155147
156488
|
);
|
|
155148
156489
|
logger.log(
|
|
155149
|
-
args.name && args.name !== "." ? `\u2728 Initialized git repository at ${
|
|
156490
|
+
args.name && args.name !== "." ? `\u2728 Initialized git repository at ${import_node_path24.default.relative(
|
|
155150
156491
|
process.cwd(),
|
|
155151
156492
|
creationDirectory
|
|
155152
156493
|
)}` : `\u2728 Initialized git repository`
|
|
@@ -155166,7 +156507,7 @@ ${err2.message ?? err2}`
|
|
|
155166
156507
|
shouldCreatePackageJson = yesFlag || await confirm("No package.json found. Would you like to create one?");
|
|
155167
156508
|
if (shouldCreatePackageJson) {
|
|
155168
156509
|
await (0, import_promises9.writeFile)(
|
|
155169
|
-
|
|
156510
|
+
import_node_path24.default.join(creationDirectory, "./package.json"),
|
|
155170
156511
|
JSON.stringify(
|
|
155171
156512
|
{
|
|
155172
156513
|
name: workerName,
|
|
@@ -155181,9 +156522,9 @@ ${err2.message ?? err2}`
|
|
|
155181
156522
|
) + "\n"
|
|
155182
156523
|
);
|
|
155183
156524
|
shouldRunPackageManagerInstall = true;
|
|
155184
|
-
pathToPackageJson =
|
|
156525
|
+
pathToPackageJson = import_node_path24.default.join(creationDirectory, "package.json");
|
|
155185
156526
|
logger.log(
|
|
155186
|
-
`\u2728 Created ${
|
|
156527
|
+
`\u2728 Created ${import_node_path24.default.relative(process.cwd(), pathToPackageJson)}`
|
|
155187
156528
|
);
|
|
155188
156529
|
} else {
|
|
155189
156530
|
return;
|
|
@@ -155195,7 +156536,7 @@ ${err2.message ?? err2}`
|
|
|
155195
156536
|
);
|
|
155196
156537
|
if (!(packageJson.devDependencies?.wrangler || packageJson.dependencies?.wrangler)) {
|
|
155197
156538
|
const shouldInstall = yesFlag || await confirm(
|
|
155198
|
-
`Would you like to install wrangler into ${
|
|
156539
|
+
`Would you like to install wrangler into ${import_node_path24.default.relative(
|
|
155199
156540
|
process.cwd(),
|
|
155200
156541
|
pathToPackageJson
|
|
155201
156542
|
)}?`
|
|
@@ -155215,13 +156556,13 @@ ${err2.message ?? err2}`
|
|
|
155215
156556
|
if (yesFlag || await confirm("Would you like to use TypeScript?")) {
|
|
155216
156557
|
isTypescriptProject = true;
|
|
155217
156558
|
await (0, import_promises9.writeFile)(
|
|
155218
|
-
|
|
155219
|
-
readFileSync5(
|
|
156559
|
+
import_node_path24.default.join(creationDirectory, "./tsconfig.json"),
|
|
156560
|
+
readFileSync5(import_node_path24.default.join(getBasePath(), "templates/tsconfig.json"))
|
|
155220
156561
|
);
|
|
155221
156562
|
devDepsToInstall.push("@cloudflare/workers-types");
|
|
155222
156563
|
devDepsToInstall.push("typescript");
|
|
155223
|
-
pathToTSConfig =
|
|
155224
|
-
logger.log(`\u2728 Created ${
|
|
156564
|
+
pathToTSConfig = import_node_path24.default.join(creationDirectory, "tsconfig.json");
|
|
156565
|
+
logger.log(`\u2728 Created ${import_node_path24.default.relative(process.cwd(), pathToTSConfig)}`);
|
|
155225
156566
|
}
|
|
155226
156567
|
} else {
|
|
155227
156568
|
isTypescriptProject = true;
|
|
@@ -155236,7 +156577,7 @@ ${err2.message ?? err2}`
|
|
|
155236
156577
|
if (shouldInstall) {
|
|
155237
156578
|
devDepsToInstall.push("@cloudflare/workers-types");
|
|
155238
156579
|
instructions.push(
|
|
155239
|
-
`\u{1F6A8} Please add "@cloudflare/workers-types" to compilerOptions.types in ${
|
|
156580
|
+
`\u{1F6A8} Please add "@cloudflare/workers-types" to compilerOptions.types in ${import_node_path24.default.relative(
|
|
155240
156581
|
process.cwd(),
|
|
155241
156582
|
pathToTSConfig
|
|
155242
156583
|
)}`
|
|
@@ -155273,7 +156614,7 @@ ${err2.message ?? err2}`
|
|
|
155273
156614
|
};
|
|
155274
156615
|
fs12.writeFileSync(wranglerTomlDestination, import_toml4.default.stringify(newToml));
|
|
155275
156616
|
}
|
|
155276
|
-
const isNamedWorker = isCreatingWranglerToml &&
|
|
156617
|
+
const isNamedWorker = isCreatingWranglerToml && import_node_path24.default.dirname(packagePath) !== process.cwd();
|
|
155277
156618
|
const isAddingTestScripts = isAddingTests && !packageJsonContent.scripts?.test;
|
|
155278
156619
|
if (isWritingScripts) {
|
|
155279
156620
|
await (0, import_promises9.writeFile)(
|
|
@@ -155313,10 +156654,10 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155313
156654
|
}
|
|
155314
156655
|
}
|
|
155315
156656
|
if (isTypescriptProject) {
|
|
155316
|
-
if (!fs12.existsSync(
|
|
155317
|
-
const newWorkerFilename =
|
|
156657
|
+
if (!fs12.existsSync(import_node_path24.default.join(creationDirectory, "./src/index.ts"))) {
|
|
156658
|
+
const newWorkerFilename = import_node_path24.default.relative(
|
|
155318
156659
|
process.cwd(),
|
|
155319
|
-
|
|
156660
|
+
import_node_path24.default.join(creationDirectory, "./src/index.ts")
|
|
155320
156661
|
);
|
|
155321
156662
|
if (fromDashScriptName) {
|
|
155322
156663
|
logger.warn(
|
|
@@ -155325,7 +156666,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155325
156666
|
);
|
|
155326
156667
|
const config = readConfig(args.config, args);
|
|
155327
156668
|
const accountId = await requireAuth(config);
|
|
155328
|
-
await (0, import_promises9.mkdir)(
|
|
156669
|
+
await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
|
|
155329
156670
|
recursive: true
|
|
155330
156671
|
});
|
|
155331
156672
|
const serviceMetaData = await fetchResult(
|
|
@@ -155336,7 +156677,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155336
156677
|
`/accounts/${accountId}/workers/services/${fromDashScriptName}/environments/${defaultEnvironment}/content`
|
|
155337
156678
|
);
|
|
155338
156679
|
await (0, import_promises9.writeFile)(
|
|
155339
|
-
|
|
156680
|
+
import_node_path24.default.join(creationDirectory, "./src/index.ts"),
|
|
155340
156681
|
dashScript
|
|
155341
156682
|
);
|
|
155342
156683
|
await writePackageJsonScriptsAndUpdateWranglerToml({
|
|
@@ -155353,17 +156694,17 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155353
156694
|
const newWorkerType = yesFlag ? "fetch" : await getNewWorkerType(newWorkerFilename);
|
|
155354
156695
|
if (newWorkerType !== "none") {
|
|
155355
156696
|
const template = getNewWorkerTemplate("ts", newWorkerType);
|
|
155356
|
-
await (0, import_promises9.mkdir)(
|
|
156697
|
+
await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
|
|
155357
156698
|
recursive: true
|
|
155358
156699
|
});
|
|
155359
156700
|
await (0, import_promises9.writeFile)(
|
|
155360
|
-
|
|
155361
|
-
readFileSync5(
|
|
156701
|
+
import_node_path24.default.join(creationDirectory, "./src/index.ts"),
|
|
156702
|
+
readFileSync5(import_node_path24.default.join(getBasePath(), `templates/${template}`))
|
|
155362
156703
|
);
|
|
155363
156704
|
logger.log(
|
|
155364
|
-
`\u2728 Created ${
|
|
156705
|
+
`\u2728 Created ${import_node_path24.default.relative(
|
|
155365
156706
|
process.cwd(),
|
|
155366
|
-
|
|
156707
|
+
import_node_path24.default.join(creationDirectory, "./src/index.ts")
|
|
155367
156708
|
)}`
|
|
155368
156709
|
);
|
|
155369
156710
|
await writePackageJsonScriptsAndUpdateWranglerToml({
|
|
@@ -155377,10 +156718,10 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155377
156718
|
}
|
|
155378
156719
|
}
|
|
155379
156720
|
} else {
|
|
155380
|
-
if (!fs12.existsSync(
|
|
155381
|
-
const newWorkerFilename =
|
|
156721
|
+
if (!fs12.existsSync(import_node_path24.default.join(creationDirectory, "./src/index.js"))) {
|
|
156722
|
+
const newWorkerFilename = import_node_path24.default.relative(
|
|
155382
156723
|
process.cwd(),
|
|
155383
|
-
|
|
156724
|
+
import_node_path24.default.join(creationDirectory, "./src/index.js")
|
|
155384
156725
|
);
|
|
155385
156726
|
if (fromDashScriptName) {
|
|
155386
156727
|
logger.warn(
|
|
@@ -155389,7 +156730,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155389
156730
|
);
|
|
155390
156731
|
const config = readConfig(args.config, args);
|
|
155391
156732
|
const accountId = await requireAuth(config);
|
|
155392
|
-
await (0, import_promises9.mkdir)(
|
|
156733
|
+
await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
|
|
155393
156734
|
recursive: true
|
|
155394
156735
|
});
|
|
155395
156736
|
const serviceMetaData = await fetchResult(
|
|
@@ -155400,7 +156741,7 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155400
156741
|
`/accounts/${accountId}/workers/services/${fromDashScriptName}/environments/${defaultEnvironment}/content`
|
|
155401
156742
|
);
|
|
155402
156743
|
await (0, import_promises9.writeFile)(
|
|
155403
|
-
|
|
156744
|
+
import_node_path24.default.join(creationDirectory, "./src/index.js"),
|
|
155404
156745
|
dashScript
|
|
155405
156746
|
);
|
|
155406
156747
|
await writePackageJsonScriptsAndUpdateWranglerToml({
|
|
@@ -155417,17 +156758,17 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155417
156758
|
const newWorkerType = yesFlag ? "fetch" : await getNewWorkerType(newWorkerFilename);
|
|
155418
156759
|
if (newWorkerType !== "none") {
|
|
155419
156760
|
const template = getNewWorkerTemplate("js", newWorkerType);
|
|
155420
|
-
await (0, import_promises9.mkdir)(
|
|
156761
|
+
await (0, import_promises9.mkdir)(import_node_path24.default.join(creationDirectory, "./src"), {
|
|
155421
156762
|
recursive: true
|
|
155422
156763
|
});
|
|
155423
156764
|
await (0, import_promises9.writeFile)(
|
|
155424
|
-
|
|
155425
|
-
readFileSync5(
|
|
156765
|
+
import_node_path24.default.join(creationDirectory, "./src/index.js"),
|
|
156766
|
+
readFileSync5(import_node_path24.default.join(getBasePath(), `templates/${template}`))
|
|
155426
156767
|
);
|
|
155427
156768
|
logger.log(
|
|
155428
|
-
`\u2728 Created ${
|
|
156769
|
+
`\u2728 Created ${import_node_path24.default.relative(
|
|
155429
156770
|
process.cwd(),
|
|
155430
|
-
|
|
156771
|
+
import_node_path24.default.join(creationDirectory, "./src/index.js")
|
|
155431
156772
|
)}`
|
|
155432
156773
|
);
|
|
155433
156774
|
shouldCreateTests = yesFlag || await confirm("Would you like us to write your first test?");
|
|
@@ -155435,18 +156776,18 @@ To start developing your Worker, run \`npx wrangler dev\`${isCreatingWranglerTom
|
|
|
155435
156776
|
newWorkerTestType = await getNewWorkerTestType();
|
|
155436
156777
|
devDepsToInstall.push(newWorkerTestType);
|
|
155437
156778
|
await (0, import_promises9.writeFile)(
|
|
155438
|
-
|
|
156779
|
+
import_node_path24.default.join(creationDirectory, "./src/index.test.js"),
|
|
155439
156780
|
readFileSync5(
|
|
155440
|
-
|
|
156781
|
+
import_node_path24.default.join(
|
|
155441
156782
|
getBasePath(),
|
|
155442
156783
|
`templates/init-tests/test-${newWorkerTestType}-new-worker.js`
|
|
155443
156784
|
)
|
|
155444
156785
|
)
|
|
155445
156786
|
);
|
|
155446
156787
|
logger.log(
|
|
155447
|
-
`\u2728 Created ${
|
|
156788
|
+
`\u2728 Created ${import_node_path24.default.relative(
|
|
155448
156789
|
process.cwd(),
|
|
155449
|
-
|
|
156790
|
+
import_node_path24.default.join(creationDirectory, "./src/index.test.js")
|
|
155450
156791
|
)}`
|
|
155451
156792
|
);
|
|
155452
156793
|
}
|
|
@@ -155555,7 +156896,7 @@ function getNewWorkerToml(workerType) {
|
|
|
155555
156896
|
}
|
|
155556
156897
|
async function findPath(isolatedInit, cwd2, basename5) {
|
|
155557
156898
|
if (isolatedInit) {
|
|
155558
|
-
return fs12.existsSync(
|
|
156899
|
+
return fs12.existsSync(import_node_path24.default.resolve(cwd2, basename5)) ? import_node_path24.default.resolve(cwd2, basename5) : void 0;
|
|
155559
156900
|
} else {
|
|
155560
156901
|
return await findUp(basename5, {
|
|
155561
156902
|
cwd: cwd2
|
|
@@ -155646,6 +156987,14 @@ async function getWorkerConfig(accountId, fromDashScriptName, {
|
|
|
155646
156987
|
];
|
|
155647
156988
|
}
|
|
155648
156989
|
break;
|
|
156990
|
+
case "analytics_engine":
|
|
156991
|
+
{
|
|
156992
|
+
configObj.analytics_engine_datasets = [
|
|
156993
|
+
...configObj.analytics_engine_datasets ?? [],
|
|
156994
|
+
{ binding: binding.name, dataset: binding.dataset }
|
|
156995
|
+
];
|
|
156996
|
+
}
|
|
156997
|
+
break;
|
|
155649
156998
|
case "namespace":
|
|
155650
156999
|
{
|
|
155651
157000
|
configObj.dispatch_namespaces = [
|
|
@@ -155753,7 +157102,7 @@ function generateOptions(yargs) {
|
|
|
155753
157102
|
deprecated: true
|
|
155754
157103
|
});
|
|
155755
157104
|
}
|
|
155756
|
-
async function
|
|
157105
|
+
async function generateHandler2({
|
|
155757
157106
|
name = "",
|
|
155758
157107
|
template,
|
|
155759
157108
|
type: type2,
|
|
@@ -155776,7 +157125,7 @@ async function generateHandler({
|
|
|
155776
157125
|
}
|
|
155777
157126
|
const creationDirectory = generateWorkerDirectoryName(name);
|
|
155778
157127
|
if (site) {
|
|
155779
|
-
const gitDirectory = creationDirectory !== process.cwd() ?
|
|
157128
|
+
const gitDirectory = creationDirectory !== process.cwd() ? import_node_path25.default.basename(creationDirectory) : "my-site";
|
|
155780
157129
|
const message = `The --site option is no longer supported.
|
|
155781
157130
|
If you wish to create a brand new Worker Sites project then clone the \`worker-sites-template\` starter repository:
|
|
155782
157131
|
|
|
@@ -155790,7 +157139,7 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
|
|
|
155790
157139
|
throw new CommandLineArgsError(message);
|
|
155791
157140
|
}
|
|
155792
157141
|
logger.log(
|
|
155793
|
-
`Creating a worker in ${
|
|
157142
|
+
`Creating a worker in ${import_node_path25.default.basename(creationDirectory)} from ${template}`
|
|
155794
157143
|
);
|
|
155795
157144
|
const { remote, subdirectory } = parseTemplatePath(template);
|
|
155796
157145
|
await cloneIntoDirectory(remote, creationDirectory, subdirectory);
|
|
@@ -155798,10 +157147,10 @@ Have you considered using Cloudflare Pages instead? See https://pages.cloudflare
|
|
|
155798
157147
|
logger.log("\u2728 Success!");
|
|
155799
157148
|
}
|
|
155800
157149
|
function generateWorkerDirectoryName(workerName) {
|
|
155801
|
-
let workerDirectoryPath =
|
|
157150
|
+
let workerDirectoryPath = import_node_path25.default.resolve(process.cwd(), workerName);
|
|
155802
157151
|
let i2 = 1;
|
|
155803
|
-
while (
|
|
155804
|
-
workerDirectoryPath =
|
|
157152
|
+
while (import_node_fs18.default.existsSync(workerDirectoryPath)) {
|
|
157153
|
+
workerDirectoryPath = import_node_path25.default.resolve(process.cwd(), `${workerName}-${i2}`);
|
|
155805
157154
|
i2++;
|
|
155806
157155
|
}
|
|
155807
157156
|
return workerDirectoryPath;
|
|
@@ -156567,9 +157916,9 @@ init_import_meta_url();
|
|
|
156567
157916
|
|
|
156568
157917
|
// src/pages/build.tsx
|
|
156569
157918
|
init_import_meta_url();
|
|
156570
|
-
var
|
|
157919
|
+
var import_node_fs19 = require("node:fs");
|
|
156571
157920
|
var import_node_os10 = require("node:os");
|
|
156572
|
-
var
|
|
157921
|
+
var import_node_path31 = require("node:path");
|
|
156573
157922
|
|
|
156574
157923
|
// src/pages/constants.ts
|
|
156575
157924
|
init_import_meta_url();
|
|
@@ -156750,13 +158099,13 @@ and that at least one include rule is provided.
|
|
|
156750
158099
|
// src/pages/functions/buildPlugin.ts
|
|
156751
158100
|
init_import_meta_url();
|
|
156752
158101
|
var import_promises10 = require("node:fs/promises");
|
|
156753
|
-
var
|
|
158102
|
+
var import_node_path26 = require("node:path");
|
|
156754
158103
|
function buildPlugin({
|
|
156755
158104
|
routesModule,
|
|
156756
158105
|
outfile = "bundle.js",
|
|
156757
158106
|
minify = false,
|
|
156758
158107
|
sourcemap = false,
|
|
156759
|
-
watch:
|
|
158108
|
+
watch: watch6 = false,
|
|
156760
158109
|
onEnd = () => {
|
|
156761
158110
|
},
|
|
156762
158111
|
nodeCompat,
|
|
@@ -156766,16 +158115,16 @@ function buildPlugin({
|
|
|
156766
158115
|
}) {
|
|
156767
158116
|
return bundleWorker(
|
|
156768
158117
|
{
|
|
156769
|
-
file: (0,
|
|
158118
|
+
file: (0, import_node_path26.resolve)(getBasePath(), "templates/pages-template-plugin.ts"),
|
|
156770
158119
|
directory: functionsDirectory,
|
|
156771
158120
|
format: "modules"
|
|
156772
158121
|
},
|
|
156773
|
-
(0,
|
|
158122
|
+
(0, import_node_path26.resolve)(outfile),
|
|
156774
158123
|
{
|
|
156775
158124
|
inject: [routesModule],
|
|
156776
158125
|
minify,
|
|
156777
158126
|
sourcemap,
|
|
156778
|
-
watch:
|
|
158127
|
+
watch: watch6,
|
|
156779
158128
|
nodeCompat,
|
|
156780
158129
|
define: {},
|
|
156781
158130
|
betaD1Shims: (betaD1Shims || []).map(
|
|
@@ -156806,9 +158155,9 @@ function buildPlugin({
|
|
|
156806
158155
|
name: "Assets",
|
|
156807
158156
|
setup(pluginBuild) {
|
|
156808
158157
|
if (pluginBuild.initialOptions.outfile) {
|
|
156809
|
-
const outdir = (0,
|
|
158158
|
+
const outdir = (0, import_node_path26.dirname)(pluginBuild.initialOptions.outfile);
|
|
156810
158159
|
pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
|
|
156811
|
-
const directory = (0,
|
|
158160
|
+
const directory = (0, import_node_path26.resolve)(
|
|
156812
158161
|
args.resolveDir,
|
|
156813
158162
|
args.path.slice("assets:".length)
|
|
156814
158163
|
);
|
|
@@ -156823,7 +158172,7 @@ function buildPlugin({
|
|
|
156823
158172
|
]
|
|
156824
158173
|
};
|
|
156825
158174
|
}
|
|
156826
|
-
const path41 = `assets:./${(0,
|
|
158175
|
+
const path41 = `assets:./${(0, import_node_path26.relative)(outdir, directory)}`;
|
|
156827
158176
|
return { path: path41, external: true, namespace: "assets" };
|
|
156828
158177
|
});
|
|
156829
158178
|
}
|
|
@@ -156845,7 +158194,7 @@ function buildPlugin({
|
|
|
156845
158194
|
// src/pages/functions/buildWorker.ts
|
|
156846
158195
|
init_import_meta_url();
|
|
156847
158196
|
var import_promises11 = require("node:fs/promises");
|
|
156848
|
-
var
|
|
158197
|
+
var import_node_path27 = require("node:path");
|
|
156849
158198
|
|
|
156850
158199
|
// ../../node_modules/nanoid/index.js
|
|
156851
158200
|
init_import_meta_url();
|
|
@@ -156886,7 +158235,7 @@ function buildWorker({
|
|
|
156886
158235
|
minify = false,
|
|
156887
158236
|
sourcemap = false,
|
|
156888
158237
|
fallbackService = "ASSETS",
|
|
156889
|
-
watch:
|
|
158238
|
+
watch: watch6 = false,
|
|
156890
158239
|
onEnd = () => {
|
|
156891
158240
|
},
|
|
156892
158241
|
buildOutputDirectory,
|
|
@@ -156897,16 +158246,16 @@ function buildWorker({
|
|
|
156897
158246
|
}) {
|
|
156898
158247
|
return bundleWorker(
|
|
156899
158248
|
{
|
|
156900
|
-
file: (0,
|
|
158249
|
+
file: (0, import_node_path27.resolve)(getBasePath(), "templates/pages-template-worker.ts"),
|
|
156901
158250
|
directory: functionsDirectory,
|
|
156902
158251
|
format: "modules"
|
|
156903
158252
|
},
|
|
156904
|
-
(0,
|
|
158253
|
+
(0, import_node_path27.resolve)(outfile),
|
|
156905
158254
|
{
|
|
156906
158255
|
inject: [routesModule],
|
|
156907
158256
|
minify,
|
|
156908
158257
|
sourcemap,
|
|
156909
|
-
watch:
|
|
158258
|
+
watch: watch6,
|
|
156910
158259
|
nodeCompat,
|
|
156911
158260
|
loader: {
|
|
156912
158261
|
".txt": "text",
|
|
@@ -156944,7 +158293,7 @@ function buildWorker({
|
|
|
156944
158293
|
setup(pluginBuild) {
|
|
156945
158294
|
const identifiers = /* @__PURE__ */ new Map();
|
|
156946
158295
|
pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
|
|
156947
|
-
const directory = (0,
|
|
158296
|
+
const directory = (0, import_node_path27.resolve)(
|
|
156948
158297
|
args.resolveDir,
|
|
156949
158298
|
args.path.slice("assets:".length)
|
|
156950
158299
|
);
|
|
@@ -156972,7 +158321,7 @@ function buildWorker({
|
|
|
156972
158321
|
async (args) => {
|
|
156973
158322
|
const identifier = identifiers.get(args.path);
|
|
156974
158323
|
if (buildOutputDirectory) {
|
|
156975
|
-
const staticAssetsOutputDirectory = (0,
|
|
158324
|
+
const staticAssetsOutputDirectory = (0, import_node_path27.join)(
|
|
156976
158325
|
buildOutputDirectory,
|
|
156977
158326
|
"cdn-cgi",
|
|
156978
158327
|
"pages-plugins",
|
|
@@ -157016,7 +158365,7 @@ function buildWorker({
|
|
|
157016
158365
|
// src/pages/functions/filepath-routing.ts
|
|
157017
158366
|
init_import_meta_url();
|
|
157018
158367
|
var import_promises12 = __toESM(require("node:fs/promises"));
|
|
157019
|
-
var
|
|
158368
|
+
var import_node_path28 = __toESM(require("node:path"));
|
|
157020
158369
|
var import_esbuild3 = require("esbuild");
|
|
157021
158370
|
async function generateConfigFromFileTree({
|
|
157022
158371
|
baseDir,
|
|
@@ -157030,13 +158379,13 @@ async function generateConfigFromFileTree({
|
|
|
157030
158379
|
baseURL = baseURL.slice(0, -1);
|
|
157031
158380
|
}
|
|
157032
158381
|
await forEachFile(baseDir, async (filepath) => {
|
|
157033
|
-
const ext =
|
|
158382
|
+
const ext = import_node_path28.default.extname(filepath);
|
|
157034
158383
|
if (/^\.(mjs|js|ts|tsx|jsx)$/.test(ext)) {
|
|
157035
158384
|
const { metafile } = await (0, import_esbuild3.build)({
|
|
157036
158385
|
metafile: true,
|
|
157037
158386
|
write: false,
|
|
157038
158387
|
bundle: false,
|
|
157039
|
-
entryPoints: [
|
|
158388
|
+
entryPoints: [import_node_path28.default.resolve(filepath)]
|
|
157040
158389
|
});
|
|
157041
158390
|
const exportNames = [];
|
|
157042
158391
|
if (metafile) {
|
|
@@ -157049,13 +158398,13 @@ async function generateConfigFromFileTree({
|
|
|
157049
158398
|
/^onRequest(Get|Post|Put|Patch|Delete|Options|Head)?$/
|
|
157050
158399
|
) ?? [];
|
|
157051
158400
|
if (match) {
|
|
157052
|
-
const basename5 =
|
|
158401
|
+
const basename5 = import_node_path28.default.basename(filepath).slice(0, -ext.length);
|
|
157053
158402
|
const isIndexFile = basename5 === "index";
|
|
157054
158403
|
const isMiddlewareFile = basename5 === "_middleware" || basename5 === "_middleware_";
|
|
157055
|
-
let routePath =
|
|
157056
|
-
let mountPath =
|
|
158404
|
+
let routePath = import_node_path28.default.relative(baseDir, filepath).slice(0, -ext.length);
|
|
158405
|
+
let mountPath = import_node_path28.default.dirname(routePath);
|
|
157057
158406
|
if (isIndexFile || isMiddlewareFile) {
|
|
157058
|
-
routePath =
|
|
158407
|
+
routePath = import_node_path28.default.dirname(routePath);
|
|
157059
158408
|
}
|
|
157060
158409
|
if (routePath === ".") {
|
|
157061
158410
|
routePath = "";
|
|
@@ -157069,7 +158418,7 @@ async function generateConfigFromFileTree({
|
|
|
157069
158418
|
routePath = routePath.replaceAll(/\[([^\]]+)\]/g, ":$1");
|
|
157070
158419
|
mountPath = mountPath.replace(/\[\[([^\]]+)\]\]/g, ":$1*");
|
|
157071
158420
|
mountPath = mountPath.replaceAll(/\[([^\]]+)\]/g, ":$1");
|
|
157072
|
-
const modulePath = toUrlPath(
|
|
158421
|
+
const modulePath = toUrlPath(import_node_path28.default.relative(baseDir, filepath));
|
|
157073
158422
|
const routeEntry = {
|
|
157074
158423
|
routePath: toUrlPath(routePath),
|
|
157075
158424
|
mountPath: toUrlPath(mountPath),
|
|
@@ -157138,7 +158487,7 @@ async function forEachFile(baseDir, fn) {
|
|
|
157138
158487
|
const cwd2 = searchPaths.shift();
|
|
157139
158488
|
const dir = await import_promises12.default.readdir(cwd2, { withFileTypes: true });
|
|
157140
158489
|
for (const entry of dir) {
|
|
157141
|
-
const pathname =
|
|
158490
|
+
const pathname = import_node_path28.default.join(cwd2, entry.name);
|
|
157142
158491
|
if (entry.isDirectory()) {
|
|
157143
158492
|
searchPaths.push(pathname);
|
|
157144
158493
|
} else if (entry.isFile()) {
|
|
@@ -157155,7 +158504,7 @@ function isNotEmpty(array) {
|
|
|
157155
158504
|
// src/pages/functions/routes.ts
|
|
157156
158505
|
init_import_meta_url();
|
|
157157
158506
|
var import_promises13 = __toESM(require("node:fs/promises"));
|
|
157158
|
-
var
|
|
158507
|
+
var import_node_path29 = __toESM(require("node:path"));
|
|
157159
158508
|
|
|
157160
158509
|
// src/pages/functions/identifiers.ts
|
|
157161
158510
|
init_import_meta_url();
|
|
@@ -157251,8 +158600,8 @@ function parseConfig(config, baseDir) {
|
|
|
157251
158600
|
return paths.map((modulePath) => {
|
|
157252
158601
|
const [filepath, name = "default"] = modulePath.split(":");
|
|
157253
158602
|
let { identifier } = importMap.get(modulePath) ?? {};
|
|
157254
|
-
const resolvedPath =
|
|
157255
|
-
if (
|
|
158603
|
+
const resolvedPath = import_node_path29.default.resolve(baseDir, filepath);
|
|
158604
|
+
if (import_node_path29.default.relative(baseDir, resolvedPath).startsWith("..")) {
|
|
157256
158605
|
throw new Error(`Invalid module path "${filepath}"`);
|
|
157257
158606
|
}
|
|
157258
158607
|
if (name !== "default" && !isValidIdentifier(name)) {
|
|
@@ -157301,7 +158650,7 @@ export const routes = [
|
|
|
157301
158650
|
|
|
157302
158651
|
// src/pages/functions/routes-transformation.ts
|
|
157303
158652
|
init_import_meta_url();
|
|
157304
|
-
var
|
|
158653
|
+
var import_node_path30 = require("node:path");
|
|
157305
158654
|
|
|
157306
158655
|
// src/pages/functions/routes-consolidation.ts
|
|
157307
158656
|
init_import_meta_url();
|
|
@@ -157353,7 +158702,7 @@ function convertRoutesToGlobPatterns(routes) {
|
|
|
157353
158702
|
const globbedRoutePath = routePath.replace(/:\w+\*?.*/, "*");
|
|
157354
158703
|
if (typeof middleware === "string" || Array.isArray(middleware) && middleware.length > 0) {
|
|
157355
158704
|
if (!globbedRoutePath.endsWith("*")) {
|
|
157356
|
-
return toUrlPath((0,
|
|
158705
|
+
return toUrlPath((0, import_node_path30.join)(globbedRoutePath, "*"));
|
|
157357
158706
|
}
|
|
157358
158707
|
}
|
|
157359
158708
|
return toUrlPath(globbedRoutePath);
|
|
@@ -157491,7 +158840,7 @@ var Handler5 = async ({
|
|
|
157491
158840
|
minify,
|
|
157492
158841
|
sourcemap,
|
|
157493
158842
|
fallbackService,
|
|
157494
|
-
watch:
|
|
158843
|
+
watch: watch6,
|
|
157495
158844
|
plugin,
|
|
157496
158845
|
buildOutputDirectory,
|
|
157497
158846
|
nodeCompat,
|
|
@@ -157514,7 +158863,7 @@ var Handler5 = async ({
|
|
|
157514
158863
|
throw new FatalError("Could not parse a valid set of 'bindings'.", 1);
|
|
157515
158864
|
}
|
|
157516
158865
|
}
|
|
157517
|
-
buildOutputDirectory ??= (0,
|
|
158866
|
+
buildOutputDirectory ??= (0, import_node_path31.dirname)(outfile);
|
|
157518
158867
|
try {
|
|
157519
158868
|
await buildFunctions({
|
|
157520
158869
|
outfile,
|
|
@@ -157523,7 +158872,7 @@ var Handler5 = async ({
|
|
|
157523
158872
|
minify,
|
|
157524
158873
|
sourcemap,
|
|
157525
158874
|
fallbackService,
|
|
157526
|
-
watch:
|
|
158875
|
+
watch: watch6,
|
|
157527
158876
|
plugin,
|
|
157528
158877
|
buildOutputDirectory,
|
|
157529
158878
|
nodeCompat,
|
|
@@ -157550,7 +158899,7 @@ async function buildFunctions({
|
|
|
157550
158899
|
minify = false,
|
|
157551
158900
|
sourcemap = false,
|
|
157552
158901
|
fallbackService = "ASSETS",
|
|
157553
|
-
watch:
|
|
158902
|
+
watch: watch6 = false,
|
|
157554
158903
|
onEnd,
|
|
157555
158904
|
plugin = false,
|
|
157556
158905
|
buildOutputDirectory,
|
|
@@ -157562,7 +158911,7 @@ async function buildFunctions({
|
|
|
157562
158911
|
RUNNING_BUILDERS.forEach(
|
|
157563
158912
|
(runningBuilder) => runningBuilder.stop && runningBuilder.stop()
|
|
157564
158913
|
);
|
|
157565
|
-
const routesModule = (0,
|
|
158914
|
+
const routesModule = (0, import_node_path31.join)((0, import_node_os10.tmpdir)(), `./functionsRoutes-${Math.random()}.mjs`);
|
|
157566
158915
|
const baseURL = toUrlPath("/");
|
|
157567
158916
|
const config = await generateConfigFromFileTree({
|
|
157568
158917
|
baseDir: functionsDirectory,
|
|
@@ -157575,10 +158924,10 @@ async function buildFunctions({
|
|
|
157575
158924
|
}
|
|
157576
158925
|
if (routesOutputPath) {
|
|
157577
158926
|
const routesJSON = convertRoutesToRoutesJSONSpec(config.routes);
|
|
157578
|
-
(0,
|
|
158927
|
+
(0, import_node_fs19.writeFileSync)(routesOutputPath, JSON.stringify(routesJSON, null, 2));
|
|
157579
158928
|
}
|
|
157580
158929
|
if (outputConfigPath) {
|
|
157581
|
-
(0,
|
|
158930
|
+
(0, import_node_fs19.writeFileSync)(
|
|
157582
158931
|
outputConfigPath,
|
|
157583
158932
|
JSON.stringify({ ...config, baseURL }, null, 2)
|
|
157584
158933
|
);
|
|
@@ -157588,7 +158937,7 @@ async function buildFunctions({
|
|
|
157588
158937
|
srcDir: functionsDirectory,
|
|
157589
158938
|
outfile: routesModule
|
|
157590
158939
|
});
|
|
157591
|
-
const absoluteFunctionsDirectory = (0,
|
|
158940
|
+
const absoluteFunctionsDirectory = (0, import_node_path31.resolve)(functionsDirectory);
|
|
157592
158941
|
if (plugin) {
|
|
157593
158942
|
RUNNING_BUILDERS.push(
|
|
157594
158943
|
await buildPlugin({
|
|
@@ -157596,7 +158945,7 @@ async function buildFunctions({
|
|
|
157596
158945
|
outfile,
|
|
157597
158946
|
minify,
|
|
157598
158947
|
sourcemap,
|
|
157599
|
-
watch:
|
|
158948
|
+
watch: watch6,
|
|
157600
158949
|
nodeCompat,
|
|
157601
158950
|
functionsDirectory: absoluteFunctionsDirectory,
|
|
157602
158951
|
local,
|
|
@@ -157612,7 +158961,7 @@ async function buildFunctions({
|
|
|
157612
158961
|
minify,
|
|
157613
158962
|
sourcemap,
|
|
157614
158963
|
fallbackService,
|
|
157615
|
-
watch:
|
|
158964
|
+
watch: watch6,
|
|
157616
158965
|
functionsDirectory: absoluteFunctionsDirectory,
|
|
157617
158966
|
local,
|
|
157618
158967
|
betaD1Shims: d1Databases,
|
|
@@ -158275,10 +159624,10 @@ async function ListHandler4({ projectName }) {
|
|
|
158275
159624
|
// src/pages/dev.tsx
|
|
158276
159625
|
init_import_meta_url();
|
|
158277
159626
|
var import_node_child_process6 = require("node:child_process");
|
|
158278
|
-
var
|
|
159627
|
+
var import_node_fs20 = require("node:fs");
|
|
158279
159628
|
var import_node_os11 = require("node:os");
|
|
158280
|
-
var
|
|
158281
|
-
var
|
|
159629
|
+
var import_node_path32 = require("node:path");
|
|
159630
|
+
var import_chokidar4 = require("chokidar");
|
|
158282
159631
|
var esbuild3 = __toESM(require("esbuild"));
|
|
158283
159632
|
var DURABLE_OBJECTS_BINDING_REGEXP = new RegExp(
|
|
158284
159633
|
/^(?<binding>[^=]+)=(?<className>[^@\s]+)(@(?<scriptName>.*)$)?$/
|
|
@@ -158384,6 +159733,11 @@ function Options7(yargs) {
|
|
|
158384
159733
|
type: "boolean",
|
|
158385
159734
|
hidden: true
|
|
158386
159735
|
},
|
|
159736
|
+
"experimental-local": {
|
|
159737
|
+
describe: "Run on my machine using the Cloudflare Workers runtime",
|
|
159738
|
+
type: "boolean",
|
|
159739
|
+
default: false
|
|
159740
|
+
},
|
|
158387
159741
|
config: {
|
|
158388
159742
|
describe: "Pages does not support wrangler.toml",
|
|
158389
159743
|
type: "string",
|
|
@@ -158416,6 +159770,7 @@ var Handler7 = async ({
|
|
|
158416
159770
|
persist,
|
|
158417
159771
|
persistTo,
|
|
158418
159772
|
"node-compat": nodeCompat,
|
|
159773
|
+
"experimental-local": experimentalLocal,
|
|
158419
159774
|
config,
|
|
158420
159775
|
_: [_pages, _dev, ...remaining],
|
|
158421
159776
|
logLevel
|
|
@@ -158445,7 +159800,7 @@ var Handler7 = async ({
|
|
|
158445
159800
|
if (proxyPort === void 0)
|
|
158446
159801
|
return void 0;
|
|
158447
159802
|
} else {
|
|
158448
|
-
directory = (0,
|
|
159803
|
+
directory = (0, import_node_path32.resolve)(directory);
|
|
158449
159804
|
}
|
|
158450
159805
|
if (!compatibilityDate) {
|
|
158451
159806
|
const currentDate = new Date().toISOString().substring(0, 10);
|
|
@@ -158470,10 +159825,10 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158470
159825
|
const scriptReadyPromise = new Promise(
|
|
158471
159826
|
(promiseResolve) => scriptReadyResolve = promiseResolve
|
|
158472
159827
|
);
|
|
158473
|
-
const workerScriptPath = directory !== void 0 ? (0,
|
|
158474
|
-
const usingWorkerScript = (0,
|
|
159828
|
+
const workerScriptPath = directory !== void 0 ? (0, import_node_path32.join)(directory, singleWorkerScriptPath) : singleWorkerScriptPath;
|
|
159829
|
+
const usingWorkerScript = (0, import_node_fs20.existsSync)(workerScriptPath);
|
|
158475
159830
|
const functionsDirectory = "./functions";
|
|
158476
|
-
let usingFunctions = !usingWorkerScript && (0,
|
|
159831
|
+
let usingFunctions = !usingWorkerScript && (0, import_node_fs20.existsSync)(functionsDirectory);
|
|
158477
159832
|
let scriptPath = "";
|
|
158478
159833
|
if (usingWorkerScript) {
|
|
158479
159834
|
scriptReadyResolve();
|
|
@@ -158490,14 +159845,14 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158490
159845
|
}
|
|
158491
159846
|
};
|
|
158492
159847
|
await runBuild();
|
|
158493
|
-
(0,
|
|
159848
|
+
(0, import_chokidar4.watch)([scriptPath], {
|
|
158494
159849
|
persistent: true,
|
|
158495
159850
|
ignoreInitial: true
|
|
158496
159851
|
}).on("all", async () => {
|
|
158497
159852
|
await runBuild();
|
|
158498
159853
|
});
|
|
158499
159854
|
} else if (usingFunctions) {
|
|
158500
|
-
const outfile = (0,
|
|
159855
|
+
const outfile = (0, import_node_path32.join)((0, import_node_os11.tmpdir)(), `./functionsWorker-${Math.random()}.mjs`);
|
|
158501
159856
|
scriptPath = outfile;
|
|
158502
159857
|
if (nodeCompat) {
|
|
158503
159858
|
console.warn(
|
|
@@ -158518,7 +159873,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158518
159873
|
local: true
|
|
158519
159874
|
});
|
|
158520
159875
|
await sendMetricsEvent("build pages functions");
|
|
158521
|
-
(0,
|
|
159876
|
+
(0, import_chokidar4.watch)([functionsDirectory], {
|
|
158522
159877
|
persistent: true,
|
|
158523
159878
|
ignoreInitial: true
|
|
158524
159879
|
}).on("all", async () => {
|
|
@@ -158559,7 +159914,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158559
159914
|
if (!usingFunctions && !usingWorkerScript) {
|
|
158560
159915
|
scriptReadyResolve();
|
|
158561
159916
|
logger.log("No functions. Shimming...");
|
|
158562
|
-
scriptPath = (0,
|
|
159917
|
+
scriptPath = (0, import_node_path32.resolve)(getBasePath(), "templates/pages-shim.ts");
|
|
158563
159918
|
}
|
|
158564
159919
|
await scriptReadyPromise;
|
|
158565
159920
|
if (scriptPath === "") {
|
|
@@ -158570,13 +159925,13 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158570
159925
|
}
|
|
158571
159926
|
let entrypoint = scriptPath;
|
|
158572
159927
|
if (directory && (usingFunctions || usingWorkerScript)) {
|
|
158573
|
-
const routesJSONPath = (0,
|
|
158574
|
-
if ((0,
|
|
159928
|
+
const routesJSONPath = (0, import_node_path32.join)(directory, "_routes.json");
|
|
159929
|
+
if ((0, import_node_fs20.existsSync)(routesJSONPath)) {
|
|
158575
159930
|
let routesJSONContents;
|
|
158576
159931
|
const runBuild = async (entrypointFile, outfile, routes) => {
|
|
158577
159932
|
await esbuild3.build({
|
|
158578
159933
|
entryPoints: [
|
|
158579
|
-
(0,
|
|
159934
|
+
(0, import_node_path32.resolve)(getBasePath(), "templates/pages-dev-pipeline.ts")
|
|
158580
159935
|
],
|
|
158581
159936
|
bundle: true,
|
|
158582
159937
|
sourcemap: true,
|
|
@@ -158584,7 +159939,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158584
159939
|
plugins: [
|
|
158585
159940
|
esbuildAliasExternalPlugin({
|
|
158586
159941
|
__ENTRY_POINT__: entrypointFile,
|
|
158587
|
-
"./pages-dev-util": (0,
|
|
159942
|
+
"./pages-dev-util": (0, import_node_path32.resolve)(
|
|
158588
159943
|
getBasePath(),
|
|
158589
159944
|
"templates/pages-dev-util.ts"
|
|
158590
159945
|
)
|
|
@@ -158597,9 +159952,9 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158597
159952
|
});
|
|
158598
159953
|
};
|
|
158599
159954
|
try {
|
|
158600
|
-
routesJSONContents = (0,
|
|
159955
|
+
routesJSONContents = (0, import_node_fs20.readFileSync)(routesJSONPath, "utf-8");
|
|
158601
159956
|
validateRoutes2(JSON.parse(routesJSONContents), directory);
|
|
158602
|
-
entrypoint = (0,
|
|
159957
|
+
entrypoint = (0, import_node_path32.join)(
|
|
158603
159958
|
(0, import_node_os11.tmpdir)(),
|
|
158604
159959
|
`${Math.random().toString(36).slice(2)}.js`
|
|
158605
159960
|
);
|
|
@@ -158614,12 +159969,12 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158614
159969
|
);
|
|
158615
159970
|
}
|
|
158616
159971
|
}
|
|
158617
|
-
(0,
|
|
159972
|
+
(0, import_chokidar4.watch)([routesJSONPath], {
|
|
158618
159973
|
persistent: true,
|
|
158619
159974
|
ignoreInitial: true
|
|
158620
159975
|
}).on("all", async () => {
|
|
158621
159976
|
try {
|
|
158622
|
-
routesJSONContents = (0,
|
|
159977
|
+
routesJSONContents = (0, import_node_fs20.readFileSync)(routesJSONPath, "utf-8");
|
|
158623
159978
|
validateRoutes2(JSON.parse(routesJSONContents), directory);
|
|
158624
159979
|
await runBuild(scriptPath, entrypoint, routesJSONContents);
|
|
158625
159980
|
} catch (err2) {
|
|
@@ -158655,6 +160010,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
158655
160010
|
compatibilityDate,
|
|
158656
160011
|
compatibilityFlags,
|
|
158657
160012
|
nodeCompat,
|
|
160013
|
+
experimentalLocal,
|
|
158658
160014
|
vars: Object.fromEntries(
|
|
158659
160015
|
bindings.map((binding) => binding.toString().split("=")).map(([key2, ...values]) => [key2, values.join("=")])
|
|
158660
160016
|
),
|
|
@@ -158834,8 +160190,8 @@ You should bundle your Worker or remove the import if it is unused.`
|
|
|
158834
160190
|
|
|
158835
160191
|
// src/pages/functions.tsx
|
|
158836
160192
|
init_import_meta_url();
|
|
158837
|
-
var
|
|
158838
|
-
var
|
|
160193
|
+
var import_node_fs21 = require("node:fs");
|
|
160194
|
+
var import_node_path33 = __toESM(require("node:path"));
|
|
158839
160195
|
function OptimizeRoutesOptions(yargs) {
|
|
158840
160196
|
return yargs.options({
|
|
158841
160197
|
"routes-path": {
|
|
@@ -158859,21 +160215,21 @@ async function OptimizeRoutesHandler({
|
|
|
158859
160215
|
logger.log(pagesBetaWarning);
|
|
158860
160216
|
}
|
|
158861
160217
|
let routesFileContents;
|
|
158862
|
-
const routesOutputDirectory =
|
|
158863
|
-
if (!(0,
|
|
160218
|
+
const routesOutputDirectory = import_node_path33.default.dirname(outputRoutesPath);
|
|
160219
|
+
if (!(0, import_node_fs21.existsSync)(routesPath)) {
|
|
158864
160220
|
throw new FatalError(
|
|
158865
160221
|
`Oops! File ${routesPath} does not exist. Please make sure --routes-path is a valid file path (for example "/public/_routes.json").`,
|
|
158866
160222
|
1
|
|
158867
160223
|
);
|
|
158868
160224
|
}
|
|
158869
|
-
if (!(0,
|
|
160225
|
+
if (!(0, import_node_fs21.existsSync)(routesOutputDirectory) || !(0, import_node_fs21.lstatSync)(routesOutputDirectory).isDirectory()) {
|
|
158870
160226
|
throw new FatalError(
|
|
158871
160227
|
`Oops! Folder ${routesOutputDirectory} does not exist. Please make sure --output-routes-path is a valid file path (for example "/public/_routes.json").`,
|
|
158872
160228
|
1
|
|
158873
160229
|
);
|
|
158874
160230
|
}
|
|
158875
160231
|
try {
|
|
158876
|
-
routesFileContents = (0,
|
|
160232
|
+
routesFileContents = (0, import_node_fs21.readFileSync)(routesPath, "utf-8");
|
|
158877
160233
|
} catch (err2) {
|
|
158878
160234
|
throw new FatalError(`Error while reading ${routesPath} file: ${err2}`);
|
|
158879
160235
|
}
|
|
@@ -158882,7 +160238,7 @@ async function OptimizeRoutesHandler({
|
|
|
158882
160238
|
const optimizedRoutes = optimizeRoutesJSONSpec(routes);
|
|
158883
160239
|
const optimizedRoutesContents = JSON.stringify(optimizedRoutes);
|
|
158884
160240
|
try {
|
|
158885
|
-
(0,
|
|
160241
|
+
(0, import_node_fs21.writeFileSync)(outputRoutesPath, optimizedRoutesContents);
|
|
158886
160242
|
} catch (err2) {
|
|
158887
160243
|
throw new FatalError(
|
|
158888
160244
|
`Error writing to ${outputRoutesPath} file: ${err2}`,
|
|
@@ -158894,9 +160250,9 @@ async function OptimizeRoutesHandler({
|
|
|
158894
160250
|
// src/pages/publish.tsx
|
|
158895
160251
|
init_import_meta_url();
|
|
158896
160252
|
var import_node_child_process7 = require("node:child_process");
|
|
158897
|
-
var
|
|
160253
|
+
var import_node_fs22 = require("node:fs");
|
|
158898
160254
|
var import_node_os12 = require("node:os");
|
|
158899
|
-
var
|
|
160255
|
+
var import_node_path35 = require("node:path");
|
|
158900
160256
|
var import_node_process7 = require("node:process");
|
|
158901
160257
|
var import_ink17 = __toESM(require_build2());
|
|
158902
160258
|
var import_ink_select_input4 = __toESM(require_build3());
|
|
@@ -158906,10 +160262,10 @@ var import_undici10 = __toESM(require_undici());
|
|
|
158906
160262
|
// src/pages/upload.tsx
|
|
158907
160263
|
init_import_meta_url();
|
|
158908
160264
|
var import_promises15 = require("node:fs/promises");
|
|
158909
|
-
var
|
|
160265
|
+
var import_node_path34 = require("node:path");
|
|
158910
160266
|
var import_ink16 = __toESM(require_build2());
|
|
158911
160267
|
var import_ink_spinner = __toESM(require_build5());
|
|
158912
|
-
var
|
|
160268
|
+
var import_mime2 = __toESM(require_mime2());
|
|
158913
160269
|
var import_minimatch = __toESM(require_minimatch2());
|
|
158914
160270
|
|
|
158915
160271
|
// ../../node_modules/p-queue/dist/index.js
|
|
@@ -159332,20 +160688,6 @@ _PQueue_carryoverConcurrencyCount = /* @__PURE__ */ new WeakMap(), _PQueue_isInt
|
|
|
159332
160688
|
|
|
159333
160689
|
// src/pages/upload.tsx
|
|
159334
160690
|
var import_react20 = __toESM(require_react());
|
|
159335
|
-
|
|
159336
|
-
// src/pages/hash.tsx
|
|
159337
|
-
init_import_meta_url();
|
|
159338
|
-
var import_node_fs20 = require("node:fs");
|
|
159339
|
-
var import_node_path32 = require("node:path");
|
|
159340
|
-
var import_blake3_wasm = require("blake3-wasm");
|
|
159341
|
-
var hashFile = (filepath) => {
|
|
159342
|
-
const contents = (0, import_node_fs20.readFileSync)(filepath);
|
|
159343
|
-
const base64Contents = contents.toString("base64");
|
|
159344
|
-
const extension = (0, import_node_path32.extname)(filepath).substring(1);
|
|
159345
|
-
return (0, import_blake3_wasm.hash)(base64Contents + extension).toString("hex").slice(0, 32);
|
|
159346
|
-
};
|
|
159347
|
-
|
|
159348
|
-
// src/pages/upload.tsx
|
|
159349
160691
|
function Options8(yargs) {
|
|
159350
160692
|
return yargs.positional("directory", {
|
|
159351
160693
|
type: "string",
|
|
@@ -159373,7 +160715,7 @@ var Handler8 = async ({
|
|
|
159373
160715
|
jwt: process.env.CF_PAGES_UPLOAD_JWT
|
|
159374
160716
|
});
|
|
159375
160717
|
if (outputManifestPath) {
|
|
159376
|
-
await (0, import_promises15.mkdir)((0,
|
|
160718
|
+
await (0, import_promises15.mkdir)((0, import_node_path34.dirname)(outputManifestPath), { recursive: true });
|
|
159377
160719
|
await (0, import_promises15.writeFile)(outputManifestPath, JSON.stringify(manifest));
|
|
159378
160720
|
}
|
|
159379
160721
|
logger.log(`\u2728 Upload complete!`);
|
|
@@ -159398,13 +160740,13 @@ var upload = async (args) => {
|
|
|
159398
160740
|
"**/node_modules",
|
|
159399
160741
|
"**/.git"
|
|
159400
160742
|
].map((pattern) => new import_minimatch.Minimatch(pattern));
|
|
159401
|
-
const directory = (0,
|
|
160743
|
+
const directory = (0, import_node_path34.resolve)(args.directory);
|
|
159402
160744
|
const walk = async (dir, fileMap2 = /* @__PURE__ */ new Map(), startingDir = dir) => {
|
|
159403
160745
|
const files2 = await (0, import_promises15.readdir)(dir);
|
|
159404
160746
|
await Promise.all(
|
|
159405
160747
|
files2.map(async (file) => {
|
|
159406
|
-
const filepath = (0,
|
|
159407
|
-
const relativeFilepath = (0,
|
|
160748
|
+
const filepath = (0, import_node_path34.join)(dir, file);
|
|
160749
|
+
const relativeFilepath = (0, import_node_path34.relative)(startingDir, filepath);
|
|
159408
160750
|
const filestat = await (0, import_promises15.stat)(filepath);
|
|
159409
160751
|
for (const minimatch of IGNORE_LIST) {
|
|
159410
160752
|
if (minimatch.match(relativeFilepath)) {
|
|
@@ -159417,7 +160759,7 @@ var upload = async (args) => {
|
|
|
159417
160759
|
if (filestat.isDirectory()) {
|
|
159418
160760
|
fileMap2 = await walk(filepath, fileMap2, startingDir);
|
|
159419
160761
|
} else {
|
|
159420
|
-
const name = relativeFilepath.split(
|
|
160762
|
+
const name = relativeFilepath.split(import_node_path34.sep).join("/");
|
|
159421
160763
|
if (filestat.size > MAX_ASSET_SIZE) {
|
|
159422
160764
|
throw new FatalError(
|
|
159423
160765
|
`Error: Pages only supports files up to ${prettyBytes(
|
|
@@ -159429,7 +160771,7 @@ ${name} is ${prettyBytes(filestat.size)} in size`,
|
|
|
159429
160771
|
}
|
|
159430
160772
|
fileMap2.set(name, {
|
|
159431
160773
|
path: filepath,
|
|
159432
|
-
contentType: (0,
|
|
160774
|
+
contentType: (0, import_mime2.getType)(name) || "application/octet-stream",
|
|
159433
160775
|
sizeInBytes: filestat.size,
|
|
159434
160776
|
hash: hashFile(filepath)
|
|
159435
160777
|
});
|
|
@@ -159809,19 +161151,19 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
159809
161151
|
}
|
|
159810
161152
|
let _headers, _redirects, _routesGenerated, _routesCustom, _workerJS;
|
|
159811
161153
|
try {
|
|
159812
|
-
_headers = (0,
|
|
161154
|
+
_headers = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_headers"), "utf-8");
|
|
159813
161155
|
} catch {
|
|
159814
161156
|
}
|
|
159815
161157
|
try {
|
|
159816
|
-
_redirects = (0,
|
|
161158
|
+
_redirects = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_redirects"), "utf-8");
|
|
159817
161159
|
} catch {
|
|
159818
161160
|
}
|
|
159819
161161
|
try {
|
|
159820
|
-
_routesCustom = (0,
|
|
161162
|
+
_routesCustom = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_routes.json"), "utf-8");
|
|
159821
161163
|
} catch {
|
|
159822
161164
|
}
|
|
159823
161165
|
try {
|
|
159824
|
-
_workerJS = (0,
|
|
161166
|
+
_workerJS = (0, import_node_fs22.readFileSync)((0, import_node_path35.join)(directory, "_worker.js"), "utf-8");
|
|
159825
161167
|
} catch {
|
|
159826
161168
|
}
|
|
159827
161169
|
const project = await fetchResult(
|
|
@@ -159832,12 +161174,12 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
159832
161174
|
isProduction = project.production_branch === branch;
|
|
159833
161175
|
}
|
|
159834
161176
|
let builtFunctions = void 0;
|
|
159835
|
-
const functionsDirectory = (0,
|
|
159836
|
-
const routesOutputPath = !(0,
|
|
161177
|
+
const functionsDirectory = (0, import_node_path35.join)((0, import_node_process7.cwd)(), "functions");
|
|
161178
|
+
const routesOutputPath = !(0, import_node_fs22.existsSync)((0, import_node_path35.join)(directory, "_routes.json")) ? (0, import_node_path35.join)((0, import_node_os12.tmpdir)(), `_routes-${Math.random()}.json`) : void 0;
|
|
159837
161179
|
let filepathRoutingConfig;
|
|
159838
|
-
if (!_workerJS && (0,
|
|
159839
|
-
const outfile = (0,
|
|
159840
|
-
const outputConfigPath = (0,
|
|
161180
|
+
if (!_workerJS && (0, import_node_fs22.existsSync)(functionsDirectory)) {
|
|
161181
|
+
const outfile = (0, import_node_path35.join)((0, import_node_os12.tmpdir)(), `./functionsWorker-${Math.random()}.js`);
|
|
161182
|
+
const outputConfigPath = (0, import_node_path35.join)(
|
|
159841
161183
|
(0, import_node_os12.tmpdir)(),
|
|
159842
161184
|
`functions-filepath-routing-config-${Math.random()}.json`
|
|
159843
161185
|
);
|
|
@@ -159848,15 +161190,15 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
159848
161190
|
functionsDirectory,
|
|
159849
161191
|
onEnd: () => {
|
|
159850
161192
|
},
|
|
159851
|
-
buildOutputDirectory: (0,
|
|
161193
|
+
buildOutputDirectory: (0, import_node_path35.dirname)(outfile),
|
|
159852
161194
|
routesOutputPath,
|
|
159853
161195
|
local: false,
|
|
159854
161196
|
d1Databases: Object.keys(
|
|
159855
161197
|
project.deployment_configs[isProduction ? "production" : "preview"].d1_databases ?? {}
|
|
159856
161198
|
)
|
|
159857
161199
|
});
|
|
159858
|
-
builtFunctions = (0,
|
|
159859
|
-
filepathRoutingConfig = (0,
|
|
161200
|
+
builtFunctions = (0, import_node_fs22.readFileSync)(outfile, "utf-8");
|
|
161201
|
+
filepathRoutingConfig = (0, import_node_fs22.readFileSync)(outputConfigPath, "utf-8");
|
|
159860
161202
|
} catch (e2) {
|
|
159861
161203
|
if (e2 instanceof FunctionsNoRoutesError) {
|
|
159862
161204
|
logger.warn(
|
|
@@ -159905,7 +161247,7 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
159905
161247
|
if (_routesCustom) {
|
|
159906
161248
|
try {
|
|
159907
161249
|
const routesCustomJSON = JSON.parse(_routesCustom);
|
|
159908
|
-
validateRoutes2(routesCustomJSON, (0,
|
|
161250
|
+
validateRoutes2(routesCustomJSON, (0, import_node_path35.join)(directory, "_routes.json"));
|
|
159909
161251
|
formData.append(
|
|
159910
161252
|
"_routes.json",
|
|
159911
161253
|
new import_undici10.File([_routesCustom], "_routes.json")
|
|
@@ -159927,7 +161269,7 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
159927
161269
|
if (_routesCustom) {
|
|
159928
161270
|
try {
|
|
159929
161271
|
const routesCustomJSON = JSON.parse(_routesCustom);
|
|
159930
|
-
validateRoutes2(routesCustomJSON, (0,
|
|
161272
|
+
validateRoutes2(routesCustomJSON, (0, import_node_path35.join)(directory, "_routes.json"));
|
|
159931
161273
|
formData.append(
|
|
159932
161274
|
"_routes.json",
|
|
159933
161275
|
new import_undici10.File([_routesCustom], "_routes.json")
|
|
@@ -159943,7 +161285,7 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
159943
161285
|
}
|
|
159944
161286
|
} else if (routesOutputPath) {
|
|
159945
161287
|
try {
|
|
159946
|
-
_routesGenerated = (0,
|
|
161288
|
+
_routesGenerated = (0, import_node_fs22.readFileSync)(routesOutputPath, "utf-8");
|
|
159947
161289
|
if (_routesGenerated) {
|
|
159948
161290
|
formData.append(
|
|
159949
161291
|
"_routes.json",
|
|
@@ -160043,13 +161385,13 @@ var pages = (yargs) => {
|
|
|
160043
161385
|
|
|
160044
161386
|
// src/publish/index.ts
|
|
160045
161387
|
init_import_meta_url();
|
|
160046
|
-
var
|
|
161388
|
+
var import_node_path37 = __toESM(require("node:path"));
|
|
160047
161389
|
|
|
160048
161390
|
// src/publish/publish.ts
|
|
160049
161391
|
init_import_meta_url();
|
|
160050
161392
|
var import_node_assert10 = __toESM(require("node:assert"));
|
|
160051
|
-
var
|
|
160052
|
-
var
|
|
161393
|
+
var import_node_fs23 = require("node:fs");
|
|
161394
|
+
var import_node_path36 = __toESM(require("node:path"));
|
|
160053
161395
|
var import_node_url12 = require("node:url");
|
|
160054
161396
|
var import_chalk5 = __toESM(require_chalk());
|
|
160055
161397
|
var import_tmp_promise4 = __toESM(require_tmp_promise());
|
|
@@ -160485,9 +161827,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160485
161827
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
160486
161828
|
);
|
|
160487
161829
|
if (props.outDir) {
|
|
160488
|
-
(0,
|
|
160489
|
-
const readmePath =
|
|
160490
|
-
(0,
|
|
161830
|
+
(0, import_node_fs23.mkdirSync)(props.outDir, { recursive: true });
|
|
161831
|
+
const readmePath = import_node_path36.default.join(props.outDir, "README.md");
|
|
161832
|
+
(0, import_node_fs23.writeFileSync)(
|
|
160491
161833
|
readmePath,
|
|
160492
161834
|
`This folder contains the built output assets for the worker "${scriptName}" generated at ${new Date().toISOString()}.`
|
|
160493
161835
|
);
|
|
@@ -160524,10 +161866,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160524
161866
|
try {
|
|
160525
161867
|
if (props.noBundle) {
|
|
160526
161868
|
const destinationDir = typeof destination === "string" ? destination : destination.path;
|
|
160527
|
-
(0,
|
|
160528
|
-
(0,
|
|
160529
|
-
|
|
160530
|
-
(0,
|
|
161869
|
+
(0, import_node_fs23.mkdirSync)(destinationDir, { recursive: true });
|
|
161870
|
+
(0, import_node_fs23.writeFileSync)(
|
|
161871
|
+
import_node_path36.default.join(destinationDir, import_node_path36.default.basename(props.entry.file)),
|
|
161872
|
+
(0, import_node_fs23.readFileSync)(props.entry.file, "utf-8")
|
|
160531
161873
|
);
|
|
160532
161874
|
}
|
|
160533
161875
|
const betaD1Shims = identifyD1BindingsAsBeta(config.d1_databases);
|
|
@@ -160575,7 +161917,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160575
161917
|
experimentalLocal: false
|
|
160576
161918
|
}
|
|
160577
161919
|
);
|
|
160578
|
-
const content = (0,
|
|
161920
|
+
const content = (0, import_node_fs23.readFileSync)(resolvedEntryPointPath, {
|
|
160579
161921
|
encoding: "utf-8"
|
|
160580
161922
|
});
|
|
160581
161923
|
const migrations = !props.dryRun ? await getMigrationsToUpload(scriptName, {
|
|
@@ -160611,6 +161953,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160611
161953
|
r2_buckets: config.r2_buckets,
|
|
160612
161954
|
d1_databases: identifyD1BindingsAsBeta(config.d1_databases),
|
|
160613
161955
|
services: config.services,
|
|
161956
|
+
analytics_engine_datasets: config.analytics_engine_datasets,
|
|
160614
161957
|
dispatch_namespaces: config.dispatch_namespaces,
|
|
160615
161958
|
logfwdr: config.logfwdr,
|
|
160616
161959
|
unsafe: config.unsafe?.bindings
|
|
@@ -160625,7 +161968,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160625
161968
|
const worker = {
|
|
160626
161969
|
name: scriptName,
|
|
160627
161970
|
main: {
|
|
160628
|
-
name:
|
|
161971
|
+
name: import_node_path36.default.basename(resolvedEntryPointPath),
|
|
160629
161972
|
content,
|
|
160630
161973
|
type: bundleType
|
|
160631
161974
|
},
|
|
@@ -160639,7 +161982,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
160639
161982
|
logpush: props.logpush !== void 0 ? props.logpush : config.logpush
|
|
160640
161983
|
};
|
|
160641
161984
|
const bundleSizePromise = printBundleSize(
|
|
160642
|
-
{ name:
|
|
161985
|
+
{ name: import_node_path36.default.basename(resolvedEntryPointPath), content },
|
|
160643
161986
|
modules
|
|
160644
161987
|
);
|
|
160645
161988
|
if (process.env.JEST_WORKER_ID !== void 0)
|
|
@@ -161099,7 +162442,7 @@ function publishOptions(yargs) {
|
|
|
161099
162442
|
}
|
|
161100
162443
|
async function publishHandler(args) {
|
|
161101
162444
|
await printWranglerBanner();
|
|
161102
|
-
const configPath = args.config || args.script && findWranglerToml(
|
|
162445
|
+
const configPath = args.config || args.script && findWranglerToml(import_node_path37.default.dirname(args.script));
|
|
161103
162446
|
const config = readConfig(configPath, args);
|
|
161104
162447
|
const entry = await getEntry(args, config, "publish");
|
|
161105
162448
|
await sendMetricsEvent(
|
|
@@ -162265,7 +163608,7 @@ ${key2} is ${prettyBytes(objectSize)} in size`,
|
|
|
162265
163608
|
|
|
162266
163609
|
// src/secret/index.ts
|
|
162267
163610
|
init_import_meta_url();
|
|
162268
|
-
var
|
|
163611
|
+
var import_node_path38 = __toESM(require("node:path"));
|
|
162269
163612
|
var secret = (secretYargs) => {
|
|
162270
163613
|
return secretYargs.option("legacy-env", {
|
|
162271
163614
|
type: "boolean",
|
|
@@ -162333,6 +163676,7 @@ var secret = (secretYargs) => {
|
|
|
162333
163676
|
r2_buckets: [],
|
|
162334
163677
|
d1_databases: [],
|
|
162335
163678
|
services: [],
|
|
163679
|
+
analytics_engine_datasets: [],
|
|
162336
163680
|
wasm_modules: {},
|
|
162337
163681
|
text_blobs: {},
|
|
162338
163682
|
data_blobs: {},
|
|
@@ -162481,7 +163825,7 @@ var secretBulkHandler = async (secretBulkArgs) => {
|
|
|
162481
163825
|
logger.log(
|
|
162482
163826
|
`\u{1F300} Creating the secrets for the Worker "${scriptName}" ${secretBulkArgs.env && !isLegacyEnv(config) ? `(${secretBulkArgs.env})` : ""}`
|
|
162483
163827
|
);
|
|
162484
|
-
const jsonFilePath =
|
|
163828
|
+
const jsonFilePath = import_node_path38.default.resolve(secretBulkArgs.json);
|
|
162485
163829
|
const content = parseJSON(
|
|
162486
163830
|
readFileSync5(jsonFilePath),
|
|
162487
163831
|
jsonFilePath
|
|
@@ -162714,6 +164058,13 @@ async function generateTypes(configToDTS, config) {
|
|
|
162714
164058
|
envTypeStructure.push(`${service.binding}: Fetcher;`);
|
|
162715
164059
|
}
|
|
162716
164060
|
}
|
|
164061
|
+
if (configToDTS.analytics_engine_datasets) {
|
|
164062
|
+
for (const analyticsEngine of configToDTS.analytics_engine_datasets) {
|
|
164063
|
+
envTypeStructure.push(
|
|
164064
|
+
`${analyticsEngine.binding}: AnalyticsEngineDataset;`
|
|
164065
|
+
);
|
|
164066
|
+
}
|
|
164067
|
+
}
|
|
162717
164068
|
if (configToDTS.dispatch_namespaces) {
|
|
162718
164069
|
for (const namespace of configToDTS.dispatch_namespaces) {
|
|
162719
164070
|
envTypeStructure.push(`${namespace.binding}: any;`);
|
|
@@ -162789,13 +164140,13 @@ function writeDTSFile({
|
|
|
162789
164140
|
let combinedTypeStrings = "";
|
|
162790
164141
|
if (formatType === "modules") {
|
|
162791
164142
|
combinedTypeStrings += `interface Env {
|
|
162792
|
-
${envTypeStructure.map((value) => ` ${value}`).join("\n")}
|
|
164143
|
+
${envTypeStructure.map((value) => ` ${value}`).join("\n")}
|
|
162793
164144
|
}
|
|
162794
164145
|
${modulesTypeStructure.join("\n")}`;
|
|
162795
164146
|
} else {
|
|
162796
164147
|
combinedTypeStrings += `export {};
|
|
162797
164148
|
declare global {
|
|
162798
|
-
${envTypeStructure.map((value) => ` const ${value}`).join("\n")}
|
|
164149
|
+
${envTypeStructure.map((value) => ` const ${value}`).join("\n")}
|
|
162799
164150
|
}
|
|
162800
164151
|
${modulesTypeStructure.join("\n")}`;
|
|
162801
164152
|
}
|
|
@@ -163041,7 +164392,7 @@ function createCLIParser(argv) {
|
|
|
163041
164392
|
"generate [name] [template]",
|
|
163042
164393
|
false,
|
|
163043
164394
|
generateOptions,
|
|
163044
|
-
|
|
164395
|
+
generateHandler2
|
|
163045
164396
|
);
|
|
163046
164397
|
wrangler.command(
|
|
163047
164398
|
"init [name]",
|
|
@@ -163246,6 +164597,7 @@ function createCLIParser(argv) {
|
|
|
163246
164597
|
r2_buckets: config.r2_buckets,
|
|
163247
164598
|
d1_databases: config.d1_databases,
|
|
163248
164599
|
services: config.services,
|
|
164600
|
+
analytics_engine_datasets: config.analytics_engine_datasets,
|
|
163249
164601
|
dispatch_namespaces: config.dispatch_namespaces,
|
|
163250
164602
|
logfwdr: config.logfwdr,
|
|
163251
164603
|
unsafe: { bindings: config.unsafe?.bindings },
|
|
@@ -163539,6 +164891,14 @@ function devOptions(yargs) {
|
|
|
163539
164891
|
});
|
|
163540
164892
|
}
|
|
163541
164893
|
async function devHandler(args) {
|
|
164894
|
+
if (!args.local) {
|
|
164895
|
+
const isLoggedIn = await loginOrRefreshIfRequired();
|
|
164896
|
+
if (!isLoggedIn) {
|
|
164897
|
+
throw new Error(
|
|
164898
|
+
"You must be logged in to use wrangler dev in remote mode. Try logging in, or run wrangler dev --local."
|
|
164899
|
+
);
|
|
164900
|
+
}
|
|
164901
|
+
}
|
|
163542
164902
|
let watcher;
|
|
163543
164903
|
try {
|
|
163544
164904
|
const devInstance = await startDev(args);
|
|
@@ -163567,15 +164927,15 @@ Switch out --local for ${import_chalk8.default.bold(
|
|
|
163567
164927
|
)
|
|
163568
164928
|
);
|
|
163569
164929
|
}
|
|
163570
|
-
const configPath = args.config || args.script && findWranglerToml(
|
|
164930
|
+
const configPath = args.config || args.script && findWranglerToml(import_node_path39.default.dirname(args.script));
|
|
163571
164931
|
let config = readConfig(configPath, args);
|
|
163572
164932
|
if (config.configPath) {
|
|
163573
|
-
watcher = (0,
|
|
164933
|
+
watcher = (0, import_chokidar5.watch)(config.configPath, {
|
|
163574
164934
|
persistent: true
|
|
163575
164935
|
}).on("change", async (_event) => {
|
|
163576
164936
|
config = readConfig(configPath, args);
|
|
163577
164937
|
if (config.configPath) {
|
|
163578
|
-
logger.log(`${
|
|
164938
|
+
logger.log(`${import_node_path39.default.basename(config.configPath)} changed...`);
|
|
163579
164939
|
rerender(await getDevReactElement(config));
|
|
163580
164940
|
}
|
|
163581
164941
|
});
|
|
@@ -163676,7 +165036,7 @@ async function startApiDev(args) {
|
|
|
163676
165036
|
logger.loggerLevel = args.logLevel;
|
|
163677
165037
|
}
|
|
163678
165038
|
await printWranglerBanner();
|
|
163679
|
-
const configPath = args.config || args.script && findWranglerToml(
|
|
165039
|
+
const configPath = args.config || args.script && findWranglerToml(import_node_path39.default.dirname(args.script));
|
|
163680
165040
|
const config = readConfig(configPath, args);
|
|
163681
165041
|
const {
|
|
163682
165042
|
entry,
|
|
@@ -163957,10 +165317,21 @@ async function getBindings(configParam, env5, args) {
|
|
|
163957
165317
|
],
|
|
163958
165318
|
dispatch_namespaces: configParam.dispatch_namespaces,
|
|
163959
165319
|
services: configParam.services,
|
|
165320
|
+
analytics_engine_datasets: configParam.analytics_engine_datasets,
|
|
163960
165321
|
unsafe: configParam.unsafe?.bindings,
|
|
163961
165322
|
logfwdr: configParam.logfwdr,
|
|
163962
165323
|
d1_databases: identifyD1BindingsAsBeta([
|
|
163963
|
-
...configParam.d1_databases
|
|
165324
|
+
...(configParam.d1_databases ?? []).map((d1Db) => {
|
|
165325
|
+
if (!d1Db.preview_database_id) {
|
|
165326
|
+
throw new Error(
|
|
165327
|
+
`In development, you should use a separate D1 database than the one you'd use in production. Please create a new D1 database with "wrangler d1 create <name>" and add its id as preview_database_id to the d1_database "${d1Db.binding}" in your wrangler.toml`
|
|
165328
|
+
);
|
|
165329
|
+
}
|
|
165330
|
+
return {
|
|
165331
|
+
...d1Db,
|
|
165332
|
+
database_id: d1Db.preview_database_id
|
|
165333
|
+
};
|
|
165334
|
+
}),
|
|
163964
165335
|
...args.d1Databases || []
|
|
163965
165336
|
])
|
|
163966
165337
|
};
|