@farm.js/core 0.1.36 → 0.1.38
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-BVExL8rZ.d.mts → agent-mcp-BwKlpnc7.d.mts} +1 -1
- package/dist/{agent-mcp-luzfXK-P.d.ts → agent-mcp-De1imoMS.d.ts} +1 -1
- package/dist/{agent-mcp-handler-SJAHFSPI.cjs → agent-mcp-handler-MRGP3WJ3.cjs} +5 -5
- package/dist/{agent-mcp-handler-LPJ2CADR.mjs → agent-mcp-handler-OLRMZONF.mjs} +4 -4
- 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/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +6 -6
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +8 -7
- package/dist/{app-BukwkFIu.d.mts → app-CFZt-srr.d.mts} +21 -3
- package/dist/{app-Yfa2dsFy.d.ts → app-kT_QXTdx.d.ts} +21 -3
- package/dist/app-markdown.cjs +6 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +5 -3
- package/dist/{chunk-ADEA7PN3.cjs → chunk-2DD4JMQC.cjs} +113 -22
- package/dist/chunk-2ZYGC6SS.cjs +576 -0
- package/dist/{chunk-JZVADIOD.cjs → chunk-34UCJRQO.cjs} +2 -2
- package/dist/{chunk-D2BB47NB.cjs → chunk-3LOLJTFV.cjs} +6 -6
- package/dist/{chunk-KXWRO25S.cjs → chunk-472NCAZ7.cjs} +3 -3
- package/dist/chunk-4E5QXOCL.cjs +109 -0
- package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
- package/dist/{chunk-VQLJWDVW.cjs → chunk-4IE345DM.cjs} +37 -19
- package/dist/{chunk-O6WAEAX3.mjs → chunk-5BWWFHR2.mjs} +70 -15
- package/dist/{chunk-JNUWCDTF.cjs → chunk-5D2JIPLH.cjs} +2 -2
- package/dist/{chunk-BO36SELV.cjs → chunk-5OKBARDN.cjs} +2 -2
- package/dist/{chunk-AO6RYU5N.cjs → chunk-5PWXMJOH.cjs} +30 -22
- package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
- package/dist/chunk-6BK3K2GB.mjs +318 -0
- package/dist/{chunk-O6I6VWKK.mjs → chunk-6HB6V3R7.mjs} +1 -1
- package/dist/{chunk-UXFQ3UDA.cjs → chunk-6XWDE2P2.cjs} +61 -4
- package/dist/{chunk-VILIPRS6.mjs → chunk-7FPTZLKH.mjs} +1 -1
- package/dist/{chunk-SC2WYWPF.mjs → chunk-7PEP3BUT.mjs} +3 -3
- package/dist/{chunk-4E5AEDKY.mjs → chunk-A3EAIURZ.mjs} +25 -7
- package/dist/{chunk-YDQZGSDS.mjs → chunk-ARC7I3O2.mjs} +1 -1
- package/dist/{chunk-LSZAVSGY.mjs → chunk-B6G5CKMC.mjs} +101 -10
- package/dist/{chunk-3KZS4SUS.mjs → chunk-BZHXGVMA.mjs} +1 -1
- package/dist/{chunk-KN7K4VQN.mjs → chunk-CNNOLE4O.mjs} +1 -1
- package/dist/{chunk-4GLOOWKE.mjs → chunk-CQMVIOYP.mjs} +1 -1
- package/dist/{chunk-2ELDTQRN.mjs → chunk-CUM5NYL5.mjs} +1 -1
- package/dist/{chunk-HITLGIAO.cjs → chunk-CY2ZQ5C6.cjs} +7 -6
- package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
- package/dist/{chunk-QORUJDIV.mjs → chunk-DRLKAXDM.mjs} +2 -2
- package/dist/{chunk-DQQOKWYA.cjs → chunk-EIPC3FDA.cjs} +12 -4
- package/dist/{chunk-HOXTWRGB.mjs → chunk-EKF7KDFD.mjs} +5 -2
- package/dist/{chunk-42NHY7HW.cjs → chunk-EKN7NSZO.cjs} +62 -14
- package/dist/{chunk-YKX5BK66.cjs → chunk-EMO6K4YY.cjs} +7 -7
- package/dist/{chunk-6SJ2KJTA.mjs → chunk-EPYU2EBL.mjs} +1 -1
- package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
- package/dist/{chunk-PTZ2TVNE.cjs → chunk-H5CLOUZS.cjs} +5 -5
- package/dist/{chunk-DTSROJ5J.mjs → chunk-HD5CF3OE.mjs} +1 -1
- package/dist/{chunk-35GKZR22.mjs → chunk-HXRYZWTA.mjs} +1 -1
- package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
- package/dist/{chunk-MKYBIIAQ.mjs → chunk-IBUQWVYA.mjs} +17 -1
- package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
- package/dist/{chunk-W7LF2J2S.mjs → chunk-INL3THCU.mjs} +1 -1
- package/dist/{chunk-WZ77PUAM.mjs → chunk-IVLZZZEI.mjs} +1 -1
- package/dist/{chunk-ENLZ4R3Y.mjs → chunk-J7K2NZD6.mjs} +7 -6
- package/dist/{chunk-BPOF5U4N.mjs → chunk-JCKYH4LG.mjs} +10 -7
- package/dist/{chunk-77GNHH2Z.cjs → chunk-JCYYXBAJ.cjs} +3 -3
- package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
- package/dist/{chunk-ZWM5KGAA.cjs → chunk-KCQBAKIY.cjs} +23 -20
- package/dist/{chunk-OTC5BDGO.mjs → chunk-KHKLMNI5.mjs} +12 -7
- package/dist/{chunk-DZ5ZVB2K.cjs → chunk-KKSTAEMY.cjs} +1 -1
- package/dist/{chunk-N2NAS2AM.cjs → chunk-L4DD7ODZ.cjs} +2 -2
- package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
- package/dist/{chunk-OO7GXVSR.mjs → chunk-LI2F57NI.mjs} +1 -1
- package/dist/{chunk-NRSN7G7E.mjs → chunk-MLY2RP5R.mjs} +10 -2
- package/dist/{chunk-BPMATOP2.cjs → chunk-N32CC42M.cjs} +25 -20
- package/dist/{chunk-FNO7A7CM.cjs → chunk-NBBEQLOK.cjs} +34 -16
- package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
- package/dist/{chunk-GQRWBCWK.mjs → chunk-OAHTRMIC.mjs} +13 -5
- package/dist/{chunk-35WV46VL.mjs → chunk-OCIEZME4.mjs} +876 -685
- package/dist/{chunk-UH6QN5NL.mjs → chunk-P664ZVTV.mjs} +2 -2
- package/dist/{chunk-TE2G5ION.cjs → chunk-PGZDEPTM.cjs} +88 -33
- package/dist/{chunk-FDR64H6B.mjs → chunk-POSPE3IO.mjs} +59 -2
- package/dist/{chunk-UVW64BCB.cjs → chunk-Q3NXS4MU.cjs} +16 -14
- package/dist/{chunk-4WCZJQUO.mjs → chunk-QFW2IH5E.mjs} +57 -9
- package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
- package/dist/chunk-QRKIMN7T.mjs +48 -0
- package/dist/chunk-QTXBII4Z.cjs +632 -0
- package/dist/{chunk-CI6E3UOH.cjs → chunk-RG4A6LB2.cjs} +7 -7
- package/dist/{chunk-BJPBQNIE.cjs → chunk-RW63BOV7.cjs} +2 -2
- package/dist/{chunk-FO427P6I.cjs → chunk-RWFLWR5J.cjs} +10 -10
- package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
- package/dist/{chunk-EUV4YR3V.cjs → chunk-SGBJ247Q.cjs} +18 -2
- package/dist/chunk-SGBZPZUW.mjs +75 -0
- package/dist/{chunk-2NNMOPDN.mjs → chunk-SKVTP5PR.mjs} +4 -1
- package/dist/{chunk-2YTDKNH3.cjs → chunk-TGFQVLLF.cjs} +956 -765
- package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
- package/dist/{chunk-276VJSM6.mjs → chunk-TUBTR2OP.mjs} +250 -118
- package/dist/{chunk-GQ3Z3IZI.cjs → chunk-TYJALEHQ.cjs} +18 -18
- package/dist/chunk-TYMMBFN2.mjs +109 -0
- package/dist/chunk-U6QLDL3G.mjs +576 -0
- package/dist/{chunk-U4KT7QP3.cjs → chunk-ULASELLA.cjs} +26 -1
- package/dist/chunk-UXHS27O6.cjs +75 -0
- package/dist/{chunk-WWIKMBRN.mjs → chunk-VNGH5MLF.mjs} +17 -1
- package/dist/{chunk-EZDQRNQ7.mjs → chunk-VT4WFRHA.mjs} +23 -5
- package/dist/{chunk-CBJJH36A.cjs → chunk-VU6AAZVY.cjs} +20 -4
- package/dist/{chunk-27ZWSI3W.cjs → chunk-VXEEATVD.cjs} +2 -2
- package/dist/{chunk-EWET4D2Y.mjs → chunk-W36M2BQ4.mjs} +3 -3
- package/dist/{chunk-4WQ6PGSJ.cjs → chunk-WEW2JVA4.cjs} +4 -4
- package/dist/{chunk-4E5WBPEG.mjs → chunk-WFRT7JPX.mjs} +8 -533
- package/dist/{chunk-T4OGRVNS.mjs → chunk-WLL43JMO.mjs} +2 -2
- package/dist/chunk-WW46B6HA.cjs +318 -0
- package/dist/{chunk-TKSCR644.cjs → chunk-WXJLNP33.cjs} +2 -2
- package/dist/{chunk-S6VYG6XU.cjs → chunk-XKG2BLFN.cjs} +2 -2
- package/dist/{chunk-4NU4GGTC.cjs → chunk-XKVVMZP5.cjs} +6 -3
- package/dist/{chunk-NMHWYWDR.cjs → chunk-YR2VBEMO.cjs} +658 -526
- package/dist/{chunk-OHLSEQ57.mjs → chunk-ZJD2PN6Z.mjs} +10 -8
- package/dist/{chunk-3BU22U3M.cjs → chunk-ZXH4TS3F.cjs} +5 -2
- package/dist/{client-plugins-r1mOtSC1.d.ts → client-plugins-BvlNhGEB.d.ts} +54 -7
- package/dist/{client-plugins-C3mK9Pol.d.mts → client-plugins-DUrIYX9B.d.mts} +54 -7
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-ERIKFEXX.mjs → devtools-JYJNOLPQ.mjs} +8 -6
- package/dist/{devtools-JZJJY5CK.cjs → devtools-VQWJANJV.cjs} +9 -7
- package/dist/docs.cjs +12 -10
- package/dist/docs.d.mts +20 -2
- package/dist/docs.d.ts +20 -2
- package/dist/docs.mjs +11 -9
- package/dist/headers.cjs +6 -4
- package/dist/headers.d.mts +11 -1
- package/dist/headers.d.ts +11 -1
- package/dist/headers.mjs +5 -3
- package/dist/i18n/client.cjs +11 -11
- package/dist/i18n/client.mjs +3 -3
- package/dist/index.cjs +62 -46
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +62 -46
- package/dist/integrations.cjs +5 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +4 -2
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +19 -5
- package/dist/internal/app-markdown-runtime.d.ts +19 -5
- package/dist/internal/app-markdown-runtime.mjs +4 -2
- package/dist/internal/build-runtime.cjs +33 -30
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +32 -29
- package/dist/internal/cli-runtime.cjs +14 -12
- package/dist/internal/cli-runtime.mjs +13 -11
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.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 +9 -7
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +8 -6
- package/dist/internal/docs-precompiled-runtime.cjs +19 -13
- package/dist/internal/docs-precompiled-runtime.d.mts +5 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +5 -0
- package/dist/internal/docs-precompiled-runtime.mjs +14 -8
- 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-node-env.cjs +6 -2
- package/dist/internal/production-node-env.d.mts +10 -1
- package/dist/internal/production-node-env.d.ts +10 -1
- package/dist/internal/production-node-env.mjs +5 -1
- package/dist/internal/production-runtime.cjs +39 -54
- package/dist/internal/production-runtime.d.mts +51 -11
- package/dist/internal/production-runtime.d.ts +51 -11
- package/dist/internal/production-runtime.mjs +39 -54
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +7 -1
- package/dist/middleware.cjs +10 -8
- package/dist/middleware.d.mts +27 -5
- package/dist/middleware.d.ts +27 -5
- package/dist/middleware.mjs +10 -8
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +6 -6
- package/dist/plugin.cjs +25 -23
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +24 -22
- package/dist/{production-runtime-CCeVZXst.d.mts → production-runtime-BQ4_WLwQ.d.mts} +1 -1
- package/dist/{production-runtime-DPnsggY3.d.ts → production-runtime-D2aMyzjr.d.ts} +1 -1
- package/dist/query/client.cjs +9 -9
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-Cw4f5E_R.d.ts → render-plan-25p4hrj4.d.ts} +1 -1
- package/dist/{render-plan-BuGaPFe6.d.mts → render-plan-DtkXMN8D.d.mts} +1 -1
- package/dist/renderer-client.cjs +12 -12
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +4 -4
- package/dist/renderer.d.mts +13 -4
- package/dist/renderer.d.ts +13 -4
- package/dist/{request-CsGARcAw.d.mts → request-DgCkIdcn.d.mts} +4 -2
- package/dist/{request-Bkg-hERy.d.ts → request-jF4jwx8f.d.ts} +4 -2
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-BUZMH_64.d.ts → route-rendering-Bji6S6a_.d.ts} +1 -1
- package/dist/{route-rendering-f11yh5dp.d.mts → route-rendering-CSBF78Ya.d.mts} +1 -1
- package/dist/{router-Cp6yRE8A.d.mts → router-B09Ui3Qm.d.mts} +1 -1
- package/dist/{router-B8CR9GbD.d.ts → router-CPB9cXtG.d.ts} +1 -1
- package/dist/routes.cjs +2 -2
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/{runtime-CAEv36S_.d.mts → runtime-CM6E6yuI.d.mts} +1 -1
- package/dist/{runtime-CQVsT330.d.ts → runtime-EDMwLdjv.d.ts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +51 -49
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +29 -27
- package/dist/{spa-router-BuciWGCZ.d.ts → spa-router-B_N8XgVu.d.ts} +2 -2
- package/dist/{spa-router-DwbqGkGj.d.mts → spa-router-Cgimzfbi.d.mts} +2 -2
- package/dist/testing.cjs +8 -8
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +6 -6
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-CaoWKtYM.d.ts → utils-BNxAKAuT.d.ts} +1 -1
- package/dist/{utils-B9V0S_yL.d.mts → utils-DZciYXYl.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +25 -23
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +24 -22
- package/package.json +1 -1
- package/types/middleware.d.ts +5 -1
- package/dist/chunk-655RLQQL.mjs +0 -43
- package/dist/chunk-FXEF4PPL.mjs +0 -47
- package/dist/chunk-IZY3V5XW.mjs +0 -23
- package/dist/chunk-MRMI32SN.cjs +0 -1157
- package/dist/chunk-MT763TDW.cjs +0 -43
- package/dist/chunk-XD32KALF.cjs +0 -47
- /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
- /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
|
@@ -3,14 +3,15 @@ import {
|
|
|
3
3
|
parseMiddlewareCookieHeader,
|
|
4
4
|
serializeMiddlewareCookie,
|
|
5
5
|
serializeMiddlewareCookieDeletion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SKVTP5PR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
compileMiddlewareConfig,
|
|
9
9
|
compileMiddlewareRoute,
|
|
10
10
|
matchesMiddlewareConfig,
|
|
11
11
|
matchesMiddlewareConfigAt,
|
|
12
|
-
matchesMiddlewareRouteAt
|
|
13
|
-
|
|
12
|
+
matchesMiddlewareRouteAt,
|
|
13
|
+
toMiddlewareRoutePathname
|
|
14
|
+
} from "./chunk-HZFM2LWQ.mjs";
|
|
14
15
|
import {
|
|
15
16
|
emitFarmEvent
|
|
16
17
|
} from "./chunk-FUZEBRP3.mjs";
|
|
@@ -260,7 +261,7 @@ function createHandledResponse(body, init, headers) {
|
|
|
260
261
|
return new Response(body, { ...init, headers: responseHeaders });
|
|
261
262
|
}
|
|
262
263
|
__name(createHandledResponse, "createHandledResponse");
|
|
263
|
-
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress) {
|
|
264
|
+
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress, toRoutePathname) {
|
|
264
265
|
let currentRequest = withNodeRequestShape(request, trustProxy, clientAddress);
|
|
265
266
|
let handledResponse = null;
|
|
266
267
|
const url = new URL(currentRequest.url);
|
|
@@ -281,6 +282,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
281
282
|
response: responseShim.response,
|
|
282
283
|
url,
|
|
283
284
|
pathname: url.pathname,
|
|
285
|
+
routePathname: toMiddlewareRoutePathname(url.pathname, toRoutePathname),
|
|
284
286
|
searchParams: url.searchParams,
|
|
285
287
|
method: currentRequest.method || "GET",
|
|
286
288
|
params: {},
|
|
@@ -323,6 +325,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
323
325
|
ctx.request = currentRequest;
|
|
324
326
|
ctx.url = nextUrl;
|
|
325
327
|
ctx.pathname = nextUrl.pathname;
|
|
328
|
+
ctx.routePathname = toMiddlewareRoutePathname(nextUrl.pathname, toRoutePathname);
|
|
326
329
|
ctx.searchParams = nextUrl.searchParams;
|
|
327
330
|
ctx.route = nextUrl.pathname;
|
|
328
331
|
},
|
|
@@ -480,15 +483,16 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
480
483
|
if (!globalConfig && entries.length === 0) {
|
|
481
484
|
return emptyResult(request);
|
|
482
485
|
}
|
|
486
|
+
const toRoutePathname = /* @__PURE__ */ __name((pathname) => options.i18n?.enabled ? stripFarmLocaleFromPathname(pathname, options.i18n) : stripFarmBasePath(pathname, options.i18n?.basePath ?? "/"), "toRoutePathname");
|
|
483
487
|
let contextState = createWebMiddlewareContext(
|
|
484
488
|
request,
|
|
485
489
|
void 0,
|
|
486
490
|
options.server?.trustProxy === true,
|
|
487
|
-
requestOptions.clientAddress
|
|
491
|
+
requestOptions.clientAddress,
|
|
492
|
+
toRoutePathname
|
|
488
493
|
);
|
|
489
494
|
let ctx = contextState.ctx;
|
|
490
495
|
let currentRequest = contextState.getRequest();
|
|
491
|
-
const toRoutePathname = /* @__PURE__ */ __name((pathname) => options.i18n?.enabled ? stripFarmLocaleFromPathname(pathname, options.i18n) : stripFarmBasePath(pathname, options.i18n?.basePath ?? "/"), "toRoutePathname");
|
|
492
496
|
const initialRequestPathname = ctx.pathname;
|
|
493
497
|
const initialPathname = toRoutePathname(initialRequestPathname);
|
|
494
498
|
const matchPathnames = /* @__PURE__ */ __name((pathname, requestPathname) => options.rawPathRouting && requestPathname !== pathname ? [
|
|
@@ -542,7 +546,8 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
542
546
|
currentRequest,
|
|
543
547
|
parentData,
|
|
544
548
|
options.server?.trustProxy === true,
|
|
545
|
-
requestOptions.clientAddress
|
|
549
|
+
requestOptions.clientAddress,
|
|
550
|
+
toRoutePathname
|
|
546
551
|
);
|
|
547
552
|
ctx = contextState.ctx;
|
|
548
553
|
}
|
|
@@ -27,7 +27,7 @@ var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
|
|
|
27
27
|
var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkVU6AAZVYcjs = require('./chunk-VU6AAZVY.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -119,7 +119,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, withTimeout, "withTimeout");
|
|
|
119
119
|
var formatSeconds = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`, "formatSeconds");
|
|
120
120
|
function collectSchemaOwners(config) {
|
|
121
121
|
const owners = [];
|
|
122
|
-
const integrationSchemas =
|
|
122
|
+
const integrationSchemas = _chunkVU6AAZVYcjs.getIntegrationSchemas.call(void 0, config.integrations);
|
|
123
123
|
let integrationClient;
|
|
124
124
|
for (const [name, schema] of Object.entries(integrationSchemas)) {
|
|
125
125
|
owners.push({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -14,10 +14,10 @@ var translate = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (key, valu
|
|
|
14
14
|
const message = readOwnMessage(snapshot.messages, key);
|
|
15
15
|
if (message === void 0) return key;
|
|
16
16
|
const cacheKey = `${snapshot.locale}\0${key}\0${message}`;
|
|
17
|
-
let formatter =
|
|
17
|
+
let formatter = _chunkS6FJO323cjs.compiledFarmI18nMessages.get(cacheKey);
|
|
18
18
|
if (!formatter) {
|
|
19
19
|
formatter = new (0, _intlmessageformat2.default)(message, snapshot.locale);
|
|
20
|
-
|
|
20
|
+
_chunkS6FJO323cjs.compiledFarmI18nMessages.set(cacheKey, formatter);
|
|
21
21
|
}
|
|
22
22
|
const result = formatter.format(values);
|
|
23
23
|
if (rich) return Array.isArray(result) && result.length === 1 ? result[0] : result;
|
|
@@ -35,7 +35,7 @@ function createFarmClientTranslator() {
|
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientTranslator, "createFarmClientTranslator");
|
|
37
37
|
function requireSnapshot() {
|
|
38
|
-
const snapshot =
|
|
38
|
+
const snapshot = _chunkS6FJO323cjs.getFarmI18nClientState.call(void 0, );
|
|
39
39
|
if (!snapshot) {
|
|
40
40
|
throw new Error("Farm i18n is not configured or has not been hydrated.");
|
|
41
41
|
}
|
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-JM5XPKWH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getCurrentRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-POSPE3IO.mjs";
|
|
7
|
+
import {
|
|
8
|
+
_resolveCurrentCspNonce
|
|
9
|
+
} from "./chunk-QRKIMN7T.mjs";
|
|
7
10
|
import {
|
|
8
11
|
__name
|
|
9
12
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -35,8 +38,13 @@ function cookies() {
|
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
__name(cookies, "cookies");
|
|
41
|
+
function getCspNonce() {
|
|
42
|
+
return _resolveCurrentCspNonce();
|
|
43
|
+
}
|
|
44
|
+
__name(getCspNonce, "getCspNonce");
|
|
38
45
|
|
|
39
46
|
export {
|
|
40
47
|
headers,
|
|
41
|
-
cookies
|
|
48
|
+
cookies,
|
|
49
|
+
getCspNonce
|
|
42
50
|
};
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkZXH4TS3Fcjs = require('./chunk-ZXH4TS3F.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
var _chunk4GWRFP22cjs = require('./chunk-4GWRFP22.cjs');
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
@@ -82,19 +83,19 @@ var WebResponseHeaderMap = _WebResponseHeaderMap;
|
|
|
82
83
|
var _WebCookieJar = class _WebCookieJar {
|
|
83
84
|
constructor(request, headers) {
|
|
84
85
|
this.headers = headers;
|
|
85
|
-
this.cookies =
|
|
86
|
+
this.cookies = _chunkZXH4TS3Fcjs.parseMiddlewareCookieHeader.call(void 0, request.headers.get("cookie"));
|
|
86
87
|
}
|
|
87
88
|
get(name) {
|
|
88
89
|
return this.cookies[name];
|
|
89
90
|
}
|
|
90
91
|
set(name, value, options = {}) {
|
|
91
92
|
this.cookies[name] = value;
|
|
92
|
-
const cookieString =
|
|
93
|
+
const cookieString = _chunkZXH4TS3Fcjs.serializeMiddlewareCookie.call(void 0, name, value, options);
|
|
93
94
|
this.headers.appendSetCookie(cookieString);
|
|
94
95
|
}
|
|
95
96
|
delete(name, options = {}) {
|
|
96
97
|
delete this.cookies[name];
|
|
97
|
-
this.headers.appendSetCookie(
|
|
98
|
+
this.headers.appendSetCookie(_chunkZXH4TS3Fcjs.serializeMiddlewareCookieDeletion.call(void 0, name, options));
|
|
98
99
|
}
|
|
99
100
|
getAll() {
|
|
100
101
|
return { ...this.cookies };
|
|
@@ -260,7 +261,7 @@ function createHandledResponse(body, init, headers) {
|
|
|
260
261
|
return new Response(body, { ...init, headers: responseHeaders });
|
|
261
262
|
}
|
|
262
263
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createHandledResponse, "createHandledResponse");
|
|
263
|
-
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress) {
|
|
264
|
+
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress, toRoutePathname) {
|
|
264
265
|
let currentRequest = withNodeRequestShape(request, trustProxy, clientAddress);
|
|
265
266
|
let handledResponse = null;
|
|
266
267
|
const url = new URL(currentRequest.url);
|
|
@@ -281,6 +282,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
281
282
|
response: responseShim.response,
|
|
282
283
|
url,
|
|
283
284
|
pathname: url.pathname,
|
|
285
|
+
routePathname: _chunk4GWRFP22cjs.toMiddlewareRoutePathname.call(void 0, url.pathname, toRoutePathname),
|
|
284
286
|
searchParams: url.searchParams,
|
|
285
287
|
method: currentRequest.method || "GET",
|
|
286
288
|
params: {},
|
|
@@ -323,6 +325,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
323
325
|
ctx.request = currentRequest;
|
|
324
326
|
ctx.url = nextUrl;
|
|
325
327
|
ctx.pathname = nextUrl.pathname;
|
|
328
|
+
ctx.routePathname = _chunk4GWRFP22cjs.toMiddlewareRoutePathname.call(void 0, nextUrl.pathname, toRoutePathname);
|
|
326
329
|
ctx.searchParams = nextUrl.searchParams;
|
|
327
330
|
ctx.route = nextUrl.pathname;
|
|
328
331
|
},
|
|
@@ -375,7 +378,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
375
378
|
}
|
|
376
379
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createWebMiddlewareContext, "createWebMiddlewareContext");
|
|
377
380
|
function matchesMiddlewareConfig2(pathname, config, ctx) {
|
|
378
|
-
return
|
|
381
|
+
return _chunk4GWRFP22cjs.matchesMiddlewareConfig.call(void 0, pathname, config, ctx);
|
|
379
382
|
}
|
|
380
383
|
_chunkS3JO3N4Hcjs.__name.call(void 0, matchesMiddlewareConfig2, "matchesMiddlewareConfig");
|
|
381
384
|
function getConfigHandlers(entry) {
|
|
@@ -408,7 +411,7 @@ function normalizeConfigMiddleware(config) {
|
|
|
408
411
|
globalConfig = middlewareConfig;
|
|
409
412
|
continue;
|
|
410
413
|
}
|
|
411
|
-
|
|
414
|
+
_chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, middlewareConfig);
|
|
412
415
|
entries.push({
|
|
413
416
|
path: "/",
|
|
414
417
|
filePath: `farm.config.ts#middleware-${index}`,
|
|
@@ -423,11 +426,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeConfigMiddleware, "normalizeConfi
|
|
|
423
426
|
function normalizeFileMiddleware(modules = []) {
|
|
424
427
|
const entries = [];
|
|
425
428
|
for (const moduleEntry of modules) {
|
|
426
|
-
const normalized =
|
|
429
|
+
const normalized = _chunkZXH4TS3Fcjs.normalizeMiddlewareModule.call(void 0, moduleEntry.module, moduleEntry.path);
|
|
427
430
|
if (!normalized) {
|
|
428
431
|
continue;
|
|
429
432
|
}
|
|
430
|
-
if (normalized.config)
|
|
433
|
+
if (normalized.config) _chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, normalized.config);
|
|
431
434
|
entries.push({
|
|
432
435
|
path: moduleEntry.path,
|
|
433
436
|
filePath: moduleEntry.filePath || moduleEntry.path,
|
|
@@ -471,24 +474,25 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, emptyResult, "emptyResult");
|
|
|
471
474
|
function createProductionMiddlewareRunner(options = {}) {
|
|
472
475
|
const configMiddleware = normalizeConfigMiddleware(options.config);
|
|
473
476
|
const fileMiddleware = normalizeFileMiddleware(options.modules);
|
|
474
|
-
for (const entry of fileMiddleware)
|
|
477
|
+
for (const entry of fileMiddleware) _chunk4GWRFP22cjs.compileMiddlewareRoute.call(void 0, entry);
|
|
475
478
|
const entries = [...configMiddleware.entries, ...fileMiddleware];
|
|
476
479
|
const globalConfig = configMiddleware.globalConfig;
|
|
477
|
-
if (globalConfig)
|
|
480
|
+
if (globalConfig) _chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, globalConfig);
|
|
478
481
|
const toMiddlewarePathnames = _chunkKNBBQHO2cjs.createFarmAPIMiddlewarePathnames.call(void 0, options.apiBasePath);
|
|
479
482
|
return /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async function runProductionMiddleware(request, requestOptions = {}) {
|
|
480
483
|
if (!globalConfig && entries.length === 0) {
|
|
481
484
|
return emptyResult(request);
|
|
482
485
|
}
|
|
486
|
+
const toRoutePathname = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pathname) => _optionalChain([options, 'access', _15 => _15.i18n, 'optionalAccess', _16 => _16.enabled]) ? _chunkBIDYX3SLcjs.stripFarmLocaleFromPathname.call(void 0, pathname, options.i18n) : _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, pathname, _nullishCoalesce(_optionalChain([options, 'access', _17 => _17.i18n, 'optionalAccess', _18 => _18.basePath]), () => ( "/"))), "toRoutePathname");
|
|
483
487
|
let contextState = createWebMiddlewareContext(
|
|
484
488
|
request,
|
|
485
489
|
void 0,
|
|
486
|
-
_optionalChain([options, 'access',
|
|
487
|
-
requestOptions.clientAddress
|
|
490
|
+
_optionalChain([options, 'access', _19 => _19.server, 'optionalAccess', _20 => _20.trustProxy]) === true,
|
|
491
|
+
requestOptions.clientAddress,
|
|
492
|
+
toRoutePathname
|
|
488
493
|
);
|
|
489
494
|
let ctx = contextState.ctx;
|
|
490
495
|
let currentRequest = contextState.getRequest();
|
|
491
|
-
const toRoutePathname = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pathname) => _optionalChain([options, 'access', _17 => _17.i18n, 'optionalAccess', _18 => _18.enabled]) ? _chunkBIDYX3SLcjs.stripFarmLocaleFromPathname.call(void 0, pathname, options.i18n) : _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, pathname, _nullishCoalesce(_optionalChain([options, 'access', _19 => _19.i18n, 'optionalAccess', _20 => _20.basePath]), () => ( "/"))), "toRoutePathname");
|
|
492
496
|
const initialRequestPathname = ctx.pathname;
|
|
493
497
|
const initialPathname = toRoutePathname(initialRequestPathname);
|
|
494
498
|
const matchPathnames = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pathname, requestPathname) => options.rawPathRouting && requestPathname !== pathname ? [
|
|
@@ -499,7 +503,7 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
499
503
|
] : toMiddlewarePathnames(pathname), "matchPathnames");
|
|
500
504
|
let parentData;
|
|
501
505
|
if (globalConfig) {
|
|
502
|
-
const globalMatch =
|
|
506
|
+
const globalMatch = _chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0,
|
|
503
507
|
matchPathnames(initialPathname, initialRequestPathname),
|
|
504
508
|
globalConfig,
|
|
505
509
|
ctx
|
|
@@ -516,11 +520,11 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
516
520
|
for (let pathname = initialPathname, requestPathname = initialRequestPathname, pass = 0; ; pass++) {
|
|
517
521
|
const pathnames = matchPathnames(pathname, requestPathname);
|
|
518
522
|
if (pass > 0 && globalConfig) {
|
|
519
|
-
if (!
|
|
523
|
+
if (!_chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0, pathnames, globalConfig, ctx).matched) return;
|
|
520
524
|
}
|
|
521
525
|
for (const entry of entries) {
|
|
522
526
|
if (ran.has(entry)) continue;
|
|
523
|
-
const routeMatch = entry.source === "config" ? { matched: true } :
|
|
527
|
+
const routeMatch = entry.source === "config" ? { matched: true } : _chunk4GWRFP22cjs.matchesMiddlewareRouteAt.call(void 0, pathnames, entry);
|
|
524
528
|
if (routeMatch.matched) yield { entry, routeMatch, pathname, pathnames };
|
|
525
529
|
}
|
|
526
530
|
const rewrittenRequestPathname = new URL(currentRequest.url).pathname;
|
|
@@ -532,7 +536,7 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
532
536
|
}
|
|
533
537
|
_chunkS3JO3N4Hcjs.__name.call(void 0, applicableMiddleware, "applicableMiddleware");
|
|
534
538
|
for (const { entry, routeMatch, pathname, pathnames } of applicableMiddleware()) {
|
|
535
|
-
const configMatch = entry.config ?
|
|
539
|
+
const configMatch = entry.config ? _chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0, pathnames, entry.config, ctx) : { matched: true };
|
|
536
540
|
if (!configMatch.matched) {
|
|
537
541
|
continue;
|
|
538
542
|
}
|
|
@@ -542,7 +546,8 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
542
546
|
currentRequest,
|
|
543
547
|
parentData,
|
|
544
548
|
_optionalChain([options, 'access', _21 => _21.server, 'optionalAccess', _22 => _22.trustProxy]) === true,
|
|
545
|
-
requestOptions.clientAddress
|
|
549
|
+
requestOptions.clientAddress,
|
|
550
|
+
toRoutePathname
|
|
546
551
|
);
|
|
547
552
|
ctx = contextState.ctx;
|
|
548
553
|
}
|
|
@@ -7,7 +7,7 @@ var _chunkD7JTOLFKcjs = require('./chunk-D7JTOLFK.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkRW63BOV7cjs = require('./chunk-RW63BOV7.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkLTNGXMQ6cjs = require('./chunk-LTNGXMQ6.cjs');
|
|
@@ -17,10 +17,12 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunkJEZO6VURcjs = require('./chunk-JEZO6VUR.cjs');
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
var _chunk63H6BKXGcjs = require('./chunk-63H6BKXG.cjs');
|
|
@@ -147,9 +149,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
147
149
|
};
|
|
148
150
|
});
|
|
149
151
|
const mutationTarget = targetRef.current;
|
|
150
|
-
const isAPITarget =
|
|
152
|
+
const isAPITarget = _chunkRW63BOV7cjs.isAPIRouteRef.call(void 0, mutationTarget);
|
|
151
153
|
const sharedOptimistic = !preparationFailed && !isAPITarget ? _optionalChain([currentOptions, 'access', _3 => _3.request, 'optionalAccess', _4 => _4.optimistic]) : void 0;
|
|
152
|
-
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]) ? _chunkRW63BOV7cjs.applyServerFnOptimisticUpdates.call(void 0, sharedOptimistic.update) : [];
|
|
153
155
|
try {
|
|
154
156
|
if (preparationFailed) throw preparationError;
|
|
155
157
|
let data;
|
|
@@ -176,9 +178,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
176
178
|
throw cause;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
|
-
|
|
181
|
+
_chunkRW63BOV7cjs.settleServerFnOptimisticUpdates.call(void 0, sharedSnapshots, "commit");
|
|
180
182
|
if (!isAPITarget && _optionalChain([currentOptions, 'access', _9 => _9.request, 'optionalAccess', _10 => _10.invalidate])) {
|
|
181
|
-
for (const key of
|
|
183
|
+
for (const key of _chunkRW63BOV7cjs.resolveServerFnInvalidateTargets.call(void 0, currentOptions.request.invalidate)) {
|
|
182
184
|
_chunkZEG3OPIBcjs.notifyFarmCacheInvalidation.call(void 0, key);
|
|
183
185
|
}
|
|
184
186
|
}
|
|
@@ -213,7 +215,7 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
213
215
|
}
|
|
214
216
|
return data;
|
|
215
217
|
} catch (cause) {
|
|
216
|
-
|
|
218
|
+
_chunkRW63BOV7cjs.settleServerFnOptimisticUpdates.call(void 0,
|
|
217
219
|
sharedSnapshots,
|
|
218
220
|
_optionalChain([sharedOptimistic, 'optionalAccess', _11 => _11.rollbackOnError]) ? "rollback" : "invalidate"
|
|
219
221
|
);
|
|
@@ -389,7 +391,7 @@ function useFetcher(target, options = {}) {
|
|
|
389
391
|
const Form = _react.useMemo.call(void 0, () => {
|
|
390
392
|
const FetcherForm = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, ({ action, method, encType, onSubmit, ...props }) => {
|
|
391
393
|
const targetValue = targetRef.current;
|
|
392
|
-
const metadata =
|
|
394
|
+
const metadata = _chunkRW63BOV7cjs.getAPIRouteRefMetadata.call(void 0, targetValue);
|
|
393
395
|
const nativeAction = _nullishCoalesce(action, () => ( resolveFetcherFormAction(targetValue, metadata)));
|
|
394
396
|
const nativeMethod = _nullishCoalesce(method, () => ( (metadata && (metadata.method === "GET" || metadata.method === "POST") ? metadata.method.toLowerCase() : metadata ? "post" : void 0)));
|
|
395
397
|
const functionAction = typeof nativeAction === "function";
|
|
@@ -458,10 +460,10 @@ function mapFetcherFormData(target, formData, options) {
|
|
|
458
460
|
if (options.mapFormData) {
|
|
459
461
|
return options.mapFormData(formData, context);
|
|
460
462
|
}
|
|
461
|
-
if (!
|
|
463
|
+
if (!_chunkRW63BOV7cjs.isAPIRouteRef.call(void 0, target)) {
|
|
462
464
|
return formData;
|
|
463
465
|
}
|
|
464
|
-
const method = _optionalChain([
|
|
466
|
+
const method = _optionalChain([_chunkRW63BOV7cjs.getAPIRouteRefMetadata.call(void 0, target), 'optionalAccess', _14 => _14.method]);
|
|
465
467
|
const query = method === "GET" || method === "HEAD";
|
|
466
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])));
|
|
467
469
|
if (!query && (_optionalChain([encoding, 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]) === "multipart/form-data" || Array.from(formData.values()).some((value) => typeof value !== "string"))) {
|
|
@@ -1213,9 +1215,10 @@ function LinkInner({
|
|
|
1213
1215
|
hash,
|
|
1214
1216
|
trailingSlash: _nullishCoalesce(trailingSlash, () => ( _chunkOYEUREB6cjs.getFarmTrailingSlashPreference.call(void 0, )))
|
|
1215
1217
|
});
|
|
1216
|
-
const localizedHref =
|
|
1218
|
+
const localizedHref = _chunkS6FJO323cjs.localizeActiveFarmHref.call(void 0, baseHref, locale);
|
|
1217
1219
|
const resolvedHref = isExternalUrl(localizedHref) ? localizedHref : _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, localizedHref, _nullishCoalesce(_optionalChain([farm, 'optionalAccess', _34 => _34.basePath]), () => ( _chunkI57LW5VZcjs.getFarmBasePath.call(void 0, ))));
|
|
1218
1220
|
const isExternal = isExternalUrl(resolvedHref);
|
|
1221
|
+
const isScriptHref = _chunkJEZO6VURcjs.isFarmScriptURL.call(void 0, resolvedHref);
|
|
1219
1222
|
const doPrefetch = _react.useCallback.call(void 0, () => {
|
|
1220
1223
|
if (isExternal || activePrefetch.current) return;
|
|
1221
1224
|
const router = getRouter();
|
|
@@ -1325,6 +1328,11 @@ function LinkInner({
|
|
|
1325
1328
|
const handleClick = _react.useCallback.call(void 0,
|
|
1326
1329
|
(event) => {
|
|
1327
1330
|
_optionalChain([onClick, 'optionalCall', _40 => _40(event)]);
|
|
1331
|
+
if (isScriptHref) {
|
|
1332
|
+
event.preventDefault();
|
|
1333
|
+
_chunkJEZO6VURcjs.isFarmBlockedNavigationURL.call(void 0, _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, resolvedHref, window.location.href));
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1328
1336
|
if (event.defaultPrevented) return;
|
|
1329
1337
|
if (isExternal) return;
|
|
1330
1338
|
if (event.currentTarget.hasAttribute("download")) return;
|
|
@@ -1333,7 +1341,7 @@ function LinkInner({
|
|
|
1333
1341
|
if (event.button !== 0) return;
|
|
1334
1342
|
if (typeof window !== "undefined") {
|
|
1335
1343
|
event.preventDefault();
|
|
1336
|
-
if (
|
|
1344
|
+
if (_chunkS6FJO323cjs.isFarmLocaleChangeHref.call(void 0, localizedHref)) {
|
|
1337
1345
|
window.location.assign(resolvedHref);
|
|
1338
1346
|
return;
|
|
1339
1347
|
}
|
|
@@ -1346,7 +1354,17 @@ function LinkInner({
|
|
|
1346
1354
|
}
|
|
1347
1355
|
}
|
|
1348
1356
|
},
|
|
1349
|
-
[
|
|
1357
|
+
[
|
|
1358
|
+
localizedHref,
|
|
1359
|
+
resolvedHref,
|
|
1360
|
+
replace,
|
|
1361
|
+
scroll,
|
|
1362
|
+
viewTransition,
|
|
1363
|
+
target,
|
|
1364
|
+
isExternal,
|
|
1365
|
+
isScriptHref,
|
|
1366
|
+
onClick
|
|
1367
|
+
]
|
|
1350
1368
|
);
|
|
1351
1369
|
const setRefs = _react.useCallback.call(void 0,
|
|
1352
1370
|
(node) => {
|
|
@@ -1360,7 +1378,7 @@ function LinkInner({
|
|
|
1360
1378
|
"a",
|
|
1361
1379
|
{
|
|
1362
1380
|
ref: setRefs,
|
|
1363
|
-
href: resolvedHref,
|
|
1381
|
+
href: isScriptHref ? void 0 : resolvedHref,
|
|
1364
1382
|
target,
|
|
1365
1383
|
onClick: handleClick,
|
|
1366
1384
|
onMouseEnter: handleMouseEnter,
|
|
@@ -1433,7 +1451,7 @@ function applyPreservedSearchParams(href) {
|
|
|
1433
1451
|
const manifest = window.__FARM_MANIFEST__;
|
|
1434
1452
|
const routes = _optionalChain([manifest, 'optionalAccess', _41 => _41.routes]) && typeof manifest.routes === "object" ? Object.values(manifest.routes) : [];
|
|
1435
1453
|
if (routes.length === 0) return href;
|
|
1436
|
-
const url =
|
|
1454
|
+
const url = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
1437
1455
|
const route = routes.find((candidate) => matchManifestRoute(url.pathname, candidate));
|
|
1438
1456
|
const preserve = Array.isArray(_optionalChain([route, 'optionalAccess', _42 => _42.search, 'optionalAccess', _43 => _43.preserve])) ? route.search.preserve : [];
|
|
1439
1457
|
if (preserve.length === 0) return href;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_hydrateFarmI18n,
|
|
3
3
|
isFarmLocaleChangeHref
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IHQIOZLC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getHashTargetElement
|
|
7
7
|
} from "./chunk-2PQNJXFM.mjs";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isFarmBlockedNavigationURL,
|
|
10
10
|
isFarmExternalNavigationURL,
|
|
11
11
|
resolveFarmNavigationURL
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QHSH7IH4.mjs";
|
|
13
13
|
import {
|
|
14
14
|
createClientCancellation
|
|
15
15
|
} from "./chunk-QVYLBY73.mjs";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createFarmDevServerDispatch
|
|
3
|
+
} from "./chunk-SGBZPZUW.mjs";
|
|
1
4
|
import {
|
|
2
5
|
_runWithAPIRequestRuntime
|
|
3
6
|
} from "./chunk-R3DS7A2T.mjs";
|
|
@@ -6,10 +9,10 @@ import {
|
|
|
6
9
|
} from "./chunk-IOEH4VWN.mjs";
|
|
7
10
|
import {
|
|
8
11
|
APIRouteConflictError
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WLL43JMO.mjs";
|
|
10
13
|
import {
|
|
11
14
|
findProgrammaticRouteFilesInDir
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MYIZXDZA.mjs";
|
|
13
16
|
import {
|
|
14
17
|
isFarmAPIRouteFileName
|
|
15
18
|
} from "./chunk-CU625VAY.mjs";
|
|
@@ -20,7 +23,7 @@ import {
|
|
|
20
23
|
matchAPIRouteAtBasePath,
|
|
21
24
|
mergePluginAPIRoutes,
|
|
22
25
|
resolveAPIRouteEndpoint
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6HB6V3R7.mjs";
|
|
24
27
|
import {
|
|
25
28
|
isProgrammaticRoutesFileName
|
|
26
29
|
} from "./chunk-EA5K5BKU.mjs";
|
|
@@ -44,7 +47,7 @@ import {
|
|
|
44
47
|
} from "./chunk-Z2RZJZIZ.mjs";
|
|
45
48
|
import {
|
|
46
49
|
resolveFarmRequestURL
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-POSPE3IO.mjs";
|
|
48
51
|
import {
|
|
49
52
|
AmbiguousRouteError,
|
|
50
53
|
assertUniqueRouteParameters,
|
|
@@ -65,6 +68,7 @@ function farmApiPlugin(options = {}) {
|
|
|
65
68
|
let apiRoutesCache = /* @__PURE__ */ new Map();
|
|
66
69
|
let apiRouterHandler = null;
|
|
67
70
|
let projectRoot = process.cwd();
|
|
71
|
+
let devServer;
|
|
68
72
|
let pluginMergedRoutes = null;
|
|
69
73
|
const servedRoutes = /* @__PURE__ */ __name(() => pluginMergedRoutes ?? apiRoutesCache, "servedRoutes");
|
|
70
74
|
let routePlugins;
|
|
@@ -190,7 +194,10 @@ function farmApiPlugin(options = {}) {
|
|
|
190
194
|
bodySizeLimit,
|
|
191
195
|
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
192
196
|
// so the middleware that guards the endpoint's path runs for it.
|
|
193
|
-
dispatch: /* @__PURE__ */ __name((request) =>
|
|
197
|
+
dispatch: /* @__PURE__ */ __name((request) => {
|
|
198
|
+
if (!devServer) throw new Error("The Farm API dev server is not running.");
|
|
199
|
+
return createFarmDevServerDispatch(devServer)(request);
|
|
200
|
+
}, "dispatch")
|
|
194
201
|
}).map((route) => [route.path, route])
|
|
195
202
|
) : null;
|
|
196
203
|
const totalEndpoints = Array.from(servedRoutes().values()).reduce(
|
|
@@ -238,6 +245,7 @@ function farmApiPlugin(options = {}) {
|
|
|
238
245
|
enforce: "pre",
|
|
239
246
|
configureServer(server) {
|
|
240
247
|
projectRoot = server.config.root;
|
|
248
|
+
devServer = server;
|
|
241
249
|
const discoverFileRoutes = /* @__PURE__ */ __name(async (apiDir) => {
|
|
242
250
|
const fs = await import("fs");
|
|
243
251
|
const path = await import("path");
|