@farm.js/core 0.1.67 → 0.1.69
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.d-DWyWkTSy.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
- package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +5 -3
- package/dist/agent-runtime.d.ts +5 -3
- package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-NAL5TJUP.mjs} +2 -2
- package/dist/analyzer-SAJSV6SP.cjs +16 -0
- package/dist/api/node.d.mts +7 -5
- package/dist/api/node.d.ts +7 -5
- package/dist/api/route-manager.d.mts +7 -5
- package/dist/api/route-manager.d.ts +7 -5
- package/dist/api/runtime.d.mts +6 -4
- package/dist/api/runtime.d.ts +6 -4
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +8 -23
- package/dist/api.d.ts +8 -23
- package/dist/api.mjs +1 -1
- package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
- package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
- package/dist/app-markdown.cjs +3 -3
- package/dist/app-markdown.d.mts +10 -10
- package/dist/app-markdown.d.ts +10 -10
- package/dist/app-markdown.mjs +2 -2
- package/dist/{app.d-BX9LVTiP.d.ts → app.d-BWeDqOaF.d.ts} +6 -6
- package/dist/{app.d-uBBUxwyV.d.mts → app.d-CaPwtytN.d.mts} +6 -6
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
- package/dist/{chunk-HM7AGSKU.cjs → chunk-22LGTSBA.cjs} +1 -1
- package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
- package/dist/{chunk-V5MQMQ2P.mjs → chunk-2P7UYHZP.mjs} +1 -1
- package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
- package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
- package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
- package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
- package/dist/{chunk-DCXSIEFE.cjs → chunk-4JRAMCUP.cjs} +59 -38
- package/dist/{chunk-Q5UX55YA.cjs → chunk-4W4ZWSV2.cjs} +887 -485
- package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
- package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
- package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
- package/dist/{chunk-HP2DQGQH.mjs → chunk-5TOWKGV3.mjs} +1 -1
- package/dist/{chunk-556H7JCE.cjs → chunk-6GQJVY4E.cjs} +32 -27
- package/dist/{chunk-PL6RTBDE.cjs → chunk-ABIBASLJ.cjs} +2 -2
- package/dist/{chunk-H37MDCPR.mjs → chunk-ANMIR6US.mjs} +1 -1
- package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
- package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
- package/dist/{chunk-UHNSY2PQ.mjs → chunk-CKCKCUYO.mjs} +826 -424
- package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
- package/dist/{chunk-N5DQMOAG.cjs → chunk-DHR2WDSL.cjs} +275 -92
- package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
- package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
- package/dist/{chunk-V5RTHYJB.cjs → chunk-F6YLXK5L.cjs} +93 -25
- package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
- package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
- package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
- package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
- package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
- package/dist/{chunk-LPIZMU7D.cjs → chunk-GQ6QOH7T.cjs} +9 -5
- package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
- package/dist/{chunk-6V5YWI4W.cjs → chunk-GUMKIQJL.cjs} +2 -2
- package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
- package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
- package/dist/chunk-ICFPTHXM.mjs +97 -0
- package/dist/{chunk-WGHY3OL5.mjs → chunk-IYLZZTP6.mjs} +233 -50
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
- package/dist/{chunk-23PVOIPT.cjs → chunk-L5OZN6YW.cjs} +3 -3
- package/dist/{chunk-QITSS4TD.cjs → chunk-L6NWQ3DR.cjs} +537 -356
- package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
- package/dist/{chunk-CO3YMZFD.mjs → chunk-MAGFDK4Q.mjs} +1 -1
- package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
- package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
- package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
- package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
- package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
- package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
- package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-E6CD45JK.mjs → chunk-PDQ6EGPK.mjs} +26 -5
- package/dist/{chunk-VK54PDQ6.mjs → chunk-PEYDQMSA.mjs} +86 -18
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
- package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
- package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
- package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
- package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
- package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
- package/dist/{chunk-WDD5CTZW.mjs → chunk-SZORL7EW.mjs} +24 -19
- package/dist/{chunk-6R53ZWX2.cjs → chunk-TKYOJ5G2.cjs} +3 -3
- package/dist/{chunk-XNZWMXCF.mjs → chunk-UHU4QALN.mjs} +330 -149
- package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
- package/dist/{chunk-GTV2ABO7.mjs → chunk-ULMXZYOA.mjs} +162 -33
- package/dist/{chunk-4DRINDGN.cjs → chunk-VO65MYJD.cjs} +254 -125
- package/dist/chunk-W44X6IC2.cjs +97 -0
- package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
- package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
- package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
- package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
- package/dist/{chunk-HRPTMX5C.mjs → chunk-ZR2QB45W.mjs} +7 -3
- package/dist/{chunk-JVM3DKZE.mjs → chunk-ZYCEEE3V.mjs} +1 -1
- package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
- package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
- package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
- package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +37 -236
- package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-Do5ULA0x.d.mts} +37 -236
- package/dist/client-plugins.d.mts +5 -3
- package/dist/client-plugins.d.ts +5 -3
- package/dist/client.cjs +6 -6
- package/dist/client.d.mts +10 -8
- package/dist/client.d.ts +10 -8
- package/dist/client.mjs +5 -5
- package/dist/config.d.mts +5 -3
- package/dist/config.d.ts +5 -3
- 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 +6 -4
- package/dist/desktop.d.ts +6 -4
- package/dist/{devtools-RZVT4JVN.cjs → devtools-7HNDS4SY.cjs} +7 -7
- package/dist/{devtools-UFQYT3VA.mjs → devtools-BP4EBTKQ.mjs} +6 -6
- package/dist/docs.cjs +11 -9
- package/dist/docs.d.mts +19 -5
- package/dist/docs.d.ts +19 -5
- package/dist/docs.mjs +11 -9
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/environment/vite.mjs +4 -4
- 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/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +45 -39
- package/dist/{index.d-Bdm6866n.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
- package/dist/{index.d-Dey5T14f.d.ts → index.d-CVFk37uX.d.ts} +1 -1
- package/dist/index.d.mts +26 -23
- package/dist/index.d.ts +26 -23
- package/dist/index.mjs +48 -42
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.d.mts +5 -3
- package/dist/integrations/orm.d.ts +5 -3
- package/dist/integrations.d.mts +5 -3
- package/dist/integrations.d.ts +5 -3
- package/dist/internal/app-markdown-runtime.cjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +12 -5
- package/dist/internal/app-markdown-runtime.d.ts +12 -5
- package/dist/internal/app-markdown-runtime.mjs +1 -1
- package/dist/internal/build-runtime.cjs +34 -32
- package/dist/internal/build-runtime.d.mts +7 -5
- package/dist/internal/build-runtime.d.ts +7 -5
- package/dist/internal/build-runtime.mjs +33 -31
- package/dist/internal/cli-runtime.cjs +10 -10
- package/dist/internal/cli-runtime.mjs +9 -9
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +31 -36
- package/dist/internal/client-runtime.d.mts +9 -7
- package/dist/internal/client-runtime.d.ts +9 -7
- package/dist/internal/client-runtime.mjs +22 -27
- package/dist/internal/compression-runtime.d.mts +5 -3
- package/dist/internal/compression-runtime.d.ts +5 -3
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- package/dist/internal/config-runtime.mjs +7 -7
- 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 +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +6 -1
- package/dist/internal/islands-boot.mjs +6 -1
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- 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 +17 -9
- package/dist/internal/production-runtime.d.mts +31 -19
- package/dist/internal/production-runtime.d.ts +31 -19
- package/dist/internal/production-runtime.mjs +18 -10
- 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/markdown.d.mts +5 -3
- package/dist/markdown.d.ts +5 -3
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +8 -5
- package/dist/middleware.d.ts +8 -5
- package/dist/middleware.mjs +6 -6
- package/dist/mobile.d.mts +4 -4
- package/dist/mobile.d.ts +4 -4
- package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
- package/dist/{mount.d-CkiPky_F.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +8 -6
- package/dist/navigation.d.ts +8 -6
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
- package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
- package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
- package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +23 -23
- package/dist/plugin.d.mts +7 -5
- package/dist/plugin.d.ts +7 -5
- package/dist/plugin.mjs +22 -22
- package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
- package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
- package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +8 -6
- package/dist/renderer-client.d.ts +8 -6
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +5 -0
- package/dist/renderer.d.ts +5 -0
- package/dist/{request.d-B928QjWy.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
- package/dist/{request.d-KG-4d2eG.d.mts → request.d-CgNVderU.d.mts} +1 -1
- package/dist/request.d.mts +6 -4
- package/dist/request.d.ts +6 -4
- package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
- package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
- package/dist/{router.d-DYnRHQwz.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
- package/dist/{router.d-B8PkJSGp.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
- package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
- package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
- package/dist/routes.d.mts +5 -3
- package/dist/routes.d.ts +5 -3
- package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-J4KKBSCH.cjs} +10 -10
- package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-PJZOVYSY.mjs} +9 -9
- package/dist/{runtime-X52Q7JFR.cjs → runtime-OLEO5NXF.cjs} +20 -20
- package/dist/{runtime-U7O3HZOZ.mjs → runtime-QDBSE4H6.mjs} +12 -12
- package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
- package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
- package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
- package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
- package/dist/server-plugins.d.mts +6 -4
- package/dist/server-plugins.d.ts +6 -4
- package/dist/server.cjs +52 -50
- package/dist/server.d-C5FFrZAo.d.ts +57 -0
- package/dist/server.d-DgC8xew5.d.mts +57 -0
- package/dist/server.d.mts +13 -11
- package/dist/server.d.ts +13 -11
- package/dist/server.mjs +31 -29
- package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
- package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
- package/dist/testing.d.mts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/types.d-xCIhyjOq.d.mts +233 -0
- package/dist/types.d-xCIhyjOq.d.ts +233 -0
- package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
- package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -23
- package/dist/vite.d.mts +10 -8
- package/dist/vite.d.ts +10 -8
- package/dist/vite.mjs +22 -22
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.d.mts +121 -1
- package/dist/workflows.d.ts +121 -1
- package/dist/workflows.mjs +1 -1
- package/package.json +7 -2
- package/dist/analyzer-KVZGVY5Q.cjs +0 -16
- package/dist/chunk-CLFEQGET.cjs +0 -60
- package/dist/chunk-MK5E44WP.mjs +0 -60
- package/dist/layers-DMRXRL7F.cjs +0 -18
- 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/server.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-FN5UEC7I.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createFarmInfraAnalyticsPlugin
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZYCEEE3V.mjs";
|
|
7
7
|
import {
|
|
8
8
|
FarmEnvironmentError,
|
|
9
9
|
createClientOnlyFn,
|
|
@@ -24,12 +24,12 @@ import {
|
|
|
24
24
|
resolveConfig,
|
|
25
25
|
resolveFarmMCPConfig,
|
|
26
26
|
resolveFarmMCPPlugin
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SZORL7EW.mjs";
|
|
28
28
|
import "./chunk-VISQDC6W.mjs";
|
|
29
29
|
import {
|
|
30
30
|
loadFarmInstrumentation,
|
|
31
31
|
resolveFarmInstrumentationFile
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-57QAQU4F.mjs";
|
|
33
33
|
import {
|
|
34
34
|
createFarmInstrumentationLifecycle
|
|
35
35
|
} from "./chunk-WNDAISB7.mjs";
|
|
@@ -39,12 +39,12 @@ import {
|
|
|
39
39
|
farmI18nClientBridgePlugin,
|
|
40
40
|
farmPlugin,
|
|
41
41
|
farmServerOnlyEntriesPlugin
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-UHU4QALN.mjs";
|
|
43
43
|
import {
|
|
44
44
|
createFarmReactRefreshPlugins,
|
|
45
45
|
farmDesktopDevGuardPlugin
|
|
46
46
|
} from "./chunk-QOSDWGKT.mjs";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-OEL5EPOJ.mjs";
|
|
48
48
|
import {
|
|
49
49
|
FarmApp,
|
|
50
50
|
RouteManager,
|
|
@@ -55,35 +55,35 @@ import {
|
|
|
55
55
|
createFarmThemeCssPlugin,
|
|
56
56
|
mergeFarmViteConfig,
|
|
57
57
|
resolveFarmImageProviderForRuntime
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-IYLZZTP6.mjs";
|
|
59
59
|
import {
|
|
60
60
|
loadTailwindVitePlugin
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-YOHHL2UE.mjs";
|
|
62
62
|
import {
|
|
63
63
|
FarmRuntimeShutdownError,
|
|
64
64
|
PluginManager
|
|
65
|
-
} from "./chunk-
|
|
66
|
-
import "./chunk-6YBYX4K4.mjs";
|
|
67
|
-
import "./chunk-ZJGFAW5U.mjs";
|
|
68
|
-
import "./chunk-E3HDJCWF.mjs";
|
|
69
|
-
import "./chunk-7PJARAQQ.mjs";
|
|
70
|
-
import "./chunk-UTUS6JUH.mjs";
|
|
71
|
-
import "./chunk-CROAFCMW.mjs";
|
|
65
|
+
} from "./chunk-PJQ5W356.mjs";
|
|
72
66
|
import {
|
|
73
67
|
resolveFarmPlatform,
|
|
74
68
|
validateFarmDesktopConfig
|
|
75
69
|
} from "./chunk-SMUW7UST.mjs";
|
|
76
70
|
import "./chunk-UB7RVEMX.mjs";
|
|
71
|
+
import "./chunk-G7NBPP7H.mjs";
|
|
72
|
+
import "./chunk-ZJGFAW5U.mjs";
|
|
73
|
+
import "./chunk-E3HDJCWF.mjs";
|
|
74
|
+
import "./chunk-7PJARAQQ.mjs";
|
|
75
|
+
import "./chunk-UTUS6JUH.mjs";
|
|
76
|
+
import "./chunk-CROAFCMW.mjs";
|
|
77
77
|
import "./chunk-GNZIAJGB.mjs";
|
|
78
78
|
import "./chunk-ZPKJPM7K.mjs";
|
|
79
79
|
import "./chunk-LLZSYFOM.mjs";
|
|
80
80
|
import "./chunk-UUMKLGUU.mjs";
|
|
81
81
|
import "./chunk-23LVFSID.mjs";
|
|
82
|
-
import "./chunk-
|
|
82
|
+
import "./chunk-ZR2QB45W.mjs";
|
|
83
83
|
import "./chunk-K6SXMVXO.mjs";
|
|
84
|
-
import "./chunk-
|
|
84
|
+
import "./chunk-2P7UYHZP.mjs";
|
|
85
85
|
import "./chunk-L4RTTTVE.mjs";
|
|
86
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-ICFPTHXM.mjs";
|
|
87
87
|
import "./chunk-X3EFRVXY.mjs";
|
|
88
88
|
import "./chunk-A4PWGL46.mjs";
|
|
89
89
|
import "./chunk-MNIR7I7B.mjs";
|
|
@@ -93,7 +93,7 @@ import "./chunk-YFTGIHNC.mjs";
|
|
|
93
93
|
import "./chunk-HZOMT5DY.mjs";
|
|
94
94
|
import {
|
|
95
95
|
farmEnvironmentFunctionsPlugin
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-ULMXZYOA.mjs";
|
|
97
97
|
import "./chunk-S32PDOLO.mjs";
|
|
98
98
|
import {
|
|
99
99
|
getTheme,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
import "./chunk-EJCVG25Z.mjs";
|
|
103
103
|
import "./chunk-NRNAHZ57.mjs";
|
|
104
104
|
import "./chunk-TPA2PV5J.mjs";
|
|
105
|
-
import "./chunk-
|
|
105
|
+
import "./chunk-R2ZHU37O.mjs";
|
|
106
106
|
import "./chunk-XR2ZIBQK.mjs";
|
|
107
107
|
import "./chunk-CU5SYTJG.mjs";
|
|
108
108
|
import "./chunk-OGVTUGMU.mjs";
|
|
@@ -114,12 +114,13 @@ import {
|
|
|
114
114
|
} from "./chunk-4QENVMG7.mjs";
|
|
115
115
|
import {
|
|
116
116
|
createFarmConfigResolutionPlugin,
|
|
117
|
+
findFarmConfigFile,
|
|
117
118
|
getFarmAppDirectories,
|
|
118
119
|
getFarmLayerAliases,
|
|
119
120
|
getFarmSourceRoots,
|
|
120
121
|
loadFarmConfigFile,
|
|
121
122
|
resolveFarmLayers
|
|
122
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-E7VF3LQ5.mjs";
|
|
123
124
|
import {
|
|
124
125
|
isReactRenderer,
|
|
125
126
|
loadFarmRendererVitePlugins,
|
|
@@ -143,13 +144,13 @@ import {
|
|
|
143
144
|
import {
|
|
144
145
|
setEnv
|
|
145
146
|
} from "./chunk-N33DLJBC.mjs";
|
|
146
|
-
import "./chunk-
|
|
147
|
-
import "./chunk-
|
|
147
|
+
import "./chunk-MV7NWU23.mjs";
|
|
148
|
+
import "./chunk-HEJM46HQ.mjs";
|
|
148
149
|
import "./chunk-BRYPZIMB.mjs";
|
|
149
150
|
import "./chunk-UIJOLBUL.mjs";
|
|
150
151
|
import "./chunk-IFR74W6S.mjs";
|
|
151
|
-
import "./chunk-
|
|
152
|
-
import "./chunk-
|
|
152
|
+
import "./chunk-MGKWYPE3.mjs";
|
|
153
|
+
import "./chunk-MGZVDX4R.mjs";
|
|
153
154
|
import "./chunk-WXFY5JIY.mjs";
|
|
154
155
|
import "./chunk-YP7YO3S3.mjs";
|
|
155
156
|
import "./chunk-YWPNIYUP.mjs";
|
|
@@ -196,8 +197,8 @@ import "./chunk-BMQAPZXD.mjs";
|
|
|
196
197
|
import "./chunk-WMLSZAKN.mjs";
|
|
197
198
|
import "./chunk-MMK4MZUN.mjs";
|
|
198
199
|
import "./chunk-K3RU5MOR.mjs";
|
|
199
|
-
import "./chunk-EYPSKXO4.mjs";
|
|
200
200
|
import "./chunk-6ZFRWRHO.mjs";
|
|
201
|
+
import "./chunk-EYPSKXO4.mjs";
|
|
201
202
|
import "./chunk-EDPENAVO.mjs";
|
|
202
203
|
import "./chunk-OJO2GOM3.mjs";
|
|
203
204
|
import "./chunk-5PZJ63PK.mjs";
|
|
@@ -274,8 +275,8 @@ import "./chunk-H3ASZDT7.mjs";
|
|
|
274
275
|
import "./chunk-2DA7CLY7.mjs";
|
|
275
276
|
import {
|
|
276
277
|
FARM_VERSION
|
|
277
|
-
} from "./chunk-
|
|
278
|
-
import "./chunk-
|
|
278
|
+
} from "./chunk-ANMIR6US.mjs";
|
|
279
|
+
import "./chunk-YVPX5PI5.mjs";
|
|
279
280
|
import "./chunk-QPNVDSFZ.mjs";
|
|
280
281
|
import "./chunk-GYMGK467.mjs";
|
|
281
282
|
import "./chunk-5Y4GYKKH.mjs";
|
|
@@ -289,7 +290,7 @@ import "./chunk-SD6JGJOM.mjs";
|
|
|
289
290
|
import "./chunk-S6O2L47H.mjs";
|
|
290
291
|
import "./chunk-NBIVGHAT.mjs";
|
|
291
292
|
import "./chunk-WCLLPR6H.mjs";
|
|
292
|
-
import "./chunk-
|
|
293
|
+
import "./chunk-NVOMQLI2.mjs";
|
|
293
294
|
import "./chunk-7BIW7VCW.mjs";
|
|
294
295
|
import "./chunk-M25IONJP.mjs";
|
|
295
296
|
import {
|
|
@@ -624,7 +625,7 @@ async function createServer2(config = {}, options = {}) {
|
|
|
624
625
|
checkWebDesktopBlock(userConfig?.desktop);
|
|
625
626
|
const rscConfig = userConfig ?? config;
|
|
626
627
|
if (resolveFarmServerComponentsMode(rscConfig.experimental?.serverComponents)) {
|
|
627
|
-
const { createFarmRscDevServer, farmAppUsesRscPipeline, resolveFarmRscCheckConfig } = await import("./rsc-pipeline-
|
|
628
|
+
const { createFarmRscDevServer, farmAppUsesRscPipeline, resolveFarmRscCheckConfig } = await import("./rsc-pipeline-PJZOVYSY.mjs");
|
|
628
629
|
await options.ensureServerComponentsPackages?.(rscConfig, root);
|
|
629
630
|
if (farmAppUsesRscPipeline(await resolveFarmRscCheckConfig(rscConfig, root, mode), root)) {
|
|
630
631
|
return await createFarmRscDevServer(rscConfig, {
|
|
@@ -946,6 +947,7 @@ export {
|
|
|
946
947
|
driverStorage,
|
|
947
948
|
farmPlugin,
|
|
948
949
|
fileExists,
|
|
950
|
+
findFarmConfigFile,
|
|
949
951
|
getCurrentRequest,
|
|
950
952
|
getFarmAppDirectories,
|
|
951
953
|
getFarmDataCache,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as Metadata } from './client-plugins.d-
|
|
1
|
+
import { M as Metadata } from './client-plugins.d-D7dHV1Nf.js';
|
|
2
2
|
import { F as FarmClientPluginManager } from './lifecycle.d-keQs5Swc.js';
|
|
3
3
|
import { a as FarmI18nClientSnapshot } from './types.d-C41ePjvP.js';
|
|
4
4
|
import { F as FarmIslandStrategy } from './island.d-CfGru1MO.js';
|
|
5
|
-
import { F as FarmRouteRenderPlan } from './render-plan.d-
|
|
5
|
+
import { F as FarmRouteRenderPlan } from './render-plan.d-W6LmjD6y.js';
|
|
6
6
|
|
|
7
7
|
type NavigationMetadata = (Metadata & Record<string, any>) | undefined;
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as Metadata } from './client-plugins.d-
|
|
1
|
+
import { M as Metadata } from './client-plugins.d-Do5ULA0x.mjs';
|
|
2
2
|
import { F as FarmClientPluginManager } from './lifecycle.d-keQs5Swc.mjs';
|
|
3
3
|
import { a as FarmI18nClientSnapshot } from './types.d-C41ePjvP.mjs';
|
|
4
4
|
import { F as FarmIslandStrategy } from './island.d-CfGru1MO.mjs';
|
|
5
|
-
import { F as FarmRouteRenderPlan } from './render-plan.d-
|
|
5
|
+
import { F as FarmRouteRenderPlan } from './render-plan.d-CzGDjcT0.mjs';
|
|
6
6
|
|
|
7
7
|
type NavigationMetadata = (Metadata & Record<string, any>) | undefined;
|
|
8
8
|
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { b2 as MiddlewareProps, z as PluginContextProps, i as RouteModule, aN as FarmContextFactory } from './client-plugins.d-
|
|
2
|
+
import { b2 as MiddlewareProps, z as PluginContextProps, i as RouteModule, aN as FarmContextFactory } from './client-plugins.d-Do5ULA0x.mjs';
|
|
3
3
|
import './types.d-C41ePjvP.mjs';
|
|
4
4
|
import { b as APIRouteParams } from './route-pattern.d-CVsVbq5n.mjs';
|
|
5
5
|
import { ServerFn } from './server-fn.mjs';
|
|
@@ -22,12 +22,14 @@ import '@farming-labs/orm';
|
|
|
22
22
|
import '@farming-labs/docs';
|
|
23
23
|
import './observability.d-B2363jB6.mjs';
|
|
24
24
|
import '@opentelemetry/api';
|
|
25
|
+
import './types.d-xCIhyjOq.mjs';
|
|
25
26
|
import 'vite';
|
|
26
|
-
import './workflows.
|
|
27
|
+
import './workflows.mjs';
|
|
28
|
+
import './server-http.d-rAe7lAQc.mjs';
|
|
27
29
|
import './cron.mjs';
|
|
28
30
|
import './env.mjs';
|
|
29
31
|
import './server-action-security.mjs';
|
|
30
|
-
import './layers.d-
|
|
32
|
+
import './layers.d-CH0bC4QL.mjs';
|
|
31
33
|
import 'rolldown/utils';
|
|
32
34
|
import 'rolldown';
|
|
33
35
|
import './image-config.d-ByhQ0TT7.mjs';
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { b2 as MiddlewareProps, z as PluginContextProps, i as RouteModule, aN as FarmContextFactory } from './client-plugins.d-
|
|
2
|
+
import { b2 as MiddlewareProps, z as PluginContextProps, i as RouteModule, aN as FarmContextFactory } from './client-plugins.d-D7dHV1Nf.js';
|
|
3
3
|
import './types.d-C41ePjvP.js';
|
|
4
4
|
import { b as APIRouteParams } from './route-pattern.d-CVsVbq5n.js';
|
|
5
5
|
import { ServerFn } from './server-fn.js';
|
|
@@ -22,12 +22,14 @@ import '@farming-labs/orm';
|
|
|
22
22
|
import '@farming-labs/docs';
|
|
23
23
|
import './observability.d-B2363jB6.js';
|
|
24
24
|
import '@opentelemetry/api';
|
|
25
|
+
import './types.d-xCIhyjOq.js';
|
|
25
26
|
import 'vite';
|
|
26
|
-
import './workflows.
|
|
27
|
+
import './workflows.js';
|
|
28
|
+
import './server-http.d-rAe7lAQc.js';
|
|
27
29
|
import './cron.js';
|
|
28
30
|
import './env.js';
|
|
29
31
|
import './server-action-security.js';
|
|
30
|
-
import './layers.d-
|
|
32
|
+
import './layers.d-CH0bC4QL.js';
|
|
31
33
|
import 'rolldown/utils';
|
|
32
34
|
import 'rolldown';
|
|
33
35
|
import './image-config.d-ByhQ0TT7.js';
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
2
|
+
import { ViteDevServer } from 'vite';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Farm.js Middleware System
|
|
6
|
+
*
|
|
7
|
+
* Type definitions for the middleware system
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Next function type for middleware chain
|
|
12
|
+
*/
|
|
13
|
+
type MiddlewareResult = void | Response;
|
|
14
|
+
type NextFunction = () => Promise<MiddlewareResult>;
|
|
15
|
+
type MiddlewareStoreKey<TValues extends Record<string, any>> = Extract<keyof TValues, string>;
|
|
16
|
+
/**
|
|
17
|
+
* A typed view over the request-scoped maps used by middleware.
|
|
18
|
+
*/
|
|
19
|
+
interface ReadonlyMiddlewareStore<TValues extends Record<string, any> = Record<string, any>> {
|
|
20
|
+
readonly size: number;
|
|
21
|
+
get<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): TValues[TKey] | undefined;
|
|
22
|
+
has<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): boolean;
|
|
23
|
+
entries(): IterableIterator<[MiddlewareStoreKey<TValues>, TValues[MiddlewareStoreKey<TValues>]]>;
|
|
24
|
+
keys(): IterableIterator<MiddlewareStoreKey<TValues>>;
|
|
25
|
+
values(): IterableIterator<TValues[MiddlewareStoreKey<TValues>]>;
|
|
26
|
+
forEach(callback: (value: TValues[MiddlewareStoreKey<TValues>], key: MiddlewareStoreKey<TValues>, store: ReadonlyMiddlewareStore<TValues>) => void, thisArg?: any): void;
|
|
27
|
+
[Symbol.iterator](): IterableIterator<[
|
|
28
|
+
MiddlewareStoreKey<TValues>,
|
|
29
|
+
TValues[MiddlewareStoreKey<TValues>]
|
|
30
|
+
]>;
|
|
31
|
+
}
|
|
32
|
+
interface MiddlewareStore<TValues extends Record<string, any> = Record<string, any>> extends ReadonlyMiddlewareStore<TValues> {
|
|
33
|
+
clear(): void;
|
|
34
|
+
delete<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): boolean;
|
|
35
|
+
set<TKey extends MiddlewareStoreKey<TValues>>(key: TKey, value: TValues[TKey]): this;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Middleware function signature
|
|
39
|
+
*/
|
|
40
|
+
type MiddlewareFunction = (ctx: MiddlewareContext, next: NextFunction) => MiddlewareResult | Promise<MiddlewareResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Context passed to a named, request-first middleware export.
|
|
43
|
+
* `locals` and the get/set helpers stay on the server. `data` can be exposed
|
|
44
|
+
* through page props and should contain only serializable, client-safe values.
|
|
45
|
+
*/
|
|
46
|
+
interface RequestMiddlewareContext<TLocals extends Record<string, any> = Record<string, any>, TData extends Record<string, any> = Record<string, any>> {
|
|
47
|
+
readonly url: URL;
|
|
48
|
+
readonly pathname: string;
|
|
49
|
+
/** The pathname the router matches: decoded once, without basePath or locale. */
|
|
50
|
+
readonly routePathname: string;
|
|
51
|
+
readonly searchParams: URLSearchParams;
|
|
52
|
+
readonly method: string;
|
|
53
|
+
readonly params: Record<string, string>;
|
|
54
|
+
readonly route: string;
|
|
55
|
+
readonly locals: MiddlewareStore<TLocals>;
|
|
56
|
+
readonly data: MiddlewareStore<TData>;
|
|
57
|
+
readonly headers: Map<string, string>;
|
|
58
|
+
readonly cookies: CookieJar;
|
|
59
|
+
get<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): TLocals[TKey] | undefined;
|
|
60
|
+
has<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): boolean;
|
|
61
|
+
set<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey, value: TLocals[TKey]): void;
|
|
62
|
+
delete<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): boolean;
|
|
63
|
+
redirect(url: string, status?: number): void;
|
|
64
|
+
rewrite(url: string): void;
|
|
65
|
+
json(data: any, status?: number): void;
|
|
66
|
+
text(content: string, status?: number): void;
|
|
67
|
+
html(content: string, status?: number): void;
|
|
68
|
+
}
|
|
69
|
+
type RequestMiddleware<TLocals extends Record<string, any> = Record<string, any>, TData extends Record<string, any> = Record<string, any>> = (request: Request, context: RequestMiddlewareContext<TLocals, TData>) => MiddlewareResult | Promise<MiddlewareResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Cookie options
|
|
72
|
+
*/
|
|
73
|
+
interface CookieOptions {
|
|
74
|
+
maxAge?: number;
|
|
75
|
+
expires?: Date;
|
|
76
|
+
path?: string;
|
|
77
|
+
domain?: string;
|
|
78
|
+
secure?: boolean;
|
|
79
|
+
httpOnly?: boolean;
|
|
80
|
+
sameSite?: "strict" | "lax" | "none";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Cookie management interface
|
|
84
|
+
*/
|
|
85
|
+
interface CookieJar {
|
|
86
|
+
get(name: string): string | undefined;
|
|
87
|
+
set(name: string, value: string, options?: CookieOptions): void;
|
|
88
|
+
/**
|
|
89
|
+
* Remove a cookie. Pass the `path`/`domain` it was set with; a tombstone only
|
|
90
|
+
* matches a cookie with the same scope.
|
|
91
|
+
*/
|
|
92
|
+
delete(name: string, options?: CookieOptions): void;
|
|
93
|
+
getAll(): Record<string, string>;
|
|
94
|
+
}
|
|
95
|
+
interface RateLimitIncrementResult {
|
|
96
|
+
count: number;
|
|
97
|
+
/** Unix epoch timestamp in milliseconds when the fixed window resets. */
|
|
98
|
+
resetAt: number;
|
|
99
|
+
}
|
|
100
|
+
interface RateLimitStorage {
|
|
101
|
+
/** Atomically increment a key and create or retain its fixed expiry window. */
|
|
102
|
+
increment(key: string, windowMs: number): Promise<RateLimitIncrementResult> | RateLimitIncrementResult;
|
|
103
|
+
/** Optional inspection support used by getRateLimitStatus(). */
|
|
104
|
+
get?(key: string): Promise<RateLimitIncrementResult | null> | RateLimitIncrementResult | null;
|
|
105
|
+
}
|
|
106
|
+
interface MemoryRateLimitStorageOptions {
|
|
107
|
+
/** Maximum number of active keys retained by this process. */
|
|
108
|
+
maxEntries?: number;
|
|
109
|
+
}
|
|
110
|
+
interface RateLimitConfig {
|
|
111
|
+
requests: number;
|
|
112
|
+
window: string;
|
|
113
|
+
keyGenerator?: (ctx: MiddlewareContext) => string;
|
|
114
|
+
onLimit?: (ctx: MiddlewareContext) => void | Response | Promise<void | Response>;
|
|
115
|
+
storage?: RateLimitStorage;
|
|
116
|
+
}
|
|
117
|
+
interface RateLimitStatus {
|
|
118
|
+
requests: number;
|
|
119
|
+
limit: number;
|
|
120
|
+
remaining: number;
|
|
121
|
+
resetIn: number | null;
|
|
122
|
+
resetAt: Date | null;
|
|
123
|
+
isLimited: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Middleware configuration
|
|
127
|
+
*/
|
|
128
|
+
type MiddlewareMatcher = string | RegExp | ((ctx: MiddlewareContext) => boolean);
|
|
129
|
+
interface MiddlewareConfig {
|
|
130
|
+
matcher?: MiddlewareMatcher | MiddlewareMatcher[];
|
|
131
|
+
exclude?: (string | RegExp)[];
|
|
132
|
+
runtime?: "nodejs" | "edge";
|
|
133
|
+
/**
|
|
134
|
+
* Whether a response this middleware lets through may be stored by a shared cache (a CDN).
|
|
135
|
+
* Farm cannot tell a guard from harmless middleware, and a CDN serves its copy without
|
|
136
|
+
* running either, so by default (`"private"`) the response is sent with
|
|
137
|
+
* `Cache-Control: private, no-store`. Set `"public"` only on middleware that never decides
|
|
138
|
+
* who may read the response, such as logging or response headers.
|
|
139
|
+
*/
|
|
140
|
+
cache?: "private" | "public";
|
|
141
|
+
}
|
|
142
|
+
interface MiddlewareConfigEntry extends MiddlewareConfig {
|
|
143
|
+
handler?: MiddlewareFunction;
|
|
144
|
+
handlers?: MiddlewareFunction[];
|
|
145
|
+
}
|
|
146
|
+
type FarmMiddlewareConfig = MiddlewareConfig | MiddlewareConfigEntry | MiddlewareConfigEntry[];
|
|
147
|
+
/**
|
|
148
|
+
* Middleware context - the main object passed to middleware functions
|
|
149
|
+
*/
|
|
150
|
+
interface MiddlewareContext {
|
|
151
|
+
request: IncomingMessage;
|
|
152
|
+
response: ServerResponse;
|
|
153
|
+
url: URL;
|
|
154
|
+
/** Request pathname as received: still percent-encoded and carrying basePath/locale. */
|
|
155
|
+
pathname: string;
|
|
156
|
+
/**
|
|
157
|
+
* The pathname the router matches: decoded once, without basePath or locale. String matchers
|
|
158
|
+
* compare this value; compare it in path checks too. Updated by `rewrite()`.
|
|
159
|
+
*/
|
|
160
|
+
readonly routePathname: string;
|
|
161
|
+
searchParams: URLSearchParams;
|
|
162
|
+
method: string;
|
|
163
|
+
params: Record<string, string>;
|
|
164
|
+
route: string;
|
|
165
|
+
parent?: {
|
|
166
|
+
data: Map<string, any>;
|
|
167
|
+
locals?: Map<string, any>;
|
|
168
|
+
headers: Record<string, string>;
|
|
169
|
+
};
|
|
170
|
+
vite: {
|
|
171
|
+
isDev: boolean;
|
|
172
|
+
hmr: boolean;
|
|
173
|
+
server?: ViteDevServer;
|
|
174
|
+
};
|
|
175
|
+
data: Map<string, any>;
|
|
176
|
+
locals: Map<string, any>;
|
|
177
|
+
headers: Map<string, string>;
|
|
178
|
+
cookies: CookieJar;
|
|
179
|
+
_handled: boolean;
|
|
180
|
+
_redirectUrl?: string;
|
|
181
|
+
_rewriteUrl?: string;
|
|
182
|
+
redirect(url: string, status?: number): void;
|
|
183
|
+
rewrite(url: string): void;
|
|
184
|
+
json(data: any, status?: number): void;
|
|
185
|
+
text(content: string, status?: number): void;
|
|
186
|
+
html(content: string, status?: number): void;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Middleware chain interface
|
|
190
|
+
*/
|
|
191
|
+
interface MiddlewareChain {
|
|
192
|
+
use(fn: MiddlewareFunction): MiddlewareChain;
|
|
193
|
+
/**
|
|
194
|
+
* Conditionally run middleware based on a condition.
|
|
195
|
+
* Supports boolean values or functions that evaluate to boolean.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* .when(true, (ctx, next) => { ... }) // Always run
|
|
199
|
+
* .when((ctx) => ctx.data.get('flag'), (ctx, next) => { ... }) // Conditional
|
|
200
|
+
*/
|
|
201
|
+
when(condition: boolean | ((ctx: MiddlewareContext) => boolean), fn: MiddlewareFunction | ((chain: MiddlewareChain) => void)): MiddlewareChain;
|
|
202
|
+
rateLimit(config: RateLimitConfig): MiddlewareChain;
|
|
203
|
+
redirect(source: string, destination: string, permanent?: boolean): MiddlewareChain;
|
|
204
|
+
/**
|
|
205
|
+
* Rewrite the current route to a new destination.
|
|
206
|
+
* In route-specific middleware, this rewrites the middleware's route.
|
|
207
|
+
*
|
|
208
|
+
* @param destination - The destination path to rewrite to
|
|
209
|
+
* @param condition - Optional boolean or function that evaluates to boolean. If false, rewrite is skipped.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* // In /contact/middleware.ts
|
|
213
|
+
* .rewrite('/about') // Always rewrites /contact to /about
|
|
214
|
+
* .rewrite('/about', true) // Always rewrites
|
|
215
|
+
* .rewrite('/about', false) // Never rewrites
|
|
216
|
+
* .rewrite('/about', (ctx) => ctx.data.get('shouldRewrite')) // Conditional rewrite
|
|
217
|
+
*/
|
|
218
|
+
rewrite(destination: string, condition?: boolean | ((ctx: MiddlewareContext) => boolean)): MiddlewareChain;
|
|
219
|
+
build(): {
|
|
220
|
+
handlers: MiddlewareFunction[];
|
|
221
|
+
config?: MiddlewareConfig;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Middleware module export
|
|
226
|
+
*/
|
|
227
|
+
interface MiddlewareModule {
|
|
228
|
+
default?: MiddlewareChain | MiddlewareFunction;
|
|
229
|
+
middleware?: RequestMiddleware;
|
|
230
|
+
config?: MiddlewareConfig;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export type { CookieJar as C, FarmMiddlewareConfig as F, MiddlewareModule as M, NextFunction as N, ReadonlyMiddlewareStore as R, MiddlewareConfig as a, MiddlewareContext as b, CookieOptions as c, MemoryRateLimitStorageOptions as d, MiddlewareChain as e, MiddlewareFunction as f, MiddlewareResult as g, MiddlewareStore as h, RateLimitConfig as i, RateLimitIncrementResult as j, RateLimitStatus as k, RateLimitStorage as l, RequestMiddleware as m, RequestMiddlewareContext as n, MiddlewareMatcher as o };
|