@farm.js/core 0.1.0-beta.0
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/LICENSE +22 -0
- package/README.md +11 -0
- package/dist/after.cjs +227 -0
- package/dist/after.cjs.map +1 -0
- package/dist/after.d.mts +25 -0
- package/dist/after.d.ts +25 -0
- package/dist/after.mjs +14 -0
- package/dist/after.mjs.map +1 -0
- package/dist/agent-runtime.cjs +2379 -0
- package/dist/agent-runtime.cjs.map +1 -0
- package/dist/agent-runtime.d.mts +93 -0
- package/dist/agent-runtime.d.ts +93 -0
- package/dist/agent-runtime.mjs +479 -0
- package/dist/agent-runtime.mjs.map +1 -0
- package/dist/api/route-manager.cjs +1196 -0
- package/dist/api/route-manager.cjs.map +1 -0
- package/dist/api/route-manager.d.mts +64 -0
- package/dist/api/route-manager.d.ts +64 -0
- package/dist/api/route-manager.mjs +34 -0
- package/dist/api/route-manager.mjs.map +1 -0
- package/dist/api/runtime.cjs +272 -0
- package/dist/api/runtime.cjs.map +1 -0
- package/dist/api/runtime.d.mts +16 -0
- package/dist/api/runtime.d.ts +16 -0
- package/dist/api/runtime.mjs +16 -0
- package/dist/api/runtime.mjs.map +1 -0
- package/dist/api.cjs +3199 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.mts +190 -0
- package/dist/api.d.ts +190 -0
- package/dist/api.mjs +63 -0
- package/dist/api.mjs.map +1 -0
- package/dist/app-BiX4qb-d.d.mts +265 -0
- package/dist/app-CFRNJXP1.d.ts +265 -0
- package/dist/app-markdown.cjs +220 -0
- package/dist/app-markdown.cjs.map +1 -0
- package/dist/app-markdown.d.mts +21 -0
- package/dist/app-markdown.d.ts +21 -0
- package/dist/app-markdown.mjs +26 -0
- package/dist/app-markdown.mjs.map +1 -0
- package/dist/cache.cjs +543 -0
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.mts +78 -0
- package/dist/cache.d.ts +78 -0
- package/dist/cache.mjs +38 -0
- package/dist/cache.mjs.map +1 -0
- package/dist/chunk-25D7G34K.mjs +142 -0
- package/dist/chunk-25D7G34K.mjs.map +1 -0
- package/dist/chunk-3QJO55ZF.mjs +3548 -0
- package/dist/chunk-3QJO55ZF.mjs.map +1 -0
- package/dist/chunk-3XNTL3FQ.mjs +452 -0
- package/dist/chunk-3XNTL3FQ.mjs.map +1 -0
- package/dist/chunk-44ZCFSKE.mjs +84 -0
- package/dist/chunk-44ZCFSKE.mjs.map +1 -0
- package/dist/chunk-4PTK6KT4.mjs +364 -0
- package/dist/chunk-4PTK6KT4.mjs.map +1 -0
- package/dist/chunk-4S3ORGFA.mjs +44 -0
- package/dist/chunk-4S3ORGFA.mjs.map +1 -0
- package/dist/chunk-5BY76U2M.mjs +1 -0
- package/dist/chunk-5BY76U2M.mjs.map +1 -0
- package/dist/chunk-5ZGPRGWV.mjs +136 -0
- package/dist/chunk-5ZGPRGWV.mjs.map +1 -0
- package/dist/chunk-6XDUHOEM.mjs +157 -0
- package/dist/chunk-6XDUHOEM.mjs.map +1 -0
- package/dist/chunk-74YTBPTY.mjs +450 -0
- package/dist/chunk-74YTBPTY.mjs.map +1 -0
- package/dist/chunk-7HO6AEOP.mjs +74 -0
- package/dist/chunk-7HO6AEOP.mjs.map +1 -0
- package/dist/chunk-7MABZJIM.mjs +29 -0
- package/dist/chunk-7MABZJIM.mjs.map +1 -0
- package/dist/chunk-7ZY5AIJO.mjs +161 -0
- package/dist/chunk-7ZY5AIJO.mjs.map +1 -0
- package/dist/chunk-AGS7UJ52.mjs +446 -0
- package/dist/chunk-AGS7UJ52.mjs.map +1 -0
- package/dist/chunk-AZ7YUVNR.mjs +65 -0
- package/dist/chunk-AZ7YUVNR.mjs.map +1 -0
- package/dist/chunk-B232I2GP.mjs +163 -0
- package/dist/chunk-B232I2GP.mjs.map +1 -0
- package/dist/chunk-B6N4ZB2H.mjs +718 -0
- package/dist/chunk-B6N4ZB2H.mjs.map +1 -0
- package/dist/chunk-BHG3LVHH.mjs +176 -0
- package/dist/chunk-BHG3LVHH.mjs.map +1 -0
- package/dist/chunk-C3DLZMBU.mjs +597 -0
- package/dist/chunk-C3DLZMBU.mjs.map +1 -0
- package/dist/chunk-CGILA3WO.mjs +14 -0
- package/dist/chunk-CGILA3WO.mjs.map +1 -0
- package/dist/chunk-CHFHNEMO.mjs +7088 -0
- package/dist/chunk-CHFHNEMO.mjs.map +1 -0
- package/dist/chunk-E2MPIBRE.mjs +149 -0
- package/dist/chunk-E2MPIBRE.mjs.map +1 -0
- package/dist/chunk-E6EPN5BT.mjs +203 -0
- package/dist/chunk-E6EPN5BT.mjs.map +1 -0
- package/dist/chunk-EVGBEZDF.mjs +215 -0
- package/dist/chunk-EVGBEZDF.mjs.map +1 -0
- package/dist/chunk-FQYDHKKU.mjs +128 -0
- package/dist/chunk-FQYDHKKU.mjs.map +1 -0
- package/dist/chunk-G3B5BRDY.mjs +5763 -0
- package/dist/chunk-G3B5BRDY.mjs.map +1 -0
- package/dist/chunk-GN72QAIH.mjs +146 -0
- package/dist/chunk-GN72QAIH.mjs.map +1 -0
- package/dist/chunk-GS6K5OCM.mjs +407 -0
- package/dist/chunk-GS6K5OCM.mjs.map +1 -0
- package/dist/chunk-GY2STC2S.mjs +180 -0
- package/dist/chunk-GY2STC2S.mjs.map +1 -0
- package/dist/chunk-GZP5W4K3.mjs +158 -0
- package/dist/chunk-GZP5W4K3.mjs.map +1 -0
- package/dist/chunk-H2FA2SBS.mjs +51 -0
- package/dist/chunk-H2FA2SBS.mjs.map +1 -0
- package/dist/chunk-HXP3ZSPC.mjs +211 -0
- package/dist/chunk-HXP3ZSPC.mjs.map +1 -0
- package/dist/chunk-ITN462YM.mjs +98 -0
- package/dist/chunk-ITN462YM.mjs.map +1 -0
- package/dist/chunk-J23HNLFY.mjs +72 -0
- package/dist/chunk-J23HNLFY.mjs.map +1 -0
- package/dist/chunk-J4FNJ5IU.mjs +179 -0
- package/dist/chunk-J4FNJ5IU.mjs.map +1 -0
- package/dist/chunk-JK25YEN6.mjs +219 -0
- package/dist/chunk-JK25YEN6.mjs.map +1 -0
- package/dist/chunk-JLWMCADZ.mjs +204 -0
- package/dist/chunk-JLWMCADZ.mjs.map +1 -0
- package/dist/chunk-JN3UU635.mjs +622 -0
- package/dist/chunk-JN3UU635.mjs.map +1 -0
- package/dist/chunk-K4667E2Q.mjs +1916 -0
- package/dist/chunk-K4667E2Q.mjs.map +1 -0
- package/dist/chunk-LGHEOHBU.mjs +218 -0
- package/dist/chunk-LGHEOHBU.mjs.map +1 -0
- package/dist/chunk-LLC7BNXW.mjs +275 -0
- package/dist/chunk-LLC7BNXW.mjs.map +1 -0
- package/dist/chunk-LM2YNO4U.mjs +24 -0
- package/dist/chunk-LM2YNO4U.mjs.map +1 -0
- package/dist/chunk-NNLCAVB6.mjs +391 -0
- package/dist/chunk-NNLCAVB6.mjs.map +1 -0
- package/dist/chunk-O3HADRW6.mjs +639 -0
- package/dist/chunk-O3HADRW6.mjs.map +1 -0
- package/dist/chunk-OYXO65LI.mjs +119 -0
- package/dist/chunk-OYXO65LI.mjs.map +1 -0
- package/dist/chunk-P7QDS5AT.mjs +191 -0
- package/dist/chunk-P7QDS5AT.mjs.map +1 -0
- package/dist/chunk-PRNYWD7K.mjs +599 -0
- package/dist/chunk-PRNYWD7K.mjs.map +1 -0
- package/dist/chunk-QF4PHCMA.mjs +422 -0
- package/dist/chunk-QF4PHCMA.mjs.map +1 -0
- package/dist/chunk-QFQRHRZS.mjs +1224 -0
- package/dist/chunk-QFQRHRZS.mjs.map +1 -0
- package/dist/chunk-QGOHVJ6J.mjs +63 -0
- package/dist/chunk-QGOHVJ6J.mjs.map +1 -0
- package/dist/chunk-QKVUNGAH.mjs +39 -0
- package/dist/chunk-QKVUNGAH.mjs.map +1 -0
- package/dist/chunk-QM6VV26B.mjs +149 -0
- package/dist/chunk-QM6VV26B.mjs.map +1 -0
- package/dist/chunk-RHIFZZUI.mjs +69 -0
- package/dist/chunk-RHIFZZUI.mjs.map +1 -0
- package/dist/chunk-RKI6TN3A.mjs +49 -0
- package/dist/chunk-RKI6TN3A.mjs.map +1 -0
- package/dist/chunk-RSKVYESE.mjs +187 -0
- package/dist/chunk-RSKVYESE.mjs.map +1 -0
- package/dist/chunk-S2XHZS7W.mjs +180 -0
- package/dist/chunk-S2XHZS7W.mjs.map +1 -0
- package/dist/chunk-SCFX4UTD.mjs +28 -0
- package/dist/chunk-SCFX4UTD.mjs.map +1 -0
- package/dist/chunk-SL6HTIOK.mjs +66 -0
- package/dist/chunk-SL6HTIOK.mjs.map +1 -0
- package/dist/chunk-SOU3Q3ZA.mjs +173 -0
- package/dist/chunk-SOU3Q3ZA.mjs.map +1 -0
- package/dist/chunk-SPBBQLXI.mjs +207 -0
- package/dist/chunk-SPBBQLXI.mjs.map +1 -0
- package/dist/chunk-SXZTEK3V.mjs +396 -0
- package/dist/chunk-SXZTEK3V.mjs.map +1 -0
- package/dist/chunk-T4QJQK76.mjs +459 -0
- package/dist/chunk-T4QJQK76.mjs.map +1 -0
- package/dist/chunk-TRORP7E4.mjs +41 -0
- package/dist/chunk-TRORP7E4.mjs.map +1 -0
- package/dist/chunk-TU4YJICB.mjs +728 -0
- package/dist/chunk-TU4YJICB.mjs.map +1 -0
- package/dist/chunk-TXCFGOHW.mjs +42 -0
- package/dist/chunk-TXCFGOHW.mjs.map +1 -0
- package/dist/chunk-UHE2TTLK.mjs +466 -0
- package/dist/chunk-UHE2TTLK.mjs.map +1 -0
- package/dist/chunk-UREJA4GZ.mjs +364 -0
- package/dist/chunk-UREJA4GZ.mjs.map +1 -0
- package/dist/chunk-USWZZUEH.mjs +25 -0
- package/dist/chunk-USWZZUEH.mjs.map +1 -0
- package/dist/chunk-UVCIEUJC.mjs +16 -0
- package/dist/chunk-UVCIEUJC.mjs.map +1 -0
- package/dist/chunk-V6WE6JSZ.mjs +352 -0
- package/dist/chunk-V6WE6JSZ.mjs.map +1 -0
- package/dist/chunk-V7RBCSDJ.mjs +170 -0
- package/dist/chunk-V7RBCSDJ.mjs.map +1 -0
- package/dist/chunk-VCANOYFI.mjs +588 -0
- package/dist/chunk-VCANOYFI.mjs.map +1 -0
- package/dist/chunk-WZ5QFROO.mjs +23 -0
- package/dist/chunk-WZ5QFROO.mjs.map +1 -0
- package/dist/chunk-Y2OJJD7R.mjs +543 -0
- package/dist/chunk-Y2OJJD7R.mjs.map +1 -0
- package/dist/chunk-Y7A27276.mjs +538 -0
- package/dist/chunk-Y7A27276.mjs.map +1 -0
- package/dist/chunk-YHU7SS6L.mjs +365 -0
- package/dist/chunk-YHU7SS6L.mjs.map +1 -0
- package/dist/chunk-ZBE6MLHL.mjs +230 -0
- package/dist/chunk-ZBE6MLHL.mjs.map +1 -0
- package/dist/chunk-ZJQNATYV.mjs +299 -0
- package/dist/chunk-ZJQNATYV.mjs.map +1 -0
- package/dist/client-D_yUjVhe.d.mts +402 -0
- package/dist/client-Dkc03WP8.d.ts +402 -0
- package/dist/client-cache-CIlyBlmx.d.ts +6 -0
- package/dist/client-cache-D-EZ7XVW.d.mts +6 -0
- package/dist/client-plugins-BZnpeTGA.d.ts +1848 -0
- package/dist/client-plugins-g4bzuCmo.d.mts +1848 -0
- package/dist/client-plugins.cjs +415 -0
- package/dist/client-plugins.cjs.map +1 -0
- package/dist/client-plugins.d.mts +21 -0
- package/dist/client-plugins.d.ts +21 -0
- package/dist/client-plugins.mjs +10 -0
- package/dist/client-plugins.mjs.map +1 -0
- package/dist/client.cjs +4571 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.mts +329 -0
- package/dist/client.d.ts +329 -0
- package/dist/client.mjs +103 -0
- package/dist/client.mjs.map +1 -0
- package/dist/config.cjs +38 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.mts +28 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.mjs +10 -0
- package/dist/config.mjs.map +1 -0
- package/dist/cron.cjs +406 -0
- package/dist/cron.cjs.map +1 -0
- package/dist/cron.d.mts +78 -0
- package/dist/cron.d.ts +78 -0
- package/dist/cron.mjs +30 -0
- package/dist/cron.mjs.map +1 -0
- package/dist/deferred.cjs +438 -0
- package/dist/deferred.cjs.map +1 -0
- package/dist/deferred.d.mts +42 -0
- package/dist/deferred.d.ts +42 -0
- package/dist/deferred.mjs +28 -0
- package/dist/deferred.mjs.map +1 -0
- package/dist/deployment.cjs +199 -0
- package/dist/deployment.cjs.map +1 -0
- package/dist/deployment.d.mts +34 -0
- package/dist/deployment.d.ts +34 -0
- package/dist/deployment.mjs +38 -0
- package/dist/deployment.mjs.map +1 -0
- package/dist/devtools-AE4RVXCM.mjs +370 -0
- package/dist/devtools-AE4RVXCM.mjs.map +1 -0
- package/dist/devtools-client-6WPY2AQU.mjs +225 -0
- package/dist/devtools-client-6WPY2AQU.mjs.map +1 -0
- package/dist/devtools-ui-NJKFORTG.mjs +1349 -0
- package/dist/devtools-ui-NJKFORTG.mjs.map +1 -0
- package/dist/docs.cjs +5541 -0
- package/dist/docs.cjs.map +1 -0
- package/dist/docs.d.mts +69 -0
- package/dist/docs.d.ts +69 -0
- package/dist/docs.mjs +46 -0
- package/dist/docs.mjs.map +1 -0
- package/dist/env-types.cjs +223 -0
- package/dist/env-types.cjs.map +1 -0
- package/dist/env-types.d.mts +11 -0
- package/dist/env-types.d.ts +11 -0
- package/dist/env-types.mjs +9 -0
- package/dist/env-types.mjs.map +1 -0
- package/dist/env.cjs +215 -0
- package/dist/env.cjs.map +1 -0
- package/dist/env.d.mts +45 -0
- package/dist/env.d.ts +45 -0
- package/dist/env.mjs +22 -0
- package/dist/env.mjs.map +1 -0
- package/dist/environment/vite.cjs +374 -0
- package/dist/environment/vite.cjs.map +1 -0
- package/dist/environment/vite.d.mts +22 -0
- package/dist/environment/vite.d.ts +22 -0
- package/dist/environment/vite.mjs +10 -0
- package/dist/environment/vite.mjs.map +1 -0
- package/dist/environment.cjs +96 -0
- package/dist/environment.cjs.map +1 -0
- package/dist/environment.d.mts +18 -0
- package/dist/environment.d.ts +18 -0
- package/dist/environment.mjs +14 -0
- package/dist/environment.mjs.map +1 -0
- package/dist/headers.cjs +126 -0
- package/dist/headers.cjs.map +1 -0
- package/dist/headers.d.mts +22 -0
- package/dist/headers.d.ts +22 -0
- package/dist/headers.mjs +12 -0
- package/dist/headers.mjs.map +1 -0
- package/dist/i18n/client.cjs +283 -0
- package/dist/i18n/client.cjs.map +1 -0
- package/dist/i18n/client.d.mts +32 -0
- package/dist/i18n/client.d.ts +32 -0
- package/dist/i18n/client.mjs +121 -0
- package/dist/i18n/client.mjs.map +1 -0
- package/dist/i18n/index.cjs +130 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.mts +20 -0
- package/dist/i18n/index.d.ts +20 -0
- package/dist/i18n/index.mjs +22 -0
- package/dist/i18n/index.mjs.map +1 -0
- package/dist/i18n/server.cjs +637 -0
- package/dist/i18n/server.cjs.map +1 -0
- package/dist/i18n/server.d.mts +30 -0
- package/dist/i18n/server.d.ts +30 -0
- package/dist/i18n/server.mjs +32 -0
- package/dist/i18n/server.mjs.map +1 -0
- package/dist/image/server.cjs +477 -0
- package/dist/image/server.cjs.map +1 -0
- package/dist/image/server.d.mts +37 -0
- package/dist/image/server.d.ts +37 -0
- package/dist/image/server.mjs +16 -0
- package/dist/image/server.mjs.map +1 -0
- package/dist/image/sharp.cjs +135 -0
- package/dist/image/sharp.cjs.map +1 -0
- package/dist/image/sharp.d.mts +7 -0
- package/dist/image/sharp.d.ts +7 -0
- package/dist/image/sharp.mjs +75 -0
- package/dist/image/sharp.mjs.map +1 -0
- package/dist/image-config-Duob7wER.d.mts +50 -0
- package/dist/image-config-Duob7wER.d.ts +50 -0
- package/dist/image.cjs +209 -0
- package/dist/image.cjs.map +1 -0
- package/dist/image.d.mts +39 -0
- package/dist/image.d.ts +39 -0
- package/dist/image.mjs +165 -0
- package/dist/image.mjs.map +1 -0
- package/dist/index.cjs +39433 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +451 -0
- package/dist/index.d.ts +451 -0
- package/dist/index.mjs +930 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integration-api-CHT2OKAf.d.mts +93 -0
- package/dist/integration-api-CHT2OKAf.d.ts +93 -0
- package/dist/integration-orm-GQLGU66X.mjs +13 -0
- package/dist/integration-orm-GQLGU66X.mjs.map +1 -0
- package/dist/integrations.cjs +2820 -0
- package/dist/integrations.cjs.map +1 -0
- package/dist/integrations.d.mts +21 -0
- package/dist/integrations.d.ts +21 -0
- package/dist/integrations.mjs +51 -0
- package/dist/integrations.mjs.map +1 -0
- package/dist/internal/build-runtime.cjs +31340 -0
- package/dist/internal/build-runtime.cjs.map +1 -0
- package/dist/internal/build-runtime.d.mts +38 -0
- package/dist/internal/build-runtime.d.ts +38 -0
- package/dist/internal/build-runtime.mjs +73 -0
- package/dist/internal/build-runtime.mjs.map +1 -0
- package/dist/internal/client-runtime.cjs +579 -0
- package/dist/internal/client-runtime.cjs.map +1 -0
- package/dist/internal/client-runtime.d.mts +2 -0
- package/dist/internal/client-runtime.d.ts +2 -0
- package/dist/internal/client-runtime.mjs +12 -0
- package/dist/internal/client-runtime.mjs.map +1 -0
- package/dist/internal/config-runtime.cjs +4172 -0
- package/dist/internal/config-runtime.cjs.map +1 -0
- package/dist/internal/config-runtime.d.mts +38 -0
- package/dist/internal/config-runtime.d.ts +38 -0
- package/dist/internal/config-runtime.mjs +38 -0
- package/dist/internal/config-runtime.mjs.map +1 -0
- package/dist/internal/production-node-env.cjs +65 -0
- package/dist/internal/production-node-env.cjs.map +1 -0
- package/dist/internal/production-node-env.d.mts +12 -0
- package/dist/internal/production-node-env.d.ts +12 -0
- package/dist/internal/production-node-env.mjs +8 -0
- package/dist/internal/production-node-env.mjs.map +1 -0
- package/dist/internal/production-runtime.cjs +1896 -0
- package/dist/internal/production-runtime.cjs.map +1 -0
- package/dist/internal/production-runtime.d.mts +39 -0
- package/dist/internal/production-runtime.d.ts +39 -0
- package/dist/internal/production-runtime.mjs +79 -0
- package/dist/internal/production-runtime.mjs.map +1 -0
- package/dist/layers-VWVDTPUZ.mjs +16 -0
- package/dist/layers-VWVDTPUZ.mjs.map +1 -0
- package/dist/manager-THKFTOFE.mjs +10 -0
- package/dist/manager-THKFTOFE.mjs.map +1 -0
- package/dist/markdown.cjs +299 -0
- package/dist/markdown.cjs.map +1 -0
- package/dist/markdown.d.mts +43 -0
- package/dist/markdown.d.ts +43 -0
- package/dist/markdown.mjs +14 -0
- package/dist/markdown.mjs.map +1 -0
- package/dist/metadata-C9NZxMDW.d.mts +22 -0
- package/dist/metadata-DAXRaOHx.d.ts +22 -0
- package/dist/middleware.cjs +2148 -0
- package/dist/middleware.cjs.map +1 -0
- package/dist/middleware.d.mts +163 -0
- package/dist/middleware.d.ts +163 -0
- package/dist/middleware.mjs +49 -0
- package/dist/middleware.mjs.map +1 -0
- package/dist/navigation-errors-Dvwpzaer.d.mts +13 -0
- package/dist/navigation-errors-Dvwpzaer.d.ts +13 -0
- package/dist/navigation.cjs +1304 -0
- package/dist/navigation.cjs.map +1 -0
- package/dist/navigation.d.mts +14 -0
- package/dist/navigation.d.ts +14 -0
- package/dist/navigation.mjs +33 -0
- package/dist/navigation.mjs.map +1 -0
- package/dist/nitro-KME62MWG.mjs +691 -0
- package/dist/nitro-KME62MWG.mjs.map +1 -0
- package/dist/observability.cjs +186 -0
- package/dist/observability.cjs.map +1 -0
- package/dist/observability.d.mts +335 -0
- package/dist/observability.d.ts +335 -0
- package/dist/observability.mjs +16 -0
- package/dist/observability.mjs.map +1 -0
- package/dist/params-BALtrRim.d.ts +15 -0
- package/dist/params-ry-lxqmy.d.mts +15 -0
- package/dist/plugin-BJDf43dc.d.mts +165 -0
- package/dist/plugin-BJDf43dc.d.ts +165 -0
- package/dist/plugin.cjs +22285 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.mts +21 -0
- package/dist/plugin.d.ts +21 -0
- package/dist/plugin.mjs +60 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/production-runtime-C_B79w2P.d.mts +28 -0
- package/dist/production-runtime-DDEM1D2q.d.ts +28 -0
- package/dist/production-runtime-DRkCHUvJ.d.ts +79 -0
- package/dist/production-runtime-flrjp_nC.d.mts +79 -0
- package/dist/query/client.cjs +560 -0
- package/dist/query/client.cjs.map +1 -0
- package/dist/query/client.d.mts +61 -0
- package/dist/query/client.d.ts +61 -0
- package/dist/query/client.mjs +364 -0
- package/dist/query/client.mjs.map +1 -0
- package/dist/query/index.cjs +226 -0
- package/dist/query/index.cjs.map +1 -0
- package/dist/query/index.d.mts +90 -0
- package/dist/query/index.d.ts +90 -0
- package/dist/query/index.mjs +31 -0
- package/dist/query/index.mjs.map +1 -0
- package/dist/query/parsers.cjs +178 -0
- package/dist/query/parsers.cjs.map +1 -0
- package/dist/query/parsers.d.mts +25 -0
- package/dist/query/parsers.d.ts +25 -0
- package/dist/query/parsers.mjs +24 -0
- package/dist/query/parsers.mjs.map +1 -0
- package/dist/query/server.cjs +301 -0
- package/dist/query/server.cjs.map +1 -0
- package/dist/query/server.d.mts +55 -0
- package/dist/query/server.d.ts +55 -0
- package/dist/query/server.mjs +105 -0
- package/dist/query/server.mjs.map +1 -0
- package/dist/request-BrFBuc8G.d.mts +6 -0
- package/dist/request-BslSZIRz.d.ts +6 -0
- package/dist/request.cjs +71 -0
- package/dist/request.cjs.map +1 -0
- package/dist/request.d.mts +2 -0
- package/dist/request.d.ts +2 -0
- package/dist/request.mjs +9 -0
- package/dist/request.mjs.map +1 -0
- package/dist/resolver-C6iecsDV.d.ts +14 -0
- package/dist/resolver-DlOPpjkB.d.mts +14 -0
- package/dist/route-runtime-DoOHzCAD.d.mts +38 -0
- package/dist/route-runtime-DoOHzCAD.d.ts +38 -0
- package/dist/router.cjs +254 -0
- package/dist/router.cjs.map +1 -0
- package/dist/router.d.mts +36 -0
- package/dist/router.d.ts +36 -0
- package/dist/router.mjs +14 -0
- package/dist/router.mjs.map +1 -0
- package/dist/routes.cjs +1213 -0
- package/dist/routes.cjs.map +1 -0
- package/dist/routes.d.mts +224 -0
- package/dist/routes.d.ts +224 -0
- package/dist/routes.mjs +52 -0
- package/dist/routes.mjs.map +1 -0
- package/dist/runtime-B6GvwDS1.d.ts +27 -0
- package/dist/runtime-DeAAZ6gO.d.mts +27 -0
- package/dist/search-client-6OXIBNYQ.mjs +14 -0
- package/dist/search-client-6OXIBNYQ.mjs.map +1 -0
- package/dist/server-action-security.cjs +492 -0
- package/dist/server-action-security.cjs.map +1 -0
- package/dist/server-action-security.d.mts +42 -0
- package/dist/server-action-security.d.ts +42 -0
- package/dist/server-action-security.mjs +29 -0
- package/dist/server-action-security.mjs.map +1 -0
- package/dist/server-fn-client.cjs +180 -0
- package/dist/server-fn-client.cjs.map +1 -0
- package/dist/server-fn-client.d.mts +31 -0
- package/dist/server-fn-client.d.ts +31 -0
- package/dist/server-fn-client.mjs +9 -0
- package/dist/server-fn-client.mjs.map +1 -0
- package/dist/server-fn.cjs +284 -0
- package/dist/server-fn.cjs.map +1 -0
- package/dist/server-fn.d.mts +84 -0
- package/dist/server-fn.d.ts +84 -0
- package/dist/server-fn.mjs +17 -0
- package/dist/server-fn.mjs.map +1 -0
- package/dist/server-plugins.cjs +235 -0
- package/dist/server-plugins.cjs.map +1 -0
- package/dist/server-plugins.d.mts +54 -0
- package/dist/server-plugins.d.ts +54 -0
- package/dist/server-plugins.mjs +18 -0
- package/dist/server-plugins.mjs.map +1 -0
- package/dist/server-query-client.cjs +792 -0
- package/dist/server-query-client.cjs.map +1 -0
- package/dist/server-query-client.d.mts +50 -0
- package/dist/server-query-client.d.ts +50 -0
- package/dist/server-query-client.mjs +23 -0
- package/dist/server-query-client.mjs.map +1 -0
- package/dist/server-query.cjs +804 -0
- package/dist/server-query.cjs.map +1 -0
- package/dist/server-query.d.mts +36 -0
- package/dist/server-query.d.ts +36 -0
- package/dist/server-query.mjs +18 -0
- package/dist/server-query.mjs.map +1 -0
- package/dist/server.cjs +25739 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.mts +47 -0
- package/dist/server.d.ts +47 -0
- package/dist/server.mjs +511 -0
- package/dist/server.mjs.map +1 -0
- package/dist/storage.cjs +515 -0
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.d.mts +52 -0
- package/dist/storage.d.ts +52 -0
- package/dist/storage.mjs +58 -0
- package/dist/storage.mjs.map +1 -0
- package/dist/testing.cjs +1882 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.mts +100 -0
- package/dist/testing.d.ts +100 -0
- package/dist/testing.mjs +324 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/types-BH1lhg5G.d.mts +81 -0
- package/dist/types-BH1lhg5G.d.ts +81 -0
- package/dist/types-C9N-nk5R.d.mts +53 -0
- package/dist/types-C9N-nk5R.d.ts +53 -0
- package/dist/types-D1A6-XvH.d.mts +73 -0
- package/dist/types-D1A6-XvH.d.ts +73 -0
- package/dist/utils-DA1yo54_.d.ts +23 -0
- package/dist/utils-DOXXivjL.d.mts +23 -0
- package/dist/vite.cjs +22684 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.mts +21 -0
- package/dist/vite.d.ts +21 -0
- package/dist/vite.mjs +59 -0
- package/dist/vite.mjs.map +1 -0
- package/dist/workflows.cjs +586 -0
- package/dist/workflows.cjs.map +1 -0
- package/dist/workflows.d.mts +110 -0
- package/dist/workflows.d.ts +110 -0
- package/dist/workflows.mjs +32 -0
- package/dist/workflows.mjs.map +1 -0
- package/package.json +523 -0
- package/types/api.d.ts +88 -0
- package/types/client.d.ts +1171 -0
- package/types/index.d.ts +17 -0
- package/types/middleware.d.ts +266 -0
|
@@ -0,0 +1,1171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for @farm.js/core/client
|
|
3
|
+
*
|
|
4
|
+
* Provides stable exports for Link, useRouter, and API client so TypeScript
|
|
5
|
+
* and IDEs resolve them even when the build output omits them. The generated
|
|
6
|
+
* farm-routes.d.ts in your app augments LinkDefaultRoute for typed href.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
AnchorHTMLAttributes,
|
|
11
|
+
ReactElement,
|
|
12
|
+
ReactNode,
|
|
13
|
+
RefObject,
|
|
14
|
+
RefAttributes,
|
|
15
|
+
} from "react";
|
|
16
|
+
|
|
17
|
+
declare module "@farm.js/core/client" {
|
|
18
|
+
export interface MiddlewareProps {
|
|
19
|
+
data: Map<string, any>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface PluginContextProps {
|
|
23
|
+
data: Map<string, any>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface PageProps {
|
|
27
|
+
params: Record<string, string>;
|
|
28
|
+
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
29
|
+
path: string;
|
|
30
|
+
middleware?: MiddlewareProps;
|
|
31
|
+
context?: PluginContextProps;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface LayoutProps {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
params: Record<string, string>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Metadata {
|
|
40
|
+
title?: string | { default?: string; template?: string };
|
|
41
|
+
description?: string;
|
|
42
|
+
keywords?: string | string[];
|
|
43
|
+
authors?: Array<{ name: string; url?: string }>;
|
|
44
|
+
creator?: string;
|
|
45
|
+
publisher?: string;
|
|
46
|
+
robots?: string | { index?: boolean; follow?: boolean };
|
|
47
|
+
openGraph?: Record<string, any>;
|
|
48
|
+
twitter?: Record<string, any>;
|
|
49
|
+
alternates?: Record<string, any>;
|
|
50
|
+
icons?: Record<string, any>;
|
|
51
|
+
manifest?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type StoreState = Record<string, any>;
|
|
55
|
+
export type StoreValueUpdater<T> = T | ((previous: T) => T);
|
|
56
|
+
export type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
|
|
57
|
+
export type StoreListener<T extends StoreState> = (state: T, previousState: T) => void;
|
|
58
|
+
export type StoreKeyListener<T extends StoreState, K extends keyof T> = (
|
|
59
|
+
value: T[K],
|
|
60
|
+
previousValue: T[K],
|
|
61
|
+
) => void;
|
|
62
|
+
export type StoreKeysListener<T extends StoreState, K extends keyof T> = (
|
|
63
|
+
value: Pick<T, K>,
|
|
64
|
+
previousValue: Pick<T, K>,
|
|
65
|
+
) => void;
|
|
66
|
+
|
|
67
|
+
export type StoreFields<T extends StoreState> = {
|
|
68
|
+
[K in keyof T]: {
|
|
69
|
+
(): T[K];
|
|
70
|
+
get(): T[K];
|
|
71
|
+
set(value: StoreValueUpdater<T[K]>): T[K];
|
|
72
|
+
subscribe(listener: StoreKeyListener<T, K>): () => void;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export interface StoreApi<T extends StoreState> {
|
|
77
|
+
use(): T;
|
|
78
|
+
use<K extends keyof T>(key: K): T[K];
|
|
79
|
+
use<K extends keyof T>(keys: readonly K[]): Pick<T, K>;
|
|
80
|
+
get(): T;
|
|
81
|
+
get<K extends keyof T>(key: K): T[K];
|
|
82
|
+
set<K extends keyof T>(key: K, value: StoreValueUpdater<T[K]>): T[K];
|
|
83
|
+
set(patch: StorePatch<T>): T;
|
|
84
|
+
replace(nextState: T | ((state: T) => T)): T;
|
|
85
|
+
reset(): T;
|
|
86
|
+
subscribe(listener: StoreListener<T>): () => void;
|
|
87
|
+
subscribe<K extends keyof T>(key: K, listener: StoreKeyListener<T, K>): () => void;
|
|
88
|
+
subscribe<K extends keyof T>(keys: readonly K[], listener: StoreKeysListener<T, K>): () => void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type Store<T extends StoreState, TMethods extends Record<string, any> = {}> = StoreApi<T> &
|
|
92
|
+
StoreFields<T> &
|
|
93
|
+
TMethods;
|
|
94
|
+
|
|
95
|
+
export function createStore<T extends StoreState, TMethods extends Record<string, any> = {}>(
|
|
96
|
+
initialState: T,
|
|
97
|
+
extend?: (store: Store<T>) => TMethods,
|
|
98
|
+
): Store<T, TMethods>;
|
|
99
|
+
|
|
100
|
+
export type PrefetchBehavior = false | "intent" | "viewport" | "render" | "none";
|
|
101
|
+
|
|
102
|
+
/** External URLs are never type-checked as routes; use for http/https/mailto etc. */
|
|
103
|
+
export type ExternalHref =
|
|
104
|
+
| `http://${string}`
|
|
105
|
+
| `https://${string}`
|
|
106
|
+
| `//${string}`
|
|
107
|
+
| `mailto:${string}`;
|
|
108
|
+
|
|
109
|
+
export interface LinkDefaultRoute {}
|
|
110
|
+
|
|
111
|
+
export type DefaultRoutePath = LinkDefaultRoute extends { _: infer TRoute extends string }
|
|
112
|
+
? TRoute
|
|
113
|
+
: string;
|
|
114
|
+
|
|
115
|
+
export type DefaultRoutePattern = LinkDefaultRoute extends {
|
|
116
|
+
pattern: infer TRoute extends string;
|
|
117
|
+
}
|
|
118
|
+
? TRoute
|
|
119
|
+
: DefaultRoutePath;
|
|
120
|
+
|
|
121
|
+
export type DefaultRouteHref = DefaultRoutePath | DefaultRoutePattern;
|
|
122
|
+
|
|
123
|
+
export type RouteHref<TRoute extends string> =
|
|
124
|
+
| TRoute
|
|
125
|
+
| `${TRoute}?${string}`
|
|
126
|
+
| `${TRoute}#${string}`
|
|
127
|
+
| `${TRoute}?${string}#${string}`;
|
|
128
|
+
|
|
129
|
+
/** A generated route with params already filled into its pathname. */
|
|
130
|
+
export type ResolvedRouteHref = RouteHref<DefaultRoutePath>;
|
|
131
|
+
|
|
132
|
+
export type RouteParamPrimitive = string | number | boolean;
|
|
133
|
+
export type RouteParamValue = RouteParamPrimitive | readonly RouteParamPrimitive[];
|
|
134
|
+
export type RouteOptionalParamValue = RouteParamValue | null | undefined;
|
|
135
|
+
export type RouteQueryValue =
|
|
136
|
+
| RouteParamPrimitive
|
|
137
|
+
| readonly RouteParamPrimitive[]
|
|
138
|
+
| null
|
|
139
|
+
| undefined;
|
|
140
|
+
|
|
141
|
+
export type RouteParams<TRoute extends string> = string extends TRoute
|
|
142
|
+
? Record<string, RouteOptionalParamValue>
|
|
143
|
+
: ExtractRouteParams<StripRouteSuffix<TRoute>>;
|
|
144
|
+
|
|
145
|
+
export type StripRouteSuffix<TRoute extends string> = TRoute extends `${infer Path}?${string}`
|
|
146
|
+
? StripRouteSuffix<Path>
|
|
147
|
+
: TRoute extends `${infer Path}#${string}`
|
|
148
|
+
? StripRouteSuffix<Path>
|
|
149
|
+
: TRoute;
|
|
150
|
+
|
|
151
|
+
export type ExtractRouteParams<TRoute extends string> = Simplify<
|
|
152
|
+
ExtractOptionalCatchAllParams<TRoute> &
|
|
153
|
+
ExtractCatchAllParams<TRoute> &
|
|
154
|
+
ExtractDynamicParams<TRoute>
|
|
155
|
+
>;
|
|
156
|
+
|
|
157
|
+
export type ExtractOptionalCatchAllParams<TRoute extends string> =
|
|
158
|
+
TRoute extends `${string}[[...${infer Param}]]${infer Rest}`
|
|
159
|
+
? { [Key in Param]?: RouteOptionalParamValue } & ExtractOptionalCatchAllParams<Rest>
|
|
160
|
+
: {};
|
|
161
|
+
|
|
162
|
+
export type ExtractCatchAllParams<TRoute extends string> =
|
|
163
|
+
TRoute extends `${string}[...${infer Param}]${infer Rest}`
|
|
164
|
+
? Param extends `[...${string}`
|
|
165
|
+
? ExtractCatchAllParams<Rest>
|
|
166
|
+
: { [Key in Param]: RouteParamValue } & ExtractCatchAllParams<Rest>
|
|
167
|
+
: {};
|
|
168
|
+
|
|
169
|
+
export type ExtractDynamicParams<TRoute extends string> =
|
|
170
|
+
TRoute extends `${string}[${infer Param}]${infer Rest}`
|
|
171
|
+
? Param extends `...${string}` | `[...${string}`
|
|
172
|
+
? ExtractDynamicParams<Rest>
|
|
173
|
+
: { [Key in Param]: RouteParamValue } & ExtractDynamicParams<Rest>
|
|
174
|
+
: {};
|
|
175
|
+
|
|
176
|
+
export type Simplify<T> = { [Key in keyof T]: T[Key] } & {};
|
|
177
|
+
|
|
178
|
+
export type LinkRouteParamsProps<TRoute extends string> = string extends TRoute
|
|
179
|
+
? { params?: Record<string, RouteOptionalParamValue> }
|
|
180
|
+
: keyof RouteParams<TRoute> extends never
|
|
181
|
+
? { params?: Record<string, RouteOptionalParamValue> }
|
|
182
|
+
: { params: RouteParams<TRoute> };
|
|
183
|
+
|
|
184
|
+
export type RoutesWithRequiredParams<TRoute extends string> = TRoute extends string
|
|
185
|
+
? keyof RouteParams<TRoute> extends never
|
|
186
|
+
? never
|
|
187
|
+
: TRoute
|
|
188
|
+
: never;
|
|
189
|
+
|
|
190
|
+
export type LinkRouteTargetProps<TRoute extends string> = [
|
|
191
|
+
RoutesWithRequiredParams<TRoute>,
|
|
192
|
+
] extends [never]
|
|
193
|
+
? {
|
|
194
|
+
href: RouteHref<TRoute>;
|
|
195
|
+
params?: Record<string, RouteOptionalParamValue>;
|
|
196
|
+
}
|
|
197
|
+
: TRoute extends string
|
|
198
|
+
? {
|
|
199
|
+
href: RouteHref<TRoute>;
|
|
200
|
+
} & LinkRouteParamsProps<TRoute>
|
|
201
|
+
: never;
|
|
202
|
+
|
|
203
|
+
export type LinkExternalTargetProps = {
|
|
204
|
+
href: ExternalHref;
|
|
205
|
+
params?: never;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export type LinkProps<TRoute extends string = DefaultRouteHref> = Omit<
|
|
209
|
+
AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
210
|
+
"href"
|
|
211
|
+
> &
|
|
212
|
+
(LinkExternalTargetProps | LinkRouteTargetProps<TRoute>) & {
|
|
213
|
+
/** Internal route path (typed when route types are generated) or external URL (never raises route-type errors). */
|
|
214
|
+
prefetch?: PrefetchBehavior | boolean | "hover" | "viewport" | "none";
|
|
215
|
+
query?: URLSearchParams | Record<string, RouteQueryValue>;
|
|
216
|
+
hash?: string;
|
|
217
|
+
trailingSlash?: boolean;
|
|
218
|
+
prefetchDelay?: number;
|
|
219
|
+
replace?: boolean;
|
|
220
|
+
scroll?: boolean;
|
|
221
|
+
viewTransition?: FarmViewTransitionMode;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export type LinkComponent = <TRoute extends string = DefaultRouteHref>(
|
|
225
|
+
props: LinkProps<TRoute> & RefAttributes<HTMLAnchorElement>,
|
|
226
|
+
) => ReactElement;
|
|
227
|
+
|
|
228
|
+
export const Link: LinkComponent;
|
|
229
|
+
|
|
230
|
+
export interface FarmNavigationBlockerContext {
|
|
231
|
+
from: string;
|
|
232
|
+
to: string;
|
|
233
|
+
action: "push" | "replace" | "pop";
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export type FarmNavigationBlocker = (
|
|
237
|
+
context: FarmNavigationBlockerContext,
|
|
238
|
+
) => boolean | void | Promise<boolean | void>;
|
|
239
|
+
|
|
240
|
+
export type FarmViewTransitionMode = boolean | "auto";
|
|
241
|
+
|
|
242
|
+
export interface FarmNavigateOptions {
|
|
243
|
+
replace?: boolean;
|
|
244
|
+
scroll?: boolean;
|
|
245
|
+
state?: unknown;
|
|
246
|
+
viewTransition?: FarmViewTransitionMode;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface FarmNavigationLocation {
|
|
250
|
+
href: string;
|
|
251
|
+
pathname: string;
|
|
252
|
+
search: string;
|
|
253
|
+
hash: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface FarmNavigationState {
|
|
257
|
+
state: "idle" | "loading";
|
|
258
|
+
pending: boolean;
|
|
259
|
+
from: string | null;
|
|
260
|
+
to: FarmNavigationLocation | null;
|
|
261
|
+
action: FarmNavigationBlockerContext["action"] | null;
|
|
262
|
+
startedAt: number | null;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export type FarmNavigationListener = (state: FarmNavigationState) => void;
|
|
266
|
+
|
|
267
|
+
export interface RouterOptions {
|
|
268
|
+
prefetchTimeout?: number;
|
|
269
|
+
cacheMaxAge?: number;
|
|
270
|
+
scrollRestoration?: boolean;
|
|
271
|
+
shouldUseDocumentNavigation?: (pathname: string) => boolean;
|
|
272
|
+
deploymentId?: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export class SPARouter {
|
|
276
|
+
constructor(options?: RouterOptions);
|
|
277
|
+
setNavigationHandler(handler: (data: Record<string, any>) => Promise<void>): void;
|
|
278
|
+
navigate(href: string, options?: FarmNavigateOptions): Promise<void>;
|
|
279
|
+
prefetch(href: string): Promise<void>;
|
|
280
|
+
observeForPrefetch(element: HTMLAnchorElement): void;
|
|
281
|
+
unobserveForPrefetch(element: HTMLAnchorElement): void;
|
|
282
|
+
addBlocker(blocker: FarmNavigationBlocker): () => void;
|
|
283
|
+
getNavigationState(): FarmNavigationState;
|
|
284
|
+
subscribeNavigation(listener: FarmNavigationListener): () => void;
|
|
285
|
+
registerScrollElement(key: string, element: HTMLElement): () => void;
|
|
286
|
+
pushState(state: unknown, href?: string): void;
|
|
287
|
+
replaceState(state: unknown, href?: string): void;
|
|
288
|
+
clearCache(): void;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export function getRouter(): SPARouter;
|
|
292
|
+
|
|
293
|
+
export interface FarmChunkRecoveryOptions {
|
|
294
|
+
maxAgeMs?: number;
|
|
295
|
+
storageKey?: string;
|
|
296
|
+
onRecover?: (error: unknown) => void;
|
|
297
|
+
reload?: () => void;
|
|
298
|
+
storage?: Pick<Storage, "getItem" | "setItem" | "removeItem"> | null;
|
|
299
|
+
location?: Pick<Location, "pathname" | "search" | "reload">;
|
|
300
|
+
now?: () => number;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface UseRouterOptions {
|
|
304
|
+
basePath?: string;
|
|
305
|
+
routes?: Array<string | { path: string; name?: string; meta?: unknown }>;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface UseBlockerOptions {
|
|
309
|
+
when: boolean | ((context: FarmNavigationBlockerContext) => boolean);
|
|
310
|
+
message?: string;
|
|
311
|
+
shouldBlock?: (context: FarmNavigationBlockerContext) => boolean | Promise<boolean>;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface UseBlockerReturn {
|
|
315
|
+
active: boolean;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function useRouter(options?: UseRouterOptions): {
|
|
319
|
+
pathname: string;
|
|
320
|
+
searchParams: URLSearchParams;
|
|
321
|
+
params: Record<string, string>;
|
|
322
|
+
pageState: unknown;
|
|
323
|
+
push: (path: string) => void;
|
|
324
|
+
replace: (path: string) => void;
|
|
325
|
+
pushState: <TState>(state: TState, href?: string) => void;
|
|
326
|
+
replaceState: <TState>(state: TState, href?: string) => void;
|
|
327
|
+
back: () => void;
|
|
328
|
+
forward: () => void;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export function usePageState<TState = unknown>(): TState | null;
|
|
332
|
+
export function useNavigation(): FarmNavigationState;
|
|
333
|
+
export function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
|
|
334
|
+
export function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(
|
|
335
|
+
key: string,
|
|
336
|
+
): RefObject<TElement>;
|
|
337
|
+
export function navigateTo(href: string, options?: FarmNavigateOptions): Promise<void>;
|
|
338
|
+
export function prefetch(href: string): Promise<void>;
|
|
339
|
+
export function pushState<TState>(state: TState, href?: string): void;
|
|
340
|
+
export function replaceState<TState>(state: TState, href?: string): void;
|
|
341
|
+
export function readPageState<TState = unknown>(): TState | null;
|
|
342
|
+
export function isChunkLoadError(errorLike: unknown): boolean;
|
|
343
|
+
export function installChunkErrorRecovery(options?: FarmChunkRecoveryOptions): () => void;
|
|
344
|
+
|
|
345
|
+
export interface APIClientOptions {
|
|
346
|
+
baseURL?: string;
|
|
347
|
+
headers?: Record<string, string>;
|
|
348
|
+
cacheDefaults?: CacheOptions;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export type StatusPhase =
|
|
352
|
+
| "idle"
|
|
353
|
+
| "pending"
|
|
354
|
+
| "success"
|
|
355
|
+
| "error"
|
|
356
|
+
| "revalidating"
|
|
357
|
+
| "invalidated";
|
|
358
|
+
|
|
359
|
+
export type StatusEvent<TData = unknown, TError = unknown> = {
|
|
360
|
+
phase: StatusPhase;
|
|
361
|
+
requestId: string;
|
|
362
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
363
|
+
key: string;
|
|
364
|
+
input?: unknown;
|
|
365
|
+
data?: TData;
|
|
366
|
+
error?: TError;
|
|
367
|
+
isBackground?: boolean;
|
|
368
|
+
timestamp: number;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
export type CacheKey<TData = unknown> = string & {
|
|
372
|
+
readonly __farmCacheData?: TData;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
export type APIResult<TData = unknown, TError = Error> = {
|
|
376
|
+
data: TData | undefined;
|
|
377
|
+
error: TError | null;
|
|
378
|
+
key: CacheKey<TData>;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
export type RequestEvent = {
|
|
382
|
+
requestId: string;
|
|
383
|
+
method: StatusEvent["method"];
|
|
384
|
+
key: string;
|
|
385
|
+
path: string;
|
|
386
|
+
input?: unknown;
|
|
387
|
+
attempt: number;
|
|
388
|
+
timestamp: number;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
export type ResponseEvent<TData = unknown, TError = Error> = {
|
|
392
|
+
requestId: string;
|
|
393
|
+
method: StatusEvent["method"];
|
|
394
|
+
key: string;
|
|
395
|
+
path: string;
|
|
396
|
+
input?: unknown;
|
|
397
|
+
attempt: number;
|
|
398
|
+
timestamp: number;
|
|
399
|
+
response?: Response;
|
|
400
|
+
data?: TData;
|
|
401
|
+
error?: TError;
|
|
402
|
+
ok?: boolean;
|
|
403
|
+
status?: number;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
export type CachePolicy = "cache-first" | "network-only" | "stale-while-revalidate";
|
|
407
|
+
|
|
408
|
+
export type CacheOptions = {
|
|
409
|
+
key?: string;
|
|
410
|
+
policy?: CachePolicy;
|
|
411
|
+
staleTime?: number;
|
|
412
|
+
gcTime?: number;
|
|
413
|
+
dedupeMs?: number;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
export type RetryOptions = {
|
|
417
|
+
count?: number;
|
|
418
|
+
delay?: number | ((attempt: number) => number);
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
export type InvalidateTarget =
|
|
422
|
+
| string
|
|
423
|
+
| {
|
|
424
|
+
key: string;
|
|
425
|
+
}
|
|
426
|
+
| {
|
|
427
|
+
path: string;
|
|
428
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
429
|
+
input?: unknown;
|
|
430
|
+
}
|
|
431
|
+
| [CallableRouteRef, unknown?];
|
|
432
|
+
|
|
433
|
+
export type InvalidateOptions =
|
|
434
|
+
| InvalidateTarget[]
|
|
435
|
+
| {
|
|
436
|
+
targets: InvalidateTarget[];
|
|
437
|
+
refetch?: boolean;
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
export type OptimisticUpdate =
|
|
441
|
+
| [CallableRouteRef<any>, unknown, (prev: any) => any]
|
|
442
|
+
| [CacheKey<any> | string, (prev: any) => any];
|
|
443
|
+
|
|
444
|
+
export type OptimisticOptions<TUpdates extends readonly unknown[] = readonly OptimisticUpdate[]> =
|
|
445
|
+
{
|
|
446
|
+
update: TUpdates & NormalizeOptimisticUpdates<TUpdates>;
|
|
447
|
+
rollbackOnError?: boolean;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
export type ClientOptions<
|
|
451
|
+
TData = unknown,
|
|
452
|
+
TError = unknown,
|
|
453
|
+
TUpdates extends readonly unknown[] = readonly OptimisticUpdate[],
|
|
454
|
+
> = {
|
|
455
|
+
key?: CacheKey<TData> | string;
|
|
456
|
+
cache?: CacheOptions;
|
|
457
|
+
retry?: RetryOptions;
|
|
458
|
+
invalidate?: InvalidateOptions;
|
|
459
|
+
optimistic?: OptimisticOptions<TUpdates>;
|
|
460
|
+
onRequest?: (event: RequestEvent) => void;
|
|
461
|
+
onResponse?: (
|
|
462
|
+
data: TData | undefined,
|
|
463
|
+
error: TError | null,
|
|
464
|
+
event: ResponseEvent<TData, TError>,
|
|
465
|
+
) => void;
|
|
466
|
+
onSuccess?: (data: TData) => void;
|
|
467
|
+
onError?: (err: TError) => void;
|
|
468
|
+
onSettled?: (data?: TData, err?: TError | null) => void;
|
|
469
|
+
onStatus?: (event: StatusEvent<TData, TError>) => void;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
type AnyRouteRef = (...args: any[]) => any;
|
|
473
|
+
type RouteRef<TData = any, TInput = any> = {
|
|
474
|
+
readonly __farmRouteInput: TInput;
|
|
475
|
+
readonly __farmRouteData: TData;
|
|
476
|
+
};
|
|
477
|
+
type CallableRouteRef<TData = any, TInput = any> = AnyRouteRef & RouteRef<TData, TInput>;
|
|
478
|
+
|
|
479
|
+
type InferRouteInput<TRoute> = TRoute extends { readonly __farmRouteInput: infer TInput }
|
|
480
|
+
? TInput
|
|
481
|
+
: never;
|
|
482
|
+
type InferRouteData<TRoute> = TRoute extends { readonly __farmRouteData: infer TData }
|
|
483
|
+
? TData
|
|
484
|
+
: never;
|
|
485
|
+
|
|
486
|
+
type NormalizeOptimisticUpdate<TUpdate> = TUpdate extends readonly [
|
|
487
|
+
infer TRoute,
|
|
488
|
+
unknown,
|
|
489
|
+
(prev: any) => any,
|
|
490
|
+
]
|
|
491
|
+
? TRoute extends RouteRef<any, any>
|
|
492
|
+
? [
|
|
493
|
+
TRoute,
|
|
494
|
+
InferRouteInput<TRoute> | undefined,
|
|
495
|
+
(prev: InferRouteData<TRoute> | undefined) => InferRouteData<TRoute>,
|
|
496
|
+
]
|
|
497
|
+
: never
|
|
498
|
+
: TUpdate extends readonly [infer TKey, (prev: any) => any]
|
|
499
|
+
? TKey extends CacheKey<infer TData>
|
|
500
|
+
? [TKey, (prev: TData | undefined) => TData]
|
|
501
|
+
: TKey extends string
|
|
502
|
+
? [TKey, (prev: unknown) => unknown]
|
|
503
|
+
: never
|
|
504
|
+
: never;
|
|
505
|
+
|
|
506
|
+
type NormalizeOptimisticUpdates<TUpdates extends readonly unknown[]> = {
|
|
507
|
+
[K in keyof TUpdates]: NormalizeOptimisticUpdate<TUpdates[K]>;
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Minimal structural type for Farm.js endpoints used for client inference.
|
|
512
|
+
* This avoids depending on build-hash-based type files.
|
|
513
|
+
*/
|
|
514
|
+
type TypedEndpointLike = {
|
|
515
|
+
__types: {
|
|
516
|
+
body: any;
|
|
517
|
+
query: any;
|
|
518
|
+
response: any;
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
type SimplifyEndpointInput<T> = {
|
|
523
|
+
[K in keyof T]: T[K];
|
|
524
|
+
} & {};
|
|
525
|
+
|
|
526
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
527
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
528
|
+
type RequiredKeys<T> = T extends object
|
|
529
|
+
? {
|
|
530
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
531
|
+
}[keyof T]
|
|
532
|
+
: never;
|
|
533
|
+
|
|
534
|
+
type BodyInputProp<TValue> =
|
|
535
|
+
IsNever<TValue> extends true
|
|
536
|
+
? {}
|
|
537
|
+
: IsAny<TValue> extends true
|
|
538
|
+
? { body?: TValue }
|
|
539
|
+
: undefined extends TValue
|
|
540
|
+
? { body?: TValue }
|
|
541
|
+
: { body: TValue };
|
|
542
|
+
|
|
543
|
+
type QueryInputProp<TValue> =
|
|
544
|
+
IsNever<TValue> extends true
|
|
545
|
+
? {}
|
|
546
|
+
: IsAny<TValue> extends true
|
|
547
|
+
? { query?: TValue }
|
|
548
|
+
: undefined extends TValue
|
|
549
|
+
? { query?: TValue }
|
|
550
|
+
: RequiredKeys<TValue> extends never
|
|
551
|
+
? { query?: TValue }
|
|
552
|
+
: { query: TValue };
|
|
553
|
+
|
|
554
|
+
type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
|
|
555
|
+
|
|
556
|
+
// Type utilities to extract endpoint input/output types
|
|
557
|
+
type InferEndpointInput<T> = T extends {
|
|
558
|
+
__types: {
|
|
559
|
+
body: infer TBody;
|
|
560
|
+
query: infer TQuery;
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
? SimplifyEndpointInput<BodyInputProp<TBody> & QueryInputProp<TQuery>>
|
|
564
|
+
: {};
|
|
565
|
+
|
|
566
|
+
type InferEndpointOutput<T> = T extends {
|
|
567
|
+
__types: {
|
|
568
|
+
response: infer R;
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
? R
|
|
572
|
+
: any;
|
|
573
|
+
|
|
574
|
+
type EndpointMethod<T = any> = (<
|
|
575
|
+
TUpdates extends readonly unknown[] = readonly OptimisticUpdate[],
|
|
576
|
+
>(
|
|
577
|
+
...args: HasRequiredKeys<InferEndpointInput<T>> extends true
|
|
578
|
+
? [
|
|
579
|
+
options: InferEndpointInput<T>,
|
|
580
|
+
clientOptions?: ClientOptions<InferEndpointOutput<T>, Error, TUpdates>,
|
|
581
|
+
]
|
|
582
|
+
: [
|
|
583
|
+
options?: InferEndpointInput<T>,
|
|
584
|
+
clientOptions?: ClientOptions<InferEndpointOutput<T>, Error, TUpdates>,
|
|
585
|
+
]
|
|
586
|
+
) => Promise<APIResult<InferEndpointOutput<T>, Error>>) &
|
|
587
|
+
RouteRef<InferEndpointOutput<T>, InferEndpointInput<T>>;
|
|
588
|
+
|
|
589
|
+
type RouterToClient<T> = {
|
|
590
|
+
[K in keyof T]: T[K] extends TypedEndpointLike
|
|
591
|
+
? EndpointMethod<T[K]>
|
|
592
|
+
: T[K] extends Record<string, unknown>
|
|
593
|
+
? RouterToClient<T[K]>
|
|
594
|
+
: EndpointMethod<T[K]>;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
export function createAPIClient<TRouter extends Record<string, any>>(
|
|
598
|
+
options?: APIClientOptions,
|
|
599
|
+
): RouterToClient<TRouter>;
|
|
600
|
+
|
|
601
|
+
export function createServerAPIClient<TEndpoints extends Record<string, unknown>>(
|
|
602
|
+
endpoints: TEndpoints,
|
|
603
|
+
): TEndpoints;
|
|
604
|
+
|
|
605
|
+
export type FarmIntegrationAPIMethod =
|
|
606
|
+
| "GET"
|
|
607
|
+
| "POST"
|
|
608
|
+
| "PUT"
|
|
609
|
+
| "PATCH"
|
|
610
|
+
| "DELETE"
|
|
611
|
+
| "OPTIONS"
|
|
612
|
+
| "HEAD";
|
|
613
|
+
|
|
614
|
+
export type FarmIntegrationAPIBodyFormat = "json" | "form" | "none";
|
|
615
|
+
export type FarmIntegrationAPIResponseFormat = "json" | "text" | "response";
|
|
616
|
+
|
|
617
|
+
export interface FarmIntegrationAPIOperation<
|
|
618
|
+
TBody = never,
|
|
619
|
+
TQuery = never,
|
|
620
|
+
TResponse = unknown,
|
|
621
|
+
TServer extends boolean = false,
|
|
622
|
+
TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod,
|
|
623
|
+
> {
|
|
624
|
+
readonly kind: "farm-integration-api-operation";
|
|
625
|
+
path: string;
|
|
626
|
+
method: TMethod;
|
|
627
|
+
bodyFormat?: FarmIntegrationAPIBodyFormat;
|
|
628
|
+
responseFormat?: FarmIntegrationAPIResponseFormat;
|
|
629
|
+
headers?: Record<string, string>;
|
|
630
|
+
credentials?: RequestCredentials;
|
|
631
|
+
isServer?: TServer;
|
|
632
|
+
__pathless?: boolean;
|
|
633
|
+
__types?: {
|
|
634
|
+
body: TBody;
|
|
635
|
+
query: TQuery;
|
|
636
|
+
response: TResponse;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export type FarmIntegrationAPI = {
|
|
641
|
+
[key: string]: FarmIntegrationAPI | FarmIntegrationAPIOperation<any, any, any>;
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
export type FarmIntegrationRouteOperationCarrier<
|
|
645
|
+
TPath extends string = string,
|
|
646
|
+
TOperation extends FarmIntegrationAPIOperation<any, any, any, any, any> =
|
|
647
|
+
FarmIntegrationAPIOperation<any, any, any, any, any>,
|
|
648
|
+
> = {
|
|
649
|
+
path: TPath;
|
|
650
|
+
__operation: TOperation;
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
export function defineIntegrationAPIOperation<
|
|
654
|
+
TBody = never,
|
|
655
|
+
TQuery = never,
|
|
656
|
+
TResponse = unknown,
|
|
657
|
+
TServer extends boolean = false,
|
|
658
|
+
TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod,
|
|
659
|
+
>(
|
|
660
|
+
operation: Omit<
|
|
661
|
+
FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>,
|
|
662
|
+
"kind" | "__types"
|
|
663
|
+
>,
|
|
664
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>;
|
|
665
|
+
|
|
666
|
+
export function defineIntegrationAPI<TAPI extends FarmIntegrationAPI>(api: TAPI): TAPI;
|
|
667
|
+
|
|
668
|
+
type IntegrationAPIBuilderOptions<TServer extends boolean = false> = Omit<
|
|
669
|
+
FarmIntegrationAPIOperation<any, any, any, TServer>,
|
|
670
|
+
"kind" | "method" | "path" | "__pathless" | "__types"
|
|
671
|
+
>;
|
|
672
|
+
|
|
673
|
+
type RouteOperationsToAPI<
|
|
674
|
+
TOperations extends readonly FarmIntegrationAPIOperation<any, any, any, any, any>[],
|
|
675
|
+
> = {
|
|
676
|
+
[TMethod in Lowercase<TOperations[number]["method"] & string>]: Extract<
|
|
677
|
+
TOperations[number],
|
|
678
|
+
{ method: Uppercase<TMethod> }
|
|
679
|
+
>;
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
type StripRouteClientPrefix<TPath extends string> = TPath extends `/api/${string}/${infer TRest}`
|
|
683
|
+
? TRest
|
|
684
|
+
: TPath extends `/${string}/${infer TRest}`
|
|
685
|
+
? TRest
|
|
686
|
+
: TPath extends `/${infer TRest}`
|
|
687
|
+
? TRest
|
|
688
|
+
: TPath;
|
|
689
|
+
|
|
690
|
+
type NormalizeRouteSegment<TSegment extends string> = TSegment extends `[...${infer TName}]`
|
|
691
|
+
? TName
|
|
692
|
+
: TSegment extends `[${infer TName}]`
|
|
693
|
+
? TName
|
|
694
|
+
: TSegment extends `${infer TName}(${string}`
|
|
695
|
+
? TName
|
|
696
|
+
: TSegment;
|
|
697
|
+
|
|
698
|
+
type RouteNamespaceFromPath<
|
|
699
|
+
TPath extends string,
|
|
700
|
+
TOperation extends FarmIntegrationAPIOperation<any, any, any, any, any>,
|
|
701
|
+
> = TPath extends `${infer THead}/${infer TTail}`
|
|
702
|
+
? {
|
|
703
|
+
[TKey in NormalizeRouteSegment<THead>]: RouteNamespaceFromPath<TTail, TOperation>;
|
|
704
|
+
}
|
|
705
|
+
: {
|
|
706
|
+
[TKey in NormalizeRouteSegment<TPath>]: {
|
|
707
|
+
[TMethod in Lowercase<TOperation["method"] & string>]: TOperation;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
type UnionToIntersection<TUnion> = (
|
|
712
|
+
TUnion extends unknown ? (value: TUnion) => void : never
|
|
713
|
+
) extends (value: infer TIntersection) => void
|
|
714
|
+
? TIntersection
|
|
715
|
+
: never;
|
|
716
|
+
|
|
717
|
+
type ExpandRecursively<TValue> = TValue extends (...args: any[]) => any
|
|
718
|
+
? TValue
|
|
719
|
+
: TValue extends object
|
|
720
|
+
? { [TKey in keyof TValue]: ExpandRecursively<TValue[TKey]> }
|
|
721
|
+
: TValue;
|
|
722
|
+
|
|
723
|
+
type RoutesToAPI<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]> =
|
|
724
|
+
ExpandRecursively<
|
|
725
|
+
UnionToIntersection<
|
|
726
|
+
TRoutes[number] extends FarmIntegrationRouteOperationCarrier<infer TPath, infer TOperation>
|
|
727
|
+
? RouteNamespaceFromPath<StripRouteClientPrefix<TPath>, TOperation>
|
|
728
|
+
: never
|
|
729
|
+
>
|
|
730
|
+
>;
|
|
731
|
+
|
|
732
|
+
export const api: {
|
|
733
|
+
get<TResponse = unknown, TServer extends boolean = false>(
|
|
734
|
+
path: string,
|
|
735
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
736
|
+
): FarmIntegrationAPIOperation<never, never, TResponse, TServer, "GET">;
|
|
737
|
+
get<TQuery = never, TResponse = unknown, TServer extends boolean = false>(
|
|
738
|
+
path: string,
|
|
739
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
740
|
+
): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "GET">;
|
|
741
|
+
get<TResponse = unknown, TServer extends boolean = false>(
|
|
742
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
743
|
+
): FarmIntegrationAPIOperation<never, never, TResponse, TServer, "GET">;
|
|
744
|
+
get<TQuery = never, TResponse = unknown, TServer extends boolean = false>(
|
|
745
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
746
|
+
): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "GET">;
|
|
747
|
+
route<TAPI extends FarmIntegrationAPI>(path: string, definition: TAPI): TAPI;
|
|
748
|
+
route<TOperations extends readonly FarmIntegrationAPIOperation<any, any, any, any, any>[]>(
|
|
749
|
+
path: string,
|
|
750
|
+
...operations: TOperations
|
|
751
|
+
): RouteOperationsToAPI<TOperations>;
|
|
752
|
+
fromRoutes<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]>(
|
|
753
|
+
routes: TRoutes,
|
|
754
|
+
): RoutesToAPI<TRoutes>;
|
|
755
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
756
|
+
path: string,
|
|
757
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
758
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
759
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
760
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
761
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
762
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
763
|
+
path: string,
|
|
764
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
765
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
766
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
767
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
768
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
769
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
770
|
+
path: string,
|
|
771
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
772
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
773
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
774
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
775
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
776
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
777
|
+
path: string,
|
|
778
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
779
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
780
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
781
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
782
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
783
|
+
options<TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
784
|
+
path: string,
|
|
785
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
786
|
+
): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "OPTIONS">;
|
|
787
|
+
options<TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
788
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
789
|
+
): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "OPTIONS">;
|
|
790
|
+
head<TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
791
|
+
path: string,
|
|
792
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
793
|
+
): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "HEAD">;
|
|
794
|
+
head<TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
795
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
796
|
+
): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "HEAD">;
|
|
797
|
+
form: {
|
|
798
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
799
|
+
path: string,
|
|
800
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
801
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
802
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
803
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
804
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
805
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
806
|
+
path: string,
|
|
807
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
808
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
809
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
810
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
811
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
812
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
813
|
+
path: string,
|
|
814
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
815
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
816
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
817
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
818
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
819
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
820
|
+
path: string,
|
|
821
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
822
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
823
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(
|
|
824
|
+
options?: IntegrationAPIBuilderOptions<TServer>,
|
|
825
|
+
): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
export const endpoint: typeof api;
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Small per-call integration metadata. When sent from a browser, values are
|
|
833
|
+
* client-controlled and should be validated before authorization decisions.
|
|
834
|
+
*/
|
|
835
|
+
export type IntegrationClientData = Record<string, unknown>;
|
|
836
|
+
|
|
837
|
+
export interface IntegrationClientOptions {
|
|
838
|
+
baseURL?: string;
|
|
839
|
+
headers?: Record<string, string>;
|
|
840
|
+
credentials?: RequestCredentials;
|
|
841
|
+
data?: IntegrationClientData;
|
|
842
|
+
isServer?: false | undefined;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
interface IntegrationRequestOptionsBase {
|
|
846
|
+
headers?: Record<string, string>;
|
|
847
|
+
signal?: AbortSignal;
|
|
848
|
+
credentials?: RequestCredentials;
|
|
849
|
+
data?: IntegrationClientData;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
export interface IntegrationClientRequestOptions extends IntegrationRequestOptionsBase {}
|
|
853
|
+
|
|
854
|
+
export type IntegrationServerRequestLike =
|
|
855
|
+
| Request
|
|
856
|
+
| {
|
|
857
|
+
url?: string;
|
|
858
|
+
headers?: HeadersInit;
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
export interface IntegrationServerClientOptions extends Omit<
|
|
862
|
+
IntegrationClientOptions,
|
|
863
|
+
"isServer"
|
|
864
|
+
> {
|
|
865
|
+
isServer: true;
|
|
866
|
+
request?: IntegrationServerRequestLike;
|
|
867
|
+
forwardHeaders?: boolean | readonly string[];
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
export interface IntegrationServerClientRequestOptions extends IntegrationRequestOptionsBase {
|
|
871
|
+
baseURL?: string;
|
|
872
|
+
request?: IntegrationServerRequestLike;
|
|
873
|
+
forwardHeaders?: boolean | readonly string[];
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export class IntegrationClientError<TData = unknown> extends Error {
|
|
877
|
+
readonly status: number;
|
|
878
|
+
readonly response: Response;
|
|
879
|
+
readonly data: TData | undefined;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export type IntegrationOperationResult<
|
|
883
|
+
TData = unknown,
|
|
884
|
+
TError = IntegrationClientError<unknown> | Error,
|
|
885
|
+
> = {
|
|
886
|
+
data: TData | null;
|
|
887
|
+
error: TError | null;
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
type ExtractIntegrationOperationBody<T> = T extends {
|
|
891
|
+
__types?: { body: infer TBody };
|
|
892
|
+
}
|
|
893
|
+
? TBody
|
|
894
|
+
: never;
|
|
895
|
+
|
|
896
|
+
type ExtractIntegrationOperationQuery<T> = T extends {
|
|
897
|
+
__types?: { query: infer TQuery };
|
|
898
|
+
}
|
|
899
|
+
? TQuery
|
|
900
|
+
: never;
|
|
901
|
+
|
|
902
|
+
type ExtractIntegrationOperationResponse<T> = T extends {
|
|
903
|
+
__types?: { response: infer TResponse };
|
|
904
|
+
}
|
|
905
|
+
? TResponse
|
|
906
|
+
: unknown;
|
|
907
|
+
|
|
908
|
+
export type InferIntegrationOperationBody<T> = ExtractIntegrationOperationBody<T>;
|
|
909
|
+
export type InferIntegrationOperationQuery<T> = ExtractIntegrationOperationQuery<T>;
|
|
910
|
+
export type InferIntegrationOperationResponse<T> = ExtractIntegrationOperationResponse<T>;
|
|
911
|
+
|
|
912
|
+
type IsIntegrationNever<T> = [T] extends [never] ? true : false;
|
|
913
|
+
|
|
914
|
+
type IntegrationOperationInput<T> =
|
|
915
|
+
IsIntegrationNever<ExtractIntegrationOperationBody<T>> extends true
|
|
916
|
+
? IsIntegrationNever<ExtractIntegrationOperationQuery<T>> extends true
|
|
917
|
+
? {}
|
|
918
|
+
: { query?: ExtractIntegrationOperationQuery<T> }
|
|
919
|
+
: IsIntegrationNever<ExtractIntegrationOperationQuery<T>> extends true
|
|
920
|
+
? { body: ExtractIntegrationOperationBody<T> }
|
|
921
|
+
: {
|
|
922
|
+
body: ExtractIntegrationOperationBody<T>;
|
|
923
|
+
query?: ExtractIntegrationOperationQuery<T>;
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
type IntegrationOperationMethod<T> = (
|
|
927
|
+
options?: IntegrationOperationInput<T>,
|
|
928
|
+
requestOptions?: IntegrationClientRequestOptions,
|
|
929
|
+
) => Promise<IntegrationOperationResult<ExtractIntegrationOperationResponse<T>>>;
|
|
930
|
+
|
|
931
|
+
type IsUnion<T, U = T> = T extends any ? ([U] extends [T] ? false : true) : never;
|
|
932
|
+
|
|
933
|
+
type SingleKey<T> = [T] extends [never] ? never : IsUnion<T> extends true ? never : T;
|
|
934
|
+
|
|
935
|
+
type ExtractAPIFromSource<TSource> = TSource extends { api?: infer TAPI }
|
|
936
|
+
? NonNullable<TAPI> extends FarmIntegrationAPI
|
|
937
|
+
? NonNullable<TAPI>
|
|
938
|
+
: never
|
|
939
|
+
: TSource extends FarmIntegrationAPI
|
|
940
|
+
? TSource
|
|
941
|
+
: never;
|
|
942
|
+
|
|
943
|
+
type SourceKeysWithAPI<TSources extends Record<string, any>> = {
|
|
944
|
+
[K in keyof TSources]: [ExtractAPIFromSource<TSources[K]>] extends [never] ? never : K;
|
|
945
|
+
}[keyof TSources];
|
|
946
|
+
|
|
947
|
+
type IsServerRegisteredOperation<T> = T extends { isServer: true } ? true : false;
|
|
948
|
+
|
|
949
|
+
type ClientOperationKeys<TAPI> = {
|
|
950
|
+
[K in keyof TAPI]: TAPI[K] extends FarmIntegrationAPIOperation<any, any, any, any>
|
|
951
|
+
? IsServerRegisteredOperation<TAPI[K]> extends true
|
|
952
|
+
? never
|
|
953
|
+
: K
|
|
954
|
+
: never;
|
|
955
|
+
}[keyof TAPI];
|
|
956
|
+
|
|
957
|
+
type ClientNamespaceShape<TAPI> = {
|
|
958
|
+
[K in keyof TAPI as TAPI[K] extends FarmIntegrationAPIOperation<any, any, any, any>
|
|
959
|
+
? IsServerRegisteredOperation<TAPI[K]> extends true
|
|
960
|
+
? never
|
|
961
|
+
: K
|
|
962
|
+
: K]: TAPI[K] extends FarmIntegrationAPIOperation<any, any, any, any>
|
|
963
|
+
? IntegrationOperationMethod<TAPI[K]>
|
|
964
|
+
: TAPI[K] extends Record<string, any>
|
|
965
|
+
? IntegrationAPIToClient<TAPI[K]>
|
|
966
|
+
: never;
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
type SingleClientOperationKey<TAPI> =
|
|
970
|
+
Exclude<keyof TAPI, ClientOperationKeys<TAPI>> extends never
|
|
971
|
+
? SingleKey<ClientOperationKeys<TAPI>>
|
|
972
|
+
: never;
|
|
973
|
+
|
|
974
|
+
type IntegrationAPIToClient<TAPI> =
|
|
975
|
+
TAPI extends FarmIntegrationAPIOperation<any, any, any, any>
|
|
976
|
+
? IntegrationOperationMethod<TAPI>
|
|
977
|
+
: TAPI extends Record<string, any>
|
|
978
|
+
? [SingleClientOperationKey<TAPI>] extends [never]
|
|
979
|
+
? ClientNamespaceShape<TAPI>
|
|
980
|
+
: SingleClientOperationKey<TAPI> extends keyof TAPI
|
|
981
|
+
? IntegrationOperationMethod<TAPI[SingleClientOperationKey<TAPI>]> &
|
|
982
|
+
ClientNamespaceShape<TAPI>
|
|
983
|
+
: ClientNamespaceShape<TAPI>
|
|
984
|
+
: never;
|
|
985
|
+
|
|
986
|
+
export type IntegrationClient<TSources extends Record<string, any>> = {
|
|
987
|
+
[K in SourceKeysWithAPI<TSources>]: IntegrationAPIToClient<ExtractAPIFromSource<TSources[K]>>;
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
export type IntegrationClientRoot<TSources extends Record<string, any>> = {
|
|
991
|
+
integrations: IntegrationClient<TSources>;
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
export type IntegrationClientAliases<TSources extends Record<string, any>> =
|
|
995
|
+
IntegrationClient<TSources> & {
|
|
996
|
+
integrations: IntegrationClient<TSources>;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
type IntegrationServerOperationMethod<T> = (
|
|
1000
|
+
options?: IntegrationOperationInput<T>,
|
|
1001
|
+
requestOptions?: IntegrationServerClientRequestOptions,
|
|
1002
|
+
) => Promise<IntegrationOperationResult<ExtractIntegrationOperationResponse<T>>>;
|
|
1003
|
+
|
|
1004
|
+
type ServerOperationKeys<TAPI> = {
|
|
1005
|
+
[K in keyof TAPI]: TAPI[K] extends FarmIntegrationAPIOperation<any, any, any, any> ? K : never;
|
|
1006
|
+
}[keyof TAPI];
|
|
1007
|
+
|
|
1008
|
+
type ServerNamespaceShape<TAPI> = {
|
|
1009
|
+
[K in keyof TAPI]: TAPI[K] extends FarmIntegrationAPIOperation<any, any, any, any>
|
|
1010
|
+
? IntegrationServerOperationMethod<TAPI[K]>
|
|
1011
|
+
: TAPI[K] extends Record<string, any>
|
|
1012
|
+
? IntegrationAPIToServerClient<TAPI[K]>
|
|
1013
|
+
: never;
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
type SingleServerOperationKey<TAPI> =
|
|
1017
|
+
Exclude<keyof TAPI, ServerOperationKeys<TAPI>> extends never
|
|
1018
|
+
? SingleKey<ServerOperationKeys<TAPI>>
|
|
1019
|
+
: never;
|
|
1020
|
+
|
|
1021
|
+
type IntegrationAPIToServerClient<TAPI> =
|
|
1022
|
+
TAPI extends FarmIntegrationAPIOperation<any, any, any, any>
|
|
1023
|
+
? IntegrationServerOperationMethod<TAPI>
|
|
1024
|
+
: TAPI extends Record<string, any>
|
|
1025
|
+
? [SingleServerOperationKey<TAPI>] extends [never]
|
|
1026
|
+
? ServerNamespaceShape<TAPI>
|
|
1027
|
+
: SingleServerOperationKey<TAPI> extends keyof TAPI
|
|
1028
|
+
? IntegrationServerOperationMethod<TAPI[SingleServerOperationKey<TAPI>]> &
|
|
1029
|
+
ServerNamespaceShape<TAPI>
|
|
1030
|
+
: ServerNamespaceShape<TAPI>
|
|
1031
|
+
: never;
|
|
1032
|
+
|
|
1033
|
+
export type IntegrationServerClient<TSources extends Record<string, any>> = {
|
|
1034
|
+
[K in SourceKeysWithAPI<TSources>]: IntegrationAPIToServerClient<
|
|
1035
|
+
ExtractAPIFromSource<TSources[K]>
|
|
1036
|
+
>;
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
export type IntegrationServerClientRoot<TSources extends Record<string, any>> = {
|
|
1040
|
+
integrations: IntegrationServerClient<TSources>;
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1043
|
+
export type IntegrationServerClientAliases<TSources extends Record<string, any>> =
|
|
1044
|
+
IntegrationServerClient<TSources> & {
|
|
1045
|
+
integrations: IntegrationServerClient<TSources>;
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
export type IntegrationAPI<TSources extends Record<string, any>> =
|
|
1049
|
+
IntegrationClientAliases<TSources> & {
|
|
1050
|
+
server: (
|
|
1051
|
+
options: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1052
|
+
) => IntegrationServerClientAliases<TSources>;
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
export type IntegrationClients<TSources extends Record<string, any>> = {
|
|
1056
|
+
api: IntegrationServerClientAliases<TSources>;
|
|
1057
|
+
apiClient: IntegrationClientAliases<TSources>;
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
export function createIntegrationClient<TSources extends Record<string, any>>(
|
|
1061
|
+
sources: { integrations: TSources },
|
|
1062
|
+
options: IntegrationServerClientOptions,
|
|
1063
|
+
): IntegrationServerClientAliases<TSources>;
|
|
1064
|
+
|
|
1065
|
+
export function createIntegrationClient<TSources extends Record<string, any>>(
|
|
1066
|
+
sources: { integrations: TSources },
|
|
1067
|
+
options?: IntegrationClientOptions,
|
|
1068
|
+
): IntegrationClientAliases<TSources>;
|
|
1069
|
+
|
|
1070
|
+
export function createIntegrationClient<TSources extends Record<string, any>>(
|
|
1071
|
+
sources: TSources,
|
|
1072
|
+
options: IntegrationServerClientOptions,
|
|
1073
|
+
): IntegrationServerClient<TSources>;
|
|
1074
|
+
|
|
1075
|
+
export function createIntegrationClient<TSources extends Record<string, any>>(
|
|
1076
|
+
sources: TSources,
|
|
1077
|
+
options?: IntegrationClientOptions,
|
|
1078
|
+
): IntegrationClient<TSources>;
|
|
1079
|
+
|
|
1080
|
+
export function createIntegrationServerClient<TSources extends Record<string, any>>(sources: {
|
|
1081
|
+
integrations: TSources;
|
|
1082
|
+
}): IntegrationServerClientAliases<TSources>;
|
|
1083
|
+
|
|
1084
|
+
export function createIntegrationServerClient<TSources extends Record<string, any>>(
|
|
1085
|
+
sources: TSources,
|
|
1086
|
+
): IntegrationServerClient<TSources>;
|
|
1087
|
+
|
|
1088
|
+
export function createIntegrationServerClient<TSources extends Record<string, any>>(
|
|
1089
|
+
sources: { integrations: TSources },
|
|
1090
|
+
options: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1091
|
+
): IntegrationServerClientAliases<TSources>;
|
|
1092
|
+
|
|
1093
|
+
export function createIntegrationServerClient<TSources extends Record<string, any>>(
|
|
1094
|
+
sources: TSources,
|
|
1095
|
+
options: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1096
|
+
): IntegrationServerClient<TSources>;
|
|
1097
|
+
|
|
1098
|
+
export function integrationsClient<
|
|
1099
|
+
TSources extends Record<string, any>,
|
|
1100
|
+
>(): IntegrationClientAliases<TSources>;
|
|
1101
|
+
|
|
1102
|
+
export function integrationsClient<TSources extends Record<string, any>>(
|
|
1103
|
+
options: IntegrationClientOptions,
|
|
1104
|
+
): IntegrationClientAliases<TSources>;
|
|
1105
|
+
|
|
1106
|
+
export function integrationsServer<
|
|
1107
|
+
TSources extends Record<string, any>,
|
|
1108
|
+
>(): IntegrationServerClientAliases<TSources>;
|
|
1109
|
+
|
|
1110
|
+
export function integrationsServer<TSources extends Record<string, any>>(
|
|
1111
|
+
options: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1112
|
+
): IntegrationServerClientAliases<TSources>;
|
|
1113
|
+
|
|
1114
|
+
export function createIntegrationApi<TSources extends Record<string, any>>(
|
|
1115
|
+
sources: { integrations: TSources },
|
|
1116
|
+
options?: IntegrationClientOptions,
|
|
1117
|
+
): IntegrationAPI<TSources>;
|
|
1118
|
+
|
|
1119
|
+
export function createIntegrationClients<TSources extends Record<string, any>>(
|
|
1120
|
+
clientOptions?: IntegrationClientOptions,
|
|
1121
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1122
|
+
): IntegrationClients<TSources>;
|
|
1123
|
+
|
|
1124
|
+
export function createIntegrationClients<TSources extends Record<string, any>>(
|
|
1125
|
+
sources: TSources,
|
|
1126
|
+
clientOptions?: IntegrationClientOptions,
|
|
1127
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1128
|
+
): IntegrationClients<TSources>;
|
|
1129
|
+
|
|
1130
|
+
export function createIntegrationClients<TSources extends Record<string, any>>(
|
|
1131
|
+
sources: { integrations: TSources },
|
|
1132
|
+
clientOptions?: IntegrationClientOptions,
|
|
1133
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1134
|
+
): IntegrationClients<TSources>;
|
|
1135
|
+
|
|
1136
|
+
export function createIntegrations<TSources extends Record<string, any>>(
|
|
1137
|
+
clientOptions?: IntegrationClientOptions,
|
|
1138
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1139
|
+
): IntegrationClients<TSources>;
|
|
1140
|
+
|
|
1141
|
+
export function createIntegrations<TSources extends Record<string, any>>(
|
|
1142
|
+
sources: TSources,
|
|
1143
|
+
clientOptions?: IntegrationClientOptions,
|
|
1144
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1145
|
+
): IntegrationClients<TSources>;
|
|
1146
|
+
|
|
1147
|
+
export function createIntegrations<TSources extends Record<string, any>>(
|
|
1148
|
+
sources: { integrations: TSources },
|
|
1149
|
+
clientOptions?: IntegrationClientOptions,
|
|
1150
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1151
|
+
): IntegrationClients<TSources>;
|
|
1152
|
+
|
|
1153
|
+
export function integrationClients<TSources extends Record<string, any>>(
|
|
1154
|
+
clientOptions?: IntegrationClientOptions,
|
|
1155
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1156
|
+
): IntegrationClients<TSources>;
|
|
1157
|
+
|
|
1158
|
+
export function integrationClients<TSources extends Record<string, any>>(
|
|
1159
|
+
sources: TSources,
|
|
1160
|
+
clientOptions?: IntegrationClientOptions,
|
|
1161
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1162
|
+
): IntegrationClients<TSources>;
|
|
1163
|
+
|
|
1164
|
+
export function integrationClients<TSources extends Record<string, any>>(
|
|
1165
|
+
sources: { integrations: TSources },
|
|
1166
|
+
clientOptions?: IntegrationClientOptions,
|
|
1167
|
+
serverOptions?: Omit<IntegrationServerClientOptions, "isServer">,
|
|
1168
|
+
): IntegrationClients<TSources>;
|
|
1169
|
+
|
|
1170
|
+
export function getIntegrationAPIManifest(): Record<string, FarmIntegrationAPI>;
|
|
1171
|
+
}
|