@farm.js/core 0.1.0-beta.6 → 0.1.0-beta.8
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/after.cjs +227 -0
- package/dist/after.cjs.map +1 -0
- package/dist/after.d.mts +25 -0
- package/dist/after.d.ts +25 -0
- package/dist/after.mjs +14 -0
- package/dist/after.mjs.map +1 -0
- package/dist/agent-runtime.cjs +2379 -0
- package/dist/agent-runtime.cjs.map +1 -0
- package/dist/agent-runtime.d.mts +94 -0
- package/dist/agent-runtime.d.ts +94 -0
- package/dist/agent-runtime.mjs +479 -0
- package/dist/agent-runtime.mjs.map +1 -0
- package/dist/api/route-manager.d.mts +66 -0
- package/dist/api/route-manager.d.ts +66 -0
- package/dist/api/runtime.d.mts +3 -0
- package/dist/api/runtime.d.ts +3 -0
- package/dist/api.cjs +4100 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.mts +48 -0
- package/dist/api.d.ts +48 -0
- package/dist/api.mjs +93 -0
- package/dist/api.mjs.map +1 -0
- package/dist/app-BWtqQu3R.d.mts +302 -0
- package/dist/app-markdown.cjs +244 -0
- package/dist/app-markdown.cjs.map +1 -0
- package/dist/app-markdown.d.mts +22 -0
- package/dist/app-markdown.d.ts +22 -0
- package/dist/app-markdown.mjs +27 -0
- package/dist/app-markdown.mjs.map +1 -0
- package/dist/app-xltejvLY.d.ts +302 -0
- package/dist/cache.cjs +945 -0
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.mts +192 -0
- package/dist/cache.d.ts +192 -0
- package/dist/cache.mjs +46 -0
- package/dist/cache.mjs.map +1 -0
- package/dist/chunk-2ED5Q2GH.mjs +422 -0
- package/dist/chunk-2ED5Q2GH.mjs.map +1 -0
- package/dist/chunk-32W4QEJP.mjs +158 -0
- package/dist/chunk-32W4QEJP.mjs.map +1 -0
- package/dist/chunk-3XNTL3FQ.mjs +452 -0
- package/dist/chunk-3XNTL3FQ.mjs.map +1 -0
- package/dist/chunk-44ZCFSKE.mjs +84 -0
- package/dist/chunk-44ZCFSKE.mjs.map +1 -0
- package/dist/chunk-4MGVSBRP.mjs +7787 -0
- package/dist/chunk-4MGVSBRP.mjs.map +1 -0
- package/dist/chunk-4S3ORGFA.mjs +44 -0
- package/dist/chunk-4S3ORGFA.mjs.map +1 -0
- package/dist/chunk-5BY76U2M.mjs +1 -0
- package/dist/chunk-5BY76U2M.mjs.map +1 -0
- package/dist/chunk-5ZGPRGWV.mjs +136 -0
- package/dist/chunk-5ZGPRGWV.mjs.map +1 -0
- package/dist/chunk-65A7QIKI.mjs +142 -0
- package/dist/chunk-65A7QIKI.mjs.map +1 -0
- package/dist/chunk-74YTBPTY.mjs +450 -0
- package/dist/chunk-74YTBPTY.mjs.map +1 -0
- package/dist/chunk-7FBJLMQH.mjs +338 -0
- package/dist/chunk-7FBJLMQH.mjs.map +1 -0
- package/dist/chunk-7HO6AEOP.mjs +74 -0
- package/dist/chunk-7HO6AEOP.mjs.map +1 -0
- package/dist/chunk-7MABZJIM.mjs +29 -0
- package/dist/chunk-7MABZJIM.mjs.map +1 -0
- package/dist/chunk-7N62DNSO.mjs +41 -0
- package/dist/chunk-7N62DNSO.mjs.map +1 -0
- package/dist/chunk-7ZY5AIJO.mjs +161 -0
- package/dist/chunk-7ZY5AIJO.mjs.map +1 -0
- package/dist/chunk-ALCLXXTY.mjs +187 -0
- package/dist/chunk-ALCLXXTY.mjs.map +1 -0
- package/dist/chunk-AZ7YUVNR.mjs +65 -0
- package/dist/chunk-AZ7YUVNR.mjs.map +1 -0
- package/dist/chunk-B232I2GP.mjs +163 -0
- package/dist/chunk-B232I2GP.mjs.map +1 -0
- package/dist/chunk-B4W3BNTL.mjs +483 -0
- package/dist/chunk-B4W3BNTL.mjs.map +1 -0
- package/dist/chunk-C2ROET2V.mjs +718 -0
- package/dist/chunk-C2ROET2V.mjs.map +1 -0
- package/dist/chunk-CGILA3WO.mjs +14 -0
- package/dist/chunk-CGILA3WO.mjs.map +1 -0
- package/dist/chunk-CGIXMLSY.mjs +184 -0
- package/dist/chunk-CGIXMLSY.mjs.map +1 -0
- package/dist/chunk-DJSGLHCN.mjs +597 -0
- package/dist/chunk-DJSGLHCN.mjs.map +1 -0
- package/dist/chunk-E2MPIBRE.mjs +149 -0
- package/dist/chunk-E2MPIBRE.mjs.map +1 -0
- package/dist/chunk-E6EPN5BT.mjs +203 -0
- package/dist/chunk-E6EPN5BT.mjs.map +1 -0
- package/dist/chunk-EI43C4RA.mjs +6277 -0
- package/dist/chunk-EI43C4RA.mjs.map +1 -0
- package/dist/chunk-EJ7T4TPB.mjs +622 -0
- package/dist/chunk-EJ7T4TPB.mjs.map +1 -0
- package/dist/chunk-FQYDHKKU.mjs +128 -0
- package/dist/chunk-FQYDHKKU.mjs.map +1 -0
- package/dist/chunk-FRPWCMMG.mjs +299 -0
- package/dist/chunk-FRPWCMMG.mjs.map +1 -0
- package/dist/chunk-GN72QAIH.mjs +146 -0
- package/dist/chunk-GN72QAIH.mjs.map +1 -0
- package/dist/chunk-GQVGIUSN.mjs +149 -0
- package/dist/chunk-GQVGIUSN.mjs.map +1 -0
- package/dist/chunk-GS6K5OCM.mjs +407 -0
- package/dist/chunk-GS6K5OCM.mjs.map +1 -0
- package/dist/chunk-GXASWWJU.mjs +364 -0
- package/dist/chunk-GXASWWJU.mjs.map +1 -0
- package/dist/chunk-GY2STC2S.mjs +180 -0
- package/dist/chunk-GY2STC2S.mjs.map +1 -0
- package/dist/chunk-H2FA2SBS.mjs +51 -0
- package/dist/chunk-H2FA2SBS.mjs.map +1 -0
- package/dist/chunk-I4CUBGVF.mjs +93 -0
- package/dist/chunk-I4CUBGVF.mjs.map +1 -0
- package/dist/chunk-ITN462YM.mjs +98 -0
- package/dist/chunk-ITN462YM.mjs.map +1 -0
- package/dist/chunk-J23HNLFY.mjs +72 -0
- package/dist/chunk-J23HNLFY.mjs.map +1 -0
- package/dist/chunk-J4FNJ5IU.mjs +179 -0
- package/dist/chunk-J4FNJ5IU.mjs.map +1 -0
- package/dist/chunk-J5YWQVI5.mjs +211 -0
- package/dist/chunk-J5YWQVI5.mjs.map +1 -0
- package/dist/chunk-JDEOUK5V.mjs +427 -0
- package/dist/chunk-JDEOUK5V.mjs.map +1 -0
- package/dist/chunk-JK25YEN6.mjs +219 -0
- package/dist/chunk-JK25YEN6.mjs.map +1 -0
- package/dist/chunk-K4667E2Q.mjs +1916 -0
- package/dist/chunk-K4667E2Q.mjs.map +1 -0
- package/dist/chunk-LGHEOHBU.mjs +218 -0
- package/dist/chunk-LGHEOHBU.mjs.map +1 -0
- package/dist/chunk-LM2YNO4U.mjs +24 -0
- package/dist/chunk-LM2YNO4U.mjs.map +1 -0
- package/dist/chunk-ME4MO2RJ.mjs +3540 -0
- package/dist/chunk-ME4MO2RJ.mjs.map +1 -0
- package/dist/chunk-MIUW47JX.mjs +639 -0
- package/dist/chunk-MIUW47JX.mjs.map +1 -0
- package/dist/chunk-NNLCAVB6.mjs +391 -0
- package/dist/chunk-NNLCAVB6.mjs.map +1 -0
- package/dist/chunk-P7QDS5AT.mjs +191 -0
- package/dist/chunk-P7QDS5AT.mjs.map +1 -0
- package/dist/chunk-PFE6GMNE.mjs +603 -0
- package/dist/chunk-PFE6GMNE.mjs.map +1 -0
- package/dist/chunk-QGOHVJ6J.mjs +63 -0
- package/dist/chunk-QGOHVJ6J.mjs.map +1 -0
- package/dist/chunk-QKVUNGAH.mjs +39 -0
- package/dist/chunk-QKVUNGAH.mjs.map +1 -0
- package/dist/chunk-QM746KUO.mjs +56 -0
- package/dist/chunk-QM746KUO.mjs.map +1 -0
- package/dist/chunk-QTZZ2ISQ.mjs +753 -0
- package/dist/chunk-QTZZ2ISQ.mjs.map +1 -0
- package/dist/chunk-RBRLLZL5.mjs +81 -0
- package/dist/chunk-RBRLLZL5.mjs.map +1 -0
- package/dist/chunk-RHIFZZUI.mjs +69 -0
- package/dist/chunk-RHIFZZUI.mjs.map +1 -0
- package/dist/chunk-RQ633A5I.mjs +187 -0
- package/dist/chunk-RQ633A5I.mjs.map +1 -0
- package/dist/chunk-SCFX4UTD.mjs +28 -0
- package/dist/chunk-SCFX4UTD.mjs.map +1 -0
- package/dist/chunk-SL6HTIOK.mjs +66 -0
- package/dist/chunk-SL6HTIOK.mjs.map +1 -0
- package/dist/chunk-SPBBQLXI.mjs +207 -0
- package/dist/chunk-SPBBQLXI.mjs.map +1 -0
- package/dist/chunk-SSA7THPX.mjs +10 -0
- package/dist/chunk-SSA7THPX.mjs.map +1 -0
- package/dist/chunk-T4QJQK76.mjs +459 -0
- package/dist/chunk-T4QJQK76.mjs.map +1 -0
- package/dist/chunk-TQAEEJB4.mjs +157 -0
- package/dist/chunk-TQAEEJB4.mjs.map +1 -0
- package/dist/chunk-UB5UOSHB.mjs +458 -0
- package/dist/chunk-UB5UOSHB.mjs.map +1 -0
- package/dist/chunk-USWZZUEH.mjs +25 -0
- package/dist/chunk-USWZZUEH.mjs.map +1 -0
- package/dist/chunk-UVCIEUJC.mjs +16 -0
- package/dist/chunk-UVCIEUJC.mjs.map +1 -0
- package/dist/chunk-UXUAWNO5.mjs +396 -0
- package/dist/chunk-UXUAWNO5.mjs.map +1 -0
- package/dist/chunk-V3XURYJO.mjs +756 -0
- package/dist/chunk-V3XURYJO.mjs.map +1 -0
- package/dist/chunk-V6WE6JSZ.mjs +352 -0
- package/dist/chunk-V6WE6JSZ.mjs.map +1 -0
- package/dist/chunk-V7RBCSDJ.mjs +170 -0
- package/dist/chunk-V7RBCSDJ.mjs.map +1 -0
- package/dist/chunk-VCANOYFI.mjs +588 -0
- package/dist/chunk-VCANOYFI.mjs.map +1 -0
- package/dist/chunk-VY2UYN5R.mjs +224 -0
- package/dist/chunk-VY2UYN5R.mjs.map +1 -0
- package/dist/chunk-W2CRQFF6.mjs +1352 -0
- package/dist/chunk-W2CRQFF6.mjs.map +1 -0
- package/dist/chunk-WDU6QXNK.mjs +872 -0
- package/dist/chunk-WDU6QXNK.mjs.map +1 -0
- package/dist/chunk-WZ5QFROO.mjs +23 -0
- package/dist/chunk-WZ5QFROO.mjs.map +1 -0
- package/dist/chunk-XIVV5IWN.mjs +541 -0
- package/dist/chunk-XIVV5IWN.mjs.map +1 -0
- package/dist/chunk-YW7OBE6Q.mjs +119 -0
- package/dist/chunk-YW7OBE6Q.mjs.map +1 -0
- package/dist/chunk-Z5CQMP54.mjs +365 -0
- package/dist/chunk-Z5CQMP54.mjs.map +1 -0
- package/dist/chunk-ZBE6MLHL.mjs +230 -0
- package/dist/chunk-ZBE6MLHL.mjs.map +1 -0
- package/dist/chunk-ZVWA4ZQ3.mjs +189 -0
- package/dist/chunk-ZVWA4ZQ3.mjs.map +1 -0
- package/dist/chunk-ZZ57EH5Z.mjs +173 -0
- package/dist/chunk-ZZ57EH5Z.mjs.map +1 -0
- package/dist/client-BT1mFQas.d.mts +447 -0
- package/dist/client-Nn0q4eO4.d.ts +447 -0
- package/dist/client-cache-CIlyBlmx.d.ts +6 -0
- package/dist/client-cache-D-EZ7XVW.d.mts +6 -0
- package/dist/client-plugins-BI2R6Eae.d.mts +1926 -0
- package/dist/client-plugins-DU9oMspX.d.ts +1926 -0
- package/dist/client-plugins.cjs +415 -0
- package/dist/client-plugins.cjs.map +1 -0
- package/dist/client-plugins.d.mts +22 -0
- package/dist/client-plugins.d.ts +22 -0
- package/dist/client-plugins.mjs +10 -0
- package/dist/client-plugins.mjs.map +1 -0
- package/dist/client.cjs +5402 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.mts +447 -0
- package/dist/client.d.ts +447 -0
- package/dist/client.mjs +110 -0
- package/dist/client.mjs.map +1 -0
- package/dist/config.cjs +38 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.mts +29 -0
- package/dist/config.d.ts +29 -0
- package/dist/config.mjs +10 -0
- package/dist/config.mjs.map +1 -0
- package/dist/cron.cjs +406 -0
- package/dist/cron.cjs.map +1 -0
- package/dist/cron.d.mts +78 -0
- package/dist/cron.d.ts +78 -0
- package/dist/cron.mjs +30 -0
- package/dist/cron.mjs.map +1 -0
- package/dist/deferred.cjs +438 -0
- package/dist/deferred.cjs.map +1 -0
- package/dist/deferred.d.mts +42 -0
- package/dist/deferred.d.ts +42 -0
- package/dist/deferred.mjs +28 -0
- package/dist/deferred.mjs.map +1 -0
- package/dist/deployment.cjs +199 -0
- package/dist/deployment.cjs.map +1 -0
- package/dist/deployment.d.mts +34 -0
- package/dist/deployment.d.ts +34 -0
- package/dist/deployment.mjs +38 -0
- package/dist/deployment.mjs.map +1 -0
- package/dist/devtools-REQTS3I7.mjs +371 -0
- package/dist/devtools-REQTS3I7.mjs.map +1 -0
- package/dist/devtools-client-3XRTBND5.mjs +216 -0
- package/dist/devtools-client-3XRTBND5.mjs.map +1 -0
- package/dist/devtools-ui-NJKFORTG.mjs +1349 -0
- package/dist/devtools-ui-NJKFORTG.mjs.map +1 -0
- package/dist/docs.cjs +5548 -0
- package/dist/docs.cjs.map +1 -0
- package/dist/docs.d.mts +69 -0
- package/dist/docs.d.ts +69 -0
- package/dist/docs.mjs +47 -0
- package/dist/docs.mjs.map +1 -0
- package/dist/env-types.cjs +232 -0
- package/dist/env-types.cjs.map +1 -0
- package/dist/env-types.d.mts +12 -0
- package/dist/env-types.d.ts +12 -0
- package/dist/env-types.mjs +11 -0
- package/dist/env-types.mjs.map +1 -0
- package/dist/env.cjs +215 -0
- package/dist/env.cjs.map +1 -0
- package/dist/env.d.mts +45 -0
- package/dist/env.d.ts +45 -0
- package/dist/env.mjs +22 -0
- package/dist/env.mjs.map +1 -0
- package/dist/environment/vite.d.mts +22 -0
- package/dist/environment/vite.d.ts +22 -0
- package/dist/environment.cjs +96 -0
- package/dist/environment.cjs.map +1 -0
- package/dist/environment.d.mts +18 -0
- package/dist/environment.d.ts +18 -0
- package/dist/environment.mjs +14 -0
- package/dist/environment.mjs.map +1 -0
- package/dist/headers.cjs +126 -0
- package/dist/headers.cjs.map +1 -0
- package/dist/headers.d.mts +22 -0
- package/dist/headers.d.ts +22 -0
- package/dist/headers.mjs +12 -0
- package/dist/headers.mjs.map +1 -0
- package/dist/i18n/client.d.mts +32 -0
- package/dist/i18n/client.d.ts +32 -0
- package/dist/i18n/index.d.mts +20 -0
- package/dist/i18n/index.d.ts +20 -0
- package/dist/i18n/server.d.mts +30 -0
- package/dist/i18n/server.d.ts +30 -0
- package/dist/image/server.d.mts +37 -0
- package/dist/image/server.d.ts +37 -0
- package/dist/image/sharp.d.mts +7 -0
- package/dist/image/sharp.d.ts +7 -0
- package/dist/image-config-Duob7wER.d.mts +50 -0
- package/dist/image-config-Duob7wER.d.ts +50 -0
- package/dist/image.cjs +209 -0
- package/dist/image.cjs.map +1 -0
- package/dist/image.d.mts +39 -0
- package/dist/image.d.ts +39 -0
- package/dist/image.mjs +165 -0
- package/dist/image.mjs.map +1 -0
- package/dist/index.cjs +42186 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +454 -0
- package/dist/index.d.ts +454 -0
- package/dist/index.mjs +980 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integration-api-CHT2OKAf.d.mts +93 -0
- package/dist/integration-api-CHT2OKAf.d.ts +93 -0
- package/dist/integration-orm-GQLGU66X.mjs +13 -0
- package/dist/integration-orm-GQLGU66X.mjs.map +1 -0
- package/dist/integrations.cjs +2820 -0
- package/dist/integrations.cjs.map +1 -0
- package/dist/integrations.d.mts +22 -0
- package/dist/integrations.d.ts +22 -0
- package/dist/integrations.mjs +51 -0
- package/dist/integrations.mjs.map +1 -0
- package/dist/internal/build-runtime.cjs +643 -322
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +39 -0
- package/dist/internal/build-runtime.d.ts +39 -0
- package/dist/internal/build-runtime.mjs +11 -10
- package/dist/internal/client-runtime.d.mts +2 -0
- package/dist/internal/client-runtime.d.ts +2 -0
- package/dist/internal/config-runtime.cjs +135 -39
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +39 -0
- package/dist/internal/config-runtime.d.ts +39 -0
- package/dist/internal/config-runtime.mjs +5 -4
- package/dist/internal/production-node-env.d.mts +12 -0
- package/dist/internal/production-node-env.d.ts +12 -0
- package/dist/internal/production-runtime.d.mts +39 -0
- package/dist/internal/production-runtime.d.ts +39 -0
- package/dist/layers-VWVDTPUZ.mjs +16 -0
- package/dist/layers-VWVDTPUZ.mjs.map +1 -0
- package/dist/manager-THKFTOFE.mjs +10 -0
- package/dist/manager-THKFTOFE.mjs.map +1 -0
- package/dist/markdown.cjs +364 -0
- package/dist/markdown.cjs.map +1 -0
- package/dist/markdown.d.mts +60 -0
- package/dist/markdown.d.ts +60 -0
- package/dist/markdown.mjs +18 -0
- package/dist/markdown.mjs.map +1 -0
- package/dist/metadata-Cm9ujH4I.d.ts +22 -0
- package/dist/metadata-DacXbnLA.d.mts +22 -0
- package/dist/middleware.cjs +2148 -0
- package/dist/middleware.cjs.map +1 -0
- package/dist/middleware.d.mts +164 -0
- package/dist/middleware.d.ts +164 -0
- package/dist/middleware.mjs +49 -0
- package/dist/middleware.mjs.map +1 -0
- package/dist/navigation-errors-Dvwpzaer.d.mts +13 -0
- package/dist/navigation-errors-Dvwpzaer.d.ts +13 -0
- package/dist/navigation.cjs +1329 -0
- package/dist/navigation.cjs.map +1 -0
- package/dist/navigation.d.mts +14 -0
- package/dist/navigation.d.ts +14 -0
- package/dist/navigation.mjs +33 -0
- package/dist/navigation.mjs.map +1 -0
- package/dist/nitro-QO5LV6QK.mjs +689 -0
- package/dist/nitro-QO5LV6QK.mjs.map +1 -0
- package/dist/observability.cjs +186 -0
- package/dist/observability.cjs.map +1 -0
- package/dist/observability.d.mts +335 -0
- package/dist/observability.d.ts +335 -0
- package/dist/observability.mjs +16 -0
- package/dist/observability.mjs.map +1 -0
- package/dist/params-BALtrRim.d.ts +15 -0
- package/dist/params-ry-lxqmy.d.mts +15 -0
- package/dist/plugin-BJDf43dc.d.mts +165 -0
- package/dist/plugin-BJDf43dc.d.ts +165 -0
- package/dist/plugin.cjs +23470 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +22 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/plugin.mjs +8 -7
- package/dist/production-runtime-4KKq1AVC.d.mts +79 -0
- package/dist/production-runtime-C_B79w2P.d.mts +28 -0
- package/dist/production-runtime-DDEM1D2q.d.ts +28 -0
- package/dist/production-runtime-DRsWDN2x.d.ts +79 -0
- package/dist/query/client.d.mts +61 -0
- package/dist/query/client.d.ts +61 -0
- package/dist/query/index.d.mts +90 -0
- package/dist/query/index.d.ts +90 -0
- package/dist/query/parsers.d.mts +25 -0
- package/dist/query/parsers.d.ts +25 -0
- package/dist/query/server.d.mts +55 -0
- package/dist/query/server.d.ts +55 -0
- package/dist/request-Dsq4kGW0.d.mts +6 -0
- package/dist/request-udtobOLv.d.ts +6 -0
- package/dist/request.d.mts +2 -0
- package/dist/request.d.ts +2 -0
- package/dist/resolver-DJqjLMg_.d.mts +14 -0
- package/dist/resolver-IH4RmPEl.d.ts +14 -0
- package/dist/route-runtime-DoOHzCAD.d.mts +38 -0
- package/dist/route-runtime-DoOHzCAD.d.ts +38 -0
- package/dist/router.d.mts +36 -0
- package/dist/router.d.ts +36 -0
- package/dist/routes.d.mts +224 -0
- package/dist/routes.d.ts +224 -0
- package/dist/runtime-9nQjVM7X.d.mts +206 -0
- package/dist/runtime-Cxpq6xZN.d.mts +27 -0
- package/dist/runtime-DgeS2skB.d.ts +206 -0
- package/dist/runtime-bv63eUiO.d.ts +27 -0
- package/dist/server-action-security.d.mts +43 -0
- package/dist/server-action-security.d.ts +43 -0
- package/dist/server-fn-client.d.mts +32 -0
- package/dist/server-fn-client.d.ts +32 -0
- package/dist/server-fn.d.mts +93 -0
- package/dist/server-fn.d.ts +93 -0
- package/dist/server-plugins.d.mts +55 -0
- package/dist/server-plugins.d.ts +55 -0
- package/dist/server-query-client.d.mts +50 -0
- package/dist/server-query-client.d.ts +50 -0
- package/dist/server-query.d.mts +36 -0
- package/dist/server-query.d.ts +36 -0
- package/dist/server.cjs +731 -447
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +48 -0
- package/dist/server.d.ts +48 -0
- package/dist/server.mjs +9 -8
- package/dist/server.mjs.map +1 -1
- package/dist/storage.d.mts +52 -0
- package/dist/storage.d.ts +52 -0
- package/dist/testing.d.mts +101 -0
- package/dist/testing.d.ts +101 -0
- package/dist/transport-BmbGTXA5.d.mts +49 -0
- package/dist/transport-BmbGTXA5.d.ts +49 -0
- package/dist/types-BMxWr97v.d.mts +81 -0
- package/dist/types-BMxWr97v.d.ts +81 -0
- package/dist/types-C9N-nk5R.d.mts +53 -0
- package/dist/types-C9N-nk5R.d.ts +53 -0
- package/dist/types-D1A6-XvH.d.mts +73 -0
- package/dist/types-D1A6-XvH.d.ts +73 -0
- package/dist/utils-B-cUHwoK.d.ts +23 -0
- package/dist/utils-Cm41AefV.d.mts +23 -0
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.mts +3 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +682 -437
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +22 -0
- package/dist/vite.d.ts +22 -0
- package/dist/vite.mjs +6 -5
- package/dist/workflows.d.mts +110 -0
- package/dist/workflows.d.ts +110 -0
- package/package.json +3 -2
- package/types/client.d.ts +1 -1
- package/types/image.d.ts +4 -0
- package/types/images.d.ts +59 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APITypeGenerator
|
|
3
|
+
} from "./chunk-LGHEOHBU.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__name,
|
|
6
|
+
__require
|
|
7
|
+
} from "./chunk-CGILA3WO.mjs";
|
|
8
|
+
|
|
9
|
+
// src/openapi/generator.ts
|
|
10
|
+
import * as z from "zod";
|
|
11
|
+
var _OpenAPIGenerator = class _OpenAPIGenerator {
|
|
12
|
+
constructor(appDir, config) {
|
|
13
|
+
this.appDir = appDir;
|
|
14
|
+
this.config = config;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get type from Zod type
|
|
18
|
+
*/
|
|
19
|
+
getTypeFromZodType(zodType) {
|
|
20
|
+
const typeName = zodType._def?.typeName;
|
|
21
|
+
if (typeName) {
|
|
22
|
+
if (typeName === "ZodString") return "string";
|
|
23
|
+
if (typeName === "ZodNumber") return "number";
|
|
24
|
+
if (typeName === "ZodBoolean") return "boolean";
|
|
25
|
+
if (typeName === "ZodArray") return "array";
|
|
26
|
+
if (typeName === "ZodObject") return "object";
|
|
27
|
+
}
|
|
28
|
+
return "string";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Process Zod type to OpenAPI schema
|
|
32
|
+
*/
|
|
33
|
+
processZodType(zodType) {
|
|
34
|
+
if (zodType instanceof z.ZodOptional) {
|
|
35
|
+
const innerType = zodType._def.innerType;
|
|
36
|
+
const innerSchema = this.processZodType(innerType);
|
|
37
|
+
return {
|
|
38
|
+
...innerSchema,
|
|
39
|
+
nullable: true
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (zodType instanceof z.ZodObject) {
|
|
43
|
+
const shape = zodType.shape;
|
|
44
|
+
if (shape) {
|
|
45
|
+
const properties = {};
|
|
46
|
+
const required = [];
|
|
47
|
+
Object.entries(shape).forEach(([key, value]) => {
|
|
48
|
+
if (value instanceof z.ZodType) {
|
|
49
|
+
properties[key] = this.processZodType(value);
|
|
50
|
+
if (!(value instanceof z.ZodOptional)) {
|
|
51
|
+
required.push(key);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties,
|
|
58
|
+
...required.length > 0 ? { required } : {},
|
|
59
|
+
description: zodType.description
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (zodType instanceof z.ZodArray) {
|
|
64
|
+
const itemType = zodType._def.type;
|
|
65
|
+
return {
|
|
66
|
+
type: "array",
|
|
67
|
+
items: this.processZodType(itemType),
|
|
68
|
+
description: zodType.description
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (zodType instanceof z.ZodEnum) {
|
|
72
|
+
return {
|
|
73
|
+
type: "string",
|
|
74
|
+
enum: zodType._def.values,
|
|
75
|
+
description: zodType.description
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const baseSchema = {
|
|
79
|
+
type: this.getTypeFromZodType(zodType),
|
|
80
|
+
description: zodType.description
|
|
81
|
+
};
|
|
82
|
+
if ("minLength" in zodType && zodType.minLength) {
|
|
83
|
+
baseSchema.minLength = zodType.minLength;
|
|
84
|
+
}
|
|
85
|
+
if ("maxLength" in zodType && zodType.maxLength) {
|
|
86
|
+
baseSchema.maxLength = zodType.maxLength;
|
|
87
|
+
}
|
|
88
|
+
if ("min" in zodType && zodType.min !== void 0) {
|
|
89
|
+
baseSchema.minimum = zodType.min;
|
|
90
|
+
}
|
|
91
|
+
if ("max" in zodType && zodType.max !== void 0) {
|
|
92
|
+
baseSchema.maximum = zodType.max;
|
|
93
|
+
}
|
|
94
|
+
return baseSchema;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Generate standard error responses
|
|
98
|
+
*/
|
|
99
|
+
getStandardResponses() {
|
|
100
|
+
return {
|
|
101
|
+
"200": {
|
|
102
|
+
description: "Successful response",
|
|
103
|
+
content: {
|
|
104
|
+
"application/json": {
|
|
105
|
+
schema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
description: "Response data"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"400": {
|
|
113
|
+
description: "Bad Request. Usually due to missing parameters, or invalid parameters.",
|
|
114
|
+
content: {
|
|
115
|
+
"application/json": {
|
|
116
|
+
schema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
message: { type: "string" },
|
|
120
|
+
error: { type: "string" }
|
|
121
|
+
},
|
|
122
|
+
required: ["message"]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"401": {
|
|
128
|
+
description: "Unauthorized. Due to missing or invalid authentication.",
|
|
129
|
+
content: {
|
|
130
|
+
"application/json": {
|
|
131
|
+
schema: {
|
|
132
|
+
type: "object",
|
|
133
|
+
properties: {
|
|
134
|
+
message: { type: "string" }
|
|
135
|
+
},
|
|
136
|
+
required: ["message"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"403": {
|
|
142
|
+
description: "Forbidden. You do not have permission to access this resource or to perform this action.",
|
|
143
|
+
content: {
|
|
144
|
+
"application/json": {
|
|
145
|
+
schema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
message: { type: "string" }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"404": {
|
|
155
|
+
description: "Not Found. The requested resource was not found.",
|
|
156
|
+
content: {
|
|
157
|
+
"application/json": {
|
|
158
|
+
schema: {
|
|
159
|
+
type: "object",
|
|
160
|
+
properties: {
|
|
161
|
+
message: { type: "string" }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"429": {
|
|
168
|
+
description: "Too Many Requests. You have exceeded the rate limit. Try again later.",
|
|
169
|
+
content: {
|
|
170
|
+
"application/json": {
|
|
171
|
+
schema: {
|
|
172
|
+
type: "object",
|
|
173
|
+
properties: {
|
|
174
|
+
message: { type: "string" }
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"500": {
|
|
181
|
+
description: "Internal Server Error. This is a problem with the server that you cannot fix.",
|
|
182
|
+
content: {
|
|
183
|
+
"application/json": {
|
|
184
|
+
schema: {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
message: { type: "string" },
|
|
188
|
+
error: { type: "string" }
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Generate OpenAPI spec from API routes
|
|
198
|
+
*/
|
|
199
|
+
async generateSpec(routes) {
|
|
200
|
+
const spec = {
|
|
201
|
+
openapi: "3.0.3",
|
|
202
|
+
info: {
|
|
203
|
+
title: this.config.title || "API Documentation",
|
|
204
|
+
description: this.config.description || "Auto-generated API documentation",
|
|
205
|
+
version: this.config.version || "1.0.0",
|
|
206
|
+
...this.config.contact && { contact: this.config.contact },
|
|
207
|
+
...this.config.license && { license: this.config.license }
|
|
208
|
+
},
|
|
209
|
+
servers: this.config.servers || [
|
|
210
|
+
{ url: "http://localhost:3000", description: "Development server" }
|
|
211
|
+
],
|
|
212
|
+
paths: {},
|
|
213
|
+
components: {
|
|
214
|
+
schemas: {},
|
|
215
|
+
securitySchemes: {
|
|
216
|
+
bearerAuth: {
|
|
217
|
+
type: "http",
|
|
218
|
+
scheme: "bearer",
|
|
219
|
+
description: "Bearer token authentication"
|
|
220
|
+
},
|
|
221
|
+
apiKeyCookie: {
|
|
222
|
+
type: "apiKey",
|
|
223
|
+
in: "cookie",
|
|
224
|
+
name: "session",
|
|
225
|
+
description: "API Key authentication via cookie"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const routeGroups = /* @__PURE__ */ new Map();
|
|
231
|
+
for (const route of routes) {
|
|
232
|
+
const key = route.path;
|
|
233
|
+
if (!routeGroups.has(key)) {
|
|
234
|
+
routeGroups.set(key, []);
|
|
235
|
+
}
|
|
236
|
+
routeGroups.get(key).push(route);
|
|
237
|
+
}
|
|
238
|
+
for (const [path, routeList] of routeGroups) {
|
|
239
|
+
const openAPIPath = this.convertToOpenAPIPath(path);
|
|
240
|
+
spec.paths[openAPIPath] = {};
|
|
241
|
+
for (const route of routeList) {
|
|
242
|
+
for (const method of route.methods) {
|
|
243
|
+
const methodLower = method.toLowerCase();
|
|
244
|
+
spec.paths[openAPIPath][methodLower] = await this.generateOperation(route, method);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return spec;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Convert Farm.js API path to OpenAPI path format
|
|
252
|
+
*/
|
|
253
|
+
convertToOpenAPIPath(path) {
|
|
254
|
+
return path.replace(/^\/api/, "");
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Extract request body schema from endpoint
|
|
258
|
+
*/
|
|
259
|
+
async getRequestBody(route, method) {
|
|
260
|
+
if (!["POST", "PUT", "PATCH", "DELETE"].includes(method)) {
|
|
261
|
+
return void 0;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
const modulePath = route.filePath;
|
|
265
|
+
const routeModule = await import(
|
|
266
|
+
/* @vite-ignore */
|
|
267
|
+
modulePath
|
|
268
|
+
);
|
|
269
|
+
const handler = routeModule[method];
|
|
270
|
+
if (handler && handler.__types && handler.__types.body) {
|
|
271
|
+
const bodySchema = handler.__types.body;
|
|
272
|
+
if (bodySchema instanceof z.ZodObject || bodySchema instanceof z.ZodOptional) {
|
|
273
|
+
const shape = bodySchema.shape || bodySchema._def?.innerType?.shape;
|
|
274
|
+
if (shape) {
|
|
275
|
+
const properties = {};
|
|
276
|
+
const required = [];
|
|
277
|
+
Object.entries(shape).forEach(([key, value]) => {
|
|
278
|
+
if (value instanceof z.ZodType) {
|
|
279
|
+
properties[key] = this.processZodType(value);
|
|
280
|
+
if (!(value instanceof z.ZodOptional)) {
|
|
281
|
+
required.push(key);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
return {
|
|
286
|
+
required: bodySchema instanceof z.ZodOptional ? false : true,
|
|
287
|
+
content: {
|
|
288
|
+
"application/json": {
|
|
289
|
+
schema: {
|
|
290
|
+
type: "object",
|
|
291
|
+
properties,
|
|
292
|
+
...required.length > 0 ? { required } : {}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (handler && handler._type && handler._type.body) {
|
|
301
|
+
const bodySchema = handler._type.body;
|
|
302
|
+
if (bodySchema instanceof z.ZodObject || bodySchema instanceof z.ZodOptional) {
|
|
303
|
+
const shape = bodySchema.shape || bodySchema._def?.innerType?.shape;
|
|
304
|
+
if (shape) {
|
|
305
|
+
const properties = {};
|
|
306
|
+
const required = [];
|
|
307
|
+
Object.entries(shape).forEach(([key, value]) => {
|
|
308
|
+
if (value instanceof z.ZodType) {
|
|
309
|
+
properties[key] = this.processZodType(value);
|
|
310
|
+
if (!(value instanceof z.ZodOptional)) {
|
|
311
|
+
required.push(key);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
return {
|
|
316
|
+
required: bodySchema instanceof z.ZodOptional ? false : true,
|
|
317
|
+
content: {
|
|
318
|
+
"application/json": {
|
|
319
|
+
schema: {
|
|
320
|
+
type: "object",
|
|
321
|
+
properties,
|
|
322
|
+
...required.length > 0 ? { required } : {}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
} catch (error) {
|
|
331
|
+
console.warn(`Could not extract schema from ${route.filePath}:`, error);
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
required: true,
|
|
335
|
+
content: {
|
|
336
|
+
"application/json": {
|
|
337
|
+
schema: {
|
|
338
|
+
type: "object",
|
|
339
|
+
description: "Request body"
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Extract query parameters from endpoint
|
|
347
|
+
*/
|
|
348
|
+
async getParameters(route, method) {
|
|
349
|
+
const parameters = [];
|
|
350
|
+
try {
|
|
351
|
+
const modulePath = route.filePath;
|
|
352
|
+
const routeModule = await import(
|
|
353
|
+
/* @vite-ignore */
|
|
354
|
+
modulePath
|
|
355
|
+
);
|
|
356
|
+
const handler = routeModule[method];
|
|
357
|
+
if (handler && handler.__types && handler.__types.query) {
|
|
358
|
+
const querySchema = handler.__types.query;
|
|
359
|
+
if (querySchema instanceof z.ZodObject) {
|
|
360
|
+
Object.entries(querySchema.shape).forEach(([key, value]) => {
|
|
361
|
+
if (value instanceof z.ZodType) {
|
|
362
|
+
parameters.push({
|
|
363
|
+
name: key,
|
|
364
|
+
in: "query",
|
|
365
|
+
required: !(value instanceof z.ZodOptional),
|
|
366
|
+
schema: this.processZodType(value)
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (handler && handler._type && handler._type.query) {
|
|
373
|
+
const querySchema = handler._type.query;
|
|
374
|
+
if (querySchema instanceof z.ZodObject) {
|
|
375
|
+
Object.entries(querySchema.shape).forEach(([key, value]) => {
|
|
376
|
+
if (value instanceof z.ZodType) {
|
|
377
|
+
parameters.push({
|
|
378
|
+
name: key,
|
|
379
|
+
in: "query",
|
|
380
|
+
required: !(value instanceof z.ZodOptional),
|
|
381
|
+
schema: this.processZodType(value)
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
} catch (error) {
|
|
388
|
+
console.warn(`Could not extract query params from ${route.filePath}:`, error);
|
|
389
|
+
}
|
|
390
|
+
return parameters;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Generate OpenAPI operation from route info
|
|
394
|
+
*/
|
|
395
|
+
async generateOperation(route, method) {
|
|
396
|
+
const operation = {
|
|
397
|
+
summary: this.generateSummary(route.path, method),
|
|
398
|
+
description: this.generateDescription(route.path, method),
|
|
399
|
+
operationId: this.generateOperationId(route.path, method),
|
|
400
|
+
tags: this.generateTags(route.path),
|
|
401
|
+
security: [{ bearerAuth: [] }, { apiKeyCookie: [] }],
|
|
402
|
+
responses: this.getStandardResponses()
|
|
403
|
+
};
|
|
404
|
+
const parameters = await this.getParameters(route, method);
|
|
405
|
+
if (parameters.length > 0) {
|
|
406
|
+
operation.parameters = parameters;
|
|
407
|
+
}
|
|
408
|
+
if (["POST", "PUT", "PATCH", "DELETE"].includes(method)) {
|
|
409
|
+
operation.requestBody = await this.getRequestBody(route, method);
|
|
410
|
+
}
|
|
411
|
+
return operation;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Generate operation summary
|
|
415
|
+
*/
|
|
416
|
+
generateSummary(path, method) {
|
|
417
|
+
const cleanPath = path.replace(/^\/api\//, "");
|
|
418
|
+
const pathParts = cleanPath.split("/");
|
|
419
|
+
const lastPart = pathParts[pathParts.length - 1];
|
|
420
|
+
const action = method === "GET" ? "Get" : method === "POST" ? "Create" : method === "PUT" ? "Update" : method === "DELETE" ? "Delete" : method === "PATCH" ? "Update" : method;
|
|
421
|
+
return `${action} ${lastPart}`;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Generate operation description
|
|
425
|
+
*/
|
|
426
|
+
generateDescription(path, method) {
|
|
427
|
+
const cleanPath = path.replace(/^\/api\//, "");
|
|
428
|
+
return `${method} ${cleanPath} endpoint`;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Generate operation ID
|
|
432
|
+
*/
|
|
433
|
+
generateOperationId(path, method) {
|
|
434
|
+
const cleanPath = path.replace(/^\/api\//, "").replace(/\//g, "_");
|
|
435
|
+
return `${method.toLowerCase()}_${cleanPath}`;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Generate tags for grouping operations
|
|
439
|
+
*/
|
|
440
|
+
generateTags(path) {
|
|
441
|
+
const cleanPath = path.replace(/^\/api\//, "");
|
|
442
|
+
const pathParts = cleanPath.split("/");
|
|
443
|
+
if (pathParts.length > 1) {
|
|
444
|
+
return [pathParts[0]];
|
|
445
|
+
}
|
|
446
|
+
return ["default"];
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Generate OpenAPI spec file
|
|
450
|
+
*/
|
|
451
|
+
async generateSpecFile(routes, outputPath) {
|
|
452
|
+
const spec = await this.generateSpec(routes);
|
|
453
|
+
const fs = __require("fs");
|
|
454
|
+
const path = __require("path");
|
|
455
|
+
const dir = path.dirname(outputPath);
|
|
456
|
+
if (!fs.existsSync(dir)) {
|
|
457
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
458
|
+
}
|
|
459
|
+
fs.writeFileSync(outputPath, JSON.stringify(spec, null, 2));
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
__name(_OpenAPIGenerator, "OpenAPIGenerator");
|
|
463
|
+
var OpenAPIGenerator = _OpenAPIGenerator;
|
|
464
|
+
|
|
465
|
+
// src/openapi/manager.ts
|
|
466
|
+
var _OpenAPIManager = class _OpenAPIManager {
|
|
467
|
+
constructor(appDir, config) {
|
|
468
|
+
this.specCache = null;
|
|
469
|
+
const appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
|
|
470
|
+
this.appDir = appDirs[appDirs.length - 1];
|
|
471
|
+
this.config = config;
|
|
472
|
+
this.generator = new OpenAPIGenerator(this.appDir, config);
|
|
473
|
+
this.apiTypeGenerator = new APITypeGenerator(appDirs);
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Generate OpenAPI spec from API routes
|
|
477
|
+
*/
|
|
478
|
+
async generateSpec() {
|
|
479
|
+
try {
|
|
480
|
+
const routes = this.apiTypeGenerator.scanAPIRoutes();
|
|
481
|
+
const spec = await this.generator.generateSpec(routes);
|
|
482
|
+
this.specCache = spec;
|
|
483
|
+
return spec;
|
|
484
|
+
} catch (error) {
|
|
485
|
+
console.error("Failed to generate OpenAPI spec:", error);
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Get cached spec or generate new one
|
|
491
|
+
*/
|
|
492
|
+
async getSpec() {
|
|
493
|
+
if (this.specCache) {
|
|
494
|
+
return this.specCache;
|
|
495
|
+
}
|
|
496
|
+
return await this.generateSpec();
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Generate and save OpenAPI spec file
|
|
500
|
+
*/
|
|
501
|
+
async generateSpecFile() {
|
|
502
|
+
try {
|
|
503
|
+
const routes = this.apiTypeGenerator.scanAPIRoutes();
|
|
504
|
+
const outputPath = `${this.appDir}/lib/openapi.spec.json`;
|
|
505
|
+
await this.generator.generateSpecFile(routes, outputPath);
|
|
506
|
+
console.log("\u2705 OpenAPI spec generated at:", outputPath);
|
|
507
|
+
} catch (error) {
|
|
508
|
+
console.error("Failed to generate OpenAPI spec file:", error);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Invalidate cache and regenerate spec
|
|
513
|
+
*/
|
|
514
|
+
async invalidateCache() {
|
|
515
|
+
this.specCache = null;
|
|
516
|
+
await this.generateSpec();
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Get the docs route handler
|
|
520
|
+
*/
|
|
521
|
+
getDocsRouteHandler() {
|
|
522
|
+
return async (req, res) => {
|
|
523
|
+
try {
|
|
524
|
+
const spec = await this.getSpec();
|
|
525
|
+
if (!spec) {
|
|
526
|
+
res.statusCode = 500;
|
|
527
|
+
res.setHeader("Content-Type", "text/html");
|
|
528
|
+
res.end(`
|
|
529
|
+
<html>
|
|
530
|
+
<body>
|
|
531
|
+
<h1>Error</h1>
|
|
532
|
+
<p>Failed to generate OpenAPI specification</p>
|
|
533
|
+
</body>
|
|
534
|
+
</html>
|
|
535
|
+
`);
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
res.statusCode = 200;
|
|
539
|
+
res.setHeader("Content-Type", "text/html");
|
|
540
|
+
const html = this.generateDocsHTML(spec);
|
|
541
|
+
res.end(html);
|
|
542
|
+
} catch (error) {
|
|
543
|
+
console.error("Error serving docs route:", error);
|
|
544
|
+
res.statusCode = 500;
|
|
545
|
+
res.setHeader("Content-Type", "text/html");
|
|
546
|
+
res.end(`
|
|
547
|
+
<html>
|
|
548
|
+
<body>
|
|
549
|
+
<h1>Error</h1>
|
|
550
|
+
<p>Failed to load API documentation</p>
|
|
551
|
+
</body>
|
|
552
|
+
</html>
|
|
553
|
+
`);
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Generate HTML for docs route
|
|
559
|
+
*/
|
|
560
|
+
generateDocsHTML(spec) {
|
|
561
|
+
return `
|
|
562
|
+
<!DOCTYPE html>
|
|
563
|
+
<html>
|
|
564
|
+
<head>
|
|
565
|
+
<title>${this.config.title || "API Documentation"}</title>
|
|
566
|
+
<meta charset="utf-8" />
|
|
567
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
568
|
+
<link rel="icon" href="data:," />
|
|
569
|
+
</head>
|
|
570
|
+
<body>
|
|
571
|
+
<script
|
|
572
|
+
id="api-reference"
|
|
573
|
+
data-url="data:application/json;base64,${Buffer.from(JSON.stringify(spec)).toString("base64")}"
|
|
574
|
+
></script>
|
|
575
|
+
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
576
|
+
</body>
|
|
577
|
+
</html>
|
|
578
|
+
`;
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
__name(_OpenAPIManager, "OpenAPIManager");
|
|
582
|
+
var OpenAPIManager = _OpenAPIManager;
|
|
583
|
+
|
|
584
|
+
export {
|
|
585
|
+
OpenAPIGenerator,
|
|
586
|
+
OpenAPIManager
|
|
587
|
+
};
|
|
588
|
+
//# sourceMappingURL=chunk-VCANOYFI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/openapi/generator.ts","../src/openapi/manager.ts"],"sourcesContent":["import type { OpenAPIConfig } from \"../config\";\nimport type { APIRouteInfo } from \"../type-generator\";\nimport * as z from \"zod\";\n\nexport interface OpenAPISpec {\n openapi: string;\n info: {\n title: string;\n description?: string;\n version: string;\n contact?: {\n name?: string;\n email?: string;\n url?: string;\n };\n license?: {\n name: string;\n url?: string;\n };\n };\n servers?: Array<{\n url: string;\n description?: string;\n }>;\n paths: Record<string, any>;\n components?: {\n schemas?: Record<string, any>;\n securitySchemes?: Record<string, any>;\n };\n}\n\ntype AllowedType = \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\";\nconst allowedType = new Set([\"string\", \"number\", \"boolean\", \"array\", \"object\"]);\n\nexport class OpenAPIGenerator {\n private config: OpenAPIConfig;\n private appDir: string;\n\n constructor(appDir: string, config: OpenAPIConfig) {\n this.appDir = appDir;\n this.config = config;\n }\n\n /**\n * Get type from Zod type\n */\n private getTypeFromZodType(zodType: z.ZodType<any>): AllowedType {\n const typeName = (zodType as any)._def?.typeName;\n if (typeName) {\n if (typeName === \"ZodString\") return \"string\";\n if (typeName === \"ZodNumber\") return \"number\";\n if (typeName === \"ZodBoolean\") return \"boolean\";\n if (typeName === \"ZodArray\") return \"array\";\n if (typeName === \"ZodObject\") return \"object\";\n }\n return \"string\";\n }\n\n /**\n * Process Zod type to OpenAPI schema\n */\n private processZodType(zodType: z.ZodType<any>): any {\n // Handle ZodOptional\n if (zodType instanceof z.ZodOptional) {\n const innerType = (zodType as any)._def.innerType;\n const innerSchema = this.processZodType(innerType);\n return {\n ...innerSchema,\n nullable: true,\n };\n }\n\n // Handle ZodObject\n if (zodType instanceof z.ZodObject) {\n const shape = (zodType as any).shape;\n if (shape) {\n const properties: Record<string, any> = {};\n const required: string[] = [];\n Object.entries(shape).forEach(([key, value]) => {\n if (value instanceof z.ZodType) {\n properties[key] = this.processZodType(value as z.ZodType<any>);\n if (!(value instanceof z.ZodOptional)) {\n required.push(key);\n }\n }\n });\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n description: (zodType as any).description,\n };\n }\n }\n\n // Handle ZodArray\n if (zodType instanceof z.ZodArray) {\n const itemType = (zodType as any)._def.type;\n return {\n type: \"array\",\n items: this.processZodType(itemType),\n description: (zodType as any).description,\n };\n }\n\n // Handle ZodEnum\n if (zodType instanceof z.ZodEnum) {\n return {\n type: \"string\",\n enum: (zodType as any)._def.values,\n description: (zodType as any).description,\n };\n }\n\n // For primitive types\n const baseSchema: any = {\n type: this.getTypeFromZodType(zodType),\n description: (zodType as any).description,\n };\n\n // Add constraints if available\n if (\"minLength\" in zodType && (zodType as any).minLength) {\n baseSchema.minLength = (zodType as any).minLength;\n }\n if (\"maxLength\" in zodType && (zodType as any).maxLength) {\n baseSchema.maxLength = (zodType as any).maxLength;\n }\n if (\"min\" in zodType && (zodType as any).min !== undefined) {\n baseSchema.minimum = (zodType as any).min;\n }\n if (\"max\" in zodType && (zodType as any).max !== undefined) {\n baseSchema.maximum = (zodType as any).max;\n }\n\n return baseSchema;\n }\n\n /**\n * Generate standard error responses\n */\n private getStandardResponses(): Record<string, any> {\n return {\n \"200\": {\n description: \"Successful response\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n description: \"Response data\",\n },\n },\n },\n },\n \"400\": {\n description: \"Bad Request. Usually due to missing parameters, or invalid parameters.\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: { type: \"string\" },\n error: { type: \"string\" },\n },\n required: [\"message\"],\n },\n },\n },\n },\n \"401\": {\n description: \"Unauthorized. Due to missing or invalid authentication.\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: { type: \"string\" },\n },\n required: [\"message\"],\n },\n },\n },\n },\n \"403\": {\n description:\n \"Forbidden. You do not have permission to access this resource or to perform this action.\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: { type: \"string\" },\n },\n },\n },\n },\n },\n \"404\": {\n description: \"Not Found. The requested resource was not found.\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: { type: \"string\" },\n },\n },\n },\n },\n },\n \"429\": {\n description: \"Too Many Requests. You have exceeded the rate limit. Try again later.\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: { type: \"string\" },\n },\n },\n },\n },\n },\n \"500\": {\n description:\n \"Internal Server Error. This is a problem with the server that you cannot fix.\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: { type: \"string\" },\n error: { type: \"string\" },\n },\n },\n },\n },\n },\n };\n }\n\n /**\n * Generate OpenAPI spec from API routes\n */\n async generateSpec(routes: APIRouteInfo[]): Promise<OpenAPISpec> {\n const spec: OpenAPISpec = {\n openapi: \"3.0.3\",\n info: {\n title: this.config.title || \"API Documentation\",\n description: this.config.description || \"Auto-generated API documentation\",\n version: this.config.version || \"1.0.0\",\n ...(this.config.contact && { contact: this.config.contact }),\n ...(this.config.license && { license: this.config.license }),\n },\n servers: this.config.servers || [\n { url: \"http://localhost:3000\", description: \"Development server\" },\n ],\n paths: {},\n components: {\n schemas: {},\n securitySchemes: {\n bearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n description: \"Bearer token authentication\",\n },\n apiKeyCookie: {\n type: \"apiKey\",\n in: \"cookie\",\n name: \"session\",\n description: \"API Key authentication via cookie\",\n },\n },\n },\n };\n\n // Group routes by path\n const routeGroups = new Map<string, APIRouteInfo[]>();\n for (const route of routes) {\n const key = route.path;\n if (!routeGroups.has(key)) {\n routeGroups.set(key, []);\n }\n routeGroups.get(key)!.push(route);\n }\n\n // Generate paths\n for (const [path, routeList] of routeGroups) {\n const openAPIPath = this.convertToOpenAPIPath(path);\n spec.paths[openAPIPath] = {};\n\n for (const route of routeList) {\n for (const method of route.methods) {\n const methodLower = method.toLowerCase();\n spec.paths[openAPIPath][methodLower] = await this.generateOperation(route, method);\n }\n }\n }\n\n return spec;\n }\n\n /**\n * Convert Farm.js API path to OpenAPI path format\n */\n private convertToOpenAPIPath(path: string): string {\n // Convert /api/auth/login to /auth/login\n return path.replace(/^\\/api/, \"\");\n }\n\n /**\n * Extract request body schema from endpoint\n */\n private async getRequestBody(route: APIRouteInfo, method: string): Promise<any> {\n if (![\"POST\", \"PUT\", \"PATCH\", \"DELETE\"].includes(method)) {\n return undefined;\n }\n\n try {\n // Try to dynamically load the route module\n const modulePath = route.filePath;\n const routeModule = await import(/* @vite-ignore */ modulePath);\n\n // Get the method handler (GET, POST, etc.)\n const handler = routeModule[method];\n\n // Check for Farm.js endpoint format: handler.__types.body\n if (handler && handler.__types && handler.__types.body) {\n const bodySchema = handler.__types.body;\n\n if (bodySchema instanceof z.ZodObject || bodySchema instanceof z.ZodOptional) {\n const shape = (bodySchema as any).shape || (bodySchema as any)._def?.innerType?.shape;\n if (shape) {\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n Object.entries(shape).forEach(([key, value]) => {\n if (value instanceof z.ZodType) {\n properties[key] = this.processZodType(value as z.ZodType<any>);\n if (!(value instanceof z.ZodOptional)) {\n required.push(key);\n }\n }\n });\n return {\n required: bodySchema instanceof z.ZodOptional ? false : true,\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n },\n },\n },\n };\n }\n }\n }\n\n // Fallback: Check for better-call format: handler._type.body\n if (handler && handler._type && handler._type.body) {\n const bodySchema = handler._type.body;\n\n if (bodySchema instanceof z.ZodObject || bodySchema instanceof z.ZodOptional) {\n const shape = (bodySchema as any).shape || (bodySchema as any)._def?.innerType?.shape;\n if (shape) {\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n Object.entries(shape).forEach(([key, value]) => {\n if (value instanceof z.ZodType) {\n properties[key] = this.processZodType(value as z.ZodType<any>);\n if (!(value instanceof z.ZodOptional)) {\n required.push(key);\n }\n }\n });\n\n return {\n required: bodySchema instanceof z.ZodOptional ? false : true,\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n },\n },\n },\n };\n }\n }\n }\n } catch (error) {\n // If we can't load the module, return generic schema\n console.warn(`Could not extract schema from ${route.filePath}:`, error);\n }\n\n // Fallback to generic schema\n return {\n required: true,\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n description: \"Request body\",\n },\n },\n },\n };\n }\n\n /**\n * Extract query parameters from endpoint\n */\n private async getParameters(route: APIRouteInfo, method: string): Promise<any[]> {\n const parameters: any[] = [];\n\n try {\n // Try to dynamically load the route module\n const modulePath = route.filePath;\n const routeModule = await import(/* @vite-ignore */ modulePath);\n\n // Get the method handler\n const handler = routeModule[method];\n\n // Check for Farm.js endpoint format: handler.__types.query\n if (handler && handler.__types && handler.__types.query) {\n const querySchema = handler.__types.query;\n\n if (querySchema instanceof z.ZodObject) {\n Object.entries((querySchema as any).shape).forEach(([key, value]) => {\n if (value instanceof z.ZodType) {\n parameters.push({\n name: key,\n in: \"query\",\n required: !(value instanceof z.ZodOptional),\n schema: this.processZodType(value as z.ZodType<any>),\n });\n }\n });\n }\n }\n\n // Fallback: Check for better-call format: handler._type.query\n if (handler && handler._type && handler._type.query) {\n const querySchema = handler._type.query;\n\n if (querySchema instanceof z.ZodObject) {\n Object.entries((querySchema as any).shape).forEach(([key, value]) => {\n if (value instanceof z.ZodType) {\n parameters.push({\n name: key,\n in: \"query\",\n required: !(value instanceof z.ZodOptional),\n schema: this.processZodType(value as z.ZodType<any>),\n });\n }\n });\n }\n }\n } catch (error) {\n console.warn(`Could not extract query params from ${route.filePath}:`, error);\n }\n\n return parameters;\n }\n\n /**\n * Generate OpenAPI operation from route info\n */\n private async generateOperation(route: APIRouteInfo, method: string): Promise<any> {\n const operation: any = {\n summary: this.generateSummary(route.path, method),\n description: this.generateDescription(route.path, method),\n operationId: this.generateOperationId(route.path, method),\n tags: this.generateTags(route.path),\n security: [{ bearerAuth: [] }, { apiKeyCookie: [] }],\n responses: this.getStandardResponses(),\n };\n\n // Add query parameters\n const parameters = await this.getParameters(route, method);\n if (parameters.length > 0) {\n operation.parameters = parameters;\n }\n\n // Add request body for POST, PUT, PATCH, DELETE\n if ([\"POST\", \"PUT\", \"PATCH\", \"DELETE\"].includes(method)) {\n operation.requestBody = await this.getRequestBody(route, method);\n }\n\n return operation;\n }\n\n /**\n * Generate operation summary\n */\n private generateSummary(path: string, method: string): string {\n const cleanPath = path.replace(/^\\/api\\//, \"\");\n const pathParts = cleanPath.split(\"/\");\n const lastPart = pathParts[pathParts.length - 1];\n\n const action =\n method === \"GET\"\n ? \"Get\"\n : method === \"POST\"\n ? \"Create\"\n : method === \"PUT\"\n ? \"Update\"\n : method === \"DELETE\"\n ? \"Delete\"\n : method === \"PATCH\"\n ? \"Update\"\n : method;\n\n return `${action} ${lastPart}`;\n }\n\n /**\n * Generate operation description\n */\n private generateDescription(path: string, method: string): string {\n const cleanPath = path.replace(/^\\/api\\//, \"\");\n return `${method} ${cleanPath} endpoint`;\n }\n\n /**\n * Generate operation ID\n */\n private generateOperationId(path: string, method: string): string {\n const cleanPath = path.replace(/^\\/api\\//, \"\").replace(/\\//g, \"_\");\n return `${method.toLowerCase()}_${cleanPath}`;\n }\n\n /**\n * Generate tags for grouping operations\n */\n private generateTags(path: string): string[] {\n const cleanPath = path.replace(/^\\/api\\//, \"\");\n const pathParts = cleanPath.split(\"/\");\n\n if (pathParts.length > 1) {\n return [pathParts[0]]; // Use first part as tag\n }\n\n return [\"default\"];\n }\n\n /**\n * Generate OpenAPI spec file\n */\n async generateSpecFile(routes: APIRouteInfo[], outputPath: string): Promise<void> {\n const spec = await this.generateSpec(routes);\n const fs = require(\"fs\");\n const path = require(\"path\");\n\n // Ensure directory exists\n const dir = path.dirname(outputPath);\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n\n // Write spec file\n fs.writeFileSync(outputPath, JSON.stringify(spec, null, 2));\n }\n}\n","import { OpenAPIGenerator } from \"./generator\";\nimport { APITypeGenerator } from \"../type-generator\";\nimport type { OpenAPIConfig } from \"../config\";\n\nexport class OpenAPIManager {\n private generator: OpenAPIGenerator;\n private apiTypeGenerator: APITypeGenerator;\n private config: OpenAPIConfig;\n private appDir: string;\n private specCache: any = null;\n\n constructor(appDir: string | readonly string[], config: OpenAPIConfig) {\n const appDirs = Array.isArray(appDir) ? [...appDir] : [appDir as string];\n this.appDir = appDirs[appDirs.length - 1];\n this.config = config;\n this.generator = new OpenAPIGenerator(this.appDir, config);\n this.apiTypeGenerator = new APITypeGenerator(appDirs);\n }\n\n /**\n * Generate OpenAPI spec from API routes\n */\n async generateSpec(): Promise<any> {\n try {\n // Get API routes using the existing type generator\n const routes = this.apiTypeGenerator.scanAPIRoutes();\n\n // Generate OpenAPI spec (now async)\n const spec = await this.generator.generateSpec(routes);\n\n // Cache the spec\n this.specCache = spec;\n\n return spec;\n } catch (error) {\n console.error(\"Failed to generate OpenAPI spec:\", error);\n return null;\n }\n }\n\n /**\n * Get cached spec or generate new one\n */\n async getSpec(): Promise<any> {\n if (this.specCache) {\n return this.specCache;\n }\n\n return await this.generateSpec();\n }\n\n /**\n * Generate and save OpenAPI spec file\n */\n async generateSpecFile(): Promise<void> {\n try {\n const routes = this.apiTypeGenerator.scanAPIRoutes();\n const outputPath = `${this.appDir}/lib/openapi.spec.json`;\n\n await this.generator.generateSpecFile(routes, outputPath);\n console.log(\"✅ OpenAPI spec generated at:\", outputPath);\n } catch (error) {\n console.error(\"Failed to generate OpenAPI spec file:\", error);\n }\n }\n\n /**\n * Invalidate cache and regenerate spec\n */\n async invalidateCache(): Promise<void> {\n this.specCache = null;\n await this.generateSpec();\n }\n\n /**\n * Get the docs route handler\n */\n getDocsRouteHandler() {\n return async (req: any, res: any) => {\n try {\n const spec = await this.getSpec();\n\n if (!spec) {\n res.statusCode = 500;\n res.setHeader(\"Content-Type\", \"text/html\");\n res.end(`\n <html>\n <body>\n <h1>Error</h1>\n <p>Failed to generate OpenAPI specification</p>\n </body>\n </html>\n `);\n return;\n }\n\n // Set headers for HTML response\n res.statusCode = 200;\n res.setHeader(\"Content-Type\", \"text/html\");\n\n // Generate HTML with Scalar\n const html = this.generateDocsHTML(spec);\n res.end(html);\n } catch (error) {\n console.error(\"Error serving docs route:\", error);\n res.statusCode = 500;\n res.setHeader(\"Content-Type\", \"text/html\");\n res.end(`\n <html>\n <body>\n <h1>Error</h1>\n <p>Failed to load API documentation</p>\n </body>\n </html>\n `);\n }\n };\n }\n\n /**\n * Generate HTML for docs route\n */\n private generateDocsHTML(spec: any): string {\n return `\n<!DOCTYPE html>\n<html>\n <head>\n <title>${this.config.title || \"API Documentation\"}</title>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" href=\"data:,\" />\n </head>\n <body>\n <script\n id=\"api-reference\"\n data-url=\"data:application/json;base64,${Buffer.from(JSON.stringify(spec)).toString(\"base64\")}\"\n ></script>\n <script src=\"https://cdn.jsdelivr.net/npm/@scalar/api-reference\"></script>\n </body>\n</html>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAEA,YAAY,OAAO;AAgCZ,IAAM,oBAAN,MAAM,kBAAiB;AAAA,EAI5B,YAAY,QAAgB,QAAuB;AACjD,SAAK,SAAS;AACd,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKQ,mBAAmB,SAAsC;AAC/D,UAAM,WAAY,QAAgB,MAAM;AACxC,QAAI,UAAU;AACZ,UAAI,aAAa,YAAa,QAAO;AACrC,UAAI,aAAa,YAAa,QAAO;AACrC,UAAI,aAAa,aAAc,QAAO;AACtC,UAAI,aAAa,WAAY,QAAO;AACpC,UAAI,aAAa,YAAa,QAAO;AAAA,IACvC;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,eAAe,SAA8B;AAEnD,QAAI,mBAAqB,eAAa;AACpC,YAAM,YAAa,QAAgB,KAAK;AACxC,YAAM,cAAc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