@farm.js/core 0.1.66 → 0.1.68
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-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
- package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
- package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
- package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
- package/dist/agent-runtime.cjs +6 -5
- package/dist/agent-runtime.d.mts +10 -8
- package/dist/agent-runtime.d.ts +10 -8
- package/dist/agent-runtime.mjs +5 -4
- package/dist/{analyzer-4UFP4HVP.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
- package/dist/analyzer-PPAHM4AW.cjs +16 -0
- package/dist/api/client.cjs +12 -2
- package/dist/api/client.d.mts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/client.mjs +12 -2
- package/dist/api/client.native.cjs +12 -2
- package/dist/api/client.native.d.mts +5 -5
- package/dist/api/client.native.d.ts +5 -5
- package/dist/api/client.native.mjs +12 -2
- package/dist/api/node.cjs +223 -0
- package/dist/api/node.d.mts +61 -0
- package/dist/api/node.d.ts +61 -0
- package/dist/api/node.mjs +223 -0
- package/dist/api/route-manager.cjs +11 -11
- package/dist/api/route-manager.d.mts +14 -11
- package/dist/api/route-manager.d.ts +14 -11
- package/dist/api/route-manager.mjs +10 -10
- package/dist/api/runtime.cjs +11 -7
- package/dist/api/runtime.d.mts +11 -9
- package/dist/api/runtime.d.ts +11 -9
- package/dist/api/runtime.mjs +10 -6
- package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
- package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
- package/dist/api.cjs +17 -13
- package/dist/api.d.mts +15 -12
- package/dist/api.d.ts +15 -12
- package/dist/api.mjs +16 -12
- package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
- package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +15 -15
- package/dist/app-markdown.d.ts +15 -15
- package/dist/app-markdown.mjs +4 -4
- package/dist/{app.d-x68Cwr0_.d.ts → app.d-BVOpL_f2.d.ts} +52 -11
- package/dist/{app.d-kuoVWhWM.d.mts → app.d-BhiDXex_.d.mts} +52 -11
- package/dist/{chunk-RY4ABNPE.cjs → chunk-225APHKC.cjs} +3 -3
- package/dist/{chunk-JGAE5XPL.cjs → chunk-23VJEGKC.cjs} +4 -2
- package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
- package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
- package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
- package/dist/{chunk-7XGWBPQQ.cjs → chunk-3EEINK7G.cjs} +24 -10
- package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
- package/dist/{chunk-HCGWDRZO.mjs → chunk-3Y52TWYU.mjs} +18 -7
- package/dist/{chunk-CBOEJ5Z4.cjs → chunk-437QZIC2.cjs} +133 -46
- package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
- package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
- package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
- package/dist/{chunk-EMNKZGF4.mjs → chunk-4UAQB5LB.mjs} +556 -462
- package/dist/{chunk-BQWBHWEW.mjs → chunk-4ZXKYCYK.mjs} +1 -1
- package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
- package/dist/{chunk-ZEXE4TGY.mjs → chunk-5FBZJJGA.mjs} +247 -110
- package/dist/{chunk-4OSOLDPL.cjs → chunk-5JKDFRTK.cjs} +2 -2
- package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
- package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
- package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
- package/dist/chunk-6I4BFRE7.cjs +51 -0
- package/dist/{chunk-UBMHQVWN.mjs → chunk-6OFOIMNS.mjs} +1 -1
- package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
- package/dist/{chunk-CHYTADNK.cjs → chunk-7LK5CTUM.cjs} +70 -53
- package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
- package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
- package/dist/{chunk-BYRZ5VTH.mjs → chunk-A3T445WK.mjs} +47 -34
- package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
- package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
- package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
- package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
- package/dist/chunk-AQIRXBBY.cjs +26 -0
- package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
- package/dist/chunk-AZ6IW6SF.mjs +28 -0
- package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
- package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
- package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
- package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
- package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
- package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
- package/dist/{chunk-VQJHT2ND.mjs → chunk-CRVSYDHV.mjs} +2 -2
- package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
- package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
- package/dist/{chunk-AZUUKA66.mjs → chunk-DIXFKAPM.mjs} +1251 -389
- package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
- package/dist/{chunk-NHQM2Q4I.cjs → chunk-DWLNLU55.cjs} +2 -2
- package/dist/chunk-DXZ57EPE.mjs +375 -0
- package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
- package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
- package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
- package/dist/chunk-EIVGPQN5.mjs +51 -0
- package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
- package/dist/{chunk-E4UDLFWR.cjs → chunk-F36LS2C7.cjs} +796 -702
- package/dist/{chunk-MPIGW42F.mjs → chunk-F6CMGWAL.mjs} +1 -1
- package/dist/{chunk-GL7N5UHF.cjs → chunk-FJMC24KG.cjs} +21 -10
- package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
- package/dist/{chunk-3CCAICF7.cjs → chunk-FSODPZRT.cjs} +5 -5
- package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
- package/dist/{chunk-WMTBBQHY.cjs → chunk-FVYBEMOD.cjs} +288 -151
- package/dist/{chunk-BM2LH2JM.mjs → chunk-G7NBPP7H.mjs} +14 -13
- package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
- package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
- package/dist/{chunk-25T5VXOE.mjs → chunk-GFPS7MNE.mjs} +106 -19
- package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
- package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
- package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
- package/dist/{chunk-RVGSVQWT.mjs → chunk-HEJM46HQ.mjs} +21 -7
- package/dist/chunk-HHLEYA4B.cjs +17 -0
- package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
- package/dist/{chunk-E552H232.cjs → chunk-I7J5RLGO.cjs} +16 -2
- package/dist/chunk-ICFPTHXM.mjs +97 -0
- package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
- package/dist/{chunk-MPJEIHW2.cjs → chunk-IGDYL2IA.cjs} +2 -2
- package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
- package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
- package/dist/chunk-J6TZRYCO.cjs +22 -0
- package/dist/{chunk-E4RDMG3K.mjs → chunk-JL2YW5KX.mjs} +5 -4
- package/dist/chunk-JSOCDYER.cjs +375 -0
- package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
- package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
- package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
- package/dist/chunk-K63OWRY2.mjs +22 -0
- package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
- package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
- package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
- package/dist/{chunk-TKK5QHKZ.mjs → chunk-KDO6T6OB.mjs} +3 -3
- package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
- package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
- package/dist/{chunk-IT6WRNGB.cjs → chunk-KWCZKJYU.cjs} +1541 -679
- package/dist/{chunk-DVKH2RVN.cjs → chunk-LDEXTX4I.cjs} +70 -57
- package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
- package/dist/{chunk-XBSKPLHF.cjs → chunk-LR4KP3I7.cjs} +2 -2
- package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
- package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
- package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
- package/dist/{chunk-TZVUF5JJ.mjs → chunk-MGZVDX4R.mjs} +5 -5
- package/dist/{chunk-MGKW5XZE.cjs → chunk-MMDKYJ5V.cjs} +7 -7
- package/dist/{chunk-SK7QSNWE.mjs → chunk-MNJDNTGO.mjs} +1 -1
- package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
- package/dist/{chunk-FIR62CR3.mjs → chunk-MV7NWU23.mjs} +1 -1
- package/dist/{chunk-7ONGIFYX.cjs → chunk-MZ4CRSY7.cjs} +481 -171
- package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
- package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
- package/dist/{chunk-XBSLKXBL.mjs → chunk-NT4W4H52.mjs} +52 -35
- package/dist/{chunk-UAQD67HM.mjs → chunk-NVOMQLI2.mjs} +16 -2
- package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
- package/dist/{chunk-V56632LA.cjs → chunk-OCNV4CI2.cjs} +39 -6
- package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
- package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
- package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
- package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
- package/dist/{chunk-27FPUFWR.mjs → chunk-P2NBQ5JI.mjs} +1 -1
- package/dist/{chunk-HZPKJRYA.cjs → chunk-PDFFYZAT.cjs} +2 -2
- package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
- package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
- package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
- package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
- package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
- package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
- package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
- package/dist/{chunk-X4K7TYN6.cjs → chunk-QOGIZKSO.cjs} +26 -25
- package/dist/{chunk-CNNBFGL5.cjs → chunk-QSUYB3RH.cjs} +14 -14
- package/dist/chunk-QYNZ3CTI.mjs +17 -0
- package/dist/{chunk-X3XUZWRB.mjs → chunk-R2ZHU37O.mjs} +36 -3
- package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
- package/dist/{chunk-O75GQVUK.mjs → chunk-RLH5AH2M.mjs} +1 -1
- package/dist/chunk-RWR7SMD7.cjs +50 -0
- package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
- package/dist/chunk-SD6JGJOM.mjs +50 -0
- package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
- package/dist/{chunk-BIF5MLTH.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
- package/dist/{chunk-WVYRLP5E.mjs → chunk-T5XFZQCL.mjs} +1 -1
- package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
- package/dist/{chunk-OP7LHY4Y.cjs → chunk-TNK2TVRS.cjs} +2005 -800
- package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
- package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
- package/dist/{chunk-WYAXRIYP.cjs → chunk-UKZ6AWKZ.cjs} +10 -9
- package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
- package/dist/{chunk-VBCQ5WOI.cjs → chunk-URN7VFO7.cjs} +105 -16
- package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
- package/dist/{chunk-435QJNC2.mjs → chunk-VFNAK6A5.mjs} +4 -4
- package/dist/{chunk-WFWFECDW.mjs → chunk-VRGY3X2I.mjs} +100 -11
- package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
- package/dist/chunk-W44X6IC2.cjs +97 -0
- package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
- package/dist/{chunk-672ISQIG.mjs → chunk-WPB67LE5.mjs} +379 -69
- package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
- package/dist/chunk-WVQNXXNE.cjs +28 -0
- package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
- package/dist/{chunk-W2ZXMMHA.mjs → chunk-XCAQTCGK.mjs} +1 -1
- package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
- package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
- package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
- package/dist/{chunk-D4MRNBVF.cjs → chunk-Y6KHPJDB.cjs} +2 -2
- package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
- package/dist/chunk-YFTGIHNC.mjs +26 -0
- package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
- package/dist/{chunk-752IHQTD.cjs → chunk-YTNBCXCW.cjs} +12 -12
- package/dist/{chunk-RFKTJTWZ.mjs → chunk-YVPX5PI5.mjs} +3 -1
- package/dist/{chunk-4TVPYN32.cjs → chunk-Z3PW3DIR.cjs} +7 -7
- package/dist/{chunk-OB7VKCUZ.mjs → chunk-Z6SOXHAD.mjs} +1851 -646
- package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
- package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
- package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
- package/dist/client/lifecycle.cjs +2 -2
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/client/lifecycle.mjs +1 -1
- package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
- package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
- package/dist/client-plugins.cjs +2 -2
- package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-CE1lVK2R.d.mts} +116 -373
- package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CNDqcAuf.d.ts} +116 -373
- package/dist/client-plugins.d.mts +10 -8
- package/dist/client-plugins.d.ts +10 -8
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +11 -9
- package/dist/client.d.mts +17 -15
- package/dist/client.d.ts +17 -15
- package/dist/client.mjs +10 -8
- package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
- package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
- package/dist/config.d.mts +10 -8
- package/dist/config.d.ts +10 -8
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/deferred.cjs +2 -2
- package/dist/deferred.mjs +1 -1
- package/dist/deployment.cjs +4 -2
- package/dist/deployment.d.mts +15 -1
- package/dist/deployment.d.ts +15 -1
- package/dist/deployment.mjs +3 -1
- package/dist/desktop.d.mts +11 -9
- package/dist/desktop.d.ts +11 -9
- package/dist/{devtools-NZUVNUP3.mjs → devtools-2A2GPC7B.mjs} +33 -29
- package/dist/{devtools-N2JQCMXB.cjs → devtools-R27T3BRY.cjs} +38 -34
- package/dist/docs.cjs +28 -27
- package/dist/docs.d.mts +24 -10
- package/dist/docs.d.ts +24 -10
- package/dist/docs.mjs +27 -26
- package/dist/env-types.cjs +3 -3
- package/dist/env-types.mjs +2 -2
- package/dist/environment/vite.cjs +7 -7
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/environment/vite.mjs +6 -6
- package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
- package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
- package/dist/headers.cjs +3 -3
- package/dist/headers.mjs +2 -2
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
- package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
- package/dist/image.cjs +6 -6
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +148 -128
- package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
- package/dist/{index.d-A_x10zGS.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
- package/dist/index.d.mts +39 -87
- package/dist/index.d.ts +39 -87
- package/dist/index.mjs +224 -204
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
- package/dist/integrations/orm.d.mts +35 -0
- package/dist/integrations/orm.d.ts +35 -0
- package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
- package/dist/integrations.cjs +6 -5
- package/dist/integrations.d.mts +10 -8
- package/dist/integrations.d.ts +10 -8
- package/dist/integrations.mjs +5 -4
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +27 -11
- package/dist/internal/app-markdown-runtime.d.ts +27 -11
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +76 -71
- package/dist/internal/build-runtime.d.mts +12 -10
- package/dist/internal/build-runtime.d.ts +12 -10
- package/dist/internal/build-runtime.mjs +75 -70
- package/dist/internal/cli-runtime.cjs +47 -46
- package/dist/internal/cli-runtime.mjs +46 -45
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +85 -36
- package/dist/internal/client-runtime.d.mts +44 -13
- package/dist/internal/client-runtime.d.ts +44 -13
- package/dist/internal/client-runtime.mjs +79 -30
- package/dist/internal/compression-runtime.d.mts +10 -8
- package/dist/internal/compression-runtime.d.ts +10 -8
- package/dist/internal/config-runtime.cjs +27 -26
- package/dist/internal/config-runtime.d.mts +14 -12
- package/dist/internal/config-runtime.d.ts +14 -12
- package/dist/internal/config-runtime.mjs +26 -25
- package/dist/internal/docs-precompiled-runtime.cjs +16 -5
- package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
- package/dist/internal/docs-precompiled-runtime.mjs +15 -4
- package/dist/internal/form-actions.cjs +7 -2
- package/dist/internal/form-actions.d.mts +10 -3
- package/dist/internal/form-actions.d.ts +10 -3
- package/dist/internal/form-actions.mjs +8 -3
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/islands-boot.cjs +6 -1
- package/dist/internal/islands-boot.mjs +6 -1
- package/dist/internal/islands-runtime.cjs +33 -4
- package/dist/internal/islands-runtime.d.mts +1 -1
- package/dist/internal/islands-runtime.d.ts +1 -1
- package/dist/internal/islands-runtime.mjs +31 -2
- package/dist/internal/native-server-fns.cjs +5 -5
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-node-env.cjs +4 -2
- package/dist/internal/production-node-env.d.mts +22 -1
- package/dist/internal/production-node-env.d.ts +22 -1
- package/dist/internal/production-node-env.mjs +3 -1
- package/dist/internal/production-runtime.cjs +57 -39
- package/dist/internal/production-runtime.d.mts +27 -21
- package/dist/internal/production-runtime.d.ts +27 -21
- package/dist/internal/production-runtime.mjs +72 -54
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/server-tree.cjs +2 -2
- package/dist/internal/server-tree.d.mts +0 -5
- package/dist/internal/server-tree.d.ts +0 -5
- package/dist/internal/server-tree.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +87 -0
- package/dist/internal/vercel-edge-middleware.d.mts +39 -0
- package/dist/internal/vercel-edge-middleware.d.ts +39 -0
- package/dist/internal/vercel-edge-middleware.mjs +87 -0
- package/dist/layers-7P4RLKVX.cjs +20 -0
- package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
- package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
- package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
- package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
- package/dist/manager-JOHU6BQI.cjs +15 -0
- package/dist/markdown.cjs +7 -3
- package/dist/markdown.d.mts +10 -8
- package/dist/markdown.d.ts +10 -8
- package/dist/markdown.mjs +6 -2
- package/dist/middleware.cjs +11 -11
- package/dist/middleware.d.mts +13 -10
- package/dist/middleware.d.ts +13 -10
- package/dist/middleware.mjs +13 -13
- package/dist/mobile.d.mts +6 -6
- package/dist/mobile.d.ts +6 -6
- package/dist/mount.d-Bki4pOaJ.d.mts +38 -0
- package/dist/mount.d-DjR5aerM.d.ts +38 -0
- package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
- package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
- package/dist/{native-tree-7LPH57Z4.cjs → native-tree-W2SSJB3Y.cjs} +4 -4
- package/dist/{native-tree-VV6WN3GX.mjs → native-tree-Y5YQANW7.mjs} +3 -3
- package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
- package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
- package/dist/navigation.cjs +8 -7
- package/dist/navigation.d.mts +13 -11
- package/dist/navigation.d.ts +13 -11
- package/dist/navigation.mjs +7 -6
- package/dist/{nitro-DD4QCA66.mjs → nitro-NSTXT7LB.mjs} +11 -11
- package/dist/{nitro-VRDX2H4M.cjs → nitro-Y3LGITW3.cjs} +13 -13
- package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
- package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
- package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
- package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
- package/dist/plugin.cjs +65 -63
- package/dist/plugin.d.mts +12 -10
- package/dist/plugin.d.ts +12 -10
- package/dist/plugin.mjs +64 -62
- package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
- package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
- package/dist/query/client.cjs +9 -7
- package/dist/query/client.mjs +5 -3
- package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
- package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
- package/dist/renderer/none/server.cjs +35 -0
- package/dist/renderer/none/server.d.mts +21 -0
- package/dist/renderer/none/server.d.ts +21 -0
- package/dist/renderer/none/server.mjs +35 -0
- package/dist/renderer/react/server.cjs +3 -3
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +13 -11
- package/dist/renderer-client.d.ts +13 -11
- package/dist/renderer-client.mjs +5 -3
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +25 -2
- package/dist/renderer.d.ts +25 -2
- package/dist/renderer.mjs +5 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-DarDOCk9.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
- package/dist/{request.d-B1RnTLri.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
- package/dist/request.d.mts +11 -9
- package/dist/request.d.ts +11 -9
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
- package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
- package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
- package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
- package/dist/{router.d-CMANF6da.d.ts → router.d-B56rMOFm.d.ts} +1 -1
- package/dist/{router.d-Cuv1jntg.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-9GFFNioh.d.ts} +2 -2
- package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-CrEy0lJS.d.mts} +2 -2
- package/dist/routes.d.mts +10 -8
- package/dist/routes.d.ts +10 -8
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-Z7QBZOIJ.cjs → rsc-pipeline-3T7V6OUT.cjs} +30 -28
- package/dist/{rsc-pipeline-7PNVJSTR.mjs → rsc-pipeline-GA4AQWZI.mjs} +29 -27
- package/dist/{runtime-FKFCUHSK.cjs → runtime-REUTNTI5.cjs} +72 -46
- package/dist/{runtime-QQHX4BP3.mjs → runtime-ZYCKKY7L.mjs} +60 -34
- package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-DLRO-ExG.d.mts} +11 -3
- package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-H7k9hOQE.d.ts} +11 -3
- package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
- package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
- package/dist/schema.cjs +6 -2
- package/dist/schema.d-Dny9pnrm.d.mts +298 -0
- package/dist/schema.d-Dny9pnrm.d.ts +298 -0
- package/dist/schema.d.mts +1 -115
- package/dist/schema.d.ts +1 -115
- package/dist/schema.mjs +5 -1
- package/dist/server-fn-client.d.mts +2 -2
- package/dist/server-fn-client.d.ts +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
- package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
- package/dist/server-plugins.cjs +7 -7
- package/dist/server-plugins.d.mts +20 -12
- package/dist/server-plugins.d.ts +20 -12
- package/dist/server-plugins.mjs +8 -8
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +168 -126
- package/dist/server.d-C5FFrZAo.d.ts +57 -0
- package/dist/server.d-DgC8xew5.d.mts +57 -0
- package/dist/server.d.mts +24 -16
- package/dist/server.d.ts +24 -16
- package/dist/server.mjs +144 -102
- package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-Dr7oanhl.d.ts} +15 -5
- package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-g4CzhEH1.d.mts} +15 -5
- package/dist/testing.cjs +17 -17
- package/dist/testing.d.mts +10 -8
- package/dist/testing.d.ts +10 -8
- package/dist/testing.mjs +13 -13
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/types.d-xCIhyjOq.d.mts +233 -0
- package/dist/types.d-xCIhyjOq.d.ts +233 -0
- package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
- package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +65 -63
- package/dist/vite.d.mts +36 -14
- package/dist/vite.d.ts +36 -14
- package/dist/vite.mjs +64 -62
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.d.mts +121 -1
- package/dist/workflows.d.ts +121 -1
- package/dist/workflows.mjs +3 -3
- package/package.json +37 -2
- package/dist/analyzer-H7SIX6BJ.cjs +0 -16
- package/dist/chunk-5YPBFMBN.cjs +0 -19
- package/dist/chunk-CLFEQGET.cjs +0 -60
- package/dist/chunk-MK5E44WP.mjs +0 -60
- package/dist/chunk-OM7WILES.mjs +0 -100
- package/dist/chunk-Q5B4LNON.mjs +0 -19
- package/dist/chunk-QPJ4MZTO.mjs +0 -60
- package/dist/chunk-R53QDV6T.cjs +0 -100
- package/dist/chunk-UYTAP4FQ.cjs +0 -60
- package/dist/layers-DMRXRL7F.cjs +0 -18
- package/dist/manager-2LUKNX2N.cjs +0 -14
- package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
- package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
- package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
- package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
- /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
- /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
- /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
- /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
- /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
- /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
|
@@ -9,13 +9,15 @@ var _chunkDUIP64BFcjs = require('./chunk-DUIP64BF.cjs');
|
|
|
9
9
|
var _chunkZOYKJBP5cjs = require('./chunk-ZOYKJBP5.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkUUQNJDGHcjs = require('./chunk-UUQNJDGH.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunkC6CUUBY5cjs = require('./chunk-C6CUUBY5.cjs');
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
|
|
@@ -42,7 +44,7 @@ var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
|
|
|
42
44
|
var _chunkHA7YRO53cjs = require('./chunk-HA7YRO53.cjs');
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
var
|
|
47
|
+
var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
var _chunk6CTFVBATcjs = require('./chunk-6CTFVBAT.cjs');
|
|
@@ -84,7 +86,7 @@ function appendIntegrationForwardedCookies(response, cookies) {
|
|
|
84
86
|
headers
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
|
-
var defineIntegrationSchema =
|
|
89
|
+
var defineIntegrationSchema = _chunkUUQNJDGHcjs.defineSchema;
|
|
88
90
|
var FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME = /* @__PURE__ */ Symbol.for(
|
|
89
91
|
"@farm.js/core/integration-plugin-server-runtime"
|
|
90
92
|
);
|
|
@@ -231,7 +233,7 @@ function defineIntegration(integration) {
|
|
|
231
233
|
const allRoutes = _optionalChain([routes, 'optionalAccess', _ => _.length]) || endpointRoutes.length ? [...routes || [], ...endpointRoutes] : void 0;
|
|
232
234
|
for (const route of allRoutes || []) {
|
|
233
235
|
_chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, route.path, "api");
|
|
234
|
-
|
|
236
|
+
_chunkPWKAX5MScjs.validateConfigRouteSource.call(void 0, route.path, `Integration route "${route.path}"`);
|
|
235
237
|
_chunkYTVSWXEZcjs.assertTerminalCatchAll.call(void 0, route.path, "api");
|
|
236
238
|
}
|
|
237
239
|
const derivedApi = integration.api || (_optionalChain([allRoutes, 'optionalAccess', _2 => _2.length]) ? _chunkHA7YRO53cjs.api.fromRoutes(
|
|
@@ -1156,6 +1158,7 @@ function normalizeIntegrationRouteInputSchemas(route) {
|
|
|
1156
1158
|
}
|
|
1157
1159
|
return input.body || input.query ? input : void 0;
|
|
1158
1160
|
}
|
|
1161
|
+
var CROSS_SITE_JSON_ROUTE_BODY_MESSAGE = 'This integration route reads a JSON body, so a request from another origin must send Content-Type: application/json. To accept form posts from other origins, set bodyFormat: "form" on the route.';
|
|
1159
1162
|
async function validateIntegrationRouteInput(route, request, url) {
|
|
1160
1163
|
if (request.method.toUpperCase() === "QUERY" && !request.headers.has("content-type")) {
|
|
1161
1164
|
return {
|
|
@@ -1176,6 +1179,11 @@ async function validateIntegrationRouteInput(route, request, url) {
|
|
|
1176
1179
|
input: {}
|
|
1177
1180
|
};
|
|
1178
1181
|
}
|
|
1182
|
+
const bodyFormat = getIntegrationRouteBodyFormat(route);
|
|
1183
|
+
if (schemas.body && bodyFormat === "json" && request.method !== "GET" && request.method !== "HEAD") {
|
|
1184
|
+
const rejection = _chunkC6CUUBY5cjs.rejectCrossSiteNonJSONBody.call(void 0, request, CROSS_SITE_JSON_ROUTE_BODY_MESSAGE);
|
|
1185
|
+
if (rejection) return { success: false, response: rejection };
|
|
1186
|
+
}
|
|
1179
1187
|
const input = {};
|
|
1180
1188
|
const issues = [];
|
|
1181
1189
|
if (schemas.query) {
|
|
@@ -1191,10 +1199,7 @@ async function validateIntegrationRouteInput(route, request, url) {
|
|
|
1191
1199
|
}
|
|
1192
1200
|
}
|
|
1193
1201
|
if (schemas.body) {
|
|
1194
|
-
const bodyInput = await readIntegrationValidationBody(
|
|
1195
|
-
request,
|
|
1196
|
-
getIntegrationRouteBodyFormat(route)
|
|
1197
|
-
);
|
|
1202
|
+
const bodyInput = await readIntegrationValidationBody(request, bodyFormat);
|
|
1198
1203
|
if (bodyInput.success) {
|
|
1199
1204
|
const bodyResult = await parseIntegrationInputSchema("body", schemas.body, bodyInput.data);
|
|
1200
1205
|
if (bodyResult.success) {
|
|
@@ -1286,7 +1291,7 @@ function createIntegrationValidationResponse(issues) {
|
|
|
1286
1291
|
}
|
|
1287
1292
|
function normalizeIntegrationValidationIssues(source, error) {
|
|
1288
1293
|
if (Array.isArray(error.issues) && error.issues.length > 0) {
|
|
1289
|
-
return
|
|
1294
|
+
return _chunkC6CUUBY5cjs.toPublicValidationIssues.call(void 0, error).map((issue) => ({ source, ...issue }));
|
|
1290
1295
|
}
|
|
1291
1296
|
return [
|
|
1292
1297
|
{
|
|
@@ -1331,6 +1336,12 @@ async function readIntegrationValidationBody(request, format) {
|
|
|
1331
1336
|
data: void 0
|
|
1332
1337
|
};
|
|
1333
1338
|
}
|
|
1339
|
+
if (!_optionalChain([request, 'access', _19 => _19.headers, 'access', _20 => _20.get, 'call', _21 => _21("content-type"), 'optionalAccess', _22 => _22.trim, 'call', _23 => _23()]) && !_chunkC6CUUBY5cjs.validateIntegrationRequestOrigin.call(void 0, request, { requireOriginMetadata: false }).ok) {
|
|
1340
|
+
return {
|
|
1341
|
+
success: true,
|
|
1342
|
+
data: void 0
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1334
1345
|
return {
|
|
1335
1346
|
success: true,
|
|
1336
1347
|
data: JSON.parse(text)
|
|
@@ -1347,7 +1358,7 @@ async function readIntegrationValidationBody(request, format) {
|
|
|
1347
1358
|
}
|
|
1348
1359
|
}
|
|
1349
1360
|
function getIntegrationRouteBodyFormat(route) {
|
|
1350
|
-
return route.bodyFormat || _optionalChain([route, 'access',
|
|
1361
|
+
return route.bodyFormat || _optionalChain([route, 'access', _24 => _24.__operation, 'optionalAccess', _25 => _25.bodyFormat]) || "json";
|
|
1351
1362
|
}
|
|
1352
1363
|
function createIntegrationRouteArgs(input) {
|
|
1353
1364
|
let clientPromise;
|
|
@@ -1364,7 +1375,7 @@ function createIntegrationRouteArgs(input) {
|
|
|
1364
1375
|
`Integration "${input.integration.type}" does not define a schema for ctx.args.db.`
|
|
1365
1376
|
);
|
|
1366
1377
|
}
|
|
1367
|
-
_nullishCoalesce(ormPromise, () => ( (ormPromise = import("./
|
|
1378
|
+
_nullishCoalesce(ormPromise, () => ( (ormPromise = import("./integrations/orm.cjs").then(
|
|
1368
1379
|
({ createIntegrationOrm }) => createIntegrationOrm({
|
|
1369
1380
|
schema: input.integration.schema,
|
|
1370
1381
|
config: input.config
|
|
@@ -1422,7 +1433,7 @@ function createLazyIntegrationOrmModel(resolveOrm, modelName) {
|
|
|
1422
1433
|
return async (...args) => {
|
|
1423
1434
|
const orm = await resolveOrm();
|
|
1424
1435
|
const model = orm[modelName];
|
|
1425
|
-
const member = _optionalChain([model, 'optionalAccess',
|
|
1436
|
+
const member = _optionalChain([model, 'optionalAccess', _26 => _26[prop]]);
|
|
1426
1437
|
if (typeof member !== "function") {
|
|
1427
1438
|
throw new Error(
|
|
1428
1439
|
`Integration ORM model "${String(modelName)}" does not expose "${String(prop)}".`
|
|
@@ -1499,19 +1510,19 @@ async function dispatchIntegrationRequest(runtime, request, options = {}) {
|
|
|
1499
1510
|
const integration = runtime.integration;
|
|
1500
1511
|
const url = new URL(request.url);
|
|
1501
1512
|
const pathname = url.pathname;
|
|
1502
|
-
const requestId = request.headers.get("x-request-id") || _optionalChain([options, 'access',
|
|
1513
|
+
const requestId = request.headers.get("x-request-id") || _optionalChain([options, 'access', _27 => _27.currentRequest, 'optionalAccess', _28 => _28.headers, 'access', _29 => _29.get, 'call', _30 => _30("x-request-id")]) || String(Date.now());
|
|
1503
1514
|
const routes = normalizeIntegrationRoutes(integration.routes || []);
|
|
1504
1515
|
const pathSegments = _chunk6CTFVBATcjs.canonicalizeRequestPathSegments.call(void 0, pathname);
|
|
1505
1516
|
const method = normalizeIntegrationRequestMethod(request.method);
|
|
1506
1517
|
const middleware = [...integration.middleware || []];
|
|
1507
1518
|
const forwardedSetCookies = [];
|
|
1508
1519
|
for (const entry of middleware) {
|
|
1509
|
-
if (_optionalChain([options, 'access',
|
|
1520
|
+
if (_optionalChain([options, 'access', _31 => _31.ranMiddleware, 'optionalAccess', _32 => _32.has, 'call', _33 => _33(entry)])) continue;
|
|
1510
1521
|
const params = _chunkZOYKJBP5cjs.resolveIntegrationMiddlewareParams.call(void 0, entry, pathname, runtime.config);
|
|
1511
1522
|
if (!params) {
|
|
1512
1523
|
continue;
|
|
1513
1524
|
}
|
|
1514
|
-
_optionalChain([options, 'access',
|
|
1525
|
+
_optionalChain([options, 'access', _34 => _34.ranMiddleware, 'optionalAccess', _35 => _35.add, 'call', _36 => _36(entry)]);
|
|
1515
1526
|
const handlerContext = createServerIntegrationHandlerContext({
|
|
1516
1527
|
runtime,
|
|
1517
1528
|
route: {
|
|
@@ -1750,7 +1761,7 @@ async function dispatchIntegrationRequest(runtime, request, options = {}) {
|
|
|
1750
1761
|
}
|
|
1751
1762
|
}
|
|
1752
1763
|
if (forwardedSetCookies.length > 0) {
|
|
1753
|
-
_optionalChain([options, 'access',
|
|
1764
|
+
_optionalChain([options, 'access', _37 => _37.onForwardedCookies, 'optionalCall', _38 => _38(forwardedSetCookies)]);
|
|
1754
1765
|
}
|
|
1755
1766
|
return null;
|
|
1756
1767
|
}
|
|
@@ -9,10 +9,10 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
9
9
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkOFBLGH6Vcjs = require('./chunk-OFBLGH6V.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
|
|
@@ -24,7 +24,9 @@ var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var _chunkXGTFLG73cjs = require('./chunk-XGTFLG73.cjs');
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
|
|
@@ -33,14 +35,14 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
|
|
|
33
35
|
var _chunkY3WG64CPcjs = require('./chunk-Y3WG64CP.cjs');
|
|
34
36
|
|
|
35
37
|
|
|
36
|
-
var
|
|
38
|
+
var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
|
|
37
39
|
|
|
38
40
|
|
|
41
|
+
var _chunkJYNNIGQOcjs = require('./chunk-JYNNIGQO.cjs');
|
|
39
42
|
|
|
40
|
-
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
41
43
|
|
|
42
44
|
|
|
43
|
-
var
|
|
45
|
+
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
|
|
@@ -48,7 +50,7 @@ var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
|
|
|
48
50
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
49
51
|
|
|
50
52
|
|
|
51
|
-
var
|
|
53
|
+
var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
|
|
@@ -114,7 +116,7 @@ function farmApiPlugin(options = {}) {
|
|
|
114
116
|
const existing = apiRoutesCache.get(routePath);
|
|
115
117
|
const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
|
|
116
118
|
if (existingFile) {
|
|
117
|
-
throw new (0,
|
|
119
|
+
throw new (0, _chunkOFBLGH6Vcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
118
120
|
}
|
|
119
121
|
if (existing) {
|
|
120
122
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -190,7 +192,7 @@ function farmApiPlugin(options = {}) {
|
|
|
190
192
|
const createRouter = async () => {
|
|
191
193
|
const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
|
|
192
194
|
pluginMergedRoutes = plugins.length ? new Map(
|
|
193
|
-
|
|
195
|
+
_chunkXGTFLG73cjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
|
|
194
196
|
bodySizeLimit,
|
|
195
197
|
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
196
198
|
// so the middleware that guards the endpoint's path runs for it.
|
|
@@ -210,7 +212,7 @@ function farmApiPlugin(options = {}) {
|
|
|
210
212
|
const url = new URL(request.url);
|
|
211
213
|
const method = request.method.toUpperCase();
|
|
212
214
|
const pathname = url.pathname;
|
|
213
|
-
const match =
|
|
215
|
+
const match = _chunkXGTFLG73cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
|
|
214
216
|
if (!match) {
|
|
215
217
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
216
218
|
status: 404,
|
|
@@ -218,23 +220,21 @@ function farmApiPlugin(options = {}) {
|
|
|
218
220
|
});
|
|
219
221
|
}
|
|
220
222
|
const { route, params } = match;
|
|
221
|
-
const endpoint =
|
|
223
|
+
const endpoint = _chunkXGTFLG73cjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
222
224
|
if (!endpoint) {
|
|
223
225
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
224
226
|
status: 405,
|
|
225
227
|
headers: {
|
|
226
|
-
Allow:
|
|
228
|
+
Allow: _chunkXGTFLG73cjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
227
229
|
"Content-Type": "application/json"
|
|
228
230
|
}
|
|
229
231
|
});
|
|
230
232
|
}
|
|
231
233
|
try {
|
|
232
|
-
return await
|
|
234
|
+
return await _chunkXGTFLG73cjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
|
|
233
235
|
} catch (error) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
headers: { "Content-Type": "application/json" }
|
|
237
|
-
});
|
|
236
|
+
console.error(`[API Error] ${pathname}:`, error);
|
|
237
|
+
return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
log(`API router created with ${totalEndpoints} endpoints`);
|
|
@@ -278,7 +278,7 @@ function farmApiPlugin(options = {}) {
|
|
|
278
278
|
const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
279
279
|
const endpoints = {};
|
|
280
280
|
const availableMethods = [];
|
|
281
|
-
for (const method of
|
|
281
|
+
for (const method of _chunkXGTFLG73cjs.API_ROUTE_METHODS) {
|
|
282
282
|
if (routeModule[method]) {
|
|
283
283
|
availableMethods.push(method);
|
|
284
284
|
endpoints[method] = routeModule[method];
|
|
@@ -291,7 +291,7 @@ function farmApiPlugin(options = {}) {
|
|
|
291
291
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
292
292
|
}
|
|
293
293
|
} catch (e) {
|
|
294
|
-
if (e instanceof
|
|
294
|
+
if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
295
295
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -318,7 +318,7 @@ function farmApiPlugin(options = {}) {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
} catch (e) {
|
|
321
|
-
if (e instanceof
|
|
321
|
+
if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
322
322
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
323
323
|
}
|
|
324
324
|
break;
|
|
@@ -328,7 +328,7 @@ function farmApiPlugin(options = {}) {
|
|
|
328
328
|
const discoverProgrammaticRoutes = async () => {
|
|
329
329
|
const path = await import("path");
|
|
330
330
|
const srcRoot = path.join(server.config.root, srcDir);
|
|
331
|
-
const routeFiles =
|
|
331
|
+
const routeFiles = _chunkQEJWNXRIcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
|
|
332
332
|
if (routeFiles.length === 0) return;
|
|
333
333
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
334
334
|
for (const routeFile of routeFiles) {
|
|
@@ -349,7 +349,7 @@ function farmApiPlugin(options = {}) {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
} catch (e) {
|
|
352
|
-
if (e instanceof
|
|
352
|
+
if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
353
353
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -403,15 +403,15 @@ function farmApiPlugin(options = {}) {
|
|
|
403
403
|
if (discoveryPromise) await waitForDiscovery();
|
|
404
404
|
const farmMiddleware = server.__farmMiddleware__;
|
|
405
405
|
let middlewareRan = false;
|
|
406
|
-
if (!
|
|
407
|
-
if (!farmMiddleware || !apiRouterHandler || !
|
|
406
|
+
if (!_chunkXGTFLG73cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
|
|
407
|
+
if (!farmMiddleware || !apiRouterHandler || !_chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, pathname, basePath)) {
|
|
408
408
|
return next();
|
|
409
409
|
}
|
|
410
410
|
await _optionalChain([farmMiddleware, 'access', _5 => _5.waitForDiscovery, 'optionalCall', _6 => _6()]);
|
|
411
411
|
if (await farmMiddleware.execute(req, res, pathname, /* @__PURE__ */ new Map())) return;
|
|
412
412
|
middlewareRan = true;
|
|
413
413
|
const rewrittenPathname = (req.url || url).split("?")[0];
|
|
414
|
-
if (rewrittenPathname === pathname || !
|
|
414
|
+
if (rewrittenPathname === pathname || !_chunkXGTFLG73cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), rewrittenPathname, basePath)) {
|
|
415
415
|
return next();
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -432,10 +432,10 @@ function farmApiPlugin(options = {}) {
|
|
|
432
432
|
}
|
|
433
433
|
const currentUrl = req.url || url;
|
|
434
434
|
const currentPathname = currentUrl.split("?")[0];
|
|
435
|
-
if (currentPathname !== pathname && !
|
|
435
|
+
if (currentPathname !== pathname && !_chunkXGTFLG73cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
|
|
436
436
|
return next();
|
|
437
437
|
}
|
|
438
|
-
const fullUrl =
|
|
438
|
+
const fullUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req);
|
|
439
439
|
const headers = new Headers();
|
|
440
440
|
for (const [key, value] of Object.entries(req.headers)) {
|
|
441
441
|
if (value) {
|
|
@@ -469,7 +469,7 @@ function farmApiPlugin(options = {}) {
|
|
|
469
469
|
console.error("[FARM] API error:", error);
|
|
470
470
|
res.statusCode = 500;
|
|
471
471
|
res.setHeader("Content-Type", "application/json");
|
|
472
|
-
res.end(
|
|
472
|
+
res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
473
473
|
}
|
|
474
474
|
});
|
|
475
475
|
server.middlewares.use((req, res, next) => {
|
|
@@ -492,7 +492,7 @@ function farmApiPlugin(options = {}) {
|
|
|
492
492
|
}
|
|
493
493
|
res.statusCode = 500;
|
|
494
494
|
res.setHeader("Content-Type", "application/json");
|
|
495
|
-
res.end(
|
|
495
|
+
res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
496
496
|
});
|
|
497
497
|
});
|
|
498
498
|
};
|
|
@@ -536,7 +536,7 @@ function farmApiPlugin(options = {}) {
|
|
|
536
536
|
log(`API router recreated`);
|
|
537
537
|
} catch (e) {
|
|
538
538
|
restoreRouteState(previousState);
|
|
539
|
-
if (e instanceof
|
|
539
|
+
if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
540
540
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
541
541
|
}
|
|
542
542
|
return [];
|
|
@@ -564,7 +564,7 @@ function farmApiPlugin(options = {}) {
|
|
|
564
564
|
const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
565
565
|
removeEndpointsFromFile(file);
|
|
566
566
|
const availableMethods = [];
|
|
567
|
-
for (const method of
|
|
567
|
+
for (const method of _chunkXGTFLG73cjs.API_ROUTE_METHODS) {
|
|
568
568
|
if (!routeModule[method]) continue;
|
|
569
569
|
availableMethods.push(method);
|
|
570
570
|
addEndpoint(routePath, file, method, routeModule[method]);
|
|
@@ -574,7 +574,7 @@ function farmApiPlugin(options = {}) {
|
|
|
574
574
|
log(`API router recreated`);
|
|
575
575
|
} catch (e) {
|
|
576
576
|
restoreRouteState(previousState);
|
|
577
|
-
if (e instanceof
|
|
577
|
+
if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
578
578
|
log(`API route HMR failed: ${e.message}`);
|
|
579
579
|
}
|
|
580
580
|
return [];
|
|
@@ -39,6 +39,16 @@ function validateIntegrationRequestOrigin(request, policy = {}) {
|
|
|
39
39
|
}
|
|
40
40
|
return { ok: true };
|
|
41
41
|
}
|
|
42
|
+
function rejectCrossSiteNonJSONBody(request, message) {
|
|
43
|
+
const contentType = _optionalChain([request, 'access', _8 => _8.headers, 'access', _9 => _9.get, 'call', _10 => _10("content-type"), 'optionalAccess', _11 => _11.split, 'call', _12 => _12(";", 1), 'access', _13 => _13[0], 'optionalAccess', _14 => _14.trim, 'call', _15 => _15(), 'access', _16 => _16.toLowerCase, 'call', _17 => _17()]);
|
|
44
|
+
if (!contentType || contentType === "application/json" || contentType.endsWith("+json")) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (validateIntegrationRequestOrigin(request, { requireOriginMetadata: false }).ok) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return Response.json({ error: "Unsupported Media Type", message }, { status: 415 });
|
|
51
|
+
}
|
|
42
52
|
function describeIntegrationOriginRejection(reason) {
|
|
43
53
|
switch (reason) {
|
|
44
54
|
case "missing-origin":
|
|
@@ -66,8 +76,8 @@ async function parseRouteSchema(schema, value) {
|
|
|
66
76
|
}
|
|
67
77
|
var PUBLIC_MESSAGE_CODES = /* @__PURE__ */ new Set(["custom", "invalid_type"]);
|
|
68
78
|
function toPublicValidationIssues(error) {
|
|
69
|
-
const issues = _optionalChain([error, 'optionalAccess',
|
|
70
|
-
const list = Array.isArray(issues) ? issues : Array.isArray(_optionalChain([error, 'optionalAccess',
|
|
79
|
+
const issues = _optionalChain([error, 'optionalAccess', _18 => _18.issues]);
|
|
80
|
+
const list = Array.isArray(issues) ? issues : Array.isArray(_optionalChain([error, 'optionalAccess', _19 => _19.errors])) ? error.errors : [];
|
|
71
81
|
return list.map((issue) => {
|
|
72
82
|
const { path, code, message } = _nullishCoalesce(issue, () => ( {}));
|
|
73
83
|
return {
|
|
@@ -90,4 +100,5 @@ function toPublicPathSegment(segment) {
|
|
|
90
100
|
|
|
91
101
|
|
|
92
102
|
|
|
93
|
-
|
|
103
|
+
|
|
104
|
+
exports.resolveIntegrationAllowedOrigins = resolveIntegrationAllowedOrigins; exports.validateIntegrationRequestOrigin = validateIntegrationRequestOrigin; exports.rejectCrossSiteNonJSONBody = rejectCrossSiteNonJSONBody; exports.describeIntegrationOriginRejection = describeIntegrationOriginRejection; exports.parseRouteSchema = parseRouteSchema; exports.toPublicValidationIssues = toPublicValidationIssues;
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
var MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
15
15
|
var FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
16
16
|
var SERVER_HTML_TAG = "f-html";
|
|
17
|
+
var SERVER_HTML_TEMPLATE_TAG = "template";
|
|
17
18
|
var FARM_SERVER_TREE_SCRIPT_TYPE = "f/tree";
|
|
18
19
|
var FARM_NOT_A_MARKER = /* @__PURE__ */ Symbol.for("farm.codec.not-a-marker");
|
|
19
20
|
var SERVER_TREE_CHUNK_SCRIPT_TYPE = "f/chunk";
|
|
@@ -312,52 +313,79 @@ function fulfilledThenable(value) {
|
|
|
312
313
|
promise.value = value;
|
|
313
314
|
return promise;
|
|
314
315
|
}
|
|
315
|
-
function createTreeChildren(ReactRuntime, children, resolver) {
|
|
316
|
+
function createTreeChildren(ReactRuntime, children, resolver, inClient) {
|
|
316
317
|
if (children === void 0) return [];
|
|
317
|
-
const node = createTreeValue(ReactRuntime, children, resolver);
|
|
318
|
+
const node = createTreeValue(ReactRuntime, children, resolver, inClient);
|
|
318
319
|
return Array.isArray(children) ? node : [node];
|
|
319
320
|
}
|
|
320
|
-
function createTreeProps(ReactRuntime, props, resolver, key) {
|
|
321
|
+
function createTreeProps(ReactRuntime, props, resolver, key, inClient) {
|
|
321
322
|
const { children, ...rest } = props;
|
|
322
323
|
const created = {};
|
|
323
324
|
for (const [name, value] of Object.entries(rest)) {
|
|
324
|
-
created[name] = createTreeValue(ReactRuntime, value, resolver);
|
|
325
|
+
created[name] = createTreeValue(ReactRuntime, value, resolver, inClient);
|
|
325
326
|
}
|
|
326
327
|
if (typeof key === "string") created.key = key;
|
|
327
|
-
return {
|
|
328
|
+
return {
|
|
329
|
+
props: created,
|
|
330
|
+
children: createTreeChildren(ReactRuntime, children, resolver, inClient)
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function collectServerHtml(value, ids) {
|
|
334
|
+
if (value === null || typeof value !== "object") return ids;
|
|
335
|
+
if (Array.isArray(value)) {
|
|
336
|
+
for (const entry of value) collectServerHtml(entry, ids);
|
|
337
|
+
return ids;
|
|
338
|
+
}
|
|
339
|
+
if (value.$ === "x") {
|
|
340
|
+
ids.push(value.i);
|
|
341
|
+
return ids;
|
|
342
|
+
}
|
|
343
|
+
const object = value.$ === "o" ? value.v : value;
|
|
344
|
+
for (const entry of Object.values(object)) collectServerHtml(entry, ids);
|
|
345
|
+
return ids;
|
|
328
346
|
}
|
|
329
|
-
function createTreeValue(ReactRuntime, value, resolver) {
|
|
347
|
+
function createTreeValue(ReactRuntime, value, resolver, inClient = false) {
|
|
330
348
|
if (value === null || typeof value !== "object") return value;
|
|
331
349
|
if (Array.isArray(value))
|
|
332
|
-
return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver));
|
|
350
|
+
return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver, inClient));
|
|
333
351
|
switch (value.$) {
|
|
334
352
|
case "h": {
|
|
335
353
|
const { props, children } = createTreeProps(
|
|
336
354
|
ReactRuntime,
|
|
337
355
|
value.p,
|
|
338
356
|
resolver,
|
|
339
|
-
value.k
|
|
357
|
+
value.k,
|
|
358
|
+
inClient
|
|
340
359
|
);
|
|
341
360
|
return ReactRuntime.createElement(value.t, props, ...children);
|
|
342
361
|
}
|
|
343
362
|
case "c": {
|
|
363
|
+
const ids = inClient ? [] : collectServerHtml(value.p, []);
|
|
344
364
|
const { props, children } = createTreeProps(
|
|
345
365
|
ReactRuntime,
|
|
346
366
|
value.p,
|
|
347
367
|
resolver,
|
|
348
|
-
value.k
|
|
368
|
+
ids.length > 0 ? void 0 : value.k,
|
|
369
|
+
true
|
|
349
370
|
);
|
|
350
|
-
|
|
371
|
+
const element = ReactRuntime.createElement(
|
|
351
372
|
resolver.component(value.r, value.e),
|
|
352
373
|
props,
|
|
353
374
|
...children
|
|
354
375
|
);
|
|
376
|
+
if (ids.length === 0) return element;
|
|
377
|
+
return ReactRuntime.createElement(
|
|
378
|
+
ReactRuntime.Fragment,
|
|
379
|
+
typeof value.k === "string" ? { key: value.k } : null,
|
|
380
|
+
element,
|
|
381
|
+
resolver.unrendered(ids)
|
|
382
|
+
);
|
|
355
383
|
}
|
|
356
384
|
case "f":
|
|
357
385
|
return ReactRuntime.createElement(
|
|
358
386
|
ReactRuntime.Fragment,
|
|
359
387
|
typeof value.k === "string" ? { key: value.k } : null,
|
|
360
|
-
...createTreeChildren(ReactRuntime, value.c, resolver)
|
|
388
|
+
...createTreeChildren(ReactRuntime, value.c, resolver, inClient)
|
|
361
389
|
);
|
|
362
390
|
case "p":
|
|
363
391
|
return ReactRuntime.createElement(
|
|
@@ -367,7 +395,8 @@ function createTreeValue(ReactRuntime, value, resolver) {
|
|
|
367
395
|
fallback: createTreeValue(
|
|
368
396
|
ReactRuntime,
|
|
369
397
|
value.f,
|
|
370
|
-
resolver
|
|
398
|
+
resolver,
|
|
399
|
+
inClient
|
|
371
400
|
)
|
|
372
401
|
},
|
|
373
402
|
ReactRuntime.createElement(getChunkComponent(ReactRuntime), {
|
|
@@ -381,13 +410,15 @@ function createTreeValue(ReactRuntime, value, resolver) {
|
|
|
381
410
|
case "a":
|
|
382
411
|
return resolver.action(value.v);
|
|
383
412
|
case "P":
|
|
384
|
-
return fulfilledThenable(
|
|
413
|
+
return fulfilledThenable(
|
|
414
|
+
createTreeValue(ReactRuntime, value.v, resolver, inClient)
|
|
415
|
+
);
|
|
385
416
|
case "o": {
|
|
386
417
|
const object = value.v;
|
|
387
418
|
return Object.fromEntries(
|
|
388
419
|
Object.entries(object).map(([name, entry]) => [
|
|
389
420
|
name,
|
|
390
|
-
createTreeValue(ReactRuntime, entry, resolver)
|
|
421
|
+
createTreeValue(ReactRuntime, entry, resolver, inClient)
|
|
391
422
|
])
|
|
392
423
|
);
|
|
393
424
|
}
|
|
@@ -396,14 +427,14 @@ function createTreeValue(ReactRuntime, value, resolver) {
|
|
|
396
427
|
if (!resolver.decode) throw new Error("typed props need islands mode");
|
|
397
428
|
const decoded = resolver.decode(
|
|
398
429
|
value,
|
|
399
|
-
(child) => createTreeValue(ReactRuntime, child, resolver)
|
|
430
|
+
(child) => createTreeValue(ReactRuntime, child, resolver, inClient)
|
|
400
431
|
);
|
|
401
432
|
if (decoded !== FARM_NOT_A_MARKER) return decoded;
|
|
402
433
|
}
|
|
403
434
|
return Object.fromEntries(
|
|
404
435
|
Object.entries(value).map(([name, entry]) => [
|
|
405
436
|
name,
|
|
406
|
-
createTreeValue(ReactRuntime, entry, resolver)
|
|
437
|
+
createTreeValue(ReactRuntime, entry, resolver, inClient)
|
|
407
438
|
])
|
|
408
439
|
);
|
|
409
440
|
}
|
|
@@ -493,6 +524,49 @@ async function createPayloadOnlyPage(state, payload, encode, resolver) {
|
|
|
493
524
|
})
|
|
494
525
|
);
|
|
495
526
|
}
|
|
527
|
+
function RenderedServerHtml({
|
|
528
|
+
id,
|
|
529
|
+
rendered,
|
|
530
|
+
children
|
|
531
|
+
}) {
|
|
532
|
+
rendered.add(id);
|
|
533
|
+
return children;
|
|
534
|
+
}
|
|
535
|
+
function UnrenderedServerHtml({
|
|
536
|
+
ReactRuntime,
|
|
537
|
+
ids,
|
|
538
|
+
rendered,
|
|
539
|
+
part
|
|
540
|
+
}) {
|
|
541
|
+
const unrendered = ids.filter((id) => !rendered.has(id));
|
|
542
|
+
if (unrendered.length === 0) return null;
|
|
543
|
+
return ReactRuntime.createElement(
|
|
544
|
+
SERVER_HTML_TEMPLATE_TAG,
|
|
545
|
+
{ [SERVER_HTML_ATTRIBUTE]: String(unrendered[0]) },
|
|
546
|
+
unrendered.map((id) => part(id, `h${id}`))
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
function createServerHtmlParts(state, isolate) {
|
|
550
|
+
const ReactRuntime = state.ReactRuntime;
|
|
551
|
+
const rendered = /* @__PURE__ */ new Set();
|
|
552
|
+
const part = (id, key) => ReactRuntime.createElement(
|
|
553
|
+
SERVER_HTML_TAG,
|
|
554
|
+
{
|
|
555
|
+
...key === null ? {} : { key },
|
|
556
|
+
[SERVER_HTML_ATTRIBUTE]: String(id),
|
|
557
|
+
style: { display: "contents" }
|
|
558
|
+
},
|
|
559
|
+
isolate(state.serverHtml.get(id))
|
|
560
|
+
);
|
|
561
|
+
return {
|
|
562
|
+
serverHtml: (id, key) => ReactRuntime.createElement(
|
|
563
|
+
RenderedServerHtml,
|
|
564
|
+
{ ...key === null ? {} : { key }, id, rendered },
|
|
565
|
+
part(id, null)
|
|
566
|
+
),
|
|
567
|
+
unrendered: (ids) => ReactRuntime.createElement(UnrenderedServerHtml, { ReactRuntime, ids, rendered, part })
|
|
568
|
+
};
|
|
569
|
+
}
|
|
496
570
|
async function renderFarmServerTreePage(ReactRuntime, element, options) {
|
|
497
571
|
const state = {
|
|
498
572
|
ReactRuntime,
|
|
@@ -558,17 +632,7 @@ async function renderFarmServerTreePage(ReactRuntime, element, options) {
|
|
|
558
632
|
entry.chunk = chunk;
|
|
559
633
|
return chunk;
|
|
560
634
|
},
|
|
561
|
-
|
|
562
|
-
return ReactRuntime.createElement(
|
|
563
|
-
SERVER_HTML_TAG,
|
|
564
|
-
{
|
|
565
|
-
...key === null ? {} : { key },
|
|
566
|
-
[SERVER_HTML_ATTRIBUTE]: String(id),
|
|
567
|
-
style: { display: "contents" }
|
|
568
|
-
},
|
|
569
|
-
options.isolate(state.serverHtml.get(id))
|
|
570
|
-
);
|
|
571
|
-
},
|
|
635
|
+
...createServerHtmlParts(state, options.isolate),
|
|
572
636
|
action(id) {
|
|
573
637
|
return state.actions.get(id);
|
|
574
638
|
},
|
|
@@ -645,8 +709,19 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
|
|
|
645
709
|
})
|
|
646
710
|
);
|
|
647
711
|
const serverHtml = /* @__PURE__ */ new Map();
|
|
648
|
-
|
|
649
|
-
|
|
712
|
+
const readParts = (parts) => {
|
|
713
|
+
for (const container of parts) {
|
|
714
|
+
if (container.localName !== SERVER_HTML_TAG) continue;
|
|
715
|
+
serverHtml.set(Number(container.getAttribute(SERVER_HTML_ATTRIBUTE)), container.innerHTML);
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
readParts(root.querySelectorAll(`${SERVER_HTML_TAG}[${SERVER_HTML_ATTRIBUTE}]`));
|
|
719
|
+
const templates = /* @__PURE__ */ new Map();
|
|
720
|
+
for (const template of root.querySelectorAll(
|
|
721
|
+
`${SERVER_HTML_TEMPLATE_TAG}[${SERVER_HTML_ATTRIBUTE}]`
|
|
722
|
+
)) {
|
|
723
|
+
templates.set(Number(template.getAttribute(SERVER_HTML_ATTRIBUTE)), template.innerHTML);
|
|
724
|
+
readParts(template.content.children);
|
|
650
725
|
}
|
|
651
726
|
const resolver = {
|
|
652
727
|
component(reference, exportName) {
|
|
@@ -683,6 +758,15 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
|
|
|
683
758
|
dangerouslySetInnerHTML: { __html: html }
|
|
684
759
|
});
|
|
685
760
|
},
|
|
761
|
+
unrendered(ids) {
|
|
762
|
+
const id = ids.find((candidate) => templates.has(candidate));
|
|
763
|
+
if (id === void 0) return null;
|
|
764
|
+
return ReactRuntime.createElement(SERVER_HTML_TEMPLATE_TAG, {
|
|
765
|
+
[SERVER_HTML_ATTRIBUTE]: String(id),
|
|
766
|
+
suppressHydrationWarning: true,
|
|
767
|
+
dangerouslySetInnerHTML: { __html: templates.get(id) }
|
|
768
|
+
});
|
|
769
|
+
},
|
|
686
770
|
action(id) {
|
|
687
771
|
if (!options.actions) throw new Error("server action props need islands mode");
|
|
688
772
|
return options.actions(id);
|