@farm.js/core 0.1.66 → 0.1.67
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-BFu9xHAi.d.ts} +1 -1
- package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-DWyWkTSy.d.mts} +1 -1
- package/dist/agent-runtime.cjs +6 -5
- package/dist/agent-runtime.d.mts +6 -6
- package/dist/agent-runtime.d.ts +6 -6
- package/dist/agent-runtime.mjs +5 -4
- package/dist/analyzer-KVZGVY5Q.cjs +16 -0
- package/dist/{analyzer-4UFP4HVP.mjs → analyzer-TTIIXXMQ.mjs} +2 -2
- 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 +59 -0
- package/dist/api/node.d.ts +59 -0
- package/dist/api/node.mjs +223 -0
- package/dist/api/route-manager.cjs +11 -11
- package/dist/api/route-manager.d.mts +10 -9
- package/dist/api/route-manager.d.ts +10 -9
- package/dist/api/route-manager.mjs +10 -10
- package/dist/api/runtime.cjs +11 -7
- package/dist/api/runtime.d.mts +7 -7
- package/dist/api/runtime.d.ts +7 -7
- 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 +11 -10
- package/dist/api.d.ts +11 -10
- package/dist/api.mjs +16 -12
- package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-CRmjN5j9.d.mts} +1 -1
- package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-CwfhGrVR.d.ts} +1 -1
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +7 -7
- package/dist/app-markdown.d.ts +7 -7
- package/dist/app-markdown.mjs +4 -4
- package/dist/{app.d-x68Cwr0_.d.ts → app.d-BX9LVTiP.d.ts} +50 -9
- package/dist/{app.d-kuoVWhWM.d.mts → app.d-uBBUxwyV.d.mts} +50 -9
- package/dist/{chunk-V56632LA.cjs → chunk-22IWL4YD.cjs} +19 -5
- package/dist/{chunk-RY4ABNPE.cjs → chunk-23PVOIPT.cjs} +3 -3
- 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-RVGSVQWT.mjs → chunk-3T5TLFCQ.mjs} +10 -5
- package/dist/{chunk-XBSKPLHF.cjs → chunk-3T7ALZJF.cjs} +2 -2
- package/dist/{chunk-7ONGIFYX.cjs → chunk-4DRINDGN.cjs} +319 -138
- package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
- package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
- package/dist/{chunk-JGAE5XPL.cjs → chunk-4JX3M4C6.cjs} +2 -1
- package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
- package/dist/{chunk-CHYTADNK.cjs → chunk-556H7JCE.cjs} +65 -48
- package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
- package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
- package/dist/{chunk-TZVUF5JJ.mjs → chunk-5TA63JD3.mjs} +4 -4
- package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
- package/dist/chunk-6I4BFRE7.cjs +51 -0
- package/dist/{chunk-4TVPYN32.cjs → chunk-6R53ZWX2.cjs} +7 -7
- package/dist/{chunk-MGKW5XZE.cjs → chunk-6SQZXRJ2.cjs} +7 -7
- package/dist/{chunk-MPJEIHW2.cjs → chunk-6V5YWI4W.cjs} +2 -2
- package/dist/{chunk-BM2LH2JM.mjs → chunk-6YBYX4K4.mjs} +13 -12
- package/dist/{chunk-X3XUZWRB.mjs → chunk-724MGMIL.mjs} +17 -3
- package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
- package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
- package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
- 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-ZEXE4TGY.mjs → chunk-AQDLVHNF.mjs} +230 -110
- package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
- package/dist/chunk-AQIRXBBY.cjs +26 -0
- 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-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
- package/dist/{chunk-UBMHQVWN.mjs → chunk-CO3YMZFD.mjs} +1 -1
- package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
- package/dist/{chunk-CNNBFGL5.cjs → chunk-DB2HSHQA.cjs} +14 -14
- package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
- package/dist/{chunk-DVKH2RVN.cjs → chunk-DCXSIEFE.cjs} +40 -41
- package/dist/{chunk-D4MRNBVF.cjs → chunk-DGOFR7D5.cjs} +2 -2
- package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
- package/dist/chunk-DXZ57EPE.mjs +375 -0
- package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
- package/dist/{chunk-BYRZ5VTH.mjs → chunk-E6CD45JK.mjs} +30 -31
- 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-E552H232.cjs → chunk-F43OG25P.cjs} +1 -1
- package/dist/{chunk-UAQD67HM.mjs → chunk-F7JKVHU2.mjs} +1 -1
- package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
- package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
- package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
- package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
- package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
- package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
- package/dist/{chunk-672ISQIG.mjs → chunk-GTV2ABO7.mjs} +218 -37
- package/dist/{chunk-MPIGW42F.mjs → chunk-H37MDCPR.mjs} +1 -1
- package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
- package/dist/{chunk-25T5VXOE.mjs → chunk-HFHJJXSV.mjs} +106 -19
- package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
- package/dist/{chunk-BIF5MLTH.cjs → chunk-HM7AGSKU.cjs} +1 -1
- package/dist/{chunk-GL7N5UHF.cjs → chunk-HNVAZGQD.cjs} +20 -9
- package/dist/{chunk-SK7QSNWE.mjs → chunk-HP2DQGQH.mjs} +1 -1
- package/dist/{chunk-435QJNC2.mjs → chunk-HRPTMX5C.mjs} +4 -4
- package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
- package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
- package/dist/{chunk-VQJHT2ND.mjs → chunk-IRA2CZAY.mjs} +2 -2
- package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
- package/dist/chunk-J6TZRYCO.cjs +22 -0
- package/dist/{chunk-WYAXRIYP.cjs → chunk-J7JHVCWA.cjs} +8 -8
- package/dist/chunk-JSOCDYER.cjs +375 -0
- package/dist/{chunk-TKK5QHKZ.mjs → chunk-JVM3DKZE.mjs} +3 -3
- package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
- package/dist/{chunk-BQWBHWEW.mjs → chunk-JWSI5WO4.mjs} +1 -1
- 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-3CCAICF7.cjs → chunk-KCY52OUQ.cjs} +4 -4
- package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
- package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
- package/dist/{chunk-RFKTJTWZ.mjs → chunk-KWFNUODD.mjs} +2 -1
- package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
- package/dist/{chunk-752IHQTD.cjs → chunk-LPIZMU7D.cjs} +12 -12
- package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
- package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
- package/dist/{chunk-E4UDLFWR.cjs → chunk-N5DQMOAG.cjs} +588 -677
- package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
- package/dist/{chunk-CBOEJ5Z4.cjs → chunk-OB3IFUK6.cjs} +133 -46
- package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
- 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-4OSOLDPL.cjs → chunk-PL6RTBDE.cjs} +2 -2
- package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
- package/dist/{chunk-WMTBBQHY.cjs → chunk-PPX7UOFY.cjs} +271 -151
- package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
- package/dist/{chunk-7XGWBPQQ.cjs → chunk-Q37INCXG.cjs} +13 -8
- package/dist/{chunk-OP7LHY4Y.cjs → chunk-Q5UX55YA.cjs} +1445 -601
- package/dist/{chunk-NHQM2Q4I.cjs → chunk-QGQP6QKO.cjs} +2 -2
- package/dist/{chunk-IT6WRNGB.cjs → chunk-QITSS4TD.cjs} +1381 -626
- package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
- package/dist/{chunk-HCGWDRZO.mjs → chunk-QJVW76JG.mjs} +17 -6
- package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
- package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +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-E4RDMG3K.mjs → chunk-TEG6HJVF.mjs} +4 -4
- package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
- package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
- package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
- package/dist/{chunk-W2ZXMMHA.mjs → chunk-UHE5JUKB.mjs} +1 -1
- package/dist/{chunk-OB7VKCUZ.mjs → chunk-UHNSY2PQ.mjs} +1302 -458
- package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
- package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
- package/dist/{chunk-WVYRLP5E.mjs → chunk-V5MQMQ2P.mjs} +1 -1
- package/dist/{chunk-VBCQ5WOI.cjs → chunk-V5RTHYJB.cjs} +30 -10
- package/dist/{chunk-WFWFECDW.mjs → chunk-VK54PDQ6.mjs} +25 -5
- package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
- package/dist/{chunk-XBSLKXBL.mjs → chunk-WDD5CTZW.mjs} +49 -32
- package/dist/{chunk-EMNKZGF4.mjs → chunk-WGHY3OL5.mjs} +354 -443
- package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
- 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-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
- package/dist/{chunk-AZUUKA66.mjs → chunk-XNZWMXCF.mjs} +1090 -335
- package/dist/{chunk-FIR62CR3.mjs → chunk-XUES6OET.mjs} +1 -1
- package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
- package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
- 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-O75GQVUK.mjs → chunk-YQYTQJZN.mjs} +1 -1
- package/dist/{chunk-X4K7TYN6.cjs → chunk-YVTS3S3F.cjs} +24 -23
- package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
- package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
- 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-CDRvRmbU.d.mts} +2 -2
- package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DWRKyAp5.d.ts} +2 -2
- package/dist/client-plugins.cjs +2 -2
- package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-BNILjfX3.d.mts} +94 -140
- package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CrKZiNSN.d.ts} +94 -140
- package/dist/client-plugins.d.mts +6 -6
- package/dist/client-plugins.d.ts +6 -6
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +11 -9
- package/dist/client.d.mts +13 -13
- package/dist/client.d.ts +13 -13
- 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 +6 -6
- package/dist/config.d.ts +6 -6
- 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 +2 -2
- package/dist/deployment.mjs +1 -1
- package/dist/desktop.d.mts +7 -7
- package/dist/desktop.d.ts +7 -7
- package/dist/{devtools-N2JQCMXB.cjs → devtools-RZVT4JVN.cjs} +36 -32
- package/dist/{devtools-NZUVNUP3.mjs → devtools-UFQYT3VA.mjs} +31 -27
- package/dist/docs.cjs +26 -25
- package/dist/docs.d.mts +20 -8
- package/dist/docs.d.ts +20 -8
- package/dist/docs.mjs +25 -24
- package/dist/env-types.cjs +3 -3
- package/dist/env-types.mjs +2 -2
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.mjs +4 -4
- 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 +142 -127
- package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bdm6866n.d.mts} +1 -1
- package/dist/{index.d-A_x10zGS.d.ts → index.d-Dey5T14f.d.ts} +1 -1
- package/dist/index.d.mts +31 -82
- package/dist/index.d.ts +31 -82
- package/dist/index.mjs +213 -198
- package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
- package/dist/integrations/orm.d.mts +33 -0
- package/dist/integrations/orm.d.ts +33 -0
- package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
- package/dist/integrations.cjs +6 -5
- package/dist/integrations.d.mts +6 -6
- package/dist/integrations.d.ts +6 -6
- package/dist/integrations.mjs +5 -4
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +17 -8
- package/dist/internal/app-markdown-runtime.d.ts +17 -8
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +68 -66
- package/dist/internal/build-runtime.d.mts +8 -8
- package/dist/internal/build-runtime.d.ts +8 -8
- package/dist/internal/build-runtime.mjs +67 -65
- package/dist/internal/cli-runtime.cjs +45 -44
- package/dist/internal/cli-runtime.mjs +44 -43
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +60 -6
- package/dist/internal/client-runtime.d.mts +40 -11
- package/dist/internal/client-runtime.d.ts +40 -11
- package/dist/internal/client-runtime.mjs +58 -4
- package/dist/internal/compression-runtime.d.mts +6 -6
- package/dist/internal/compression-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.cjs +25 -24
- package/dist/internal/config-runtime.d.mts +9 -9
- package/dist/internal/config-runtime.d.ts +9 -9
- package/dist/internal/config-runtime.mjs +24 -23
- 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/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- 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-runtime.cjs +53 -39
- package/dist/internal/production-runtime.d.mts +16 -15
- package/dist/internal/production-runtime.d.ts +16 -15
- package/dist/internal/production-runtime.mjs +68 -54
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -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 +6 -6
- package/dist/markdown.d.ts +6 -6
- package/dist/markdown.mjs +6 -2
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +8 -8
- package/dist/middleware.d.ts +8 -8
- package/dist/middleware.mjs +9 -9
- package/dist/mobile.d.mts +4 -4
- package/dist/mobile.d.ts +4 -4
- package/dist/mount.d-BP0nLYQO.d.mts +38 -0
- package/dist/mount.d-CkiPky_F.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-DQVYKoaZ.d.mts → navigation-delegate.d-CdBP-hkZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-DchcGzAQ.d.ts} +1 -1
- package/dist/navigation.cjs +8 -7
- package/dist/navigation.d.mts +9 -9
- package/dist/navigation.d.ts +9 -9
- package/dist/navigation.mjs +7 -6
- package/dist/{nitro-DD4QCA66.mjs → nitro-55YOZWRA.mjs} +11 -11
- package/dist/{nitro-VRDX2H4M.cjs → nitro-EEX2J3KB.cjs} +13 -13
- package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
- package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
- package/dist/plugin.cjs +61 -59
- package/dist/plugin.d.mts +8 -8
- package/dist/plugin.d.ts +8 -8
- package/dist/plugin.mjs +60 -58
- package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-Dou_Htas.d.ts} +1 -1
- package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-VwsBzIee.d.mts} +1 -1
- package/dist/query/client.cjs +9 -7
- package/dist/query/client.mjs +5 -3
- package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-D8UakAIk.d.ts} +1 -1
- package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-LKymStDJ.d.mts} +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 +2 -2
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +9 -9
- package/dist/renderer-client.d.ts +9 -9
- package/dist/renderer-client.mjs +5 -3
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +20 -2
- package/dist/renderer.d.ts +20 -2
- package/dist/renderer.mjs +5 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-B1RnTLri.d.ts → request.d-B928QjWy.d.ts} +1 -1
- package/dist/{request.d-DarDOCk9.d.mts → request.d-KG-4d2eG.d.mts} +1 -1
- package/dist/request.d.mts +7 -7
- package/dist/request.d.ts +7 -7
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-DoEe_w9t.d.ts} +1 -1
- package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-NIHQeb4m.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-Cuv1jntg.d.mts → router.d-B8PkJSGp.d.mts} +1 -1
- package/dist/{router.d-CMANF6da.d.ts → router.d-DYnRHQwz.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-DgZ_jgGG.d.mts} +1 -1
- package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-uUBZyWoK.d.ts} +1 -1
- package/dist/routes.d.mts +6 -6
- package/dist/routes.d.ts +6 -6
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-7PNVJSTR.mjs → rsc-pipeline-4OJ5ZQNZ.mjs} +26 -25
- package/dist/{rsc-pipeline-Z7QBZOIJ.cjs → rsc-pipeline-7K5H2RPH.cjs} +27 -26
- package/dist/{runtime-QQHX4BP3.mjs → runtime-U7O3HZOZ.mjs} +60 -34
- package/dist/{runtime-FKFCUHSK.cjs → runtime-X52Q7JFR.cjs} +70 -44
- package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-BxQIzwfy.d.mts} +11 -3
- package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-DP7mEkEF.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-plugins.cjs +7 -7
- package/dist/server-plugins.d.mts +16 -10
- package/dist/server-plugins.d.ts +16 -10
- 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 +160 -120
- package/dist/server.d.mts +20 -14
- package/dist/server.d.ts +20 -14
- package/dist/server.mjs +138 -98
- package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-BgHPVMhz.d.mts} +15 -5
- package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-DsFDHTsv.d.ts} +15 -5
- package/dist/testing.cjs +17 -17
- package/dist/testing.d.mts +6 -6
- package/dist/testing.d.ts +6 -6
- package/dist/testing.mjs +13 -13
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-BKyKDBR1.d.mts} +1 -1
- package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-zxAVcf_V.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +63 -61
- package/dist/vite.d.mts +32 -12
- package/dist/vite.d.ts +32 -12
- package/dist/vite.mjs +62 -60
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.mjs +3 -3
- package/package.json +31 -1
- package/dist/analyzer-H7SIX6BJ.cjs +0 -16
- package/dist/chunk-5YPBFMBN.cjs +0 -19
- 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/manager-2LUKNX2N.cjs +0 -14
- /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
|
@@ -12,6 +12,7 @@ var CHUNK_ERROR_PATTERNS = [
|
|
|
12
12
|
/unable to preload CSS/i,
|
|
13
13
|
/module script failed/i
|
|
14
14
|
];
|
|
15
|
+
var LAZY_ROUTER_CHUNK = /\/farm-client-router-h[0-9a-f]+\.js(?:[?#]|$)/;
|
|
15
16
|
function isChunkLoadError(errorLike) {
|
|
16
17
|
const values = collectErrorText(errorLike);
|
|
17
18
|
if (values.some((value) => CHUNK_ERROR_PATTERNS.some((pattern) => pattern.test(value)))) {
|
|
@@ -38,6 +39,9 @@ function installChunkErrorRecovery(options = {}) {
|
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
const recover = (errorLike) => {
|
|
42
|
+
if (LAZY_ROUTER_CHUNK.test(getEventTargetAssetUrl(errorLike) ?? "")) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
41
45
|
if (!isChunkLoadError(errorLike)) {
|
|
42
46
|
return;
|
|
43
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
var _chunkRI3EVPKDcjs = require('./chunk-RI3EVPKD.cjs');
|
|
@@ -16,6 +16,9 @@ var _chunkQQ44FYROcjs = require('./chunk-QQ44FYRO.cjs');
|
|
|
16
16
|
var _chunkPENBZAHJcjs = require('./chunk-PENBZAHJ.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
19
22
|
|
|
20
23
|
|
|
21
24
|
var _chunk6IOZPJ3Icjs = require('./chunk-6IOZPJ3I.cjs');
|
|
@@ -26,10 +29,10 @@ var _chunkCQL5ZGFUcjs = require('./chunk-CQL5ZGFU.cjs');
|
|
|
26
29
|
|
|
27
30
|
|
|
28
31
|
|
|
29
|
-
var
|
|
32
|
+
var _chunkF43OG25Pcjs = require('./chunk-F43OG25P.cjs');
|
|
30
33
|
|
|
31
34
|
|
|
32
|
-
var
|
|
35
|
+
var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
|
|
33
36
|
|
|
34
37
|
// src/client/metadata-reconciler.ts
|
|
35
38
|
var MANAGED_ATTRIBUTE = _chunk6IOZPJ3Icjs.FARM_METADATA_ATTRIBUTE;
|
|
@@ -92,6 +95,14 @@ function applyFarmMetadataToDocument(metadata, pathname) {
|
|
|
92
95
|
|
|
93
96
|
// src/client/spa-router.ts
|
|
94
97
|
var MAX_CONCURRENT_VIEWPORT_PREFETCHES = 4;
|
|
98
|
+
var MAX_PAGE_DATA_REDIRECTS = 20;
|
|
99
|
+
var FarmPageDataRedirectSignal = class extends Error {
|
|
100
|
+
constructor(redirect) {
|
|
101
|
+
super(`Page data redirected to ${redirect.location}`);
|
|
102
|
+
this.redirect = redirect;
|
|
103
|
+
this.name = "FarmPageDataRedirect";
|
|
104
|
+
}
|
|
105
|
+
};
|
|
95
106
|
var FARM_PAGE_STATE_KEY = "__farmPageState";
|
|
96
107
|
var FARM_INTERCEPT_FROM_KEY = "__farmInterceptFrom";
|
|
97
108
|
var FARM_HISTORY_INDEX_KEY = "__farmHistoryIndex";
|
|
@@ -217,7 +228,10 @@ var SPARouter = class {
|
|
|
217
228
|
/**
|
|
218
229
|
* Navigate to a new URL
|
|
219
230
|
*/
|
|
220
|
-
|
|
231
|
+
navigate(href, options = {}) {
|
|
232
|
+
return this.runNavigation(href, options, 0);
|
|
233
|
+
}
|
|
234
|
+
async runNavigation(href, options, redirectCount) {
|
|
221
235
|
const {
|
|
222
236
|
replace = false,
|
|
223
237
|
scroll = true,
|
|
@@ -255,15 +269,17 @@ var SPARouter = class {
|
|
|
255
269
|
}
|
|
256
270
|
const from = window.location.pathname + window.location.search;
|
|
257
271
|
const action = replace ? "replace" : "push";
|
|
258
|
-
if (
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
this.
|
|
272
|
+
if (redirectCount === 0) {
|
|
273
|
+
if (await this.shouldBlockNavigation({ from, to: fullPath, action })) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (!(refresh && fullPath === from) && await _chunkJIBEFLQ7cjs.runFarmNavigationDelegates.call(void 0, { url: url.href, from, to: fullPath, action })) {
|
|
277
|
+
this.cancelActiveNavigation();
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (this.options.scrollRestoration) {
|
|
281
|
+
this.saveScrollPosition(window.location.pathname + window.location.search);
|
|
282
|
+
}
|
|
267
283
|
}
|
|
268
284
|
const navigation = this.startNavigation({
|
|
269
285
|
from,
|
|
@@ -278,13 +294,17 @@ var SPARouter = class {
|
|
|
278
294
|
action: replace ? "replace" : "push"
|
|
279
295
|
})]);
|
|
280
296
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
281
|
-
const pageData = await
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
297
|
+
const pageData = await this.fetchPageData(
|
|
298
|
+
fullPath,
|
|
299
|
+
true,
|
|
300
|
+
from,
|
|
301
|
+
refresh,
|
|
302
|
+
navigation.controller.signal,
|
|
303
|
+
true
|
|
304
|
+
);
|
|
285
305
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
286
306
|
if (clientNavigation) {
|
|
287
|
-
await _optionalChain([this, 'access',
|
|
307
|
+
await _optionalChain([this, 'access', _15 => _15.clientPlugins, 'optionalAccess', _16 => _16.markNavigationLoaded, 'call', _17 => _17(clientNavigation, pageData)]);
|
|
288
308
|
}
|
|
289
309
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
290
310
|
await this.runViewTransition(
|
|
@@ -302,20 +322,53 @@ var SPARouter = class {
|
|
|
302
322
|
);
|
|
303
323
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
304
324
|
if (clientNavigation) {
|
|
305
|
-
await _optionalChain([this, 'access',
|
|
306
|
-
void _optionalChain([this, 'access',
|
|
325
|
+
await _optionalChain([this, 'access', _18 => _18.clientPlugins, 'optionalAccess', _19 => _19.resolveNavigation, 'call', _20 => _20(clientNavigation)]);
|
|
326
|
+
void _optionalChain([this, 'access', _21 => _21.clientPlugins, 'optionalAccess', _22 => _22.scheduleNavigationRendered, 'call', _23 => _23(clientNavigation)]);
|
|
307
327
|
}
|
|
308
328
|
this.finishNavigation(navigation);
|
|
309
329
|
} catch (error) {
|
|
310
330
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
331
|
+
if (error instanceof FarmPageDataRedirectSignal) {
|
|
332
|
+
await this.followPageDataRedirect(
|
|
333
|
+
error.redirect,
|
|
334
|
+
url,
|
|
335
|
+
options,
|
|
336
|
+
redirectCount,
|
|
337
|
+
clientNavigation
|
|
338
|
+
);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
311
341
|
if (clientNavigation) {
|
|
312
|
-
await _optionalChain([this, 'access',
|
|
342
|
+
await _optionalChain([this, 'access', _24 => _24.clientPlugins, 'optionalAccess', _25 => _25.failNavigation, 'call', _26 => _26(clientNavigation, error)]);
|
|
313
343
|
}
|
|
314
344
|
this.finishNavigation(navigation);
|
|
315
345
|
console.error("[Farm.js] Navigation error:", error);
|
|
316
346
|
window.location.href = href;
|
|
317
347
|
}
|
|
318
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Continue a navigation whose page data redirected, as a document load
|
|
351
|
+
* follows a server redirect: the target takes the history entry the
|
|
352
|
+
* redirecting URL would have had, inherits its fragment when the target has
|
|
353
|
+
* none, and leaves the app when it is cross-origin.
|
|
354
|
+
*/
|
|
355
|
+
followPageDataRedirect(redirect, from, options, redirectCount, clientNavigation) {
|
|
356
|
+
if (clientNavigation) _optionalChain([this, 'access', _27 => _27.clientPlugins, 'optionalAccess', _28 => _28.cancelNavigation, 'optionalCall', _29 => _29(clientNavigation, "superseded")]);
|
|
357
|
+
const target = resolvePageDataRedirectTarget(redirect.location, from);
|
|
358
|
+
const replace = options.replace === true || target !== null && target.pathname + target.search === window.location.pathname + window.location.search;
|
|
359
|
+
if (!target || redirectCount >= MAX_PAGE_DATA_REDIRECTS) {
|
|
360
|
+
this.cancelActiveNavigation();
|
|
361
|
+
const documentURL = (_nullishCoalesce(target, () => ( from))).href;
|
|
362
|
+
if (replace) window.location.replace(documentURL);
|
|
363
|
+
else window.location.assign(documentURL);
|
|
364
|
+
return Promise.resolve();
|
|
365
|
+
}
|
|
366
|
+
return this.runNavigation(
|
|
367
|
+
target.href,
|
|
368
|
+
{ ...options, replace, refresh: true },
|
|
369
|
+
redirectCount + 1
|
|
370
|
+
);
|
|
371
|
+
}
|
|
319
372
|
/**
|
|
320
373
|
* Re-render the active route from the server while preserving the document,
|
|
321
374
|
* shared layouts, client runtime, and browser history entry.
|
|
@@ -343,9 +396,11 @@ var SPARouter = class {
|
|
|
343
396
|
if (this.isCached(fullPath, interceptFrom)) return;
|
|
344
397
|
this.prefetchingUrls.add(fullPath);
|
|
345
398
|
try {
|
|
346
|
-
await this.fetchPageData(fullPath, false, interceptFrom);
|
|
399
|
+
await this.fetchPageData(fullPath, false, interceptFrom, false, void 0, true);
|
|
347
400
|
} catch (error) {
|
|
348
|
-
|
|
401
|
+
if (!(error instanceof FarmPageDataRedirectSignal)) {
|
|
402
|
+
console.warn("[Farm.js] Prefetch failed:", href, error);
|
|
403
|
+
}
|
|
349
404
|
} finally {
|
|
350
405
|
this.prefetchingUrls.delete(fullPath);
|
|
351
406
|
}
|
|
@@ -561,7 +616,7 @@ var SPARouter = class {
|
|
|
561
616
|
/**
|
|
562
617
|
* Fetch page data from cache or server
|
|
563
618
|
*/
|
|
564
|
-
async fetchPageData(path, recover = true, interceptFrom, fresh = false, signal) {
|
|
619
|
+
async fetchPageData(path, recover = true, interceptFrom, fresh = false, signal, readDocument = false) {
|
|
565
620
|
const cacheKey = getPageDataCacheKey(path, interceptFrom);
|
|
566
621
|
const cached = fresh ? void 0 : this.cache.get(cacheKey);
|
|
567
622
|
if (cached && Date.now() - cached.timestamp < this.options.cacheMaxAge) {
|
|
@@ -603,6 +658,16 @@ var SPARouter = class {
|
|
|
603
658
|
}
|
|
604
659
|
};
|
|
605
660
|
try {
|
|
661
|
+
const documentData = readDocument && this.options.fetchNavigationDocument ? await this.options.fetchNavigationDocument(path, {
|
|
662
|
+
signal,
|
|
663
|
+
refresh: fresh,
|
|
664
|
+
prefetch: !recover
|
|
665
|
+
}) : null;
|
|
666
|
+
if (documentData) {
|
|
667
|
+
if (!recover) cacheData(documentData);
|
|
668
|
+
_optionalChain([prefetch2, 'optionalAccess', _45 => _45.resolve, 'call', _46 => _46(documentData)]);
|
|
669
|
+
return documentData;
|
|
670
|
+
}
|
|
606
671
|
return await this.requestPageData(
|
|
607
672
|
path,
|
|
608
673
|
recover,
|
|
@@ -610,10 +675,10 @@ var SPARouter = class {
|
|
|
610
675
|
activeLayoutChain,
|
|
611
676
|
signal,
|
|
612
677
|
cacheData,
|
|
613
|
-
_optionalChain([prefetch2, 'optionalAccess',
|
|
678
|
+
_optionalChain([prefetch2, 'optionalAccess', _47 => _47.resolve])
|
|
614
679
|
);
|
|
615
680
|
} finally {
|
|
616
|
-
_optionalChain([prefetch2, 'optionalAccess',
|
|
681
|
+
_optionalChain([prefetch2, 'optionalAccess', _48 => _48.resolve, 'call', _49 => _49(void 0)]);
|
|
617
682
|
if (prefetch2 && this.pendingPrefetches.get(prefetchKey) === prefetch2) {
|
|
618
683
|
this.pendingPrefetches.delete(prefetchKey);
|
|
619
684
|
}
|
|
@@ -622,7 +687,7 @@ var SPARouter = class {
|
|
|
622
687
|
async requestPageData(path, recover, interceptFrom, activeLayoutChain, signal, cacheData, resolvePrefetch) {
|
|
623
688
|
const response = await fetch(`/__farm/page-data?path=${encodeURIComponent(path)}`, {
|
|
624
689
|
signal,
|
|
625
|
-
headers:
|
|
690
|
+
headers: _chunkF43OG25Pcjs.createFarmDeploymentRequestHeaders.call(void 0, this.options.deploymentId, {
|
|
626
691
|
Accept: "application/x-farm-deferred+json, application/json",
|
|
627
692
|
"X-Farm-SPA": "1",
|
|
628
693
|
...activeLayoutChain ? { "X-Farm-Layout-Chain": activeLayoutChain } : {},
|
|
@@ -631,8 +696,8 @@ var SPARouter = class {
|
|
|
631
696
|
..._chunkCQL5ZGFUcjs.getFarmIslandValueHeaders.call(void 0, )
|
|
632
697
|
})
|
|
633
698
|
});
|
|
634
|
-
if (
|
|
635
|
-
const error =
|
|
699
|
+
if (_chunkF43OG25Pcjs.isFarmDeploymentMismatchResponse.call(void 0, response, this.options.deploymentId)) {
|
|
700
|
+
const error = _chunkF43OG25Pcjs.createFarmDeploymentMismatchError.call(void 0,
|
|
636
701
|
response,
|
|
637
702
|
this.options.deploymentId || "unknown"
|
|
638
703
|
);
|
|
@@ -642,24 +707,26 @@ var SPARouter = class {
|
|
|
642
707
|
}
|
|
643
708
|
throw error;
|
|
644
709
|
}
|
|
710
|
+
const redirect = await _chunkRWR7SMD7cjs.readFarmPageDataRedirect.call(void 0, response);
|
|
711
|
+
if (redirect) throw new FarmPageDataRedirectSignal(redirect);
|
|
645
712
|
if (!response.ok) {
|
|
646
713
|
throw new Error(`Failed to fetch page data: ${response.status}`);
|
|
647
714
|
}
|
|
648
715
|
const isDeferredResponse = (response.headers.get("Content-Type") || "").toLowerCase().startsWith("application/x-farm-deferred+json");
|
|
649
716
|
if (!isDeferredResponse) {
|
|
650
|
-
const data2 = await
|
|
717
|
+
const data2 = await _chunkDBYNZIIQcjs.readDeferredDataResponse.call(void 0, response);
|
|
651
718
|
cacheData(data2);
|
|
652
|
-
_optionalChain([resolvePrefetch, 'optionalCall',
|
|
719
|
+
_optionalChain([resolvePrefetch, 'optionalCall', _50 => _50(data2)]);
|
|
653
720
|
return data2;
|
|
654
721
|
}
|
|
655
|
-
_optionalChain([resolvePrefetch, 'optionalCall',
|
|
722
|
+
_optionalChain([resolvePrefetch, 'optionalCall', _51 => _51(void 0)]);
|
|
656
723
|
let data;
|
|
657
724
|
let streamCompleted = false;
|
|
658
725
|
const markStreamComplete = () => {
|
|
659
726
|
streamCompleted = true;
|
|
660
727
|
if (data) cacheData(data);
|
|
661
728
|
};
|
|
662
|
-
data = await
|
|
729
|
+
data = await _chunkDBYNZIIQcjs.readDeferredDataResponse.call(void 0, response, {
|
|
663
730
|
onComplete: markStreamComplete
|
|
664
731
|
});
|
|
665
732
|
if (streamCompleted) cacheData(data);
|
|
@@ -711,7 +778,7 @@ var SPARouter = class {
|
|
|
711
778
|
}
|
|
712
779
|
const path = window.location.pathname + window.location.search;
|
|
713
780
|
const from = _nullishCoalesce(this.currentHistoryPath, () => ( path));
|
|
714
|
-
if (path === from && window.location.hash !== this.currentHistoryHash && _optionalChain([event, 'access',
|
|
781
|
+
if (path === from && window.location.hash !== this.currentHistoryHash && _optionalChain([event, 'access', _52 => _52.state, 'optionalAccess', _53 => _53[FARM_INTERCEPT_FROM_KEY]]) === this.currentInterceptFrom) {
|
|
715
782
|
this.cancelActiveNavigation();
|
|
716
783
|
this.currentHistoryHash = window.location.hash;
|
|
717
784
|
this.currentHistoryIndex = readHistoryIndex(event.state);
|
|
@@ -727,7 +794,7 @@ var SPARouter = class {
|
|
|
727
794
|
}
|
|
728
795
|
this.currentHistoryPath = path;
|
|
729
796
|
this.currentHistoryHash = window.location.hash;
|
|
730
|
-
this.currentInterceptFrom = _optionalChain([event, 'access',
|
|
797
|
+
this.currentInterceptFrom = _optionalChain([event, 'access', _54 => _54.state, 'optionalAccess', _55 => _55[FARM_INTERCEPT_FROM_KEY]]);
|
|
731
798
|
this.currentHistoryIndex = readHistoryIndex(event.state);
|
|
732
799
|
const navigation = this.startNavigation({
|
|
733
800
|
from,
|
|
@@ -736,13 +803,13 @@ var SPARouter = class {
|
|
|
736
803
|
});
|
|
737
804
|
let clientNavigation;
|
|
738
805
|
try {
|
|
739
|
-
clientNavigation = await _optionalChain([this, 'access',
|
|
806
|
+
clientNavigation = await _optionalChain([this, 'access', _56 => _56.clientPlugins, 'optionalAccess', _57 => _57.beginNavigation, 'call', _58 => _58({
|
|
740
807
|
from: null,
|
|
741
808
|
to: window.location.href,
|
|
742
809
|
action: "pop"
|
|
743
810
|
})]);
|
|
744
811
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
745
|
-
const interceptFrom = typeof _optionalChain([event, 'access',
|
|
812
|
+
const interceptFrom = typeof _optionalChain([event, 'access', _59 => _59.state, 'optionalAccess', _60 => _60[FARM_INTERCEPT_FROM_KEY]]) === "string" ? event.state[FARM_INTERCEPT_FROM_KEY] : void 0;
|
|
746
813
|
const pageData = await this.fetchPageData(
|
|
747
814
|
path,
|
|
748
815
|
true,
|
|
@@ -752,7 +819,7 @@ var SPARouter = class {
|
|
|
752
819
|
);
|
|
753
820
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
754
821
|
if (clientNavigation) {
|
|
755
|
-
await _optionalChain([this, 'access',
|
|
822
|
+
await _optionalChain([this, 'access', _61 => _61.clientPlugins, 'optionalAccess', _62 => _62.markNavigationLoaded, 'call', _63 => _63(clientNavigation, pageData)]);
|
|
756
823
|
}
|
|
757
824
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
758
825
|
this.updateDocumentMetadata(pageData.metadata);
|
|
@@ -775,14 +842,24 @@ var SPARouter = class {
|
|
|
775
842
|
this.restoreScrollElements(destinationPath);
|
|
776
843
|
}
|
|
777
844
|
if (clientNavigation) {
|
|
778
|
-
await _optionalChain([this, 'access',
|
|
779
|
-
void _optionalChain([this, 'access',
|
|
845
|
+
await _optionalChain([this, 'access', _64 => _64.clientPlugins, 'optionalAccess', _65 => _65.resolveNavigation, 'call', _66 => _66(clientNavigation)]);
|
|
846
|
+
void _optionalChain([this, 'access', _67 => _67.clientPlugins, 'optionalAccess', _68 => _68.scheduleNavigationRendered, 'call', _69 => _69(clientNavigation)]);
|
|
780
847
|
}
|
|
781
848
|
this.finishNavigation(navigation);
|
|
782
849
|
} catch (error) {
|
|
783
850
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
851
|
+
if (error instanceof FarmPageDataRedirectSignal) {
|
|
852
|
+
await this.followPageDataRedirect(
|
|
853
|
+
error.redirect,
|
|
854
|
+
new URL(window.location.href),
|
|
855
|
+
{ replace: true },
|
|
856
|
+
0,
|
|
857
|
+
clientNavigation
|
|
858
|
+
);
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
784
861
|
if (clientNavigation) {
|
|
785
|
-
await _optionalChain([this, 'access',
|
|
862
|
+
await _optionalChain([this, 'access', _70 => _70.clientPlugins, 'optionalAccess', _71 => _71.failNavigation, 'call', _72 => _72(clientNavigation, error)]);
|
|
786
863
|
}
|
|
787
864
|
this.finishNavigation(navigation);
|
|
788
865
|
console.error("[Farm.js] Popstate navigation error:", error);
|
|
@@ -822,7 +899,7 @@ var SPARouter = class {
|
|
|
822
899
|
shouldBlockUnload() {
|
|
823
900
|
for (const blocker of this.blockers) {
|
|
824
901
|
try {
|
|
825
|
-
if (_optionalChain([this, 'access',
|
|
902
|
+
if (_optionalChain([this, 'access', _73 => _73.unloadBlockers, 'access', _74 => _74.get, 'call', _75 => _75(blocker), 'optionalCall', _76 => _76()])) return true;
|
|
826
903
|
} catch (e4) {
|
|
827
904
|
return true;
|
|
828
905
|
}
|
|
@@ -833,7 +910,7 @@ var SPARouter = class {
|
|
|
833
910
|
applyFarmMetadataToDocument(metadata, window.location.pathname);
|
|
834
911
|
}
|
|
835
912
|
startNavigation(options) {
|
|
836
|
-
_optionalChain([this, 'access',
|
|
913
|
+
_optionalChain([this, 'access', _77 => _77.activeNavigation, 'optionalAccess', _78 => _78.controller, 'access', _79 => _79.abort, 'call', _80 => _80("superseded")]);
|
|
837
914
|
const navigation = {
|
|
838
915
|
id: ++this.navigationSequence,
|
|
839
916
|
controller: new AbortController()
|
|
@@ -850,10 +927,10 @@ var SPARouter = class {
|
|
|
850
927
|
return navigation;
|
|
851
928
|
}
|
|
852
929
|
isCurrentNavigation(navigation, clientNavigation) {
|
|
853
|
-
return _optionalChain([this, 'access',
|
|
930
|
+
return _optionalChain([this, 'access', _81 => _81.activeNavigation, 'optionalAccess', _82 => _82.id]) === navigation.id && !navigation.controller.signal.aborted && !_optionalChain([clientNavigation, 'optionalAccess', _83 => _83.signal, 'access', _84 => _84.aborted]);
|
|
854
931
|
}
|
|
855
932
|
finishNavigation(navigation) {
|
|
856
|
-
if (_optionalChain([this, 'access',
|
|
933
|
+
if (_optionalChain([this, 'access', _85 => _85.activeNavigation, 'optionalAccess', _86 => _86.id]) !== navigation.id) return;
|
|
857
934
|
this.activeNavigation = void 0;
|
|
858
935
|
this.setNavigationState(IDLE_NAVIGATION_STATE);
|
|
859
936
|
}
|
|
@@ -963,7 +1040,7 @@ function readBrowserDeploymentId() {
|
|
|
963
1040
|
if (typeof window === "undefined") return void 0;
|
|
964
1041
|
const runtimeId = window.__FARM_DEPLOYMENT_ID__;
|
|
965
1042
|
if (typeof runtimeId === "string" && runtimeId) return runtimeId;
|
|
966
|
-
return _optionalChain([document, 'access',
|
|
1043
|
+
return _optionalChain([document, 'access', _87 => _87.querySelector, 'call', _88 => _88('meta[name="farm-deployment-id"]'), 'optionalAccess', _89 => _89.content]);
|
|
967
1044
|
}
|
|
968
1045
|
function dispatchDeploymentMismatch(error) {
|
|
969
1046
|
if (typeof window === "undefined" || typeof CustomEvent === "undefined") return;
|
|
@@ -1019,6 +1096,16 @@ function createHistoryState(path, pageState, currentState, interceptFrom) {
|
|
|
1019
1096
|
}
|
|
1020
1097
|
return nextState;
|
|
1021
1098
|
}
|
|
1099
|
+
function resolvePageDataRedirectTarget(location, from) {
|
|
1100
|
+
let target;
|
|
1101
|
+
try {
|
|
1102
|
+
target = new URL(location, from);
|
|
1103
|
+
} catch (e9) {
|
|
1104
|
+
return null;
|
|
1105
|
+
}
|
|
1106
|
+
if (!target.hash && from.hash) target.hash = from.hash;
|
|
1107
|
+
return target;
|
|
1108
|
+
}
|
|
1022
1109
|
function getPageDataCacheKey(path, interceptFrom) {
|
|
1023
1110
|
return interceptFrom ? `${path}
|
|
1024
1111
|
intercept:${interceptFrom}` : path;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
// src/api/endpoint.ts
|
|
14
14
|
import { createEndpoint as betterCallEndpoint } from "better-call";
|
|
15
|
+
var ENDPOINT_FAILURE_SYMBOL = /* @__PURE__ */ Symbol.for("farm.endpoint.failure");
|
|
15
16
|
var EndpointFailure = class extends Error {
|
|
16
17
|
constructor(code, data, options) {
|
|
17
18
|
super(options.message);
|
|
@@ -19,10 +20,14 @@ var EndpointFailure = class extends Error {
|
|
|
19
20
|
this.code = code;
|
|
20
21
|
this.data = data;
|
|
21
22
|
this.status = options.status;
|
|
23
|
+
Object.defineProperty(this, ENDPOINT_FAILURE_SYMBOL, { value: true, enumerable: false });
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
function isEndpointFailure(value) {
|
|
25
|
-
|
|
27
|
+
if (value instanceof EndpointFailure) return true;
|
|
28
|
+
if (!value || typeof value !== "object") return false;
|
|
29
|
+
const candidate = value;
|
|
30
|
+
return candidate[ENDPOINT_FAILURE_SYMBOL] === true && typeof candidate.code === "string" && Number.isInteger(candidate.status) && candidate.status >= 400 && candidate.status <= 599;
|
|
26
31
|
}
|
|
27
32
|
function createEndpoint(pathOrOptions, optionsOrHandler, maybeHandler) {
|
|
28
33
|
let path;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
|
|
@@ -17,7 +17,8 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
var _chunkXGTFLG73cjs = require('./chunk-XGTFLG73.cjs');
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
var _chunkJXIYH2NOcjs = require('./chunk-JXIYH2NO.cjs');
|
|
@@ -27,7 +28,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
|
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
var
|
|
31
|
+
var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
|
|
@@ -99,7 +100,7 @@ var APIRouteManager = class {
|
|
|
99
100
|
await this.loadProgrammaticApiRoutes(appDir);
|
|
100
101
|
}
|
|
101
102
|
this.routes = new Map(
|
|
102
|
-
|
|
103
|
+
_chunkXGTFLG73cjs.mergePluginAPIRoutes.call(void 0, [...this.routes.values()], this.plugins, void 0, {
|
|
103
104
|
bodySizeLimit: this.bodySizeLimit,
|
|
104
105
|
dispatch: this.dispatch
|
|
105
106
|
}).map((route) => [route.path, route])
|
|
@@ -147,7 +148,7 @@ var APIRouteManager = class {
|
|
|
147
148
|
const routeModule = await this.loadModule(filePath);
|
|
148
149
|
const endpoints = {};
|
|
149
150
|
const availableMethods = [];
|
|
150
|
-
for (const method of
|
|
151
|
+
for (const method of _chunkXGTFLG73cjs.API_ROUTE_METHODS) {
|
|
151
152
|
if (routeModule[method]) {
|
|
152
153
|
endpoints[method] = routeModule[method];
|
|
153
154
|
availableMethods.push(method);
|
|
@@ -163,8 +164,8 @@ var APIRouteManager = class {
|
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
const runtimeConfig =
|
|
167
|
-
|
|
167
|
+
const runtimeConfig = _chunkIUKBPBM7cjs.normalizeFarmRouteRuntimeConfig.call(void 0,
|
|
168
|
+
_chunkIUKBPBM7cjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
|
|
168
169
|
`API route "${routePath}"`
|
|
169
170
|
);
|
|
170
171
|
this.registerRouteShape(routePath, filePath, appDir);
|
|
@@ -217,7 +218,7 @@ var APIRouteManager = class {
|
|
|
217
218
|
async loadProgrammaticApiRoutes(appDir) {
|
|
218
219
|
const candidateRoots = [path.dirname(appDir), appDir];
|
|
219
220
|
const routeFiles = Array.from(
|
|
220
|
-
new Set(candidateRoots.flatMap((srcRoot) =>
|
|
221
|
+
new Set(candidateRoots.flatMap((srcRoot) => _chunkQEJWNXRIcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot)))
|
|
221
222
|
);
|
|
222
223
|
if (routeFiles.length === 0) return;
|
|
223
224
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
@@ -261,6 +262,7 @@ var APIRouteManager = class {
|
|
|
261
262
|
}
|
|
262
263
|
return null;
|
|
263
264
|
}
|
|
265
|
+
/** Load an app module through the server that loads the routes, as their handlers were. */
|
|
264
266
|
async loadModule(filePath) {
|
|
265
267
|
if (this.viteServer) {
|
|
266
268
|
return await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, this.viteServer, filePath);
|
|
@@ -304,7 +306,7 @@ var APIRouteManager = class {
|
|
|
304
306
|
}
|
|
305
307
|
addProgrammaticApiRoute(filePath, route, appDir) {
|
|
306
308
|
const modulePath = _chunkE7QOEV5Zcjs.createProgrammaticRouteModuleId.call(void 0, filePath, "api", route.path);
|
|
307
|
-
const runtimeConfig =
|
|
309
|
+
const runtimeConfig = _chunkIUKBPBM7cjs.normalizeFarmRouteRuntimeConfig.call(void 0, route, `API route "${route.path}"`);
|
|
308
310
|
for (const [method, endpoint] of Object.entries(route.methods)) {
|
|
309
311
|
if (endpoint) {
|
|
310
312
|
this.addEndpoint(route.path, modulePath, method, endpoint, appDir, runtimeConfig);
|
|
@@ -329,7 +331,7 @@ var APIRouteManager = class {
|
|
|
329
331
|
const url = new URL(request.url);
|
|
330
332
|
const pathname = url.pathname;
|
|
331
333
|
const method = request.method.toUpperCase();
|
|
332
|
-
const match =
|
|
334
|
+
const match = _chunkXGTFLG73cjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
333
335
|
if (!match) {
|
|
334
336
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
335
337
|
status: 404,
|
|
@@ -337,26 +339,23 @@ var APIRouteManager = class {
|
|
|
337
339
|
});
|
|
338
340
|
}
|
|
339
341
|
const { route, params } = match;
|
|
340
|
-
const endpoint =
|
|
342
|
+
const endpoint = _chunkXGTFLG73cjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
341
343
|
if (!endpoint) {
|
|
342
344
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
343
345
|
status: 405,
|
|
344
346
|
headers: {
|
|
345
|
-
Allow:
|
|
347
|
+
Allow: _chunkXGTFLG73cjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
346
348
|
"Content-Type": "application/json"
|
|
347
349
|
}
|
|
348
350
|
});
|
|
349
351
|
}
|
|
350
352
|
const invoke = async () => {
|
|
351
353
|
try {
|
|
352
|
-
return await
|
|
354
|
+
return await _chunkXGTFLG73cjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, this.bodySizeLimit);
|
|
353
355
|
} catch (error) {
|
|
354
356
|
if (options.throwOnError) throw error;
|
|
355
357
|
console.error(`[API Error] ${pathname}:`, error);
|
|
356
|
-
return
|
|
357
|
-
status: 500,
|
|
358
|
-
headers: { "Content-Type": "application/json" }
|
|
359
|
-
});
|
|
358
|
+
return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
360
359
|
}
|
|
361
360
|
};
|
|
362
361
|
return _optionalChain([this, 'access', _10 => _10.i18n, 'optionalAccess', _11 => _11.config, 'access', _12 => _12.enabled]) ? _chunkRVGLYMJMcjs._runWithFarmI18nRequest.call(void 0, this.i18n, request, invoke, {
|
|
@@ -371,7 +370,7 @@ var APIRouteManager = class {
|
|
|
371
370
|
return Boolean(this.matchRoute(pathname));
|
|
372
371
|
}
|
|
373
372
|
matchRoute(pathname) {
|
|
374
|
-
return
|
|
373
|
+
return _chunkXGTFLG73cjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
375
374
|
}
|
|
376
375
|
/**
|
|
377
376
|
* Get all routes for client type generation
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isFarmMetadataNoIndex
|
|
3
|
-
|
|
2
|
+
isFarmMetadataNoIndex,
|
|
3
|
+
resolveFarmAgentOrigin
|
|
4
|
+
} from "./chunk-YGJ5P3TJ.mjs";
|
|
4
5
|
import {
|
|
5
6
|
matchesFarmMarkdownRoutePattern
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IFR74W6S.mjs";
|
|
7
8
|
import {
|
|
8
9
|
applyFarmBasePath
|
|
9
10
|
} from "./chunk-SF3JB56B.mjs";
|
|
@@ -161,7 +162,7 @@ function resolveRoutePatterns(value, key) {
|
|
|
161
162
|
}
|
|
162
163
|
function createFarmDefaultSitemap(sources, options) {
|
|
163
164
|
const { include, exclude } = options.config;
|
|
164
|
-
const base =
|
|
165
|
+
const base = resolveFarmAgentOrigin(options.metadataBase, options.origin);
|
|
165
166
|
const entries = /* @__PURE__ */ new Map();
|
|
166
167
|
for (const source of sources) {
|
|
167
168
|
const path = source.pattern;
|
|
@@ -180,15 +181,6 @@ function createFarmDefaultSitemap(sources, options) {
|
|
|
180
181
|
}
|
|
181
182
|
return [...entries.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([, entry]) => entry);
|
|
182
183
|
}
|
|
183
|
-
function toAbsoluteHttpOrigin(value) {
|
|
184
|
-
if (typeof value !== "string" && !(value instanceof URL)) return void 0;
|
|
185
|
-
try {
|
|
186
|
-
const url = new URL(String(value));
|
|
187
|
-
return url.protocol === "https:" || url.protocol === "http:" ? url.origin : void 0;
|
|
188
|
-
} catch {
|
|
189
|
-
return void 0;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
184
|
function isRecord(value) {
|
|
193
185
|
return Boolean(value && typeof value === "object");
|
|
194
186
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findProgrammaticRouteFilesInDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TXE4SAMV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isFarmAPIRouteFileName
|
|
6
6
|
} from "./chunk-YX6AFPXC.mjs";
|
|
@@ -12,12 +12,13 @@ import {
|
|
|
12
12
|
} from "./chunk-NR63PD3P.mjs";
|
|
13
13
|
import {
|
|
14
14
|
API_ROUTE_METHODS,
|
|
15
|
+
createFarmInternalServerErrorResponse,
|
|
15
16
|
getAllowedAPIRouteMethods,
|
|
16
17
|
invokeAPIRouteEndpoint,
|
|
17
18
|
matchAPIRouteAtBasePath,
|
|
18
19
|
mergePluginAPIRoutes,
|
|
19
20
|
resolveAPIRouteEndpoint
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TY5KCYDE.mjs";
|
|
21
22
|
import {
|
|
22
23
|
registerAPIRouteShape
|
|
23
24
|
} from "./chunk-GWXZS7K5.mjs";
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
import {
|
|
28
29
|
getFarmRouteRuntimeConfig,
|
|
29
30
|
normalizeFarmRouteRuntimeConfig
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PKMUQ7LM.mjs";
|
|
31
32
|
import {
|
|
32
33
|
toFileModuleUrl
|
|
33
34
|
} from "./chunk-VHIXGZYH.mjs";
|
|
@@ -261,6 +262,7 @@ var APIRouteManager = class {
|
|
|
261
262
|
}
|
|
262
263
|
return null;
|
|
263
264
|
}
|
|
265
|
+
/** Load an app module through the server that loads the routes, as their handlers were. */
|
|
264
266
|
async loadModule(filePath) {
|
|
265
267
|
if (this.viteServer) {
|
|
266
268
|
return await loadFarmDevModule(this.viteServer, filePath);
|
|
@@ -353,10 +355,7 @@ var APIRouteManager = class {
|
|
|
353
355
|
} catch (error) {
|
|
354
356
|
if (options.throwOnError) throw error;
|
|
355
357
|
console.error(`[API Error] ${pathname}:`, error);
|
|
356
|
-
return
|
|
357
|
-
status: 500,
|
|
358
|
-
headers: { "Content-Type": "application/json" }
|
|
359
|
-
});
|
|
358
|
+
return createFarmInternalServerErrorResponse();
|
|
360
359
|
}
|
|
361
360
|
};
|
|
362
361
|
return this.i18n?.config.enabled ? _runWithFarmI18nRequest(this.i18n, request, invoke, {
|