@farm.js/core 0.1.38 → 0.1.39
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/dist/{agent-mcp-BwKlpnc7.d.mts → agent-mcp-BhneNPb4.d.mts} +1 -1
- package/dist/{agent-mcp-De1imoMS.d.ts → agent-mcp-HcTYQmNX.d.ts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-kT_QXTdx.d.ts → app-CMkoghtp.d.ts} +3 -3
- package/dist/{app-CFZt-srr.d.mts → app-DVzmmbNO.d.mts} +3 -3
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{chunk-4E5QXOCL.cjs → chunk-5ULKUBIA.cjs} +6 -6
- package/dist/{chunk-TYMMBFN2.mjs → chunk-677THUVP.mjs} +1 -1
- package/dist/{chunk-CXEN47J3.mjs → chunk-73WX6PRY.mjs} +25 -0
- package/dist/{chunk-ZJD2PN6Z.mjs → chunk-75HN5IZ3.mjs} +12 -2
- package/dist/{chunk-L4DD7ODZ.cjs → chunk-A657YSP4.cjs} +2 -2
- package/dist/{chunk-YR2VBEMO.cjs → chunk-AS2VPMEE.cjs} +96 -96
- package/dist/{chunk-IBUQWVYA.mjs → chunk-ATSDUUFK.mjs} +11 -1
- package/dist/{chunk-TYJALEHQ.cjs → chunk-B5J2YVG7.cjs} +14 -14
- package/dist/{chunk-FWE7LEQC.cjs → chunk-BD3D7EZV.cjs} +4 -4
- package/dist/{chunk-7FPTZLKH.mjs → chunk-BFJTHYTN.mjs} +1 -1
- package/dist/{chunk-VU6AAZVY.cjs → chunk-BWIQR4DH.cjs} +13 -3
- package/dist/{chunk-XKVVMZP5.cjs → chunk-BXDJXFQG.cjs} +4 -4
- package/dist/{chunk-4IE345DM.cjs → chunk-CIOT4HGT.cjs} +2 -2
- package/dist/{chunk-DRLKAXDM.mjs → chunk-EGCTIS5F.mjs} +2 -2
- package/dist/{chunk-B6G5CKMC.mjs → chunk-GKBWWRBG.mjs} +3 -3
- package/dist/{chunk-Q3NXS4MU.cjs → chunk-HRETEZ2Z.cjs} +13 -3
- package/dist/{chunk-EMO6K4YY.cjs → chunk-HRSAQ23K.cjs} +7 -7
- package/dist/{chunk-TUBTR2OP.mjs → chunk-HYTZYOW2.mjs} +6 -6
- package/dist/{chunk-EKF7KDFD.mjs → chunk-KTSUBU2E.mjs} +2 -2
- package/dist/{chunk-KCQBAKIY.cjs → chunk-LMPAPBUA.cjs} +10 -10
- package/dist/{chunk-EK4QAEFZ.cjs → chunk-LZESP4IR.cjs} +25 -0
- package/dist/{chunk-HZFM2LWQ.mjs → chunk-P3PLW4FR.mjs} +34 -2
- package/dist/{chunk-KHKLMNI5.mjs → chunk-PVZE2JGJ.mjs} +1 -1
- package/dist/{chunk-N32CC42M.cjs → chunk-QG775BRV.cjs} +12 -12
- package/dist/{chunk-KKSTAEMY.cjs → chunk-QUCXCDE2.cjs} +1 -1
- package/dist/{chunk-JCKYH4LG.mjs → chunk-QYMZOOC5.mjs} +1 -1
- package/dist/{chunk-2DD4JMQC.cjs → chunk-RVXFINNS.cjs} +12 -12
- package/dist/{chunk-LI2F57NI.mjs → chunk-SOP2EAA6.mjs} +1 -1
- package/dist/{chunk-ND2CWPOD.mjs → chunk-TS4JHGUJ.mjs} +1 -1
- package/dist/{chunk-4GWRFP22.cjs → chunk-UPJLHLJU.cjs} +35 -3
- package/dist/{chunk-7PEP3BUT.mjs → chunk-VWBHM3F6.mjs} +1 -1
- package/dist/{chunk-TGFQVLLF.cjs → chunk-YFYUYWL7.cjs} +95 -95
- package/dist/{chunk-A3EAIURZ.mjs → chunk-YKZRDB5Z.mjs} +1 -1
- package/dist/{chunk-OCIEZME4.mjs → chunk-ZUPXLIGB.mjs} +8 -8
- package/dist/{client-plugins-DUrIYX9B.d.mts → client-plugins-CsCuCLBz.d.mts} +18 -0
- package/dist/{client-plugins-BvlNhGEB.d.ts → client-plugins-D0ke-Hc8.d.ts} +18 -0
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-JYJNOLPQ.mjs → devtools-5AFIPVUJ.mjs} +3 -3
- package/dist/{devtools-VQWJANJV.cjs → devtools-LW4QQ5J3.cjs} +4 -4
- package/dist/docs.cjs +5 -5
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +4 -4
- package/dist/index.cjs +18 -18
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.mjs +17 -17
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +12 -12
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +11 -11
- package/dist/internal/cli-runtime.cjs +5 -5
- package/dist/internal/cli-runtime.mjs +4 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +10 -8
- package/dist/internal/production-runtime.d.mts +9 -9
- package/dist/internal/production-runtime.d.ts +9 -9
- package/dist/internal/production-runtime.mjs +9 -7
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +5 -5
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.mjs +4 -4
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +8 -8
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +7 -7
- package/dist/{production-runtime-D2aMyzjr.d.ts → production-runtime-BaI3WHnV.d.ts} +1 -1
- package/dist/{production-runtime-BQ4_WLwQ.d.mts → production-runtime-DfRP0cV0.d.mts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-25p4hrj4.d.ts → render-plan-CfIdJKAf.d.ts} +1 -1
- package/dist/{render-plan-DtkXMN8D.d.mts → render-plan-Dg8RBYFa.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request-jF4jwx8f.d.ts → request-CEbHIIl4.d.ts} +1 -1
- package/dist/{request-DgCkIdcn.d.mts → request-DfE02G_A.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-CSBF78Ya.d.mts → route-rendering-BHyOfXjD.d.mts} +1 -1
- package/dist/{route-rendering-Bji6S6a_.d.ts → route-rendering-C4oHbv6C.d.ts} +1 -1
- package/dist/{router-B09Ui3Qm.d.mts → router-DwhA61SB.d.mts} +1 -1
- package/dist/{router-CPB9cXtG.d.ts → router-uRN_29Em.d.ts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{runtime-CM6E6yuI.d.mts → runtime-BEdHhN4C.d.mts} +1 -1
- package/dist/{runtime-EDMwLdjv.d.ts → runtime-COk03hmx.d.ts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +25 -25
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +8 -8
- package/dist/{spa-router-B_N8XgVu.d.ts → spa-router-DrVOBVGg.d.ts} +2 -2
- package/dist/{spa-router-Cgimzfbi.d.mts → spa-router-w4aFOuyn.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils-DZciYXYl.d.mts → utils-BtYehqeU.d.mts} +1 -1
- package/dist/{utils-BNxAKAuT.d.ts → utils-Dhuqwmd2.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +8 -8
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +7 -7
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ var _chunkZXH4TS3Fcjs = require('./chunk-ZXH4TS3F.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkUPJLHLJUcjs = require('./chunk-UPJLHLJU.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
@@ -282,7 +282,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
282
282
|
response: responseShim.response,
|
|
283
283
|
url,
|
|
284
284
|
pathname: url.pathname,
|
|
285
|
-
routePathname:
|
|
285
|
+
routePathname: _chunkUPJLHLJUcjs.toMiddlewareRoutePathname.call(void 0, url.pathname, toRoutePathname),
|
|
286
286
|
searchParams: url.searchParams,
|
|
287
287
|
method: currentRequest.method || "GET",
|
|
288
288
|
params: {},
|
|
@@ -325,7 +325,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
325
325
|
ctx.request = currentRequest;
|
|
326
326
|
ctx.url = nextUrl;
|
|
327
327
|
ctx.pathname = nextUrl.pathname;
|
|
328
|
-
ctx.routePathname =
|
|
328
|
+
ctx.routePathname = _chunkUPJLHLJUcjs.toMiddlewareRoutePathname.call(void 0, nextUrl.pathname, toRoutePathname);
|
|
329
329
|
ctx.searchParams = nextUrl.searchParams;
|
|
330
330
|
ctx.route = nextUrl.pathname;
|
|
331
331
|
},
|
|
@@ -378,7 +378,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
378
378
|
}
|
|
379
379
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createWebMiddlewareContext, "createWebMiddlewareContext");
|
|
380
380
|
function matchesMiddlewareConfig2(pathname, config, ctx) {
|
|
381
|
-
return
|
|
381
|
+
return _chunkUPJLHLJUcjs.matchesMiddlewareConfig.call(void 0, pathname, config, ctx);
|
|
382
382
|
}
|
|
383
383
|
_chunkS3JO3N4Hcjs.__name.call(void 0, matchesMiddlewareConfig2, "matchesMiddlewareConfig");
|
|
384
384
|
function getConfigHandlers(entry) {
|
|
@@ -411,7 +411,7 @@ function normalizeConfigMiddleware(config) {
|
|
|
411
411
|
globalConfig = middlewareConfig;
|
|
412
412
|
continue;
|
|
413
413
|
}
|
|
414
|
-
|
|
414
|
+
_chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, middlewareConfig);
|
|
415
415
|
entries.push({
|
|
416
416
|
path: "/",
|
|
417
417
|
filePath: `farm.config.ts#middleware-${index}`,
|
|
@@ -430,7 +430,7 @@ function normalizeFileMiddleware(modules = []) {
|
|
|
430
430
|
if (!normalized) {
|
|
431
431
|
continue;
|
|
432
432
|
}
|
|
433
|
-
if (normalized.config)
|
|
433
|
+
if (normalized.config) _chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, normalized.config);
|
|
434
434
|
entries.push({
|
|
435
435
|
path: moduleEntry.path,
|
|
436
436
|
filePath: moduleEntry.filePath || moduleEntry.path,
|
|
@@ -474,10 +474,10 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, emptyResult, "emptyResult");
|
|
|
474
474
|
function createProductionMiddlewareRunner(options = {}) {
|
|
475
475
|
const configMiddleware = normalizeConfigMiddleware(options.config);
|
|
476
476
|
const fileMiddleware = normalizeFileMiddleware(options.modules);
|
|
477
|
-
for (const entry of fileMiddleware)
|
|
477
|
+
for (const entry of fileMiddleware) _chunkUPJLHLJUcjs.compileMiddlewareRoute.call(void 0, entry);
|
|
478
478
|
const entries = [...configMiddleware.entries, ...fileMiddleware];
|
|
479
479
|
const globalConfig = configMiddleware.globalConfig;
|
|
480
|
-
if (globalConfig)
|
|
480
|
+
if (globalConfig) _chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, globalConfig);
|
|
481
481
|
const toMiddlewarePathnames = _chunkKNBBQHO2cjs.createFarmAPIMiddlewarePathnames.call(void 0, options.apiBasePath);
|
|
482
482
|
return /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async function runProductionMiddleware(request, requestOptions = {}) {
|
|
483
483
|
if (!globalConfig && entries.length === 0) {
|
|
@@ -503,7 +503,7 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
503
503
|
] : toMiddlewarePathnames(pathname), "matchPathnames");
|
|
504
504
|
let parentData;
|
|
505
505
|
if (globalConfig) {
|
|
506
|
-
const globalMatch =
|
|
506
|
+
const globalMatch = _chunkUPJLHLJUcjs.matchesMiddlewareConfigAt.call(void 0,
|
|
507
507
|
matchPathnames(initialPathname, initialRequestPathname),
|
|
508
508
|
globalConfig,
|
|
509
509
|
ctx
|
|
@@ -520,11 +520,11 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
520
520
|
for (let pathname = initialPathname, requestPathname = initialRequestPathname, pass = 0; ; pass++) {
|
|
521
521
|
const pathnames = matchPathnames(pathname, requestPathname);
|
|
522
522
|
if (pass > 0 && globalConfig) {
|
|
523
|
-
if (!
|
|
523
|
+
if (!_chunkUPJLHLJUcjs.matchesMiddlewareConfigAt.call(void 0, pathnames, globalConfig, ctx).matched) return;
|
|
524
524
|
}
|
|
525
525
|
for (const entry of entries) {
|
|
526
526
|
if (ran.has(entry)) continue;
|
|
527
|
-
const routeMatch = entry.source === "config" ? { matched: true } :
|
|
527
|
+
const routeMatch = entry.source === "config" ? { matched: true } : _chunkUPJLHLJUcjs.matchesMiddlewareRouteAt.call(void 0, pathnames, entry);
|
|
528
528
|
if (routeMatch.matched) yield { entry, routeMatch, pathname, pathnames };
|
|
529
529
|
}
|
|
530
530
|
const rewrittenRequestPathname = new URL(currentRequest.url).pathname;
|
|
@@ -536,7 +536,7 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
536
536
|
}
|
|
537
537
|
_chunkS3JO3N4Hcjs.__name.call(void 0, applicableMiddleware, "applicableMiddleware");
|
|
538
538
|
for (const { entry, routeMatch, pathname, pathnames } of applicableMiddleware()) {
|
|
539
|
-
const configMatch = entry.config ?
|
|
539
|
+
const configMatch = entry.config ? _chunkUPJLHLJUcjs.matchesMiddlewareConfigAt.call(void 0, pathnames, entry.config, ctx) : { matched: true };
|
|
540
540
|
if (!configMatch.matched) {
|
|
541
541
|
continue;
|
|
542
542
|
}
|
|
@@ -18,12 +18,12 @@ var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
|
18
18
|
var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkBWIQR4DHcjs = require('./chunk-BWIQR4DH.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkUPJLHLJUcjs = require('./chunk-UPJLHLJU.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
var _chunkTKJZFIMLcjs = require('./chunk-TKJZFIML.cjs');
|
|
@@ -42,7 +42,7 @@ var _chunkKIIMAWOJcjs = require('./chunk-KIIMAWOJ.cjs');
|
|
|
42
42
|
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var _chunkQUCXCDE2cjs = require('./chunk-QUCXCDE2.cjs');
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -252,20 +252,20 @@ function configMiddlewareMayHandlePath(config, pathname) {
|
|
|
252
252
|
typeof matcher === "function" ? () => true : matcher
|
|
253
253
|
)
|
|
254
254
|
) : void 0;
|
|
255
|
-
const compiled =
|
|
256
|
-
return
|
|
255
|
+
const compiled = _chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, { matcher: matchers, exclude: entry.exclude });
|
|
256
|
+
return _chunkUPJLHLJUcjs.matchesCompiledMiddlewareConfig.call(void 0, pathname, compiled, {}).matched;
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
_chunkS3JO3N4Hcjs.__name.call(void 0, configMiddlewareMayHandlePath, "configMiddlewareMayHandlePath");
|
|
260
260
|
function appMiddlewareMayHandlePath(middlewareRoutes, pathname) {
|
|
261
|
-
return middlewareRoutes.some((route) =>
|
|
261
|
+
return middlewareRoutes.some((route) => _chunkUPJLHLJUcjs.matchesMiddlewareRoute.call(void 0, pathname, route).matched);
|
|
262
262
|
}
|
|
263
263
|
_chunkS3JO3N4Hcjs.__name.call(void 0, appMiddlewareMayHandlePath, "appMiddlewareMayHandlePath");
|
|
264
264
|
var CATCH_ALL_PROBE = "/__farm-listing-probe__/0";
|
|
265
265
|
function isPathSpecificMatcher(matcher) {
|
|
266
266
|
if (typeof matcher === "function") return false;
|
|
267
|
-
const compiled =
|
|
268
|
-
return !
|
|
267
|
+
const compiled = _chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, { matcher });
|
|
268
|
+
return !_chunkUPJLHLJUcjs.matchesCompiledMiddlewareConfig.call(void 0, CATCH_ALL_PROBE, compiled, {}).matched;
|
|
269
269
|
}
|
|
270
270
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isPathSpecificMatcher, "isPathSpecificMatcher");
|
|
271
271
|
function pathSpecificConfigMiddlewareCovers(config, pathname) {
|
|
@@ -277,8 +277,8 @@ function pathSpecificConfigMiddlewareCovers(config, pathname) {
|
|
|
277
277
|
isPathSpecificMatcher
|
|
278
278
|
);
|
|
279
279
|
if (matchers.length === 0) return false;
|
|
280
|
-
const compiled =
|
|
281
|
-
return
|
|
280
|
+
const compiled = _chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, { matcher: matchers, exclude: entry.exclude });
|
|
281
|
+
return _chunkUPJLHLJUcjs.matchesCompiledMiddlewareConfig.call(void 0, pathname, compiled, {}).matched;
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
_chunkS3JO3N4Hcjs.__name.call(void 0, pathSpecificConfigMiddlewareCovers, "pathSpecificConfigMiddlewareCovers");
|
|
@@ -286,7 +286,7 @@ function farmPathGuardCoversPage(options, pathname) {
|
|
|
286
286
|
return appMiddlewareMayHandlePath(
|
|
287
287
|
options.middlewareRoutes.filter((route) => route.path !== "/"),
|
|
288
288
|
pathname
|
|
289
|
-
) || pathSpecificConfigMiddlewareCovers(options.config.middleware, pathname) ||
|
|
289
|
+
) || pathSpecificConfigMiddlewareCovers(options.config.middleware, pathname) || _chunkBWIQR4DHcjs.integrationMiddlewareMayHandlePath.call(void 0, options.config.integrations, pathname, CATCH_ALL_PROBE);
|
|
290
290
|
}
|
|
291
291
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmPathGuardCoversPage, "farmPathGuardCoversPage");
|
|
292
292
|
function farmPathGuardCoversEndpoint(options, path, apiServerBasePath) {
|
|
@@ -997,7 +997,7 @@ function createFarmAppManifest(input, { full = false } = {}) {
|
|
|
997
997
|
const manifest = {
|
|
998
998
|
schemaVersion: 1,
|
|
999
999
|
app: {
|
|
1000
|
-
farm:
|
|
1000
|
+
farm: _chunkQUCXCDE2cjs.FARM_VERSION,
|
|
1001
1001
|
renderer: input.renderer,
|
|
1002
1002
|
basePath: input.basePath,
|
|
1003
1003
|
build: input.build
|
|
@@ -66,6 +66,37 @@ function parseColonParam(segment) {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
_chunkS3JO3N4Hcjs.__name.call(void 0, parseColonParam, "parseColonParam");
|
|
69
|
+
var MATCHER_PARAM_NAME = /^[\p{L}\p{N}_$-]+$/u;
|
|
70
|
+
var MATCHER_REGEX_SYNTAX = /[()[\]|\\{}^$?]/;
|
|
71
|
+
var MATCHER_BRACKET_PARAM = /^\[\[\.\.\.(.+)\]\]$|^\[\.\.\.(.+)\]$|^\[(.+)\]$/;
|
|
72
|
+
function isSupportedMatcherSegment(segment) {
|
|
73
|
+
if (segment === "*" || segment === "**") return true;
|
|
74
|
+
if (segment.startsWith(":")) return MATCHER_PARAM_NAME.test(parseColonParam(segment).name);
|
|
75
|
+
const bracket = MATCHER_BRACKET_PARAM.exec(segment);
|
|
76
|
+
if (bracket) return MATCHER_PARAM_NAME.test(_nullishCoalesce(_nullishCoalesce(bracket[1], () => ( bracket[2])), () => ( bracket[3])));
|
|
77
|
+
return !MATCHER_REGEX_SYNTAX.test(segment);
|
|
78
|
+
}
|
|
79
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isSupportedMatcherSegment, "isSupportedMatcherSegment");
|
|
80
|
+
function isLiteralMatcherSegment(segment) {
|
|
81
|
+
return !MATCHER_REGEX_SYNTAX.test(segment) && !segment.includes("*") && !segment.startsWith(":");
|
|
82
|
+
}
|
|
83
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isLiteralMatcherSegment, "isLiteralMatcherSegment");
|
|
84
|
+
function assertSupportedMiddlewareMatcher(pattern) {
|
|
85
|
+
if (pattern === "*" || pattern === "/(.*)") return;
|
|
86
|
+
const subtree = pattern.endsWith("(.*)");
|
|
87
|
+
const path = subtree ? pattern.slice(0, -4) : pattern;
|
|
88
|
+
const segments = path.split("/").filter(Boolean);
|
|
89
|
+
if (segments.every(subtree ? isLiteralMatcherSegment : isSupportedMatcherSegment)) return;
|
|
90
|
+
throw new Error(
|
|
91
|
+
`Middleware matcher "${pattern}" is not a supported string pattern, so it would never match a request and the middleware would not run. String matchers do not accept regular-expression syntax such as groups, alternation, character classes, or lookaheads. Pass a RegExp instead, for example \`matcher: /^\\/(?!api|_next).*/\`, or use the supported forms: /path/:param, /path/:param*, /path/[param], /path/[...param], /path/*, /path/**, or a trailing (.*) such as /path(.*).`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, assertSupportedMiddlewareMatcher, "assertSupportedMiddlewareMatcher");
|
|
95
|
+
function compileConfigPattern(pattern, compile) {
|
|
96
|
+
if (typeof pattern === "string") assertSupportedMiddlewareMatcher(pattern);
|
|
97
|
+
return compile(pattern);
|
|
98
|
+
}
|
|
99
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, compileConfigPattern, "compileConfigPattern");
|
|
69
100
|
function compilePathPattern(pattern, trailingSlash = false) {
|
|
70
101
|
const params = [];
|
|
71
102
|
const segments = pattern.split("/").filter(Boolean);
|
|
@@ -140,9 +171,9 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, compilePattern, "compilePattern");
|
|
|
140
171
|
function compileMiddlewareConfig(config) {
|
|
141
172
|
const compiled = {
|
|
142
173
|
matcher: config.matcher ? toMatcherList(config.matcher).map(
|
|
143
|
-
(matcher) => typeof matcher === "function" ? matcher :
|
|
174
|
+
(matcher) => typeof matcher === "function" ? matcher : compileConfigPattern(matcher, compileMatcherPattern)
|
|
144
175
|
) : void 0,
|
|
145
|
-
exclude: _optionalChain([config, 'access', _2 => _2.exclude, 'optionalAccess', _3 => _3.map, 'call', _4 => _4(compilePattern)])
|
|
176
|
+
exclude: _optionalChain([config, 'access', _2 => _2.exclude, 'optionalAccess', _3 => _3.map, 'call', _4 => _4((pattern) => compileConfigPattern(pattern, compilePattern))])
|
|
146
177
|
};
|
|
147
178
|
compiledConfigCache.set(config, {
|
|
148
179
|
compiled,
|
|
@@ -256,4 +287,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, matchesMiddlewareConfigAt, "matchesMiddlew
|
|
|
256
287
|
|
|
257
288
|
|
|
258
289
|
|
|
259
|
-
|
|
290
|
+
|
|
291
|
+
exports.compileMiddlewareRoute = compileMiddlewareRoute; exports.matchesMiddlewareRoute = matchesMiddlewareRoute; exports.matchesMiddlewareRouteAt = matchesMiddlewareRouteAt; exports.assertSupportedMiddlewareMatcher = assertSupportedMiddlewareMatcher; exports.compileMiddlewareConfig = compileMiddlewareConfig; exports.matchesMiddlewarePredicate = matchesMiddlewarePredicate; exports.toMiddlewareRoutePathname = toMiddlewareRoutePathname; exports.matchesCompiledMiddlewareConfig = matchesCompiledMiddlewareConfig; exports.matchesMiddlewareConfig = matchesMiddlewareConfig; exports.matchesMiddlewareConfigAt = matchesMiddlewareConfigAt;
|