@farm.js/core 0.1.40 → 0.1.41
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-XNF4JqHw.d.mts → agent-mcp-BOqIxJLI.d.mts} +8 -2
- package/dist/{agent-mcp-DRlXq3lM.d.ts → agent-mcp-D0eZKfci.d.ts} +8 -2
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +8 -8
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +7 -7
- package/dist/api/runtime.cjs +6 -6
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +5 -5
- package/dist/api.cjs +10 -10
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +9 -9
- package/dist/{app-CWjCklhF.d.mts → app-CzTSMJaf.d.mts} +5 -5
- package/dist/{app-CDJHPqZn.d.ts → app-DM8e1z3G.d.ts} +5 -5
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/cache.cjs +3 -3
- package/dist/cache.mjs +2 -2
- package/dist/{chunk-UM3ZV5EP.mjs → chunk-24SP5TGU.mjs} +1 -1
- package/dist/{chunk-B6IMBBOS.cjs → chunk-25LPIZSX.cjs} +3 -3
- package/dist/{chunk-WW374SGU.mjs → chunk-26RUNDIR.mjs} +1 -1
- package/dist/{chunk-B77AUCBV.cjs → chunk-2FUIT2G2.cjs} +3 -3
- package/dist/{chunk-54QWHSNR.cjs → chunk-32TZ3QTP.cjs} +149 -155
- package/dist/{chunk-BPGO2IEP.mjs → chunk-35WS7P2V.mjs} +24 -126
- package/dist/{chunk-CKFK3Z2V.mjs → chunk-4C7KTKX7.mjs} +1 -1
- package/dist/{chunk-MNUSIXGS.mjs → chunk-4KQDHTWX.mjs} +1 -1
- package/dist/{chunk-DATEWH3W.cjs → chunk-6IZWX6ES.cjs} +22 -8
- package/dist/{chunk-Y6LRPO2K.mjs → chunk-6LVRDOAW.mjs} +19 -5
- package/dist/{chunk-UMQAK3KP.cjs → chunk-6MVFHNYZ.cjs} +2 -2
- package/dist/{chunk-OLQ73ZO5.mjs → chunk-6PKXK4TY.mjs} +3 -3
- package/dist/{chunk-PYQ3ZG4Z.mjs → chunk-724JLMS4.mjs} +4 -4
- package/dist/{chunk-PNCM5MFD.mjs → chunk-7UEEHAW7.mjs} +1 -1
- package/dist/{chunk-7VAJSSPG.mjs → chunk-B2GSRB3P.mjs} +1 -1
- package/dist/{chunk-ZKVJYQPO.mjs → chunk-BGGWKZ2V.mjs} +11 -10
- package/dist/{chunk-JXB6DVCO.mjs → chunk-BPNRQ5BA.mjs} +1 -1
- package/dist/{chunk-GNVEJUT5.cjs → chunk-C5KVWHIH.cjs} +21 -21
- package/dist/chunk-COABSY3U.mjs +196 -0
- package/dist/{chunk-Y2GNNXGV.cjs → chunk-D64OPY6A.cjs} +5 -5
- package/dist/{chunk-DKU6NXRK.cjs → chunk-EH3464KF.cjs} +1 -1
- package/dist/{chunk-Y4QVEU67.mjs → chunk-ENOBPDKZ.mjs} +2 -2
- package/dist/{chunk-FLZ4H25A.cjs → chunk-EX4MKHXN.cjs} +6 -6
- package/dist/{chunk-I64GEPOB.cjs → chunk-FEYQCYT7.cjs} +3 -3
- package/dist/{chunk-AXB5P7BK.mjs → chunk-FIAPD365.mjs} +1 -1
- package/dist/{chunk-FCOLU5P6.mjs → chunk-FJGIVDA5.mjs} +38 -15
- package/dist/{chunk-7FHZ3E6D.cjs → chunk-GB7LDGY5.cjs} +2 -2
- package/dist/{chunk-45UZKX2J.mjs → chunk-HJ64F4GS.mjs} +2 -2
- package/dist/{chunk-IRYK4Z5M.cjs → chunk-I5MG3TKE.cjs} +2 -2
- package/dist/{chunk-YR2P74F7.cjs → chunk-IFWSR7YZ.cjs} +2 -2
- package/dist/{chunk-5E65AL7P.mjs → chunk-IN6RCKLL.mjs} +5 -4
- package/dist/{chunk-EORXKFLR.cjs → chunk-JEIG3EWE.cjs} +1 -1
- package/dist/{chunk-TAKG7ZCD.cjs → chunk-JOTUZIM4.cjs} +14 -14
- package/dist/{chunk-TFX4RTH2.mjs → chunk-JOW4HDJO.mjs} +1 -1
- package/dist/{chunk-H44XGLFU.cjs → chunk-L6A26QT5.cjs} +9 -9
- package/dist/{chunk-EW4MEVLE.cjs → chunk-L6HYACBE.cjs} +7 -7
- package/dist/{chunk-OZN4XL6L.cjs → chunk-LIZTLA5F.cjs} +7 -6
- package/dist/{chunk-62DY5GKS.mjs → chunk-LLUA2LSC.mjs} +2 -2
- package/dist/{chunk-LDPKAYVS.cjs → chunk-LYIZHJTK.cjs} +2 -2
- package/dist/{chunk-2DMWQWNJ.mjs → chunk-MEASUNVY.mjs} +1 -1
- package/dist/{chunk-T4II4MMW.mjs → chunk-MHHCLYXU.mjs} +1 -1
- package/dist/{chunk-SHFXCE5A.cjs → chunk-MHN4UR5U.cjs} +4 -4
- package/dist/{chunk-5JEC43MQ.cjs → chunk-MN4TQJ3W.cjs} +9 -9
- package/dist/{chunk-5XS5NCVM.cjs → chunk-MY5PZYAD.cjs} +4 -4
- package/dist/{chunk-2JG2LJDI.cjs → chunk-NBPNUQYO.cjs} +2 -2
- package/dist/{chunk-4XO5GSD6.cjs → chunk-NFG4PUPI.cjs} +2 -2
- package/dist/{chunk-5LL6TKII.mjs → chunk-O7USYJ4U.mjs} +1 -1
- package/dist/{chunk-GKQL726H.cjs → chunk-OQ4YXWH4.cjs} +74 -73
- package/dist/{chunk-VBN3UAPQ.mjs → chunk-P2UJF4SS.mjs} +1 -1
- package/dist/{chunk-PGW7HZE2.cjs → chunk-PN676AZF.cjs} +6 -6
- package/dist/{chunk-IMQO6ZUU.mjs → chunk-PYHPXPSW.mjs} +2 -2
- package/dist/{chunk-KK22JPQM.cjs → chunk-QEILRWVV.cjs} +30 -132
- package/dist/{chunk-UXMIFB44.cjs → chunk-QIBP5EFA.cjs} +5 -5
- package/dist/{chunk-XKIUHXHW.mjs → chunk-R65GCA6A.mjs} +45 -51
- package/dist/{chunk-EGCT3AHF.cjs → chunk-ROQ4C4LJ.cjs} +121 -98
- package/dist/{chunk-QJM7A4CR.cjs → chunk-S7MTDRYA.cjs} +10 -10
- package/dist/{chunk-ACLPN56I.mjs → chunk-SGB4IW7K.mjs} +1 -1
- package/dist/{chunk-T6DLMX5V.mjs → chunk-SVPGWJZF.mjs} +3 -3
- package/dist/{chunk-I63UCMXW.mjs → chunk-ULQOP5UI.mjs} +2 -2
- package/dist/{chunk-HBEBV7OZ.mjs → chunk-UQUEANTY.mjs} +1 -1
- package/dist/chunk-VHRS3MCW.cjs +196 -0
- package/dist/{chunk-H56MQYEG.mjs → chunk-VLPII2JJ.mjs} +1 -1
- package/dist/{chunk-WCWV25PG.mjs → chunk-VTBXE6QG.mjs} +2 -2
- package/dist/{chunk-E55H6UKH.cjs → chunk-WLHA5USH.cjs} +9 -9
- package/dist/{chunk-YJBWB6GF.mjs → chunk-WMBRZI5V.mjs} +1 -1
- package/dist/{chunk-AGR7F3LA.cjs → chunk-WROEFVNO.cjs} +3 -3
- package/dist/{chunk-CA62IQY3.cjs → chunk-WU7ZS3EM.cjs} +2 -2
- package/dist/{chunk-ZOABCQGT.mjs → chunk-X3NGFVRF.mjs} +37 -22
- package/dist/{chunk-XJAEZCT6.mjs → chunk-XUC6CFLE.mjs} +1 -1
- package/dist/{chunk-6ILGLCXF.cjs → chunk-YWCYV7QC.cjs} +8 -8
- package/dist/{chunk-T36UJS3X.mjs → chunk-YYQVGKO5.mjs} +2 -2
- package/dist/{chunk-XVIEGKTT.cjs → chunk-ZTP3BJG6.cjs} +41 -26
- package/dist/{client-plugins-B_5QbNrp.d.mts → client-plugins-CkYwvDJ0.d.mts} +1 -1
- package/dist/{client-plugins-DgSfIWIF.d.ts → client-plugins-DfeKd0sD.d.ts} +1 -1
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +5 -5
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +4 -4
- package/dist/client.react-server.mjs +2 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/{devtools-ANJ7JAPQ.cjs → devtools-2YHAJYH6.cjs} +5 -5
- package/dist/{devtools-VEQQDVHE.mjs → devtools-N3QLRIQU.mjs} +4 -4
- package/dist/docs.cjs +7 -7
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +6 -6
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config-Duob7wER.d.ts → image-config-BpH1q5R8.d.mts} +4 -1
- package/dist/{image-config-Duob7wER.d.mts → image-config-BpH1q5R8.d.ts} +4 -1
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/index.cjs +39 -37
- package/dist/index.d.mts +15 -135
- package/dist/index.d.ts +15 -135
- package/dist/index.mjs +38 -36
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.cjs +22 -22
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +21 -21
- package/dist/internal/cli-runtime.cjs +12 -12
- package/dist/internal/cli-runtime.mjs +11 -11
- 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 +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +5 -5
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +4 -4
- package/dist/internal/docs-precompiled-runtime.cjs +3 -3
- package/dist/internal/docs-precompiled-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-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 +20 -12
- package/dist/internal/production-runtime.d.mts +30 -10
- package/dist/internal/production-runtime.d.ts +30 -10
- package/dist/internal/production-runtime.mjs +20 -12
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/middleware.cjs +7 -7
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +6 -6
- package/dist/navigation.cjs +4 -4
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-NFG2LBRC.mjs → nitro-KDACKNHU.mjs} +1 -1
- package/dist/{nitro-S2QABUFA.cjs → nitro-NPGU6VBT.cjs} +2 -2
- package/dist/plugin.cjs +20 -20
- package/dist/plugin.d.mts +4 -3
- package/dist/plugin.d.ts +4 -3
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime-j_WCfuwB.d.mts → production-runtime-BTkXQdYy.d.mts} +1 -1
- package/dist/{production-runtime-DfknD3g_.d.ts → production-runtime-DFC7pgbp.d.ts} +1 -1
- package/dist/query/client.cjs +2 -2
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-ChUtsymc.d.mts → render-plan-5rFeWmk7.d.mts} +1 -1
- package/dist/{render-plan-CFIhcYYS.d.ts → render-plan-BoAK9xFC.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request-F4HRwzSd.d.mts → request-BxBWigtl.d.mts} +1 -1
- package/dist/{request-RJvelT8L.d.ts → request-fciwmd3n.d.ts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-3a4fbNyC.d.mts → route-rendering-BCM1QzEf.d.mts} +1 -1
- package/dist/{route-rendering-D4coJ-kw.d.ts → route-rendering-BLZT0IP0.d.ts} +1 -1
- package/dist/{router-WLEW3Te1.d.ts → router-CkheNX3-.d.ts} +1 -1
- package/dist/{router-DqIssGRO.d.mts → router-DyZJWc1_.d.mts} +1 -1
- package/dist/routes.cjs +4 -4
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.mjs +3 -3
- package/dist/{runtime-BrNdLOq9.d.ts → runtime-DfU4sKa5.d.ts} +1 -1
- package/dist/{runtime-CmE_j-js.d.mts → runtime-wexvUN5J.d.mts} +1 -1
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +45 -45
- package/dist/server.d.mts +10 -9
- package/dist/server.d.ts +10 -9
- package/dist/server.mjs +24 -24
- package/dist/{spa-router-D_0VXqPC.d.ts → spa-router-CcejECnG.d.ts} +2 -2
- package/dist/{spa-router-C41zjnFl.d.mts → spa-router-DgsMXqfX.d.mts} +2 -2
- package/dist/ssg-1FGaFISl.d.ts +184 -0
- package/dist/ssg-Bg4bMMhM.d.mts +184 -0
- package/dist/testing.cjs +11 -11
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +8 -8
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-BKWSe3S7.d.mts → utils-8wtTYiH4.d.mts} +1 -1
- package/dist/{utils-YYcWsOJp.d.ts → utils-Dxbh6Hgj.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +37 -21
- package/dist/vite.d.mts +41 -4
- package/dist/vite.d.ts +41 -4
- package/dist/vite.mjs +37 -21
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-DAO7JGTS.mjs +0 -73
- package/dist/chunk-SYQ3MOWW.cjs +0 -73
- package/dist/programmatic-routes-client-DcoxEaLe.d.mts +0 -55
- package/dist/programmatic-routes-client-DcoxEaLe.d.ts +0 -55
- /package/dist/{chunk-MOSYH4CY.mjs → chunk-FWCGUVVL.mjs} +0 -0
- /package/dist/{chunk-4A3YUB4D.cjs → chunk-KF6VDJH7.cjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKF6VDJH7cjs = require('./chunk-KF6VDJH7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
@@ -17,7 +17,7 @@ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkQIBP5EFAcjs = require('./chunk-QIBP5EFA.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
|
|
@@ -104,7 +104,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
104
104
|
await this.loadProgrammaticApiRoutes(appDir);
|
|
105
105
|
}
|
|
106
106
|
this.routes = new Map(
|
|
107
|
-
|
|
107
|
+
_chunkQIBP5EFAcjs.mergePluginAPIRoutes.call(void 0, [...this.routes.values()], this.plugins, void 0, {
|
|
108
108
|
bodySizeLimit: this.bodySizeLimit,
|
|
109
109
|
dispatch: this.dispatch
|
|
110
110
|
}).map((route) => [route.path, route])
|
|
@@ -152,7 +152,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
152
152
|
const routeModule = await this.loadModule(filePath);
|
|
153
153
|
const endpoints = {};
|
|
154
154
|
const availableMethods = [];
|
|
155
|
-
for (const method of
|
|
155
|
+
for (const method of _chunkQIBP5EFAcjs.API_ROUTE_METHODS) {
|
|
156
156
|
if (routeModule[method]) {
|
|
157
157
|
endpoints[method] = routeModule[method];
|
|
158
158
|
availableMethods.push(method);
|
|
@@ -222,7 +222,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
222
222
|
async loadProgrammaticApiRoutes(appDir) {
|
|
223
223
|
const candidateRoots = [path.dirname(appDir), appDir];
|
|
224
224
|
const routeFiles = Array.from(
|
|
225
|
-
new Set(candidateRoots.flatMap((srcRoot) =>
|
|
225
|
+
new Set(candidateRoots.flatMap((srcRoot) => _chunkKF6VDJH7cjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot)))
|
|
226
226
|
);
|
|
227
227
|
if (routeFiles.length === 0) return;
|
|
228
228
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
@@ -334,7 +334,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
334
334
|
const url = new URL(request.url);
|
|
335
335
|
const pathname = url.pathname;
|
|
336
336
|
const method = request.method.toUpperCase();
|
|
337
|
-
const match =
|
|
337
|
+
const match = _chunkQIBP5EFAcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
338
338
|
if (!match) {
|
|
339
339
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
340
340
|
status: 404,
|
|
@@ -342,19 +342,19 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
const { route, params } = match;
|
|
345
|
-
const endpoint =
|
|
345
|
+
const endpoint = _chunkQIBP5EFAcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
346
346
|
if (!endpoint) {
|
|
347
347
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
348
348
|
status: 405,
|
|
349
349
|
headers: {
|
|
350
|
-
Allow:
|
|
350
|
+
Allow: _chunkQIBP5EFAcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
351
351
|
"Content-Type": "application/json"
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
355
|
const invoke = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
356
356
|
try {
|
|
357
|
-
return await
|
|
357
|
+
return await _chunkQIBP5EFAcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, this.bodySizeLimit);
|
|
358
358
|
} catch (error) {
|
|
359
359
|
if (options.throwOnError) throw error;
|
|
360
360
|
console.error(`[API Error] ${pathname}:`, error);
|
|
@@ -376,7 +376,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
376
376
|
return Boolean(this.matchRoute(pathname));
|
|
377
377
|
}
|
|
378
378
|
matchRoute(pathname) {
|
|
379
|
-
return
|
|
379
|
+
return _chunkQIBP5EFAcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
380
380
|
}
|
|
381
381
|
/**
|
|
382
382
|
* Get all routes for client type generation
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-ETPEZLS3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
stampFarmCspNonce
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7UEEHAW7.mjs";
|
|
13
13
|
import {
|
|
14
14
|
emitFarmAgentRead
|
|
15
15
|
} from "./chunk-KYN5ODF6.mjs";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./chunk-ZZGQD7A4.mjs";
|
|
43
43
|
import {
|
|
44
44
|
FARM_VERSION
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-VLPII2JJ.mjs";
|
|
46
46
|
import {
|
|
47
47
|
localizeFarmPathname
|
|
48
48
|
} from "./chunk-L3KT7IXV.mjs";
|
|
@@ -112,7 +112,7 @@ function routeBoundaryCoversDirectory(boundaryPattern, directory) {
|
|
|
112
112
|
__name(routeBoundaryCoversDirectory, "routeBoundaryCoversDirectory");
|
|
113
113
|
|
|
114
114
|
// src/server/full-document.ts
|
|
115
|
-
var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
|
|
115
|
+
var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents;?\s*"[^>]*>/i;
|
|
116
116
|
var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>|<script\b[^>]*\basync\b[^>]*><\/script>|<style\b[^>]*\bdata-precedence\b[^>]*>[\s\S]*?<\/style>)/i;
|
|
117
117
|
function peelDocumentPrefix(markup) {
|
|
118
118
|
let inner = markup.replace(/^\s+/, "");
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
_assertRequestReadAllowed,
|
|
6
6
|
getCurrentRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-X3NGFVRF.mjs";
|
|
8
8
|
import {
|
|
9
9
|
_resolveCurrentCspNonce
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6LVRDOAW.mjs";
|
|
11
11
|
import {
|
|
12
12
|
__name
|
|
13
13
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
4
|
+
|
|
5
|
+
// src/route-rendering.ts
|
|
6
|
+
function normalizeDynamicMode(value) {
|
|
7
|
+
switch (value) {
|
|
8
|
+
case "auto":
|
|
9
|
+
case "force-static":
|
|
10
|
+
case "force-dynamic":
|
|
11
|
+
case "error":
|
|
12
|
+
return value;
|
|
13
|
+
default:
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeDynamicMode, "normalizeDynamicMode");
|
|
18
|
+
function mergeRouteRenderingDirectiveConfig(directiveConfig, mod, options) {
|
|
19
|
+
const pprEnabled = _optionalChain([options, 'optionalAccess', _ => _.experimentalPPR]) === true;
|
|
20
|
+
let ssg = _nullishCoalesce(_optionalChain([directiveConfig, 'optionalAccess', _2 => _2.ssg]), () => ( false));
|
|
21
|
+
let requestedPPR = _nullishCoalesce(_optionalChain([directiveConfig, 'optionalAccess', _3 => _3.ppr]), () => ( false));
|
|
22
|
+
let revalidate = _optionalChain([directiveConfig, 'optionalAccess', _4 => _4.revalidate]);
|
|
23
|
+
const moduleDynamic = normalizeDynamicMode(_optionalChain([mod, 'optionalAccess', _5 => _5.dynamic]));
|
|
24
|
+
const dynamic = _nullishCoalesce(moduleDynamic, () => ( _optionalChain([directiveConfig, 'optionalAccess', _6 => _6.dynamic])));
|
|
25
|
+
const hasExplicitSsg = typeof _optionalChain([mod, 'optionalAccess', _7 => _7.ssg]) === "boolean";
|
|
26
|
+
const hasExplicitPPR = typeof _optionalChain([mod, 'optionalAccess', _8 => _8.ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _9 => _9.experimental_ppr]) === "boolean";
|
|
27
|
+
if (hasExplicitSsg) {
|
|
28
|
+
ssg = mod.ssg === true;
|
|
29
|
+
}
|
|
30
|
+
if (hasExplicitPPR) {
|
|
31
|
+
requestedPPR = _optionalChain([mod, 'optionalAccess', _10 => _10.ppr]) === true || _optionalChain([mod, 'optionalAccess', _11 => _11.experimental_ppr]) === true;
|
|
32
|
+
}
|
|
33
|
+
if (typeof _optionalChain([mod, 'optionalAccess', _12 => _12.revalidate]) === "number") {
|
|
34
|
+
if (mod.revalidate > 0) {
|
|
35
|
+
revalidate = mod.revalidate;
|
|
36
|
+
if (!hasExplicitSsg && !requestedPPR) {
|
|
37
|
+
ssg = true;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
revalidate = void 0;
|
|
41
|
+
if (!hasExplicitSsg) {
|
|
42
|
+
ssg = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} else if (_optionalChain([mod, 'optionalAccess', _13 => _13.revalidate]) === false) {
|
|
46
|
+
revalidate = void 0;
|
|
47
|
+
}
|
|
48
|
+
if (moduleDynamic === "force-static" || moduleDynamic === "error") {
|
|
49
|
+
ssg = true;
|
|
50
|
+
requestedPPR = false;
|
|
51
|
+
} else if (moduleDynamic === "force-dynamic") {
|
|
52
|
+
ssg = false;
|
|
53
|
+
requestedPPR = false;
|
|
54
|
+
revalidate = void 0;
|
|
55
|
+
}
|
|
56
|
+
if (_optionalChain([directiveConfig, 'optionalAccess', _14 => _14.requestBound]) && ssg) {
|
|
57
|
+
ssg = false;
|
|
58
|
+
revalidate = void 0;
|
|
59
|
+
}
|
|
60
|
+
const ppr = pprEnabled && !ssg && requestedPPR;
|
|
61
|
+
return {
|
|
62
|
+
ssg,
|
|
63
|
+
ppr,
|
|
64
|
+
revalidate: ssg || ppr ? revalidate : void 0,
|
|
65
|
+
dynamic,
|
|
66
|
+
directive: _optionalChain([directiveConfig, 'optionalAccess', _15 => _15.directive])
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeRouteRenderingDirectiveConfig, "mergeRouteRenderingDirectiveConfig");
|
|
70
|
+
|
|
71
|
+
// src/ssg-paths.ts
|
|
72
|
+
var OPTIONAL_CATCH_ALL_SEGMENT = /^\[\[\.\.\.([^\]]+)\]\]$/;
|
|
73
|
+
var REQUIRED_CATCH_ALL_SEGMENT = /^\[\.\.\.([^\]]+)\]$/;
|
|
74
|
+
var REQUIRED_DYNAMIC_SEGMENT = /^\[([^\]]+)\]$/;
|
|
75
|
+
function materializeSSGRoutePath(routePattern, params) {
|
|
76
|
+
const outputSegments = [];
|
|
77
|
+
for (const segment of routePattern.split("/")) {
|
|
78
|
+
if (!segment) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const optionalCatchAll = segment.match(OPTIONAL_CATCH_ALL_SEGMENT);
|
|
82
|
+
if (optionalCatchAll) {
|
|
83
|
+
const parameterName = optionalCatchAll[1];
|
|
84
|
+
const value = params[parameterName];
|
|
85
|
+
const values = readCatchAllSegments(value, {
|
|
86
|
+
optional: true,
|
|
87
|
+
parameterName,
|
|
88
|
+
routePattern
|
|
89
|
+
});
|
|
90
|
+
outputSegments.push(...values.map(encodePathSegment));
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const requiredCatchAll = segment.match(REQUIRED_CATCH_ALL_SEGMENT);
|
|
94
|
+
if (requiredCatchAll) {
|
|
95
|
+
const parameterName = requiredCatchAll[1];
|
|
96
|
+
const value = params[parameterName];
|
|
97
|
+
const values = readCatchAllSegments(value, {
|
|
98
|
+
optional: false,
|
|
99
|
+
parameterName,
|
|
100
|
+
routePattern
|
|
101
|
+
});
|
|
102
|
+
outputSegments.push(...values.map(encodePathSegment));
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const requiredDynamic = segment.match(REQUIRED_DYNAMIC_SEGMENT);
|
|
106
|
+
if (requiredDynamic) {
|
|
107
|
+
const parameterName = requiredDynamic[1];
|
|
108
|
+
const value = params[parameterName];
|
|
109
|
+
if (isStaticPathArray(value)) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
`Cannot materialize SSG route "${routePattern}": parameter "${parameterName}" must be a scalar value; arrays are only supported for catch-all segments.`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
if (isMissingPathValue(value)) {
|
|
115
|
+
throw missingRequiredParameterError(routePattern, parameterName);
|
|
116
|
+
}
|
|
117
|
+
outputSegments.push(encodePathSegment(value));
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
outputSegments.push(segment);
|
|
121
|
+
}
|
|
122
|
+
return outputSegments.length > 0 ? `/${outputSegments.join("/")}` : "/";
|
|
123
|
+
}
|
|
124
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, materializeSSGRoutePath, "materializeSSGRoutePath");
|
|
125
|
+
function readCatchAllSegments(value, options) {
|
|
126
|
+
if (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0) {
|
|
127
|
+
if (options.optional) {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
throw missingRequiredParameterError(options.routePattern, options.parameterName);
|
|
131
|
+
}
|
|
132
|
+
const segments = isStaticPathArray(value) ? [...value] : [value];
|
|
133
|
+
if (segments.some(isMissingPathValue)) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
`Cannot materialize SSG route "${options.routePattern}": catch-all parameter "${options.parameterName}" contains an empty path segment.`
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
return segments;
|
|
139
|
+
}
|
|
140
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, readCatchAllSegments, "readCatchAllSegments");
|
|
141
|
+
function getOptionalCatchAllParameterNames(routePattern) {
|
|
142
|
+
return new Set(
|
|
143
|
+
routePattern.split("/").map((segment) => _optionalChain([segment, 'access', _16 => _16.match, 'call', _17 => _17(OPTIONAL_CATCH_ALL_SEGMENT), 'optionalAccess', _18 => _18[1]])).filter((name) => Boolean(name))
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getOptionalCatchAllParameterNames, "getOptionalCatchAllParameterNames");
|
|
147
|
+
function normalizeStaticPathParams(params, optionalCatchAllParams) {
|
|
148
|
+
const entries = Object.entries(params).map(([key, value]) => {
|
|
149
|
+
const emptyOptionalCatchAll = optionalCatchAllParams.has(key) && (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0);
|
|
150
|
+
return [
|
|
151
|
+
key,
|
|
152
|
+
emptyOptionalCatchAll ? "" : isStaticPathArray(value) ? value.map(String).join("/") : String(value)
|
|
153
|
+
];
|
|
154
|
+
});
|
|
155
|
+
for (const name of optionalCatchAllParams) {
|
|
156
|
+
if (!Object.prototype.hasOwnProperty.call(params, name)) {
|
|
157
|
+
entries.push([name, ""]);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return Object.fromEntries(entries);
|
|
161
|
+
}
|
|
162
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeStaticPathParams, "normalizeStaticPathParams");
|
|
163
|
+
function isMissingPathValue(value) {
|
|
164
|
+
return value === "" || value === null || typeof value === "undefined";
|
|
165
|
+
}
|
|
166
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isMissingPathValue, "isMissingPathValue");
|
|
167
|
+
function isStaticPathArray(value) {
|
|
168
|
+
return Array.isArray(value);
|
|
169
|
+
}
|
|
170
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isStaticPathArray, "isStaticPathArray");
|
|
171
|
+
function missingRequiredParameterError(routePattern, parameterName) {
|
|
172
|
+
return new Error(
|
|
173
|
+
`Cannot materialize SSG route "${routePattern}": required parameter "${parameterName}" is missing or empty.`
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, missingRequiredParameterError, "missingRequiredParameterError");
|
|
177
|
+
function encodePathSegment(value) {
|
|
178
|
+
const encoded = encodeURIComponent(String(value)).replace(
|
|
179
|
+
/[!'()*]/g,
|
|
180
|
+
(character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`
|
|
181
|
+
);
|
|
182
|
+
if (encoded === "." || encoded === "..") {
|
|
183
|
+
throw new Error(
|
|
184
|
+
`Cannot materialize SSG path segment "${encoded}": dot-only segments are unsafe to prerender.`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return encoded;
|
|
188
|
+
}
|
|
189
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, encodePathSegment, "encodePathSegment");
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
exports.mergeRouteRenderingDirectiveConfig = mergeRouteRenderingDirectiveConfig; exports.materializeSSGRoutePath = materializeSSGRoutePath; exports.getOptionalCatchAllParameterNames = getOptionalCatchAllParameterNames; exports.normalizeStaticPathParams = normalizeStaticPathParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isEndpointFailure,
|
|
3
3
|
resolvePluginRoutes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MEASUNVY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
registerAPIRouteShape
|
|
7
7
|
} from "./chunk-W3B4PKAW.mjs";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./chunk-4SIYUGRY.mjs";
|
|
37
37
|
import {
|
|
38
38
|
_runWithCurrentRequest
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-X3NGFVRF.mjs";
|
|
40
40
|
import {
|
|
41
41
|
__name
|
|
42
42
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -7,7 +7,7 @@ var _chunkD7JTOLFKcjs = require('./chunk-D7JTOLFK.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkGB7LDGY5cjs = require('./chunk-GB7LDGY5.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkLTNGXMQ6cjs = require('./chunk-LTNGXMQ6.cjs');
|
|
@@ -149,9 +149,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
149
149
|
};
|
|
150
150
|
});
|
|
151
151
|
const mutationTarget = targetRef.current;
|
|
152
|
-
const isAPITarget =
|
|
152
|
+
const isAPITarget = _chunkGB7LDGY5cjs.isAPIRouteRef.call(void 0, mutationTarget);
|
|
153
153
|
const sharedOptimistic = !preparationFailed && !isAPITarget ? _optionalChain([currentOptions, 'access', _3 => _3.request, 'optionalAccess', _4 => _4.optimistic]) : void 0;
|
|
154
|
-
const sharedSnapshots = _optionalChain([sharedOptimistic, 'optionalAccess', _5 => _5.update, 'optionalAccess', _6 => _6.length]) ?
|
|
154
|
+
const sharedSnapshots = _optionalChain([sharedOptimistic, 'optionalAccess', _5 => _5.update, 'optionalAccess', _6 => _6.length]) ? _chunkGB7LDGY5cjs.applyServerFnOptimisticUpdates.call(void 0, sharedOptimistic.update) : [];
|
|
155
155
|
try {
|
|
156
156
|
if (preparationFailed) throw preparationError;
|
|
157
157
|
let data;
|
|
@@ -178,9 +178,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
178
178
|
throw cause;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
_chunkGB7LDGY5cjs.settleServerFnOptimisticUpdates.call(void 0, sharedSnapshots, "commit");
|
|
182
182
|
if (!isAPITarget && _optionalChain([currentOptions, 'access', _9 => _9.request, 'optionalAccess', _10 => _10.invalidate])) {
|
|
183
|
-
for (const key of
|
|
183
|
+
for (const key of _chunkGB7LDGY5cjs.resolveServerFnInvalidateTargets.call(void 0, currentOptions.request.invalidate)) {
|
|
184
184
|
_chunkZEG3OPIBcjs.notifyFarmCacheInvalidation.call(void 0, key);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -215,7 +215,7 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
215
215
|
}
|
|
216
216
|
return data;
|
|
217
217
|
} catch (cause) {
|
|
218
|
-
|
|
218
|
+
_chunkGB7LDGY5cjs.settleServerFnOptimisticUpdates.call(void 0,
|
|
219
219
|
sharedSnapshots,
|
|
220
220
|
_optionalChain([sharedOptimistic, 'optionalAccess', _11 => _11.rollbackOnError]) ? "rollback" : "invalidate"
|
|
221
221
|
);
|
|
@@ -391,7 +391,7 @@ function useFetcher(target, options = {}) {
|
|
|
391
391
|
const Form = _react.useMemo.call(void 0, () => {
|
|
392
392
|
const FetcherForm = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, ({ action, method, encType, onSubmit, ...props }) => {
|
|
393
393
|
const targetValue = targetRef.current;
|
|
394
|
-
const metadata =
|
|
394
|
+
const metadata = _chunkGB7LDGY5cjs.getAPIRouteRefMetadata.call(void 0, targetValue);
|
|
395
395
|
const nativeAction = _nullishCoalesce(action, () => ( resolveFetcherFormAction(targetValue, metadata)));
|
|
396
396
|
const nativeMethod = _nullishCoalesce(method, () => ( (metadata && (metadata.method === "GET" || metadata.method === "POST") ? metadata.method.toLowerCase() : metadata ? "post" : void 0)));
|
|
397
397
|
const functionAction = typeof nativeAction === "function";
|
|
@@ -460,10 +460,10 @@ function mapFetcherFormData(target, formData, options) {
|
|
|
460
460
|
if (options.mapFormData) {
|
|
461
461
|
return options.mapFormData(formData, context);
|
|
462
462
|
}
|
|
463
|
-
if (!
|
|
463
|
+
if (!_chunkGB7LDGY5cjs.isAPIRouteRef.call(void 0, target)) {
|
|
464
464
|
return formData;
|
|
465
465
|
}
|
|
466
|
-
const method = _optionalChain([
|
|
466
|
+
const method = _optionalChain([_chunkGB7LDGY5cjs.getAPIRouteRefMetadata.call(void 0, target), 'optionalAccess', _14 => _14.method]);
|
|
467
467
|
const query = method === "GET" || method === "HEAD";
|
|
468
468
|
const encoding = _nullishCoalesce(_optionalChain([context, 'access', _15 => _15.submitter, 'optionalAccess', _16 => _16.getAttribute, 'call', _17 => _17("formenctype")]), () => ( _optionalChain([context, 'access', _18 => _18.form, 'optionalAccess', _19 => _19.enctype])));
|
|
469
469
|
if (!query && (_optionalChain([encoding, 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]) === "multipart/form-data" || Array.from(formData.values()).some((value) => typeof value !== "string"))) {
|
|
@@ -12,7 +12,7 @@ var _chunkDVM4FKZLcjs = require('./chunk-DVM4FKZL.cjs');
|
|
|
12
12
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -41,7 +41,7 @@ function createRedirectsPlugin(redirects, {
|
|
|
41
41
|
if (overrideBeforeRequest) {
|
|
42
42
|
await overrideBeforeRequest(req, res, context);
|
|
43
43
|
}
|
|
44
|
-
const url =
|
|
44
|
+
const url = _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, req);
|
|
45
45
|
const routePath = _chunkDVM4FKZLcjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n);
|
|
46
46
|
const pathname = routePath.pathname;
|
|
47
47
|
for (const { redirect, pattern } of compiledRedirects) {
|
|
@@ -153,7 +153,7 @@ function createHeadersPlugin(headers, {
|
|
|
153
153
|
if (overrideBeforeRequest) {
|
|
154
154
|
await overrideBeforeRequest(req, res, context);
|
|
155
155
|
}
|
|
156
|
-
const url =
|
|
156
|
+
const url = _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, req);
|
|
157
157
|
const pathname = _chunkDVM4FKZLcjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n).pathname;
|
|
158
158
|
const matchedHeaders = compiledHeaders.filter(({ pattern }) => pattern.regex.test(pathname)).map(({ config }) => config.headers);
|
|
159
159
|
applyResponseHeaders(res, matchedHeaders);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6MVFHNYZcjs = require('./chunk-6MVFHNYZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkARJWXNQLcjs = require('./chunk-ARJWXNQL.cjs');
|
|
@@ -225,7 +225,7 @@ async function applyEndpointInvalidations(declaration, context, result) {
|
|
|
225
225
|
"Endpoint invalidates must resolve to an array of { key }, { path }, or { tag } targets"
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
|
-
return
|
|
228
|
+
return _chunk6MVFHNYZcjs.applyFarmCacheInvalidationTargets.call(void 0, targets);
|
|
229
229
|
}
|
|
230
230
|
_chunkS3JO3N4Hcjs.__name.call(void 0, applyEndpointInvalidations, "applyEndpointInvalidations");
|
|
231
231
|
function createInitialEndpointContext(value) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
_setCspNonceResolver,
|
|
4
4
|
_setCurrentRequestResolver,
|
|
5
5
|
_setSharedCacheScopeRunner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6LVRDOAW.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -63,34 +63,49 @@ function getAppRequestView(request) {
|
|
|
63
63
|
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
64
64
|
countRequestRead(request);
|
|
65
65
|
view = request;
|
|
66
|
+
try {
|
|
67
|
+
guardRequestReads(view, request, request.headers, request.clone);
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
66
70
|
} else {
|
|
67
71
|
view = new Request(request);
|
|
68
|
-
Object.
|
|
69
|
-
|
|
70
|
-
signal: { configurable: true, get: /* @__PURE__ */ __name(() => request.signal, "get") },
|
|
71
|
-
headers: {
|
|
72
|
-
configurable: true,
|
|
73
|
-
get() {
|
|
74
|
-
_assertRequestReadAllowed("request.headers");
|
|
75
|
-
countRequestRead(request);
|
|
76
|
-
return request.headers;
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
clone: {
|
|
80
|
-
configurable: true,
|
|
81
|
-
value() {
|
|
82
|
-
_assertRequestReadAllowed("request.clone()");
|
|
83
|
-
countRequestRead(request);
|
|
84
|
-
return request.clone();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
72
|
+
Object.defineProperty(view, "signal", { configurable: true, get: /* @__PURE__ */ __name(() => request.signal, "get") });
|
|
73
|
+
guardRequestReads(view, request, request.headers, request.clone);
|
|
88
74
|
}
|
|
89
75
|
appRequestViews.set(request, view);
|
|
90
76
|
return view;
|
|
91
77
|
}
|
|
92
78
|
__name(getAppRequestView, "getAppRequestView");
|
|
93
|
-
|
|
79
|
+
function guardRequestReads(view, request, requestHeaders, clone) {
|
|
80
|
+
Object.defineProperties(view, {
|
|
81
|
+
headers: {
|
|
82
|
+
configurable: true,
|
|
83
|
+
get() {
|
|
84
|
+
_assertRequestReadAllowed("request.headers");
|
|
85
|
+
countRequestRead(request);
|
|
86
|
+
return requestHeaders;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
clone: {
|
|
90
|
+
configurable: true,
|
|
91
|
+
value() {
|
|
92
|
+
_assertRequestReadAllowed("request.clone()");
|
|
93
|
+
countRequestRead(request);
|
|
94
|
+
return clone.call(request);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
__name(guardRequestReads, "guardRequestReads");
|
|
100
|
+
_setCurrentRequestResolver(
|
|
101
|
+
() => {
|
|
102
|
+
_assertRequestReadAllowed(
|
|
103
|
+
"A helper that reads the current request (such as auth.user() or the server api client)"
|
|
104
|
+
);
|
|
105
|
+
return requestStore.getStore();
|
|
106
|
+
},
|
|
107
|
+
() => requestStore.getStore()
|
|
108
|
+
);
|
|
94
109
|
var CSP_NONCE_STORAGE_KEY = /* @__PURE__ */ Symbol.for("@farm.js/core/csp-nonce-storage");
|
|
95
110
|
function getCspNonceStore() {
|
|
96
111
|
const runtime = globalThis;
|
|
@@ -4,23 +4,23 @@ var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk6IZWX6EScjs = require('./chunk-6IZWX6ES.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
14
14
|
|
|
15
15
|
// src/headers.ts
|
|
16
16
|
function headers() {
|
|
17
|
-
|
|
18
|
-
return new Headers(
|
|
17
|
+
_chunkZTP3BJG6cjs._assertRequestReadAllowed.call(void 0, "headers()");
|
|
18
|
+
return new Headers(_chunkZTP3BJG6cjs.getCurrentRequest.call(void 0, ).headers);
|
|
19
19
|
}
|
|
20
20
|
_chunkS3JO3N4Hcjs.__name.call(void 0, headers, "headers");
|
|
21
21
|
function cookies() {
|
|
22
|
-
|
|
23
|
-
const cookieHeader =
|
|
22
|
+
_chunkZTP3BJG6cjs._assertRequestReadAllowed.call(void 0, "cookies()");
|
|
23
|
+
const cookieHeader = _chunkZTP3BJG6cjs.getCurrentRequest.call(void 0, ).headers.get("cookie") || "";
|
|
24
24
|
const parsed = _chunkAI7QMY7Ocjs.parseRequestCookieHeader.call(void 0, cookieHeader);
|
|
25
25
|
return {
|
|
26
26
|
get(name) {
|
|
@@ -42,8 +42,8 @@ function cookies() {
|
|
|
42
42
|
}
|
|
43
43
|
_chunkS3JO3N4Hcjs.__name.call(void 0, cookies, "cookies");
|
|
44
44
|
function getCspNonce() {
|
|
45
|
-
|
|
46
|
-
return
|
|
45
|
+
_chunkZTP3BJG6cjs._assertRequestReadAllowed.call(void 0, "getCspNonce()");
|
|
46
|
+
return _chunk6IZWX6EScjs._resolveCurrentCspNonce.call(void 0, );
|
|
47
47
|
}
|
|
48
48
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getCspNonce, "getCspNonce");
|
|
49
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findProgrammaticRouteFilesInDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FWCGUVVL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isFarmAPIRouteFileName
|
|
6
6
|
} from "./chunk-CU625VAY.mjs";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
matchAPIRouteAtBasePath,
|
|
18
18
|
mergePluginAPIRoutes,
|
|
19
19
|
resolveAPIRouteEndpoint
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VTBXE6QG.mjs";
|
|
21
21
|
import {
|
|
22
22
|
registerAPIRouteShape
|
|
23
23
|
} from "./chunk-W3B4PKAW.mjs";
|