@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
package/dist/env.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/env.ts"],"sourcesContent":["export interface EnvSchema<TOutput = unknown> {\n parse(value: unknown): TOutput;\n}\n\nexport type EnvParser<TOutput = unknown> =\n | EnvSchema<TOutput>\n | ((value: string | undefined, context: { key: string; scope: \"server\" | \"public\" }) => TOutput);\n\nexport type EnvShape = Record<string, EnvParser<any>>;\n\nexport type InferEnvParser<TParser> =\n TParser extends EnvSchema<infer TOutput>\n ? TOutput\n : TParser extends (value: string | undefined, context: any) => infer TOutput\n ? TOutput\n : never;\n\nexport type InferEnvShape<TShape> = TShape extends EnvShape\n ? { [K in keyof TShape]: InferEnvParser<TShape[K]> }\n : {};\n\nexport interface FarmEnvConfig<\n TServer extends EnvShape = EnvShape,\n TPublic extends EnvShape = EnvShape,\n> {\n server?: TServer;\n public?: TPublic;\n}\n\nexport interface ResolvedFarmEnv<\n TServer extends Record<string, any> = Record<string, unknown>,\n TPublic extends Record<string, any> = Record<string, unknown>,\n> {\n server: TServer;\n public: TPublic;\n}\n\nexport type InferEnv<TConfig> =\n TConfig extends FarmEnvConfig<infer TServer, infer TPublic>\n ? ResolvedFarmEnv<InferEnvShape<TServer>, InferEnvShape<TPublic>>\n : ResolvedFarmEnv;\n\n/**\n * Augmented by generated src/farm-env.d.ts for project-specific autocomplete.\n */\nexport interface FarmEnvTypes {}\n\nexport type FarmServerEnv = FarmEnvTypes extends { server: infer TServer }\n ? TServer extends Record<string, any>\n ? TServer\n : Record<string, unknown>\n : Record<string, unknown>;\n\nexport type FarmPublicEnv = FarmEnvTypes extends { public: infer TPublic }\n ? TPublic extends Record<string, any>\n ? TPublic\n : Record<string, unknown>\n : Record<string, unknown>;\n\nexport type FarmTypedEnv = ResolvedFarmEnv<FarmServerEnv, FarmPublicEnv>;\n\ndeclare const __FARM_PUBLIC_ENV__: Record<string, unknown> | undefined;\ndeclare const __FARM_ENV__: ResolvedFarmEnv | undefined;\n\nconst FARM_ENV_SYMBOL = Symbol.for(\"farm.env\");\nconst farmEnvGlobal = globalThis as typeof globalThis & {\n [FARM_ENV_SYMBOL]?: ResolvedFarmEnv;\n};\nlet currentEnv: ResolvedFarmEnv = getInitialEnv();\n\nexport function resolveEnv<TConfig extends FarmEnvConfig<any, any> | undefined>(\n config: TConfig,\n source: Record<string, string | undefined> = getProcessEnv(),\n): InferEnv<NonNullable<TConfig>> {\n const resolved = {\n server: resolveEnvScope(config?.server, source, \"server\"),\n public: resolveEnvScope(config?.public, source, \"public\"),\n } as InferEnv<NonNullable<TConfig>>;\n\n return resolved;\n}\n\nexport function setEnv(env: ResolvedFarmEnv): void {\n currentEnv = normalizeResolvedEnv(env);\n if (typeof window === \"undefined\") {\n farmEnvGlobal[FARM_ENV_SYMBOL] = currentEnv;\n }\n}\n\nexport function getResolvedEnv<TEnv extends ResolvedFarmEnv = FarmTypedEnv>(): TEnv {\n return getCurrentEnv() as TEnv;\n}\n\nexport function getEnv<TServer extends Record<string, any> = FarmServerEnv>(): TServer;\nexport function getEnv<TKey extends Extract<keyof FarmServerEnv, string>>(\n key: TKey,\n): FarmServerEnv[TKey];\nexport function getEnv(key?: string): unknown {\n assertServerEnvAccess();\n if (key === undefined) {\n return getCurrentEnv().server;\n }\n\n return getCurrentEnv().server[key];\n}\n\nexport function getPublicEnv<TPublic extends Record<string, any> = FarmPublicEnv>(): TPublic;\nexport function getPublicEnv<TKey extends Extract<keyof FarmPublicEnv, string>>(\n key: TKey,\n): FarmPublicEnv[TKey];\nexport function getPublicEnv(key?: string): unknown {\n if (key === undefined) {\n return getCurrentEnv().public;\n }\n\n return getCurrentEnv().public[key];\n}\n\nexport const env = createEnvProxy(\"server\") as FarmServerEnv;\nexport const serverEnv = env;\nexport const publicEnv = createEnvProxy(\"public\") as FarmPublicEnv;\n\nfunction resolveEnvScope(\n shape: EnvShape | undefined,\n source: Record<string, string | undefined>,\n scope: \"server\" | \"public\",\n): Record<string, unknown> {\n if (!shape) {\n return {};\n }\n\n const resolved: Record<string, unknown> = {};\n\n for (const [key, parser] of Object.entries(shape)) {\n try {\n resolved[key] = parseEnvValue(parser, source[key], key, scope);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Invalid ${scope} env \"${key}\": ${message}`);\n }\n }\n\n return resolved;\n}\n\nfunction parseEnvValue(\n parser: EnvParser<any>,\n value: string | undefined,\n key: string,\n scope: \"server\" | \"public\",\n): unknown {\n if (typeof parser === \"function\") {\n return parser(value, { key, scope });\n }\n\n if (parser && typeof parser.parse === \"function\") {\n return parser.parse(value);\n }\n\n throw new Error(\"expected a parser function or schema with parse()\");\n}\n\nfunction createEnvProxy(scope: \"server\" | \"public\"): Record<string, unknown> {\n return new Proxy(\n {},\n {\n get(_target, property) {\n if (typeof property === \"symbol\") {\n return undefined;\n }\n\n const env = getEnvScope(scope);\n return env[property];\n },\n ownKeys() {\n return Reflect.ownKeys(getEnvScope(scope));\n },\n getOwnPropertyDescriptor(_target, property) {\n const env = getEnvScope(scope);\n if (!(property in env)) {\n return undefined;\n }\n\n return {\n enumerable: true,\n configurable: true,\n value: env[property as keyof typeof env],\n };\n },\n has(_target, property) {\n return property in getEnvScope(scope);\n },\n },\n );\n}\n\nfunction getEnvScope(scope: \"server\" | \"public\"): Record<string, unknown> {\n if (scope === \"server\") {\n assertServerEnvAccess();\n }\n\n return getCurrentEnv()[scope] || {};\n}\n\nfunction assertServerEnvAccess(): void {\n if (typeof window !== \"undefined\") {\n throw new Error(\"Farm server env is not available in the browser. Use publicEnv.\");\n }\n}\n\nfunction getInitialEnv(): ResolvedFarmEnv {\n const injectedEnv = getInjectedEnv();\n if (injectedEnv) {\n return injectedEnv;\n }\n\n if (typeof window === \"undefined\" && farmEnvGlobal[FARM_ENV_SYMBOL]) {\n return normalizeResolvedEnv(farmEnvGlobal[FARM_ENV_SYMBOL]);\n }\n\n return {\n server: {},\n public: getInjectedPublicEnv(),\n };\n}\n\nfunction getCurrentEnv(): ResolvedFarmEnv {\n if (typeof window === \"undefined\" && farmEnvGlobal[FARM_ENV_SYMBOL]) {\n return farmEnvGlobal[FARM_ENV_SYMBOL];\n }\n\n return currentEnv;\n}\n\nfunction getInjectedEnv(): ResolvedFarmEnv | null {\n try {\n if (typeof __FARM_ENV__ !== \"undefined\" && __FARM_ENV__) {\n return normalizeResolvedEnv(__FARM_ENV__);\n }\n } catch {\n // The compile-time global is only defined in Farm server bundles.\n }\n\n return null;\n}\n\nfunction getInjectedPublicEnv(): Record<string, unknown> {\n try {\n if (typeof __FARM_PUBLIC_ENV__ !== \"undefined\" && __FARM_PUBLIC_ENV__) {\n return __FARM_PUBLIC_ENV__;\n }\n } catch {\n // The compile-time global is only defined in Farm browser bundles.\n }\n\n return {};\n}\n\nfunction normalizeResolvedEnv(env: ResolvedFarmEnv): ResolvedFarmEnv {\n return {\n server: isRecord(env.server) ? env.server : {},\n public: isRecord(env.public) ? env.public : {},\n };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction getProcessEnv(): Record<string, string | undefined> {\n if (typeof process !== \"undefined\" && process.env) {\n return process.env;\n }\n\n return {};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgEA,IAAM,kBAAkB,uBAAO,IAAI,UAAU;AAC7C,IAA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AO,WAAW,eAAe,cAAc,eAAe,GAAG;AACnE,WAAO,qBAAqB,cAAc,eAAe,CAAC;AAAA,EAC5D;AAEA,SAAO;AAAA,IACL,QAAQ,CAAC;AAAA,IACT,QAAQ,qBAAqB;AAAA,EAC/B;AACF;AAdS;AAgBT,SAAS,gBAAiC;AACxC,MAAI,OAAO,WAAW,eAAe,cAAc,eAAe,GAAG;AACnE,WAAO,cAAc,eAAe;AAAA,EACtC;AAEA,SAAO;AACT;AANS;AAQT,SAAS,iBAAyC;AAChD,MAAI;AACF,QAAI,OAAO,iBAAiB,eAAe,cAAc;AACvD,aAAO,qBAAqB,YAAY;AAAA,IAC1C;AAAA,EACF,QAAQ;AAAA,EAER;AAEA,SAAO;AACT;AAVS;AAYT,SAAS,uBAAgD;AACvD,MAAI;AACF,QAAI,OAAO,wBAAwB,eAAe,qBAAqB;AACrE,aAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAER;AAEA,SAAO,CAAC;AACV;AAVS;AAYT,SAAS,qBAAqBA,MAAuC;AACnE,SAAO;AAAA,IACL,QAAQ,SAASA,KAAI,MAAM,IAAIA,KAAI,SAAS,CAAC;AAAA,IAC7C,QAAQ,SAASA,KAAI,MAAM,IAAIA,KAAI,SAAS,CAAC;AAAA,EAC/C;AACF;AALS;AAOT,SAAS,SAAS,OAAkD;AAClE,SAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AACrE;AAFS;AAIT,SAAS,gBAAoD;AAC3D,MAAI,OAAO,YAAY,eAAe,QAAQ,KAAK;AACjD,WAAO,QAAQ;AAAA,EACjB;AAEA,SAAO,CAAC;AACV;AANS;","names":["env"]}
|
package/dist/env.d.mts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
interface EnvSchema<TOutput = unknown> {
|
|
2
|
-
parse(value: unknown): TOutput;
|
|
3
|
-
}
|
|
4
|
-
type EnvParser<TOutput = unknown> = EnvSchema<TOutput> | ((value: string | undefined, context: {
|
|
5
|
-
key: string;
|
|
6
|
-
scope: "server" | "public";
|
|
7
|
-
}) => TOutput);
|
|
8
|
-
type EnvShape = Record<string, EnvParser<any>>;
|
|
9
|
-
type InferEnvParser<TParser> = TParser extends EnvSchema<infer TOutput> ? TOutput : TParser extends (value: string | undefined, context: any) => infer TOutput ? TOutput : never;
|
|
10
|
-
type InferEnvShape<TShape> = TShape extends EnvShape ? {
|
|
11
|
-
[K in keyof TShape]: InferEnvParser<TShape[K]>;
|
|
12
|
-
} : {};
|
|
13
|
-
interface FarmEnvConfig<TServer extends EnvShape = EnvShape, TPublic extends EnvShape = EnvShape> {
|
|
14
|
-
server?: TServer;
|
|
15
|
-
public?: TPublic;
|
|
16
|
-
}
|
|
17
|
-
interface ResolvedFarmEnv<TServer extends Record<string, any> = Record<string, unknown>, TPublic extends Record<string, any> = Record<string, unknown>> {
|
|
18
|
-
server: TServer;
|
|
19
|
-
public: TPublic;
|
|
20
|
-
}
|
|
21
|
-
type InferEnv<TConfig> = TConfig extends FarmEnvConfig<infer TServer, infer TPublic> ? ResolvedFarmEnv<InferEnvShape<TServer>, InferEnvShape<TPublic>> : ResolvedFarmEnv;
|
|
22
|
-
/**
|
|
23
|
-
* Augmented by generated src/farm-env.d.ts for project-specific autocomplete.
|
|
24
|
-
*/
|
|
25
|
-
interface FarmEnvTypes {
|
|
26
|
-
}
|
|
27
|
-
type FarmServerEnv = FarmEnvTypes extends {
|
|
28
|
-
server: infer TServer;
|
|
29
|
-
} ? TServer extends Record<string, any> ? TServer : Record<string, unknown> : Record<string, unknown>;
|
|
30
|
-
type FarmPublicEnv = FarmEnvTypes extends {
|
|
31
|
-
public: infer TPublic;
|
|
32
|
-
} ? TPublic extends Record<string, any> ? TPublic : Record<string, unknown> : Record<string, unknown>;
|
|
33
|
-
type FarmTypedEnv = ResolvedFarmEnv<FarmServerEnv, FarmPublicEnv>;
|
|
34
|
-
declare function resolveEnv<TConfig extends FarmEnvConfig<any, any> | undefined>(config: TConfig, source?: Record<string, string | undefined>): InferEnv<NonNullable<TConfig>>;
|
|
35
|
-
declare function setEnv(env: ResolvedFarmEnv): void;
|
|
36
|
-
declare function getResolvedEnv<TEnv extends ResolvedFarmEnv = FarmTypedEnv>(): TEnv;
|
|
37
|
-
declare function getEnv<TServer extends Record<string, any> = FarmServerEnv>(): TServer;
|
|
38
|
-
declare function getEnv<TKey extends Extract<keyof FarmServerEnv, string>>(key: TKey): FarmServerEnv[TKey];
|
|
39
|
-
declare function getPublicEnv<TPublic extends Record<string, any> = FarmPublicEnv>(): TPublic;
|
|
40
|
-
declare function getPublicEnv<TKey extends Extract<keyof FarmPublicEnv, string>>(key: TKey): FarmPublicEnv[TKey];
|
|
41
|
-
declare const env: FarmServerEnv;
|
|
42
|
-
declare const serverEnv: Record<string, unknown>;
|
|
43
|
-
declare const publicEnv: FarmPublicEnv;
|
|
44
|
-
|
|
45
|
-
export { type EnvParser, type EnvSchema, type EnvShape, type FarmEnvConfig, type FarmEnvTypes, type FarmPublicEnv, type FarmServerEnv, type FarmTypedEnv, type InferEnv, type InferEnvParser, type InferEnvShape, type ResolvedFarmEnv, env, getEnv, getPublicEnv, getResolvedEnv, publicEnv, resolveEnv, serverEnv, setEnv };
|
package/dist/env.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
interface EnvSchema<TOutput = unknown> {
|
|
2
|
-
parse(value: unknown): TOutput;
|
|
3
|
-
}
|
|
4
|
-
type EnvParser<TOutput = unknown> = EnvSchema<TOutput> | ((value: string | undefined, context: {
|
|
5
|
-
key: string;
|
|
6
|
-
scope: "server" | "public";
|
|
7
|
-
}) => TOutput);
|
|
8
|
-
type EnvShape = Record<string, EnvParser<any>>;
|
|
9
|
-
type InferEnvParser<TParser> = TParser extends EnvSchema<infer TOutput> ? TOutput : TParser extends (value: string | undefined, context: any) => infer TOutput ? TOutput : never;
|
|
10
|
-
type InferEnvShape<TShape> = TShape extends EnvShape ? {
|
|
11
|
-
[K in keyof TShape]: InferEnvParser<TShape[K]>;
|
|
12
|
-
} : {};
|
|
13
|
-
interface FarmEnvConfig<TServer extends EnvShape = EnvShape, TPublic extends EnvShape = EnvShape> {
|
|
14
|
-
server?: TServer;
|
|
15
|
-
public?: TPublic;
|
|
16
|
-
}
|
|
17
|
-
interface ResolvedFarmEnv<TServer extends Record<string, any> = Record<string, unknown>, TPublic extends Record<string, any> = Record<string, unknown>> {
|
|
18
|
-
server: TServer;
|
|
19
|
-
public: TPublic;
|
|
20
|
-
}
|
|
21
|
-
type InferEnv<TConfig> = TConfig extends FarmEnvConfig<infer TServer, infer TPublic> ? ResolvedFarmEnv<InferEnvShape<TServer>, InferEnvShape<TPublic>> : ResolvedFarmEnv;
|
|
22
|
-
/**
|
|
23
|
-
* Augmented by generated src/farm-env.d.ts for project-specific autocomplete.
|
|
24
|
-
*/
|
|
25
|
-
interface FarmEnvTypes {
|
|
26
|
-
}
|
|
27
|
-
type FarmServerEnv = FarmEnvTypes extends {
|
|
28
|
-
server: infer TServer;
|
|
29
|
-
} ? TServer extends Record<string, any> ? TServer : Record<string, unknown> : Record<string, unknown>;
|
|
30
|
-
type FarmPublicEnv = FarmEnvTypes extends {
|
|
31
|
-
public: infer TPublic;
|
|
32
|
-
} ? TPublic extends Record<string, any> ? TPublic : Record<string, unknown> : Record<string, unknown>;
|
|
33
|
-
type FarmTypedEnv = ResolvedFarmEnv<FarmServerEnv, FarmPublicEnv>;
|
|
34
|
-
declare function resolveEnv<TConfig extends FarmEnvConfig<any, any> | undefined>(config: TConfig, source?: Record<string, string | undefined>): InferEnv<NonNullable<TConfig>>;
|
|
35
|
-
declare function setEnv(env: ResolvedFarmEnv): void;
|
|
36
|
-
declare function getResolvedEnv<TEnv extends ResolvedFarmEnv = FarmTypedEnv>(): TEnv;
|
|
37
|
-
declare function getEnv<TServer extends Record<string, any> = FarmServerEnv>(): TServer;
|
|
38
|
-
declare function getEnv<TKey extends Extract<keyof FarmServerEnv, string>>(key: TKey): FarmServerEnv[TKey];
|
|
39
|
-
declare function getPublicEnv<TPublic extends Record<string, any> = FarmPublicEnv>(): TPublic;
|
|
40
|
-
declare function getPublicEnv<TKey extends Extract<keyof FarmPublicEnv, string>>(key: TKey): FarmPublicEnv[TKey];
|
|
41
|
-
declare const env: FarmServerEnv;
|
|
42
|
-
declare const serverEnv: Record<string, unknown>;
|
|
43
|
-
declare const publicEnv: FarmPublicEnv;
|
|
44
|
-
|
|
45
|
-
export { type EnvParser, type EnvSchema, type EnvShape, type FarmEnvConfig, type FarmEnvTypes, type FarmPublicEnv, type FarmServerEnv, type FarmTypedEnv, type InferEnv, type InferEnvParser, type InferEnvShape, type ResolvedFarmEnv, env, getEnv, getPublicEnv, getResolvedEnv, publicEnv, resolveEnv, serverEnv, setEnv };
|
package/dist/env.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
env,
|
|
3
|
-
getEnv,
|
|
4
|
-
getPublicEnv,
|
|
5
|
-
getResolvedEnv,
|
|
6
|
-
publicEnv,
|
|
7
|
-
resolveEnv,
|
|
8
|
-
serverEnv,
|
|
9
|
-
setEnv
|
|
10
|
-
} from "./chunk-RSKVYESE.mjs";
|
|
11
|
-
import "./chunk-CGILA3WO.mjs";
|
|
12
|
-
export {
|
|
13
|
-
env,
|
|
14
|
-
getEnv,
|
|
15
|
-
getPublicEnv,
|
|
16
|
-
getResolvedEnv,
|
|
17
|
-
publicEnv,
|
|
18
|
-
resolveEnv,
|
|
19
|
-
serverEnv,
|
|
20
|
-
setEnv
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=env.mjs.map
|
package/dist/env.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import { FarmEnvironment } from '../environment.mjs';
|
|
3
|
-
|
|
4
|
-
interface AstNode {
|
|
5
|
-
type: string;
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}
|
|
10
|
-
interface TransformEnvironmentFunctionsOptions {
|
|
11
|
-
code: string;
|
|
12
|
-
id: string;
|
|
13
|
-
environment: FarmEnvironment;
|
|
14
|
-
parse: (code: string) => AstNode;
|
|
15
|
-
}
|
|
16
|
-
interface TransformEnvironmentFunctionsResult {
|
|
17
|
-
code: string;
|
|
18
|
-
}
|
|
19
|
-
declare function transformEnvironmentFunctions(options: TransformEnvironmentFunctionsOptions): TransformEnvironmentFunctionsResult | null;
|
|
20
|
-
declare function farmEnvironmentFunctionsPlugin(): Plugin;
|
|
21
|
-
|
|
22
|
-
export { type TransformEnvironmentFunctionsOptions, type TransformEnvironmentFunctionsResult, farmEnvironmentFunctionsPlugin, transformEnvironmentFunctions };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import { FarmEnvironment } from '../environment.js';
|
|
3
|
-
|
|
4
|
-
interface AstNode {
|
|
5
|
-
type: string;
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}
|
|
10
|
-
interface TransformEnvironmentFunctionsOptions {
|
|
11
|
-
code: string;
|
|
12
|
-
id: string;
|
|
13
|
-
environment: FarmEnvironment;
|
|
14
|
-
parse: (code: string) => AstNode;
|
|
15
|
-
}
|
|
16
|
-
interface TransformEnvironmentFunctionsResult {
|
|
17
|
-
code: string;
|
|
18
|
-
}
|
|
19
|
-
declare function transformEnvironmentFunctions(options: TransformEnvironmentFunctionsOptions): TransformEnvironmentFunctionsResult | null;
|
|
20
|
-
declare function farmEnvironmentFunctionsPlugin(): Plugin;
|
|
21
|
-
|
|
22
|
-
export { type TransformEnvironmentFunctionsOptions, type TransformEnvironmentFunctionsResult, farmEnvironmentFunctionsPlugin, transformEnvironmentFunctions };
|
package/dist/environment.cjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/environment.ts
|
|
22
|
-
var environment_exports = {};
|
|
23
|
-
__export(environment_exports, {
|
|
24
|
-
FarmEnvironmentError: () => FarmEnvironmentError,
|
|
25
|
-
createClientOnlyFn: () => createClientOnlyFn,
|
|
26
|
-
createIsomorphicFn: () => createIsomorphicFn,
|
|
27
|
-
createServerOnlyFn: () => createServerOnlyFn
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(environment_exports);
|
|
30
|
-
var _FarmEnvironmentError = class _FarmEnvironmentError extends Error {
|
|
31
|
-
constructor(api, expected, actual) {
|
|
32
|
-
super(`${api}() can only be called on the ${expected}. It was called on the ${actual}.`);
|
|
33
|
-
this.api = api;
|
|
34
|
-
this.expected = expected;
|
|
35
|
-
this.actual = actual;
|
|
36
|
-
this.code = "FARM_ENVIRONMENT_MISMATCH";
|
|
37
|
-
this.name = "FarmEnvironmentError";
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
__name(_FarmEnvironmentError, "FarmEnvironmentError");
|
|
41
|
-
var FarmEnvironmentError = _FarmEnvironmentError;
|
|
42
|
-
function createServerOnlyFn(implementation, compiledActualEnvironment) {
|
|
43
|
-
if (compiledActualEnvironment) {
|
|
44
|
-
return createMismatchFunction("createServerOnlyFn", "server", compiledActualEnvironment);
|
|
45
|
-
}
|
|
46
|
-
if (getRuntimeEnvironment() !== "server") {
|
|
47
|
-
return createMismatchFunction("createServerOnlyFn", "server");
|
|
48
|
-
}
|
|
49
|
-
assertFunction(implementation, "createServerOnlyFn");
|
|
50
|
-
return implementation;
|
|
51
|
-
}
|
|
52
|
-
__name(createServerOnlyFn, "createServerOnlyFn");
|
|
53
|
-
function createClientOnlyFn(implementation, compiledActualEnvironment) {
|
|
54
|
-
if (compiledActualEnvironment) {
|
|
55
|
-
return createMismatchFunction("createClientOnlyFn", "client", compiledActualEnvironment);
|
|
56
|
-
}
|
|
57
|
-
if (getRuntimeEnvironment() !== "client") {
|
|
58
|
-
return createMismatchFunction("createClientOnlyFn", "client");
|
|
59
|
-
}
|
|
60
|
-
assertFunction(implementation, "createClientOnlyFn");
|
|
61
|
-
return implementation;
|
|
62
|
-
}
|
|
63
|
-
__name(createClientOnlyFn, "createClientOnlyFn");
|
|
64
|
-
function createIsomorphicFn(options) {
|
|
65
|
-
if (!options || typeof options !== "object") {
|
|
66
|
-
throw new TypeError("createIsomorphicFn requires server and client functions");
|
|
67
|
-
}
|
|
68
|
-
assertFunction(options.server, "createIsomorphicFn server");
|
|
69
|
-
assertFunction(options.client, "createIsomorphicFn client");
|
|
70
|
-
return getRuntimeEnvironment() === "server" ? options.server : options.client;
|
|
71
|
-
}
|
|
72
|
-
__name(createIsomorphicFn, "createIsomorphicFn");
|
|
73
|
-
function getRuntimeEnvironment() {
|
|
74
|
-
return typeof window === "undefined" ? "server" : "client";
|
|
75
|
-
}
|
|
76
|
-
__name(getRuntimeEnvironment, "getRuntimeEnvironment");
|
|
77
|
-
function createMismatchFunction(api, expected, actual = expected === "server" ? "client" : "server") {
|
|
78
|
-
return /* @__PURE__ */ __name(function farmEnvironmentBoundary() {
|
|
79
|
-
throw new FarmEnvironmentError(api, expected, actual);
|
|
80
|
-
}, "farmEnvironmentBoundary");
|
|
81
|
-
}
|
|
82
|
-
__name(createMismatchFunction, "createMismatchFunction");
|
|
83
|
-
function assertFunction(value, label) {
|
|
84
|
-
if (typeof value !== "function") {
|
|
85
|
-
throw new TypeError(`${label} must be a function`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
__name(assertFunction, "assertFunction");
|
|
89
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
-
0 && (module.exports = {
|
|
91
|
-
FarmEnvironmentError,
|
|
92
|
-
createClientOnlyFn,
|
|
93
|
-
createIsomorphicFn,
|
|
94
|
-
createServerOnlyFn
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=environment.cjs.map
|
package/dist/environment.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/environment.ts"],"sourcesContent":["type AnyEnvironmentFunction = (...args: never[]) => unknown;\n\nexport type FarmEnvironment = \"server\" | \"client\";\n\nexport interface FarmIsomorphicFnOptions<TArgs extends unknown[], TServerResult, TClientResult> {\n server: (...args: TArgs) => TServerResult;\n client: (...args: TArgs) => TClientResult;\n}\n\nexport class FarmEnvironmentError extends Error {\n readonly code = \"FARM_ENVIRONMENT_MISMATCH\";\n\n constructor(\n readonly api: \"createServerOnlyFn\" | \"createClientOnlyFn\",\n readonly expected: FarmEnvironment,\n readonly actual: FarmEnvironment,\n ) {\n super(`${api}() can only be called on the ${expected}. It was called on the ${actual}.`);\n this.name = \"FarmEnvironmentError\";\n }\n}\n\nexport function createServerOnlyFn<TFunction extends AnyEnvironmentFunction>(\n implementation: TFunction,\n): TFunction;\nexport function createServerOnlyFn(\n implementation: AnyEnvironmentFunction | undefined,\n compiledActualEnvironment?: FarmEnvironment,\n): AnyEnvironmentFunction {\n if (compiledActualEnvironment) {\n return createMismatchFunction(\"createServerOnlyFn\", \"server\", compiledActualEnvironment);\n }\n if (getRuntimeEnvironment() !== \"server\") {\n return createMismatchFunction(\"createServerOnlyFn\", \"server\");\n }\n\n assertFunction(implementation, \"createServerOnlyFn\");\n return implementation;\n}\n\nexport function createClientOnlyFn<TFunction extends AnyEnvironmentFunction>(\n implementation: TFunction,\n): TFunction;\nexport function createClientOnlyFn(\n implementation: AnyEnvironmentFunction | undefined,\n compiledActualEnvironment?: FarmEnvironment,\n): AnyEnvironmentFunction {\n if (compiledActualEnvironment) {\n return createMismatchFunction(\"createClientOnlyFn\", \"client\", compiledActualEnvironment);\n }\n if (getRuntimeEnvironment() !== \"client\") {\n return createMismatchFunction(\"createClientOnlyFn\", \"client\");\n }\n\n assertFunction(implementation, \"createClientOnlyFn\");\n return implementation;\n}\n\nexport function createIsomorphicFn<TArgs extends unknown[], TServerResult, TClientResult>(\n options: FarmIsomorphicFnOptions<TArgs, TServerResult, TClientResult>,\n): (...args: TArgs) => TServerResult | TClientResult {\n if (!options || typeof options !== \"object\") {\n throw new TypeError(\"createIsomorphicFn requires server and client functions\");\n }\n\n assertFunction(options.server, \"createIsomorphicFn server\");\n assertFunction(options.client, \"createIsomorphicFn client\");\n\n return getRuntimeEnvironment() === \"server\" ? options.server : options.client;\n}\n\nfunction getRuntimeEnvironment(): FarmEnvironment {\n return typeof window === \"undefined\" ? \"server\" : \"client\";\n}\n\nfunction createMismatchFunction(\n api: \"createServerOnlyFn\" | \"createClientOnlyFn\",\n expected: FarmEnvironment,\n actual: FarmEnvironment = expected === \"server\" ? \"client\" : \"server\",\n) {\n return function farmEnvironmentBoundary(): never {\n throw new FarmEnvironmentError(api, expected, actual);\n };\n}\n\nfunction assertFunction(value: unknown, label: string): asserts value is AnyEnvironmentFunction {\n if (typeof value !== \"function\") {\n throw new TypeError(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C,UAAM,IAAI,qBAAqB,KAAK,UAAU,MAAM;AAAA,EACtD,GAFO;AAGT;AARS;AAUT,SAAS,eAAe,OAAgB,OAAwD;AAC9F,MAAI,OAAO,UAAU,YAAY;AAC/B,UAAM,IAAI,UAAU,GAAG,KAAK,qBAAqB;AAAA,EACnD;AACF;AAJS;","names":[]}
|
package/dist/environment.d.mts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type AnyEnvironmentFunction = (...args: never[]) => unknown;
|
|
2
|
-
type FarmEnvironment = "server" | "client";
|
|
3
|
-
interface FarmIsomorphicFnOptions<TArgs extends unknown[], TServerResult, TClientResult> {
|
|
4
|
-
server: (...args: TArgs) => TServerResult;
|
|
5
|
-
client: (...args: TArgs) => TClientResult;
|
|
6
|
-
}
|
|
7
|
-
declare class FarmEnvironmentError extends Error {
|
|
8
|
-
readonly api: "createServerOnlyFn" | "createClientOnlyFn";
|
|
9
|
-
readonly expected: FarmEnvironment;
|
|
10
|
-
readonly actual: FarmEnvironment;
|
|
11
|
-
readonly code = "FARM_ENVIRONMENT_MISMATCH";
|
|
12
|
-
constructor(api: "createServerOnlyFn" | "createClientOnlyFn", expected: FarmEnvironment, actual: FarmEnvironment);
|
|
13
|
-
}
|
|
14
|
-
declare function createServerOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
|
|
15
|
-
declare function createClientOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
|
|
16
|
-
declare function createIsomorphicFn<TArgs extends unknown[], TServerResult, TClientResult>(options: FarmIsomorphicFnOptions<TArgs, TServerResult, TClientResult>): (...args: TArgs) => TServerResult | TClientResult;
|
|
17
|
-
|
|
18
|
-
export { type FarmEnvironment, FarmEnvironmentError, type FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn };
|
package/dist/environment.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type AnyEnvironmentFunction = (...args: never[]) => unknown;
|
|
2
|
-
type FarmEnvironment = "server" | "client";
|
|
3
|
-
interface FarmIsomorphicFnOptions<TArgs extends unknown[], TServerResult, TClientResult> {
|
|
4
|
-
server: (...args: TArgs) => TServerResult;
|
|
5
|
-
client: (...args: TArgs) => TClientResult;
|
|
6
|
-
}
|
|
7
|
-
declare class FarmEnvironmentError extends Error {
|
|
8
|
-
readonly api: "createServerOnlyFn" | "createClientOnlyFn";
|
|
9
|
-
readonly expected: FarmEnvironment;
|
|
10
|
-
readonly actual: FarmEnvironment;
|
|
11
|
-
readonly code = "FARM_ENVIRONMENT_MISMATCH";
|
|
12
|
-
constructor(api: "createServerOnlyFn" | "createClientOnlyFn", expected: FarmEnvironment, actual: FarmEnvironment);
|
|
13
|
-
}
|
|
14
|
-
declare function createServerOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
|
|
15
|
-
declare function createClientOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
|
|
16
|
-
declare function createIsomorphicFn<TArgs extends unknown[], TServerResult, TClientResult>(options: FarmIsomorphicFnOptions<TArgs, TServerResult, TClientResult>): (...args: TArgs) => TServerResult | TClientResult;
|
|
17
|
-
|
|
18
|
-
export { type FarmEnvironment, FarmEnvironmentError, type FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn };
|
package/dist/environment.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FarmEnvironmentError,
|
|
3
|
-
createClientOnlyFn,
|
|
4
|
-
createIsomorphicFn,
|
|
5
|
-
createServerOnlyFn
|
|
6
|
-
} from "./chunk-J23HNLFY.mjs";
|
|
7
|
-
import "./chunk-CGILA3WO.mjs";
|
|
8
|
-
export {
|
|
9
|
-
FarmEnvironmentError,
|
|
10
|
-
createClientOnlyFn,
|
|
11
|
-
createIsomorphicFn,
|
|
12
|
-
createServerOnlyFn
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=environment.mjs.map
|
package/dist/environment.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/headers.cjs
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/headers.ts
|
|
22
|
-
var headers_exports = {};
|
|
23
|
-
__export(headers_exports, {
|
|
24
|
-
cookies: () => cookies,
|
|
25
|
-
headers: () => headers
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(headers_exports);
|
|
28
|
-
|
|
29
|
-
// src/server/request.ts
|
|
30
|
-
var import_node_async_hooks = require("async_hooks");
|
|
31
|
-
|
|
32
|
-
// src/server/request-bridge.ts
|
|
33
|
-
var CURRENT_REQUEST_RESOLVER_KEY = /* @__PURE__ */ Symbol.for("farm.currentRequestResolver");
|
|
34
|
-
function getGlobalState() {
|
|
35
|
-
return globalThis;
|
|
36
|
-
}
|
|
37
|
-
__name(getGlobalState, "getGlobalState");
|
|
38
|
-
function _setCurrentRequestResolver(resolver) {
|
|
39
|
-
getGlobalState()[CURRENT_REQUEST_RESOLVER_KEY] = resolver;
|
|
40
|
-
}
|
|
41
|
-
__name(_setCurrentRequestResolver, "_setCurrentRequestResolver");
|
|
42
|
-
|
|
43
|
-
// src/server/request.ts
|
|
44
|
-
var REQUEST_STORAGE_KEY = /* @__PURE__ */ Symbol.for("@farm.js/core/request-storage");
|
|
45
|
-
function getRequestStore() {
|
|
46
|
-
const runtime = globalThis;
|
|
47
|
-
const existing = runtime[REQUEST_STORAGE_KEY];
|
|
48
|
-
if (existing instanceof import_node_async_hooks.AsyncLocalStorage) {
|
|
49
|
-
return existing;
|
|
50
|
-
}
|
|
51
|
-
const storage = new import_node_async_hooks.AsyncLocalStorage();
|
|
52
|
-
runtime[REQUEST_STORAGE_KEY] = storage;
|
|
53
|
-
return storage;
|
|
54
|
-
}
|
|
55
|
-
__name(getRequestStore, "getRequestStore");
|
|
56
|
-
var requestStore = getRequestStore();
|
|
57
|
-
_setCurrentRequestResolver(() => requestStore.getStore());
|
|
58
|
-
function getCurrentRequest() {
|
|
59
|
-
const request = requestStore.getStore();
|
|
60
|
-
if (!request) {
|
|
61
|
-
throw new Error(
|
|
62
|
-
"No current request is available. getCurrentRequest() can only be used during server rendering."
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
return request;
|
|
66
|
-
}
|
|
67
|
-
__name(getCurrentRequest, "getCurrentRequest");
|
|
68
|
-
|
|
69
|
-
// src/headers.ts
|
|
70
|
-
function headers() {
|
|
71
|
-
return new Headers(getCurrentRequest().headers);
|
|
72
|
-
}
|
|
73
|
-
__name(headers, "headers");
|
|
74
|
-
function cookies() {
|
|
75
|
-
const cookieHeader = getCurrentRequest().headers.get("cookie") || "";
|
|
76
|
-
const parsed = parseCookieHeader(cookieHeader);
|
|
77
|
-
return {
|
|
78
|
-
get(name) {
|
|
79
|
-
return parsed.find((cookie) => cookie.name === name);
|
|
80
|
-
},
|
|
81
|
-
getAll(name) {
|
|
82
|
-
return name ? parsed.filter((cookie) => cookie.name === name) : [...parsed];
|
|
83
|
-
},
|
|
84
|
-
has(name) {
|
|
85
|
-
return parsed.some((cookie) => cookie.name === name);
|
|
86
|
-
},
|
|
87
|
-
toString() {
|
|
88
|
-
return cookieHeader;
|
|
89
|
-
},
|
|
90
|
-
[Symbol.iterator]() {
|
|
91
|
-
return parsed[Symbol.iterator]();
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
__name(cookies, "cookies");
|
|
96
|
-
function parseCookieHeader(header) {
|
|
97
|
-
if (!header.trim()) return [];
|
|
98
|
-
return header.split(";").map((part) => part.trim()).filter(Boolean).map((part) => {
|
|
99
|
-
const separatorIndex = part.indexOf("=");
|
|
100
|
-
if (separatorIndex === -1) {
|
|
101
|
-
return {
|
|
102
|
-
name: decodeCookiePart(part),
|
|
103
|
-
value: ""
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
name: decodeCookiePart(part.slice(0, separatorIndex).trim()),
|
|
108
|
-
value: decodeCookiePart(part.slice(separatorIndex + 1).trim())
|
|
109
|
-
};
|
|
110
|
-
}).filter((cookie) => cookie.name.length > 0);
|
|
111
|
-
}
|
|
112
|
-
__name(parseCookieHeader, "parseCookieHeader");
|
|
113
|
-
function decodeCookiePart(value) {
|
|
114
|
-
try {
|
|
115
|
-
return decodeURIComponent(value);
|
|
116
|
-
} catch {
|
|
117
|
-
return value;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
__name(decodeCookiePart, "decodeCookiePart");
|
|
121
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
-
0 && (module.exports = {
|
|
123
|
-
cookies,
|
|
124
|
-
headers
|
|
125
|
-
});
|
|
126
|
-
//# sourceMappingURL=headers.cjs.map
|
package/dist/headers.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/headers.ts","../src/server/request.ts","../src/server/request-bridge.ts"],"sourcesContent":["import { getCurrentRequest } from \"./server/request\";\n\nexport interface RequestCookie {\n name: string;\n value: string;\n}\n\nexport interface ReadonlyHeaders extends Iterable<[string, string]> {\n get(name: string): string | null;\n has(name: string): boolean;\n forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;\n entries(): IterableIterator<[string, string]>;\n keys(): IterableIterator<string>;\n values(): IterableIterator<string>;\n}\n\nexport interface ReadonlyRequestCookies extends Iterable<RequestCookie> {\n get(name: string): RequestCookie | undefined;\n getAll(name?: string): RequestCookie[];\n has(name: string): boolean;\n toString(): string;\n}\n\nexport function headers(): ReadonlyHeaders {\n return new Headers(getCurrentRequest().headers) as ReadonlyHeaders;\n}\n\nexport function cookies(): ReadonlyRequestCookies {\n const cookieHeader = getCurrentRequest().headers.get(\"cookie\") || \"\";\n const parsed = parseCookieHeader(cookieHeader);\n\n return {\n get(name) {\n return parsed.find((cookie) => cookie.name === name);\n },\n getAll(name) {\n return name ? parsed.filter((cookie) => cookie.name === name) : [...parsed];\n },\n has(name) {\n return parsed.some((cookie) => cookie.name === name);\n },\n toString() {\n return cookieHeader;\n },\n [Symbol.iterator]() {\n return parsed[Symbol.iterator]();\n },\n };\n}\n\nfunction parseCookieHeader(header: string): RequestCookie[] {\n if (!header.trim()) return [];\n\n return header\n .split(\";\")\n .map((part) => part.trim())\n .filter(Boolean)\n .map((part) => {\n const separatorIndex = part.indexOf(\"=\");\n if (separatorIndex === -1) {\n return {\n name: decodeCookiePart(part),\n value: \"\",\n };\n }\n\n return {\n name: decodeCookiePart(part.slice(0, separatorIndex).trim()),\n value: decodeCookiePart(part.slice(separatorIndex + 1).trim()),\n };\n })\n .filter((cookie) => cookie.name.length > 0);\n}\n\nfunction decodeCookiePart(value: string) {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n}\n","import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type { FarmRequest } from \"../types\";\nimport { _setCurrentRequestResolver } from \"./request-bridge\";\n\nconst REQUEST_STORAGE_KEY = Symbol.for(\"@farm.js/core/request-storage\");\n\nfunction getRequestStore(): AsyncLocalStorage<Request> {\n const runtime = globalThis as typeof globalThis & Record<PropertyKey, unknown>;\n const existing = runtime[REQUEST_STORAGE_KEY];\n if (existing instanceof AsyncLocalStorage) {\n return existing as AsyncLocalStorage<Request>;\n }\n\n const storage = new AsyncLocalStorage<Request>();\n runtime[REQUEST_STORAGE_KEY] = storage;\n return storage;\n}\n\nconst requestStore = getRequestStore();\n\n_setCurrentRequestResolver(() => requestStore.getStore());\n\nexport function createWebRequestFromFarmRequest(req: FarmRequest): Request {\n const forwardedHost = req.headers[\"x-forwarded-host\"];\n const host = Array.isArray(forwardedHost)\n ? forwardedHost[0]\n : forwardedHost || req.headers.host || \"localhost\";\n const forwardedProto = req.headers[\"x-forwarded-proto\"];\n const proto = Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto || \"http\";\n const fullUrl = new URL(req.url || \"/\", `${proto}://${host}`).toString();\n\n const headers = new Headers();\n for (const [key, value] of Object.entries(req.headers)) {\n if (value == null) {\n continue;\n }\n\n if (Array.isArray(value)) {\n for (const item of value) {\n headers.append(key, item);\n }\n continue;\n }\n\n headers.set(key, value);\n }\n\n return new Request(fullUrl, {\n method: req.method,\n headers,\n });\n}\n\nexport async function _runWithCurrentRequest<T>(\n request: Request,\n fn: () => Promise<T> | T,\n): Promise<T> {\n return requestStore.run(request, fn);\n}\n\nexport function getCurrentRequest(): Request {\n const request = requestStore.getStore();\n if (!request) {\n throw new Error(\n \"No current request is available. getCurrentRequest() can only be used during server rendering.\",\n );\n }\n\n return request;\n}\n","type CurrentRequestResolver = () => Request | undefined;\n\nconst CURRENT_REQUEST_RESOLVER_KEY = Symbol.for(\"farm.currentRequestResolver\");\n\ntype GlobalWithCurrentRequestResolver = typeof globalThis & {\n [CURRENT_REQUEST_RESOLVER_KEY]?: CurrentRequestResolver;\n};\n\nfunction getGlobalState(): GlobalWithCurrentRequestResolver {\n return globalThis as GlobalWithCurrentRequestResolver;\n}\n\nexport function _setCurrentRequestResolver(resolver: CurrentRequestResolver | undefined): void {\n getGlobalState()[CURRENT_REQUEST_RESOLVER_KEY] = resolver;\n}\n\nexport function _resolveCurrentRequest(): Request | undefined {\n return getGlobalState()[CURRENT_REQUEST_RESOLVER_KEY]?.();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,8BAAkC;;;ACElC,IAAM,+BAA+B,uBAAO,IAAI,6BAA6B;AAM7E,SAAS,iBAAmD;AAC1D,SAAO;AACT;AAFS;AAIF,SAAS,2BAA2B,UAAoD;AAC7F,iBAAe,EAAE,4BAA4B,IAAI;AACnD;AAFgB;;;ADRhB,IAAM,sBAAsB,uBAAO,IAAI,+BAA+B;AAEtE,SAAS,kBAA8C;AACrD,QAAM,UAAU;AAChB,QAAM,WAAW,QAAQ,mBAAmB;AAC5C,MAAI,oBAAoB,2CAAmB;AACzC,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,IAAI,0CAA2B;AAC/C,UAAQ,mBAAmB,IAAI;AAC/B,SAAO;AACT;AAVS;AAYT,IAAM,eAAe,gBAAgB;AAErC,2BAA2B,MAAM,aAAa,SAAS,CAAC;AAwCjD,SAAS,oBAA6B;AAC3C,QAAM,UAAU,aAAa,SAAS;AACtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AATgB;;;ADrCT,SAAS,UAA2B;AACzC,SAAO,IAAI,QAAQ,kBAAkB,EAAE,OAAO;AAChD;AAFgB;AAIT,SAAS,UAAkC;AAChD,QAAM,eAAe,kBAAkB,EAAE,QAAQ,IAAI,QAAQ,KAAK;AAClE,QAAM,SAAS,kBAAkB,YAAY;AAE7C,SAAO;AAAA,IACL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
|
3
|
-
value: string;
|
|
4
|
-
}
|
|
5
|
-
interface ReadonlyHeaders extends Iterable<[string, string]> {
|
|
6
|
-
get(name: string): string | null;
|
|
7
|
-
has(name: string): boolean;
|
|
8
|
-
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
9
|
-
entries(): IterableIterator<[string, string]>;
|
|
10
|
-
keys(): IterableIterator<string>;
|
|
11
|
-
values(): IterableIterator<string>;
|
|
12
|
-
}
|
|
13
|
-
interface ReadonlyRequestCookies extends Iterable<RequestCookie> {
|
|
14
|
-
get(name: string): RequestCookie | undefined;
|
|
15
|
-
getAll(name?: string): RequestCookie[];
|
|
16
|
-
has(name: string): boolean;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
|
19
|
-
declare function headers(): ReadonlyHeaders;
|
|
20
|
-
declare function cookies(): ReadonlyRequestCookies;
|
|
21
|
-
|
|
22
|
-
export { type ReadonlyHeaders, type ReadonlyRequestCookies, type RequestCookie, cookies, headers };
|
package/dist/headers.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface RequestCookie {
|
|
2
|
-
name: string;
|
|
3
|
-
value: string;
|
|
4
|
-
}
|
|
5
|
-
interface ReadonlyHeaders extends Iterable<[string, string]> {
|
|
6
|
-
get(name: string): string | null;
|
|
7
|
-
has(name: string): boolean;
|
|
8
|
-
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
9
|
-
entries(): IterableIterator<[string, string]>;
|
|
10
|
-
keys(): IterableIterator<string>;
|
|
11
|
-
values(): IterableIterator<string>;
|
|
12
|
-
}
|
|
13
|
-
interface ReadonlyRequestCookies extends Iterable<RequestCookie> {
|
|
14
|
-
get(name: string): RequestCookie | undefined;
|
|
15
|
-
getAll(name?: string): RequestCookie[];
|
|
16
|
-
has(name: string): boolean;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
|
19
|
-
declare function headers(): ReadonlyHeaders;
|
|
20
|
-
declare function cookies(): ReadonlyRequestCookies;
|
|
21
|
-
|
|
22
|
-
export { type ReadonlyHeaders, type ReadonlyRequestCookies, type RequestCookie, cookies, headers };
|
package/dist/headers.mjs
DELETED
package/dist/headers.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/i18n/client.d.mts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { d as FarmTranslator, c as FarmI18nLocale, a as FarmI18nClientSnapshot } from '../types-BH1lhg5G.mjs';
|
|
2
|
-
export { e as FarmI18nMessageArgs, f as FarmI18nMessageKey } from '../types-BH1lhg5G.mjs';
|
|
3
|
-
|
|
4
|
-
declare const t: FarmTranslator;
|
|
5
|
-
|
|
6
|
-
interface FarmLocaleState {
|
|
7
|
-
locale: FarmI18nLocale;
|
|
8
|
-
locales: readonly FarmI18nLocale[];
|
|
9
|
-
direction: "ltr" | "rtl";
|
|
10
|
-
setLocale(locale: FarmI18nLocale): void;
|
|
11
|
-
}
|
|
12
|
-
interface FarmListFormatOptions {
|
|
13
|
-
localeMatcher?: "lookup" | "best fit";
|
|
14
|
-
type?: "conjunction" | "disjunction" | "unit";
|
|
15
|
-
style?: "long" | "short" | "narrow";
|
|
16
|
-
}
|
|
17
|
-
declare function useLocale(): FarmLocaleState;
|
|
18
|
-
declare function useTranslations(): FarmTranslator;
|
|
19
|
-
declare function getLocale(): FarmI18nLocale;
|
|
20
|
-
declare function getLocaleSource(): FarmI18nClientSnapshot["source"];
|
|
21
|
-
declare function createTranslator(): FarmTranslator;
|
|
22
|
-
declare function setLocale(locale: FarmI18nLocale): void;
|
|
23
|
-
declare function _setFarmI18nClientSnapshot(snapshot: FarmI18nClientSnapshot): void;
|
|
24
|
-
declare const format: {
|
|
25
|
-
number(value: number, options?: Intl.NumberFormatOptions): string;
|
|
26
|
-
currency(value: number, currency: string, options?: Omit<Intl.NumberFormatOptions, "style" | "currency">): string;
|
|
27
|
-
date(value: Date | number, options?: Intl.DateTimeFormatOptions): string;
|
|
28
|
-
relativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;
|
|
29
|
-
list(values: Iterable<string>, options?: FarmListFormatOptions): string;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { FarmI18nClientSnapshot, FarmI18nLocale, type FarmLocaleState, _setFarmI18nClientSnapshot, createTranslator, format, getLocale, getLocaleSource, setLocale, t, useLocale, useTranslations };
|
package/dist/i18n/client.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { d as FarmTranslator, c as FarmI18nLocale, a as FarmI18nClientSnapshot } from '../types-BH1lhg5G.js';
|
|
2
|
-
export { e as FarmI18nMessageArgs, f as FarmI18nMessageKey } from '../types-BH1lhg5G.js';
|
|
3
|
-
|
|
4
|
-
declare const t: FarmTranslator;
|
|
5
|
-
|
|
6
|
-
interface FarmLocaleState {
|
|
7
|
-
locale: FarmI18nLocale;
|
|
8
|
-
locales: readonly FarmI18nLocale[];
|
|
9
|
-
direction: "ltr" | "rtl";
|
|
10
|
-
setLocale(locale: FarmI18nLocale): void;
|
|
11
|
-
}
|
|
12
|
-
interface FarmListFormatOptions {
|
|
13
|
-
localeMatcher?: "lookup" | "best fit";
|
|
14
|
-
type?: "conjunction" | "disjunction" | "unit";
|
|
15
|
-
style?: "long" | "short" | "narrow";
|
|
16
|
-
}
|
|
17
|
-
declare function useLocale(): FarmLocaleState;
|
|
18
|
-
declare function useTranslations(): FarmTranslator;
|
|
19
|
-
declare function getLocale(): FarmI18nLocale;
|
|
20
|
-
declare function getLocaleSource(): FarmI18nClientSnapshot["source"];
|
|
21
|
-
declare function createTranslator(): FarmTranslator;
|
|
22
|
-
declare function setLocale(locale: FarmI18nLocale): void;
|
|
23
|
-
declare function _setFarmI18nClientSnapshot(snapshot: FarmI18nClientSnapshot): void;
|
|
24
|
-
declare const format: {
|
|
25
|
-
number(value: number, options?: Intl.NumberFormatOptions): string;
|
|
26
|
-
currency(value: number, currency: string, options?: Omit<Intl.NumberFormatOptions, "style" | "currency">): string;
|
|
27
|
-
date(value: Date | number, options?: Intl.DateTimeFormatOptions): string;
|
|
28
|
-
relativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;
|
|
29
|
-
list(values: Iterable<string>, options?: FarmListFormatOptions): string;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { FarmI18nClientSnapshot, FarmI18nLocale, type FarmLocaleState, _setFarmI18nClientSnapshot, createTranslator, format, getLocale, getLocaleSource, setLocale, t, useLocale, useTranslations };
|