@farm.js/core 0.1.72 → 0.1.74
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-VIT4GOSR.mjs → agent-mcp-handler-HX4F4VKN.mjs} +4 -4
- package/dist/{agent-mcp-handler-KE4J3W7S.cjs → agent-mcp-handler-NRIL4JBC.cjs} +5 -5
- package/dist/{agent-mcp.d-Cwff7lcA.d.mts → agent-mcp.d-BEhDfdWc.d.mts} +1 -1
- package/dist/{agent-mcp.d-BO3rZXEM.d.ts → agent-mcp.d-CX8_oOT_.d.ts} +1 -1
- package/dist/agent-runtime.cjs +4 -4
- package/dist/agent-runtime.d.mts +5 -5
- package/dist/agent-runtime.d.ts +5 -5
- package/dist/agent-runtime.mjs +3 -3
- package/dist/{analyzer-5Q75LTIL.mjs → analyzer-2K35LIQZ.mjs} +2 -2
- package/dist/analyzer-6EOYURMV.cjs +16 -0
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/client.native.d.mts +4 -4
- package/dist/api/client.native.d.ts +4 -4
- package/dist/api/node.cjs +9 -8
- package/dist/api/node.d.mts +7 -7
- package/dist/api/node.d.ts +7 -7
- package/dist/api/node.mjs +8 -7
- package/dist/api/route-manager.cjs +11 -9
- package/dist/api/route-manager.d.mts +10 -8
- package/dist/api/route-manager.d.ts +10 -8
- package/dist/api/route-manager.mjs +10 -8
- package/dist/api/runtime.cjs +8 -7
- package/dist/api/runtime.d.mts +6 -6
- package/dist/api/runtime.d.ts +6 -6
- package/dist/api/runtime.mjs +7 -6
- package/dist/{api-client.d-Bp35zMqR.d.mts → api-client.d-CyVmI4Di.d.mts} +2 -2
- package/dist/{api-client.d-CFI_xL0V.d.ts → api-client.d-DrTM7BdH.d.ts} +2 -2
- package/dist/api.cjs +13 -11
- package/dist/api.d.mts +10 -10
- package/dist/api.d.ts +10 -10
- package/dist/api.mjs +12 -10
- package/dist/{app-manifest.d-USD_IbFd.d.mts → app-manifest.d-BcXt2yCx.d.mts} +10 -1
- package/dist/{app-manifest.d-DwjGkYlP.d.ts → app-manifest.d-CVEx1CFB.d.ts} +10 -1
- package/dist/app-markdown.cjs +8 -4
- package/dist/app-markdown.d.mts +7 -7
- package/dist/app-markdown.d.ts +7 -7
- package/dist/app-markdown.mjs +7 -3
- package/dist/{app.d-DAmF2MAk.d.ts → app.d-B6i8CSrx.d.ts} +36 -4
- package/dist/{app.d-fW06_h8h.d.mts → app.d-DowzSmT5.d.mts} +36 -4
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +8 -0
- package/dist/cache.d.ts +8 -0
- package/dist/cache.mjs +1 -1
- package/dist/chunk-2DOI6HLJ.cjs +284 -0
- package/dist/chunk-2GQBBOFH.mjs +76 -0
- package/dist/{chunk-5LOARKDP.cjs → chunk-2TZ3F6TN.cjs} +29 -17
- package/dist/{chunk-IWCYRDRQ.cjs → chunk-35GBGSQZ.cjs} +3 -3
- package/dist/{chunk-GF22VGMS.cjs → chunk-3BUJIPKE.cjs} +2 -2
- package/dist/{chunk-Y5LEPEVH.mjs → chunk-3ODLJRA6.mjs} +1 -1
- package/dist/{chunk-DMAP4RND.cjs → chunk-3OMLZLDE.cjs} +54 -16
- package/dist/{chunk-VNBDN5W2.cjs → chunk-47ZDUDN5.cjs} +64 -27
- package/dist/{chunk-2W4GNXGX.cjs → chunk-4AB62NMW.cjs} +2 -2
- package/dist/{chunk-HDPT6OYE.cjs → chunk-4M5ESTJ2.cjs} +10 -2
- package/dist/{chunk-CBLRSZQL.cjs → chunk-56HHUSR5.cjs} +502 -430
- package/dist/chunk-5XD2ULJG.mjs +114 -0
- package/dist/{chunk-JX5VOLAV.cjs → chunk-65OS2TOT.cjs} +4 -4
- package/dist/{chunk-WIJF3PBM.mjs → chunk-6JEXH7N6.mjs} +1 -1
- package/dist/{chunk-TY5KCYDE.mjs → chunk-72NTEYCX.mjs} +10 -3
- package/dist/{chunk-5R4Q5FN7.cjs → chunk-737MIVX3.cjs} +52 -41
- package/dist/{chunk-5X6OHJEE.cjs → chunk-77SVUQM5.cjs} +74 -20
- package/dist/{chunk-CKQAQFF6.mjs → chunk-7RKHXF4P.mjs} +2 -2
- package/dist/{chunk-GJEC5S4V.mjs → chunk-7VCLTNED.mjs} +1 -1
- package/dist/{chunk-E3LE6EZH.cjs → chunk-ACAEFEOH.cjs} +38 -41
- package/dist/{chunk-REP6HWJN.mjs → chunk-AL6E63FZ.mjs} +2 -2
- package/dist/{chunk-DQ2DI3Y7.mjs → chunk-AO5IRA2N.mjs} +2 -2
- package/dist/{chunk-VAWDGGW3.mjs → chunk-AU5UPNOD.mjs} +26 -15
- package/dist/{chunk-DS7JGFW5.mjs → chunk-B3XY6FMC.mjs} +71 -17
- package/dist/{chunk-U7VH3Q5E.cjs → chunk-B5WZP3T3.cjs} +15 -2
- package/dist/{chunk-3JN5M3T5.mjs → chunk-BFOMCSZ2.mjs} +476 -138
- package/dist/{chunk-I4KPA2C6.mjs → chunk-BIX46FTI.mjs} +1 -1
- package/dist/{chunk-YZLEOMMA.mjs → chunk-BNXV3PRM.mjs} +4 -4
- package/dist/{chunk-3GNVIYPO.cjs → chunk-BSJMWCWM.cjs} +7 -7
- package/dist/{chunk-WVQNXXNE.cjs → chunk-BWFBTTJ5.cjs} +2 -2
- package/dist/{chunk-FEFCISOX.cjs → chunk-CEVXKJKF.cjs} +2 -2
- package/dist/{chunk-DGNMXL2O.mjs → chunk-CF77L6RL.mjs} +33 -36
- package/dist/{chunk-OB45EAQL.mjs → chunk-CXQZQK6R.mjs} +3 -2
- package/dist/{chunk-255J7K4X.mjs → chunk-D2IAYGYA.mjs} +1 -1
- package/dist/{chunk-OSEQL34Q.cjs → chunk-D4TYE6MY.cjs} +2 -2
- package/dist/{chunk-FSSONJRV.cjs → chunk-DM2YGTRH.cjs} +24 -17
- package/dist/{chunk-ICFPTHXM.mjs → chunk-DRBXYJZ6.mjs} +7 -3
- package/dist/{chunk-E3HDJCWF.mjs → chunk-DRHHTHA3.mjs} +1 -1
- package/dist/{chunk-YXIQYWOK.cjs → chunk-DTBRSRTR.cjs} +23 -5
- package/dist/{chunk-JZQS3ZOI.mjs → chunk-E4T7WJJN.mjs} +10 -2
- package/dist/{chunk-YAEN3L2F.cjs → chunk-EF5AP4CV.cjs} +21 -2
- package/dist/{chunk-SPP3EZTJ.cjs → chunk-EHJOSIXM.cjs} +137 -67
- package/dist/{chunk-JZBU7V4D.mjs → chunk-ELJQWUAR.mjs} +125 -55
- package/dist/{chunk-DMXMIE2C.cjs → chunk-ENYBDM4U.cjs} +2 -2
- package/dist/{chunk-ZFEJ2SF2.cjs → chunk-EWIEJQP6.cjs} +28 -28
- package/dist/{chunk-ZUVAGMQ5.cjs → chunk-F244KE2D.cjs} +7 -7
- package/dist/{chunk-WW3LRNQV.mjs → chunk-FCBUNILW.mjs} +1 -1
- package/dist/{chunk-645ENY7W.mjs → chunk-FEQ72ZHD.mjs} +16 -9
- package/dist/{chunk-ME7RVELR.mjs → chunk-FGXSWRWA.mjs} +20 -1
- package/dist/{chunk-2AFW7673.cjs → chunk-FNWL5DMG.cjs} +4 -3
- package/dist/{chunk-HLMUWKAP.cjs → chunk-FYV6DTAG.cjs} +826 -531
- package/dist/{chunk-7PPLTD3P.cjs → chunk-G7S6XG6X.cjs} +6 -6
- package/dist/{chunk-AQIO3RNL.mjs → chunk-GK2GBIXD.mjs} +3 -3
- package/dist/{chunk-IHTDLCDJ.cjs → chunk-GRHSQYD4.cjs} +17 -4
- package/dist/{chunk-W44X6IC2.cjs → chunk-HBLYSWIJ.cjs} +13 -9
- package/dist/chunk-HK4VJI27.cjs +76 -0
- package/dist/{chunk-EGIY4A7V.cjs → chunk-HKZVC5GP.cjs} +2 -2
- package/dist/{chunk-EYPSKXO4.mjs → chunk-HRQV5Q3J.mjs} +1 -1
- package/dist/{chunk-S7MWSFFP.cjs → chunk-IBEHVSU4.cjs} +2 -2
- package/dist/{chunk-77VNYVVX.mjs → chunk-IG4IQMIW.mjs} +1 -1
- package/dist/{chunk-N3XO5AL5.cjs → chunk-IJFNXP3D.cjs} +2 -2
- package/dist/{chunk-RFWWXEIF.mjs → chunk-IP2R2TAE.mjs} +1 -1
- package/dist/{chunk-FETMUBIA.mjs → chunk-IZ5WOTQP.mjs} +1 -1
- package/dist/{chunk-CSLHNBPS.cjs → chunk-J42QN7OC.cjs} +6 -6
- package/dist/{chunk-NDDRTFN4.mjs → chunk-J7EUGGTY.mjs} +2 -2
- package/dist/{chunk-5XFKWHZD.mjs → chunk-JI6N4W2I.mjs} +208 -136
- package/dist/{chunk-GJ7QVFAG.mjs → chunk-JOECBGY7.mjs} +1 -1
- package/dist/{chunk-CL52PD6D.cjs → chunk-JSUVQ5HG.cjs} +8 -8
- package/dist/{chunk-DZHTNSQ5.cjs → chunk-JWHRVBCZ.cjs} +14 -14
- package/dist/{chunk-OSMUE5ST.mjs → chunk-JZ43UD6S.mjs} +7 -7
- package/dist/{chunk-RLEALQEN.mjs → chunk-KIRIFO6T.mjs} +43 -5
- package/dist/{chunk-XGTFLG73.cjs → chunk-KMYOKQPP.cjs} +18 -11
- package/dist/{chunk-WX63N6C5.mjs → chunk-KNEYWPZV.mjs} +64 -27
- package/dist/{chunk-AYVGD3PK.mjs → chunk-KUMKBBYP.mjs} +1 -1
- package/dist/{chunk-VT25ERQK.mjs → chunk-KWUZJZ23.mjs} +21 -3
- package/dist/{chunk-NV26EGMC.mjs → chunk-LHFGTR7F.mjs} +2 -2
- package/dist/{chunk-4P5634G6.cjs → chunk-LIQJYEQP.cjs} +14 -9
- package/dist/chunk-LRPPXKCX.mjs +58 -0
- package/dist/chunk-LXTYJ2HW.mjs +139 -0
- package/dist/{chunk-O32QPFVV.cjs → chunk-MKQ27TGW.cjs} +5 -5
- package/dist/{chunk-KQAB5LML.mjs → chunk-MQ5HA7H2.mjs} +2 -2
- package/dist/{chunk-Z3GPAFIA.mjs → chunk-MUITBU5Z.mjs} +1 -1
- package/dist/chunk-NDOE76QC.cjs +58 -0
- package/dist/{chunk-EXN4DTVF.cjs → chunk-NET6PBUH.cjs} +2 -2
- package/dist/{chunk-YBY34UHB.mjs → chunk-NKETXVKP.mjs} +15 -2
- package/dist/chunk-NRWEY2CM.mjs +25 -0
- package/dist/chunk-NU5XLYRN.cjs +139 -0
- package/dist/{chunk-BE7AQXJB.cjs → chunk-NXGQIXR7.cjs} +507 -169
- package/dist/{chunk-C5AM2XDN.cjs → chunk-O2A6HE76.cjs} +4 -4
- package/dist/{chunk-OAEDVXVE.mjs → chunk-O6K4G7YA.mjs} +5 -2
- package/dist/{chunk-LXEJNWF5.mjs → chunk-OSKIG4OP.mjs} +2 -2
- package/dist/{chunk-3WG7GJQL.cjs → chunk-P3EZKU6L.cjs} +18 -18
- package/dist/{chunk-C2JOS77Z.cjs → chunk-PG6ZIHKE.cjs} +250 -51
- package/dist/{chunk-ET6WW3FY.cjs → chunk-Q3MVNRAO.cjs} +1305 -848
- package/dist/{chunk-AZ6IW6SF.mjs → chunk-Q4G52OSW.mjs} +1 -1
- package/dist/{chunk-TPYAYFMF.cjs → chunk-QL3YZTGZ.cjs} +2 -2
- package/dist/{chunk-JMFTKNBA.mjs → chunk-R4BWNP73.mjs} +2 -2
- package/dist/{chunk-J5ASGNKF.mjs → chunk-R6Q6VSGU.mjs} +24 -9
- package/dist/{chunk-B6RBJJ5G.mjs → chunk-RBRIKT6B.mjs} +15 -2
- package/dist/{chunk-C6CUUBY5.cjs → chunk-RHI67C2V.cjs} +5 -5
- package/dist/chunk-RK3YYUX6.cjs +114 -0
- package/dist/{chunk-Y2LU4LE5.mjs → chunk-ROPMQNCG.mjs} +2 -2
- package/dist/{chunk-QIXEU2WV.cjs → chunk-RQ4UZJPR.cjs} +3 -3
- package/dist/{chunk-ZDZUFD67.cjs → chunk-RSL3YFJG.cjs} +1 -1
- package/dist/{chunk-JWY66PID.cjs → chunk-S3D6SL2V.cjs} +9 -6
- package/dist/{chunk-4HGLJOXZ.cjs → chunk-TPDKFRQX.cjs} +11 -11
- package/dist/{chunk-E2V7RRFL.mjs → chunk-UHAARKF3.mjs} +2 -2
- package/dist/{chunk-QSTRBKHZ.mjs → chunk-UJWRXBVP.mjs} +2 -2
- package/dist/{chunk-7QCJDYZQ.cjs → chunk-V6T3UJAH.cjs} +7 -7
- package/dist/{chunk-AUAMXI6N.mjs → chunk-VFPFXMTF.mjs} +1 -1
- package/dist/{chunk-KPJYBSHL.mjs → chunk-VKLV7GF4.mjs} +221 -22
- package/dist/{chunk-TP4RAV7Y.cjs → chunk-VKRMO3EZ.cjs} +8 -8
- package/dist/chunk-VWIW47FW.cjs +25 -0
- package/dist/{chunk-L6E4SHUB.cjs → chunk-VZKCGHWC.cjs} +39 -24
- package/dist/{chunk-JWLRBDDC.cjs → chunk-WH3PBJS7.cjs} +2 -2
- package/dist/{chunk-BSXKZPFE.mjs → chunk-WS4SLJW5.mjs} +501 -206
- package/dist/{chunk-5OFNUETM.mjs → chunk-WTTJ2YS2.mjs} +9 -1
- package/dist/{chunk-RLFGKJQ6.mjs → chunk-X2KNHD4B.mjs} +14 -2
- package/dist/{chunk-5CFHQ7HM.mjs → chunk-XXKMAHYE.mjs} +1 -1
- package/dist/{chunk-MBCRWU3P.cjs → chunk-XZPI44Q7.cjs} +4 -4
- package/dist/{chunk-ACGBXN3U.cjs → chunk-Y4FEQBKY.cjs} +17 -9
- package/dist/{chunk-MWUDEYBI.mjs → chunk-YH33PZ3K.mjs} +1 -1
- package/dist/chunk-YQWRBBAA.mjs +284 -0
- package/dist/{chunk-QUYAGU65.mjs → chunk-YWDRWG4L.mjs} +1210 -753
- package/dist/{chunk-E46NXBNJ.mjs → chunk-ZD7JUTBY.mjs} +11 -6
- package/dist/{chunk-JDO346NV.mjs → chunk-ZLRWO5GK.mjs} +1 -1
- package/dist/{chunk-NAXKOTPP.cjs → chunk-ZRCGPSUM.cjs} +21 -21
- package/dist/{chunk-YCNHUIPR.cjs → chunk-ZZGANFQH.cjs} +10 -10
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-9J7CkTWW.d.ts → client-component.d-DYOwmq0c.d.ts} +80 -3
- package/dist/{client-component.d-ciHeCxr-.d.mts → client-component.d-edV76QvU.d.mts} +80 -3
- package/dist/{client-plugins.d-CUOhfapO.d.ts → client-plugins.d-BmJYW2FY.d.ts} +20 -7
- package/dist/{client-plugins.d-JnRz5a1o.d.mts → client-plugins.d-DwvqqGsU.d.mts} +20 -7
- package/dist/client-plugins.d.mts +5 -5
- package/dist/client-plugins.d.ts +5 -5
- package/dist/client.cjs +6 -5
- package/dist/client.d.mts +12 -12
- package/dist/client.d.ts +12 -12
- package/dist/client.mjs +5 -4
- package/dist/config.d.mts +5 -5
- package/dist/config.d.ts +5 -5
- package/dist/cron.cjs +6 -2
- package/dist/cron.d.mts +11 -2
- package/dist/cron.d.ts +11 -2
- package/dist/cron.mjs +7 -3
- package/dist/desktop.d.mts +6 -6
- package/dist/desktop.d.ts +6 -6
- package/dist/{devtools-7JPQMSTQ.mjs → devtools-WPX62NG2.mjs} +10 -9
- package/dist/{devtools-IZFUYWPG.cjs → devtools-YMDS7PUA.cjs} +12 -11
- package/dist/docs.cjs +14 -13
- package/dist/docs.d.mts +6 -6
- package/dist/docs.d.ts +6 -6
- package/dist/docs.mjs +13 -12
- package/dist/{endpoint.d-BkMSCRf6.d.mts → endpoint.d-BXbBpKoh.d.mts} +42 -1
- package/dist/{endpoint.d-BgHn0lhl.d.ts → endpoint.d-Dx_1k6Du.d.ts} +42 -1
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/headers.cjs +3 -3
- package/dist/{headers.d-CqpTL_fZ.d.ts → headers.d-BIbQyAxJ.d.ts} +1 -1
- package/dist/{headers.d-rbbTKGaN.d.mts → headers.d-BtNxFc2s.d.mts} +1 -1
- package/dist/headers.mjs +2 -2
- package/dist/index.cjs +73 -60
- package/dist/{index.d-CMKvzHLW.d.ts → index.d-CQ_wUzOV.d.ts} +1 -1
- package/dist/{index.d-D_B2D9Il.d.mts → index.d-CQdDRXd1.d.mts} +1 -1
- package/dist/index.d.mts +63 -29
- package/dist/index.d.ts +63 -29
- package/dist/index.mjs +69 -56
- package/dist/integrations/orm.d.mts +5 -5
- package/dist/integrations/orm.d.ts +5 -5
- package/dist/integrations.cjs +4 -4
- package/dist/integrations.d.mts +5 -5
- package/dist/integrations.d.ts +5 -5
- package/dist/integrations.mjs +3 -3
- package/dist/internal/app-markdown-runtime.cjs +7 -3
- package/dist/internal/app-markdown-runtime.d.mts +18 -7
- package/dist/internal/app-markdown-runtime.d.ts +18 -7
- package/dist/internal/app-markdown-runtime.mjs +6 -2
- package/dist/internal/build-runtime.cjs +42 -40
- package/dist/internal/build-runtime.d.mts +7 -7
- package/dist/internal/build-runtime.d.ts +7 -7
- package/dist/internal/build-runtime.mjs +41 -39
- package/dist/internal/cli-runtime.cjs +21 -20
- package/dist/internal/cli-runtime.mjs +20 -19
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +6 -2
- package/dist/internal/client-runtime.d.mts +22 -10
- package/dist/internal/client-runtime.d.ts +22 -10
- package/dist/internal/client-runtime.mjs +5 -1
- package/dist/internal/compression-runtime.d.mts +5 -5
- package/dist/internal/compression-runtime.d.ts +5 -5
- package/dist/internal/config-runtime.cjs +12 -11
- package/dist/internal/config-runtime.d.mts +7 -7
- package/dist/internal/config-runtime.d.ts +7 -7
- package/dist/internal/config-runtime.mjs +11 -10
- package/dist/internal/form-actions.cjs +5 -4
- package/dist/internal/form-actions.d.mts +2 -2
- package/dist/internal/form-actions.d.ts +2 -2
- package/dist/internal/form-actions.mjs +4 -3
- package/dist/internal/infra-analytics-runtime.cjs +10 -10
- package/dist/internal/infra-analytics-runtime.mjs +8 -8
- 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-runtime.cjs +32 -22
- package/dist/internal/production-runtime.d.mts +65 -14
- package/dist/internal/production-runtime.d.ts +65 -14
- package/dist/internal/production-runtime.mjs +31 -21
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +4 -4
- package/dist/internal/vercel-edge-middleware.mjs +3 -3
- package/dist/{lifecycle.d-keQs5Swc.d.mts → lifecycle.d-OtGWAvJT.d.mts} +4 -0
- package/dist/{lifecycle.d-keQs5Swc.d.ts → lifecycle.d-OtGWAvJT.d.ts} +4 -0
- package/dist/{manager-JIA66YJ2.mjs → manager-RHB2P35B.mjs} +4 -1
- package/dist/{manager-JOHU6BQI.cjs → manager-S77ZARTC.cjs} +5 -2
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +5 -5
- package/dist/markdown.d.ts +5 -5
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +6 -6
- package/dist/middleware.d.mts +5 -5
- package/dist/middleware.d.ts +5 -5
- package/dist/middleware.mjs +5 -5
- package/dist/{mount.d-ImEO7q8a.d.mts → mount.d-6bhpBQQB.d.mts} +1 -1
- package/dist/{mount.d-B0XMxDRh.d.ts → mount.d-C-u7rFkM.d.ts} +1 -1
- package/dist/{native-server-fn-handler-EP5AFJYE.mjs → native-server-fn-handler-I66X4E5S.mjs} +6 -5
- package/dist/{native-server-fn-handler-QRTXGZA4.cjs → native-server-fn-handler-W4FSD76W.cjs} +7 -6
- package/dist/{native-tree-L2IIEBXH.mjs → native-tree-3X23BT3N.mjs} +2 -2
- package/dist/{native-tree-GF4BH33L.cjs → native-tree-TAPKR7QJ.cjs} +3 -3
- package/dist/{navigation-delegate.d-83Q7ksf7.d.mts → navigation-delegate.d-nx6gtsY4.d.mts} +1 -1
- package/dist/{navigation-delegate.d-RRx1CSlb.d.ts → navigation-delegate.d-xsG4T1x-.d.ts} +1 -1
- package/dist/navigation.cjs +4 -4
- package/dist/navigation.d.mts +8 -8
- package/dist/navigation.d.ts +8 -8
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-2LMOMIST.cjs → nitro-SSFTPZMW.cjs} +4 -4
- package/dist/{nitro-72TFIGGO.mjs → nitro-XTQ2HKDL.mjs} +1 -1
- package/dist/{observability.d-B2363jB6.d.ts → observability.d-DdJRiaIX.d.mts} +27 -3
- package/dist/{observability.d-B2363jB6.d.mts → observability.d-DdJRiaIX.d.ts} +27 -3
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +36 -33
- package/dist/plugin.d.mts +8 -8
- package/dist/plugin.d.ts +8 -8
- package/dist/plugin.mjs +35 -32
- package/dist/query/client.cjs +5 -5
- package/dist/query/client.mjs +1 -1
- package/dist/{render-plan.d-wP8nTeRV.d.mts → render-plan.d-B5y3h97B.d.mts} +1 -1
- package/dist/{render-plan.d-Ds2sXJ5m.d.ts → render-plan.d-gW0fwKz2.d.ts} +1 -1
- package/dist/renderer-client.cjs +4 -4
- package/dist/renderer-client.d.mts +8 -8
- package/dist/renderer-client.d.ts +8 -8
- package/dist/renderer-client.mjs +1 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-zpSn6pu_.d.ts → request.d-B0ugAadD.d.ts} +9 -2
- package/dist/{request.d-F3h7K37m.d.mts → request.d-DLq33nYo.d.mts} +9 -2
- package/dist/request.d.mts +6 -6
- package/dist/request.d.ts +6 -6
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-Mw0ZKG2e.d.mts → route-rendering.d-DSeIV7yV.d.mts} +1 -1
- package/dist/{route-rendering.d-BL0_AdKj.d.ts → route-rendering.d-ytaqDQD6.d.ts} +1 -1
- package/dist/{route.d-DrXkpvcg.d.mts → route.d-Cd4Fi6BA.d.ts} +3 -1
- package/dist/{route.d-hs-_cyHn.d.ts → route.d-ShmtqqVQ.d.mts} +3 -1
- package/dist/{router.d-BwXigemZ.d.ts → router.d-BaEAEGPg.d.ts} +1 -1
- package/dist/{router.d-NGVsU11T.d.mts → router.d-Chd5cpe3.d.mts} +1 -1
- package/dist/routes.cjs +5 -3
- package/dist/routes.d.mts +5 -5
- package/dist/routes.d.ts +5 -5
- package/dist/routes.mjs +4 -2
- package/dist/{rsc-pipeline-DHYZLWSF.mjs → rsc-pipeline-DPMYONEV.mjs} +12 -11
- package/dist/{rsc-pipeline-BNXYMG4G.cjs → rsc-pipeline-XIUUMMG5.cjs} +13 -12
- package/dist/{runtime-IWOT6ZVC.cjs → runtime-WD77S3C5.cjs} +25 -25
- package/dist/{runtime-XPYKUNL3.mjs → runtime-XIUJZTZ3.mjs} +16 -16
- package/dist/{runtime.d-BA3MzhXz.d.mts → runtime.d-DpCs0eAO.d.mts} +3 -3
- package/dist/{runtime.d-OBIZWpx1.d.ts → runtime.d-h2USyQsz.d.ts} +3 -3
- package/dist/server-action-security.cjs +5 -3
- package/dist/server-action-security.d.mts +11 -3
- package/dist/server-action-security.d.ts +11 -3
- package/dist/server-action-security.mjs +4 -2
- package/dist/server-fn-client.d.mts +3 -3
- package/dist/server-fn-client.d.ts +3 -3
- package/dist/server-fn.cjs +6 -5
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-fn.mjs +5 -4
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +54 -10
- package/dist/server-plugins.d.ts +54 -10
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query.cjs +7 -6
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server-query.mjs +6 -5
- package/dist/server.cjs +65 -68
- package/dist/server.d.mts +15 -15
- package/dist/server.d.ts +15 -15
- package/dist/server.mjs +44 -47
- package/dist/{spa-router.d-BG2XzE5p.d.mts → spa-router.d-DCQVtEaE.d.mts} +11 -5
- package/dist/{spa-router.d-DrYT944-.d.ts → spa-router.d-DpdJHs1q.d.ts} +11 -5
- package/dist/testing.cjs +16 -14
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.mjs +12 -10
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-C1k9BJeD.d.mts → utils.d-DKDZtAY5.d.mts} +1 -1
- package/dist/{utils.d-DcF4wxey.d.ts → utils.d-DmicwMvS.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +38 -33
- package/dist/vite.d.mts +24 -10
- package/dist/vite.d.ts +24 -10
- package/dist/vite.mjs +37 -32
- package/package.json +1 -1
- package/dist/analyzer-UJG4MIZW.cjs +0 -16
- package/dist/chunk-6I4BFRE7.cjs +0 -51
- package/dist/chunk-EIVGPQN5.mjs +0 -51
- package/dist/chunk-V3UOEWCB.cjs +0 -46
- package/dist/chunk-VE3FWJBO.mjs +0 -46
- /package/dist/{chunk-QEJWNXRI.cjs → chunk-EMRYJG4U.cjs} +0 -0
- /package/dist/{chunk-TXE4SAMV.mjs → chunk-H2ZJ35NW.mjs} +0 -0
|
@@ -1,58 +1,56 @@
|
|
|
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(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; }
|
|
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(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
var _chunkFPBOAG6Ncjs = require('./chunk-FPBOAG6N.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkVWIW47FWcjs = require('./chunk-VWIW47FW.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkHK4VJI27cjs = require('./chunk-HK4VJI27.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
|
|
7
16
|
|
|
8
17
|
|
|
18
|
+
var _chunkHLYRXN2Icjs = require('./chunk-HLYRXN2I.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
9
21
|
var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
|
|
10
22
|
|
|
11
23
|
// src/openapi/generator.ts
|
|
12
24
|
var allowedType = /* @__PURE__ */ new Set(["string", "number", "boolean", "array", "object"]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ZodPipeline: "pipe",
|
|
25
|
-
ZodRecord: "record",
|
|
26
|
-
ZodString: "string",
|
|
27
|
-
ZodTuple: "tuple",
|
|
28
|
-
ZodUnion: "union"
|
|
29
|
-
};
|
|
30
|
-
function getZodKind(schema) {
|
|
31
|
-
if (!schema || typeof schema !== "object") return void 0;
|
|
32
|
-
const definition = schema._def;
|
|
33
|
-
if (!definition || typeof definition !== "object") return void 0;
|
|
34
|
-
if (typeof definition.type === "string") return definition.type;
|
|
35
|
-
return typeof definition.typeName === "string" ? zodTypeNameKinds[definition.typeName] : void 0;
|
|
36
|
-
}
|
|
37
|
-
function getZodObjectShape(schema) {
|
|
38
|
-
if (getZodKind(schema) !== "object") return void 0;
|
|
39
|
-
const candidate = _nullishCoalesce(schema.shape, () => ( _optionalChain([schema, 'access', _ => _._def, 'optionalAccess', _2 => _2.shape])));
|
|
40
|
-
const shape = typeof candidate === "function" ? candidate() : candidate;
|
|
41
|
-
return shape && typeof shape === "object" ? shape : void 0;
|
|
42
|
-
}
|
|
43
|
-
function getZodTransformInput(schema) {
|
|
44
|
-
const kind = getZodKind(schema);
|
|
45
|
-
const definition = _optionalChain([schema, 'optionalAccess', _3 => _3._def]);
|
|
46
|
-
if (kind === "effects") return definition.schema;
|
|
47
|
-
if (kind !== "pipe") return void 0;
|
|
48
|
-
return getZodKind(definition.in) === "transform" ? definition.out : definition.in;
|
|
25
|
+
function isZodFileSchema(schema, kind) {
|
|
26
|
+
if (kind === "file") return true;
|
|
27
|
+
if (kind !== "custom" || typeof Blob === "undefined") return false;
|
|
28
|
+
const check = _optionalChain([schema, 'optionalAccess', _ => _._def, 'optionalAccess', _2 => _2.fn]);
|
|
29
|
+
if (typeof check !== "function") return false;
|
|
30
|
+
try {
|
|
31
|
+
const sample = typeof File === "undefined" ? new Blob([]) : new File([], "farm-openapi-probe");
|
|
32
|
+
return check(sample) === true && check("farm-openapi-probe") !== true;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
49
36
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
for (
|
|
53
|
-
|
|
37
|
+
function makeOperationIdsUnique(paths) {
|
|
38
|
+
const used = /* @__PURE__ */ new Set();
|
|
39
|
+
for (const pathItem of Object.values(paths)) {
|
|
40
|
+
const operations = [
|
|
41
|
+
...Object.values(_nullishCoalesce(pathItem, () => ( {}))),
|
|
42
|
+
...Object.values(_nullishCoalesce(_optionalChain([pathItem, 'optionalAccess', _3 => _3["x-oai-additionalOperations"]]), () => ( {})))
|
|
43
|
+
];
|
|
44
|
+
for (const operation of operations) {
|
|
45
|
+
if (!operation || typeof operation !== "object") continue;
|
|
46
|
+
const operationId = operation.operationId;
|
|
47
|
+
if (typeof operationId !== "string") continue;
|
|
48
|
+
let unique = operationId;
|
|
49
|
+
for (let index = 2; used.has(unique); index += 1) unique = `${operationId}_${index}`;
|
|
50
|
+
operation.operationId = unique;
|
|
51
|
+
used.add(unique);
|
|
52
|
+
}
|
|
54
53
|
}
|
|
55
|
-
return current;
|
|
56
54
|
}
|
|
57
55
|
function isStandardSchema(schema) {
|
|
58
56
|
return !!schema && typeof schema === "object" && typeof _optionalChain([schema, 'access', _4 => _4["~standard"], 'optionalAccess', _5 => _5.validate]) === "function";
|
|
@@ -82,7 +80,7 @@ var OpenAPIGenerator = class {
|
|
|
82
80
|
* Get type from Zod type
|
|
83
81
|
*/
|
|
84
82
|
getTypeFromZodType(zodType) {
|
|
85
|
-
const tag = getZodKind(zodType);
|
|
83
|
+
const tag = _chunkHK4VJI27cjs.getZodKind.call(void 0, zodType);
|
|
86
84
|
return typeof tag === "string" && allowedType.has(tag) ? tag : "string";
|
|
87
85
|
}
|
|
88
86
|
/**
|
|
@@ -92,19 +90,19 @@ var OpenAPIGenerator = class {
|
|
|
92
90
|
* which documented every `.default()` field as required.
|
|
93
91
|
*/
|
|
94
92
|
isRequiredField(value) {
|
|
95
|
-
const kind = getZodKind(unwrapZodTransforms(value));
|
|
93
|
+
const kind = _chunkHK4VJI27cjs.getZodKind.call(void 0, _chunkHK4VJI27cjs.unwrapZodTransforms.call(void 0, value));
|
|
96
94
|
return kind !== "optional" && kind !== "default";
|
|
97
95
|
}
|
|
98
96
|
/**
|
|
99
97
|
* Process Zod type to OpenAPI schema
|
|
100
98
|
*/
|
|
101
99
|
processZodType(zodType) {
|
|
102
|
-
const kind = getZodKind(zodType);
|
|
100
|
+
const kind = _chunkHK4VJI27cjs.getZodKind.call(void 0, zodType);
|
|
103
101
|
const definition = _optionalChain([zodType, 'optionalAccess', _6 => _6._def]);
|
|
104
102
|
if (!kind) {
|
|
105
103
|
return isStandardSchema(zodType) ? { description: "Schema metadata is unavailable for this Standard Schema validator." } : { description: "Schema metadata is unavailable." };
|
|
106
104
|
}
|
|
107
|
-
const transformInput = getZodTransformInput(zodType);
|
|
105
|
+
const transformInput = _chunkHK4VJI27cjs.getZodTransformInput.call(void 0, zodType);
|
|
108
106
|
if (transformInput) {
|
|
109
107
|
const inputSchema = this.processZodType(transformInput);
|
|
110
108
|
const description = zodType.description;
|
|
@@ -125,12 +123,12 @@ var OpenAPIGenerator = class {
|
|
|
125
123
|
return this.processZodType(definition.innerType);
|
|
126
124
|
}
|
|
127
125
|
if (kind === "object") {
|
|
128
|
-
const shape = getZodObjectShape(zodType);
|
|
126
|
+
const shape = _chunkHK4VJI27cjs.getZodObjectShape.call(void 0, zodType);
|
|
129
127
|
if (shape) {
|
|
130
128
|
const properties = {};
|
|
131
129
|
const required = [];
|
|
132
130
|
Object.entries(shape).forEach(([key, value]) => {
|
|
133
|
-
if (getZodKind(value) || isStandardSchema(value)) {
|
|
131
|
+
if (_chunkHK4VJI27cjs.getZodKind.call(void 0, value) || isStandardSchema(value)) {
|
|
134
132
|
properties[key] = this.processZodType(value);
|
|
135
133
|
if (this.isRequiredField(value)) {
|
|
136
134
|
required.push(key);
|
|
@@ -201,6 +199,14 @@ var OpenAPIGenerator = class {
|
|
|
201
199
|
}
|
|
202
200
|
return tupleSchema;
|
|
203
201
|
}
|
|
202
|
+
if (isZodFileSchema(zodType, kind)) {
|
|
203
|
+
const description = zodType.description;
|
|
204
|
+
return {
|
|
205
|
+
type: "string",
|
|
206
|
+
format: "binary",
|
|
207
|
+
...description === void 0 ? {} : { description }
|
|
208
|
+
};
|
|
209
|
+
}
|
|
204
210
|
const baseSchema = {
|
|
205
211
|
type: this.getTypeFromZodType(zodType),
|
|
206
212
|
description: zodType.description
|
|
@@ -299,6 +305,7 @@ var OpenAPIGenerator = class {
|
|
|
299
305
|
};
|
|
300
306
|
const routeGroups = /* @__PURE__ */ new Map();
|
|
301
307
|
for (const route of routes) {
|
|
308
|
+
if (route.path !== "/api" && !route.path.startsWith("/api/")) continue;
|
|
302
309
|
const key = route.path;
|
|
303
310
|
if (!routeGroups.has(key)) {
|
|
304
311
|
routeGroups.set(key, []);
|
|
@@ -307,11 +314,11 @@ var OpenAPIGenerator = class {
|
|
|
307
314
|
}
|
|
308
315
|
for (const [path, routeList] of routeGroups) {
|
|
309
316
|
for (const variant of this.getOpenAPIPathVariants(path)) {
|
|
310
|
-
_nullishCoalesce((_a = spec.paths)[_b = variant.path], () => ( (_a[_b] = {})));
|
|
311
317
|
for (const route of routeList) {
|
|
312
318
|
for (const method of route.methods) {
|
|
319
|
+
if (await this.isHidden(route, method)) continue;
|
|
313
320
|
if (variant.operationIdSuffix === "base") {
|
|
314
|
-
const existingOperation = method === "QUERY" ? _optionalChain([spec, 'access', _9 => _9.paths, 'access', _10 => _10[variant.path], '
|
|
321
|
+
const existingOperation = method === "QUERY" ? _optionalChain([spec, 'access', _9 => _9.paths, 'access', _10 => _10[variant.path], 'optionalAccess', _11 => _11["x-oai-additionalOperations"], 'optionalAccess', _12 => _12.QUERY]) : _optionalChain([spec, 'access', _13 => _13.paths, 'access', _14 => _14[variant.path], 'optionalAccess', _15 => _15[method.toLowerCase()]]);
|
|
315
322
|
if (existingOperation) continue;
|
|
316
323
|
}
|
|
317
324
|
const operation = await this.generateOperation(
|
|
@@ -320,19 +327,77 @@ var OpenAPIGenerator = class {
|
|
|
320
327
|
variant.path,
|
|
321
328
|
variant.operationIdSuffix
|
|
322
329
|
);
|
|
330
|
+
const pathItem = _nullishCoalesce((_a = spec.paths)[_b = variant.path], () => ( (_a[_b] = {})));
|
|
323
331
|
if (method === "QUERY") {
|
|
324
|
-
const additionalOperations = _nullishCoalesce(
|
|
332
|
+
const additionalOperations = _nullishCoalesce(pathItem["x-oai-additionalOperations"], () => ( {}));
|
|
325
333
|
additionalOperations.QUERY = operation;
|
|
326
|
-
|
|
334
|
+
pathItem["x-oai-additionalOperations"] = additionalOperations;
|
|
327
335
|
} else {
|
|
328
|
-
|
|
336
|
+
pathItem[method.toLowerCase()] = operation;
|
|
329
337
|
}
|
|
330
338
|
}
|
|
331
339
|
}
|
|
332
340
|
}
|
|
333
341
|
}
|
|
342
|
+
makeOperationIdsUnique(spec.paths);
|
|
343
|
+
this.addConfiguredPaths(spec);
|
|
334
344
|
return spec;
|
|
335
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* Adds `openapi.paths`, which describe routes Farm serves without a route file.
|
|
348
|
+
* Neither side silently replaces the other: an operation both describe is an error.
|
|
349
|
+
*/
|
|
350
|
+
addConfiguredPaths(spec) {
|
|
351
|
+
for (const [path, pathItem] of Object.entries(_nullishCoalesce(this.config.paths, () => ( {})))) {
|
|
352
|
+
if (!path.startsWith("/")) {
|
|
353
|
+
throw new Error(`openapi.paths keys must start with "/": received "${path}".`);
|
|
354
|
+
}
|
|
355
|
+
if (!pathItem || typeof pathItem !== "object" || Array.isArray(pathItem)) {
|
|
356
|
+
throw new Error(`openapi.paths["${path}"] must be an OpenAPI Path Item Object.`);
|
|
357
|
+
}
|
|
358
|
+
const generated = spec.paths[path];
|
|
359
|
+
if (generated) {
|
|
360
|
+
for (const key of Object.keys(pathItem)) {
|
|
361
|
+
if (key in generated) {
|
|
362
|
+
throw new Error(
|
|
363
|
+
`openapi.paths["${path}"].${key} describes an operation Farm already generates from an API route. Remove it, or hide the route with openapi: { hidden: true }.`
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
spec.paths[path] = { ...generated, ...pathItem };
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/** Endpoint metadata wins over the route file's `openapi` export. */
|
|
372
|
+
async isHidden(route, method) {
|
|
373
|
+
let hidden;
|
|
374
|
+
try {
|
|
375
|
+
hidden = await _asyncOptionalChain([(await this.loadEndpoint(route, method)), 'optionalAccess', async _16 => _16.__openapi, 'optionalAccess', async _17 => _17.hidden]);
|
|
376
|
+
} catch (e2) {
|
|
377
|
+
}
|
|
378
|
+
if (hidden !== void 0) return hidden;
|
|
379
|
+
if (route.endpoints) return _optionalChain([route, 'access', _18 => _18.openapi, 'optionalAccess', _19 => _19[method], 'optionalAccess', _20 => _20.hidden]) === true;
|
|
380
|
+
let routeModule;
|
|
381
|
+
try {
|
|
382
|
+
routeModule = await import(
|
|
383
|
+
/* @vite-ignore */
|
|
384
|
+
route.filePath
|
|
385
|
+
);
|
|
386
|
+
} catch (e3) {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
const routeOpenAPI = _chunkVWIW47FWcjs.resolveRouteOpenAPIConfig.call(void 0,
|
|
390
|
+
routeModule.openapi,
|
|
391
|
+
`API route "${route.path}"`
|
|
392
|
+
);
|
|
393
|
+
return _optionalChain([routeOpenAPI, 'optionalAccess', _21 => _21.hidden]) === true;
|
|
394
|
+
}
|
|
395
|
+
/** A mounted route's endpoint, or the export of a scanned route's file. */
|
|
396
|
+
async loadEndpoint(route, method) {
|
|
397
|
+
if (route.endpoints) return route.endpoints[method];
|
|
398
|
+
const routeModule = await this.loadRouteModule(route.filePath);
|
|
399
|
+
return routeModule[method];
|
|
400
|
+
}
|
|
336
401
|
/**
|
|
337
402
|
* Resolve server entries in decreasing order of authority: explicit OpenAPI
|
|
338
403
|
* servers, Farm's public API base, the current development request origin,
|
|
@@ -416,14 +481,14 @@ var OpenAPIGenerator = class {
|
|
|
416
481
|
return void 0;
|
|
417
482
|
}
|
|
418
483
|
try {
|
|
419
|
-
const
|
|
420
|
-
const
|
|
421
|
-
const bodySchema = _nullishCoalesce(_optionalChain([handler, 'optionalAccess', _13 => _13.__types, 'optionalAccess', _14 => _14.body]), () => ( _optionalChain([handler, 'optionalAccess', _15 => _15._type, 'optionalAccess', _16 => _16.body])));
|
|
484
|
+
const handler = await this.loadEndpoint(route, method);
|
|
485
|
+
const bodySchema = _nullishCoalesce(_optionalChain([handler, 'optionalAccess', _22 => _22.__types, 'optionalAccess', _23 => _23.body]), () => ( _optionalChain([handler, 'optionalAccess', _24 => _24._type, 'optionalAccess', _25 => _25.body])));
|
|
422
486
|
if (bodySchema) {
|
|
423
487
|
return {
|
|
424
488
|
required: this.isRequiredField(bodySchema),
|
|
425
489
|
content: {
|
|
426
|
-
|
|
490
|
+
// A multipart() body is sent as form data, its files as binary parts.
|
|
491
|
+
[_chunkHLYRXN2Icjs.isMultipartSchema.call(void 0, bodySchema) ? "multipart/form-data" : "application/json"]: {
|
|
427
492
|
schema: this.processZodType(bodySchema)
|
|
428
493
|
}
|
|
429
494
|
}
|
|
@@ -451,13 +516,12 @@ var OpenAPIGenerator = class {
|
|
|
451
516
|
async getParameters(route, method) {
|
|
452
517
|
const parameters = [];
|
|
453
518
|
try {
|
|
454
|
-
const
|
|
455
|
-
const
|
|
456
|
-
const
|
|
457
|
-
const shape = getZodObjectShape(unwrapZodTransforms(querySchema));
|
|
519
|
+
const handler = await this.loadEndpoint(route, method);
|
|
520
|
+
const querySchema = _nullishCoalesce(_optionalChain([handler, 'optionalAccess', _26 => _26.__types, 'optionalAccess', _27 => _27.query]), () => ( _optionalChain([handler, 'optionalAccess', _28 => _28._type, 'optionalAccess', _29 => _29.query])));
|
|
521
|
+
const shape = _chunkHK4VJI27cjs.getZodObjectShape.call(void 0, _chunkHK4VJI27cjs.unwrapZodTransforms.call(void 0, querySchema));
|
|
458
522
|
if (shape) {
|
|
459
523
|
Object.entries(shape).forEach(([key, value]) => {
|
|
460
|
-
if (getZodKind(value) || isStandardSchema(value)) {
|
|
524
|
+
if (_chunkHK4VJI27cjs.getZodKind.call(void 0, value) || isStandardSchema(value)) {
|
|
461
525
|
parameters.push({
|
|
462
526
|
name: key,
|
|
463
527
|
in: "query",
|
|
@@ -505,9 +569,8 @@ var OpenAPIGenerator = class {
|
|
|
505
569
|
}
|
|
506
570
|
async getEndpointOpenAPIMetadata(route, method) {
|
|
507
571
|
try {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
} catch (e) {
|
|
572
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadEndpoint(route, method)), 'optionalAccess', async _30 => _30.__openapi]), async () => ( {}));
|
|
573
|
+
} catch (e4) {
|
|
511
574
|
return {};
|
|
512
575
|
}
|
|
513
576
|
}
|
|
@@ -613,15 +676,22 @@ var OpenAPIManager = class {
|
|
|
613
676
|
const appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
|
|
614
677
|
this.appDir = appDirs[appDirs.length - 1];
|
|
615
678
|
this.config = config;
|
|
679
|
+
this.mountedRoutes = context.routes;
|
|
616
680
|
this.generator = new OpenAPIGenerator(this.appDir, config, context);
|
|
617
681
|
this.apiTypeGenerator = new (0, _chunkFPBOAG6Ncjs.APITypeGenerator)(appDirs);
|
|
618
682
|
}
|
|
683
|
+
getRoutes() {
|
|
684
|
+
if (!this.mountedRoutes) return this.apiTypeGenerator.scanAPIRoutes();
|
|
685
|
+
return [...this.mountedRoutes()].sort(
|
|
686
|
+
(left, right) => left.path.localeCompare(right.path) || (_nullishCoalesce(left.filePath, () => ( ""))).localeCompare(_nullishCoalesce(right.filePath, () => ( "")))
|
|
687
|
+
);
|
|
688
|
+
}
|
|
619
689
|
/**
|
|
620
690
|
* Generate OpenAPI spec from API routes
|
|
621
691
|
*/
|
|
622
692
|
async generateSpec() {
|
|
623
693
|
try {
|
|
624
|
-
const routes = this.
|
|
694
|
+
const routes = this.getRoutes();
|
|
625
695
|
const spec = await this.generator.generateSpec(routes);
|
|
626
696
|
this.specCache = spec;
|
|
627
697
|
return spec;
|
|
@@ -646,7 +716,7 @@ var OpenAPIManager = class {
|
|
|
646
716
|
*/
|
|
647
717
|
async generateSpecFile() {
|
|
648
718
|
try {
|
|
649
|
-
const routes = this.
|
|
719
|
+
const routes = this.getRoutes();
|
|
650
720
|
const outputPath = `${this.appDir}/lib/openapi.spec.json`;
|
|
651
721
|
await this.generator.generateSpecFile(routes, outputPath);
|
|
652
722
|
console.log("\u2705 OpenAPI spec generated at:", outputPath);
|
|
@@ -1,58 +1,56 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APITypeGenerator
|
|
3
3
|
} from "./chunk-7PJARAQQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
resolveRouteOpenAPIConfig
|
|
6
|
+
} from "./chunk-NRWEY2CM.mjs";
|
|
7
|
+
import {
|
|
8
|
+
getZodKind,
|
|
9
|
+
getZodObjectShape,
|
|
10
|
+
getZodTransformInput,
|
|
11
|
+
unwrapZodTransforms
|
|
12
|
+
} from "./chunk-2GQBBOFH.mjs";
|
|
4
13
|
import {
|
|
5
14
|
toFileModuleUrl
|
|
6
15
|
} from "./chunk-VHIXGZYH.mjs";
|
|
16
|
+
import {
|
|
17
|
+
isMultipartSchema
|
|
18
|
+
} from "./chunk-YT3SLLZK.mjs";
|
|
7
19
|
import {
|
|
8
20
|
__require
|
|
9
21
|
} from "./chunk-Y6FXYEAI.mjs";
|
|
10
22
|
|
|
11
23
|
// src/openapi/generator.ts
|
|
12
24
|
var allowedType = /* @__PURE__ */ new Set(["string", "number", "boolean", "array", "object"]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ZodPipeline: "pipe",
|
|
25
|
-
ZodRecord: "record",
|
|
26
|
-
ZodString: "string",
|
|
27
|
-
ZodTuple: "tuple",
|
|
28
|
-
ZodUnion: "union"
|
|
29
|
-
};
|
|
30
|
-
function getZodKind(schema) {
|
|
31
|
-
if (!schema || typeof schema !== "object") return void 0;
|
|
32
|
-
const definition = schema._def;
|
|
33
|
-
if (!definition || typeof definition !== "object") return void 0;
|
|
34
|
-
if (typeof definition.type === "string") return definition.type;
|
|
35
|
-
return typeof definition.typeName === "string" ? zodTypeNameKinds[definition.typeName] : void 0;
|
|
36
|
-
}
|
|
37
|
-
function getZodObjectShape(schema) {
|
|
38
|
-
if (getZodKind(schema) !== "object") return void 0;
|
|
39
|
-
const candidate = schema.shape ?? schema._def?.shape;
|
|
40
|
-
const shape = typeof candidate === "function" ? candidate() : candidate;
|
|
41
|
-
return shape && typeof shape === "object" ? shape : void 0;
|
|
42
|
-
}
|
|
43
|
-
function getZodTransformInput(schema) {
|
|
44
|
-
const kind = getZodKind(schema);
|
|
45
|
-
const definition = schema?._def;
|
|
46
|
-
if (kind === "effects") return definition.schema;
|
|
47
|
-
if (kind !== "pipe") return void 0;
|
|
48
|
-
return getZodKind(definition.in) === "transform" ? definition.out : definition.in;
|
|
25
|
+
function isZodFileSchema(schema, kind) {
|
|
26
|
+
if (kind === "file") return true;
|
|
27
|
+
if (kind !== "custom" || typeof Blob === "undefined") return false;
|
|
28
|
+
const check = schema?._def?.fn;
|
|
29
|
+
if (typeof check !== "function") return false;
|
|
30
|
+
try {
|
|
31
|
+
const sample = typeof File === "undefined" ? new Blob([]) : new File([], "farm-openapi-probe");
|
|
32
|
+
return check(sample) === true && check("farm-openapi-probe") !== true;
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
49
36
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
for (
|
|
53
|
-
|
|
37
|
+
function makeOperationIdsUnique(paths) {
|
|
38
|
+
const used = /* @__PURE__ */ new Set();
|
|
39
|
+
for (const pathItem of Object.values(paths)) {
|
|
40
|
+
const operations = [
|
|
41
|
+
...Object.values(pathItem ?? {}),
|
|
42
|
+
...Object.values(pathItem?.["x-oai-additionalOperations"] ?? {})
|
|
43
|
+
];
|
|
44
|
+
for (const operation of operations) {
|
|
45
|
+
if (!operation || typeof operation !== "object") continue;
|
|
46
|
+
const operationId = operation.operationId;
|
|
47
|
+
if (typeof operationId !== "string") continue;
|
|
48
|
+
let unique = operationId;
|
|
49
|
+
for (let index = 2; used.has(unique); index += 1) unique = `${operationId}_${index}`;
|
|
50
|
+
operation.operationId = unique;
|
|
51
|
+
used.add(unique);
|
|
52
|
+
}
|
|
54
53
|
}
|
|
55
|
-
return current;
|
|
56
54
|
}
|
|
57
55
|
function isStandardSchema(schema) {
|
|
58
56
|
return !!schema && typeof schema === "object" && typeof schema["~standard"]?.validate === "function";
|
|
@@ -201,6 +199,14 @@ var OpenAPIGenerator = class {
|
|
|
201
199
|
}
|
|
202
200
|
return tupleSchema;
|
|
203
201
|
}
|
|
202
|
+
if (isZodFileSchema(zodType, kind)) {
|
|
203
|
+
const description = zodType.description;
|
|
204
|
+
return {
|
|
205
|
+
type: "string",
|
|
206
|
+
format: "binary",
|
|
207
|
+
...description === void 0 ? {} : { description }
|
|
208
|
+
};
|
|
209
|
+
}
|
|
204
210
|
const baseSchema = {
|
|
205
211
|
type: this.getTypeFromZodType(zodType),
|
|
206
212
|
description: zodType.description
|
|
@@ -299,6 +305,7 @@ var OpenAPIGenerator = class {
|
|
|
299
305
|
};
|
|
300
306
|
const routeGroups = /* @__PURE__ */ new Map();
|
|
301
307
|
for (const route of routes) {
|
|
308
|
+
if (route.path !== "/api" && !route.path.startsWith("/api/")) continue;
|
|
302
309
|
const key = route.path;
|
|
303
310
|
if (!routeGroups.has(key)) {
|
|
304
311
|
routeGroups.set(key, []);
|
|
@@ -307,11 +314,11 @@ var OpenAPIGenerator = class {
|
|
|
307
314
|
}
|
|
308
315
|
for (const [path, routeList] of routeGroups) {
|
|
309
316
|
for (const variant of this.getOpenAPIPathVariants(path)) {
|
|
310
|
-
(_a = spec.paths)[_b = variant.path] ?? (_a[_b] = {});
|
|
311
317
|
for (const route of routeList) {
|
|
312
318
|
for (const method of route.methods) {
|
|
319
|
+
if (await this.isHidden(route, method)) continue;
|
|
313
320
|
if (variant.operationIdSuffix === "base") {
|
|
314
|
-
const existingOperation = method === "QUERY" ? spec.paths[variant.path]["x-oai-additionalOperations"]?.QUERY : spec.paths[variant.path][method.toLowerCase()];
|
|
321
|
+
const existingOperation = method === "QUERY" ? spec.paths[variant.path]?.["x-oai-additionalOperations"]?.QUERY : spec.paths[variant.path]?.[method.toLowerCase()];
|
|
315
322
|
if (existingOperation) continue;
|
|
316
323
|
}
|
|
317
324
|
const operation = await this.generateOperation(
|
|
@@ -320,19 +327,77 @@ var OpenAPIGenerator = class {
|
|
|
320
327
|
variant.path,
|
|
321
328
|
variant.operationIdSuffix
|
|
322
329
|
);
|
|
330
|
+
const pathItem = (_a = spec.paths)[_b = variant.path] ?? (_a[_b] = {});
|
|
323
331
|
if (method === "QUERY") {
|
|
324
|
-
const additionalOperations =
|
|
332
|
+
const additionalOperations = pathItem["x-oai-additionalOperations"] ?? {};
|
|
325
333
|
additionalOperations.QUERY = operation;
|
|
326
|
-
|
|
334
|
+
pathItem["x-oai-additionalOperations"] = additionalOperations;
|
|
327
335
|
} else {
|
|
328
|
-
|
|
336
|
+
pathItem[method.toLowerCase()] = operation;
|
|
329
337
|
}
|
|
330
338
|
}
|
|
331
339
|
}
|
|
332
340
|
}
|
|
333
341
|
}
|
|
342
|
+
makeOperationIdsUnique(spec.paths);
|
|
343
|
+
this.addConfiguredPaths(spec);
|
|
334
344
|
return spec;
|
|
335
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* Adds `openapi.paths`, which describe routes Farm serves without a route file.
|
|
348
|
+
* Neither side silently replaces the other: an operation both describe is an error.
|
|
349
|
+
*/
|
|
350
|
+
addConfiguredPaths(spec) {
|
|
351
|
+
for (const [path, pathItem] of Object.entries(this.config.paths ?? {})) {
|
|
352
|
+
if (!path.startsWith("/")) {
|
|
353
|
+
throw new Error(`openapi.paths keys must start with "/": received "${path}".`);
|
|
354
|
+
}
|
|
355
|
+
if (!pathItem || typeof pathItem !== "object" || Array.isArray(pathItem)) {
|
|
356
|
+
throw new Error(`openapi.paths["${path}"] must be an OpenAPI Path Item Object.`);
|
|
357
|
+
}
|
|
358
|
+
const generated = spec.paths[path];
|
|
359
|
+
if (generated) {
|
|
360
|
+
for (const key of Object.keys(pathItem)) {
|
|
361
|
+
if (key in generated) {
|
|
362
|
+
throw new Error(
|
|
363
|
+
`openapi.paths["${path}"].${key} describes an operation Farm already generates from an API route. Remove it, or hide the route with openapi: { hidden: true }.`
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
spec.paths[path] = { ...generated, ...pathItem };
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/** Endpoint metadata wins over the route file's `openapi` export. */
|
|
372
|
+
async isHidden(route, method) {
|
|
373
|
+
let hidden;
|
|
374
|
+
try {
|
|
375
|
+
hidden = (await this.loadEndpoint(route, method))?.__openapi?.hidden;
|
|
376
|
+
} catch {
|
|
377
|
+
}
|
|
378
|
+
if (hidden !== void 0) return hidden;
|
|
379
|
+
if (route.endpoints) return route.openapi?.[method]?.hidden === true;
|
|
380
|
+
let routeModule;
|
|
381
|
+
try {
|
|
382
|
+
routeModule = await import(
|
|
383
|
+
/* @vite-ignore */
|
|
384
|
+
route.filePath
|
|
385
|
+
);
|
|
386
|
+
} catch {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
const routeOpenAPI = resolveRouteOpenAPIConfig(
|
|
390
|
+
routeModule.openapi,
|
|
391
|
+
`API route "${route.path}"`
|
|
392
|
+
);
|
|
393
|
+
return routeOpenAPI?.hidden === true;
|
|
394
|
+
}
|
|
395
|
+
/** A mounted route's endpoint, or the export of a scanned route's file. */
|
|
396
|
+
async loadEndpoint(route, method) {
|
|
397
|
+
if (route.endpoints) return route.endpoints[method];
|
|
398
|
+
const routeModule = await this.loadRouteModule(route.filePath);
|
|
399
|
+
return routeModule[method];
|
|
400
|
+
}
|
|
336
401
|
/**
|
|
337
402
|
* Resolve server entries in decreasing order of authority: explicit OpenAPI
|
|
338
403
|
* servers, Farm's public API base, the current development request origin,
|
|
@@ -416,14 +481,14 @@ var OpenAPIGenerator = class {
|
|
|
416
481
|
return void 0;
|
|
417
482
|
}
|
|
418
483
|
try {
|
|
419
|
-
const
|
|
420
|
-
const handler = routeModule[method];
|
|
484
|
+
const handler = await this.loadEndpoint(route, method);
|
|
421
485
|
const bodySchema = handler?.__types?.body ?? handler?._type?.body;
|
|
422
486
|
if (bodySchema) {
|
|
423
487
|
return {
|
|
424
488
|
required: this.isRequiredField(bodySchema),
|
|
425
489
|
content: {
|
|
426
|
-
|
|
490
|
+
// A multipart() body is sent as form data, its files as binary parts.
|
|
491
|
+
[isMultipartSchema(bodySchema) ? "multipart/form-data" : "application/json"]: {
|
|
427
492
|
schema: this.processZodType(bodySchema)
|
|
428
493
|
}
|
|
429
494
|
}
|
|
@@ -451,8 +516,7 @@ var OpenAPIGenerator = class {
|
|
|
451
516
|
async getParameters(route, method) {
|
|
452
517
|
const parameters = [];
|
|
453
518
|
try {
|
|
454
|
-
const
|
|
455
|
-
const handler = routeModule[method];
|
|
519
|
+
const handler = await this.loadEndpoint(route, method);
|
|
456
520
|
const querySchema = handler?.__types?.query ?? handler?._type?.query;
|
|
457
521
|
const shape = getZodObjectShape(unwrapZodTransforms(querySchema));
|
|
458
522
|
if (shape) {
|
|
@@ -505,8 +569,7 @@ var OpenAPIGenerator = class {
|
|
|
505
569
|
}
|
|
506
570
|
async getEndpointOpenAPIMetadata(route, method) {
|
|
507
571
|
try {
|
|
508
|
-
|
|
509
|
-
return routeModule[method]?.__openapi ?? {};
|
|
572
|
+
return (await this.loadEndpoint(route, method))?.__openapi ?? {};
|
|
510
573
|
} catch {
|
|
511
574
|
return {};
|
|
512
575
|
}
|
|
@@ -613,15 +676,22 @@ var OpenAPIManager = class {
|
|
|
613
676
|
const appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
|
|
614
677
|
this.appDir = appDirs[appDirs.length - 1];
|
|
615
678
|
this.config = config;
|
|
679
|
+
this.mountedRoutes = context.routes;
|
|
616
680
|
this.generator = new OpenAPIGenerator(this.appDir, config, context);
|
|
617
681
|
this.apiTypeGenerator = new APITypeGenerator(appDirs);
|
|
618
682
|
}
|
|
683
|
+
getRoutes() {
|
|
684
|
+
if (!this.mountedRoutes) return this.apiTypeGenerator.scanAPIRoutes();
|
|
685
|
+
return [...this.mountedRoutes()].sort(
|
|
686
|
+
(left, right) => left.path.localeCompare(right.path) || (left.filePath ?? "").localeCompare(right.filePath ?? "")
|
|
687
|
+
);
|
|
688
|
+
}
|
|
619
689
|
/**
|
|
620
690
|
* Generate OpenAPI spec from API routes
|
|
621
691
|
*/
|
|
622
692
|
async generateSpec() {
|
|
623
693
|
try {
|
|
624
|
-
const routes = this.
|
|
694
|
+
const routes = this.getRoutes();
|
|
625
695
|
const spec = await this.generator.generateSpec(routes);
|
|
626
696
|
this.specCache = spec;
|
|
627
697
|
return spec;
|
|
@@ -646,7 +716,7 @@ var OpenAPIManager = class {
|
|
|
646
716
|
*/
|
|
647
717
|
async generateSpecFile() {
|
|
648
718
|
try {
|
|
649
|
-
const routes = this.
|
|
719
|
+
const routes = this.getRoutes();
|
|
650
720
|
const outputPath = `${this.appDir}/lib/openapi.spec.json`;
|
|
651
721
|
await this.generator.generateSpecFile(routes, outputPath);
|
|
652
722
|
console.log("\u2705 OpenAPI spec generated at:", outputPath);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk65OS2TOTcjs = require('./chunk-65OS2TOT.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -284,7 +284,7 @@ function isArrayIndex(key) {
|
|
|
284
284
|
// src/plugin-server-runtime.ts
|
|
285
285
|
function hasFarmServerRuntimePlugins(plugins) {
|
|
286
286
|
return (plugins || []).some((plugin) => {
|
|
287
|
-
if (
|
|
287
|
+
if (_chunk65OS2TOTcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
|
|
288
288
|
return Boolean(
|
|
289
289
|
plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
|
|
290
290
|
);
|