@farm.js/core 0.1.0-beta.5 → 0.1.0-beta.6
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/package.json +1 -1
- package/dist/after.cjs +0 -227
- package/dist/after.cjs.map +0 -1
- package/dist/after.d.mts +0 -25
- package/dist/after.d.ts +0 -25
- package/dist/after.mjs +0 -14
- package/dist/after.mjs.map +0 -1
- package/dist/agent-runtime.cjs +0 -2379
- package/dist/agent-runtime.cjs.map +0 -1
- package/dist/agent-runtime.d.mts +0 -94
- package/dist/agent-runtime.d.ts +0 -94
- package/dist/agent-runtime.mjs +0 -479
- package/dist/agent-runtime.mjs.map +0 -1
- package/dist/api/route-manager.d.mts +0 -66
- package/dist/api/route-manager.d.ts +0 -66
- package/dist/api/runtime.d.mts +0 -3
- package/dist/api/runtime.d.ts +0 -3
- package/dist/api.cjs +0 -4100
- package/dist/api.cjs.map +0 -1
- package/dist/api.d.mts +0 -48
- package/dist/api.d.ts +0 -48
- package/dist/api.mjs +0 -93
- package/dist/api.mjs.map +0 -1
- package/dist/app-BjN-da13.d.ts +0 -300
- package/dist/app-CakAr8Be.d.mts +0 -300
- package/dist/app-markdown.cjs +0 -220
- package/dist/app-markdown.cjs.map +0 -1
- package/dist/app-markdown.d.mts +0 -22
- package/dist/app-markdown.d.ts +0 -22
- package/dist/app-markdown.mjs +0 -26
- package/dist/app-markdown.mjs.map +0 -1
- package/dist/cache.cjs +0 -945
- package/dist/cache.cjs.map +0 -1
- package/dist/cache.d.mts +0 -192
- package/dist/cache.d.ts +0 -192
- package/dist/cache.mjs +0 -46
- package/dist/cache.mjs.map +0 -1
- package/dist/chunk-2CUKEMVR.mjs +0 -872
- package/dist/chunk-2CUKEMVR.mjs.map +0 -1
- package/dist/chunk-2ED5Q2GH.mjs +0 -422
- package/dist/chunk-2ED5Q2GH.mjs.map +0 -1
- package/dist/chunk-2NHCNRF6.mjs +0 -6241
- package/dist/chunk-2NHCNRF6.mjs.map +0 -1
- package/dist/chunk-32W4QEJP.mjs +0 -158
- package/dist/chunk-32W4QEJP.mjs.map +0 -1
- package/dist/chunk-3XNTL3FQ.mjs +0 -452
- package/dist/chunk-3XNTL3FQ.mjs.map +0 -1
- package/dist/chunk-44ZCFSKE.mjs +0 -84
- package/dist/chunk-44ZCFSKE.mjs.map +0 -1
- package/dist/chunk-4S3ORGFA.mjs +0 -44
- package/dist/chunk-4S3ORGFA.mjs.map +0 -1
- package/dist/chunk-5BY76U2M.mjs +0 -1
- package/dist/chunk-5BY76U2M.mjs.map +0 -1
- package/dist/chunk-5ZGPRGWV.mjs +0 -136
- package/dist/chunk-5ZGPRGWV.mjs.map +0 -1
- package/dist/chunk-65A7QIKI.mjs +0 -142
- package/dist/chunk-65A7QIKI.mjs.map +0 -1
- package/dist/chunk-74YTBPTY.mjs +0 -450
- package/dist/chunk-74YTBPTY.mjs.map +0 -1
- package/dist/chunk-7HO6AEOP.mjs +0 -74
- package/dist/chunk-7HO6AEOP.mjs.map +0 -1
- package/dist/chunk-7MABZJIM.mjs +0 -29
- package/dist/chunk-7MABZJIM.mjs.map +0 -1
- package/dist/chunk-7N62DNSO.mjs +0 -41
- package/dist/chunk-7N62DNSO.mjs.map +0 -1
- package/dist/chunk-7ZY5AIJO.mjs +0 -161
- package/dist/chunk-7ZY5AIJO.mjs.map +0 -1
- package/dist/chunk-A2LUXHD2.mjs +0 -7631
- package/dist/chunk-A2LUXHD2.mjs.map +0 -1
- package/dist/chunk-ALCLXXTY.mjs +0 -187
- package/dist/chunk-ALCLXXTY.mjs.map +0 -1
- package/dist/chunk-AZ7YUVNR.mjs +0 -65
- package/dist/chunk-AZ7YUVNR.mjs.map +0 -1
- package/dist/chunk-B232I2GP.mjs +0 -163
- package/dist/chunk-B232I2GP.mjs.map +0 -1
- package/dist/chunk-BHG3LVHH.mjs +0 -176
- package/dist/chunk-BHG3LVHH.mjs.map +0 -1
- package/dist/chunk-C2ROET2V.mjs +0 -718
- package/dist/chunk-C2ROET2V.mjs.map +0 -1
- package/dist/chunk-C3DLZMBU.mjs +0 -597
- package/dist/chunk-C3DLZMBU.mjs.map +0 -1
- package/dist/chunk-CGILA3WO.mjs +0 -14
- package/dist/chunk-CGILA3WO.mjs.map +0 -1
- package/dist/chunk-E2MPIBRE.mjs +0 -149
- package/dist/chunk-E2MPIBRE.mjs.map +0 -1
- package/dist/chunk-E6EPN5BT.mjs +0 -203
- package/dist/chunk-E6EPN5BT.mjs.map +0 -1
- package/dist/chunk-EEABSBKK.mjs +0 -10
- package/dist/chunk-EEABSBKK.mjs.map +0 -1
- package/dist/chunk-EJ7T4TPB.mjs +0 -622
- package/dist/chunk-EJ7T4TPB.mjs.map +0 -1
- package/dist/chunk-FQYDHKKU.mjs +0 -128
- package/dist/chunk-FQYDHKKU.mjs.map +0 -1
- package/dist/chunk-FRPWCMMG.mjs +0 -299
- package/dist/chunk-FRPWCMMG.mjs.map +0 -1
- package/dist/chunk-GN72QAIH.mjs +0 -146
- package/dist/chunk-GN72QAIH.mjs.map +0 -1
- package/dist/chunk-GQVGIUSN.mjs +0 -149
- package/dist/chunk-GQVGIUSN.mjs.map +0 -1
- package/dist/chunk-GS6K5OCM.mjs +0 -407
- package/dist/chunk-GS6K5OCM.mjs.map +0 -1
- package/dist/chunk-GXASWWJU.mjs +0 -364
- package/dist/chunk-GXASWWJU.mjs.map +0 -1
- package/dist/chunk-GY2STC2S.mjs +0 -180
- package/dist/chunk-GY2STC2S.mjs.map +0 -1
- package/dist/chunk-H2FA2SBS.mjs +0 -51
- package/dist/chunk-H2FA2SBS.mjs.map +0 -1
- package/dist/chunk-HNIQFZKB.mjs +0 -3550
- package/dist/chunk-HNIQFZKB.mjs.map +0 -1
- package/dist/chunk-ITN462YM.mjs +0 -98
- package/dist/chunk-ITN462YM.mjs.map +0 -1
- package/dist/chunk-J23HNLFY.mjs +0 -72
- package/dist/chunk-J23HNLFY.mjs.map +0 -1
- package/dist/chunk-J4FNJ5IU.mjs +0 -179
- package/dist/chunk-J4FNJ5IU.mjs.map +0 -1
- package/dist/chunk-J5YWQVI5.mjs +0 -211
- package/dist/chunk-J5YWQVI5.mjs.map +0 -1
- package/dist/chunk-JDEOUK5V.mjs +0 -427
- package/dist/chunk-JDEOUK5V.mjs.map +0 -1
- package/dist/chunk-JK25YEN6.mjs +0 -219
- package/dist/chunk-JK25YEN6.mjs.map +0 -1
- package/dist/chunk-K4667E2Q.mjs +0 -1916
- package/dist/chunk-K4667E2Q.mjs.map +0 -1
- package/dist/chunk-LGHEOHBU.mjs +0 -218
- package/dist/chunk-LGHEOHBU.mjs.map +0 -1
- package/dist/chunk-LLC7BNXW.mjs +0 -275
- package/dist/chunk-LLC7BNXW.mjs.map +0 -1
- package/dist/chunk-LM2YNO4U.mjs +0 -24
- package/dist/chunk-LM2YNO4U.mjs.map +0 -1
- package/dist/chunk-MIUW47JX.mjs +0 -639
- package/dist/chunk-MIUW47JX.mjs.map +0 -1
- package/dist/chunk-NM3CRAAL.mjs +0 -467
- package/dist/chunk-NM3CRAAL.mjs.map +0 -1
- package/dist/chunk-NNLCAVB6.mjs +0 -391
- package/dist/chunk-NNLCAVB6.mjs.map +0 -1
- package/dist/chunk-P7QDS5AT.mjs +0 -191
- package/dist/chunk-P7QDS5AT.mjs.map +0 -1
- package/dist/chunk-PFE6GMNE.mjs +0 -603
- package/dist/chunk-PFE6GMNE.mjs.map +0 -1
- package/dist/chunk-QGOHVJ6J.mjs +0 -63
- package/dist/chunk-QGOHVJ6J.mjs.map +0 -1
- package/dist/chunk-QGQX7SFC.mjs +0 -180
- package/dist/chunk-QGQX7SFC.mjs.map +0 -1
- package/dist/chunk-QKVUNGAH.mjs +0 -39
- package/dist/chunk-QKVUNGAH.mjs.map +0 -1
- package/dist/chunk-QM746KUO.mjs +0 -56
- package/dist/chunk-QM746KUO.mjs.map +0 -1
- package/dist/chunk-QTZZ2ISQ.mjs +0 -753
- package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
- package/dist/chunk-RBRLLZL5.mjs +0 -81
- package/dist/chunk-RBRLLZL5.mjs.map +0 -1
- package/dist/chunk-RHIFZZUI.mjs +0 -69
- package/dist/chunk-RHIFZZUI.mjs.map +0 -1
- package/dist/chunk-RSKVYESE.mjs +0 -187
- package/dist/chunk-RSKVYESE.mjs.map +0 -1
- package/dist/chunk-SCFX4UTD.mjs +0 -28
- package/dist/chunk-SCFX4UTD.mjs.map +0 -1
- package/dist/chunk-SL6HTIOK.mjs +0 -66
- package/dist/chunk-SL6HTIOK.mjs.map +0 -1
- package/dist/chunk-SPBBQLXI.mjs +0 -207
- package/dist/chunk-SPBBQLXI.mjs.map +0 -1
- package/dist/chunk-T4QJQK76.mjs +0 -459
- package/dist/chunk-T4QJQK76.mjs.map +0 -1
- package/dist/chunk-TQAEEJB4.mjs +0 -157
- package/dist/chunk-TQAEEJB4.mjs.map +0 -1
- package/dist/chunk-UB5UOSHB.mjs +0 -458
- package/dist/chunk-UB5UOSHB.mjs.map +0 -1
- package/dist/chunk-USWZZUEH.mjs +0 -25
- package/dist/chunk-USWZZUEH.mjs.map +0 -1
- package/dist/chunk-UVCIEUJC.mjs +0 -16
- package/dist/chunk-UVCIEUJC.mjs.map +0 -1
- package/dist/chunk-UXUAWNO5.mjs +0 -396
- package/dist/chunk-UXUAWNO5.mjs.map +0 -1
- package/dist/chunk-V3XURYJO.mjs +0 -756
- package/dist/chunk-V3XURYJO.mjs.map +0 -1
- package/dist/chunk-V6WE6JSZ.mjs +0 -352
- package/dist/chunk-V6WE6JSZ.mjs.map +0 -1
- package/dist/chunk-V7RBCSDJ.mjs +0 -170
- package/dist/chunk-V7RBCSDJ.mjs.map +0 -1
- package/dist/chunk-VCANOYFI.mjs +0 -588
- package/dist/chunk-VCANOYFI.mjs.map +0 -1
- package/dist/chunk-VY2UYN5R.mjs +0 -224
- package/dist/chunk-VY2UYN5R.mjs.map +0 -1
- package/dist/chunk-W2CRQFF6.mjs +0 -1352
- package/dist/chunk-W2CRQFF6.mjs.map +0 -1
- package/dist/chunk-WZ5QFROO.mjs +0 -23
- package/dist/chunk-WZ5QFROO.mjs.map +0 -1
- package/dist/chunk-XIVV5IWN.mjs +0 -541
- package/dist/chunk-XIVV5IWN.mjs.map +0 -1
- package/dist/chunk-YW7OBE6Q.mjs +0 -119
- package/dist/chunk-YW7OBE6Q.mjs.map +0 -1
- package/dist/chunk-Z5CQMP54.mjs +0 -365
- package/dist/chunk-Z5CQMP54.mjs.map +0 -1
- package/dist/chunk-ZBE6MLHL.mjs +0 -230
- package/dist/chunk-ZBE6MLHL.mjs.map +0 -1
- package/dist/chunk-ZZ57EH5Z.mjs +0 -173
- package/dist/chunk-ZZ57EH5Z.mjs.map +0 -1
- package/dist/client-BT1mFQas.d.mts +0 -447
- package/dist/client-Nn0q4eO4.d.ts +0 -447
- package/dist/client-cache-CIlyBlmx.d.ts +0 -6
- package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
- package/dist/client-plugins-Cw4qUGsw.d.ts +0 -1855
- package/dist/client-plugins-DQQ1adXM.d.mts +0 -1855
- package/dist/client-plugins.cjs +0 -415
- package/dist/client-plugins.cjs.map +0 -1
- package/dist/client-plugins.d.mts +0 -22
- package/dist/client-plugins.d.ts +0 -22
- package/dist/client-plugins.mjs +0 -10
- package/dist/client-plugins.mjs.map +0 -1
- package/dist/client.cjs +0 -5402
- package/dist/client.cjs.map +0 -1
- package/dist/client.d.mts +0 -447
- package/dist/client.d.ts +0 -447
- package/dist/client.mjs +0 -110
- package/dist/client.mjs.map +0 -1
- package/dist/config.cjs +0 -38
- package/dist/config.cjs.map +0 -1
- package/dist/config.d.mts +0 -29
- package/dist/config.d.ts +0 -29
- package/dist/config.mjs +0 -10
- package/dist/config.mjs.map +0 -1
- package/dist/cron.cjs +0 -406
- package/dist/cron.cjs.map +0 -1
- package/dist/cron.d.mts +0 -78
- package/dist/cron.d.ts +0 -78
- package/dist/cron.mjs +0 -30
- package/dist/cron.mjs.map +0 -1
- package/dist/deferred.cjs +0 -438
- package/dist/deferred.cjs.map +0 -1
- package/dist/deferred.d.mts +0 -42
- package/dist/deferred.d.ts +0 -42
- package/dist/deferred.mjs +0 -28
- package/dist/deferred.mjs.map +0 -1
- package/dist/deployment.cjs +0 -199
- package/dist/deployment.cjs.map +0 -1
- package/dist/deployment.d.mts +0 -34
- package/dist/deployment.d.ts +0 -34
- package/dist/deployment.mjs +0 -38
- package/dist/deployment.mjs.map +0 -1
- package/dist/devtools-LVC3VB5P.mjs +0 -370
- package/dist/devtools-LVC3VB5P.mjs.map +0 -1
- package/dist/devtools-client-3XRTBND5.mjs +0 -216
- package/dist/devtools-client-3XRTBND5.mjs.map +0 -1
- package/dist/devtools-ui-NJKFORTG.mjs +0 -1349
- package/dist/devtools-ui-NJKFORTG.mjs.map +0 -1
- package/dist/docs.cjs +0 -5553
- package/dist/docs.cjs.map +0 -1
- package/dist/docs.d.mts +0 -69
- package/dist/docs.d.ts +0 -69
- package/dist/docs.mjs +0 -46
- package/dist/docs.mjs.map +0 -1
- package/dist/env-types.cjs +0 -223
- package/dist/env-types.cjs.map +0 -1
- package/dist/env-types.d.mts +0 -11
- package/dist/env-types.d.ts +0 -11
- package/dist/env-types.mjs +0 -9
- package/dist/env-types.mjs.map +0 -1
- package/dist/env.cjs +0 -215
- package/dist/env.cjs.map +0 -1
- package/dist/env.d.mts +0 -45
- package/dist/env.d.ts +0 -45
- package/dist/env.mjs +0 -22
- package/dist/env.mjs.map +0 -1
- package/dist/environment/vite.d.mts +0 -22
- package/dist/environment/vite.d.ts +0 -22
- package/dist/environment.cjs +0 -96
- package/dist/environment.cjs.map +0 -1
- package/dist/environment.d.mts +0 -18
- package/dist/environment.d.ts +0 -18
- package/dist/environment.mjs +0 -14
- package/dist/environment.mjs.map +0 -1
- package/dist/headers.cjs +0 -126
- package/dist/headers.cjs.map +0 -1
- package/dist/headers.d.mts +0 -22
- package/dist/headers.d.ts +0 -22
- package/dist/headers.mjs +0 -12
- package/dist/headers.mjs.map +0 -1
- package/dist/i18n/client.d.mts +0 -32
- package/dist/i18n/client.d.ts +0 -32
- package/dist/i18n/index.d.mts +0 -20
- package/dist/i18n/index.d.ts +0 -20
- package/dist/i18n/server.d.mts +0 -30
- package/dist/i18n/server.d.ts +0 -30
- package/dist/image/server.d.mts +0 -37
- package/dist/image/server.d.ts +0 -37
- package/dist/image/sharp.d.mts +0 -7
- package/dist/image/sharp.d.ts +0 -7
- package/dist/image-config-Duob7wER.d.mts +0 -50
- package/dist/image-config-Duob7wER.d.ts +0 -50
- package/dist/image.cjs +0 -209
- package/dist/image.cjs.map +0 -1
- package/dist/image.d.mts +0 -39
- package/dist/image.d.ts +0 -39
- package/dist/image.mjs +0 -165
- package/dist/image.mjs.map +0 -1
- package/dist/index.cjs +0 -41822
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.mts +0 -451
- package/dist/index.d.ts +0 -451
- package/dist/index.mjs +0 -973
- package/dist/index.mjs.map +0 -1
- package/dist/integration-api-CHT2OKAf.d.mts +0 -93
- package/dist/integration-api-CHT2OKAf.d.ts +0 -93
- package/dist/integration-orm-GQLGU66X.mjs +0 -13
- package/dist/integration-orm-GQLGU66X.mjs.map +0 -1
- package/dist/integrations.cjs +0 -2820
- package/dist/integrations.cjs.map +0 -1
- package/dist/integrations.d.mts +0 -22
- package/dist/integrations.d.ts +0 -22
- package/dist/integrations.mjs +0 -51
- package/dist/integrations.mjs.map +0 -1
- package/dist/internal/build-runtime.d.mts +0 -39
- package/dist/internal/build-runtime.d.ts +0 -39
- package/dist/internal/client-runtime.d.mts +0 -2
- package/dist/internal/client-runtime.d.ts +0 -2
- package/dist/internal/config-runtime.d.mts +0 -39
- package/dist/internal/config-runtime.d.ts +0 -39
- package/dist/internal/production-node-env.d.mts +0 -12
- package/dist/internal/production-node-env.d.ts +0 -12
- package/dist/internal/production-runtime.d.mts +0 -39
- package/dist/internal/production-runtime.d.ts +0 -39
- package/dist/layers-VWVDTPUZ.mjs +0 -16
- package/dist/layers-VWVDTPUZ.mjs.map +0 -1
- package/dist/manager-THKFTOFE.mjs +0 -10
- package/dist/manager-THKFTOFE.mjs.map +0 -1
- package/dist/markdown.cjs +0 -299
- package/dist/markdown.cjs.map +0 -1
- package/dist/markdown.d.mts +0 -43
- package/dist/markdown.d.ts +0 -43
- package/dist/markdown.mjs +0 -14
- package/dist/markdown.mjs.map +0 -1
- package/dist/metadata-BAPg_Nmo.d.ts +0 -22
- package/dist/metadata-_6i9oFG3.d.mts +0 -22
- package/dist/middleware.cjs +0 -2148
- package/dist/middleware.cjs.map +0 -1
- package/dist/middleware.d.mts +0 -164
- package/dist/middleware.d.ts +0 -164
- package/dist/middleware.mjs +0 -49
- package/dist/middleware.mjs.map +0 -1
- package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
- package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
- package/dist/navigation.cjs +0 -1329
- package/dist/navigation.cjs.map +0 -1
- package/dist/navigation.d.mts +0 -14
- package/dist/navigation.d.ts +0 -14
- package/dist/navigation.mjs +0 -33
- package/dist/navigation.mjs.map +0 -1
- package/dist/nitro-QO5LV6QK.mjs +0 -689
- package/dist/nitro-QO5LV6QK.mjs.map +0 -1
- package/dist/observability.cjs +0 -186
- package/dist/observability.cjs.map +0 -1
- package/dist/observability.d.mts +0 -335
- package/dist/observability.d.ts +0 -335
- package/dist/observability.mjs +0 -16
- package/dist/observability.mjs.map +0 -1
- package/dist/params-BALtrRim.d.ts +0 -15
- package/dist/params-ry-lxqmy.d.mts +0 -15
- package/dist/plugin-BJDf43dc.d.mts +0 -165
- package/dist/plugin-BJDf43dc.d.ts +0 -165
- package/dist/plugin.cjs +0 -23225
- package/dist/plugin.d.mts +0 -22
- package/dist/plugin.d.ts +0 -22
- package/dist/production-runtime-BoJDc5mc.d.ts +0 -79
- package/dist/production-runtime-C_B79w2P.d.mts +0 -28
- package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
- package/dist/production-runtime-DPfgMV9Y.d.mts +0 -79
- package/dist/query/client.d.mts +0 -61
- package/dist/query/client.d.ts +0 -61
- package/dist/query/index.d.mts +0 -90
- package/dist/query/index.d.ts +0 -90
- package/dist/query/parsers.d.mts +0 -25
- package/dist/query/parsers.d.ts +0 -25
- package/dist/query/server.d.mts +0 -55
- package/dist/query/server.d.ts +0 -55
- package/dist/request-BrFBuc8G.d.mts +0 -6
- package/dist/request-BslSZIRz.d.ts +0 -6
- package/dist/request.d.mts +0 -2
- package/dist/request.d.ts +0 -2
- package/dist/resolver-C6iecsDV.d.ts +0 -14
- package/dist/resolver-DlOPpjkB.d.mts +0 -14
- package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
- package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
- package/dist/router.d.mts +0 -36
- package/dist/router.d.ts +0 -36
- package/dist/routes.d.mts +0 -224
- package/dist/routes.d.ts +0 -224
- package/dist/runtime-9nQjVM7X.d.mts +0 -206
- package/dist/runtime-B6GvwDS1.d.ts +0 -27
- package/dist/runtime-DeAAZ6gO.d.mts +0 -27
- package/dist/runtime-DgeS2skB.d.ts +0 -206
- package/dist/server-action-security.d.mts +0 -43
- package/dist/server-action-security.d.ts +0 -43
- package/dist/server-fn-client.d.mts +0 -32
- package/dist/server-fn-client.d.ts +0 -32
- package/dist/server-fn.d.mts +0 -93
- package/dist/server-fn.d.ts +0 -93
- package/dist/server-plugins.d.mts +0 -55
- package/dist/server-plugins.d.ts +0 -55
- package/dist/server-query-client.d.mts +0 -50
- package/dist/server-query-client.d.ts +0 -50
- package/dist/server-query.d.mts +0 -36
- package/dist/server-query.d.ts +0 -36
- package/dist/server.d.mts +0 -48
- package/dist/server.d.ts +0 -48
- package/dist/storage.d.mts +0 -52
- package/dist/storage.d.ts +0 -52
- package/dist/testing.d.mts +0 -101
- package/dist/testing.d.ts +0 -101
- package/dist/transport-BmbGTXA5.d.mts +0 -49
- package/dist/transport-BmbGTXA5.d.ts +0 -49
- package/dist/types-BH1lhg5G.d.mts +0 -81
- package/dist/types-BH1lhg5G.d.ts +0 -81
- package/dist/types-C9N-nk5R.d.mts +0 -53
- package/dist/types-C9N-nk5R.d.ts +0 -53
- package/dist/types-D1A6-XvH.d.mts +0 -73
- package/dist/types-D1A6-XvH.d.ts +0 -73
- package/dist/utils-CHXlMDkg.d.mts +0 -23
- package/dist/utils-Drsyz1Vj.d.ts +0 -23
- package/dist/version.d.mts +0 -3
- package/dist/version.d.ts +0 -3
- package/dist/vite.d.mts +0 -22
- package/dist/vite.d.ts +0 -22
- package/dist/workflows.d.mts +0 -110
- package/dist/workflows.d.ts +0 -110
|
@@ -1,1855 +0,0 @@
|
|
|
1
|
-
import { n as FarmClientPlugin } from './plugin-BJDf43dc.mjs';
|
|
2
|
-
import React__default, { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
-
import { k as FarmStorageUserConfig } from './types-D1A6-XvH.mjs';
|
|
5
|
-
import { F as FarmIntegrationAPI, f as FarmIntegrationAPIMethod, e as FarmIntegrationAPIBodyFormat, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, h as FarmIntegrationRouteOperationCarrier, I as InferIntegrationAPIFromRoutes } from './integration-api-CHT2OKAf.mjs';
|
|
6
|
-
import { OrmClient, SchemaDefinition, ModelDefinition, FieldBuilder, JsonValue, AnyModelDefinition, SchemaModels } from '@farming-labs/orm';
|
|
7
|
-
import { a as FarmDocsUserConfig, F as FarmDocsResolvedConfig } from './types-C9N-nk5R.mjs';
|
|
8
|
-
import { FarmMarkdownUserConfig, FarmMarkdownResolvedConfig } from './markdown.mjs';
|
|
9
|
-
import { FarmObservabilityUserConfig } from './observability.mjs';
|
|
10
|
-
import * as vite from 'vite';
|
|
11
|
-
import { ViteDevServer, UserConfig, Plugin } from 'vite';
|
|
12
|
-
import { FarmWorkflowsUserConfig, FarmWorkflowsResolvedConfig } from './workflows.mjs';
|
|
13
|
-
import { FarmCronUserConfig, FarmCronResolvedConfig } from './cron.mjs';
|
|
14
|
-
import { FarmEnvConfig, ResolvedFarmEnv } from './env.mjs';
|
|
15
|
-
import { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from './server-action-security.mjs';
|
|
16
|
-
import { F as FarmImageConfig, R as ResolvedFarmImageConfig } from './image-config-Duob7wER.mjs';
|
|
17
|
-
import { k as FarmI18nUserConfig, R as ResolvedFarmI18nConfig } from './types-BH1lhg5G.mjs';
|
|
18
|
-
import { FarmCacheUserConfig } from './cache.mjs';
|
|
19
|
-
import { F as FarmRouteRuntimeConfig, a as FarmRouteRuntime, b as FarmRouteRegions, c as FarmRouteMaxDuration } from './route-runtime-DoOHzCAD.mjs';
|
|
20
|
-
|
|
21
|
-
type RuntimeClientFactory<TClient> = () => TClient | Promise<TClient>;
|
|
22
|
-
type FarmIntegrationOrmSchema = SchemaDefinition<Record<string, AnyModelDefinition>>;
|
|
23
|
-
type FarmIntegrationOrmClient<TSchema extends FarmIntegrationOrmSchema> = OrmClient<TSchema>;
|
|
24
|
-
type FarmIntegrationOrmFieldKind<TField extends FarmIntegrationSchemaField> = TField["type"] extends "id" | "uuid" ? "id" : TField["type"] extends "text" ? "string" : TField["type"] extends "number" ? "decimal" : Extract<TField["type"], "string" | "boolean" | "integer" | "datetime" | "json" | "enum">;
|
|
25
|
-
type FarmIntegrationOrmFieldNullable<TField extends FarmIntegrationSchemaField> = TField extends {
|
|
26
|
-
nullable: true;
|
|
27
|
-
} ? true : TField extends {
|
|
28
|
-
required: false;
|
|
29
|
-
} ? true : false;
|
|
30
|
-
type FarmIntegrationOrmEnumValue<TField extends FarmIntegrationSchemaField> = TField extends {
|
|
31
|
-
values: readonly (infer TValue extends string)[];
|
|
32
|
-
} ? TValue : string;
|
|
33
|
-
type FarmIntegrationOrmFieldValue<TField extends FarmIntegrationSchemaField> = TField["type"] extends "id" | "uuid" | "string" | "text" ? string : TField["type"] extends "boolean" ? boolean : TField["type"] extends "integer" ? number : TField["type"] extends "number" ? string : TField["type"] extends "datetime" ? Date : TField["type"] extends "json" ? JsonValue : TField["type"] extends "enum" ? FarmIntegrationOrmEnumValue<TField> : never;
|
|
34
|
-
type InferFarmIntegrationOrmField<TField extends FarmIntegrationSchemaField> = FieldBuilder<FarmIntegrationOrmFieldKind<TField>, FarmIntegrationOrmFieldNullable<TField>, FarmIntegrationOrmFieldValue<TField>>;
|
|
35
|
-
type InferFarmIntegrationOrmFields<TModel extends FarmIntegrationSchemaModel> = {
|
|
36
|
-
[TFieldKey in keyof TModel["fields"] & string]: InferFarmIntegrationOrmField<Extract<TModel["fields"][TFieldKey], FarmIntegrationSchemaField>>;
|
|
37
|
-
};
|
|
38
|
-
type InferFarmIntegrationOrmSchema<TSchema extends FarmIntegrationSchema> = SchemaDefinition<{
|
|
39
|
-
[TModelKey in keyof TSchema["models"] & string]: ModelDefinition<InferFarmIntegrationOrmFields<Extract<TSchema["models"][TModelKey], FarmIntegrationSchemaModel>>, {}>;
|
|
40
|
-
}>;
|
|
41
|
-
type InferFarmIntegrationOrmClient<TSchema extends FarmIntegrationSchema | undefined> = TSchema extends FarmIntegrationSchema ? OrmClient<InferFarmIntegrationOrmSchema<TSchema>> : never;
|
|
42
|
-
interface CreateIntegrationOrmOptions<TClient = unknown, TSchema extends FarmIntegrationSchema = FarmIntegrationSchema> {
|
|
43
|
-
schema: TSchema;
|
|
44
|
-
config?: Pick<FarmConfig, "storage">;
|
|
45
|
-
storage?: FarmStorageUserConfig;
|
|
46
|
-
client?: TClient | RuntimeClientFactory<TClient>;
|
|
47
|
-
}
|
|
48
|
-
declare function createIntegrationOrm<TClient = unknown, TSchema extends FarmIntegrationSchema = FarmIntegrationSchema>(options: CreateIntegrationOrmOptions<TClient, TSchema>): Promise<InferFarmIntegrationOrmClient<TSchema>>;
|
|
49
|
-
declare function resolveIntegrationOrmRuntimeClient<TClient = unknown>(options: Omit<CreateIntegrationOrmOptions<TClient>, "schema">): Promise<TClient | unknown | undefined>;
|
|
50
|
-
declare function farmIntegrationSchemaToOrmSchema(schema: FarmIntegrationSchema): Promise<FarmIntegrationOrmSchema>;
|
|
51
|
-
type IntegrationOrmModelNames<TSchema extends FarmIntegrationOrmSchema> = keyof SchemaModels<TSchema> & string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Farm.js Middleware System
|
|
55
|
-
*
|
|
56
|
-
* Type definitions for the middleware system
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Next function type for middleware chain
|
|
61
|
-
*/
|
|
62
|
-
type MiddlewareResult = void | Response;
|
|
63
|
-
type NextFunction = () => Promise<MiddlewareResult>;
|
|
64
|
-
type MiddlewareStoreKey<TValues extends Record<string, any>> = Extract<keyof TValues, string>;
|
|
65
|
-
/**
|
|
66
|
-
* A typed view over the request-scoped maps used by middleware.
|
|
67
|
-
*/
|
|
68
|
-
interface ReadonlyMiddlewareStore<TValues extends Record<string, any> = Record<string, any>> {
|
|
69
|
-
readonly size: number;
|
|
70
|
-
get<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): TValues[TKey] | undefined;
|
|
71
|
-
has<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): boolean;
|
|
72
|
-
entries(): IterableIterator<[MiddlewareStoreKey<TValues>, TValues[MiddlewareStoreKey<TValues>]]>;
|
|
73
|
-
keys(): IterableIterator<MiddlewareStoreKey<TValues>>;
|
|
74
|
-
values(): IterableIterator<TValues[MiddlewareStoreKey<TValues>]>;
|
|
75
|
-
forEach(callback: (value: TValues[MiddlewareStoreKey<TValues>], key: MiddlewareStoreKey<TValues>, store: ReadonlyMiddlewareStore<TValues>) => void, thisArg?: any): void;
|
|
76
|
-
[Symbol.iterator](): IterableIterator<[
|
|
77
|
-
MiddlewareStoreKey<TValues>,
|
|
78
|
-
TValues[MiddlewareStoreKey<TValues>]
|
|
79
|
-
]>;
|
|
80
|
-
}
|
|
81
|
-
interface MiddlewareStore<TValues extends Record<string, any> = Record<string, any>> extends ReadonlyMiddlewareStore<TValues> {
|
|
82
|
-
clear(): void;
|
|
83
|
-
delete<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): boolean;
|
|
84
|
-
set<TKey extends MiddlewareStoreKey<TValues>>(key: TKey, value: TValues[TKey]): this;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Middleware function signature
|
|
88
|
-
*/
|
|
89
|
-
type MiddlewareFunction = (ctx: MiddlewareContext, next: NextFunction) => MiddlewareResult | Promise<MiddlewareResult>;
|
|
90
|
-
/**
|
|
91
|
-
* Context passed to a named, request-first middleware export.
|
|
92
|
-
* `locals` and the get/set helpers stay on the server. `data` can be exposed
|
|
93
|
-
* through page props and should contain only serializable, client-safe values.
|
|
94
|
-
*/
|
|
95
|
-
interface RequestMiddlewareContext<TLocals extends Record<string, any> = Record<string, any>, TData extends Record<string, any> = Record<string, any>> {
|
|
96
|
-
readonly url: URL;
|
|
97
|
-
readonly pathname: string;
|
|
98
|
-
readonly searchParams: URLSearchParams;
|
|
99
|
-
readonly method: string;
|
|
100
|
-
readonly params: Record<string, string>;
|
|
101
|
-
readonly route: string;
|
|
102
|
-
readonly locals: MiddlewareStore<TLocals>;
|
|
103
|
-
readonly data: MiddlewareStore<TData>;
|
|
104
|
-
readonly headers: Map<string, string>;
|
|
105
|
-
readonly cookies: CookieJar;
|
|
106
|
-
get<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): TLocals[TKey] | undefined;
|
|
107
|
-
has<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): boolean;
|
|
108
|
-
set<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey, value: TLocals[TKey]): void;
|
|
109
|
-
delete<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): boolean;
|
|
110
|
-
redirect(url: string, status?: number): void;
|
|
111
|
-
rewrite(url: string): void;
|
|
112
|
-
json(data: any, status?: number): void;
|
|
113
|
-
text(content: string, status?: number): void;
|
|
114
|
-
html(content: string, status?: number): void;
|
|
115
|
-
}
|
|
116
|
-
type RequestMiddleware<TLocals extends Record<string, any> = Record<string, any>, TData extends Record<string, any> = Record<string, any>> = (request: Request, context: RequestMiddlewareContext<TLocals, TData>) => MiddlewareResult | Promise<MiddlewareResult>;
|
|
117
|
-
/**
|
|
118
|
-
* Cookie options
|
|
119
|
-
*/
|
|
120
|
-
interface CookieOptions {
|
|
121
|
-
maxAge?: number;
|
|
122
|
-
expires?: Date;
|
|
123
|
-
path?: string;
|
|
124
|
-
domain?: string;
|
|
125
|
-
secure?: boolean;
|
|
126
|
-
httpOnly?: boolean;
|
|
127
|
-
sameSite?: "strict" | "lax" | "none";
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Cookie management interface
|
|
131
|
-
*/
|
|
132
|
-
interface CookieJar {
|
|
133
|
-
get(name: string): string | undefined;
|
|
134
|
-
set(name: string, value: string, options?: CookieOptions): void;
|
|
135
|
-
delete(name: string): void;
|
|
136
|
-
getAll(): Record<string, string>;
|
|
137
|
-
}
|
|
138
|
-
interface RateLimitStorage {
|
|
139
|
-
get(key: string): Promise<any> | any;
|
|
140
|
-
set(key: string, value: any, ttl?: number): Promise<void> | void;
|
|
141
|
-
delete(key: string): Promise<void> | void;
|
|
142
|
-
ttl?(key: string): Promise<number | null> | number | null;
|
|
143
|
-
}
|
|
144
|
-
interface RateLimitConfig {
|
|
145
|
-
requests: number;
|
|
146
|
-
window: string;
|
|
147
|
-
keyGenerator?: (ctx: MiddlewareContext) => string;
|
|
148
|
-
onLimit?: (ctx: MiddlewareContext) => void | Response | Promise<void | Response>;
|
|
149
|
-
storage?: RateLimitStorage;
|
|
150
|
-
}
|
|
151
|
-
interface RateLimitStatus {
|
|
152
|
-
requests: number;
|
|
153
|
-
limit: number;
|
|
154
|
-
remaining: number;
|
|
155
|
-
resetIn: number | null;
|
|
156
|
-
resetAt: Date | null;
|
|
157
|
-
isLimited: boolean;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Middleware configuration
|
|
161
|
-
*/
|
|
162
|
-
type MiddlewareMatcher = string | RegExp | ((ctx: MiddlewareContext) => boolean);
|
|
163
|
-
interface MiddlewareConfig$1 {
|
|
164
|
-
matcher?: MiddlewareMatcher | MiddlewareMatcher[];
|
|
165
|
-
exclude?: (string | RegExp)[];
|
|
166
|
-
runtime?: "nodejs" | "edge";
|
|
167
|
-
}
|
|
168
|
-
interface MiddlewareConfigEntry extends MiddlewareConfig$1 {
|
|
169
|
-
handler?: MiddlewareFunction;
|
|
170
|
-
handlers?: MiddlewareFunction[];
|
|
171
|
-
}
|
|
172
|
-
type FarmMiddlewareConfig = MiddlewareConfig$1 | MiddlewareConfigEntry | MiddlewareConfigEntry[];
|
|
173
|
-
/**
|
|
174
|
-
* Middleware context - the main object passed to middleware functions
|
|
175
|
-
*/
|
|
176
|
-
interface MiddlewareContext {
|
|
177
|
-
request: IncomingMessage;
|
|
178
|
-
response: ServerResponse;
|
|
179
|
-
url: URL;
|
|
180
|
-
pathname: string;
|
|
181
|
-
searchParams: URLSearchParams;
|
|
182
|
-
method: string;
|
|
183
|
-
params: Record<string, string>;
|
|
184
|
-
route: string;
|
|
185
|
-
parent?: {
|
|
186
|
-
data: Map<string, any>;
|
|
187
|
-
locals?: Map<string, any>;
|
|
188
|
-
headers: Record<string, string>;
|
|
189
|
-
};
|
|
190
|
-
vite: {
|
|
191
|
-
isDev: boolean;
|
|
192
|
-
hmr: boolean;
|
|
193
|
-
server?: ViteDevServer;
|
|
194
|
-
};
|
|
195
|
-
data: Map<string, any>;
|
|
196
|
-
locals: Map<string, any>;
|
|
197
|
-
headers: Map<string, string>;
|
|
198
|
-
cookies: CookieJar;
|
|
199
|
-
_handled: boolean;
|
|
200
|
-
_redirectUrl?: string;
|
|
201
|
-
_rewriteUrl?: string;
|
|
202
|
-
redirect(url: string, status?: number): void;
|
|
203
|
-
rewrite(url: string): void;
|
|
204
|
-
json(data: any, status?: number): void;
|
|
205
|
-
text(content: string, status?: number): void;
|
|
206
|
-
html(content: string, status?: number): void;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Middleware chain interface
|
|
210
|
-
*/
|
|
211
|
-
interface MiddlewareChain {
|
|
212
|
-
use(fn: MiddlewareFunction): MiddlewareChain;
|
|
213
|
-
/**
|
|
214
|
-
* Conditionally run middleware based on a condition.
|
|
215
|
-
* Supports boolean values or functions that evaluate to boolean.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* .when(true, (ctx, next) => { ... }) // Always run
|
|
219
|
-
* .when((ctx) => ctx.data.get('flag'), (ctx, next) => { ... }) // Conditional
|
|
220
|
-
*/
|
|
221
|
-
when(condition: boolean | ((ctx: MiddlewareContext) => boolean), fn: MiddlewareFunction | ((chain: MiddlewareChain) => void)): MiddlewareChain;
|
|
222
|
-
rateLimit(config: RateLimitConfig): MiddlewareChain;
|
|
223
|
-
redirect(source: string, destination: string, permanent?: boolean): MiddlewareChain;
|
|
224
|
-
/**
|
|
225
|
-
* Rewrite the current route to a new destination.
|
|
226
|
-
* In route-specific middleware, this rewrites the middleware's route.
|
|
227
|
-
*
|
|
228
|
-
* @param destination - The destination path to rewrite to
|
|
229
|
-
* @param condition - Optional boolean or function that evaluates to boolean. If false, rewrite is skipped.
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* // In /contact/middleware.ts
|
|
233
|
-
* .rewrite('/about') // Always rewrites /contact to /about
|
|
234
|
-
* .rewrite('/about', true) // Always rewrites
|
|
235
|
-
* .rewrite('/about', false) // Never rewrites
|
|
236
|
-
* .rewrite('/about', (ctx) => ctx.data.get('shouldRewrite')) // Conditional rewrite
|
|
237
|
-
*/
|
|
238
|
-
rewrite(destination: string, condition?: boolean | ((ctx: MiddlewareContext) => boolean)): MiddlewareChain;
|
|
239
|
-
build(): {
|
|
240
|
-
handlers: MiddlewareFunction[];
|
|
241
|
-
config?: MiddlewareConfig$1;
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Middleware module export
|
|
246
|
-
*/
|
|
247
|
-
interface MiddlewareModule {
|
|
248
|
-
default?: MiddlewareChain | MiddlewareFunction;
|
|
249
|
-
middleware?: RequestMiddleware;
|
|
250
|
-
config?: MiddlewareConfig$1;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
type FarmMdxComponent = React__default.ComponentType<any> | keyof React__default.JSX.IntrinsicElements;
|
|
254
|
-
type FarmMdxComponents = Record<string, FarmMdxComponent>;
|
|
255
|
-
interface FarmMdxUserConfig {
|
|
256
|
-
/**
|
|
257
|
-
* Component map or module path that exports `components` or a default component map.
|
|
258
|
-
* Relative paths resolve from the project root.
|
|
259
|
-
*/
|
|
260
|
-
components?: string | FarmMdxComponents;
|
|
261
|
-
/**
|
|
262
|
-
* Serve source-authored markdown pages at `/route.md`.
|
|
263
|
-
* Enabled by default for `page.md` and `page.mdx`.
|
|
264
|
-
*/
|
|
265
|
-
markdownRoutes?: boolean;
|
|
266
|
-
/**
|
|
267
|
-
* Class name used for the wrapper around rendered markdown content.
|
|
268
|
-
*/
|
|
269
|
-
className?: string;
|
|
270
|
-
}
|
|
271
|
-
interface FarmMdxResolvedConfig {
|
|
272
|
-
components?: string | FarmMdxComponents;
|
|
273
|
-
markdownRoutes: boolean;
|
|
274
|
-
className: string;
|
|
275
|
-
}
|
|
276
|
-
interface FarmMarkdownPageSource {
|
|
277
|
-
source: string;
|
|
278
|
-
filePath: string;
|
|
279
|
-
}
|
|
280
|
-
interface FarmMarkdownPageModuleInput extends FarmMarkdownPageSource {
|
|
281
|
-
components?: FarmMdxComponents;
|
|
282
|
-
config?: FarmMdxResolvedConfig;
|
|
283
|
-
}
|
|
284
|
-
declare function resolveMdxConfig(config: FarmMdxUserConfig | undefined): FarmMdxResolvedConfig;
|
|
285
|
-
declare function isFarmMarkdownPageFile(filePath: string): boolean;
|
|
286
|
-
declare function normalizeFarmMarkdownRoutePath(pathname: string): string;
|
|
287
|
-
declare function parseMarkdownFrontmatter(source: string): {
|
|
288
|
-
frontmatter: Record<string, string>;
|
|
289
|
-
body: string;
|
|
290
|
-
};
|
|
291
|
-
declare function titleFromMarkdown(body: string, fallback?: string): string | undefined;
|
|
292
|
-
declare function createMarkdownMetadata(source: string, filePath: string): (Metadata & Record<string, any>) | undefined;
|
|
293
|
-
declare function createFarmMarkdownRouteModule(input: FarmMarkdownPageModuleInput): RouteModule & {
|
|
294
|
-
source: string;
|
|
295
|
-
};
|
|
296
|
-
declare function createFarmMarkdownRouteModuleFromFile(filePath: string, options?: {
|
|
297
|
-
components?: FarmMdxComponents;
|
|
298
|
-
config?: FarmMdxResolvedConfig;
|
|
299
|
-
}): Promise<RouteModule & {
|
|
300
|
-
source: string;
|
|
301
|
-
}>;
|
|
302
|
-
declare function loadFarmMdxComponents(config: FarmMdxResolvedConfig | undefined, options: {
|
|
303
|
-
root: string;
|
|
304
|
-
loadModule?: (modulePath: string) => Promise<unknown>;
|
|
305
|
-
}): Promise<FarmMdxComponents>;
|
|
306
|
-
declare function createFarmMarkdownSourceResponse(options: {
|
|
307
|
-
request: Request;
|
|
308
|
-
config?: FarmMdxResolvedConfig;
|
|
309
|
-
resolveSource: (pathname: string) => Promise<FarmMarkdownPageSource | null> | FarmMarkdownPageSource | null;
|
|
310
|
-
}): Promise<Response | null>;
|
|
311
|
-
|
|
312
|
-
type FarmRouteRuleRenderMode = "static" | "dynamic";
|
|
313
|
-
type FarmRouteRuleRedirect = string | {
|
|
314
|
-
to: string;
|
|
315
|
-
statusCode?: number;
|
|
316
|
-
permanent?: boolean;
|
|
317
|
-
};
|
|
318
|
-
type FarmRouteRuleCors = boolean | {
|
|
319
|
-
origin?: string;
|
|
320
|
-
methods?: string | readonly string[];
|
|
321
|
-
headers?: string | readonly string[];
|
|
322
|
-
};
|
|
323
|
-
interface FarmRouteRule extends FarmRouteRuntimeConfig {
|
|
324
|
-
prerender?: boolean;
|
|
325
|
-
render?: FarmRouteRuleRenderMode;
|
|
326
|
-
ssr?: boolean;
|
|
327
|
-
swr?: boolean | number;
|
|
328
|
-
isr?: boolean | number;
|
|
329
|
-
cors?: FarmRouteRuleCors;
|
|
330
|
-
headers?: Record<string, string>;
|
|
331
|
-
redirect?: FarmRouteRuleRedirect;
|
|
332
|
-
}
|
|
333
|
-
type FarmRouteRules = Record<string, FarmRouteRule>;
|
|
334
|
-
declare function normalizeRouteRules(routeRules: FarmRouteRules | undefined): FarmRouteRules;
|
|
335
|
-
declare function routeRulesToRedirects(routeRules: FarmRouteRules): RedirectConfig[];
|
|
336
|
-
declare function routeRulesToHeaders(routeRules: FarmRouteRules): HeaderConfig[];
|
|
337
|
-
declare function routeRulesToNitroRouteRules(routeRules: FarmRouteRules): Record<string, any>;
|
|
338
|
-
|
|
339
|
-
type FarmLayerEntry = string;
|
|
340
|
-
interface ResolvedFarmLayer {
|
|
341
|
-
/** The value used in `extends`. */
|
|
342
|
-
source: string;
|
|
343
|
-
/** Stable name used by the `#layers/<name>` alias. */
|
|
344
|
-
name: string;
|
|
345
|
-
/** Absolute layer package or directory root. */
|
|
346
|
-
root: string;
|
|
347
|
-
/** Source directory relative to the layer root. */
|
|
348
|
-
srcDir: string;
|
|
349
|
-
/** Resolved layer config file when one exists. */
|
|
350
|
-
configFile?: string;
|
|
351
|
-
}
|
|
352
|
-
interface FarmSourceRoot {
|
|
353
|
-
name: string;
|
|
354
|
-
root: string;
|
|
355
|
-
srcDir: string;
|
|
356
|
-
layer: boolean;
|
|
357
|
-
}
|
|
358
|
-
interface ResolveFarmLayersOptions {
|
|
359
|
-
root: string;
|
|
360
|
-
mode: "development" | "production";
|
|
361
|
-
}
|
|
362
|
-
interface FarmLayerResolution<TConfig extends Record<string, any>> {
|
|
363
|
-
config: TConfig & {
|
|
364
|
-
extends?: readonly FarmLayerEntry[];
|
|
365
|
-
layers: ResolvedFarmLayer[];
|
|
366
|
-
};
|
|
367
|
-
layers: ResolvedFarmLayer[];
|
|
368
|
-
}
|
|
369
|
-
declare function resolveFarmLayers<TConfig extends Record<string, any>>(projectConfig: TConfig, options: ResolveFarmLayersOptions): Promise<FarmLayerResolution<TConfig>>;
|
|
370
|
-
declare function getFarmSourceRoots(config: {
|
|
371
|
-
root?: string;
|
|
372
|
-
srcDir?: string;
|
|
373
|
-
layers?: readonly ResolvedFarmLayer[];
|
|
374
|
-
}): FarmSourceRoot[];
|
|
375
|
-
declare function getFarmAppDirectories(config: {
|
|
376
|
-
root?: string;
|
|
377
|
-
srcDir?: string;
|
|
378
|
-
layers?: readonly ResolvedFarmLayer[];
|
|
379
|
-
}): string[];
|
|
380
|
-
declare function getFarmLayerAliases(layers: readonly ResolvedFarmLayer[] | undefined): Record<string, string>;
|
|
381
|
-
declare function loadFarmConfigFile<TConfig = Record<string, any>>(configPath: string, options: {
|
|
382
|
-
root: string;
|
|
383
|
-
cacheRoot?: string;
|
|
384
|
-
}): Promise<TConfig>;
|
|
385
|
-
|
|
386
|
-
declare const DEFAULT_FARM_DEVTOOLS_SHORTCUT = "mod+shift+.";
|
|
387
|
-
declare const FARM_DEVTOOLS_PATH = "/__farm/devtools";
|
|
388
|
-
declare const FARM_DEVTOOLS_LAUNCH_PARAM = "__farm_devtools";
|
|
389
|
-
interface FarmDevtoolsConfig {
|
|
390
|
-
/** Enable the development-only DevTools UI and runtime endpoints. */
|
|
391
|
-
enabled?: boolean;
|
|
392
|
-
/** Keyboard shortcut used to toggle DevTools, or false to disable the shortcut. */
|
|
393
|
-
shortcut?: string | false;
|
|
394
|
-
}
|
|
395
|
-
type FarmDevtoolsUserConfig = boolean | FarmDevtoolsConfig;
|
|
396
|
-
interface ResolvedFarmDevtoolsConfig {
|
|
397
|
-
enabled: boolean;
|
|
398
|
-
shortcut: string | false;
|
|
399
|
-
}
|
|
400
|
-
declare function resolveFarmDevtoolsConfig(config: FarmDevtoolsUserConfig | ResolvedFarmDevtoolsConfig | undefined, mode?: "development" | "production"): ResolvedFarmDevtoolsConfig;
|
|
401
|
-
|
|
402
|
-
declare const FARM_RESOLVED_CUSTOM_CONTEXT: unique symbol;
|
|
403
|
-
|
|
404
|
-
interface RedirectConfig {
|
|
405
|
-
source: string;
|
|
406
|
-
destination: string;
|
|
407
|
-
permanent?: boolean;
|
|
408
|
-
statusCode?: number;
|
|
409
|
-
}
|
|
410
|
-
interface HeaderConfig {
|
|
411
|
-
source: string;
|
|
412
|
-
headers: Array<{
|
|
413
|
-
key: string;
|
|
414
|
-
value: string;
|
|
415
|
-
}>;
|
|
416
|
-
}
|
|
417
|
-
interface RewriteConfig {
|
|
418
|
-
source: string;
|
|
419
|
-
destination: string;
|
|
420
|
-
}
|
|
421
|
-
/** @deprecated Use FarmImageConfig. */
|
|
422
|
-
type ImageConfig = FarmImageConfig;
|
|
423
|
-
/** @deprecated Use FarmI18nUserConfig. */
|
|
424
|
-
type I18nConfig = FarmI18nUserConfig;
|
|
425
|
-
interface OpenAPIConfig {
|
|
426
|
-
enabled?: boolean;
|
|
427
|
-
route?: string;
|
|
428
|
-
title?: string;
|
|
429
|
-
description?: string;
|
|
430
|
-
version?: string;
|
|
431
|
-
servers?: Array<{
|
|
432
|
-
url: string;
|
|
433
|
-
description?: string;
|
|
434
|
-
}>;
|
|
435
|
-
contact?: {
|
|
436
|
-
name?: string;
|
|
437
|
-
email?: string;
|
|
438
|
-
url?: string;
|
|
439
|
-
};
|
|
440
|
-
license?: {
|
|
441
|
-
name: string;
|
|
442
|
-
url?: string;
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
type MiddlewareConfig = FarmMiddlewareConfig;
|
|
446
|
-
interface NotFoundConfig {
|
|
447
|
-
/** Path to a custom 404 page component (e.g., "./src/app/not-found.tsx") */
|
|
448
|
-
component?: string;
|
|
449
|
-
}
|
|
450
|
-
type FarmDeployTarget = "vercel" | "cloudflare" | "netlify" | "node" | string;
|
|
451
|
-
interface FarmDeployConfig {
|
|
452
|
-
/**
|
|
453
|
-
* Deployment platform. When present, Farm picks the matching Nitro preset and
|
|
454
|
-
* output directory unless explicitly overridden.
|
|
455
|
-
*/
|
|
456
|
-
target?: FarmDeployTarget;
|
|
457
|
-
/** Nitro preset override. Usually inferred from target. */
|
|
458
|
-
preset?: FarmConfig["preset"];
|
|
459
|
-
/** Deployable output directory, relative to project root unless absolute. */
|
|
460
|
-
outputDir?: string;
|
|
461
|
-
/** Alias for outputDir for terser config. */
|
|
462
|
-
output?: string;
|
|
463
|
-
/** Cloudflare Pages project name used by `farm deploy --cloudflare`. */
|
|
464
|
-
projectName?: string;
|
|
465
|
-
vercel?: {
|
|
466
|
-
outputDirectory?: string;
|
|
467
|
-
buildCommand?: string;
|
|
468
|
-
installCommand?: string;
|
|
469
|
-
framework?: string | null;
|
|
470
|
-
};
|
|
471
|
-
cloudflare?: {
|
|
472
|
-
outputDir?: string;
|
|
473
|
-
projectName?: string;
|
|
474
|
-
};
|
|
475
|
-
netlify?: {
|
|
476
|
-
outputDir?: string;
|
|
477
|
-
site?: string;
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
interface ResolvedFarmDeployConfig extends Omit<FarmDeployConfig, "output"> {
|
|
481
|
-
target?: FarmDeployTarget;
|
|
482
|
-
preset: FarmConfig["preset"];
|
|
483
|
-
outputDir: string;
|
|
484
|
-
}
|
|
485
|
-
interface FarmUserConfig extends Omit<FarmConfig, "vite" | "docs" | "env" | "layers"> {
|
|
486
|
-
/** Reusable Farm directories or installed packages, applied from left to right. */
|
|
487
|
-
extends?: readonly FarmLayerEntry[];
|
|
488
|
-
plugins?: FarmPlugin[];
|
|
489
|
-
integrations?: FarmIntegrationsUserConfig;
|
|
490
|
-
/** Shared application data, route, ISR, and PPR cache. */
|
|
491
|
-
cache?: FarmCacheUserConfig;
|
|
492
|
-
migrations?: FarmMigrationsUserConfig;
|
|
493
|
-
/** Map portable cron schedules to ordinary GET API routes. */
|
|
494
|
-
cron?: FarmCronUserConfig | FarmCronResolvedConfig | false;
|
|
495
|
-
workflows?: FarmWorkflowsUserConfig | boolean;
|
|
496
|
-
preset?: FarmConfig["preset"];
|
|
497
|
-
deploy?: FarmDeployConfig;
|
|
498
|
-
docs?: FarmDocsUserConfig;
|
|
499
|
-
md?: FarmMarkdownUserConfig | boolean;
|
|
500
|
-
mdx?: FarmMdxUserConfig;
|
|
501
|
-
observability?: FarmObservabilityUserConfig;
|
|
502
|
-
trailingSlash?: boolean;
|
|
503
|
-
redirects?: () => Promise<RedirectConfig[]> | RedirectConfig[];
|
|
504
|
-
rewrites?: () => Promise<RewriteConfig[]> | RewriteConfig[];
|
|
505
|
-
headers?: () => Promise<HeaderConfig[]> | HeaderConfig[];
|
|
506
|
-
images?: ImageConfig;
|
|
507
|
-
publicDir?: string;
|
|
508
|
-
i18n?: FarmI18nUserConfig | false;
|
|
509
|
-
openapi?: OpenAPIConfig;
|
|
510
|
-
middleware?: FarmMiddlewareConfig;
|
|
511
|
-
routeRules?: FarmRouteRules;
|
|
512
|
-
context?: FarmConfig["context"];
|
|
513
|
-
serverActions?: FarmServerActionsConfig;
|
|
514
|
-
/** Build identifier used to detect and recover from deployment version skew. */
|
|
515
|
-
deploymentId?: string;
|
|
516
|
-
notFound?: NotFoundConfig;
|
|
517
|
-
output?: "standalone" | "static" | "export";
|
|
518
|
-
distDir?: string;
|
|
519
|
-
generateBuildId?: () => string | Promise<string>;
|
|
520
|
-
compress?: boolean;
|
|
521
|
-
devIndicators?: {
|
|
522
|
-
buildActivity?: boolean;
|
|
523
|
-
buildActivityPosition?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
524
|
-
};
|
|
525
|
-
serverRuntimeConfig?: Record<string, any>;
|
|
526
|
-
publicRuntimeConfig?: Record<string, any>;
|
|
527
|
-
env?: FarmEnvConfig<any, any>;
|
|
528
|
-
typescript?: {
|
|
529
|
-
tsconfigPath?: string;
|
|
530
|
-
ignoreBuildErrors?: boolean;
|
|
531
|
-
};
|
|
532
|
-
vite?: UserConfig | ((config: UserConfig) => UserConfig);
|
|
533
|
-
[key: string]: any;
|
|
534
|
-
}
|
|
535
|
-
interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "plugins" | "vite" | "deploy" | "docs" | "md" | "mdx" | "migrations" | "cron" | "workflows" | "env" | "serverActions" | "devtools" | "images" | "i18n">> {
|
|
536
|
-
/** @internal Tracks whether `context` came from user/layer config instead of the default noop. */
|
|
537
|
-
[FARM_RESOLVED_CUSTOM_CONTEXT]?: boolean;
|
|
538
|
-
extends: readonly FarmLayerEntry[];
|
|
539
|
-
layers: ResolvedFarmLayer[];
|
|
540
|
-
plugins: FarmPlugin[];
|
|
541
|
-
vite: UserConfig;
|
|
542
|
-
deploy: ResolvedFarmDeployConfig;
|
|
543
|
-
docs: FarmDocsResolvedConfig;
|
|
544
|
-
md: FarmMarkdownResolvedConfig;
|
|
545
|
-
mdx: FarmMdxResolvedConfig;
|
|
546
|
-
migrations: ResolvedFarmMigrationsConfig;
|
|
547
|
-
cron: FarmCronResolvedConfig;
|
|
548
|
-
workflows: FarmWorkflowsResolvedConfig;
|
|
549
|
-
env: ResolvedFarmEnv;
|
|
550
|
-
serverActions: ResolvedFarmServerActionsConfig;
|
|
551
|
-
devtools: ResolvedFarmDevtoolsConfig;
|
|
552
|
-
images: ResolvedFarmImageConfig;
|
|
553
|
-
i18n: ResolvedFarmI18nConfig;
|
|
554
|
-
routeRules: FarmRouteRules;
|
|
555
|
-
}
|
|
556
|
-
type FarmLayerConfig = Omit<FarmUserConfig, "root" | "outDir" | "distDir" | "deploy" | "output" | "preset" | "publicDir" | "generateBuildId" | "deploymentId">;
|
|
557
|
-
|
|
558
|
-
declare function normalizeDeployTarget(target?: FarmDeployTarget): FarmDeployTarget | undefined;
|
|
559
|
-
declare function getPresetForDeployTarget(target?: FarmDeployTarget): FarmConfig["preset"] | undefined;
|
|
560
|
-
declare function getDeployTargetForPreset(preset?: string): FarmDeployTarget | undefined;
|
|
561
|
-
declare function resolveDeployOutputPath(root: string, outputDir: string): string;
|
|
562
|
-
declare function resolveDeployConfig(config: Pick<FarmUserConfig, "deploy" | "preset" | "distDir">, overrides?: {
|
|
563
|
-
target?: FarmDeployTarget;
|
|
564
|
-
preset?: FarmConfig["preset"];
|
|
565
|
-
outputDir?: string;
|
|
566
|
-
}): ResolvedFarmDeployConfig;
|
|
567
|
-
declare function resolveMigrationsConfig(migrations: FarmMigrationsUserConfig | undefined): ResolvedFarmMigrationsConfig;
|
|
568
|
-
declare function resolveConfig(userConfig: FarmUserConfig, mode: "development" | "production"): Promise<ResolvedFarmConfig>;
|
|
569
|
-
declare function loadConfig(rootDir?: string, configPath?: string, mode?: string, loadEnvironment?: (typeof vite)["loadEnv"]): Promise<FarmUserConfig | undefined>;
|
|
570
|
-
|
|
571
|
-
interface FarmVitePluginOptions extends FarmConfig {
|
|
572
|
-
openapi?: FarmUserConfig["openapi"];
|
|
573
|
-
images?: FarmUserConfig["images"];
|
|
574
|
-
}
|
|
575
|
-
declare function farmI18nClientBridgePlugin(): Plugin;
|
|
576
|
-
interface FarmModuleAstNode {
|
|
577
|
-
type: string;
|
|
578
|
-
start: number;
|
|
579
|
-
end: number;
|
|
580
|
-
[key: string]: unknown;
|
|
581
|
-
}
|
|
582
|
-
declare function rewriteEarlySsrRelativeImports(options: {
|
|
583
|
-
code: string;
|
|
584
|
-
id: string;
|
|
585
|
-
root: string;
|
|
586
|
-
parse: (code: string) => FarmModuleAstNode;
|
|
587
|
-
}): string | null;
|
|
588
|
-
declare function farmPlugin(options?: FarmVitePluginOptions, initialPluginManager?: PluginManager): Plugin;
|
|
589
|
-
declare function defineConfig(config?: FarmVitePluginOptions): Promise<{
|
|
590
|
-
plugins: (Plugin<any> | {
|
|
591
|
-
name: string;
|
|
592
|
-
enforce: "pre";
|
|
593
|
-
resolveId(id: string): string | null;
|
|
594
|
-
} | {
|
|
595
|
-
name: string;
|
|
596
|
-
enforce: "pre";
|
|
597
|
-
configureServer(server: ViteDevServer): void;
|
|
598
|
-
} | Plugin<any>[])[];
|
|
599
|
-
customLogger: {
|
|
600
|
-
info: (msg: string) => void;
|
|
601
|
-
warn: (msg: string) => void;
|
|
602
|
-
warnOnce: (msg: string) => void;
|
|
603
|
-
error: (msg: string) => void;
|
|
604
|
-
clearScreen: () => void;
|
|
605
|
-
hasErrorLogged: () => boolean;
|
|
606
|
-
hasWarned: boolean;
|
|
607
|
-
};
|
|
608
|
-
clearScreen: boolean;
|
|
609
|
-
optimizeDeps: {
|
|
610
|
-
include: string[];
|
|
611
|
-
exclude: string[];
|
|
612
|
-
};
|
|
613
|
-
ssr: {
|
|
614
|
-
noExternal: string[];
|
|
615
|
-
external: string[];
|
|
616
|
-
};
|
|
617
|
-
resolve: {
|
|
618
|
-
dedupe: string[];
|
|
619
|
-
alias: {
|
|
620
|
-
"@": string;
|
|
621
|
-
"supports-color": string;
|
|
622
|
-
"@poppinss/dumper": string;
|
|
623
|
-
"@poppinss/dumper/html": string;
|
|
624
|
-
"consola/basic": string;
|
|
625
|
-
youch: string;
|
|
626
|
-
};
|
|
627
|
-
};
|
|
628
|
-
define: {
|
|
629
|
-
__FARM_DEV__: string;
|
|
630
|
-
__FARM_PUBLIC_ENV__: string;
|
|
631
|
-
};
|
|
632
|
-
}>;
|
|
633
|
-
|
|
634
|
-
type MaybePromise$1<T> = T | Promise<T>;
|
|
635
|
-
interface PluginRequestContext {
|
|
636
|
-
set: (target: FarmRequest | Request, key: string, value: any, options?: {
|
|
637
|
-
exposeToPage?: boolean;
|
|
638
|
-
}) => void;
|
|
639
|
-
get: <T = any>(target: FarmRequest | Request, key: string) => T | undefined;
|
|
640
|
-
has: (target: FarmRequest | Request, key: string) => boolean;
|
|
641
|
-
delete: (target: FarmRequest | Request, key: string) => boolean;
|
|
642
|
-
clear: (target: FarmRequest | Request) => void;
|
|
643
|
-
getAll: (target: FarmRequest | Request, options?: {
|
|
644
|
-
exposedOnly?: boolean;
|
|
645
|
-
}) => Map<string, any>;
|
|
646
|
-
}
|
|
647
|
-
interface FarmRequestStore {
|
|
648
|
-
set(key: string, value: unknown, options?: {
|
|
649
|
-
exposeToPage?: boolean;
|
|
650
|
-
}): void;
|
|
651
|
-
get<T = unknown>(key: string): T | undefined;
|
|
652
|
-
has(key: string): boolean;
|
|
653
|
-
delete(key: string): boolean;
|
|
654
|
-
clear(): void;
|
|
655
|
-
snapshot(options?: {
|
|
656
|
-
exposedOnly?: boolean;
|
|
657
|
-
}): Map<string, unknown>;
|
|
658
|
-
}
|
|
659
|
-
interface FarmPluginContext {
|
|
660
|
-
config: FarmConfig;
|
|
661
|
-
viteServer?: ViteDevServer;
|
|
662
|
-
isDev: boolean;
|
|
663
|
-
isProd: boolean;
|
|
664
|
-
/** @deprecated Use `ctx.req` inside request hooks. */
|
|
665
|
-
requestContext: PluginRequestContext;
|
|
666
|
-
}
|
|
667
|
-
interface FarmRequestPluginContext extends FarmPluginContext {
|
|
668
|
-
/** Request-scoped values for the current hook invocation. */
|
|
669
|
-
readonly req: FarmRequestStore;
|
|
670
|
-
}
|
|
671
|
-
interface RouteDiscoveredPayload {
|
|
672
|
-
kind: "page" | "layout";
|
|
673
|
-
pattern: string;
|
|
674
|
-
modulePath: string;
|
|
675
|
-
}
|
|
676
|
-
interface RoutesGeneratedPayload {
|
|
677
|
-
routes: RouteDiscoveredPayload[];
|
|
678
|
-
pageCount: number;
|
|
679
|
-
layoutCount: number;
|
|
680
|
-
}
|
|
681
|
-
interface MiddlewareDiscoveredPayload {
|
|
682
|
-
path: string;
|
|
683
|
-
filePath: string;
|
|
684
|
-
handlerCount: number;
|
|
685
|
-
}
|
|
686
|
-
interface APIRouteDiscoveredPayload {
|
|
687
|
-
path: string;
|
|
688
|
-
filePath: string;
|
|
689
|
-
methods: string[];
|
|
690
|
-
}
|
|
691
|
-
interface RouteMatchPayload {
|
|
692
|
-
pathname: string;
|
|
693
|
-
method?: string;
|
|
694
|
-
}
|
|
695
|
-
interface RouteMatchResultPayload {
|
|
696
|
-
pathname: string;
|
|
697
|
-
matched: boolean;
|
|
698
|
-
routePattern: string | null;
|
|
699
|
-
params: Record<string, string>;
|
|
700
|
-
layoutPatterns: string[];
|
|
701
|
-
}
|
|
702
|
-
interface RenderLifecyclePayload {
|
|
703
|
-
pathname: string;
|
|
704
|
-
method: string;
|
|
705
|
-
routePattern: string | null;
|
|
706
|
-
params: Record<string, string>;
|
|
707
|
-
}
|
|
708
|
-
interface APIHandlerLifecyclePayload {
|
|
709
|
-
pathname: string;
|
|
710
|
-
method: string;
|
|
711
|
-
routePath?: string;
|
|
712
|
-
}
|
|
713
|
-
interface ErrorLifecyclePayload {
|
|
714
|
-
phase: string;
|
|
715
|
-
error: unknown;
|
|
716
|
-
meta?: Record<string, unknown>;
|
|
717
|
-
}
|
|
718
|
-
interface HMRUpdatePayload {
|
|
719
|
-
file: string;
|
|
720
|
-
modules: string[];
|
|
721
|
-
}
|
|
722
|
-
interface BundleLifecyclePayload {
|
|
723
|
-
root: string;
|
|
724
|
-
preset: string;
|
|
725
|
-
universal: boolean;
|
|
726
|
-
distDir: string;
|
|
727
|
-
outputDir?: string;
|
|
728
|
-
}
|
|
729
|
-
interface BundleResultPayload extends BundleLifecyclePayload {
|
|
730
|
-
success: boolean;
|
|
731
|
-
}
|
|
732
|
-
interface NitroBuildLifecyclePayload {
|
|
733
|
-
root: string;
|
|
734
|
-
preset: string;
|
|
735
|
-
distDir: string;
|
|
736
|
-
outputDir: string;
|
|
737
|
-
}
|
|
738
|
-
interface ShutdownPayload {
|
|
739
|
-
reason: string;
|
|
740
|
-
}
|
|
741
|
-
type FarmPluginRuntimeKind = "request" | "page" | "api" | "action" | "integration" | "docs" | "asset" | (string & {});
|
|
742
|
-
interface FarmPluginRouteRuntimePayload {
|
|
743
|
-
pathname: string;
|
|
744
|
-
pattern?: string | null;
|
|
745
|
-
params?: Record<string, string>;
|
|
746
|
-
}
|
|
747
|
-
interface FarmPluginSetupContext extends FarmPluginContext {
|
|
748
|
-
env: ResolvedFarmEnv;
|
|
749
|
-
}
|
|
750
|
-
interface FarmPluginStateContext<TState = unknown> extends FarmPluginContext {
|
|
751
|
-
state: TState;
|
|
752
|
-
}
|
|
753
|
-
interface FarmPluginRuntimeBaseEvent<TState = unknown> extends FarmPluginStateContext<TState> {
|
|
754
|
-
request: Request;
|
|
755
|
-
/** Request-scoped values shared by plugin hooks. */
|
|
756
|
-
req: FarmRequestStore;
|
|
757
|
-
kind: FarmPluginRuntimeKind;
|
|
758
|
-
route?: FarmPluginRouteRuntimePayload;
|
|
759
|
-
signal: AbortSignal;
|
|
760
|
-
waitUntil(promise: Promise<unknown>): void;
|
|
761
|
-
}
|
|
762
|
-
type FarmPluginRuntimeContextEvent<TState = unknown> = FarmPluginRuntimeBaseEvent<TState>;
|
|
763
|
-
interface FarmPluginRuntimeBeforeEvent<TState = unknown, TRequestContext extends object = Record<string, unknown>> extends FarmPluginRuntimeBaseEvent<TState> {
|
|
764
|
-
ctx: Readonly<TRequestContext>;
|
|
765
|
-
}
|
|
766
|
-
interface FarmPluginRuntimeAfterEvent<TState = unknown, TRequestContext extends object = Record<string, unknown>> extends FarmPluginRuntimeBeforeEvent<TState, TRequestContext> {
|
|
767
|
-
response: Response;
|
|
768
|
-
durationMs: number;
|
|
769
|
-
}
|
|
770
|
-
interface FarmPluginRuntimeErrorEvent<TState = unknown, TRequestContext extends object = Record<string, unknown>> extends FarmPluginRuntimeBeforeEvent<TState, TRequestContext> {
|
|
771
|
-
error: unknown;
|
|
772
|
-
durationMs: number;
|
|
773
|
-
}
|
|
774
|
-
type FarmPluginRuntimeStartEvent<TState = unknown> = FarmPluginStateContext<TState>;
|
|
775
|
-
interface FarmPluginRuntimeCloseEvent<TState = unknown> extends FarmPluginStateContext<TState>, ShutdownPayload {
|
|
776
|
-
}
|
|
777
|
-
interface FarmPluginRuntimeHooks<TState = unknown, TRequestContext extends object = Record<string, unknown>> {
|
|
778
|
-
start?(event: FarmPluginRuntimeStartEvent<TState>): MaybePromise$1<void>;
|
|
779
|
-
context?(event: FarmPluginRuntimeContextEvent<TState>): MaybePromise$1<TRequestContext>;
|
|
780
|
-
before?(event: FarmPluginRuntimeBeforeEvent<TState, TRequestContext>): MaybePromise$1<Request | Response | void>;
|
|
781
|
-
after?(event: FarmPluginRuntimeAfterEvent<TState, TRequestContext>): MaybePromise$1<Response | void>;
|
|
782
|
-
error?(event: FarmPluginRuntimeErrorEvent<TState, TRequestContext>): MaybePromise$1<void>;
|
|
783
|
-
close?(event: FarmPluginRuntimeCloseEvent<TState>): MaybePromise$1<void>;
|
|
784
|
-
}
|
|
785
|
-
interface FarmPluginRuntimeRequestOptions {
|
|
786
|
-
kind?: FarmPluginRuntimeKind;
|
|
787
|
-
route?: FarmPluginRouteRuntimePayload;
|
|
788
|
-
waitUntil?: (promise: Promise<unknown>) => void;
|
|
789
|
-
}
|
|
790
|
-
type FarmPluginRuntimeRequestHandler = (request: Request) => MaybePromise$1<Response>;
|
|
791
|
-
interface FarmPluginRuntimeSession {
|
|
792
|
-
request: Request;
|
|
793
|
-
response?: Response;
|
|
794
|
-
ctx: Readonly<Record<string, unknown>>;
|
|
795
|
-
startedAt: number;
|
|
796
|
-
options: FarmPluginRuntimeRequestOptions;
|
|
797
|
-
waitUntil(promise: Promise<unknown>): void;
|
|
798
|
-
}
|
|
799
|
-
type FarmPluginDiscoveredRoute = RouteDiscoveredPayload | ({
|
|
800
|
-
kind: "middleware";
|
|
801
|
-
} & MiddlewareDiscoveredPayload) | ({
|
|
802
|
-
kind: "api";
|
|
803
|
-
} & APIRouteDiscoveredPayload);
|
|
804
|
-
interface FarmPluginRouterHooks<TState = unknown> {
|
|
805
|
-
discovered?(route: FarmPluginDiscoveredRoute, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
806
|
-
generated?(routes: RoutesGeneratedPayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
807
|
-
before?(route: RouteMatchPayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
808
|
-
after?(result: RouteMatchResultPayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
809
|
-
}
|
|
810
|
-
interface FarmPluginRenderHooks<TState = unknown> {
|
|
811
|
-
before?(render: RenderLifecyclePayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
812
|
-
html?(html: string, render: RenderLifecyclePayload, context: FarmPluginStateContext<TState>): MaybePromise$1<string | void>;
|
|
813
|
-
}
|
|
814
|
-
interface FarmPluginBuildHooks<TState = unknown> {
|
|
815
|
-
before?(bundle: BundleLifecyclePayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
816
|
-
configure?(buildConfig: any, context: FarmPluginStateContext<TState>): MaybePromise$1<any>;
|
|
817
|
-
after?(result: BundleResultPayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
818
|
-
}
|
|
819
|
-
interface FarmPluginDevHooks<TState = unknown> {
|
|
820
|
-
server?(viteServer: ViteDevServer, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
821
|
-
update?(update: HMRUpdatePayload, context: FarmPluginStateContext<TState>): MaybePromise$1<void>;
|
|
822
|
-
}
|
|
823
|
-
interface FarmPluginClientConfig<TState = unknown, TPublic = undefined> extends FarmClientPlugin<TState, TPublic> {
|
|
824
|
-
/** Explicitly public, JSON-safe data embedded in the browser bundle. */
|
|
825
|
-
public?: TPublic;
|
|
826
|
-
}
|
|
827
|
-
interface FarmPlugin<TState = any, TRequestContext extends object = Record<string, unknown>, TClientState = any, TClientPublic = any> {
|
|
828
|
-
name: string;
|
|
829
|
-
version?: string;
|
|
830
|
-
enforce?: "pre" | "post";
|
|
831
|
-
/** Transform Farm config before it is resolved. */
|
|
832
|
-
configure?: (config: FarmConfig, context: FarmPluginContext) => MaybePromise$1<FarmConfig | void>;
|
|
833
|
-
/** Initialize private plugin state once for this plugin manager. */
|
|
834
|
-
setup?: (context: FarmPluginSetupContext) => MaybePromise$1<TState>;
|
|
835
|
-
runtime?: FarmPluginRuntimeHooks<TState, TRequestContext>;
|
|
836
|
-
router?: FarmPluginRouterHooks<TState>;
|
|
837
|
-
render?: FarmPluginRenderHooks<TState>;
|
|
838
|
-
build?: FarmPluginBuildHooks<TState>;
|
|
839
|
-
dev?: FarmPluginDevHooks<TState>;
|
|
840
|
-
/** Optional browser lifecycle for this logical plugin. */
|
|
841
|
-
client?: FarmPluginClientConfig<TClientState, TClientPublic>;
|
|
842
|
-
/** @deprecated Use `setup` instead. */
|
|
843
|
-
init?: (context: FarmPluginContext) => void | Promise<void>;
|
|
844
|
-
/** @deprecated Use `runtime.start` instead. */
|
|
845
|
-
ready?: (context: FarmPluginContext) => void | Promise<void>;
|
|
846
|
-
/** @deprecated Use `dev.server` instead. */
|
|
847
|
-
devServerCreated?: (viteServer: ViteDevServer, context: FarmPluginContext) => void | Promise<void>;
|
|
848
|
-
/** @deprecated Use `configure` instead. */
|
|
849
|
-
config?: (config: FarmConfig, context: FarmPluginContext) => FarmConfig | Promise<FarmConfig>;
|
|
850
|
-
configResolved?: (config: FarmConfig, context: FarmPluginContext) => void | Promise<void>;
|
|
851
|
-
/** @deprecated Use `build.before` instead. */
|
|
852
|
-
buildStart?: (context: FarmPluginContext) => void | Promise<void>;
|
|
853
|
-
/** @deprecated Use `build.after` instead. */
|
|
854
|
-
buildEnd?: (context: FarmPluginContext) => void | Promise<void>;
|
|
855
|
-
/** @deprecated Use `router.discovered` instead. */
|
|
856
|
-
routeDiscovered?: (route: RouteDiscoveredPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
857
|
-
/** @deprecated Use `router.generated` instead. */
|
|
858
|
-
routesGenerated?: (routes: RoutesGeneratedPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
859
|
-
/** @deprecated Use `router.discovered` instead. */
|
|
860
|
-
middlewareDiscovered?: (middleware: MiddlewareDiscoveredPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
861
|
-
/** @deprecated Use `router.discovered` instead. */
|
|
862
|
-
apiRouteDiscovered?: (route: APIRouteDiscoveredPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
863
|
-
/** @deprecated Use `router.before` instead. */
|
|
864
|
-
beforeRouteMatch?: (route: RouteMatchPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
865
|
-
/** @deprecated Use `router.after` instead. */
|
|
866
|
-
afterRouteMatch?: (result: RouteMatchResultPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
867
|
-
/** @deprecated Use `render.before` instead. */
|
|
868
|
-
beforeRender?: (render: RenderLifecyclePayload, context: FarmPluginContext) => void | Promise<void>;
|
|
869
|
-
/** @deprecated Use `render.html` instead. */
|
|
870
|
-
afterRender?: (html: string, render: RenderLifecyclePayload, context: FarmPluginContext) => string | Promise<string> | void | Promise<void>;
|
|
871
|
-
/** @deprecated Use `runtime.before` instead. */
|
|
872
|
-
beforeApiHandler?: (request: Request, api: APIHandlerLifecyclePayload, context: FarmRequestPluginContext) => Request | Promise<Request> | void | Promise<void>;
|
|
873
|
-
/** @deprecated Use `runtime.after` instead. */
|
|
874
|
-
afterApiHandler?: (response: Response, api: APIHandlerLifecyclePayload, context: FarmPluginContext) => Response | Promise<Response> | void | Promise<void>;
|
|
875
|
-
onError?: (error: ErrorLifecyclePayload, context: FarmPluginContext) => void | Promise<void>;
|
|
876
|
-
/** @deprecated Use `dev.update` instead. */
|
|
877
|
-
hmrUpdate?: (update: HMRUpdatePayload, context: FarmPluginContext) => void | Promise<void>;
|
|
878
|
-
/** @deprecated Use `build.before` instead. */
|
|
879
|
-
beforeBundle?: (bundle: BundleLifecyclePayload, context: FarmPluginContext) => void | Promise<void>;
|
|
880
|
-
/** @deprecated Use `build.after` instead. */
|
|
881
|
-
afterBundle?: (result: BundleResultPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
882
|
-
/** @deprecated Use `build.configure` instead. */
|
|
883
|
-
beforeNitroBuild?: (nitroConfig: any, context: FarmPluginContext) => any | Promise<any>;
|
|
884
|
-
afterNitroBuild?: (payload: NitroBuildLifecyclePayload, context: FarmPluginContext) => void | Promise<void>;
|
|
885
|
-
/** @deprecated Use `runtime.close` instead. */
|
|
886
|
-
shutdown?: (payload: ShutdownPayload, context: FarmPluginContext) => void | Promise<void>;
|
|
887
|
-
/** @deprecated Use the Web Request based `runtime.before` hook instead. */
|
|
888
|
-
beforeRequest?: (req: FarmRequest, res: FarmResponse, context: FarmRequestPluginContext) => void | Promise<void>;
|
|
889
|
-
/** @deprecated Use the Web Response based `runtime.after` hook instead. */
|
|
890
|
-
afterResponse?: (req: FarmRequest, res: FarmResponse, context: FarmRequestPluginContext) => void | Promise<void>;
|
|
891
|
-
/** @deprecated Use `render.html` instead. */
|
|
892
|
-
transformHTML?: (html: string, context: FarmPluginContext) => string | Promise<string>;
|
|
893
|
-
/** @deprecated Use `render.before` or `render.html` instead. */
|
|
894
|
-
transformPage?: (component: any, context: FarmPluginContext) => any | Promise<any>;
|
|
895
|
-
}
|
|
896
|
-
declare class PluginManager {
|
|
897
|
-
private plugins;
|
|
898
|
-
private hookPresence;
|
|
899
|
-
private runtimeHookPresence;
|
|
900
|
-
private context;
|
|
901
|
-
private pluginStates;
|
|
902
|
-
private setupComplete;
|
|
903
|
-
private initialized;
|
|
904
|
-
private runtimeReady;
|
|
905
|
-
private runtimeClosed;
|
|
906
|
-
private runtimeStartPromise?;
|
|
907
|
-
private runtimeClosePromise?;
|
|
908
|
-
private runtimeRequestContexts;
|
|
909
|
-
private failedRuntimeSessions;
|
|
910
|
-
constructor(context: Omit<FarmPluginContext, "requestContext">);
|
|
911
|
-
private createRequestHookContext;
|
|
912
|
-
private copyRequestStore;
|
|
913
|
-
private copyRuntimeRequestContext;
|
|
914
|
-
private createRuntimeBaseEvent;
|
|
915
|
-
private createRuntimeRequestContext;
|
|
916
|
-
private runRuntimeErrorHooks;
|
|
917
|
-
private createStateHookContext;
|
|
918
|
-
private getPluginHooks;
|
|
919
|
-
private getHookContext;
|
|
920
|
-
addPlugin(plugin: FarmPlugin): void;
|
|
921
|
-
addPlugins(plugins: FarmPlugin[]): void;
|
|
922
|
-
getPlugins(): FarmPlugin[];
|
|
923
|
-
getSortedPlugins(): FarmPlugin[];
|
|
924
|
-
hasHook(hookName: keyof FarmPlugin): boolean;
|
|
925
|
-
hasRuntimeHook(hookName: "context" | "before" | "after" | "error"): boolean;
|
|
926
|
-
hasRuntimeRequestHooks(): boolean;
|
|
927
|
-
copyRequestContext(source: FarmRequest | Request, target: FarmRequest | Request): void;
|
|
928
|
-
setupPlugins(): Promise<void>;
|
|
929
|
-
startRuntime(): Promise<void>;
|
|
930
|
-
closeRuntime(reason?: string): Promise<void>;
|
|
931
|
-
beginRuntimeRequest(request: Request, options?: FarmPluginRuntimeRequestOptions): Promise<FarmPluginRuntimeSession>;
|
|
932
|
-
endRuntimeRequest(session: FarmPluginRuntimeSession, initialResponse: Response): Promise<Response>;
|
|
933
|
-
failRuntimeRequest(session: FarmPluginRuntimeSession, error: unknown): Promise<void>;
|
|
934
|
-
runRuntimeRequest(request: Request, handler: FarmPluginRuntimeRequestHandler, options?: FarmPluginRuntimeRequestOptions): Promise<Response>;
|
|
935
|
-
runHook<K extends keyof FarmPlugin>(hookName: K, ...args: any[]): Promise<any>;
|
|
936
|
-
runHookSerial<K extends keyof FarmPlugin>(hookName: K, initialValue: any, ...args: any[]): Promise<any>;
|
|
937
|
-
runHookParallel<K extends keyof FarmPlugin>(hookName: K, ...args: any[]): Promise<boolean>;
|
|
938
|
-
updateContext(updates: Partial<FarmPluginContext>): void;
|
|
939
|
-
}
|
|
940
|
-
declare function definePlugin<TState = undefined, TRequestContext extends object = Record<string, never>, TClientState = unknown, TClientPublic = undefined>(plugin: FarmPlugin<TState, TRequestContext, TClientState, TClientPublic>): FarmPlugin<TState, TRequestContext, TClientState, TClientPublic>;
|
|
941
|
-
|
|
942
|
-
type FarmIntegrationCategory = "auth" | "payment" | "monitoring" | "logging" | (string & {});
|
|
943
|
-
/** @deprecated Use FarmIntegrationCategory instead. */
|
|
944
|
-
type FarmIntegrationSlot = FarmIntegrationCategory;
|
|
945
|
-
type FarmIntegrationRouteParamValue = string | string[];
|
|
946
|
-
type FarmIntegrationRouteParams = Record<string, FarmIntegrationRouteParamValue>;
|
|
947
|
-
type FarmIntegrationRouteMethod = FarmIntegrationAPIMethod | Lowercase<FarmIntegrationAPIMethod> | "ALL" | "all";
|
|
948
|
-
type FarmIntegrationRouteInputSource = "body" | "query";
|
|
949
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
950
|
-
type FarmIntegrationValidationPathSegment = PropertyKey | {
|
|
951
|
-
readonly key: PropertyKey;
|
|
952
|
-
};
|
|
953
|
-
interface FarmIntegrationRouteInput<TBody = unknown, TQuery = unknown> {
|
|
954
|
-
body?: TBody;
|
|
955
|
-
query?: TQuery;
|
|
956
|
-
}
|
|
957
|
-
interface FarmIntegrationValidationIssue {
|
|
958
|
-
source: FarmIntegrationRouteInputSource;
|
|
959
|
-
path?: readonly (string | number)[];
|
|
960
|
-
code?: string;
|
|
961
|
-
message: string;
|
|
962
|
-
}
|
|
963
|
-
interface FarmIntegrationValidationErrorLike {
|
|
964
|
-
issues?: readonly {
|
|
965
|
-
path?: readonly FarmIntegrationValidationPathSegment[];
|
|
966
|
-
code?: string;
|
|
967
|
-
message?: string;
|
|
968
|
-
}[];
|
|
969
|
-
message?: string;
|
|
970
|
-
}
|
|
971
|
-
type FarmIntegrationValidationResult<TValue> = {
|
|
972
|
-
success: true;
|
|
973
|
-
data: TValue;
|
|
974
|
-
} | {
|
|
975
|
-
success: false;
|
|
976
|
-
error: FarmIntegrationValidationErrorLike;
|
|
977
|
-
};
|
|
978
|
-
type FarmIntegrationStandardValidationResult<TValue> = {
|
|
979
|
-
value: TValue;
|
|
980
|
-
} | {
|
|
981
|
-
issues: readonly {
|
|
982
|
-
path?: readonly FarmIntegrationValidationPathSegment[];
|
|
983
|
-
code?: string;
|
|
984
|
-
message: string;
|
|
985
|
-
}[];
|
|
986
|
-
};
|
|
987
|
-
interface FarmIntegrationInputSchema<TValue = unknown> {
|
|
988
|
-
_output?: TValue;
|
|
989
|
-
parse?(value: unknown): MaybePromise<TValue>;
|
|
990
|
-
safeParse?(value: unknown): MaybePromise<FarmIntegrationValidationResult<TValue>>;
|
|
991
|
-
safeParseAsync?(value: unknown): Promise<FarmIntegrationValidationResult<TValue>>;
|
|
992
|
-
"~standard"?: {
|
|
993
|
-
validate(value: unknown): MaybePromise<FarmIntegrationStandardValidationResult<TValue>>;
|
|
994
|
-
types?: {
|
|
995
|
-
output: TValue;
|
|
996
|
-
};
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
interface FarmIntegrationRouteInputSchemas<TBody = unknown, TQuery = unknown> {
|
|
1000
|
-
body?: FarmIntegrationInputSchema<TBody>;
|
|
1001
|
-
query?: FarmIntegrationInputSchema<TQuery>;
|
|
1002
|
-
}
|
|
1003
|
-
/** @deprecated Use `FarmRequestStore` and access it through `ctx.req`. */
|
|
1004
|
-
type FarmIntegrationRequestContextStore = FarmRequestStore;
|
|
1005
|
-
declare const FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = "farm.integration.internalDispatch";
|
|
1006
|
-
type FarmIntegrationRouteDb<TSchema extends FarmIntegrationSchema | undefined> = InferFarmIntegrationOrmClient<TSchema>;
|
|
1007
|
-
interface FarmIntegrationRouteStorageArgs<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1008
|
-
getClient(): Promise<unknown | undefined>;
|
|
1009
|
-
getOrm(): Promise<FarmIntegrationRouteDb<TSchema>>;
|
|
1010
|
-
}
|
|
1011
|
-
interface FarmIntegrationRouteArgs<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1012
|
-
db: FarmIntegrationRouteDb<TSchema>;
|
|
1013
|
-
getDb(): Promise<FarmIntegrationRouteDb<TSchema>>;
|
|
1014
|
-
storage: FarmIntegrationRouteStorageArgs<TSchema>;
|
|
1015
|
-
}
|
|
1016
|
-
interface FarmIntegrationConfigContext<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1017
|
-
key: string;
|
|
1018
|
-
integration: FarmIntegration<TSchema, any>;
|
|
1019
|
-
appConfig: FarmPluginContext["config"];
|
|
1020
|
-
/** Alias for appConfig. */
|
|
1021
|
-
config: FarmPluginContext["config"];
|
|
1022
|
-
args: FarmIntegrationRouteArgs<TSchema>;
|
|
1023
|
-
env: Record<string, string | undefined>;
|
|
1024
|
-
isDev: boolean;
|
|
1025
|
-
isProd: boolean;
|
|
1026
|
-
}
|
|
1027
|
-
interface FarmIntegrationConfigDefinition<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1028
|
-
schema?: FarmIntegrationInputSchema<TConfig>;
|
|
1029
|
-
env?: Record<string, string | readonly string[]>;
|
|
1030
|
-
defaults?: Partial<TConfig> | ((context: FarmIntegrationConfigContext<TSchema>) => MaybePromise<Partial<TConfig>>);
|
|
1031
|
-
input?: Partial<TConfig> | ((context: FarmIntegrationConfigContext<TSchema>) => MaybePromise<Partial<TConfig>>);
|
|
1032
|
-
resolve?(context: FarmIntegrationConfigContext<TSchema>): MaybePromise<TConfig | Partial<TConfig> | undefined>;
|
|
1033
|
-
}
|
|
1034
|
-
type FarmIntegrationConfigInput<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = FarmIntegrationInputSchema<TConfig> | FarmIntegrationConfigDefinition<TConfig, TSchema>;
|
|
1035
|
-
type FarmIntegrationLifecycleLogLevel = "info" | "warn" | "error";
|
|
1036
|
-
interface FarmIntegrationLifecycleLogger {
|
|
1037
|
-
info(message: string, meta?: Record<string, unknown>): void;
|
|
1038
|
-
warn(message: string, meta?: Record<string, unknown>): void;
|
|
1039
|
-
error(message: string, meta?: Record<string, unknown>): void;
|
|
1040
|
-
}
|
|
1041
|
-
interface FarmIntegrationLifecycleContext<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationConfigContext<TSchema> {
|
|
1042
|
-
integration: FarmIntegration<TSchema, TConfig>;
|
|
1043
|
-
integrationConfig: TConfig;
|
|
1044
|
-
log: FarmIntegrationLifecycleLogger;
|
|
1045
|
-
reason?: string;
|
|
1046
|
-
cleanup(callback?: () => MaybePromise<void>): Promise<void>;
|
|
1047
|
-
}
|
|
1048
|
-
type FarmIntegrationLifecycleHook<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = (context: FarmIntegrationLifecycleContext<TConfig, TSchema>) => MaybePromise<void>;
|
|
1049
|
-
/**
|
|
1050
|
-
* Small per-call integration metadata. Values received over HTTP are
|
|
1051
|
-
* client-controlled and should be validated before authorization decisions.
|
|
1052
|
-
*/
|
|
1053
|
-
type FarmIntegrationData = Record<string, unknown>;
|
|
1054
|
-
interface FarmIntegrationHandlerContext<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1055
|
-
request: Request;
|
|
1056
|
-
requestId: string;
|
|
1057
|
-
url: URL;
|
|
1058
|
-
pathname: string;
|
|
1059
|
-
method: string;
|
|
1060
|
-
params: FarmIntegrationRouteParams;
|
|
1061
|
-
input: FarmIntegrationRouteInput<TBody, TQuery>;
|
|
1062
|
-
args: FarmIntegrationRouteArgs<TSchema>;
|
|
1063
|
-
data: FarmIntegrationData;
|
|
1064
|
-
integration: {
|
|
1065
|
-
category: FarmIntegrationCategory;
|
|
1066
|
-
/** @deprecated Use category instead. */
|
|
1067
|
-
slot: FarmIntegrationCategory;
|
|
1068
|
-
type: string;
|
|
1069
|
-
instance: unknown;
|
|
1070
|
-
};
|
|
1071
|
-
route: {
|
|
1072
|
-
kind: "route" | "middleware";
|
|
1073
|
-
path: string;
|
|
1074
|
-
methods: readonly string[];
|
|
1075
|
-
};
|
|
1076
|
-
req: FarmRequestStore;
|
|
1077
|
-
/** @deprecated Use `req` instead. */
|
|
1078
|
-
requestContext: FarmRequestStore;
|
|
1079
|
-
config: FarmPluginContext["config"];
|
|
1080
|
-
isDev: boolean;
|
|
1081
|
-
isProd: boolean;
|
|
1082
|
-
}
|
|
1083
|
-
interface FarmIntegrationRouteHookContext<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationHandlerContext<TBody, TQuery, TSchema> {
|
|
1084
|
-
response?: Response;
|
|
1085
|
-
}
|
|
1086
|
-
type FarmIntegrationRouteHook<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = {
|
|
1087
|
-
bivarianceHack(request: Request, context: FarmIntegrationRouteHookContext<TBody, TQuery, TSchema>): Promise<Response | void> | Response | void;
|
|
1088
|
-
}["bivarianceHack"];
|
|
1089
|
-
interface FarmIntegrationRoute<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1090
|
-
path: string;
|
|
1091
|
-
method?: FarmIntegrationRouteMethod;
|
|
1092
|
-
methods?: readonly FarmIntegrationRouteMethod[];
|
|
1093
|
-
middleware?: readonly FarmIntegrationRouteMiddleware<TSchema>[];
|
|
1094
|
-
before?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
|
|
1095
|
-
after?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
|
|
1096
|
-
rawBody?: boolean;
|
|
1097
|
-
bodyFormat?: FarmIntegrationAPIBodyFormat;
|
|
1098
|
-
body?: FarmIntegrationInputSchema<TBody>;
|
|
1099
|
-
query?: FarmIntegrationInputSchema<TQuery>;
|
|
1100
|
-
input?: FarmIntegrationRouteInputSchemas<TBody, TQuery>;
|
|
1101
|
-
handler(request: Request, context: FarmIntegrationHandlerContext<TBody, TQuery, TSchema>): Promise<Response> | Response;
|
|
1102
|
-
}
|
|
1103
|
-
interface FarmTypedIntegrationRoute<TPath extends string = string, TBody = never, TQuery = never, TResponse = unknown, TServer extends boolean = false, TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationRoute<TBody, TQuery, TSchema> {
|
|
1104
|
-
path: TPath;
|
|
1105
|
-
method: TMethod;
|
|
1106
|
-
__operation: FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>;
|
|
1107
|
-
}
|
|
1108
|
-
interface FarmIntegrationRouteMiddleware<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1109
|
-
handler(request: Request, context: FarmIntegrationHandlerContext<unknown, unknown, TSchema>): Promise<Response | void> | Response | void;
|
|
1110
|
-
}
|
|
1111
|
-
interface FarmIntegrationMiddleware<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1112
|
-
matcher?: string | string[];
|
|
1113
|
-
handler(request: Request, context: FarmIntegrationHandlerContext<unknown, unknown, TSchema>): Promise<Response | void> | Response | void;
|
|
1114
|
-
}
|
|
1115
|
-
interface FarmIntegrationProviderProps {
|
|
1116
|
-
children: ReactNode;
|
|
1117
|
-
}
|
|
1118
|
-
interface FarmIntegrationProvider {
|
|
1119
|
-
name: string;
|
|
1120
|
-
type: string;
|
|
1121
|
-
props?: Record<string, unknown>;
|
|
1122
|
-
component?: ComponentType<FarmIntegrationProviderProps>;
|
|
1123
|
-
}
|
|
1124
|
-
interface FarmIntegrationDocumentNavigation {
|
|
1125
|
-
matcher: string | readonly string[];
|
|
1126
|
-
}
|
|
1127
|
-
type FarmIntegrationSchemaFieldType = "id" | "uuid" | "string" | "text" | "boolean" | "integer" | "number" | "datetime" | "json" | "enum";
|
|
1128
|
-
interface FarmIntegrationSchemaReference {
|
|
1129
|
-
model: string;
|
|
1130
|
-
field: string;
|
|
1131
|
-
relation?: "belongsTo" | "hasOne" | "hasMany";
|
|
1132
|
-
onDelete?: "cascade" | "restrict" | "setNull" | "noAction";
|
|
1133
|
-
enforced?: "db" | "app" | "none";
|
|
1134
|
-
}
|
|
1135
|
-
interface FarmIntegrationSchemaField {
|
|
1136
|
-
type: FarmIntegrationSchemaFieldType;
|
|
1137
|
-
name?: string;
|
|
1138
|
-
description?: string;
|
|
1139
|
-
required?: boolean;
|
|
1140
|
-
nullable?: boolean;
|
|
1141
|
-
primaryKey?: boolean;
|
|
1142
|
-
unique?: boolean;
|
|
1143
|
-
index?: boolean;
|
|
1144
|
-
list?: boolean;
|
|
1145
|
-
default?: unknown;
|
|
1146
|
-
values?: readonly string[];
|
|
1147
|
-
reference?: FarmIntegrationSchemaReference;
|
|
1148
|
-
meta?: Record<string, unknown>;
|
|
1149
|
-
}
|
|
1150
|
-
interface FarmIntegrationSchemaConstraint {
|
|
1151
|
-
type: "unique" | "index";
|
|
1152
|
-
fields: readonly string[];
|
|
1153
|
-
name?: string;
|
|
1154
|
-
meta?: Record<string, unknown>;
|
|
1155
|
-
}
|
|
1156
|
-
interface FarmIntegrationSchemaModel {
|
|
1157
|
-
name?: string;
|
|
1158
|
-
description?: string;
|
|
1159
|
-
fields: Record<string, FarmIntegrationSchemaField>;
|
|
1160
|
-
constraints?: readonly FarmIntegrationSchemaConstraint[];
|
|
1161
|
-
meta?: Record<string, unknown>;
|
|
1162
|
-
}
|
|
1163
|
-
interface FarmIntegrationSchemaModelExtension {
|
|
1164
|
-
name?: string;
|
|
1165
|
-
description?: string;
|
|
1166
|
-
fields?: Record<string, FarmIntegrationSchemaField>;
|
|
1167
|
-
constraints?: readonly FarmIntegrationSchemaConstraint[];
|
|
1168
|
-
meta?: Record<string, unknown>;
|
|
1169
|
-
}
|
|
1170
|
-
interface FarmIntegrationSchemaModelOverride {
|
|
1171
|
-
name?: string;
|
|
1172
|
-
description?: string;
|
|
1173
|
-
fields?: Record<string, Partial<FarmIntegrationSchemaField>>;
|
|
1174
|
-
constraints?: readonly FarmIntegrationSchemaConstraint[];
|
|
1175
|
-
meta?: Record<string, unknown>;
|
|
1176
|
-
}
|
|
1177
|
-
interface FarmIntegrationSchema {
|
|
1178
|
-
models: Record<string, FarmIntegrationSchemaModel>;
|
|
1179
|
-
meta?: Record<string, unknown>;
|
|
1180
|
-
extend?: Record<string, FarmIntegrationSchemaModelExtension>;
|
|
1181
|
-
override?: Record<string, FarmIntegrationSchemaModelOverride>;
|
|
1182
|
-
}
|
|
1183
|
-
declare function defineIntegrationSchema<TSchema extends FarmIntegrationSchema>(schema: TSchema): TSchema;
|
|
1184
|
-
type FarmIntegrationLogPhase = "registered" | "validate" | "setup" | "ready" | "dispose" | "request:start" | "request:end" | "request:error";
|
|
1185
|
-
interface FarmIntegrationLogEvent {
|
|
1186
|
-
category: FarmIntegrationCategory;
|
|
1187
|
-
/** @deprecated Use category instead. */
|
|
1188
|
-
slot: FarmIntegrationCategory;
|
|
1189
|
-
type: string;
|
|
1190
|
-
phase: FarmIntegrationLogPhase;
|
|
1191
|
-
route?: {
|
|
1192
|
-
kind: "route" | "middleware";
|
|
1193
|
-
path: string;
|
|
1194
|
-
methods: readonly string[];
|
|
1195
|
-
};
|
|
1196
|
-
requestId?: string;
|
|
1197
|
-
request?: Request;
|
|
1198
|
-
response?: Response;
|
|
1199
|
-
error?: unknown;
|
|
1200
|
-
durationMs?: number;
|
|
1201
|
-
level?: FarmIntegrationLifecycleLogLevel;
|
|
1202
|
-
message?: string;
|
|
1203
|
-
meta?: Record<string, unknown>;
|
|
1204
|
-
context: Map<string, unknown>;
|
|
1205
|
-
}
|
|
1206
|
-
type FarmIntegrationLogger = (event: FarmIntegrationLogEvent) => void | Promise<void>;
|
|
1207
|
-
interface FarmIntegration<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined, TConfig = unknown> {
|
|
1208
|
-
readonly kind: "farm-integration";
|
|
1209
|
-
category: FarmIntegrationCategory;
|
|
1210
|
-
/** @deprecated Use category instead. */
|
|
1211
|
-
slot?: FarmIntegrationCategory;
|
|
1212
|
-
type: string;
|
|
1213
|
-
instance: unknown;
|
|
1214
|
-
/** Set to false when a platform adapter owns this integration's production routes. */
|
|
1215
|
-
serverRuntime?: boolean;
|
|
1216
|
-
api?: FarmIntegrationAPI;
|
|
1217
|
-
schema?: TSchema;
|
|
1218
|
-
config?: FarmIntegrationConfigInput<TConfig, TSchema>;
|
|
1219
|
-
validate?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
|
|
1220
|
-
setup?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
|
|
1221
|
-
ready?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
|
|
1222
|
-
dispose?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
|
|
1223
|
-
log?: FarmIntegrationLogger;
|
|
1224
|
-
routes?: readonly FarmIntegrationRoute<any, any, TSchema>[];
|
|
1225
|
-
endpoints?: FarmIntegrationEndpoints<TSchema>;
|
|
1226
|
-
middleware?: readonly FarmIntegrationMiddleware<TSchema>[];
|
|
1227
|
-
providers?: readonly FarmIntegrationProvider[];
|
|
1228
|
-
documentNavigations?: readonly FarmIntegrationDocumentNavigation[];
|
|
1229
|
-
plugins?: readonly FarmPlugin[];
|
|
1230
|
-
}
|
|
1231
|
-
type FarmIntegrationsUserConfig = Record<string, FarmIntegration<any, any> | undefined>;
|
|
1232
|
-
/** @internal Identifies lifecycle plugins owned by platform-managed integrations. */
|
|
1233
|
-
declare function getFarmIntegrationPluginServerRuntime(plugin: FarmPlugin): boolean | undefined;
|
|
1234
|
-
type IntegrationRouteBuilderOptions<TBody, TQuery, TServer extends boolean, TSchema extends FarmIntegrationSchema | undefined> = {
|
|
1235
|
-
middleware?: readonly FarmIntegrationRouteMiddleware<TSchema>[];
|
|
1236
|
-
before?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
|
|
1237
|
-
after?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
|
|
1238
|
-
rawBody?: boolean;
|
|
1239
|
-
headers?: Record<string, string>;
|
|
1240
|
-
credentials?: RequestCredentials;
|
|
1241
|
-
bodyFormat?: FarmIntegrationAPIBodyFormat;
|
|
1242
|
-
responseFormat?: FarmIntegrationAPIResponseFormat;
|
|
1243
|
-
isServer?: TServer;
|
|
1244
|
-
body?: FarmIntegrationInputSchema<TBody>;
|
|
1245
|
-
query?: FarmIntegrationInputSchema<TQuery>;
|
|
1246
|
-
input?: FarmIntegrationRouteInputSchemas<TBody, TQuery>;
|
|
1247
|
-
handler(request: Request, context: FarmIntegrationHandlerContext<TBody, TQuery, TSchema>): Promise<Response> | Response;
|
|
1248
|
-
};
|
|
1249
|
-
interface FarmIntegrationRouteFactory<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1250
|
-
get<TPath extends string, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: Omit<IntegrationRouteBuilderOptions<never, TQuery, TServer, TSchema>, "bodyFormat">): FarmTypedIntegrationRoute<TPath, never, TQuery, TResponse, TServer, "GET", TSchema>;
|
|
1251
|
-
post<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "POST", TSchema>;
|
|
1252
|
-
put<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "PUT", TSchema>;
|
|
1253
|
-
patch<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "PATCH", TSchema>;
|
|
1254
|
-
delete<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "DELETE", TSchema>;
|
|
1255
|
-
options<TPath extends string, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: Omit<IntegrationRouteBuilderOptions<never, TQuery, TServer, TSchema>, "bodyFormat">): FarmTypedIntegrationRoute<TPath, never, TQuery, TResponse, TServer, "OPTIONS", TSchema>;
|
|
1256
|
-
head<TPath extends string, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: Omit<IntegrationRouteBuilderOptions<never, TQuery, TServer, TSchema>, "bodyFormat">): FarmTypedIntegrationRoute<TPath, never, TQuery, TResponse, TServer, "HEAD", TSchema>;
|
|
1257
|
-
}
|
|
1258
|
-
interface FarmIntegrationRoutesFactoryContext<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
|
|
1259
|
-
route: FarmIntegrationRouteFactory<TSchema>;
|
|
1260
|
-
integrationRoute: FarmIntegrationRouteFactory<TSchema>;
|
|
1261
|
-
}
|
|
1262
|
-
type FarmIntegrationRoutesFactory<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = (context: FarmIntegrationRoutesFactoryContext<TSchema>) => readonly FarmIntegrationRoute<any, any, TSchema>[];
|
|
1263
|
-
type FarmIntegrationEndpointValue<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = FarmIntegrationRoute<any, any, TSchema> | readonly FarmIntegrationEndpointValue<TSchema>[] | {
|
|
1264
|
-
readonly [key: string]: FarmIntegrationEndpointValue<TSchema> | undefined;
|
|
1265
|
-
};
|
|
1266
|
-
type FarmIntegrationEndpoints<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = {
|
|
1267
|
-
readonly [key: string]: FarmIntegrationEndpointValue<TSchema> | undefined;
|
|
1268
|
-
};
|
|
1269
|
-
interface FarmIntegrationEndpointsFactoryContext<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationRoutesFactoryContext<TSchema> {
|
|
1270
|
-
endpoint: FarmIntegrationRouteFactory<TSchema>;
|
|
1271
|
-
}
|
|
1272
|
-
type FarmIntegrationEndpointsFactory<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = (context: FarmIntegrationEndpointsFactoryContext<TSchema>) => FarmIntegrationEndpoints<TSchema>;
|
|
1273
|
-
declare function createIntegrationRoute<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined>(_schema?: TSchema): FarmIntegrationRouteFactory<TSchema>;
|
|
1274
|
-
declare const integrationRoute: FarmIntegrationRouteFactory<undefined>;
|
|
1275
|
-
type RegisteredIntegrationRuntime = {
|
|
1276
|
-
integration: FarmIntegration;
|
|
1277
|
-
config: FarmPluginContext["config"];
|
|
1278
|
-
isDev: boolean;
|
|
1279
|
-
isProd: boolean;
|
|
1280
|
-
};
|
|
1281
|
-
type FarmIntegrationRoutesInput<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = readonly FarmIntegrationRoute<any, any, TSchema>[] | FarmIntegrationRoutesFactory<TSchema>;
|
|
1282
|
-
type FarmIntegrationEndpointsInput<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = FarmIntegrationEndpoints<TSchema> | FarmIntegrationEndpointsFactory<TSchema>;
|
|
1283
|
-
type FarmIntegrationInput<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined, TConfig = unknown> = Omit<FarmIntegration<TSchema, TConfig>, "kind" | "category" | "slot" | "config" | "routes" | "endpoints"> & {
|
|
1284
|
-
config?: FarmIntegrationConfigInput<TConfig, TSchema>;
|
|
1285
|
-
routes?: FarmIntegrationRoutesInput<TSchema>;
|
|
1286
|
-
endpoints?: FarmIntegrationEndpointsInput<TSchema>;
|
|
1287
|
-
} & ({
|
|
1288
|
-
category: FarmIntegrationCategory;
|
|
1289
|
-
slot?: FarmIntegrationCategory;
|
|
1290
|
-
} | {
|
|
1291
|
-
category?: FarmIntegrationCategory;
|
|
1292
|
-
slot: FarmIntegrationCategory;
|
|
1293
|
-
});
|
|
1294
|
-
type FarmIntegrationCategoryInput = {
|
|
1295
|
-
category: FarmIntegrationCategory;
|
|
1296
|
-
slot?: FarmIntegrationCategory;
|
|
1297
|
-
} | {
|
|
1298
|
-
category?: FarmIntegrationCategory;
|
|
1299
|
-
slot: FarmIntegrationCategory;
|
|
1300
|
-
};
|
|
1301
|
-
type FarmIntegrationShapeForInference = FarmIntegrationCategoryInput & {
|
|
1302
|
-
api?: FarmIntegrationAPI;
|
|
1303
|
-
schema?: FarmIntegrationSchema;
|
|
1304
|
-
config?: unknown;
|
|
1305
|
-
routes?: unknown;
|
|
1306
|
-
endpoints?: unknown;
|
|
1307
|
-
};
|
|
1308
|
-
type ExtractIntegrationSchema<TIntegration> = TIntegration extends {
|
|
1309
|
-
schema: infer TSchema extends FarmIntegrationSchema;
|
|
1310
|
-
} ? TSchema : undefined;
|
|
1311
|
-
type ResolveIntegrationRoutesInput<TRoutes, TSchema extends FarmIntegrationSchema | undefined> = TRoutes extends FarmIntegrationRoutesFactory<TSchema> ? ReturnType<TRoutes> : TRoutes;
|
|
1312
|
-
type ResolveIntegrationEndpointsInput<TEndpoints, TSchema extends FarmIntegrationSchema | undefined> = TEndpoints extends FarmIntegrationEndpointsFactory<TSchema> ? ReturnType<TEndpoints> : TEndpoints;
|
|
1313
|
-
type ExtractIntegrationRoutesFromRoutesInput<TRoutes, TSchema extends FarmIntegrationSchema | undefined> = ResolveIntegrationRoutesInput<TRoutes, TSchema> extends readonly (infer TRoute)[] ? TRoute : never;
|
|
1314
|
-
type ExtractIntegrationRoutesFromEndpointValue<TValue> = TValue extends FarmIntegrationRouteOperationCarrier<string, any> ? TValue : TValue extends readonly (infer TItem)[] ? ExtractIntegrationRoutesFromEndpointValue<TItem> : TValue extends object ? ExtractIntegrationRoutesFromEndpointValue<TValue[keyof TValue]> : never;
|
|
1315
|
-
type ExtractIntegrationRoutesFromEndpointsInput<TEndpoints, TSchema extends FarmIntegrationSchema | undefined> = ExtractIntegrationRoutesFromEndpointValue<ResolveIntegrationEndpointsInput<TEndpoints, TSchema>>;
|
|
1316
|
-
type ExtractIntegrationRouteUnion<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = (TIntegration extends {
|
|
1317
|
-
routes: infer TRoutes;
|
|
1318
|
-
} ? ExtractIntegrationRoutesFromRoutesInput<TRoutes, TSchema> : never) | (TIntegration extends {
|
|
1319
|
-
endpoints: infer TEndpoints;
|
|
1320
|
-
} ? ExtractIntegrationRoutesFromEndpointsInput<TEndpoints, TSchema> : never);
|
|
1321
|
-
type ExtractDefinedIntegrationRoutes<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = [ExtractIntegrationRouteUnion<TIntegration, TSchema>] extends [never] ? undefined : readonly ExtractIntegrationRouteUnion<TIntegration, TSchema>[];
|
|
1322
|
-
type ExtractDefinedIntegrationEndpoints<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = TIntegration extends {
|
|
1323
|
-
endpoints: infer TEndpoints;
|
|
1324
|
-
} ? ResolveIntegrationEndpointsInput<TEndpoints, TSchema> : undefined;
|
|
1325
|
-
type ExtractIntegrationAPIRoutes<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = Extract<ExtractIntegrationRouteUnion<TIntegration, TSchema>, FarmIntegrationRouteOperationCarrier<string, any>>;
|
|
1326
|
-
type ExtractIntegrationCategory<TIntegration extends FarmIntegrationCategoryInput> = TIntegration extends {
|
|
1327
|
-
category: infer TCategory extends FarmIntegrationCategory;
|
|
1328
|
-
} ? TCategory : TIntegration extends {
|
|
1329
|
-
slot: infer TSlot extends FarmIntegrationCategory;
|
|
1330
|
-
} ? TSlot : FarmIntegrationCategory;
|
|
1331
|
-
type ExtractDerivedIntegrationAPI<TIntegration extends FarmIntegrationShapeForInference, TSchema extends FarmIntegrationSchema | undefined = ExtractIntegrationSchema<TIntegration>> = TIntegration extends {
|
|
1332
|
-
api: infer TAPI extends FarmIntegrationAPI;
|
|
1333
|
-
} ? TAPI : [ExtractIntegrationAPIRoutes<TIntegration, TSchema>] extends [never] ? FarmIntegrationAPI | undefined : InferIntegrationAPIFromRoutes<readonly ExtractIntegrationAPIRoutes<TIntegration, TSchema>[]>;
|
|
1334
|
-
type DefinedIntegration<TIntegration extends FarmIntegrationShapeForInference, TSchema extends FarmIntegrationSchema | undefined = ExtractIntegrationSchema<TIntegration>> = Omit<TIntegration, "kind" | "category" | "slot" | "api" | "routes" | "endpoints"> & {
|
|
1335
|
-
readonly kind: "farm-integration";
|
|
1336
|
-
category: ExtractIntegrationCategory<TIntegration>;
|
|
1337
|
-
slot: ExtractIntegrationCategory<TIntegration>;
|
|
1338
|
-
routes: ExtractDefinedIntegrationRoutes<TIntegration, TSchema>;
|
|
1339
|
-
endpoints: ExtractDefinedIntegrationEndpoints<TIntegration, TSchema>;
|
|
1340
|
-
api: ExtractDerivedIntegrationAPI<TIntegration, TSchema>;
|
|
1341
|
-
};
|
|
1342
|
-
declare function defineIntegration<const TSchema extends FarmIntegrationSchema | undefined, const TConfig, TIntegration extends FarmIntegrationInput<TSchema, TConfig>>(integration: TIntegration & FarmIntegrationInput<TSchema, TConfig>): DefinedIntegration<TIntegration, TSchema>;
|
|
1343
|
-
declare function isFarmIntegration(value: unknown): value is FarmIntegration;
|
|
1344
|
-
declare function resolveIntegrationPlugins(integrations: FarmIntegrationsUserConfig | undefined): FarmPlugin[];
|
|
1345
|
-
declare function getIntegrationProviders(integrations: FarmIntegrationsUserConfig | undefined): Array<Pick<FarmIntegrationProvider, "name" | "type" | "props">>;
|
|
1346
|
-
declare function getIntegrationDocumentNavigationMatchers(integrations: FarmIntegrationsUserConfig | undefined): string[];
|
|
1347
|
-
declare function getIntegrationSchemas(integrations: FarmIntegrationsUserConfig | undefined): Record<string, FarmIntegrationSchema>;
|
|
1348
|
-
declare function getRegisteredIntegrationRuntime(key: string): RegisteredIntegrationRuntime | undefined;
|
|
1349
|
-
declare function getRegisteredIntegrations(): Record<string, FarmIntegration>;
|
|
1350
|
-
declare function getRegisteredIntegrationSchemas(): Record<string, FarmIntegrationSchema>;
|
|
1351
|
-
declare function matchIntegrationRoute(integrations: FarmIntegrationsUserConfig | undefined, input: {
|
|
1352
|
-
pathname: string;
|
|
1353
|
-
method?: string;
|
|
1354
|
-
}): {
|
|
1355
|
-
key: string;
|
|
1356
|
-
integration: FarmIntegration;
|
|
1357
|
-
route: {
|
|
1358
|
-
path: string;
|
|
1359
|
-
methods: readonly string[];
|
|
1360
|
-
};
|
|
1361
|
-
params: FarmIntegrationRouteParams;
|
|
1362
|
-
} | null;
|
|
1363
|
-
declare function matchRegisteredIntegrationRoute(input: {
|
|
1364
|
-
pathname: string;
|
|
1365
|
-
method?: string;
|
|
1366
|
-
}): {
|
|
1367
|
-
key: string;
|
|
1368
|
-
integration: FarmIntegration;
|
|
1369
|
-
route: {
|
|
1370
|
-
path: string;
|
|
1371
|
-
methods: readonly string[];
|
|
1372
|
-
};
|
|
1373
|
-
params: FarmIntegrationRouteParams;
|
|
1374
|
-
} | null;
|
|
1375
|
-
declare function getRegisteredIntegrationAPIManifest(): Record<string, FarmIntegrationAPI>;
|
|
1376
|
-
declare function dispatchIntegrationRequest(runtime: RegisteredIntegrationRuntime, request: Request, options?: {
|
|
1377
|
-
currentRequest?: Request;
|
|
1378
|
-
data?: FarmIntegrationData;
|
|
1379
|
-
internal?: boolean;
|
|
1380
|
-
}): Promise<Response | null>;
|
|
1381
|
-
|
|
1382
|
-
type NitroPreset = "node-server" | "vercel" | "cloudflare" | "cloudflare-pages" | "netlify" | "netlify-edge" | "bun" | "deno" | "azure" | "aws-lambda" | "firebase" | "custom" | "self-host" | "farm" | string;
|
|
1383
|
-
type FarmMigrationCommand = string | {
|
|
1384
|
-
/** Shell command to run for this migration step. */
|
|
1385
|
-
command: string;
|
|
1386
|
-
/** Optional label printed by the CLI before running the command. */
|
|
1387
|
-
name?: string;
|
|
1388
|
-
/** Working directory for this command, relative to the project root unless absolute. */
|
|
1389
|
-
cwd?: string;
|
|
1390
|
-
/** Additional environment variables for this command. */
|
|
1391
|
-
env?: Record<string, string | undefined>;
|
|
1392
|
-
/** Skip this command without removing it from config. */
|
|
1393
|
-
skip?: boolean;
|
|
1394
|
-
};
|
|
1395
|
-
interface FarmMigrationsConfig {
|
|
1396
|
-
/** One-shot commands that create or update app/integration schemas. */
|
|
1397
|
-
commands?: FarmMigrationCommand[];
|
|
1398
|
-
}
|
|
1399
|
-
type FarmMigrationsUserConfig = FarmMigrationsConfig | FarmMigrationCommand[];
|
|
1400
|
-
interface ResolvedFarmMigrationsConfig {
|
|
1401
|
-
commands: FarmMigrationCommand[];
|
|
1402
|
-
}
|
|
1403
|
-
interface FarmContextFactoryInput {
|
|
1404
|
-
request: Request;
|
|
1405
|
-
rawRequest?: FarmRequest;
|
|
1406
|
-
params: Record<string, string>;
|
|
1407
|
-
search: Record<string, string | string[] | undefined>;
|
|
1408
|
-
path: string;
|
|
1409
|
-
}
|
|
1410
|
-
type FarmContextFactory<TContext = unknown> = (input: FarmContextFactoryInput) => TContext | Promise<TContext>;
|
|
1411
|
-
interface FarmAppContext {
|
|
1412
|
-
}
|
|
1413
|
-
interface FarmConfig {
|
|
1414
|
-
root?: string;
|
|
1415
|
-
/** App source directory. @default "src" */
|
|
1416
|
-
srcDir?: string;
|
|
1417
|
-
extends?: readonly FarmLayerEntry[];
|
|
1418
|
-
/** Resolved layer graph. Populated by config resolution. */
|
|
1419
|
-
layers?: readonly ResolvedFarmLayer[];
|
|
1420
|
-
outDir?: string;
|
|
1421
|
-
basePath?: string;
|
|
1422
|
-
preset?: NitroPreset;
|
|
1423
|
-
deploy?: {
|
|
1424
|
-
target?: "vercel" | "cloudflare" | "netlify" | "node" | string;
|
|
1425
|
-
preset?: NitroPreset;
|
|
1426
|
-
outputDir?: string;
|
|
1427
|
-
output?: string;
|
|
1428
|
-
projectName?: string;
|
|
1429
|
-
vercel?: {
|
|
1430
|
-
outputDirectory?: string;
|
|
1431
|
-
buildCommand?: string;
|
|
1432
|
-
installCommand?: string;
|
|
1433
|
-
framework?: string | null;
|
|
1434
|
-
};
|
|
1435
|
-
cloudflare?: {
|
|
1436
|
-
outputDir?: string;
|
|
1437
|
-
projectName?: string;
|
|
1438
|
-
};
|
|
1439
|
-
netlify?: {
|
|
1440
|
-
outputDir?: string;
|
|
1441
|
-
site?: string;
|
|
1442
|
-
};
|
|
1443
|
-
};
|
|
1444
|
-
storage?: FarmStorageUserConfig;
|
|
1445
|
-
/** Shared application data, route, ISR, and PPR cache. */
|
|
1446
|
-
cache?: FarmCacheUserConfig;
|
|
1447
|
-
integrations?: FarmIntegrationsUserConfig;
|
|
1448
|
-
plugins?: FarmPlugin[];
|
|
1449
|
-
migrations?: FarmMigrationsUserConfig;
|
|
1450
|
-
/** Map portable cron schedules to ordinary GET API routes. */
|
|
1451
|
-
cron?: FarmCronUserConfig | FarmCronResolvedConfig | false;
|
|
1452
|
-
workflows?: FarmWorkflowsUserConfig | boolean;
|
|
1453
|
-
env?: FarmEnvConfig<any, any> | ResolvedFarmEnv;
|
|
1454
|
-
middleware?: FarmMiddlewareConfig;
|
|
1455
|
-
routeRules?: FarmRouteRules;
|
|
1456
|
-
context?: FarmContextFactory<any>;
|
|
1457
|
-
serverActions?: FarmServerActionsConfig;
|
|
1458
|
-
images?: FarmImageConfig;
|
|
1459
|
-
i18n?: FarmI18nUserConfig | ResolvedFarmI18nConfig | false;
|
|
1460
|
-
/** Build identifier used to detect stale clients during rolling deployments. */
|
|
1461
|
-
deploymentId?: string;
|
|
1462
|
-
docs?: FarmDocsUserConfig | FarmDocsResolvedConfig;
|
|
1463
|
-
md?: FarmMarkdownUserConfig | FarmMarkdownResolvedConfig | boolean;
|
|
1464
|
-
mdx?: FarmMdxUserConfig | FarmMdxResolvedConfig;
|
|
1465
|
-
observability?: FarmObservabilityUserConfig;
|
|
1466
|
-
/** Development-only runtime inspector. Enabled by default during `farm dev`. */
|
|
1467
|
-
devtools?: FarmDevtoolsUserConfig;
|
|
1468
|
-
/**
|
|
1469
|
-
* When true, Link href is not strictly typed (accepts any string).
|
|
1470
|
-
* Use when you want to skip route-type errors on Link or don't use generated route types.
|
|
1471
|
-
*/
|
|
1472
|
-
suppressLintOnLink?: boolean;
|
|
1473
|
-
experimental?: {
|
|
1474
|
-
serverComponents?: boolean;
|
|
1475
|
-
serverActions?: boolean;
|
|
1476
|
-
/**
|
|
1477
|
-
* Enable server-only optimized boundaries for host-only content. Boundary
|
|
1478
|
-
* interiors cannot contain Client Components, event handlers, or
|
|
1479
|
-
* independently updating React state.
|
|
1480
|
-
*
|
|
1481
|
-
* @experimental
|
|
1482
|
-
* @default false
|
|
1483
|
-
*/
|
|
1484
|
-
optimizedBoundary?: boolean;
|
|
1485
|
-
};
|
|
1486
|
-
vite?: any;
|
|
1487
|
-
}
|
|
1488
|
-
/**
|
|
1489
|
-
* Middleware data available in page components
|
|
1490
|
-
*/
|
|
1491
|
-
interface MiddlewareProps {
|
|
1492
|
-
/**
|
|
1493
|
-
* Map containing all data set by middleware via ctx.data.set()
|
|
1494
|
-
*
|
|
1495
|
-
* @example
|
|
1496
|
-
* ```tsx
|
|
1497
|
-
* // In middleware.ts
|
|
1498
|
-
* ctx.data.set('user', { id: 1, name: 'John' });
|
|
1499
|
-
*
|
|
1500
|
-
* // In page.tsx
|
|
1501
|
-
* const user = props.middleware?.data.get('user');
|
|
1502
|
-
* ```
|
|
1503
|
-
*/
|
|
1504
|
-
data: Map<string, any>;
|
|
1505
|
-
}
|
|
1506
|
-
/**
|
|
1507
|
-
* Plugin context data available in server page components.
|
|
1508
|
-
* Only values explicitly exposed by plugins are included.
|
|
1509
|
-
*/
|
|
1510
|
-
interface PluginContextProps {
|
|
1511
|
-
data: Map<string, any>;
|
|
1512
|
-
}
|
|
1513
|
-
/**
|
|
1514
|
-
* Page component props
|
|
1515
|
-
*
|
|
1516
|
-
* @param params - Dynamic route parameters (e.g., { id: '123' } for /users/[id])
|
|
1517
|
-
* @param searchParams - URL search/query parameters
|
|
1518
|
-
* @param path - Current pathname
|
|
1519
|
-
* @param middleware - Data set by middleware.ts (optional, available if middleware exists)
|
|
1520
|
-
* @param context - Data explicitly exposed by plugins for this request (optional)
|
|
1521
|
-
*/
|
|
1522
|
-
interface PageProps {
|
|
1523
|
-
params: Record<string, string>;
|
|
1524
|
-
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
1525
|
-
path: string;
|
|
1526
|
-
/**
|
|
1527
|
-
* Data from middleware.ts in the same directory or parent directories
|
|
1528
|
-
* Access data via props.middleware?.data.get('key')
|
|
1529
|
-
*
|
|
1530
|
-
* @example
|
|
1531
|
-
* ```tsx
|
|
1532
|
-
* export default function Page(props: PageProps) {
|
|
1533
|
-
* const user = props.middleware?.data.get('user');
|
|
1534
|
-
* const stats = props.middleware?.data.get('dashboardStats');
|
|
1535
|
-
*
|
|
1536
|
-
* return <div>Welcome {user?.name}</div>;
|
|
1537
|
-
* }
|
|
1538
|
-
* ```
|
|
1539
|
-
*/
|
|
1540
|
-
middleware?: MiddlewareProps;
|
|
1541
|
-
/**
|
|
1542
|
-
* Request-scoped plugin context values explicitly exposed by plugins.
|
|
1543
|
-
* Access data via props.context?.data.get('key').
|
|
1544
|
-
*/
|
|
1545
|
-
context?: PluginContextProps;
|
|
1546
|
-
}
|
|
1547
|
-
interface LoadingProps {
|
|
1548
|
-
params: Record<string, string>;
|
|
1549
|
-
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
1550
|
-
search?: Record<string, string | string[] | undefined>;
|
|
1551
|
-
path: string;
|
|
1552
|
-
middleware?: MiddlewareProps;
|
|
1553
|
-
context?: PluginContextProps;
|
|
1554
|
-
}
|
|
1555
|
-
interface ErrorProps extends LoadingProps {
|
|
1556
|
-
error: unknown;
|
|
1557
|
-
reset: () => void;
|
|
1558
|
-
}
|
|
1559
|
-
/**
|
|
1560
|
-
* Helper type to create typed page props with specific middleware data shape
|
|
1561
|
-
*
|
|
1562
|
-
* @example
|
|
1563
|
-
* ```tsx
|
|
1564
|
-
* interface MyMiddlewareData {
|
|
1565
|
-
* user: { id: number; name: string };
|
|
1566
|
-
* stats: { views: number };
|
|
1567
|
-
* }
|
|
1568
|
-
*
|
|
1569
|
-
* type MyPageProps = PagePropsWithMiddleware<MyMiddlewareData>;
|
|
1570
|
-
*
|
|
1571
|
-
* export default function Page(props: MyPageProps) {
|
|
1572
|
-
* const user = props.middleware?.data.get('user'); // Fully typed!
|
|
1573
|
-
* const stats = props.middleware?.data.get('stats'); // Fully typed!
|
|
1574
|
-
*
|
|
1575
|
-
* return <div>Welcome {user?.name}</div>;
|
|
1576
|
-
* }
|
|
1577
|
-
* ```
|
|
1578
|
-
*/
|
|
1579
|
-
type PagePropsWithMiddleware<T extends Record<string, any>> = PageProps & {
|
|
1580
|
-
middleware: {
|
|
1581
|
-
data: Map<keyof T, T[keyof T]>;
|
|
1582
|
-
};
|
|
1583
|
-
};
|
|
1584
|
-
interface LayoutProps {
|
|
1585
|
-
children: ReactNode;
|
|
1586
|
-
params: Record<string, string>;
|
|
1587
|
-
}
|
|
1588
|
-
type Page = ComponentType<PageProps>;
|
|
1589
|
-
type Layout = ComponentType<LayoutProps>;
|
|
1590
|
-
type Loading = ComponentType<LoadingProps>;
|
|
1591
|
-
type ErrorBoundary = ComponentType<ErrorProps>;
|
|
1592
|
-
/**
|
|
1593
|
-
* Route module exports for pages
|
|
1594
|
-
*
|
|
1595
|
-
* SSR is the default - pages render on each request
|
|
1596
|
-
* SSG is opt-in via `export const ssg = true`, Next-compatible route
|
|
1597
|
-
* config exports, or a top-of-file rendering directive.
|
|
1598
|
-
*
|
|
1599
|
-
* @example SSR Page (default):
|
|
1600
|
-
* ```tsx
|
|
1601
|
-
* export default async function Page() {
|
|
1602
|
-
* const data = await fetchData();
|
|
1603
|
-
* return <div>{data.title}</div>;
|
|
1604
|
-
* }
|
|
1605
|
-
* ```
|
|
1606
|
-
*
|
|
1607
|
-
* @example SSG Page:
|
|
1608
|
-
* ```tsx
|
|
1609
|
-
* export const ssg = true;
|
|
1610
|
-
*
|
|
1611
|
-
* export default function AboutPage() {
|
|
1612
|
-
* return <h1>About Us</h1>;
|
|
1613
|
-
* }
|
|
1614
|
-
* ```
|
|
1615
|
-
*
|
|
1616
|
-
* @example SSG with Revalidation (ISR):
|
|
1617
|
-
* ```tsx
|
|
1618
|
-
* export const ssg = true;
|
|
1619
|
-
* export const revalidate = 60; // Regenerate every 60 seconds
|
|
1620
|
-
*
|
|
1621
|
-
* export default async function ProductsPage() {
|
|
1622
|
-
* const products = await fetchProducts();
|
|
1623
|
-
* return <ProductList products={products} />;
|
|
1624
|
-
* }
|
|
1625
|
-
* ```
|
|
1626
|
-
*
|
|
1627
|
-
* @example Dynamic SSG Route:
|
|
1628
|
-
* ```tsx
|
|
1629
|
-
* export const ssg = true;
|
|
1630
|
-
*
|
|
1631
|
-
* export async function getStaticPaths() {
|
|
1632
|
-
* const posts = await fetchPosts();
|
|
1633
|
-
* return posts.map(post => ({ slug: post.slug }));
|
|
1634
|
-
* }
|
|
1635
|
-
*
|
|
1636
|
-
* export default async function BlogPost({ params }) {
|
|
1637
|
-
* const post = await fetchPost(params.slug);
|
|
1638
|
-
* return <article>{post.title}</article>;
|
|
1639
|
-
* }
|
|
1640
|
-
* ```
|
|
1641
|
-
*
|
|
1642
|
-
* @example Next-compatible Route Config:
|
|
1643
|
-
* ```tsx
|
|
1644
|
-
* export const dynamic = "force-static";
|
|
1645
|
-
* export const revalidate = 60;
|
|
1646
|
-
*
|
|
1647
|
-
* export default function DocsPage() {
|
|
1648
|
-
* return <h1>Docs</h1>;
|
|
1649
|
-
* }
|
|
1650
|
-
* ```
|
|
1651
|
-
*
|
|
1652
|
-
* @example Directive Route Config:
|
|
1653
|
-
* ```tsx
|
|
1654
|
-
* "use ssg; 60";
|
|
1655
|
-
*
|
|
1656
|
-
* export default function DocsPage() {
|
|
1657
|
-
* return <h1>Docs</h1>;
|
|
1658
|
-
* }
|
|
1659
|
-
* ```
|
|
1660
|
-
*/
|
|
1661
|
-
interface RouteModule {
|
|
1662
|
-
default?: Page;
|
|
1663
|
-
/** Execution runtime for this route. Layout values are inherited unless overridden. */
|
|
1664
|
-
runtime?: FarmRouteRuntime;
|
|
1665
|
-
/** Provider-specific execution regions, or "auto" to clear an inherited value. */
|
|
1666
|
-
regions?: FarmRouteRegions;
|
|
1667
|
-
/** Maximum execution time in seconds, or "auto" to use the provider default. */
|
|
1668
|
-
maxDuration?: FarmRouteMaxDuration;
|
|
1669
|
-
/**
|
|
1670
|
-
* Mark this page for Static Site Generation (SSG)
|
|
1671
|
-
* When true, the page will be pre-rendered at build time
|
|
1672
|
-
*/
|
|
1673
|
-
ssg?: boolean;
|
|
1674
|
-
/**
|
|
1675
|
-
* Revalidate interval in seconds for Incremental Static Regeneration (ISR)
|
|
1676
|
-
* Only applicable when ssg = true
|
|
1677
|
-
*/
|
|
1678
|
-
revalidate?: number | false;
|
|
1679
|
-
/**
|
|
1680
|
-
* Next.js-compatible rendering mode.
|
|
1681
|
-
* - force-static/error: pre-render at build time
|
|
1682
|
-
* - force-dynamic: render on each request
|
|
1683
|
-
*/
|
|
1684
|
-
dynamic?: "auto" | "force-static" | "force-dynamic" | "error";
|
|
1685
|
-
/**
|
|
1686
|
-
* Opt into Partial Prerendering/static-shell caching for this route.
|
|
1687
|
-
* Compatible with Farm's `ppr` export and Next.js `experimental_ppr`.
|
|
1688
|
-
*/
|
|
1689
|
-
ppr?: boolean;
|
|
1690
|
-
experimental_ppr?: boolean;
|
|
1691
|
-
/**
|
|
1692
|
-
* Return all paths to pre-render for dynamic SSG routes
|
|
1693
|
-
* Required for dynamic routes (e.g., [slug]) when ssg = true
|
|
1694
|
-
*/
|
|
1695
|
-
getStaticPaths?: () => Promise<StaticPathParams[]> | StaticPathParams[];
|
|
1696
|
-
/**
|
|
1697
|
-
* @deprecated Use getStaticPaths instead
|
|
1698
|
-
*/
|
|
1699
|
-
generateStaticParams?: () => Promise<StaticPathParams[]> | StaticPathParams[];
|
|
1700
|
-
metadata?: Metadata & Record<string, any>;
|
|
1701
|
-
generateMetadata?: (props: PageProps) => Promise<Metadata> | Metadata;
|
|
1702
|
-
}
|
|
1703
|
-
/** A value accepted for one static route parameter. */
|
|
1704
|
-
type StaticPathPrimitive = string | number | boolean;
|
|
1705
|
-
/**
|
|
1706
|
-
* Parameters returned by `getStaticPaths` or `generateStaticParams`.
|
|
1707
|
-
* Arrays create individual URL segments for catch-all route parameters.
|
|
1708
|
-
*/
|
|
1709
|
-
type StaticPathParams = Record<string, StaticPathPrimitive | readonly StaticPathPrimitive[]>;
|
|
1710
|
-
interface LayoutModule {
|
|
1711
|
-
default: Layout;
|
|
1712
|
-
runtime?: FarmRouteRuntime;
|
|
1713
|
-
regions?: FarmRouteRegions;
|
|
1714
|
-
maxDuration?: FarmRouteMaxDuration;
|
|
1715
|
-
metadata?: Metadata & Record<string, any>;
|
|
1716
|
-
generateMetadata?: (props: {
|
|
1717
|
-
params: Record<string, string>;
|
|
1718
|
-
}) => Promise<Metadata> | Metadata;
|
|
1719
|
-
}
|
|
1720
|
-
interface Metadata {
|
|
1721
|
-
metadataBase?: string | URL;
|
|
1722
|
-
title?: string | {
|
|
1723
|
-
default?: string;
|
|
1724
|
-
template?: string;
|
|
1725
|
-
};
|
|
1726
|
-
description?: string;
|
|
1727
|
-
keywords?: string | string[];
|
|
1728
|
-
author?: string;
|
|
1729
|
-
authors?: Array<{
|
|
1730
|
-
name: string;
|
|
1731
|
-
url?: string;
|
|
1732
|
-
}>;
|
|
1733
|
-
creator?: string;
|
|
1734
|
-
publisher?: string;
|
|
1735
|
-
robots?: string | {
|
|
1736
|
-
index?: boolean;
|
|
1737
|
-
follow?: boolean;
|
|
1738
|
-
};
|
|
1739
|
-
openGraph?: {
|
|
1740
|
-
title?: string;
|
|
1741
|
-
description?: string;
|
|
1742
|
-
url?: string;
|
|
1743
|
-
siteName?: string;
|
|
1744
|
-
images?: string | {
|
|
1745
|
-
url: string;
|
|
1746
|
-
width?: number;
|
|
1747
|
-
height?: number;
|
|
1748
|
-
alt?: string;
|
|
1749
|
-
type?: string;
|
|
1750
|
-
} | Array<{
|
|
1751
|
-
url: string;
|
|
1752
|
-
width?: number;
|
|
1753
|
-
height?: number;
|
|
1754
|
-
alt?: string;
|
|
1755
|
-
type?: string;
|
|
1756
|
-
}>;
|
|
1757
|
-
image?: string;
|
|
1758
|
-
type?: string;
|
|
1759
|
-
locale?: string;
|
|
1760
|
-
};
|
|
1761
|
-
twitter?: {
|
|
1762
|
-
card?: "summary" | "summary_large_image" | "app" | "player";
|
|
1763
|
-
site?: string;
|
|
1764
|
-
creator?: string;
|
|
1765
|
-
title?: string;
|
|
1766
|
-
description?: string;
|
|
1767
|
-
images?: string | {
|
|
1768
|
-
url: string;
|
|
1769
|
-
width?: number;
|
|
1770
|
-
height?: number;
|
|
1771
|
-
alt?: string;
|
|
1772
|
-
type?: string;
|
|
1773
|
-
} | Array<string | {
|
|
1774
|
-
url: string;
|
|
1775
|
-
width?: number;
|
|
1776
|
-
height?: number;
|
|
1777
|
-
alt?: string;
|
|
1778
|
-
type?: string;
|
|
1779
|
-
}>;
|
|
1780
|
-
};
|
|
1781
|
-
alternates?: {
|
|
1782
|
-
canonical?: string;
|
|
1783
|
-
languages?: Record<string, string>;
|
|
1784
|
-
};
|
|
1785
|
-
icons?: string | {
|
|
1786
|
-
icon?: string | Array<string | {
|
|
1787
|
-
url: string;
|
|
1788
|
-
sizes?: string;
|
|
1789
|
-
type?: string;
|
|
1790
|
-
}>;
|
|
1791
|
-
shortcut?: string | Array<string | {
|
|
1792
|
-
url: string;
|
|
1793
|
-
sizes?: string;
|
|
1794
|
-
type?: string;
|
|
1795
|
-
}>;
|
|
1796
|
-
apple?: string | Array<string | {
|
|
1797
|
-
url: string;
|
|
1798
|
-
sizes?: string;
|
|
1799
|
-
type?: string;
|
|
1800
|
-
}>;
|
|
1801
|
-
};
|
|
1802
|
-
manifest?: string;
|
|
1803
|
-
}
|
|
1804
|
-
interface FarmRequest extends IncomingMessage {
|
|
1805
|
-
params?: Record<string, string>;
|
|
1806
|
-
query?: Record<string, string | string[]>;
|
|
1807
|
-
body?: any;
|
|
1808
|
-
}
|
|
1809
|
-
interface FarmResponse extends ServerResponse {
|
|
1810
|
-
json: (data: any) => void;
|
|
1811
|
-
status: (code: number) => FarmResponse;
|
|
1812
|
-
redirect: (url: string, status?: number) => void;
|
|
1813
|
-
}
|
|
1814
|
-
type ServerAction = (...args: any[]) => Promise<any>;
|
|
1815
|
-
interface RouteSegment {
|
|
1816
|
-
segment: string;
|
|
1817
|
-
isDynamic: boolean;
|
|
1818
|
-
isOptional: boolean;
|
|
1819
|
-
isCatchAll: boolean;
|
|
1820
|
-
}
|
|
1821
|
-
interface ParsedRoute {
|
|
1822
|
-
segments: RouteSegment[];
|
|
1823
|
-
filePath: string;
|
|
1824
|
-
type: "page" | "layout" | "loading" | "error" | "not-found";
|
|
1825
|
-
}
|
|
1826
|
-
interface BuildOptions {
|
|
1827
|
-
mode: "development" | "production";
|
|
1828
|
-
ssr: boolean;
|
|
1829
|
-
minify: boolean;
|
|
1830
|
-
sourcemap: boolean;
|
|
1831
|
-
}
|
|
1832
|
-
/**
|
|
1833
|
-
* Represents a page to be pre-rendered at build time (SSG)
|
|
1834
|
-
*/
|
|
1835
|
-
interface SSGPage {
|
|
1836
|
-
/** The URL path for this page */
|
|
1837
|
-
urlPath: string;
|
|
1838
|
-
/** The file path to the page module */
|
|
1839
|
-
filePath: string;
|
|
1840
|
-
/** Route parameters for dynamic routes */
|
|
1841
|
-
params: Record<string, string>;
|
|
1842
|
-
/** Revalidation interval in seconds (ISR) */
|
|
1843
|
-
revalidate?: number;
|
|
1844
|
-
}
|
|
1845
|
-
/**
|
|
1846
|
-
* Result of SSG page collection
|
|
1847
|
-
*/
|
|
1848
|
-
interface SSGCollectionResult {
|
|
1849
|
-
/** Pages to pre-render at build time */
|
|
1850
|
-
ssg: SSGPage[];
|
|
1851
|
-
/** Routes that will be server-rendered on each request */
|
|
1852
|
-
ssr: string[];
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
|
-
export { type ResolvedFarmDevtoolsConfig as $, type FarmLayerEntry as A, type BuildOptions as B, type ResolvedFarmLayer as C, type FarmSourceRoot as D, type ErrorProps as E, type FarmConfig as F, type ResolveFarmLayersOptions as G, type FarmLayerResolution as H, resolveFarmLayers as I, getFarmSourceRoots as J, getFarmAppDirectories as K, type LoadingProps as L, type MiddlewareProps as M, type NitroPreset as N, getFarmLayerAliases as O, type PluginContextProps as P, loadFarmConfigFile as Q, type ResolvedFarmMigrationsConfig as R, type StaticPathPrimitive as S, type FarmUserConfig as T, type BundleResultPayload as U, type FarmPlugin as V, type FarmIntegration as W, type ReadonlyMiddlewareStore as X, type FarmMiddlewareConfig as Y, type MiddlewareModule as Z, type FarmMdxResolvedConfig as _, type FarmMigrationCommand as a, type FarmIntegrationRouteParams as a$, type OpenAPIConfig as a0, definePlugin as a1, PluginManager as a2, resolveConfig as a3, loadConfig as a4, resolveDeployConfig as a5, resolveMigrationsConfig as a6, resolveDeployOutputPath as a7, normalizeDeployTarget as a8, getDeployTargetForPreset as a9, type FarmPluginClientConfig as aA, type RouteDiscoveredPayload as aB, type RoutesGeneratedPayload as aC, type MiddlewareDiscoveredPayload as aD, type APIRouteDiscoveredPayload as aE, type RouteMatchPayload as aF, type RouteMatchResultPayload as aG, type RenderLifecyclePayload as aH, type APIHandlerLifecyclePayload as aI, type ErrorLifecyclePayload as aJ, type HMRUpdatePayload as aK, type BundleLifecyclePayload as aL, type NitroBuildLifecyclePayload as aM, type ShutdownPayload as aN, type ResolvedFarmConfig as aO, type RedirectConfig as aP, type HeaderConfig as aQ, type RewriteConfig as aR, type ImageConfig as aS, type I18nConfig as aT, type MiddlewareConfig as aU, type FarmDeployConfig as aV, type ResolvedFarmDeployConfig as aW, type FarmDeployTarget as aX, type FarmIntegrationCategory as aY, type FarmIntegrationSlot as aZ, type FarmIntegrationRouteParamValue as a_, getPresetForDeployTarget as aa, type FarmLayerConfig as ab, type PluginRequestContext as ac, type FarmPluginContext as ad, type FarmRequestPluginContext as ae, type FarmRequestStore as af, type FarmPluginRuntimeKind as ag, type FarmPluginRouteRuntimePayload as ah, type FarmPluginSetupContext as ai, type FarmPluginStateContext as aj, type FarmPluginRuntimeBaseEvent as ak, type FarmPluginRuntimeContextEvent as al, type FarmPluginRuntimeBeforeEvent as am, type FarmPluginRuntimeAfterEvent as an, type FarmPluginRuntimeErrorEvent as ao, type FarmPluginRuntimeStartEvent as ap, type FarmPluginRuntimeCloseEvent as aq, type FarmPluginRuntimeHooks as ar, type FarmPluginRuntimeRequestOptions as as, type FarmPluginRuntimeRequestHandler as at, type FarmPluginRuntimeSession as au, type FarmPluginDiscoveredRoute as av, type FarmPluginRouterHooks as aw, type FarmPluginRenderHooks as ax, type FarmPluginBuildHooks as ay, type FarmPluginDevHooks as az, type FarmMigrationsConfig as b, getRegisteredIntegrationRuntime as b$, type FarmIntegrationRouteMethod as b0, type FarmIntegrationRouteInputSource as b1, type FarmIntegrationValidationPathSegment as b2, type FarmIntegrationRouteInput as b3, type FarmIntegrationValidationIssue as b4, type FarmIntegrationValidationErrorLike as b5, type FarmIntegrationValidationResult as b6, type FarmIntegrationStandardValidationResult as b7, type FarmIntegrationInputSchema as b8, type FarmIntegrationRouteInputSchemas as b9, type FarmIntegrationSchemaConstraint as bA, type FarmIntegrationSchemaModel as bB, type FarmIntegrationSchemaModelExtension as bC, type FarmIntegrationSchemaModelOverride as bD, type FarmIntegrationSchema as bE, defineIntegrationSchema as bF, type FarmIntegrationLogPhase as bG, type FarmIntegrationLogEvent as bH, type FarmIntegrationLogger as bI, type FarmIntegrationsUserConfig as bJ, getFarmIntegrationPluginServerRuntime as bK, type FarmIntegrationRouteFactory as bL, type FarmIntegrationRoutesFactoryContext as bM, type FarmIntegrationRoutesFactory as bN, type FarmIntegrationEndpointValue as bO, type FarmIntegrationEndpoints as bP, type FarmIntegrationEndpointsFactoryContext as bQ, type FarmIntegrationEndpointsFactory as bR, createIntegrationRoute as bS, integrationRoute as bT, type DefinedIntegration as bU, defineIntegration as bV, isFarmIntegration as bW, resolveIntegrationPlugins as bX, getIntegrationProviders as bY, getIntegrationDocumentNavigationMatchers as bZ, getIntegrationSchemas as b_, type FarmIntegrationRequestContextStore as ba, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bb, type FarmIntegrationRouteDb as bc, type FarmIntegrationRouteStorageArgs as bd, type FarmIntegrationRouteArgs as be, type FarmIntegrationConfigContext as bf, type FarmIntegrationConfigDefinition as bg, type FarmIntegrationConfigInput as bh, type FarmIntegrationLifecycleLogLevel as bi, type FarmIntegrationLifecycleLogger as bj, type FarmIntegrationLifecycleContext as bk, type FarmIntegrationLifecycleHook as bl, type FarmIntegrationData as bm, type FarmIntegrationHandlerContext as bn, type FarmIntegrationRouteHookContext as bo, type FarmIntegrationRouteHook as bp, type FarmIntegrationRoute as bq, type FarmTypedIntegrationRoute as br, type FarmIntegrationRouteMiddleware as bs, type FarmIntegrationMiddleware as bt, type FarmIntegrationProviderProps as bu, type FarmIntegrationProvider as bv, type FarmIntegrationDocumentNavigation as bw, type FarmIntegrationSchemaFieldType as bx, type FarmIntegrationSchemaReference as by, type FarmIntegrationSchemaField as bz, type FarmMigrationsUserConfig as c, getRegisteredIntegrations as c0, getRegisteredIntegrationSchemas as c1, matchIntegrationRoute as c2, matchRegisteredIntegrationRoute as c3, getRegisteredIntegrationAPIManifest as c4, dispatchIntegrationRequest as c5, type FarmIntegrationOrmSchema as c6, type FarmIntegrationOrmClient as c7, type InferFarmIntegrationOrmField as c8, type InferFarmIntegrationOrmFields as c9, routeRulesToRedirects as cA, routeRulesToHeaders as cB, routeRulesToNitroRouteRules as cC, type FarmMdxComponent as cD, type FarmMdxComponents as cE, type FarmMdxUserConfig as cF, type FarmMarkdownPageSource as cG, type FarmMarkdownPageModuleInput as cH, resolveMdxConfig as cI, isFarmMarkdownPageFile as cJ, normalizeFarmMarkdownRoutePath as cK, parseMarkdownFrontmatter as cL, titleFromMarkdown as cM, createMarkdownMetadata as cN, createFarmMarkdownRouteModule as cO, createFarmMarkdownRouteModuleFromFile as cP, loadFarmMdxComponents as cQ, createFarmMarkdownSourceResponse as cR, DEFAULT_FARM_DEVTOOLS_SHORTCUT as cS, FARM_DEVTOOLS_PATH as cT, FARM_DEVTOOLS_LAUNCH_PARAM as cU, type FarmDevtoolsConfig as cV, type FarmDevtoolsUserConfig as cW, resolveFarmDevtoolsConfig as cX, type MiddlewareConfig$1 as cY, farmI18nClientBridgePlugin as cZ, rewriteEarlySsrRelativeImports as c_, type InferFarmIntegrationOrmSchema as ca, type InferFarmIntegrationOrmClient as cb, type CreateIntegrationOrmOptions as cc, createIntegrationOrm as cd, resolveIntegrationOrmRuntimeClient as ce, farmIntegrationSchemaToOrmSchema as cf, type IntegrationOrmModelNames as cg, type MiddlewareContext as ch, type MiddlewareFunction as ci, type RequestMiddleware as cj, type RequestMiddlewareContext as ck, type MiddlewareStore as cl, type MiddlewareChain as cm, type CookieJar as cn, type CookieOptions as co, type RateLimitConfig as cp, type RateLimitStorage as cq, type RateLimitStatus as cr, type NextFunction as cs, type MiddlewareResult as ct, type FarmRouteRuleRenderMode as cu, type FarmRouteRuleRedirect as cv, type FarmRouteRuleCors as cw, type FarmRouteRule as cx, type FarmRouteRules as cy, normalizeRouteRules as cz, defineConfig as d, type FarmContextFactoryInput as e, farmPlugin as f, type FarmContextFactory as g, type FarmAppContext as h, type PageProps as i, type PagePropsWithMiddleware as j, type LayoutProps as k, type Page as l, type Layout as m, type Loading as n, type ErrorBoundary as o, type RouteModule as p, type StaticPathParams as q, type LayoutModule as r, type Metadata as s, type FarmRequest as t, type FarmResponse as u, type ServerAction as v, type RouteSegment as w, type ParsedRoute as x, type SSGPage as y, type SSGCollectionResult as z };
|