@farm.js/core 0.1.31 → 0.1.34
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/README.md +1 -1
- package/dist/agent-runtime.cjs +69 -14
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +58 -3
- package/dist/api/route-manager.cjs +16 -13
- package/dist/api/route-manager.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/route-manager.mjs +15 -12
- package/dist/api/runtime.cjs +9 -7
- package/dist/api/runtime.d.mts +1 -1
- package/dist/api/runtime.d.ts +1 -1
- package/dist/api/runtime.mjs +8 -6
- package/dist/api.cjs +19 -16
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.mjs +18 -15
- package/dist/{app-sUJ3jnTZ.d.ts → app-DgotYGbq.d.ts} +3 -3
- package/dist/app-markdown.cjs +8 -6
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +7 -5
- package/dist/{app-DAuUTIZf.d.mts → app-q4rmZlXK.d.mts} +3 -3
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +10 -1
- package/dist/cache.d.ts +10 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-YZTASLPQ.cjs → chunk-27ZWSI3W.cjs} +2 -2
- package/dist/{chunk-WBIH66JK.mjs → chunk-2ELDTQRN.mjs} +5 -2
- package/dist/{chunk-K7CELQLK.cjs → chunk-2F2ER724.cjs} +54 -29
- package/dist/{chunk-NRVGEI5I.mjs → chunk-2NNMOPDN.mjs} +4 -210
- package/dist/chunk-2NQQ5H5G.cjs +86 -0
- package/dist/{chunk-IFI5FXEZ.cjs → chunk-36MK5YCW.cjs} +334 -163
- package/dist/chunk-3BU22U3M.cjs +237 -0
- package/dist/{chunk-MM5D6VLP.mjs → chunk-3KZS4SUS.mjs} +33 -14
- package/dist/chunk-3SDFA7UF.cjs +701 -0
- package/dist/{chunk-4IEPYMHF.mjs → chunk-3UEVPCGW.mjs} +1 -1
- package/dist/{chunk-5LJCOSKT.mjs → chunk-3VSKDFAT.mjs} +1 -1
- package/dist/{chunk-5HGR3W6O.mjs → chunk-5SJWVY6R.mjs} +8 -0
- package/dist/{chunk-X7WVQMIB.mjs → chunk-657WJNRY.mjs} +10 -4
- package/dist/{chunk-MKMBQSNQ.mjs → chunk-6VVL3MHY.mjs} +3 -3
- package/dist/{chunk-QZRVZSPN.cjs → chunk-77GNHH2Z.cjs} +3 -3
- package/dist/{chunk-KZLND3D2.cjs → chunk-7BT4H4P7.cjs} +7 -5
- package/dist/{chunk-A777V5WU.cjs → chunk-7M52YUMY.cjs} +2 -2
- package/dist/{chunk-VUMAE7NC.mjs → chunk-7Y6ZNFPX.mjs} +81 -30
- package/dist/{chunk-MXDTKXO6.cjs → chunk-A5FGU2WU.cjs} +74 -23
- package/dist/{chunk-7QOCTYBS.mjs → chunk-AGC75XAE.mjs} +37 -1
- package/dist/{chunk-4ZQQL4IU.mjs → chunk-AHGECQEW.mjs} +1 -1
- package/dist/{chunk-RG3ZOTG5.cjs → chunk-AI7QMY7O.cjs} +10 -3
- package/dist/{chunk-O3DTUAX2.mjs → chunk-AQZFOP7S.mjs} +6 -77
- package/dist/{chunk-WNLBF77X.cjs → chunk-ATK2R4CH.cjs} +14 -12
- package/dist/{chunk-SORB3MAR.cjs → chunk-AWC4VUZL.cjs} +17 -17
- package/dist/{chunk-YMCXWPWK.mjs → chunk-BCMSYSN2.mjs} +4 -1
- package/dist/{chunk-FYRBX5IY.cjs → chunk-BTAG7LI7.cjs} +2 -2
- package/dist/{chunk-I6XDAKWQ.mjs → chunk-BTHHUD7Q.mjs} +14 -0
- package/dist/chunk-C4SPBWFM.cjs +26 -0
- package/dist/{chunk-JATSG2ZO.mjs → chunk-CLJYVZAD.mjs} +4 -2
- package/dist/{chunk-J3LOGE4T.cjs → chunk-DQQOKWYA.cjs} +5 -5
- package/dist/{chunk-JLRDISQL.cjs → chunk-DZ4DTRJ5.cjs} +7 -7
- package/dist/chunk-E5GNDG5F.mjs +701 -0
- package/dist/{chunk-E76XC6ZG.mjs → chunk-EZDQRNQ7.mjs} +2 -2
- package/dist/{chunk-TOVMYGYW.mjs → chunk-F2SE2VDO.mjs} +1 -1
- package/dist/{chunk-BSPQVJ4A.mjs → chunk-FDR64H6B.mjs} +13 -0
- package/dist/{chunk-5OVTOKGH.cjs → chunk-FFFW3OQ7.cjs} +2 -2
- package/dist/{chunk-D4JE5NNV.cjs → chunk-FNO7A7CM.cjs} +5 -5
- package/dist/chunk-FZ6YYU2W.mjs +65 -0
- package/dist/{chunk-PZNCMPJF.cjs → chunk-G26MUMKL.cjs} +14 -8
- package/dist/{chunk-IXUY2F5U.mjs → chunk-GCXWJJKH.mjs} +4 -7
- package/dist/{chunk-JLCQGPXE.mjs → chunk-GNSDTTWZ.mjs} +50 -61
- package/dist/{chunk-TEN4FIZU.mjs → chunk-GOABMOX3.mjs} +151 -3
- package/dist/{chunk-HBTUGXHS.cjs → chunk-HLJ6MBUZ.cjs} +7 -4
- package/dist/{chunk-GZYH4OER.mjs → chunk-HR5KPHC2.mjs} +1 -1
- package/dist/{chunk-ZCU4NZ3M.cjs → chunk-IE7XCHH3.cjs} +4 -4
- package/dist/{chunk-I26CZYPV.cjs → chunk-IHNIDL6H.cjs} +50 -7
- package/dist/{chunk-2FQHH5SC.mjs → chunk-IHNMMXHV.mjs} +49 -24
- package/dist/{chunk-VHJGDMCG.cjs → chunk-IWZKTWHZ.cjs} +2 -2
- package/dist/{chunk-DGXN3L4D.mjs → chunk-JDPAKVS4.mjs} +4 -4
- package/dist/chunk-JG6DJF5A.mjs +238 -0
- package/dist/{chunk-5TISYEQF.mjs → chunk-JM5XPKWH.mjs} +10 -3
- package/dist/{chunk-BJJATPEC.mjs → chunk-KN7K4VQN.mjs} +1 -1
- package/dist/{chunk-WPYFSQKK.cjs → chunk-KNBBQHO2.cjs} +15 -1
- package/dist/{chunk-XWAWFQFS.cjs → chunk-KXWRO25S.cjs} +7 -4
- package/dist/{chunk-QG5HNS7P.mjs → chunk-LHODW25H.mjs} +2 -2
- package/dist/{chunk-BXFWA23T.mjs → chunk-LMJ7VRHZ.mjs} +3 -3
- package/dist/{chunk-WG2KHOMN.mjs → chunk-LR5QSC2P.mjs} +380 -209
- package/dist/chunk-LSKZMJMP.cjs +65 -0
- package/dist/{chunk-2N5PX3LS.mjs → chunk-LYV44OIR.mjs} +7 -1
- package/dist/{chunk-5MKEDGLD.cjs → chunk-M64YUMA4.cjs} +11 -6
- package/dist/{chunk-EXLKRR4U.cjs → chunk-MIDIZJZC.cjs} +12 -12
- package/dist/{chunk-ES4B2IXW.cjs → chunk-MOKLYNHV.cjs} +2 -2
- package/dist/{chunk-IV6CQY7O.mjs → chunk-MSSFIQGM.mjs} +63 -13
- package/dist/{chunk-KH7BN726.cjs → chunk-N4UOK6ZI.cjs} +8 -2
- package/dist/{chunk-6VYZOPOT.mjs → chunk-NGVORZVZ.mjs} +1 -1
- package/dist/{chunk-JNGIWIY6.mjs → chunk-NPC7VWJE.mjs} +2 -2
- package/dist/{chunk-ILWLPEVO.mjs → chunk-NRSN7G7E.mjs} +2 -2
- package/dist/{chunk-AHAJGAYD.mjs → chunk-O27L4YAA.mjs} +1 -1
- package/dist/{chunk-VYZSOYR4.cjs → chunk-ODBZYBAB.cjs} +1 -1
- package/dist/{chunk-YVGAEAA5.cjs → chunk-P64MIF5B.cjs} +154 -6
- package/dist/{chunk-DFLLARUK.cjs → chunk-PQDFUSXD.cjs} +14 -14
- package/dist/{chunk-F6XEGFHO.mjs → chunk-PXKIEXZD.mjs} +10 -0
- package/dist/{chunk-S5GDHOE4.mjs → chunk-PZNL3WEG.mjs} +48 -5
- package/dist/{chunk-FV45CKBC.mjs → chunk-QCFBDFRS.mjs} +1 -1
- package/dist/{chunk-75BRBIFP.cjs → chunk-QCVE2OCI.cjs} +5 -8
- package/dist/{chunk-6ZCMSZ5U.mjs → chunk-QE6VAKLT.mjs} +1 -1
- package/dist/{chunk-75DYEVXI.cjs → chunk-QGYRXFU2.cjs} +9 -9
- package/dist/{chunk-CTV2TTNP.cjs → chunk-QJ3J6MZT.cjs} +16 -87
- package/dist/{chunk-O6XNAMBV.mjs → chunk-QLQ32WC4.mjs} +8 -3
- package/dist/{chunk-IMB4PIAR.cjs → chunk-SJVKK4JE.cjs} +839 -420
- package/dist/{chunk-3FCFQP5V.cjs → chunk-TA5G2HWD.cjs} +21 -21
- package/dist/{chunk-Z5HIWVDP.cjs → chunk-TDFPACVX.cjs} +62 -73
- package/dist/{chunk-ND224OE2.cjs → chunk-TKSCR644.cjs} +34 -15
- package/dist/{chunk-UAFSBWNT.mjs → chunk-U4PTAHW3.mjs} +64 -13
- package/dist/{chunk-ZHVYQL3H.cjs → chunk-U74I55WB.cjs} +86 -35
- package/dist/chunk-UBO4SGH4.mjs +86 -0
- package/dist/{chunk-IQXFRNY2.cjs → chunk-UFDAAQFX.cjs} +2 -2
- package/dist/{chunk-X7KZBF63.cjs → chunk-UX5S4JEO.cjs} +40 -4
- package/dist/{chunk-5ZSWG4UX.cjs → chunk-UXFQ3UDA.cjs} +14 -1
- package/dist/{chunk-L4DVIHOC.mjs → chunk-VCCUOMQN.mjs} +1 -1
- package/dist/{chunk-4V7GIE2U.mjs → chunk-VHANUNEG.mjs} +2 -2
- package/dist/{chunk-FXUUWYAX.cjs → chunk-VKNHTSAP.cjs} +10 -0
- package/dist/{chunk-2AKFKCHA.mjs → chunk-W7LF2J2S.mjs} +1 -1
- package/dist/{chunk-MNUGPHLN.mjs → chunk-WNNYOOIB.mjs} +5 -3
- package/dist/{chunk-VA62MHFV.mjs → chunk-X242HVD5.mjs} +1 -1
- package/dist/{chunk-UJ2C4ICS.cjs → chunk-XJXBIP67.cjs} +4 -4
- package/dist/{chunk-6L6DQR5W.mjs → chunk-XV5DJTBX.mjs} +539 -121
- package/dist/{chunk-KJ2TIHZZ.cjs → chunk-XXJU7FCC.cjs} +3 -2
- package/dist/{chunk-DYEJQTDN.cjs → chunk-YSCV4SJF.cjs} +4 -4
- package/dist/{chunk-2SDO73HK.cjs → chunk-YWN746US.cjs} +64 -14
- package/dist/chunk-Z2HLU4IX.cjs +238 -0
- package/dist/{chunk-2FXWWUE5.cjs → chunk-Z2YLTERK.cjs} +4 -4
- package/dist/{chunk-CUMINO7Z.cjs → chunk-ZHPHJPQP.cjs} +4 -4
- package/dist/{chunk-FJZ3DQLK.mjs → chunk-ZKP7C2B6.mjs} +4 -4
- package/dist/{chunk-JBC2FKRW.mjs → chunk-ZUSJDQ2Q.mjs} +2 -1
- package/dist/{client-plugins-BX2ptm4H.d.mts → client-plugins-CLObcuCq.d.mts} +26 -2
- package/dist/{client-plugins-BmxM5KW_.d.ts → client-plugins-DZjHC4Mi.d.ts} +26 -2
- 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-EWRDHCD5.cjs → devtools-HU6Y2MNV.cjs} +11 -9
- package/dist/{devtools-BPBCYOU6.mjs → devtools-RNXCTS4R.mjs} +10 -8
- package/dist/docs.cjs +13 -11
- package/dist/docs.d.mts +5 -0
- package/dist/docs.d.ts +5 -0
- package/dist/docs.mjs +12 -10
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.mjs +1 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +14 -13
- package/dist/i18n/client.mjs +5 -4
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +67 -55
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +70 -58
- package/dist/integrations.cjs +6 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +7 -4
- package/dist/internal/app-markdown-runtime.cjs +7 -5
- package/dist/internal/app-markdown-runtime.d.mts +14 -3
- package/dist/internal/app-markdown-runtime.d.ts +14 -3
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +38 -35
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +37 -34
- package/dist/internal/cli-runtime.cjs +20 -17
- package/dist/internal/cli-runtime.mjs +19 -16
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +4 -2
- package/dist/internal/client-runtime.d.mts +9 -1
- package/dist/internal/client-runtime.d.ts +9 -1
- package/dist/internal/client-runtime.mjs +3 -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 +11 -9
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +10 -8
- package/dist/internal/infra-analytics-runtime.cjs +4 -4
- package/dist/internal/infra-analytics-runtime.mjs +2 -2
- 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 -14
- package/dist/internal/production-runtime.d.mts +115 -8
- package/dist/internal/production-runtime.d.ts +115 -8
- package/dist/internal/production-runtime.mjs +19 -13
- package/dist/internal/request-cookies.cjs +4 -2
- package/dist/internal/request-cookies.d.mts +9 -1
- package/dist/internal/request-cookies.d.ts +9 -1
- package/dist/internal/request-cookies.mjs +3 -1
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +3 -3
- package/dist/{metadata-DsEaK7mQ.d.mts → metadata-2HSU2i_w.d.mts} +1 -1
- package/dist/{metadata-fwZ3gfG6.d.ts → metadata-Cjs8JMRM.d.ts} +1 -1
- package/dist/middleware.cjs +18 -8
- package/dist/middleware.d.mts +24 -5
- package/dist/middleware.d.ts +24 -5
- package/dist/middleware.mjs +18 -8
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-NAKCRVHX.mjs → nitro-4XGPNIK4.mjs} +3 -3
- package/dist/{nitro-VYDZGYFY.cjs → nitro-HSAQFXSS.cjs} +4 -4
- package/dist/plugin.cjs +33 -30
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +32 -29
- package/dist/{production-runtime-DNkpFnmg.d.ts → production-runtime-BU5ETAK9.d.ts} +8 -1
- package/dist/{production-runtime-Baqgwtvc.d.mts → production-runtime-CysZl3EV.d.mts} +8 -1
- package/dist/query/client.cjs +7 -7
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-DhwQnmmX.d.mts → render-plan-CKr4ltOd.d.mts} +1 -1
- package/dist/{render-plan-rkIK9wd9.d.ts → render-plan-D72O1qm4.d.ts} +1 -1
- package/dist/renderer-client.cjs +39 -19
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +28 -8
- package/dist/{request-CFy1BltJ.d.mts → request-Be83WafN.d.mts} +7 -2
- package/dist/{request-BcY4RYPC.d.ts → request-DbyOYI2j.d.ts} +7 -2
- package/dist/request.cjs +2 -2
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering-BkS0TBlB.d.mts → route-rendering-BG56SzvJ.d.mts} +1 -1
- package/dist/{route-rendering-D4XpMjam.d.ts → route-rendering-CtVMpV-k.d.ts} +1 -1
- package/dist/{router-C4zPlC3V.d.mts → router-ALUvm8gC.d.mts} +1 -1
- package/dist/{router-Cq7BcZxg.d.ts → router-D94-SDlW.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +2 -2
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.cjs +3 -3
- package/dist/server-query-client.mjs +2 -2
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +60 -57
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +37 -34
- package/dist/{spa-router-B1HI3X9k.d.ts → spa-router-CxK3USIz.d.ts} +2 -2
- package/dist/{spa-router-DzPZH-AO.d.mts → spa-router-DbxNRKOB.d.mts} +2 -2
- package/dist/testing.cjs +19 -17
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +16 -14
- package/dist/theme/server.cjs +4 -3
- package/dist/theme/server.mjs +3 -2
- package/dist/{utils-DMD1Hzta.d.ts → utils-311Y8eoK.d.ts} +1 -1
- package/dist/{utils-CEBktlBG.d.mts → utils-4wVRcpOw.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +33 -30
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +32 -29
- package/package.json +2 -2
- package/dist/chunk-22GUSVNJ.cjs +0 -351
- package/dist/chunk-SWN467MP.cjs +0 -18
- package/dist/chunk-XGC343EY.cjs +0 -443
- package/dist/chunk-ZSH2Y4LN.mjs +0 -351
- /package/dist/{chunk-SUIBNSNO.cjs → chunk-SJNMVDDF.cjs} +0 -0
- /package/dist/{chunk-LNZ7JZUS.mjs → chunk-UDNPLXW7.mjs} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkZHPHJPQPcjs = require('./chunk-ZHPHJPQP.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
@@ -15,8 +15,14 @@ var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
|
15
15
|
var _chunkTKJZFIMLcjs = require('./chunk-TKJZFIML.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
var _chunkM64YUMA4cjs = require('./chunk-M64YUMA4.cjs');
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunkODBZYBABcjs = require('./chunk-ODBZYBAB.cjs');
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -210,7 +216,7 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
|
|
|
210
216
|
if (isResponse(value)) {
|
|
211
217
|
return method === "HEAD" ? _chunkTKJZFIMLcjs.omitFarmResponseBody.call(void 0, value) : value;
|
|
212
218
|
}
|
|
213
|
-
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ?
|
|
219
|
+
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunkZHPHJPQPcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
|
|
214
220
|
const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
|
|
215
221
|
return new Response(method === "HEAD" ? null : body, {
|
|
216
222
|
headers: {
|
|
@@ -462,9 +468,9 @@ function resolveFarmApiCatalogInput(config) {
|
|
|
462
468
|
basePath: config.basePath,
|
|
463
469
|
apiBaseURL: _nullishCoalesce(_optionalChain([config, 'access', _5 => _5.openapi, 'optionalAccess', _6 => _6.servers, 'optionalAccess', _7 => _7[0], 'optionalAccess', _8 => _8.url]), () => ( config.api.baseURL)),
|
|
464
470
|
openapi: _optionalChain([config, 'access', _9 => _9.openapi, 'optionalAccess', _10 => _10.enabled]) ? { specRoute: config.openapi.specRoute, route: config.openapi.route } : void 0,
|
|
465
|
-
mcpPath: mcp ?
|
|
471
|
+
mcpPath: mcp ? _chunkKNBBQHO2cjs.resolveFarmAPIServerRoutePath.call(void 0,
|
|
466
472
|
_nullishCoalesce(mcp.path, () => ( "/api/mcp")),
|
|
467
|
-
|
|
473
|
+
_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
468
474
|
) : void 0
|
|
469
475
|
};
|
|
470
476
|
}
|
|
@@ -514,6 +520,148 @@ function createFarmApiCatalogResponse(method, input, request) {
|
|
|
514
520
|
}
|
|
515
521
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmApiCatalogResponse, "createFarmApiCatalogResponse");
|
|
516
522
|
|
|
523
|
+
// src/app-manifest.ts
|
|
524
|
+
var FARM_APP_MANIFEST_PATH = "/.well-known/farmjs";
|
|
525
|
+
var FARM_INFRA_SIGNATURE_HEADER = "farmjs-infra-signature";
|
|
526
|
+
var SIGNED_PURPOSE = "farmjs-manifest-v1";
|
|
527
|
+
var SIGNATURE_WINDOW_SECONDS = 300;
|
|
528
|
+
function resolveFarmAppManifestInput(config, extra) {
|
|
529
|
+
const llms = _optionalChain([config, 'access', _15 => _15.agent, 'optionalAccess', _16 => _16.llmsTxt]);
|
|
530
|
+
const plugins = (_nullishCoalesce(config.plugins, () => ( []))).map(({ name }) => name);
|
|
531
|
+
const webmcp = plugins.includes("farm:webmcp");
|
|
532
|
+
return {
|
|
533
|
+
renderer: _nullishCoalesce(_optionalChain([config, 'access', _17 => _17.renderer, 'optionalAccess', _18 => _18.name]), () => ( "react")),
|
|
534
|
+
basePath: config.basePath || "/",
|
|
535
|
+
build: extra.build,
|
|
536
|
+
packages: extra.packages,
|
|
537
|
+
webmcp: { enabled: webmcp, tools: webmcp ? _nullishCoalesce(extra.webmcpTools, () => ( [])) : [] },
|
|
538
|
+
integrations: Object.entries(_nullishCoalesce(config.integrations, () => ( {}))).flatMap(([key, integration]) => {
|
|
539
|
+
const category = _nullishCoalesce(_optionalChain([integration, 'optionalAccess', _19 => _19.category]), () => ( _optionalChain([integration, 'optionalAccess', _20 => _20.slot])));
|
|
540
|
+
return integration && category && integration.type ? [{ key, category, type: integration.type }] : [];
|
|
541
|
+
}),
|
|
542
|
+
agent: {
|
|
543
|
+
apiCatalog: _optionalChain([config, 'access', _21 => _21.agent, 'optionalAccess', _22 => _22.apiCatalog]) ? "/.well-known/api-catalog" : null,
|
|
544
|
+
llmsTxt: llms === true || typeof llms === "object" && llms !== null && llms.enabled !== false,
|
|
545
|
+
openapi: _optionalChain([config, 'access', _23 => _23.openapi, 'optionalAccess', _24 => _24.enabled]) && config.openapi.specRoute ? config.openapi.specRoute : null
|
|
546
|
+
},
|
|
547
|
+
plugins,
|
|
548
|
+
analytics: config.analytics !== false
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppManifestInput, "resolveFarmAppManifestInput");
|
|
552
|
+
var SOURCES = {
|
|
553
|
+
endpoint: "endpoint",
|
|
554
|
+
standalone: "defineTool",
|
|
555
|
+
serverFunction: "serverFunction"
|
|
556
|
+
};
|
|
557
|
+
function createFarmAppManifest(input) {
|
|
558
|
+
return {
|
|
559
|
+
schemaVersion: 1,
|
|
560
|
+
app: {
|
|
561
|
+
farm: _chunkODBZYBABcjs.FARM_VERSION,
|
|
562
|
+
renderer: input.renderer,
|
|
563
|
+
basePath: input.basePath,
|
|
564
|
+
build: input.build
|
|
565
|
+
},
|
|
566
|
+
packages: input.packages,
|
|
567
|
+
mcp: {
|
|
568
|
+
servers: _chunkM64YUMA4cjs._listFarmMCPCatalogs.call(void 0, ).map(({ server, tools, details }) => ({
|
|
569
|
+
name: server.name,
|
|
570
|
+
version: server.version,
|
|
571
|
+
path: server.path,
|
|
572
|
+
resources: [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _25 => _25.resources]), () => ( []))],
|
|
573
|
+
prompts: [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _26 => _26.prompts]), () => ( []))],
|
|
574
|
+
tools: tools.map((tool) => {
|
|
575
|
+
const schemas = _optionalChain([details, 'optionalAccess', _27 => _27.schemas, 'optionalAccess', _28 => _28[tool.name]]);
|
|
576
|
+
const hints = Object.fromEntries(
|
|
577
|
+
["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"].filter((hint) => typeof tool[hint] === "boolean").map((hint) => [hint, tool[hint]])
|
|
578
|
+
);
|
|
579
|
+
return {
|
|
580
|
+
name: tool.name,
|
|
581
|
+
...tool.title ? { title: tool.title } : {},
|
|
582
|
+
...tool.description ? { description: tool.description } : {},
|
|
583
|
+
source: SOURCES[tool.kind],
|
|
584
|
+
...tool.kind === "endpoint" ? { method: tool.method, path: tool.path } : {},
|
|
585
|
+
...hints,
|
|
586
|
+
...schemas ? { inputSchema: schemas.input } : {},
|
|
587
|
+
..._optionalChain([schemas, 'optionalAccess', _29 => _29.output]) ? { outputSchema: schemas.output } : {}
|
|
588
|
+
};
|
|
589
|
+
})
|
|
590
|
+
}))
|
|
591
|
+
},
|
|
592
|
+
webmcp: input.webmcp,
|
|
593
|
+
integrations: input.integrations,
|
|
594
|
+
agent: input.agent,
|
|
595
|
+
plugins: input.plugins
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmAppManifest, "createFarmAppManifest");
|
|
599
|
+
var encoder = new TextEncoder();
|
|
600
|
+
var hex = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (bytes) => [...new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join(""), "hex");
|
|
601
|
+
async function sha256Hex(value) {
|
|
602
|
+
return hex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
|
|
603
|
+
}
|
|
604
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, sha256Hex, "sha256Hex");
|
|
605
|
+
async function hmacHex(secret, message) {
|
|
606
|
+
const key = await crypto.subtle.importKey(
|
|
607
|
+
"raw",
|
|
608
|
+
encoder.encode(secret),
|
|
609
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
610
|
+
false,
|
|
611
|
+
["sign"]
|
|
612
|
+
);
|
|
613
|
+
return hex(await crypto.subtle.sign("HMAC", key, encoder.encode(message)));
|
|
614
|
+
}
|
|
615
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, hmacHex, "hmacHex");
|
|
616
|
+
function sameHex(a, b) {
|
|
617
|
+
if (a.length !== b.length) return false;
|
|
618
|
+
let difference = 0;
|
|
619
|
+
for (let index = 0; index < a.length; index++)
|
|
620
|
+
difference |= a.charCodeAt(index) ^ b.charCodeAt(index);
|
|
621
|
+
return difference === 0;
|
|
622
|
+
}
|
|
623
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, sameHex, "sameHex");
|
|
624
|
+
async function verifyFarmInfraManifestSignature(header, key, now = Date.now()) {
|
|
625
|
+
if (!header || header.length > 2048) return false;
|
|
626
|
+
const parts = header.split(",").map((part) => part.trim());
|
|
627
|
+
const timestamp = Number(
|
|
628
|
+
_optionalChain([/^t=(\d{1,12})$/, 'access', _30 => _30.exec, 'call', _31 => _31(_nullishCoalesce(parts.find((part) => part.startsWith("t=")), () => ( ""))), 'optionalAccess', _32 => _32[1]])
|
|
629
|
+
);
|
|
630
|
+
if (!Number.isSafeInteger(timestamp)) return false;
|
|
631
|
+
if (Math.abs(now / 1e3 - timestamp) > SIGNATURE_WINDOW_SECONDS) return false;
|
|
632
|
+
const signatures = parts.filter((part) => part.startsWith("v1=")).map((part) => part.slice(3)).filter((value) => /^[0-9a-f]{64}$/.test(value));
|
|
633
|
+
if (!signatures.length || signatures.length > 8) return false;
|
|
634
|
+
const expected = await hmacHex(await sha256Hex(key), `${SIGNED_PURPOSE}
|
|
635
|
+
${timestamp}`);
|
|
636
|
+
return signatures.some((signature) => sameHex(signature, expected));
|
|
637
|
+
}
|
|
638
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, verifyFarmInfraManifestSignature, "verifyFarmInfraManifestSignature");
|
|
639
|
+
function processEnv() {
|
|
640
|
+
return _nullishCoalesce(_optionalChain([globalThis, 'access', _33 => _33.process, 'optionalAccess', _34 => _34.env]), () => ( {}));
|
|
641
|
+
}
|
|
642
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, processEnv, "processEnv");
|
|
643
|
+
async function createFarmAppManifestResponse(request, input, options) {
|
|
644
|
+
if (request.method !== "GET" && request.method !== "HEAD") return null;
|
|
645
|
+
if (!options.development) {
|
|
646
|
+
const key = _optionalChain([(_nullishCoalesce(options.env, () => ( processEnv()))), 'access', _35 => _35.FARMJS_API_KEY, 'optionalAccess', _36 => _36.trim, 'call', _37 => _37()]);
|
|
647
|
+
if (!input.analytics || !key) return null;
|
|
648
|
+
const signed = await verifyFarmInfraManifestSignature(
|
|
649
|
+
request.headers.get(FARM_INFRA_SIGNATURE_HEADER),
|
|
650
|
+
key
|
|
651
|
+
);
|
|
652
|
+
if (!signed)
|
|
653
|
+
return new Response(null, { status: 404, headers: { "cache-control": "no-store" } });
|
|
654
|
+
}
|
|
655
|
+
const body = JSON.stringify(createFarmAppManifest(input));
|
|
656
|
+
return new Response(request.method === "HEAD" ? null : body, {
|
|
657
|
+
headers: { "content-type": "application/json", "cache-control": "private, no-store" }
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmAppManifestResponse, "createFarmAppManifestResponse");
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
517
665
|
|
|
518
666
|
|
|
519
667
|
|
|
@@ -527,4 +675,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmApiCatalogResponse, "createFarmA
|
|
|
527
675
|
|
|
528
676
|
|
|
529
677
|
|
|
530
|
-
exports.renderFarmLocaleAlternateLinks = renderFarmLocaleAlternateLinks; exports.createLateRedirectRecovery = createLateRedirectRecovery; exports.createLateNotFoundRecovery = createLateNotFoundRecovery; exports.createFarmMetadataRouteResponse = createFarmMetadataRouteResponse; exports.resolveDefaultErrorStatus = resolveDefaultErrorStatus; exports.getDefaultErrorStatusText = getDefaultErrorStatusText; exports.createDefaultErrorMarkup = createDefaultErrorMarkup; exports.createFarmThemeDocumentParts = createFarmThemeDocumentParts; exports.applyFarmThemeDocument = applyFarmThemeDocument; exports.FARM_API_CATALOG_PATH = FARM_API_CATALOG_PATH; exports.resolveFarmApiCatalogInput = resolveFarmApiCatalogInput; exports.createFarmApiCatalogResponse = createFarmApiCatalogResponse;
|
|
678
|
+
exports.renderFarmLocaleAlternateLinks = renderFarmLocaleAlternateLinks; exports.createLateRedirectRecovery = createLateRedirectRecovery; exports.createLateNotFoundRecovery = createLateNotFoundRecovery; exports.createFarmMetadataRouteResponse = createFarmMetadataRouteResponse; exports.resolveDefaultErrorStatus = resolveDefaultErrorStatus; exports.getDefaultErrorStatusText = getDefaultErrorStatusText; exports.createDefaultErrorMarkup = createDefaultErrorMarkup; exports.createFarmThemeDocumentParts = createFarmThemeDocumentParts; exports.applyFarmThemeDocument = applyFarmThemeDocument; exports.FARM_API_CATALOG_PATH = FARM_API_CATALOG_PATH; exports.resolveFarmApiCatalogInput = resolveFarmApiCatalogInput; exports.createFarmApiCatalogResponse = createFarmApiCatalogResponse; exports.FARM_APP_MANIFEST_PATH = FARM_APP_MANIFEST_PATH; exports.resolveFarmAppManifestInput = resolveFarmAppManifestInput; exports.createFarmAppManifestResponse = createFarmAppManifestResponse;
|
|
@@ -29,7 +29,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkZHPHJPQPcjs = require('./chunk-ZHPHJPQP.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
|
|
@@ -48,7 +48,7 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
|
48
48
|
var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunkXXJU7FCCcjs = require('./chunk-XXJU7FCC.cjs');
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
|
|
@@ -60,13 +60,13 @@ var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
|
|
|
60
60
|
var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var
|
|
63
|
+
var _chunkTDFPACVXcjs = require('./chunk-TDFPACVX.cjs');
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
var _chunkEM6SBQKMcjs = require('./chunk-EM6SBQKM.cjs');
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
var
|
|
69
|
+
var _chunkHLJ6MBUZcjs = require('./chunk-HLJ6MBUZ.cjs');
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
@@ -135,11 +135,11 @@ function resolveFarmAgentConfig(input, context = {}) {
|
|
|
135
135
|
const jsonLd = _optionalChain([input, 'optionalAccess', _ => _.jsonLd]);
|
|
136
136
|
return {
|
|
137
137
|
jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
138
|
-
noindexPreviews:
|
|
138
|
+
noindexPreviews: _chunkZHPHJPQPcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
|
|
139
139
|
// The docs engine answers /llms.txt with its own pages; a default here would replace it.
|
|
140
140
|
// llms-full.txt renders every listed page, so it stays opt-in.
|
|
141
|
-
llmsTxt:
|
|
142
|
-
crawlers:
|
|
141
|
+
llmsTxt: _chunkZHPHJPQPcjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt]), () => ( (context.docs ? false : { full: false })))),
|
|
142
|
+
crawlers: _chunkZHPHJPQPcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _4 => _4.crawlers])),
|
|
143
143
|
apiCatalog: resolveFarmApiCatalogEnabled(_optionalChain([input, 'optionalAccess', _5 => _5.apiCatalog]))
|
|
144
144
|
};
|
|
145
145
|
}
|
|
@@ -688,9 +688,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
688
688
|
const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
|
|
689
689
|
const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
|
|
690
690
|
const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
|
|
691
|
-
const security =
|
|
692
|
-
const securityHeader =
|
|
693
|
-
if (
|
|
691
|
+
const security = _chunkZHPHJPQPcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
|
|
692
|
+
const securityHeader = _chunkZHPHJPQPcjs.getFarmSecurityHeader.call(void 0, security);
|
|
693
|
+
if (_chunkZHPHJPQPcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
|
|
694
694
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
695
695
|
"security.csp blocks the inline scripts Farm injects for theming and hydration. Set security.csp.nonce to true for managed dynamic nonces and prerendered hashes, or make the governing script directive allow 'unsafe-inline' without a nonce, hash, or 'strict-dynamic' source."
|
|
696
696
|
);
|
|
@@ -700,7 +700,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
700
700
|
const srcDir = userConfig.srcDir || "src";
|
|
701
701
|
_chunk6MVFL3R5cjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
|
|
702
702
|
const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
|
|
703
|
-
const md =
|
|
703
|
+
const md = _chunkXXJU7FCCcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
|
|
704
704
|
const mdx = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
|
|
705
705
|
const env = _chunkVEKFLAQMcjs.resolveEnv.call(void 0, userConfig.env, process.env);
|
|
706
706
|
_chunkVEKFLAQMcjs.setEnv.call(void 0, env);
|
|
@@ -776,7 +776,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
776
776
|
},
|
|
777
777
|
agent: resolveFarmAgentConfig(userConfig.agent, { docs: docs.enabled }),
|
|
778
778
|
plugins: [
|
|
779
|
-
...
|
|
779
|
+
..._chunkTDFPACVXcjs.resolveIntegrationPlugins.call(void 0, integrations),
|
|
780
780
|
...nativeMCPPlugin ? [nativeMCPPlugin] : [],
|
|
781
781
|
...userConfig.plugins || []
|
|
782
782
|
],
|
|
@@ -791,10 +791,10 @@ async function resolveConfig(userConfig, mode) {
|
|
|
791
791
|
], "headers"),
|
|
792
792
|
routeRules,
|
|
793
793
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
|
|
794
|
-
performance:
|
|
794
|
+
performance: _chunkZHPHJPQPcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
|
|
795
795
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
|
|
796
796
|
publicDir: userConfig.publicDir || "public",
|
|
797
|
-
i18n:
|
|
797
|
+
i18n: _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
|
|
798
798
|
openapi,
|
|
799
799
|
middleware: userConfig.middleware || {},
|
|
800
800
|
notFound: userConfig.notFound || {},
|
|
@@ -217,6 +217,7 @@ function parseIpv6Hextets(value) {
|
|
|
217
217
|
if (!octets) return null;
|
|
218
218
|
tail = [octets[0] << 8 | octets[1], octets[2] << 8 | octets[3]];
|
|
219
219
|
text = text.slice(0, lastColon);
|
|
220
|
+
if (text.endsWith(":")) text += ":";
|
|
220
221
|
if (text === "") return null;
|
|
221
222
|
}
|
|
222
223
|
const compressionParts = text.split("::");
|
|
@@ -264,6 +265,15 @@ function isPrivateImageAddress(address) {
|
|
|
264
265
|
if (embedsIpv4 && (h6 !== 0 || h7 !== 0)) {
|
|
265
266
|
return isPrivateIpv4([h6 >> 8, h6 & 255, h7 >> 8, h7 & 255]);
|
|
266
267
|
}
|
|
268
|
+
if (h0 === 100 && h1 === 65435) {
|
|
269
|
+
if (h2 === 1) return true;
|
|
270
|
+
if (h2 === 0 && h3 === 0 && h4 === 0 && h5 === 0) {
|
|
271
|
+
return isPrivateIpv4([h6 >> 8, h6 & 255, h7 >> 8, h7 & 255]);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (h0 === 8194) {
|
|
275
|
+
return isPrivateIpv4([h1 >> 8, h1 & 255, h2 >> 8, h2 & 255]);
|
|
276
|
+
}
|
|
267
277
|
if (zeroPrefix && h4 === 0 && h5 === 0 && h6 === 0 && (h7 === 0 || h7 === 1)) return true;
|
|
268
278
|
if ((h0 & 65024) === 64512) return true;
|
|
269
279
|
if ((h0 & 65472) === 65152) return true;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
createRouteDataCacheTag,
|
|
13
13
|
getFarmDataCache
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MSSFIQGM.mjs";
|
|
15
15
|
import {
|
|
16
16
|
createFarmCacheKey
|
|
17
17
|
} from "./chunk-CNOQY6Z7.mjs";
|
|
@@ -282,7 +282,7 @@ function createRouteModuleFromProgrammaticPage(route, rendererRuntime) {
|
|
|
282
282
|
default: createProgrammaticPageComponent(route, rendererRuntime),
|
|
283
283
|
...normalizeFarmRouteRuntimeConfig(route, `Route "${route.path}"`)
|
|
284
284
|
};
|
|
285
|
-
if (route.params || route.search || route
|
|
285
|
+
if (route.params || route.search || hasProgrammaticServerProps(route)) {
|
|
286
286
|
mod.__farmRouteSchemas = {
|
|
287
287
|
params: route.params,
|
|
288
288
|
search: getProgrammaticRouteSearchSchema(route.search)
|
|
@@ -346,7 +346,7 @@ function scanProgrammaticPagePaths(source) {
|
|
|
346
346
|
}
|
|
347
347
|
__name(scanProgrammaticPagePaths, "scanProgrammaticPagePaths");
|
|
348
348
|
function createProgrammaticPageComponent(route, rendererRuntime) {
|
|
349
|
-
if (!route.params && !route.search && !route
|
|
349
|
+
if (!route.params && !route.search && !hasProgrammaticServerProps(route) && !route.pending && !route.error && !route.notFound) {
|
|
350
350
|
return route.component;
|
|
351
351
|
}
|
|
352
352
|
const createElement = /* @__PURE__ */ __name((...args) => {
|
|
@@ -391,7 +391,22 @@ function createProgrammaticPageComponent(route, rendererRuntime) {
|
|
|
391
391
|
createElement(PageContent, props)
|
|
392
392
|
);
|
|
393
393
|
}, "FarmProgrammaticPage");
|
|
394
|
-
return
|
|
394
|
+
return markClientStrippedPage(
|
|
395
|
+
route,
|
|
396
|
+
markFunctionComponent(FarmProgrammaticPage)
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
if (getClientStrippedServerHooks(route)) {
|
|
400
|
+
const FarmProgrammaticClientPage = /* @__PURE__ */ __name(function FarmProgrammaticClientPage2(props) {
|
|
401
|
+
if (!isProgrammaticRoutePropsResolved(props)) {
|
|
402
|
+
throw createClientStrippedRouteError(route);
|
|
403
|
+
}
|
|
404
|
+
return createElement(Component, stripProgrammaticRoutePropsMarker(props));
|
|
405
|
+
}, "FarmProgrammaticClientPage");
|
|
406
|
+
return markClientStrippedPage(
|
|
407
|
+
route,
|
|
408
|
+
markFunctionComponent(FarmProgrammaticClientPage)
|
|
409
|
+
);
|
|
395
410
|
}
|
|
396
411
|
const FarmProgrammaticPageContent = /* @__PURE__ */ __name(async function FarmProgrammaticPageContent2(props) {
|
|
397
412
|
try {
|
|
@@ -410,9 +425,34 @@ function createProgrammaticPageComponent(route, rendererRuntime) {
|
|
|
410
425
|
throw error;
|
|
411
426
|
}
|
|
412
427
|
}, "FarmProgrammaticPageContent");
|
|
413
|
-
return
|
|
428
|
+
return markClientStrippedPage(
|
|
429
|
+
route,
|
|
430
|
+
markFunctionComponent(FarmProgrammaticPageContent)
|
|
431
|
+
);
|
|
414
432
|
}
|
|
415
433
|
__name(createProgrammaticPageComponent, "createProgrammaticPageComponent");
|
|
434
|
+
function getClientStrippedServerHooks(route) {
|
|
435
|
+
const hooks = route.__farmServerHooks;
|
|
436
|
+
return Array.isArray(hooks) && hooks.length > 0 ? hooks : void 0;
|
|
437
|
+
}
|
|
438
|
+
__name(getClientStrippedServerHooks, "getClientStrippedServerHooks");
|
|
439
|
+
function createClientStrippedRouteError(route) {
|
|
440
|
+
return new Error(
|
|
441
|
+
`Route "${route.path}" resolves its ${getClientStrippedServerHooks(route).join(" and ")} on the server; the browser can only render it with server-resolved props.`
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
__name(createClientStrippedRouteError, "createClientStrippedRouteError");
|
|
445
|
+
function hasProgrammaticServerProps(route) {
|
|
446
|
+
return Boolean(route.guard || route.data || getClientStrippedServerHooks(route));
|
|
447
|
+
}
|
|
448
|
+
__name(hasProgrammaticServerProps, "hasProgrammaticServerProps");
|
|
449
|
+
function markClientStrippedPage(route, component) {
|
|
450
|
+
if (getClientStrippedServerHooks(route) && typeof component === "function") {
|
|
451
|
+
Object.defineProperty(component, "__farmServerProps", { value: true });
|
|
452
|
+
}
|
|
453
|
+
return component;
|
|
454
|
+
}
|
|
455
|
+
__name(markClientStrippedPage, "markClientStrippedPage");
|
|
416
456
|
function readProgrammaticRouteProps(route, props, resources) {
|
|
417
457
|
if (isProgrammaticRoutePropsResolved(props)) {
|
|
418
458
|
return props;
|
|
@@ -479,6 +519,9 @@ async function resolveProgrammaticRouteProps(route, props) {
|
|
|
479
519
|
props.path,
|
|
480
520
|
route.path
|
|
481
521
|
);
|
|
522
|
+
if (getClientStrippedServerHooks(route)) {
|
|
523
|
+
throw createClientStrippedRouteError(route);
|
|
524
|
+
}
|
|
482
525
|
const routeContextValue = getFarmRouteContext(props);
|
|
483
526
|
const pluginContext = props.context;
|
|
484
527
|
const baseProps = {
|
|
@@ -1,5 +1,8 @@
|
|
|
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
|
+
var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
|
|
4
7
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
5
8
|
|
|
@@ -139,16 +142,10 @@ function readCookie(header, name) {
|
|
|
139
142
|
for (const part of header.split(";")) {
|
|
140
143
|
const separator = part.indexOf("=");
|
|
141
144
|
if (separator < 0) continue;
|
|
142
|
-
|
|
143
|
-
try {
|
|
144
|
-
key = decodeURIComponent(part.slice(0, separator).trim());
|
|
145
|
-
} catch (e2) {
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
if (key !== name) continue;
|
|
145
|
+
if (_chunkAI7QMY7Ocjs.decodeCookieName.call(void 0, part.slice(0, separator).trim()) !== name) continue;
|
|
149
146
|
try {
|
|
150
147
|
return decodeURIComponent(part.slice(separator + 1).trim());
|
|
151
|
-
} catch (
|
|
148
|
+
} catch (e2) {
|
|
152
149
|
return part.slice(separator + 1).trim();
|
|
153
150
|
}
|
|
154
151
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMOKLYNHVcjs = require('./chunk-MOKLYNHV.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkSK35NQKKcjs = require('./chunk-SK35NQKK.cjs');
|
|
@@ -14,7 +14,7 @@ var _chunkT5CERMEHcjs = require('./chunk-T5CERMEH.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkYWN746UScjs = require('./chunk-YWN746US.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ function createServerQuery(options) {
|
|
|
35
35
|
throw new TypeError("createServerQuery requires a key function");
|
|
36
36
|
}
|
|
37
37
|
const staleTime = normalizeServerQueryStaleTime(options.staleTime);
|
|
38
|
-
const execute =
|
|
38
|
+
const execute = _chunkMOKLYNHVcjs.createServerFn.call(void 0, {
|
|
39
39
|
input: options.input,
|
|
40
40
|
middleware: options.middleware,
|
|
41
41
|
handler: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (context) => {
|
|
@@ -45,7 +45,7 @@ function createServerQuery(options) {
|
|
|
45
45
|
const cacheKey = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["route-data", routeKey]);
|
|
46
46
|
const producer = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
47
47
|
const value = await options.handler(context);
|
|
48
|
-
return
|
|
48
|
+
return _chunkMOKLYNHVcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
|
|
49
49
|
}, "producer");
|
|
50
50
|
let data;
|
|
51
51
|
let updatedAt;
|
|
@@ -53,9 +53,9 @@ function createServerQuery(options) {
|
|
|
53
53
|
data = await dedupeServerQueryRequest(cacheKey, context.request, producer);
|
|
54
54
|
updatedAt = Date.now();
|
|
55
55
|
} else {
|
|
56
|
-
const cache =
|
|
56
|
+
const cache = _chunkYWN746UScjs.getFarmDataCache.call(void 0, );
|
|
57
57
|
data = await cache.getOrSet(cacheKey, producer, {
|
|
58
|
-
tags: [
|
|
58
|
+
tags: [_chunkYWN746UScjs.createRouteDataCacheTag.call(void 0, routeKey)],
|
|
59
59
|
revalidate: staleTime === false ? false : staleTime / 1e3
|
|
60
60
|
});
|
|
61
61
|
updatedAt = await _asyncNullishCoalesce(await _asyncOptionalChain([(await cache.getEntryAsync(cacheKey, { allowStale: true })), 'optionalAccess', async _ => _.createdAt]), async () => ( Date.now()));
|
|
@@ -90,10 +90,10 @@ function createServerQuery(options) {
|
|
|
90
90
|
enumerable: false
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
_chunkMOKLYNHVcjs._attachServerFunctionDescriptor.call(void 0,
|
|
94
94
|
query,
|
|
95
|
-
|
|
96
|
-
const result = await
|
|
95
|
+
_chunkMOKLYNHVcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
|
|
96
|
+
const result = await _chunkMOKLYNHVcjs._runServerFunctionForCaller.call(void 0,
|
|
97
97
|
execute,
|
|
98
98
|
value
|
|
99
99
|
);
|