@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/workflows.d.mts
CHANGED
|
@@ -1 +1,121 @@
|
|
|
1
|
-
|
|
1
|
+
import { F as FarmServerConfig, R as ResolvedFarmServerConfig } from './server-http.d-rAe7lAQc.mjs';
|
|
2
|
+
|
|
3
|
+
type FarmWorkflowSchedule = string | string[];
|
|
4
|
+
interface FarmWorkflowsUserConfig {
|
|
5
|
+
/** Enable or disable Farm workflow discovery. Enabled by default. */
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
/** Directory or directories to scan for workflow modules. */
|
|
8
|
+
dir?: string | string[];
|
|
9
|
+
/** Alias for dir. */
|
|
10
|
+
dirs?: string[];
|
|
11
|
+
/** HTTP route used for manual and URL-based cron invocation. */
|
|
12
|
+
route?: string;
|
|
13
|
+
/** Environment variable that stores the optional runner secret. */
|
|
14
|
+
secretEnv?: string;
|
|
15
|
+
/** Inline runner secret. Prefer secretEnv for deployed apps. */
|
|
16
|
+
secret?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Serve the workflow route without a secret in a deployed runtime.
|
|
19
|
+
* Defaults to false: without a secret the route is public, so production
|
|
20
|
+
* requests are rejected unless this is explicitly enabled.
|
|
21
|
+
*/
|
|
22
|
+
allowUnsecured?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface FarmWorkflowsResolvedConfig {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
dirs: string[];
|
|
27
|
+
route: string;
|
|
28
|
+
secretEnv: string;
|
|
29
|
+
secret?: string;
|
|
30
|
+
allowUnsecured?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FarmWorkflowLogger {
|
|
33
|
+
info: (...args: unknown[]) => void;
|
|
34
|
+
warn: (...args: unknown[]) => void;
|
|
35
|
+
error: (...args: unknown[]) => void;
|
|
36
|
+
}
|
|
37
|
+
interface FarmWorkflowRunContext<TPayload = unknown> {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
payload: TPayload;
|
|
41
|
+
scheduledTime?: number | string;
|
|
42
|
+
request?: Request;
|
|
43
|
+
event?: unknown;
|
|
44
|
+
env: Record<string, string | undefined>;
|
|
45
|
+
data: Map<string, unknown>;
|
|
46
|
+
log: FarmWorkflowLogger;
|
|
47
|
+
}
|
|
48
|
+
interface FarmWorkflowDefinition<TPayload = unknown, TResult = unknown> {
|
|
49
|
+
kind?: "farm-workflow";
|
|
50
|
+
id?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
schedule?: FarmWorkflowSchedule;
|
|
53
|
+
timezone?: string;
|
|
54
|
+
run: (ctx: FarmWorkflowRunContext<TPayload>) => TResult | Promise<TResult>;
|
|
55
|
+
}
|
|
56
|
+
interface FarmCronDefinition<TPayload = unknown, TResult = unknown> extends FarmWorkflowDefinition<TPayload, TResult> {
|
|
57
|
+
schedule: FarmWorkflowSchedule;
|
|
58
|
+
}
|
|
59
|
+
interface FarmDiscoveredWorkflow {
|
|
60
|
+
id: string;
|
|
61
|
+
filePath: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
schedule: string[];
|
|
64
|
+
timezone?: string;
|
|
65
|
+
routePath: string;
|
|
66
|
+
}
|
|
67
|
+
interface PreparedFarmWorkflows {
|
|
68
|
+
workflows: FarmDiscoveredWorkflow[];
|
|
69
|
+
tasks: Record<string, {
|
|
70
|
+
handler: string;
|
|
71
|
+
description: string;
|
|
72
|
+
}>;
|
|
73
|
+
scheduledTasks: Record<string, string | string[]>;
|
|
74
|
+
handlerPath?: string;
|
|
75
|
+
manifestPath?: string;
|
|
76
|
+
}
|
|
77
|
+
interface FarmWorkflowHTTPHandlerOptions {
|
|
78
|
+
workflows: FarmDiscoveredWorkflow[];
|
|
79
|
+
config: FarmWorkflowsResolvedConfig;
|
|
80
|
+
loadModule: (workflow: FarmDiscoveredWorkflow) => Promise<Record<string, any>>;
|
|
81
|
+
server?: FarmServerConfig | ResolvedFarmServerConfig;
|
|
82
|
+
}
|
|
83
|
+
declare const DEFAULT_FARM_WORKFLOW_DIRS: string[];
|
|
84
|
+
declare const DEFAULT_FARM_WORKFLOW_ROUTE = "/api/_farm/workflows";
|
|
85
|
+
declare const DEFAULT_FARM_WORKFLOW_SECRET_ENV = "CRON_SECRET";
|
|
86
|
+
declare function defineWorkflow<const TPayload = unknown, TResult = unknown>(definition: FarmWorkflowDefinition<TPayload, TResult>): FarmWorkflowDefinition<TPayload, TResult>;
|
|
87
|
+
declare function defineTask<const TPayload = unknown, TResult = unknown>(definition: FarmWorkflowDefinition<TPayload, TResult>): FarmWorkflowDefinition<TPayload, TResult>;
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated Configure `cron` in `farm.config.ts` and point it at an API route.
|
|
90
|
+
*/
|
|
91
|
+
declare function defineCron<const TPayload = unknown, TResult = unknown>(definition: FarmCronDefinition<TPayload, TResult>): FarmCronDefinition<TPayload, TResult>;
|
|
92
|
+
declare function resolveWorkflowsConfig(workflows: FarmWorkflowsUserConfig | boolean | undefined): FarmWorkflowsResolvedConfig;
|
|
93
|
+
declare function discoverFarmWorkflows(config: {
|
|
94
|
+
root?: string;
|
|
95
|
+
workflows?: FarmWorkflowsResolvedConfig | FarmWorkflowsUserConfig | boolean;
|
|
96
|
+
}, options?: {
|
|
97
|
+
loadModule?: (filePath: string) => Promise<Record<string, any>>;
|
|
98
|
+
}): Promise<FarmDiscoveredWorkflow[]>;
|
|
99
|
+
declare function createFarmWorkflowRequestHandler(options: FarmWorkflowHTTPHandlerOptions): (request: Request) => Promise<Response | null>;
|
|
100
|
+
declare function runFarmWorkflowModule(module: Record<string, any>, context: {
|
|
101
|
+
id: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
payload?: unknown;
|
|
104
|
+
scheduledTime?: number | string;
|
|
105
|
+
request?: Request;
|
|
106
|
+
event?: unknown;
|
|
107
|
+
env?: Record<string, string | undefined>;
|
|
108
|
+
}): Promise<unknown>;
|
|
109
|
+
declare function prepareFarmWorkflowsForNitro(config: {
|
|
110
|
+
root?: string;
|
|
111
|
+
distDir?: string;
|
|
112
|
+
workflows?: FarmWorkflowsResolvedConfig | FarmWorkflowsUserConfig | boolean;
|
|
113
|
+
server?: FarmServerConfig | ResolvedFarmServerConfig;
|
|
114
|
+
}): Promise<PreparedFarmWorkflows>;
|
|
115
|
+
declare function createFarmWorkflowVercelCrons(workflows: FarmDiscoveredWorkflow[]): Array<{
|
|
116
|
+
path: string;
|
|
117
|
+
schedule: string;
|
|
118
|
+
}>;
|
|
119
|
+
declare function applyFarmWorkflowVercelCrons(vercelConfig: Record<string, any>, workflows: FarmDiscoveredWorkflow[]): Record<string, any>;
|
|
120
|
+
|
|
121
|
+
export { DEFAULT_FARM_WORKFLOW_DIRS, DEFAULT_FARM_WORKFLOW_ROUTE, DEFAULT_FARM_WORKFLOW_SECRET_ENV, type FarmCronDefinition, type FarmDiscoveredWorkflow, type FarmWorkflowDefinition, type FarmWorkflowHTTPHandlerOptions, type FarmWorkflowLogger, type FarmWorkflowRunContext, type FarmWorkflowSchedule, type FarmWorkflowsResolvedConfig, type FarmWorkflowsUserConfig, type PreparedFarmWorkflows, applyFarmWorkflowVercelCrons, createFarmWorkflowRequestHandler, createFarmWorkflowVercelCrons, defineCron, defineTask, defineWorkflow, discoverFarmWorkflows, prepareFarmWorkflowsForNitro, resolveWorkflowsConfig, runFarmWorkflowModule };
|
package/dist/workflows.d.ts
CHANGED
|
@@ -1 +1,121 @@
|
|
|
1
|
-
|
|
1
|
+
import { F as FarmServerConfig, R as ResolvedFarmServerConfig } from './server-http.d-rAe7lAQc.js';
|
|
2
|
+
|
|
3
|
+
type FarmWorkflowSchedule = string | string[];
|
|
4
|
+
interface FarmWorkflowsUserConfig {
|
|
5
|
+
/** Enable or disable Farm workflow discovery. Enabled by default. */
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
/** Directory or directories to scan for workflow modules. */
|
|
8
|
+
dir?: string | string[];
|
|
9
|
+
/** Alias for dir. */
|
|
10
|
+
dirs?: string[];
|
|
11
|
+
/** HTTP route used for manual and URL-based cron invocation. */
|
|
12
|
+
route?: string;
|
|
13
|
+
/** Environment variable that stores the optional runner secret. */
|
|
14
|
+
secretEnv?: string;
|
|
15
|
+
/** Inline runner secret. Prefer secretEnv for deployed apps. */
|
|
16
|
+
secret?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Serve the workflow route without a secret in a deployed runtime.
|
|
19
|
+
* Defaults to false: without a secret the route is public, so production
|
|
20
|
+
* requests are rejected unless this is explicitly enabled.
|
|
21
|
+
*/
|
|
22
|
+
allowUnsecured?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface FarmWorkflowsResolvedConfig {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
dirs: string[];
|
|
27
|
+
route: string;
|
|
28
|
+
secretEnv: string;
|
|
29
|
+
secret?: string;
|
|
30
|
+
allowUnsecured?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FarmWorkflowLogger {
|
|
33
|
+
info: (...args: unknown[]) => void;
|
|
34
|
+
warn: (...args: unknown[]) => void;
|
|
35
|
+
error: (...args: unknown[]) => void;
|
|
36
|
+
}
|
|
37
|
+
interface FarmWorkflowRunContext<TPayload = unknown> {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
payload: TPayload;
|
|
41
|
+
scheduledTime?: number | string;
|
|
42
|
+
request?: Request;
|
|
43
|
+
event?: unknown;
|
|
44
|
+
env: Record<string, string | undefined>;
|
|
45
|
+
data: Map<string, unknown>;
|
|
46
|
+
log: FarmWorkflowLogger;
|
|
47
|
+
}
|
|
48
|
+
interface FarmWorkflowDefinition<TPayload = unknown, TResult = unknown> {
|
|
49
|
+
kind?: "farm-workflow";
|
|
50
|
+
id?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
schedule?: FarmWorkflowSchedule;
|
|
53
|
+
timezone?: string;
|
|
54
|
+
run: (ctx: FarmWorkflowRunContext<TPayload>) => TResult | Promise<TResult>;
|
|
55
|
+
}
|
|
56
|
+
interface FarmCronDefinition<TPayload = unknown, TResult = unknown> extends FarmWorkflowDefinition<TPayload, TResult> {
|
|
57
|
+
schedule: FarmWorkflowSchedule;
|
|
58
|
+
}
|
|
59
|
+
interface FarmDiscoveredWorkflow {
|
|
60
|
+
id: string;
|
|
61
|
+
filePath: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
schedule: string[];
|
|
64
|
+
timezone?: string;
|
|
65
|
+
routePath: string;
|
|
66
|
+
}
|
|
67
|
+
interface PreparedFarmWorkflows {
|
|
68
|
+
workflows: FarmDiscoveredWorkflow[];
|
|
69
|
+
tasks: Record<string, {
|
|
70
|
+
handler: string;
|
|
71
|
+
description: string;
|
|
72
|
+
}>;
|
|
73
|
+
scheduledTasks: Record<string, string | string[]>;
|
|
74
|
+
handlerPath?: string;
|
|
75
|
+
manifestPath?: string;
|
|
76
|
+
}
|
|
77
|
+
interface FarmWorkflowHTTPHandlerOptions {
|
|
78
|
+
workflows: FarmDiscoveredWorkflow[];
|
|
79
|
+
config: FarmWorkflowsResolvedConfig;
|
|
80
|
+
loadModule: (workflow: FarmDiscoveredWorkflow) => Promise<Record<string, any>>;
|
|
81
|
+
server?: FarmServerConfig | ResolvedFarmServerConfig;
|
|
82
|
+
}
|
|
83
|
+
declare const DEFAULT_FARM_WORKFLOW_DIRS: string[];
|
|
84
|
+
declare const DEFAULT_FARM_WORKFLOW_ROUTE = "/api/_farm/workflows";
|
|
85
|
+
declare const DEFAULT_FARM_WORKFLOW_SECRET_ENV = "CRON_SECRET";
|
|
86
|
+
declare function defineWorkflow<const TPayload = unknown, TResult = unknown>(definition: FarmWorkflowDefinition<TPayload, TResult>): FarmWorkflowDefinition<TPayload, TResult>;
|
|
87
|
+
declare function defineTask<const TPayload = unknown, TResult = unknown>(definition: FarmWorkflowDefinition<TPayload, TResult>): FarmWorkflowDefinition<TPayload, TResult>;
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated Configure `cron` in `farm.config.ts` and point it at an API route.
|
|
90
|
+
*/
|
|
91
|
+
declare function defineCron<const TPayload = unknown, TResult = unknown>(definition: FarmCronDefinition<TPayload, TResult>): FarmCronDefinition<TPayload, TResult>;
|
|
92
|
+
declare function resolveWorkflowsConfig(workflows: FarmWorkflowsUserConfig | boolean | undefined): FarmWorkflowsResolvedConfig;
|
|
93
|
+
declare function discoverFarmWorkflows(config: {
|
|
94
|
+
root?: string;
|
|
95
|
+
workflows?: FarmWorkflowsResolvedConfig | FarmWorkflowsUserConfig | boolean;
|
|
96
|
+
}, options?: {
|
|
97
|
+
loadModule?: (filePath: string) => Promise<Record<string, any>>;
|
|
98
|
+
}): Promise<FarmDiscoveredWorkflow[]>;
|
|
99
|
+
declare function createFarmWorkflowRequestHandler(options: FarmWorkflowHTTPHandlerOptions): (request: Request) => Promise<Response | null>;
|
|
100
|
+
declare function runFarmWorkflowModule(module: Record<string, any>, context: {
|
|
101
|
+
id: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
payload?: unknown;
|
|
104
|
+
scheduledTime?: number | string;
|
|
105
|
+
request?: Request;
|
|
106
|
+
event?: unknown;
|
|
107
|
+
env?: Record<string, string | undefined>;
|
|
108
|
+
}): Promise<unknown>;
|
|
109
|
+
declare function prepareFarmWorkflowsForNitro(config: {
|
|
110
|
+
root?: string;
|
|
111
|
+
distDir?: string;
|
|
112
|
+
workflows?: FarmWorkflowsResolvedConfig | FarmWorkflowsUserConfig | boolean;
|
|
113
|
+
server?: FarmServerConfig | ResolvedFarmServerConfig;
|
|
114
|
+
}): Promise<PreparedFarmWorkflows>;
|
|
115
|
+
declare function createFarmWorkflowVercelCrons(workflows: FarmDiscoveredWorkflow[]): Array<{
|
|
116
|
+
path: string;
|
|
117
|
+
schedule: string;
|
|
118
|
+
}>;
|
|
119
|
+
declare function applyFarmWorkflowVercelCrons(vercelConfig: Record<string, any>, workflows: FarmDiscoveredWorkflow[]): Record<string, any>;
|
|
120
|
+
|
|
121
|
+
export { DEFAULT_FARM_WORKFLOW_DIRS, DEFAULT_FARM_WORKFLOW_ROUTE, DEFAULT_FARM_WORKFLOW_SECRET_ENV, type FarmCronDefinition, type FarmDiscoveredWorkflow, type FarmWorkflowDefinition, type FarmWorkflowHTTPHandlerOptions, type FarmWorkflowLogger, type FarmWorkflowRunContext, type FarmWorkflowSchedule, type FarmWorkflowsResolvedConfig, type FarmWorkflowsUserConfig, type PreparedFarmWorkflows, applyFarmWorkflowVercelCrons, createFarmWorkflowRequestHandler, createFarmWorkflowVercelCrons, defineCron, defineTask, defineWorkflow, discoverFarmWorkflows, prepareFarmWorkflowsForNitro, resolveWorkflowsConfig, runFarmWorkflowModule };
|
package/dist/workflows.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
prepareFarmWorkflowsForNitro,
|
|
13
13
|
resolveWorkflowsConfig,
|
|
14
14
|
runFarmWorkflowModule
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MGZVDX4R.mjs";
|
|
16
16
|
import "./chunk-WXFY5JIY.mjs";
|
|
17
17
|
import "./chunk-YP7YO3S3.mjs";
|
|
18
18
|
import "./chunk-JSDV2NUN.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm.js/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.69",
|
|
4
4
|
"description": "The core of Farm.js, the framework for the web and agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@farm.js/core",
|
|
@@ -698,6 +698,11 @@
|
|
|
698
698
|
"import": "./dist/internal/compression-runtime.mjs",
|
|
699
699
|
"require": "./dist/internal/compression-runtime.cjs"
|
|
700
700
|
},
|
|
701
|
+
"./internal/vercel-edge-middleware": {
|
|
702
|
+
"types": "./dist/internal/vercel-edge-middleware.d.ts",
|
|
703
|
+
"import": "./dist/internal/vercel-edge-middleware.mjs",
|
|
704
|
+
"require": "./dist/internal/vercel-edge-middleware.cjs"
|
|
705
|
+
},
|
|
701
706
|
"./internal/client-runtime": {
|
|
702
707
|
"types": "./dist/internal/client-runtime.d.ts",
|
|
703
708
|
"import": "./dist/internal/client-runtime.mjs",
|
|
@@ -813,7 +818,7 @@
|
|
|
813
818
|
"access": "public"
|
|
814
819
|
},
|
|
815
820
|
"dependencies": {
|
|
816
|
-
"@farm.js/islx": "0.0.
|
|
821
|
+
"@farm.js/islx": "0.0.22",
|
|
817
822
|
"@farming-labs/orm": "0.0.66",
|
|
818
823
|
"@farming-labs/orm-runtime": "0.0.66",
|
|
819
824
|
"@formatjs/icu-messageformat-parser": "3.5.15",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkPL6RTBDEcjs = require('./chunk-PL6RTBDE.cjs');
|
|
7
|
-
require('./chunk-WBTHHTBO.cjs');
|
|
8
|
-
require('./chunk-CCAUIBIS.cjs');
|
|
9
|
-
require('./chunk-HM7AGSKU.cjs');
|
|
10
|
-
require('./chunk-BTZ5O6VM.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.CORE_PORTABLE = _chunkPL6RTBDEcjs.CORE_PORTABLE; exports.analyzeFarmMobileRoutes = _chunkPL6RTBDEcjs.analyzeFarmMobileRoutes; exports.readAliases = _chunkPL6RTBDEcjs.readAliases; exports.resolveFile = _chunkPL6RTBDEcjs.resolveFile;
|
package/dist/chunk-CLFEQGET.cjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkCKPTIEDXcjs = require('./chunk-CKPTIEDX.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
14
|
-
|
|
15
|
-
// src/form-actions.ts
|
|
16
|
-
var _server = require('@farm.js/islx/server');
|
|
17
|
-
var FARM_FORM_ACTION_HEADER = "F-Action";
|
|
18
|
-
function registerFarmFormAction(action, id) {
|
|
19
|
-
return _server.registerServerReference.call(void 0, action, id);
|
|
20
|
-
}
|
|
21
|
-
function handleFarmFormActionRequest(request, config) {
|
|
22
|
-
return _server.handleAction.call(void 0, request, {
|
|
23
|
-
allowedOrigins: config.allowedOrigins,
|
|
24
|
-
bodySizeLimit: config.bodySizeLimit,
|
|
25
|
-
// The result islx sends is the envelope, not the action's own type.
|
|
26
|
-
run: (actionRequest, action) => runFarmFormAction(actionRequest, action),
|
|
27
|
-
mapError(error) {
|
|
28
|
-
const redirect = _chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error);
|
|
29
|
-
if (redirect) return { redirect: redirect.url };
|
|
30
|
-
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error)) return { status: 404 };
|
|
31
|
-
return void 0;
|
|
32
|
-
},
|
|
33
|
-
onError: (error) => console.error("[Farm.js] Server action failed:", error)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
async function runFarmFormAction(request, action) {
|
|
37
|
-
if (!request.headers.has(FARM_FORM_ACTION_HEADER)) {
|
|
38
|
-
return _chunk4P5634G6cjs.runWithServerActionRequest.call(void 0, request, action);
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
return await _chunk4P5634G6cjs.runWithServerActionRequest.call(void 0, request, async () => {
|
|
42
|
-
const value = await action();
|
|
43
|
-
return {
|
|
44
|
-
[_chunkCKPTIEDXcjs.FARM_ACTION_RESULT_KEY]: { invalidations: [..._chunk4P5634G6cjs.getServerActionInvalidations.call(void 0, )] },
|
|
45
|
-
value
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
} catch (error) {
|
|
49
|
-
if (!_chunk4P5634G6cjs.serializeServerFnFailure.call(void 0, error)) throw error;
|
|
50
|
-
return {
|
|
51
|
-
[_chunkCKPTIEDXcjs.FARM_ACTION_RESULT_KEY]: { invalidations: [], error: _chunk4P5634G6cjs.sanitizeServerActionError.call(void 0, error) }
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.FARM_FORM_ACTION_HEADER = FARM_FORM_ACTION_HEADER; exports.registerFarmFormAction = registerFarmFormAction; exports.handleFarmFormActionRequest = handleFarmFormActionRequest;
|
package/dist/chunk-MK5E44WP.mjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FARM_ACTION_RESULT_KEY
|
|
3
|
-
} from "./chunk-X3EFRVXY.mjs";
|
|
4
|
-
import {
|
|
5
|
-
getServerActionInvalidations,
|
|
6
|
-
runWithServerActionRequest,
|
|
7
|
-
sanitizeServerActionError,
|
|
8
|
-
serializeServerFnFailure
|
|
9
|
-
} from "./chunk-E46NXBNJ.mjs";
|
|
10
|
-
import {
|
|
11
|
-
getFarmRedirectError,
|
|
12
|
-
isFarmNotFoundError
|
|
13
|
-
} from "./chunk-JNYFXL7X.mjs";
|
|
14
|
-
|
|
15
|
-
// src/form-actions.ts
|
|
16
|
-
import { handleAction, registerServerReference } from "@farm.js/islx/server";
|
|
17
|
-
var FARM_FORM_ACTION_HEADER = "F-Action";
|
|
18
|
-
function registerFarmFormAction(action, id) {
|
|
19
|
-
return registerServerReference(action, id);
|
|
20
|
-
}
|
|
21
|
-
function handleFarmFormActionRequest(request, config) {
|
|
22
|
-
return handleAction(request, {
|
|
23
|
-
allowedOrigins: config.allowedOrigins,
|
|
24
|
-
bodySizeLimit: config.bodySizeLimit,
|
|
25
|
-
// The result islx sends is the envelope, not the action's own type.
|
|
26
|
-
run: (actionRequest, action) => runFarmFormAction(actionRequest, action),
|
|
27
|
-
mapError(error) {
|
|
28
|
-
const redirect = getFarmRedirectError(error);
|
|
29
|
-
if (redirect) return { redirect: redirect.url };
|
|
30
|
-
if (isFarmNotFoundError(error)) return { status: 404 };
|
|
31
|
-
return void 0;
|
|
32
|
-
},
|
|
33
|
-
onError: (error) => console.error("[Farm.js] Server action failed:", error)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
async function runFarmFormAction(request, action) {
|
|
37
|
-
if (!request.headers.has(FARM_FORM_ACTION_HEADER)) {
|
|
38
|
-
return runWithServerActionRequest(request, action);
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
return await runWithServerActionRequest(request, async () => {
|
|
42
|
-
const value = await action();
|
|
43
|
-
return {
|
|
44
|
-
[FARM_ACTION_RESULT_KEY]: { invalidations: [...getServerActionInvalidations()] },
|
|
45
|
-
value
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
} catch (error) {
|
|
49
|
-
if (!serializeServerFnFailure(error)) throw error;
|
|
50
|
-
return {
|
|
51
|
-
[FARM_ACTION_RESULT_KEY]: { invalidations: [], error: sanitizeServerActionError(error) }
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
FARM_FORM_ACTION_HEADER,
|
|
58
|
-
registerFarmFormAction,
|
|
59
|
-
handleFarmFormActionRequest
|
|
60
|
-
};
|
package/dist/layers-DMRXRL7F.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
|
|
9
|
-
require('./chunk-DQJ2CIH7.cjs');
|
|
10
|
-
require('./chunk-BTZ5O6VM.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.createFarmConfigResolutionPlugin = _chunk5Y2P454Ocjs.createFarmConfigResolutionPlugin; exports.getFarmAppDirectories = _chunk5Y2P454Ocjs.getFarmAppDirectories; exports.getFarmLayerAliases = _chunk5Y2P454Ocjs.getFarmLayerAliases; exports.getFarmSourceRoots = _chunk5Y2P454Ocjs.getFarmSourceRoots; exports.loadFarmConfigFile = _chunk5Y2P454Ocjs.loadFarmConfigFile; exports.resolveFarmLayers = _chunk5Y2P454Ocjs.resolveFarmLayers;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _chunkDQJ2CIH7cjs = require('./chunk-DQJ2CIH7.cjs');
|
|
6
|
-
require('./chunk-BTZ5O6VM.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.bundleNodeModule = _chunkDQJ2CIH7cjs.bundleNodeModule; exports.isDeclarationFile = _chunkDQJ2CIH7cjs.isDeclarationFile; exports.resolvePackageWithoutTsconfig = _chunkDQJ2CIH7cjs.resolvePackageWithoutTsconfig;
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
interface FarmNodeAbortRequest {
|
|
2
|
-
aborted?: boolean;
|
|
3
|
-
once(event: "aborted", listener: () => void): unknown;
|
|
4
|
-
off(event: "aborted", listener: () => void): unknown;
|
|
5
|
-
}
|
|
6
|
-
interface FarmNodeAbortResponse {
|
|
7
|
-
writableEnded: boolean;
|
|
8
|
-
once(event: "close" | "finish", listener: () => void): unknown;
|
|
9
|
-
off(event: "close" | "finish", listener: () => void): unknown;
|
|
10
|
-
}
|
|
11
|
-
/** Share disconnect semantics between development and production Node requests. */
|
|
12
|
-
declare function createFarmNodeRequestAbortSignal(req: FarmNodeAbortRequest, res: FarmNodeAbortResponse): AbortSignal;
|
|
13
|
-
type FarmServerDuration = number | `${number}${"ms" | "s" | "m" | "h"}`;
|
|
14
|
-
interface FarmServerHealthConfig {
|
|
15
|
-
/** Liveness endpoint. It remains healthy while a production process drains. */
|
|
16
|
-
livenessPath?: string;
|
|
17
|
-
/** Readiness endpoint. It returns 503 until startup completes and while draining. */
|
|
18
|
-
readinessPath?: string;
|
|
19
|
-
}
|
|
20
|
-
interface ResolvedFarmServerHealthConfig {
|
|
21
|
-
enabled: boolean;
|
|
22
|
-
livenessPath: string;
|
|
23
|
-
readinessPath: string;
|
|
24
|
-
}
|
|
25
|
-
interface FarmServerConfig {
|
|
26
|
-
/** Maximum request body size for API routes, integrations, workflows, and uploads. */
|
|
27
|
-
bodySizeLimit?: number | string;
|
|
28
|
-
/**
|
|
29
|
-
* Trust proxy-provided client address and request authority headers. Enable only behind a trusted proxy.
|
|
30
|
-
* The client address is the last `X-Forwarded-For` hop, the one the closest proxy appended.
|
|
31
|
-
*/
|
|
32
|
-
trustProxy?: boolean;
|
|
33
|
-
/** Maximum time for a Node client to send complete request headers. */
|
|
34
|
-
headersTimeout?: FarmServerDuration;
|
|
35
|
-
/** Maximum time for a Node client to send the complete request. */
|
|
36
|
-
requestTimeout?: FarmServerDuration;
|
|
37
|
-
/** How long an idle Node keep-alive connection remains open after a response. */
|
|
38
|
-
keepAliveTimeout?: FarmServerDuration;
|
|
39
|
-
/** Maximum time the Node adapter drains traffic before forcing shutdown. */
|
|
40
|
-
gracefulShutdownTimeout?: FarmServerDuration;
|
|
41
|
-
/** Production liveness and readiness endpoints. Set to false to disable them. */
|
|
42
|
-
health?: false | FarmServerHealthConfig;
|
|
43
|
-
}
|
|
44
|
-
interface ResolvedFarmServerConfig {
|
|
45
|
-
bodySizeLimit: number;
|
|
46
|
-
trustProxy: boolean;
|
|
47
|
-
headersTimeout: number;
|
|
48
|
-
requestTimeout: number;
|
|
49
|
-
keepAliveTimeout: number;
|
|
50
|
-
gracefulShutdownTimeout: number;
|
|
51
|
-
health: ResolvedFarmServerHealthConfig;
|
|
52
|
-
}
|
|
53
|
-
/** Apply the weak entity-tag comparison required by If-None-Match. */
|
|
54
|
-
declare function matchesFarmIfNoneMatch(value: string | readonly string[] | null | undefined, etag: string): boolean;
|
|
55
|
-
declare function resolveFarmServerConfig(config: FarmServerConfig | ResolvedFarmServerConfig | undefined): ResolvedFarmServerConfig;
|
|
56
|
-
declare function cloneFarmRequestWithContext(request: Request): Request;
|
|
57
|
-
declare function bufferFarmRequestBody(request: Request, limit: number): Promise<Request>;
|
|
58
|
-
declare function readFarmRequestBody(request: Request, limit: number): Promise<Uint8Array>;
|
|
59
|
-
declare function readNodeRequestBody(request: Parameters<typeof readNodeRequestBodyOnce>[0], limit: number): Promise<Buffer>;
|
|
60
|
-
declare function readNodeRequestBodyOnce(request: {
|
|
61
|
-
headers: Record<string, string | string[] | undefined>;
|
|
62
|
-
on(event: "data", listener: (chunk: unknown) => void): unknown;
|
|
63
|
-
on(event: "end", listener: () => void): unknown;
|
|
64
|
-
on(event: "error", listener: (error: Error) => void): unknown;
|
|
65
|
-
removeListener?(event: string, listener: (...args: any[]) => void): unknown;
|
|
66
|
-
resume?(): unknown;
|
|
67
|
-
}, limit: number): Promise<Buffer>;
|
|
68
|
-
declare function createFarmRequestBodyErrorResponse(error: unknown): Response | null;
|
|
69
|
-
|
|
70
|
-
type FarmWorkflowSchedule = string | string[];
|
|
71
|
-
interface FarmWorkflowsUserConfig {
|
|
72
|
-
/** Enable or disable Farm workflow discovery. Enabled by default. */
|
|
73
|
-
enabled?: boolean;
|
|
74
|
-
/** Directory or directories to scan for workflow modules. */
|
|
75
|
-
dir?: string | string[];
|
|
76
|
-
/** Alias for dir. */
|
|
77
|
-
dirs?: string[];
|
|
78
|
-
/** HTTP route used for manual and URL-based cron invocation. */
|
|
79
|
-
route?: string;
|
|
80
|
-
/** Environment variable that stores the optional runner secret. */
|
|
81
|
-
secretEnv?: string;
|
|
82
|
-
/** Inline runner secret. Prefer secretEnv for deployed apps. */
|
|
83
|
-
secret?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Serve the workflow route without a secret in a deployed runtime.
|
|
86
|
-
* Defaults to false: without a secret the route is public, so production
|
|
87
|
-
* requests are rejected unless this is explicitly enabled.
|
|
88
|
-
*/
|
|
89
|
-
allowUnsecured?: boolean;
|
|
90
|
-
}
|
|
91
|
-
interface FarmWorkflowsResolvedConfig {
|
|
92
|
-
enabled: boolean;
|
|
93
|
-
dirs: string[];
|
|
94
|
-
route: string;
|
|
95
|
-
secretEnv: string;
|
|
96
|
-
secret?: string;
|
|
97
|
-
allowUnsecured?: boolean;
|
|
98
|
-
}
|
|
99
|
-
interface FarmWorkflowLogger {
|
|
100
|
-
info: (...args: unknown[]) => void;
|
|
101
|
-
warn: (...args: unknown[]) => void;
|
|
102
|
-
error: (...args: unknown[]) => void;
|
|
103
|
-
}
|
|
104
|
-
interface FarmWorkflowRunContext<TPayload = unknown> {
|
|
105
|
-
id: string;
|
|
106
|
-
name: string;
|
|
107
|
-
payload: TPayload;
|
|
108
|
-
scheduledTime?: number | string;
|
|
109
|
-
request?: Request;
|
|
110
|
-
event?: unknown;
|
|
111
|
-
env: Record<string, string | undefined>;
|
|
112
|
-
data: Map<string, unknown>;
|
|
113
|
-
log: FarmWorkflowLogger;
|
|
114
|
-
}
|
|
115
|
-
interface FarmWorkflowDefinition<TPayload = unknown, TResult = unknown> {
|
|
116
|
-
kind?: "farm-workflow";
|
|
117
|
-
id?: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
schedule?: FarmWorkflowSchedule;
|
|
120
|
-
timezone?: string;
|
|
121
|
-
run: (ctx: FarmWorkflowRunContext<TPayload>) => TResult | Promise<TResult>;
|
|
122
|
-
}
|
|
123
|
-
interface FarmCronDefinition<TPayload = unknown, TResult = unknown> extends FarmWorkflowDefinition<TPayload, TResult> {
|
|
124
|
-
schedule: FarmWorkflowSchedule;
|
|
125
|
-
}
|
|
126
|
-
interface FarmDiscoveredWorkflow {
|
|
127
|
-
id: string;
|
|
128
|
-
filePath: string;
|
|
129
|
-
description?: string;
|
|
130
|
-
schedule: string[];
|
|
131
|
-
timezone?: string;
|
|
132
|
-
routePath: string;
|
|
133
|
-
}
|
|
134
|
-
interface PreparedFarmWorkflows {
|
|
135
|
-
workflows: FarmDiscoveredWorkflow[];
|
|
136
|
-
tasks: Record<string, {
|
|
137
|
-
handler: string;
|
|
138
|
-
description: string;
|
|
139
|
-
}>;
|
|
140
|
-
scheduledTasks: Record<string, string | string[]>;
|
|
141
|
-
handlerPath?: string;
|
|
142
|
-
manifestPath?: string;
|
|
143
|
-
}
|
|
144
|
-
interface FarmWorkflowHTTPHandlerOptions {
|
|
145
|
-
workflows: FarmDiscoveredWorkflow[];
|
|
146
|
-
config: FarmWorkflowsResolvedConfig;
|
|
147
|
-
loadModule: (workflow: FarmDiscoveredWorkflow) => Promise<Record<string, any>>;
|
|
148
|
-
server?: FarmServerConfig | ResolvedFarmServerConfig;
|
|
149
|
-
}
|
|
150
|
-
declare const DEFAULT_FARM_WORKFLOW_DIRS: string[];
|
|
151
|
-
declare const DEFAULT_FARM_WORKFLOW_ROUTE = "/api/_farm/workflows";
|
|
152
|
-
declare const DEFAULT_FARM_WORKFLOW_SECRET_ENV = "CRON_SECRET";
|
|
153
|
-
declare function defineWorkflow<const TPayload = unknown, TResult = unknown>(definition: FarmWorkflowDefinition<TPayload, TResult>): FarmWorkflowDefinition<TPayload, TResult>;
|
|
154
|
-
declare function defineTask<const TPayload = unknown, TResult = unknown>(definition: FarmWorkflowDefinition<TPayload, TResult>): FarmWorkflowDefinition<TPayload, TResult>;
|
|
155
|
-
/**
|
|
156
|
-
* @deprecated Configure `cron` in `farm.config.ts` and point it at an API route.
|
|
157
|
-
*/
|
|
158
|
-
declare function defineCron<const TPayload = unknown, TResult = unknown>(definition: FarmCronDefinition<TPayload, TResult>): FarmCronDefinition<TPayload, TResult>;
|
|
159
|
-
declare function resolveWorkflowsConfig(workflows: FarmWorkflowsUserConfig | boolean | undefined): FarmWorkflowsResolvedConfig;
|
|
160
|
-
declare function discoverFarmWorkflows(config: {
|
|
161
|
-
root?: string;
|
|
162
|
-
workflows?: FarmWorkflowsResolvedConfig | FarmWorkflowsUserConfig | boolean;
|
|
163
|
-
}, options?: {
|
|
164
|
-
loadModule?: (filePath: string) => Promise<Record<string, any>>;
|
|
165
|
-
}): Promise<FarmDiscoveredWorkflow[]>;
|
|
166
|
-
declare function createFarmWorkflowRequestHandler(options: FarmWorkflowHTTPHandlerOptions): (request: Request) => Promise<Response | null>;
|
|
167
|
-
declare function runFarmWorkflowModule(module: Record<string, any>, context: {
|
|
168
|
-
id: string;
|
|
169
|
-
name?: string;
|
|
170
|
-
payload?: unknown;
|
|
171
|
-
scheduledTime?: number | string;
|
|
172
|
-
request?: Request;
|
|
173
|
-
event?: unknown;
|
|
174
|
-
env?: Record<string, string | undefined>;
|
|
175
|
-
}): Promise<unknown>;
|
|
176
|
-
declare function prepareFarmWorkflowsForNitro(config: {
|
|
177
|
-
root?: string;
|
|
178
|
-
distDir?: string;
|
|
179
|
-
workflows?: FarmWorkflowsResolvedConfig | FarmWorkflowsUserConfig | boolean;
|
|
180
|
-
server?: FarmServerConfig | ResolvedFarmServerConfig;
|
|
181
|
-
}): Promise<PreparedFarmWorkflows>;
|
|
182
|
-
declare function createFarmWorkflowVercelCrons(workflows: FarmDiscoveredWorkflow[]): Array<{
|
|
183
|
-
path: string;
|
|
184
|
-
schedule: string;
|
|
185
|
-
}>;
|
|
186
|
-
declare function applyFarmWorkflowVercelCrons(vercelConfig: Record<string, any>, workflows: FarmDiscoveredWorkflow[]): Record<string, any>;
|
|
187
|
-
|
|
188
|
-
export { cloneFarmRequestWithContext as A, createFarmRequestBodyErrorResponse as B, matchesFarmIfNoneMatch as C, DEFAULT_FARM_WORKFLOW_DIRS as D, readFarmRequestBody as E, type FarmWorkflowsResolvedConfig as F, readNodeRequestBody as G, resolveFarmServerConfig as H, type PreparedFarmWorkflows as P, type ResolvedFarmServerConfig as R, DEFAULT_FARM_WORKFLOW_ROUTE as a, DEFAULT_FARM_WORKFLOW_SECRET_ENV as b, createFarmNodeRequestAbortSignal as c, type FarmCronDefinition as d, type FarmDiscoveredWorkflow as e, type FarmServerConfig as f, type FarmServerDuration as g, type FarmServerHealthConfig as h, type FarmWorkflowDefinition as i, type FarmWorkflowHTTPHandlerOptions as j, type FarmWorkflowLogger as k, type FarmWorkflowRunContext as l, type FarmWorkflowSchedule as m, type FarmWorkflowsUserConfig as n, type ResolvedFarmServerHealthConfig as o, applyFarmWorkflowVercelCrons as p, createFarmWorkflowRequestHandler as q, createFarmWorkflowVercelCrons as r, defineCron as s, defineTask as t, defineWorkflow as u, discoverFarmWorkflows as v, prepareFarmWorkflowsForNitro as w, resolveWorkflowsConfig as x, runFarmWorkflowModule as y, bufferFarmRequestBody as z };
|