@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTYJALEHQcjs = require('./chunk-TYJALEHQ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFWE7LEQCcjs = require('./chunk-FWE7LEQC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
@@ -13,7 +13,7 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
13
13
|
|
|
14
14
|
// src/navigation.ts
|
|
15
15
|
function useRouter2() {
|
|
16
|
-
const router =
|
|
16
|
+
const router = _chunkTYJALEHQcjs.useRouter.call(void 0, );
|
|
17
17
|
return {
|
|
18
18
|
push: router.push,
|
|
19
19
|
replace: router.replace,
|
|
@@ -21,21 +21,21 @@ function useRouter2() {
|
|
|
21
21
|
forward: router.forward,
|
|
22
22
|
refresh() {
|
|
23
23
|
if (typeof window === "undefined") return Promise.resolve();
|
|
24
|
-
return
|
|
24
|
+
return _chunkFWE7LEQCcjs.getRouter.call(void 0, ).refresh();
|
|
25
25
|
},
|
|
26
26
|
prefetch(href) {
|
|
27
27
|
if (typeof window === "undefined") return Promise.resolve();
|
|
28
|
-
return
|
|
28
|
+
return _chunkFWE7LEQCcjs.getRouter.call(void 0, ).prefetch(_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter2, "useRouter");
|
|
33
33
|
function usePathname() {
|
|
34
|
-
return
|
|
34
|
+
return _chunkTYJALEHQcjs.useRouter.call(void 0, ).pathname;
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePathname, "usePathname");
|
|
37
37
|
function useSearchParams() {
|
|
38
|
-
return
|
|
38
|
+
return _chunkTYJALEHQcjs.useRouter.call(void 0, ).searchParams;
|
|
39
39
|
}
|
|
40
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useSearchParams, "useSearchParams");
|
|
41
41
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkR5A5KNVXcjs = require('./chunk-R5A5KNVX.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkR5A5KNVXcjs = require('./chunk-R5A5KNVX.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkJEZO6VURcjs = require('./chunk-JEZO6VUR.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkJ7FSKED3cjs = require('./chunk-J7FSKED3.cjs');
|
|
@@ -227,12 +227,12 @@ var _SPARouter = class _SPARouter {
|
|
|
227
227
|
viewTransition = false,
|
|
228
228
|
refresh = false
|
|
229
229
|
} = options;
|
|
230
|
-
const url =
|
|
231
|
-
if (
|
|
230
|
+
const url = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
231
|
+
if (_chunkJEZO6VURcjs.isFarmBlockedNavigationURL.call(void 0, url)) return;
|
|
232
232
|
const pathname = url.pathname;
|
|
233
233
|
const search = url.search;
|
|
234
234
|
const fullPath = pathname + search;
|
|
235
|
-
if (
|
|
235
|
+
if (_chunkJEZO6VURcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin) || _chunkS6FJO323cjs.isFarmLocaleChangeHref.call(void 0, url.toString()) || this.options.shouldUseDocumentNavigation(pathname)) {
|
|
236
236
|
this.cancelActiveNavigation();
|
|
237
237
|
if (replace) window.location.replace(url.toString());
|
|
238
238
|
else window.location.assign(url.toString());
|
|
@@ -336,9 +336,9 @@ var _SPARouter = class _SPARouter {
|
|
|
336
336
|
*/
|
|
337
337
|
async prefetch(href) {
|
|
338
338
|
if (this.destroyed) return;
|
|
339
|
-
if (
|
|
340
|
-
const url =
|
|
341
|
-
if (
|
|
339
|
+
if (_chunkS6FJO323cjs.isFarmLocaleChangeHref.call(void 0, href)) return;
|
|
340
|
+
const url = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
341
|
+
if (_chunkJEZO6VURcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin)) return;
|
|
342
342
|
if (this.options.shouldUseDocumentNavigation(url.pathname)) return;
|
|
343
343
|
const fullPath = url.pathname + url.search;
|
|
344
344
|
const interceptFrom = window.location.pathname + window.location.search;
|
|
@@ -497,7 +497,7 @@ var _SPARouter = class _SPARouter {
|
|
|
497
497
|
this.writePageState(action, readPageState(), href, false);
|
|
498
498
|
}
|
|
499
499
|
async commitNavigation(options) {
|
|
500
|
-
const historyUrl =
|
|
500
|
+
const historyUrl = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0,
|
|
501
501
|
options.pageData.canonicalPath || options.fullPath,
|
|
502
502
|
window.location.href
|
|
503
503
|
);
|
|
@@ -519,13 +519,13 @@ var _SPARouter = class _SPARouter {
|
|
|
519
519
|
window.history.pushState(historyState, "", historyPath);
|
|
520
520
|
}
|
|
521
521
|
this.currentHistoryIndex = nextHistoryIndex;
|
|
522
|
-
const resolvedHistoryUrl =
|
|
522
|
+
const resolvedHistoryUrl = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, historyPath, window.location.href);
|
|
523
523
|
this.currentHistoryPath = resolvedHistoryUrl.pathname + resolvedHistoryUrl.search;
|
|
524
524
|
this.currentHistoryHash = resolvedHistoryUrl.hash;
|
|
525
525
|
this.currentInterceptFrom = historyState[FARM_INTERCEPT_FROM_KEY];
|
|
526
526
|
notifyRouterHistoryChange();
|
|
527
527
|
this.updateDocumentMetadata(options.pageData.metadata);
|
|
528
|
-
|
|
528
|
+
_chunkS6FJO323cjs._hydrateFarmI18n.call(void 0, options.pageData.i18n);
|
|
529
529
|
if (this.onNavigate) {
|
|
530
530
|
await this.onNavigate(options.pageData);
|
|
531
531
|
}
|
|
@@ -757,7 +757,7 @@ var _SPARouter = class _SPARouter {
|
|
|
757
757
|
}
|
|
758
758
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
759
759
|
this.updateDocumentMetadata(pageData.metadata);
|
|
760
|
-
|
|
760
|
+
_chunkS6FJO323cjs._hydrateFarmI18n.call(void 0, pageData.i18n);
|
|
761
761
|
if (this.onNavigate) {
|
|
762
762
|
await this.onNavigate(pageData);
|
|
763
763
|
}
|
|
@@ -872,7 +872,7 @@ var _SPARouter = class _SPARouter {
|
|
|
872
872
|
}
|
|
873
873
|
writePageState(action, state, href, notify = true) {
|
|
874
874
|
if (typeof window === "undefined") return;
|
|
875
|
-
const url = href ?
|
|
875
|
+
const url = href ? _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href).toString() : window.location.href;
|
|
876
876
|
const parsedUrl = new URL(url);
|
|
877
877
|
const nextPath = parsedUrl.pathname + parsedUrl.search;
|
|
878
878
|
const historyPath = nextPath + parsedUrl.hash;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkWEW2JVA4cjs = require('./chunk-WEW2JVA4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -108,10 +108,10 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
108
108
|
for (const source of sources) {
|
|
109
109
|
const module = isRecord(source.module) ? source.module : void 0;
|
|
110
110
|
if (_optionalChain([module, 'optionalAccess', _ => _.__farmRouteGuard])) continue;
|
|
111
|
-
if (!
|
|
111
|
+
if (!_chunkSGBJ247Qcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, source.pattern)) continue;
|
|
112
112
|
readable.push({ pattern: source.pattern, metadata: _optionalChain([module, 'optionalAccess', _2 => _2.metadata]) });
|
|
113
113
|
}
|
|
114
|
-
return
|
|
114
|
+
return _chunkWEW2JVA4cjs.collectFarmLlmsTxtPages.call(void 0, readable, {
|
|
115
115
|
origin: options.origin,
|
|
116
116
|
basePath: options.basePath,
|
|
117
117
|
markdown: options.markdown
|
|
@@ -121,7 +121,7 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
121
121
|
url: `${options.origin}${_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, page.path, options.basePath)}`,
|
|
122
122
|
...page.description ? { description: page.description } : {},
|
|
123
123
|
markdownUrl: `${options.origin}${_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0,
|
|
124
|
-
|
|
124
|
+
_chunkSGBJ247Qcjs.getFarmMarkdownMirrorPath.call(void 0, page.path),
|
|
125
125
|
options.basePath
|
|
126
126
|
)}`
|
|
127
127
|
}));
|
|
@@ -183,6 +183,25 @@ function matchPattern(pattern, pathname) {
|
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
__name(matchPattern, "matchPattern");
|
|
186
|
+
function withRoutePathname(ctx, routePathname) {
|
|
187
|
+
return new Proxy(ctx, {
|
|
188
|
+
get(target, key) {
|
|
189
|
+
return key === "pathname" || key === "routePathname" ? routePathname : Reflect.get(target, key, target);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
__name(withRoutePathname, "withRoutePathname");
|
|
194
|
+
function matchesMiddlewarePredicate(predicate, ctx, getRoutePathname = () => ctx.routePathname) {
|
|
195
|
+
if (predicate(ctx)) return true;
|
|
196
|
+
const routePathname = getRoutePathname();
|
|
197
|
+
if (routePathname === void 0 || routePathname === ctx.pathname) return false;
|
|
198
|
+
return Boolean(predicate(withRoutePathname(ctx, routePathname)));
|
|
199
|
+
}
|
|
200
|
+
__name(matchesMiddlewarePredicate, "matchesMiddlewarePredicate");
|
|
201
|
+
function toMiddlewareRoutePathname(pathname, toRoutePathname = (value) => value) {
|
|
202
|
+
return canonicalizeRequestPathname(toRoutePathname(pathname));
|
|
203
|
+
}
|
|
204
|
+
__name(toMiddlewareRoutePathname, "toMiddlewareRoutePathname");
|
|
186
205
|
function matchesCompiledMiddlewareConfig(pathname, config, ctx) {
|
|
187
206
|
let canonicalPathname;
|
|
188
207
|
const getCanonicalPathname = /* @__PURE__ */ __name(() => canonicalPathname ?? (canonicalPathname = canonicalizeRequestPathname(pathname)), "getCanonicalPathname");
|
|
@@ -196,7 +215,7 @@ function matchesCompiledMiddlewareConfig(pathname, config, ctx) {
|
|
|
196
215
|
if (config.matcher) {
|
|
197
216
|
for (const matcher of config.matcher) {
|
|
198
217
|
if (typeof matcher === "function") {
|
|
199
|
-
if (matcher
|
|
218
|
+
if (matchesMiddlewarePredicate(matcher, ctx, getCanonicalPathname)) {
|
|
200
219
|
return { matched: true };
|
|
201
220
|
}
|
|
202
221
|
continue;
|
|
@@ -232,6 +251,8 @@ export {
|
|
|
232
251
|
matchesMiddlewareRoute,
|
|
233
252
|
matchesMiddlewareRouteAt,
|
|
234
253
|
compileMiddlewareConfig,
|
|
254
|
+
matchesMiddlewarePredicate,
|
|
255
|
+
toMiddlewareRoutePathname,
|
|
235
256
|
matchesCompiledMiddlewareConfig,
|
|
236
257
|
matchesMiddlewareConfig,
|
|
237
258
|
matchesMiddlewareConfigAt
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
compileMiddlewareConfig,
|
|
6
6
|
matchesCompiledMiddlewareConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HZFM2LWQ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
bufferFarmRequestBody,
|
|
10
10
|
clearRequestContext,
|
|
@@ -2033,6 +2033,21 @@ function resolveIntegrationMiddlewareParams(entry, pathname, config) {
|
|
|
2033
2033
|
return null;
|
|
2034
2034
|
}
|
|
2035
2035
|
__name(resolveIntegrationMiddlewareParams, "resolveIntegrationMiddlewareParams");
|
|
2036
|
+
function integrationMiddlewareMayHandlePath(integrations, pathname, catchAllProbe) {
|
|
2037
|
+
if (!integrations) return false;
|
|
2038
|
+
const covers = /* @__PURE__ */ __name((entry) => resolveIntegrationMiddlewareParams(entry, pathname, void 0) !== null, "covers");
|
|
2039
|
+
return Object.values(integrations).some(
|
|
2040
|
+
(integration) => isFarmIntegration(integration) && (integration.middleware || []).some((entry) => {
|
|
2041
|
+
if (catchAllProbe === void 0) return covers(entry);
|
|
2042
|
+
if (!entry.matcher) return false;
|
|
2043
|
+
const specific = (Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher]).filter(
|
|
2044
|
+
(matcher) => resolveIntegrationMiddlewareParams({ matcher }, catchAllProbe, void 0) === null
|
|
2045
|
+
);
|
|
2046
|
+
return specific.length > 0 && covers({ matcher: specific });
|
|
2047
|
+
})
|
|
2048
|
+
);
|
|
2049
|
+
}
|
|
2050
|
+
__name(integrationMiddlewareMayHandlePath, "integrationMiddlewareMayHandlePath");
|
|
2036
2051
|
var FARM_INTEGRATION_API_BASE_PATH_KEY = "__farmAPIServerBasePath";
|
|
2037
2052
|
var integrationAPIPathnames = /* @__PURE__ */ new WeakMap();
|
|
2038
2053
|
function getIntegrationAPIPathnames(config) {
|
|
@@ -2183,5 +2198,6 @@ export {
|
|
|
2183
2198
|
getRegisteredIntegrationAPIManifest,
|
|
2184
2199
|
dispatchIntegrationRequest,
|
|
2185
2200
|
dispatchIntegrationRequests,
|
|
2201
|
+
integrationMiddlewareMayHandlePath,
|
|
2186
2202
|
FARM_INTEGRATION_API_BASE_PATH_KEY
|
|
2187
2203
|
};
|
|
@@ -20,15 +20,16 @@ async function hydrateFarmDocsAdapterRuntime() {
|
|
|
20
20
|
async function hydrateFarmDocsAdapterRuntime() {
|
|
21
21
|
const runtime = window.__FARM_DOCS_ADAPTER__;
|
|
22
22
|
if (!runtime) return false;
|
|
23
|
-
|
|
23
|
+
// The docs server flags pages whose config holds what its JSON copy cannot (icons,
|
|
24
|
+
// MDX components, callbacks); the adapter restores those from the module itself.
|
|
25
|
+
// Fetch it alongside the adapter rather than after it: they don't depend on each other.
|
|
26
|
+
const [FarmDocsAdapterReact, configModule] = await Promise.all([
|
|
27
|
+
import(${JSON.stringify(reactModule)}),
|
|
28
|
+
runtime.configModule ? ${configModule ? `import(${JSON.stringify(configModule)})` : "undefined"} : undefined,
|
|
29
|
+
]);
|
|
24
30
|
if (typeof FarmDocsAdapterReact.hydrateFarmDocs !== "function") {
|
|
25
31
|
throw new Error("The configured Farm docs adapter does not export hydrateFarmDocs().");
|
|
26
32
|
}
|
|
27
|
-
// The docs server flags pages whose config holds what its JSON copy cannot (icons,
|
|
28
|
-
// MDX components, callbacks); the adapter restores those from the module itself.
|
|
29
|
-
const configModule = runtime.configModule
|
|
30
|
-
? ${configModule ? `await import(${JSON.stringify(configModule)})` : "undefined"}
|
|
31
|
-
: undefined;
|
|
32
33
|
FarmDocsAdapterReact.hydrateFarmDocs({
|
|
33
34
|
config: runtime.config || {},
|
|
34
35
|
data: runtime.data,
|
|
@@ -7,13 +7,14 @@ import {
|
|
|
7
7
|
parseMiddlewareCookieHeader,
|
|
8
8
|
serializeMiddlewareCookie,
|
|
9
9
|
serializeMiddlewareCookieDeletion
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SKVTP5PR.mjs";
|
|
11
11
|
import {
|
|
12
12
|
compileMiddlewareConfig,
|
|
13
13
|
compileMiddlewareRoute,
|
|
14
14
|
matchesMiddlewareConfigAt,
|
|
15
|
-
matchesMiddlewareRouteAt
|
|
16
|
-
|
|
15
|
+
matchesMiddlewareRouteAt,
|
|
16
|
+
toMiddlewareRoutePathname
|
|
17
|
+
} from "./chunk-HZFM2LWQ.mjs";
|
|
17
18
|
import {
|
|
18
19
|
createCliColors
|
|
19
20
|
} from "./chunk-I2BHUNBU.mjs";
|
|
@@ -40,7 +41,7 @@ import {
|
|
|
40
41
|
} from "./chunk-CBBLJMR5.mjs";
|
|
41
42
|
import {
|
|
42
43
|
resolveFarmRequestURL
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-POSPE3IO.mjs";
|
|
44
45
|
import {
|
|
45
46
|
stripFarmLocaleFromPathname
|
|
46
47
|
} from "./chunk-L3KT7IXV.mjs";
|
|
@@ -80,7 +81,7 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
80
81
|
};
|
|
81
82
|
__name(_CookieJarImpl, "CookieJarImpl");
|
|
82
83
|
var CookieJarImpl = _CookieJarImpl;
|
|
83
|
-
function createContext(req, res, viteServer, parent, server) {
|
|
84
|
+
function createContext(req, res, viteServer, parent, server, toRoutePathname) {
|
|
84
85
|
const url = resolveFarmRequestURL(req, { trustProxy: server?.trustProxy });
|
|
85
86
|
const headers = /* @__PURE__ */ new Map();
|
|
86
87
|
const data = parent?.data ? new Map(parent.data) : /* @__PURE__ */ new Map();
|
|
@@ -105,6 +106,7 @@ function createContext(req, res, viteServer, parent, server) {
|
|
|
105
106
|
response: res,
|
|
106
107
|
url,
|
|
107
108
|
pathname: url.pathname,
|
|
109
|
+
routePathname: toMiddlewareRoutePathname(url.pathname, toRoutePathname),
|
|
108
110
|
searchParams: url.searchParams,
|
|
109
111
|
method: req.method || "GET",
|
|
110
112
|
params: {},
|
|
@@ -140,6 +142,7 @@ function createContext(req, res, viteServer, parent, server) {
|
|
|
140
142
|
const newUrl = new URL(rewriteUrl, ctx.url);
|
|
141
143
|
ctx.url = newUrl;
|
|
142
144
|
ctx.pathname = newUrl.pathname;
|
|
145
|
+
ctx.routePathname = toMiddlewareRoutePathname(newUrl.pathname, toRoutePathname);
|
|
143
146
|
ctx.searchParams = newUrl.searchParams;
|
|
144
147
|
ctx.route = newUrl.pathname;
|
|
145
148
|
req.url = rewriteUrl;
|
|
@@ -364,7 +367,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
364
367
|
const method = req.method || "GET";
|
|
365
368
|
const startTime = Date.now();
|
|
366
369
|
let parentData;
|
|
367
|
-
let ctx = createContext(req, res, this.viteServer, void 0, this.server);
|
|
370
|
+
let ctx = createContext(req, res, this.viteServer, void 0, this.server, toRoutePathname);
|
|
368
371
|
if (this.globalConfig) {
|
|
369
372
|
const globalMatch = this.matchesConfig(routePathname, this.globalConfig, ctx);
|
|
370
373
|
if (!globalMatch.matched) {
|
|
@@ -432,7 +435,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
432
435
|
ctx.params = { ...ctx.params, ...configMatch.params };
|
|
433
436
|
}
|
|
434
437
|
if (parentData) {
|
|
435
|
-
ctx = createContext(req, res, this.viteServer, parentData, this.server);
|
|
438
|
+
ctx = createContext(req, res, this.viteServer, parentData, this.server, toRoutePathname);
|
|
436
439
|
if (routeMatch.params) {
|
|
437
440
|
ctx.params = { ...ctx.params, ...routeMatch.params };
|
|
438
441
|
}
|
|
@@ -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 _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.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 = _chunk6XWDE2P2cjs.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 = _chunk6XWDE2P2cjs.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);
|
|
@@ -10,6 +10,14 @@ function isFarmBlockedNavigationURL(url) {
|
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
12
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmBlockedNavigationURL, "isFarmBlockedNavigationURL");
|
|
13
|
+
function isFarmScriptURL(href) {
|
|
14
|
+
try {
|
|
15
|
+
return new URL(href, "http://farm.invalid").protocol === "javascript:";
|
|
16
|
+
} catch (e) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmScriptURL, "isFarmScriptURL");
|
|
13
21
|
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
14
22
|
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
15
23
|
}
|
|
@@ -23,4 +31,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNavigationURL, "resolveFarmNavi
|
|
|
23
31
|
|
|
24
32
|
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
|
|
35
|
+
exports.isFarmBlockedNavigationURL = isFarmBlockedNavigationURL; exports.isFarmScriptURL = isFarmScriptURL; exports.isFarmExternalNavigationURL = isFarmExternalNavigationURL; exports.resolveFarmNavigationURL = resolveFarmNavigationURL;
|
|
@@ -7,13 +7,14 @@ var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkZXH4TS3Fcjs = require('./chunk-ZXH4TS3F.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
var _chunk4GWRFP22cjs = require('./chunk-4GWRFP22.cjs');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
|
|
@@ -40,7 +41,7 @@ var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
|
40
41
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
41
42
|
|
|
42
43
|
|
|
43
|
-
var
|
|
44
|
+
var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -56,7 +57,7 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
56
57
|
constructor(req, res) {
|
|
57
58
|
this.req = req;
|
|
58
59
|
this.res = res;
|
|
59
|
-
this.cookies =
|
|
60
|
+
this.cookies = _chunkZXH4TS3Fcjs.parseMiddlewareCookieHeader.call(void 0, req.headers.cookie);
|
|
60
61
|
const existing = res.getHeader("Set-Cookie");
|
|
61
62
|
this.setCookies = Array.isArray(existing) ? existing.map(String) : existing === void 0 ? [] : [String(existing)];
|
|
62
63
|
}
|
|
@@ -65,13 +66,13 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
65
66
|
}
|
|
66
67
|
set(name, value, options = {}) {
|
|
67
68
|
this.cookies[name] = value;
|
|
68
|
-
const cookieString =
|
|
69
|
+
const cookieString = _chunkZXH4TS3Fcjs.serializeMiddlewareCookie.call(void 0, name, value, options);
|
|
69
70
|
this.setCookies.push(cookieString);
|
|
70
71
|
this.res.setHeader("Set-Cookie", this.setCookies);
|
|
71
72
|
}
|
|
72
73
|
delete(name, options = {}) {
|
|
73
74
|
delete this.cookies[name];
|
|
74
|
-
this.setCookies.push(
|
|
75
|
+
this.setCookies.push(_chunkZXH4TS3Fcjs.serializeMiddlewareCookieDeletion.call(void 0, name, options));
|
|
75
76
|
this.res.setHeader("Set-Cookie", this.setCookies);
|
|
76
77
|
}
|
|
77
78
|
getAll() {
|
|
@@ -80,8 +81,8 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
80
81
|
};
|
|
81
82
|
_chunkS3JO3N4Hcjs.__name.call(void 0, _CookieJarImpl, "CookieJarImpl");
|
|
82
83
|
var CookieJarImpl = _CookieJarImpl;
|
|
83
|
-
function createContext(req, res, viteServer, parent, server) {
|
|
84
|
-
const url =
|
|
84
|
+
function createContext(req, res, viteServer, parent, server, toRoutePathname) {
|
|
85
|
+
const url = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([server, 'optionalAccess', _ => _.trustProxy]) });
|
|
85
86
|
const headers = /* @__PURE__ */ new Map();
|
|
86
87
|
const data = _optionalChain([parent, 'optionalAccess', _2 => _2.data]) ? new Map(parent.data) : /* @__PURE__ */ new Map();
|
|
87
88
|
const locals = _optionalChain([parent, 'optionalAccess', _3 => _3.locals]) ? new Map(parent.locals) : /* @__PURE__ */ new Map();
|
|
@@ -105,6 +106,7 @@ function createContext(req, res, viteServer, parent, server) {
|
|
|
105
106
|
response: res,
|
|
106
107
|
url,
|
|
107
108
|
pathname: url.pathname,
|
|
109
|
+
routePathname: _chunk4GWRFP22cjs.toMiddlewareRoutePathname.call(void 0, url.pathname, toRoutePathname),
|
|
108
110
|
searchParams: url.searchParams,
|
|
109
111
|
method: req.method || "GET",
|
|
110
112
|
params: {},
|
|
@@ -140,6 +142,7 @@ function createContext(req, res, viteServer, parent, server) {
|
|
|
140
142
|
const newUrl = new URL(rewriteUrl, ctx.url);
|
|
141
143
|
ctx.url = newUrl;
|
|
142
144
|
ctx.pathname = newUrl.pathname;
|
|
145
|
+
ctx.routePathname = _chunk4GWRFP22cjs.toMiddlewareRoutePathname.call(void 0, newUrl.pathname, toRoutePathname);
|
|
143
146
|
ctx.searchParams = newUrl.searchParams;
|
|
144
147
|
ctx.route = newUrl.pathname;
|
|
145
148
|
req.url = rewriteUrl;
|
|
@@ -246,7 +249,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
246
249
|
for (const [index, entry] of entries.entries()) {
|
|
247
250
|
const handlers = this.getConfigHandlers(entry);
|
|
248
251
|
const middlewareConfig = this.toMiddlewareConfig(entry);
|
|
249
|
-
|
|
252
|
+
_chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, middlewareConfig);
|
|
250
253
|
if (handlers.length === 0) {
|
|
251
254
|
this.globalConfig = middlewareConfig;
|
|
252
255
|
continue;
|
|
@@ -269,7 +272,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
269
272
|
const discovered = [];
|
|
270
273
|
await this.discoverInDirectory(appDir, "/", "", discovered);
|
|
271
274
|
for (const entry of discovered) {
|
|
272
|
-
|
|
275
|
+
_chunk4GWRFP22cjs.compileMiddlewareRoute.call(void 0, entry.middleware);
|
|
273
276
|
middlewareByDirectory.set(entry.location.directory, entry);
|
|
274
277
|
}
|
|
275
278
|
}
|
|
@@ -334,12 +337,12 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
334
337
|
_chunkSHLXACIOcjs.toFileModuleUrl.call(void 0, filePath)
|
|
335
338
|
);
|
|
336
339
|
}
|
|
337
|
-
const normalized =
|
|
340
|
+
const normalized = _chunkZXH4TS3Fcjs.normalizeMiddlewareModule.call(void 0, module, routePath);
|
|
338
341
|
if (!normalized) {
|
|
339
342
|
throw new Error("must export a default handler or a named middleware handler");
|
|
340
343
|
}
|
|
341
344
|
if (normalized.config) {
|
|
342
|
-
|
|
345
|
+
_chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, normalized.config);
|
|
343
346
|
}
|
|
344
347
|
return {
|
|
345
348
|
path: routePath,
|
|
@@ -356,7 +359,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
356
359
|
* Execute middleware for a request
|
|
357
360
|
*/
|
|
358
361
|
async execute(req, res) {
|
|
359
|
-
const url =
|
|
362
|
+
const url = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _6 => _6.server, 'optionalAccess', _7 => _7.trustProxy]) });
|
|
360
363
|
const pathname = url.pathname;
|
|
361
364
|
const toRoutePathname = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => _optionalChain([this, 'access', _8 => _8.i18n, 'optionalAccess', _9 => _9.enabled]) ? _chunkBIDYX3SLcjs.stripFarmLocaleFromPathname.call(void 0, value, this.i18n) : _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, value, _nullishCoalesce(_optionalChain([this, 'access', _10 => _10.i18n, 'optionalAccess', _11 => _11.basePath]), () => ( "/"))), "toRoutePathname");
|
|
362
365
|
const routePathname = toRoutePathname(pathname);
|
|
@@ -364,7 +367,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
364
367
|
const method = req.method || "GET";
|
|
365
368
|
const startTime = Date.now();
|
|
366
369
|
let parentData;
|
|
367
|
-
let ctx = createContext(req, res, this.viteServer, void 0, this.server);
|
|
370
|
+
let ctx = createContext(req, res, this.viteServer, void 0, this.server, toRoutePathname);
|
|
368
371
|
if (this.globalConfig) {
|
|
369
372
|
const globalMatch = this.matchesConfig(routePathname, this.globalConfig, ctx);
|
|
370
373
|
if (!globalMatch.matched) {
|
|
@@ -378,7 +381,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
378
381
|
...this.configMiddleware.map((mw) => ({ mw, routeMatch: { matched: true } })),
|
|
379
382
|
...this.middleware.map((mw) => ({
|
|
380
383
|
mw,
|
|
381
|
-
routeMatch:
|
|
384
|
+
routeMatch: _chunk4GWRFP22cjs.matchesMiddlewareRouteAt.call(void 0, toMiddlewarePathnames(routePathname), mw)
|
|
382
385
|
})).filter((entry) => entry.routeMatch.matched)
|
|
383
386
|
];
|
|
384
387
|
if (applicable.length === 0) {
|
|
@@ -404,17 +407,17 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
404
407
|
for (; ; ) {
|
|
405
408
|
for (const entry of pass) yield { ...entry, pathname: passPathname };
|
|
406
409
|
const rewrittenPathname = toRoutePathname(
|
|
407
|
-
|
|
410
|
+
_chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy }).pathname
|
|
408
411
|
);
|
|
409
412
|
if (rewrittenPathname === passPathname) return;
|
|
410
413
|
passPathname = rewrittenPathname;
|
|
411
414
|
const passPathnames = toMiddlewarePathnames(passPathname);
|
|
412
|
-
if (globalConfig && !
|
|
415
|
+
if (globalConfig && !_chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0, passPathnames, globalConfig, ctx).matched) {
|
|
413
416
|
return;
|
|
414
417
|
}
|
|
415
418
|
pass = allMiddleware.filter((mw) => !ran.has(mw)).map((mw) => ({
|
|
416
419
|
mw,
|
|
417
|
-
routeMatch: mw.source === "config" ? { matched: true } :
|
|
420
|
+
routeMatch: mw.source === "config" ? { matched: true } : _chunk4GWRFP22cjs.matchesMiddlewareRouteAt.call(void 0, passPathnames, mw)
|
|
418
421
|
})).filter((entry) => entry.routeMatch.matched);
|
|
419
422
|
}
|
|
420
423
|
}
|
|
@@ -432,7 +435,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
432
435
|
ctx.params = { ...ctx.params, ...configMatch.params };
|
|
433
436
|
}
|
|
434
437
|
if (parentData) {
|
|
435
|
-
ctx = createContext(req, res, this.viteServer, parentData, this.server);
|
|
438
|
+
ctx = createContext(req, res, this.viteServer, parentData, this.server, toRoutePathname);
|
|
436
439
|
if (routeMatch.params) {
|
|
437
440
|
ctx.params = { ...ctx.params, ...routeMatch.params };
|
|
438
441
|
}
|
|
@@ -525,7 +528,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
525
528
|
* Check if pathname matches middleware config
|
|
526
529
|
*/
|
|
527
530
|
matchesConfig(pathname, config, ctx) {
|
|
528
|
-
return
|
|
531
|
+
return _chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0, this.toMiddlewarePathnames(pathname), config, ctx);
|
|
529
532
|
}
|
|
530
533
|
/**
|
|
531
534
|
* Reload middleware (for HMR)
|