@farm.js/core 0.1.0-beta.1 → 0.1.0-beta.11
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/README.md +1 -1
- package/dist/agent-runtime.d.mts +3 -2
- package/dist/agent-runtime.d.ts +3 -2
- package/dist/api/route-manager.cjs +410 -15
- package/dist/api/route-manager.cjs.map +1 -1
- package/dist/api/route-manager.d.mts +7 -5
- package/dist/api/route-manager.d.ts +7 -5
- package/dist/api/route-manager.mjs +9 -8
- package/dist/api/runtime.cjs +748 -9
- package/dist/api/runtime.cjs.map +1 -1
- package/dist/api/runtime.d.mts +3 -16
- package/dist/api/runtime.d.ts +3 -16
- package/dist/api/runtime.mjs +8 -1
- package/dist/api.cjs +1243 -342
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.mts +8 -150
- package/dist/api.d.ts +8 -150
- package/dist/api.mjs +51 -21
- package/dist/{app-BiX4qb-d.d.mts → app-BNE2FoZ4.d.mts} +42 -5
- package/dist/{app-CFRNJXP1.d.ts → app-DRGUmJ3s.d.ts} +42 -5
- package/dist/app-markdown.cjs +32 -8
- package/dist/app-markdown.cjs.map +1 -1
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/app-markdown.mjs +2 -1
- package/dist/cache.cjs +414 -12
- package/dist/cache.cjs.map +1 -1
- package/dist/cache.d.mts +120 -6
- package/dist/cache.d.ts +120 -6
- package/dist/cache.mjs +11 -3
- package/dist/{chunk-QF4PHCMA.mjs → chunk-2ED5Q2GH.mjs} +3 -3
- package/dist/chunk-2ED5Q2GH.mjs.map +1 -0
- package/dist/{chunk-GZP5W4K3.mjs → chunk-32W4QEJP.mjs} +1 -1
- package/dist/chunk-32W4QEJP.mjs.map +1 -0
- package/dist/{chunk-G3B5BRDY.mjs → chunk-4677KXB7.mjs} +646 -86
- package/dist/chunk-4677KXB7.mjs.map +1 -0
- package/dist/{chunk-3QJO55ZF.mjs → chunk-4LND3PXF.mjs} +30 -38
- package/dist/chunk-4LND3PXF.mjs.map +1 -0
- package/dist/chunk-5EVQFRL2.mjs +10 -0
- package/dist/chunk-5EVQFRL2.mjs.map +1 -0
- package/dist/{chunk-25D7G34K.mjs → chunk-65A7QIKI.mjs} +5 -5
- package/dist/{chunk-25D7G34K.mjs.map → chunk-65A7QIKI.mjs.map} +1 -1
- package/dist/{chunk-CHFHNEMO.mjs → chunk-77BOAQHI.mjs} +1972 -188
- package/dist/chunk-77BOAQHI.mjs.map +1 -0
- package/dist/{chunk-LLC7BNXW.mjs → chunk-7FBJLMQH.mjs} +73 -10
- package/dist/chunk-7FBJLMQH.mjs.map +1 -0
- package/dist/{chunk-TRORP7E4.mjs → chunk-7N62DNSO.mjs} +2 -2
- package/dist/chunk-ALCLXXTY.mjs +187 -0
- package/dist/chunk-ALCLXXTY.mjs.map +1 -0
- package/dist/chunk-AW6I64AP.mjs +25 -0
- package/dist/chunk-AW6I64AP.mjs.map +1 -0
- package/dist/{chunk-B6N4ZB2H.mjs → chunk-C2ROET2V.mjs} +3 -3
- package/dist/{chunk-BHG3LVHH.mjs → chunk-CGIXMLSY.mjs} +15 -7
- package/dist/chunk-CGIXMLSY.mjs.map +1 -0
- package/dist/{chunk-C3DLZMBU.mjs → chunk-DJSGLHCN.mjs} +2 -2
- package/dist/{chunk-JN3UU635.mjs → chunk-EJ7T4TPB.mjs} +2 -2
- package/dist/chunk-EJ7T4TPB.mjs.map +1 -0
- package/dist/{chunk-ZJQNATYV.mjs → chunk-FRPWCMMG.mjs} +3 -3
- package/dist/chunk-FRPWCMMG.mjs.map +1 -0
- package/dist/{chunk-QM6VV26B.mjs → chunk-GQVGIUSN.mjs} +3 -3
- package/dist/{chunk-QM6VV26B.mjs.map → chunk-GQVGIUSN.mjs.map} +1 -1
- package/dist/{chunk-UREJA4GZ.mjs → chunk-GXASWWJU.mjs} +1 -1
- package/dist/{chunk-UREJA4GZ.mjs.map → chunk-GXASWWJU.mjs.map} +1 -1
- package/dist/chunk-I4CUBGVF.mjs +93 -0
- package/dist/chunk-I4CUBGVF.mjs.map +1 -0
- package/dist/{chunk-HXP3ZSPC.mjs → chunk-J5YWQVI5.mjs} +4 -4
- package/dist/chunk-J5YWQVI5.mjs.map +1 -0
- package/dist/{chunk-PRNYWD7K.mjs → chunk-JDEOUK5V.mjs} +67 -239
- package/dist/chunk-JDEOUK5V.mjs.map +1 -0
- package/dist/{chunk-UHE2TTLK.mjs → chunk-K5ZTUF22.mjs} +34 -17
- package/dist/chunk-K5ZTUF22.mjs.map +1 -0
- package/dist/{chunk-O3HADRW6.mjs → chunk-MIUW47JX.mjs} +2 -2
- package/dist/{chunk-O3HADRW6.mjs.map → chunk-MIUW47JX.mjs.map} +1 -1
- package/dist/chunk-PFE6GMNE.mjs +603 -0
- package/dist/chunk-PFE6GMNE.mjs.map +1 -0
- package/dist/{chunk-RKI6TN3A.mjs → chunk-QM746KUO.mjs} +9 -2
- package/dist/chunk-QM746KUO.mjs.map +1 -0
- package/dist/{chunk-TU4YJICB.mjs → chunk-QTZZ2ISQ.mjs} +41 -16
- package/dist/chunk-QTZZ2ISQ.mjs.map +1 -0
- package/dist/chunk-RBRLLZL5.mjs +81 -0
- package/dist/chunk-RBRLLZL5.mjs.map +1 -0
- package/dist/{chunk-RSKVYESE.mjs → chunk-RQ633A5I.mjs} +1 -1
- package/dist/chunk-RQ633A5I.mjs.map +1 -0
- package/dist/{chunk-6XDUHOEM.mjs → chunk-TQAEEJB4.mjs} +3 -3
- package/dist/{chunk-AGS7UJ52.mjs → chunk-UB5UOSHB.mjs} +24 -12
- package/dist/chunk-UB5UOSHB.mjs.map +1 -0
- package/dist/{chunk-SXZTEK3V.mjs → chunk-UXUAWNO5.mjs} +2 -2
- package/dist/chunk-V3XURYJO.mjs +756 -0
- package/dist/chunk-V3XURYJO.mjs.map +1 -0
- package/dist/{chunk-JLWMCADZ.mjs → chunk-VY2UYN5R.mjs} +24 -4
- package/dist/chunk-VY2UYN5R.mjs.map +1 -0
- package/dist/{chunk-QFQRHRZS.mjs → chunk-W2CRQFF6.mjs} +151 -23
- package/dist/chunk-W2CRQFF6.mjs.map +1 -0
- package/dist/{chunk-Y7A27276.mjs → chunk-WDU6QXNK.mjs} +349 -15
- package/dist/chunk-WDU6QXNK.mjs.map +1 -0
- package/dist/{chunk-Y2OJJD7R.mjs → chunk-XIVV5IWN.mjs} +7 -9
- package/dist/chunk-XIVV5IWN.mjs.map +1 -0
- package/dist/{chunk-OYXO65LI.mjs → chunk-YW7OBE6Q.mjs} +4 -4
- package/dist/chunk-YW7OBE6Q.mjs.map +1 -0
- package/dist/{chunk-YHU7SS6L.mjs → chunk-Z5CQMP54.mjs} +11 -11
- package/dist/{chunk-S2XHZS7W.mjs → chunk-ZVWA4ZQ3.mjs} +18 -9
- package/dist/chunk-ZVWA4ZQ3.mjs.map +1 -0
- package/dist/{chunk-SOU3Q3ZA.mjs → chunk-ZZ57EH5Z.mjs} +1 -1
- package/dist/chunk-ZZ57EH5Z.mjs.map +1 -0
- package/dist/{client-D_yUjVhe.d.mts → client-BT1mFQas.d.mts} +55 -10
- package/dist/{client-Dkc03WP8.d.ts → client-Nn0q4eO4.d.ts} +55 -10
- package/dist/{client-plugins-BZnpeTGA.d.ts → client-plugins-Bc5jHcNr.d.ts} +85 -6
- package/dist/{client-plugins-g4bzuCmo.d.mts → client-plugins-jsk-ZLzJ.d.mts} +85 -6
- package/dist/client-plugins.d.mts +3 -2
- package/dist/client-plugins.d.ts +3 -2
- package/dist/client.cjs +922 -91
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +124 -6
- package/dist/client.d.ts +124 -6
- package/dist/client.mjs +23 -16
- package/dist/config.d.mts +3 -2
- package/dist/config.d.ts +3 -2
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.mjs +1 -1
- package/dist/{devtools-AE4RVXCM.mjs → devtools-A22KUJZT.mjs} +13 -12
- package/dist/{devtools-AE4RVXCM.mjs.map → devtools-A22KUJZT.mjs.map} +1 -1
- package/dist/{devtools-client-6WPY2AQU.mjs → devtools-client-3XRTBND5.mjs} +2 -11
- package/dist/devtools-client-3XRTBND5.mjs.map +1 -0
- package/dist/docs.cjs +65 -58
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +13 -12
- package/dist/env-types.cjs +14 -5
- package/dist/env-types.cjs.map +1 -1
- package/dist/env-types.d.mts +2 -1
- package/dist/env-types.d.ts +2 -1
- package/dist/env-types.mjs +3 -1
- package/dist/env.cjs.map +1 -1
- package/dist/env.d.mts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/env.mjs +1 -1
- package/dist/font.cjs +47 -0
- package/dist/font.cjs.map +1 -0
- package/dist/font.d.mts +70 -0
- package/dist/font.d.ts +70 -0
- package/dist/font.mjs +10 -0
- package/dist/font.mjs.map +1 -0
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/server.cjs +2 -2
- package/dist/i18n/server.cjs.map +1 -1
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +1 -1
- package/dist/index.cjs +5016 -1108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +23 -19
- package/dist/index.d.ts +23 -19
- package/dist/index.mjs +177 -121
- package/dist/index.mjs.map +1 -1
- package/dist/integrations.d.mts +3 -2
- package/dist/integrations.d.ts +3 -2
- package/dist/internal/build-runtime.cjs +3504 -581
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +32 -29
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/config-runtime.cjs +148 -41
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +4 -3
- package/dist/internal/config-runtime.d.ts +4 -3
- package/dist/internal/config-runtime.mjs +12 -11
- package/dist/internal/production-runtime.cjs +300 -9
- package/dist/internal/production-runtime.cjs.map +1 -1
- package/dist/internal/production-runtime.d.mts +10 -8
- package/dist/internal/production-runtime.d.ts +10 -8
- package/dist/internal/production-runtime.mjs +27 -9
- package/dist/internal/production-runtime.mjs.map +1 -1
- package/dist/markdown.cjs +73 -8
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.mts +19 -2
- package/dist/markdown.d.ts +19 -2
- package/dist/markdown.mjs +5 -1
- package/dist/{metadata-C9NZxMDW.d.mts → metadata-7ffpT3jr.d.mts} +1 -1
- package/dist/{metadata-DAXRaOHx.d.ts → metadata-JHn-8eht.d.ts} +1 -1
- package/dist/middleware.cjs +2 -2
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.mts +5 -4
- package/dist/middleware.d.ts +5 -4
- package/dist/middleware.mjs +3 -3
- package/dist/navigation.cjs +40 -15
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-KME62MWG.mjs → nitro-QO5LV6QK.mjs} +11 -13
- package/dist/{nitro-KME62MWG.mjs.map → nitro-QO5LV6QK.mjs.map} +1 -1
- package/dist/plugin.cjs +2854 -590
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +3 -2
- package/dist/plugin.d.ts +3 -2
- package/dist/plugin.mjs +28 -25
- package/dist/{production-runtime-DRkCHUvJ.d.ts → production-runtime-9KG7GuvW.d.ts} +2 -2
- package/dist/{production-runtime-flrjp_nC.d.mts → production-runtime-B-fweKts.d.mts} +2 -2
- package/dist/{request-BrFBuc8G.d.mts → request-Dsq4kGW0.d.mts} +1 -1
- package/dist/{request-BslSZIRz.d.ts → request-udtobOLv.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{resolver-DlOPpjkB.d.mts → resolver-DJqjLMg_.d.mts} +1 -1
- package/dist/{resolver-C6iecsDV.d.ts → resolver-IH4RmPEl.d.ts} +1 -1
- package/dist/routes.cjs +276 -6
- package/dist/routes.cjs.map +1 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.mjs +4 -4
- package/dist/runtime-9nQjVM7X.d.mts +206 -0
- package/dist/{runtime-DeAAZ6gO.d.mts → runtime-Cxpq6xZN.d.mts} +2 -2
- package/dist/runtime-DgeS2skB.d.ts +206 -0
- package/dist/{runtime-B6GvwDS1.d.ts → runtime-bv63eUiO.d.ts} +2 -2
- package/dist/server-action-security.cjs +28 -10
- package/dist/server-action-security.cjs.map +1 -1
- package/dist/server-action-security.d.mts +2 -1
- package/dist/server-action-security.d.ts +2 -1
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn-client.cjs.map +1 -1
- package/dist/server-fn-client.d.mts +1 -0
- package/dist/server-fn-client.d.ts +1 -0
- package/dist/server-fn-client.mjs +1 -1
- package/dist/server-fn.cjs +785 -3
- package/dist/server-fn.cjs.map +1 -1
- package/dist/server-fn.d.mts +10 -1
- package/dist/server-fn.d.ts +10 -1
- package/dist/server-fn.mjs +6 -3
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-query-client.cjs +279 -8
- package/dist/server-query-client.cjs.map +1 -1
- package/dist/server-query-client.mjs +4 -4
- package/dist/server-query.cjs +381 -10
- package/dist/server-query.cjs.map +1 -1
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +3319 -841
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +12 -11
- package/dist/server.d.ts +12 -11
- package/dist/server.mjs +57 -36
- package/dist/server.mjs.map +1 -1
- package/dist/testing.cjs +436 -25
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.mts +5 -4
- package/dist/testing.d.ts +5 -4
- package/dist/testing.mjs +19 -18
- package/dist/testing.mjs.map +1 -1
- package/dist/transport-BmbGTXA5.d.mts +49 -0
- package/dist/transport-BmbGTXA5.d.ts +49 -0
- package/dist/{types-BH1lhg5G.d.ts → types-BMxWr97v.d.mts} +2 -2
- package/dist/{types-BH1lhg5G.d.mts → types-BMxWr97v.d.ts} +2 -2
- package/dist/{utils-DA1yo54_.d.ts → utils-CA0z0c-2.d.ts} +1 -1
- package/dist/{utils-DOXXivjL.d.mts → utils-mYVkSOt2.d.mts} +1 -1
- package/dist/version.cjs +36 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.mts +3 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.mjs +8 -0
- package/dist/version.mjs.map +1 -0
- package/dist/vite.cjs +2938 -668
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +3 -2
- package/dist/vite.d.ts +3 -2
- package/dist/vite.mjs +26 -23
- package/dist/workflows.cjs +6 -8
- package/dist/workflows.cjs.map +1 -1
- package/dist/workflows.mjs +1 -1
- package/package.json +22 -6
- package/types/api.d.ts +44 -0
- package/types/client.d.ts +221 -17
- package/types/image.d.ts +4 -0
- package/types/images.d.ts +59 -0
- package/dist/chunk-3QJO55ZF.mjs.map +0 -1
- package/dist/chunk-4PTK6KT4.mjs +0 -364
- package/dist/chunk-4PTK6KT4.mjs.map +0 -1
- package/dist/chunk-AGS7UJ52.mjs.map +0 -1
- package/dist/chunk-BHG3LVHH.mjs.map +0 -1
- package/dist/chunk-CHFHNEMO.mjs.map +0 -1
- package/dist/chunk-EVGBEZDF.mjs +0 -215
- package/dist/chunk-EVGBEZDF.mjs.map +0 -1
- package/dist/chunk-G3B5BRDY.mjs.map +0 -1
- package/dist/chunk-GZP5W4K3.mjs.map +0 -1
- package/dist/chunk-HXP3ZSPC.mjs.map +0 -1
- package/dist/chunk-JLWMCADZ.mjs.map +0 -1
- package/dist/chunk-JN3UU635.mjs.map +0 -1
- package/dist/chunk-LLC7BNXW.mjs.map +0 -1
- package/dist/chunk-OYXO65LI.mjs.map +0 -1
- package/dist/chunk-PRNYWD7K.mjs.map +0 -1
- package/dist/chunk-QF4PHCMA.mjs.map +0 -1
- package/dist/chunk-QFQRHRZS.mjs.map +0 -1
- package/dist/chunk-RKI6TN3A.mjs.map +0 -1
- package/dist/chunk-RSKVYESE.mjs.map +0 -1
- package/dist/chunk-S2XHZS7W.mjs.map +0 -1
- package/dist/chunk-SOU3Q3ZA.mjs.map +0 -1
- package/dist/chunk-TU4YJICB.mjs.map +0 -1
- package/dist/chunk-TXCFGOHW.mjs +0 -42
- package/dist/chunk-TXCFGOHW.mjs.map +0 -1
- package/dist/chunk-UHE2TTLK.mjs.map +0 -1
- package/dist/chunk-Y2OJJD7R.mjs.map +0 -1
- package/dist/chunk-Y7A27276.mjs.map +0 -1
- package/dist/chunk-ZJQNATYV.mjs.map +0 -1
- package/dist/devtools-client-6WPY2AQU.mjs.map +0 -1
- /package/dist/{chunk-TRORP7E4.mjs.map → chunk-7N62DNSO.mjs.map} +0 -0
- /package/dist/{chunk-B6N4ZB2H.mjs.map → chunk-C2ROET2V.mjs.map} +0 -0
- /package/dist/{chunk-C3DLZMBU.mjs.map → chunk-DJSGLHCN.mjs.map} +0 -0
- /package/dist/{chunk-6XDUHOEM.mjs.map → chunk-TQAEEJB4.mjs.map} +0 -0
- /package/dist/{chunk-SXZTEK3V.mjs.map → chunk-UXUAWNO5.mjs.map} +0 -0
- /package/dist/{chunk-YHU7SS6L.mjs.map → chunk-Z5CQMP54.mjs.map} +0 -0
|
@@ -778,9 +778,9 @@ var FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = "farm.integration.internalD
|
|
|
778
778
|
var FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME = /* @__PURE__ */ Symbol.for(
|
|
779
779
|
"@farm.js/core/integration-plugin-server-runtime"
|
|
780
780
|
);
|
|
781
|
-
function defineTypedIntegrationRoute(method,
|
|
781
|
+
function defineTypedIntegrationRoute(method, path5, input) {
|
|
782
782
|
return {
|
|
783
|
-
path:
|
|
783
|
+
path: path5,
|
|
784
784
|
method,
|
|
785
785
|
middleware: input.middleware,
|
|
786
786
|
before: input.before,
|
|
@@ -790,7 +790,7 @@ function defineTypedIntegrationRoute(method, path4, input) {
|
|
|
790
790
|
input: normalizeIntegrationRouteInputSchemas(input),
|
|
791
791
|
handler: input.handler,
|
|
792
792
|
__operation: defineIntegrationAPIOperation({
|
|
793
|
-
path:
|
|
793
|
+
path: path5,
|
|
794
794
|
method,
|
|
795
795
|
bodyFormat: input.bodyFormat,
|
|
796
796
|
responseFormat: input.responseFormat,
|
|
@@ -803,52 +803,52 @@ function defineTypedIntegrationRoute(method, path4, input) {
|
|
|
803
803
|
__name(defineTypedIntegrationRoute, "defineTypedIntegrationRoute");
|
|
804
804
|
function createIntegrationRouteFactory() {
|
|
805
805
|
return {
|
|
806
|
-
get(
|
|
806
|
+
get(path5, input) {
|
|
807
807
|
return defineTypedIntegrationRoute(
|
|
808
808
|
"GET",
|
|
809
|
-
|
|
809
|
+
path5,
|
|
810
810
|
input
|
|
811
811
|
);
|
|
812
812
|
},
|
|
813
|
-
post(
|
|
813
|
+
post(path5, input) {
|
|
814
814
|
return defineTypedIntegrationRoute(
|
|
815
815
|
"POST",
|
|
816
|
-
|
|
816
|
+
path5,
|
|
817
817
|
{
|
|
818
818
|
bodyFormat: "json",
|
|
819
819
|
...input
|
|
820
820
|
}
|
|
821
821
|
);
|
|
822
822
|
},
|
|
823
|
-
put(
|
|
823
|
+
put(path5, input) {
|
|
824
824
|
return defineTypedIntegrationRoute(
|
|
825
825
|
"PUT",
|
|
826
|
-
|
|
826
|
+
path5,
|
|
827
827
|
{
|
|
828
828
|
bodyFormat: "json",
|
|
829
829
|
...input
|
|
830
830
|
}
|
|
831
831
|
);
|
|
832
832
|
},
|
|
833
|
-
patch(
|
|
834
|
-
return defineTypedIntegrationRoute("PATCH",
|
|
833
|
+
patch(path5, input) {
|
|
834
|
+
return defineTypedIntegrationRoute("PATCH", path5, {
|
|
835
835
|
bodyFormat: "json",
|
|
836
836
|
...input
|
|
837
837
|
});
|
|
838
838
|
},
|
|
839
|
-
delete(
|
|
840
|
-
return defineTypedIntegrationRoute("DELETE",
|
|
839
|
+
delete(path5, input) {
|
|
840
|
+
return defineTypedIntegrationRoute("DELETE", path5, {
|
|
841
841
|
bodyFormat: "json",
|
|
842
842
|
...input
|
|
843
843
|
});
|
|
844
844
|
},
|
|
845
|
-
options(
|
|
846
|
-
return defineTypedIntegrationRoute("OPTIONS",
|
|
845
|
+
options(path5, input) {
|
|
846
|
+
return defineTypedIntegrationRoute("OPTIONS", path5, input);
|
|
847
847
|
},
|
|
848
|
-
head(
|
|
848
|
+
head(path5, input) {
|
|
849
849
|
return defineTypedIntegrationRoute(
|
|
850
850
|
"HEAD",
|
|
851
|
-
|
|
851
|
+
path5,
|
|
852
852
|
input
|
|
853
853
|
);
|
|
854
854
|
}
|
|
@@ -971,8 +971,8 @@ __name(parseIntegrationConfigSchema, "parseIntegrationConfigSchema");
|
|
|
971
971
|
function createIntegrationConfigValidationError(integration, error) {
|
|
972
972
|
const issues = Array.isArray(error.issues) && error.issues.length > 0 ? error.issues.map((issue) => {
|
|
973
973
|
const normalizedPath = normalizeIntegrationValidationPath(issue.path);
|
|
974
|
-
const
|
|
975
|
-
return `${
|
|
974
|
+
const path5 = normalizedPath.length ? `${normalizedPath.join(".")}: ` : "";
|
|
975
|
+
return `${path5}${issue.message || "Invalid config"}`;
|
|
976
976
|
}).join("; ") : error.message || "Invalid config";
|
|
977
977
|
return new Error(`Integration "${integration.type}" config validation failed: ${issues}`);
|
|
978
978
|
}
|
|
@@ -1679,8 +1679,8 @@ function normalizeIntegrationValidationIssues(source, error) {
|
|
|
1679
1679
|
];
|
|
1680
1680
|
}
|
|
1681
1681
|
__name(normalizeIntegrationValidationIssues, "normalizeIntegrationValidationIssues");
|
|
1682
|
-
function normalizeIntegrationValidationPath(
|
|
1683
|
-
return (
|
|
1682
|
+
function normalizeIntegrationValidationPath(path5) {
|
|
1683
|
+
return (path5 || []).map((segment) => {
|
|
1684
1684
|
const key = typeof segment === "object" && segment !== null && "key" in segment ? segment.key : segment;
|
|
1685
1685
|
return typeof key === "symbol" ? key.description || key.toString() : key;
|
|
1686
1686
|
});
|
|
@@ -2378,7 +2378,7 @@ __name(normalizeMatcher, "normalizeMatcher");
|
|
|
2378
2378
|
|
|
2379
2379
|
// src/markdown.ts
|
|
2380
2380
|
function resolveMarkdownConfig(config) {
|
|
2381
|
-
if (config === false
|
|
2381
|
+
if (config === false) {
|
|
2382
2382
|
return {
|
|
2383
2383
|
enabled: false,
|
|
2384
2384
|
expose: [],
|
|
@@ -2386,7 +2386,7 @@ function resolveMarkdownConfig(config) {
|
|
|
2386
2386
|
includeMetadata: true
|
|
2387
2387
|
};
|
|
2388
2388
|
}
|
|
2389
|
-
if (config === true) {
|
|
2389
|
+
if (config === true || config === void 0) {
|
|
2390
2390
|
return {
|
|
2391
2391
|
enabled: true,
|
|
2392
2392
|
expose: true,
|
|
@@ -2394,7 +2394,7 @@ function resolveMarkdownConfig(config) {
|
|
|
2394
2394
|
includeMetadata: true
|
|
2395
2395
|
};
|
|
2396
2396
|
}
|
|
2397
|
-
const exposeInput = config.expose ?? config.routes ??
|
|
2397
|
+
const exposeInput = config.expose ?? config.routes ?? true;
|
|
2398
2398
|
const expose = exposeInput === true ? true : Array.isArray(exposeInput) ? exposeInput.map(normalizeMarkdownRouteInput) : [];
|
|
2399
2399
|
return {
|
|
2400
2400
|
enabled: config.enabled !== false && (expose === true || expose.length > 0),
|
|
@@ -2417,7 +2417,7 @@ function normalizeMarkdownRouteInput(input) {
|
|
|
2417
2417
|
}
|
|
2418
2418
|
__name(normalizeMarkdownRouteInput, "normalizeMarkdownRouteInput");
|
|
2419
2419
|
function normalizeMarkdownRoute(route) {
|
|
2420
|
-
const withoutMarkdownExtension = route.endsWith(".md") ? route.slice(0, -3) : route;
|
|
2420
|
+
const withoutMarkdownExtension = route.toLowerCase().endsWith(".md") ? route.slice(0, -3) : route;
|
|
2421
2421
|
const withSlash = withoutMarkdownExtension.startsWith("/") ? withoutMarkdownExtension : `/${withoutMarkdownExtension}`;
|
|
2422
2422
|
const normalized = withSlash.replace(/\/+/g, "/").replace(/\/$/g, "");
|
|
2423
2423
|
return normalized === "" || normalized === "/index" ? "/" : normalized;
|
|
@@ -2507,7 +2507,7 @@ function normalizeCronJob(name, job) {
|
|
|
2507
2507
|
if (!job || typeof job !== "object" || Array.isArray(job)) {
|
|
2508
2508
|
throw new TypeError(`Farm cron ${JSON.stringify(name)} must be a configuration object.`);
|
|
2509
2509
|
}
|
|
2510
|
-
const
|
|
2510
|
+
const path5 = normalizeCronPath(name, job.path);
|
|
2511
2511
|
const rawSchedule = Array.isArray(job.schedule) ? job.schedule : [job.schedule];
|
|
2512
2512
|
const schedule = [...new Set(rawSchedule.map((value) => normalizeCronExpression(name, value)))];
|
|
2513
2513
|
if (schedule.length === 0) {
|
|
@@ -2516,7 +2516,7 @@ function normalizeCronJob(name, job) {
|
|
|
2516
2516
|
return {
|
|
2517
2517
|
name,
|
|
2518
2518
|
schedule,
|
|
2519
|
-
path:
|
|
2519
|
+
path: path5,
|
|
2520
2520
|
description: job.description?.trim() || void 0
|
|
2521
2521
|
};
|
|
2522
2522
|
}
|
|
@@ -2525,13 +2525,13 @@ function normalizeCronPath(name, value) {
|
|
|
2525
2525
|
if (typeof value !== "string" || !value.trim().startsWith("/")) {
|
|
2526
2526
|
throw new TypeError(`Farm cron ${JSON.stringify(name)} path must start with "/".`);
|
|
2527
2527
|
}
|
|
2528
|
-
const
|
|
2529
|
-
if (
|
|
2528
|
+
const path5 = value.trim();
|
|
2529
|
+
if (path5.startsWith("//") || path5.includes("?") || path5.includes("#")) {
|
|
2530
2530
|
throw new TypeError(
|
|
2531
2531
|
`Farm cron ${JSON.stringify(name)} path must be an application pathname without a host, query, or hash.`
|
|
2532
2532
|
);
|
|
2533
2533
|
}
|
|
2534
|
-
return
|
|
2534
|
+
return path5.length > 1 ? path5.replace(/\/+$/, "") : path5;
|
|
2535
2535
|
}
|
|
2536
2536
|
__name(normalizeCronPath, "normalizeCronPath");
|
|
2537
2537
|
function normalizeCronExpression(name, value) {
|
|
@@ -2831,7 +2831,7 @@ function routeRulesToHeaders(routeRules) {
|
|
|
2831
2831
|
for (const [source, rule] of Object.entries(routeRules)) {
|
|
2832
2832
|
const headers = {
|
|
2833
2833
|
...normalizeCorsHeaders(rule.cors),
|
|
2834
|
-
...rule.headers
|
|
2834
|
+
...rule.headers
|
|
2835
2835
|
};
|
|
2836
2836
|
const entries = Object.entries(headers);
|
|
2837
2837
|
if (entries.length === 0) continue;
|
|
@@ -2879,7 +2879,8 @@ var FARM_CACHE_INVALIDATION_STATE = /* @__PURE__ */ Symbol.for("farm.cacheInvali
|
|
|
2879
2879
|
var globalState = globalThis;
|
|
2880
2880
|
function getFarmCacheInvalidationState() {
|
|
2881
2881
|
return globalState[FARM_CACHE_INVALIDATION_STATE] ?? (globalState[FARM_CACHE_INVALIDATION_STATE] = {
|
|
2882
|
-
listeners: /* @__PURE__ */ new Set()
|
|
2882
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
2883
|
+
taskListeners: /* @__PURE__ */ new Set()
|
|
2883
2884
|
});
|
|
2884
2885
|
}
|
|
2885
2886
|
__name(getFarmCacheInvalidationState, "getFarmCacheInvalidationState");
|
|
@@ -2889,6 +2890,12 @@ function subscribeFarmCacheInvalidation(listener) {
|
|
|
2889
2890
|
return () => state.listeners.delete(listener);
|
|
2890
2891
|
}
|
|
2891
2892
|
__name(subscribeFarmCacheInvalidation, "subscribeFarmCacheInvalidation");
|
|
2893
|
+
function subscribeFarmCacheTask(listener) {
|
|
2894
|
+
const state = getFarmCacheInvalidationState();
|
|
2895
|
+
state.taskListeners.add(listener);
|
|
2896
|
+
return () => state.taskListeners.delete(listener);
|
|
2897
|
+
}
|
|
2898
|
+
__name(subscribeFarmCacheTask, "subscribeFarmCacheTask");
|
|
2892
2899
|
|
|
2893
2900
|
// src/server-action-security.ts
|
|
2894
2901
|
var DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT = 1e6;
|
|
@@ -2911,6 +2918,9 @@ __name(getServerActionExecutionContext, "getServerActionExecutionContext");
|
|
|
2911
2918
|
subscribeFarmCacheInvalidation((key) => {
|
|
2912
2919
|
getServerActionExecutionContext()?.invalidations.add(key);
|
|
2913
2920
|
});
|
|
2921
|
+
subscribeFarmCacheTask((task) => {
|
|
2922
|
+
getServerActionExecutionContext()?.cacheTasks.add(task);
|
|
2923
|
+
});
|
|
2914
2924
|
function getServerActionStorage() {
|
|
2915
2925
|
const globalState2 = globalThis;
|
|
2916
2926
|
if (!globalState2[SERVER_ACTION_STORAGE_KEY]) {
|
|
@@ -3457,7 +3467,7 @@ var SIZE_UNITS = {
|
|
|
3457
3467
|
gib: 1073741824
|
|
3458
3468
|
};
|
|
3459
3469
|
function resolveFarmImageConfig(config) {
|
|
3460
|
-
const
|
|
3470
|
+
const path5 = normalizeImagePath(config?.path ?? DEFAULT_FARM_IMAGE_PATH);
|
|
3461
3471
|
const deviceSizes = normalizeIntegerList(
|
|
3462
3472
|
config?.deviceSizes ?? DEFAULT_FARM_IMAGE_DEVICE_SIZES,
|
|
3463
3473
|
"images.deviceSizes"
|
|
@@ -3485,7 +3495,7 @@ function resolveFarmImageConfig(config) {
|
|
|
3485
3495
|
);
|
|
3486
3496
|
return Object.freeze({
|
|
3487
3497
|
provider: config?.provider ?? "auto",
|
|
3488
|
-
path:
|
|
3498
|
+
path: path5,
|
|
3489
3499
|
domains: Object.freeze([
|
|
3490
3500
|
...new Set(
|
|
3491
3501
|
(config?.domains ?? []).map((domain) => domain.trim().toLowerCase()).filter(Boolean)
|
|
@@ -3515,11 +3525,11 @@ function resolveFarmImageConfig(config) {
|
|
|
3515
3525
|
}
|
|
3516
3526
|
__name(resolveFarmImageConfig, "resolveFarmImageConfig");
|
|
3517
3527
|
function normalizeImagePath(value) {
|
|
3518
|
-
const
|
|
3519
|
-
if (!
|
|
3528
|
+
const path5 = value.trim().replace(/\/+$/, "") || "/";
|
|
3529
|
+
if (!path5.startsWith("/") || path5.includes("?") || path5.includes("#")) {
|
|
3520
3530
|
throw new TypeError("images.path must be an absolute pathname without a query or hash");
|
|
3521
3531
|
}
|
|
3522
|
-
return
|
|
3532
|
+
return path5;
|
|
3523
3533
|
}
|
|
3524
3534
|
__name(normalizeImagePath, "normalizeImagePath");
|
|
3525
3535
|
function normalizeIntegerList(values, name, max) {
|
|
@@ -3702,6 +3712,90 @@ function normalizePositiveInteger(value, fallback, name) {
|
|
|
3702
3712
|
}
|
|
3703
3713
|
__name(normalizePositiveInteger, "normalizePositiveInteger");
|
|
3704
3714
|
|
|
3715
|
+
// src/auth-config.ts
|
|
3716
|
+
var import_node_module2 = require("module");
|
|
3717
|
+
var import_node_path3 = __toESM(require("path"));
|
|
3718
|
+
var import_node_url2 = require("url");
|
|
3719
|
+
function resolveFarmAuthConfig(input) {
|
|
3720
|
+
const config = input === true ? {} : input && typeof input === "object" ? input : {};
|
|
3721
|
+
const passwordConfig = typeof config.emailAndPassword === "object" ? config.emailAndPassword : {};
|
|
3722
|
+
const resolved = {
|
|
3723
|
+
enabled: input !== void 0 && input !== false && config.enabled !== false,
|
|
3724
|
+
appName: config.appName,
|
|
3725
|
+
basePath: normalizeBasePath(config.basePath),
|
|
3726
|
+
emailAndPassword: {
|
|
3727
|
+
enabled: config.emailAndPassword !== false,
|
|
3728
|
+
requireEmailVerification: passwordConfig.requireEmailVerification ?? false,
|
|
3729
|
+
minPasswordLength: passwordConfig.minPasswordLength ?? 8,
|
|
3730
|
+
maxPasswordLength: passwordConfig.maxPasswordLength ?? 128
|
|
3731
|
+
},
|
|
3732
|
+
session: {
|
|
3733
|
+
expiresIn: config.session?.expiresIn ?? 60 * 60 * 24 * 7,
|
|
3734
|
+
updateAge: config.session?.updateAge ?? 60 * 60 * 24
|
|
3735
|
+
},
|
|
3736
|
+
database: {
|
|
3737
|
+
url: config.database?.url,
|
|
3738
|
+
path: config.database?.path || ".farm/auth.sqlite",
|
|
3739
|
+
migrateInDevelopment: config.database?.migrateInDevelopment ?? true
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3742
|
+
validateFarmAuthConfig(resolved);
|
|
3743
|
+
return resolved;
|
|
3744
|
+
}
|
|
3745
|
+
__name(resolveFarmAuthConfig, "resolveFarmAuthConfig");
|
|
3746
|
+
async function resolveFarmAuthIntegration(config, options) {
|
|
3747
|
+
if (!config.enabled) return void 0;
|
|
3748
|
+
const root = import_node_path3.default.resolve(options.root);
|
|
3749
|
+
let modulePath;
|
|
3750
|
+
try {
|
|
3751
|
+
const resolveFromApp = (0, import_node_module2.createRequire)(import_node_path3.default.join(root, "package.json"));
|
|
3752
|
+
modulePath = resolveFromApp.resolve("@farm.js/auth/internal");
|
|
3753
|
+
} catch {
|
|
3754
|
+
throw new Error(
|
|
3755
|
+
"The `auth` config requires @farm.js/auth. Install it with `pnpm add @farm.js/auth` and try again."
|
|
3756
|
+
);
|
|
3757
|
+
}
|
|
3758
|
+
const runtime = await import(
|
|
3759
|
+
/* @vite-ignore */
|
|
3760
|
+
(0, import_node_url2.pathToFileURL)(modulePath).href
|
|
3761
|
+
);
|
|
3762
|
+
if (typeof runtime.createFarmAuthIntegration !== "function") {
|
|
3763
|
+
throw new Error(
|
|
3764
|
+
"The installed @farm.js/auth package is incompatible with this version of @farm.js/core."
|
|
3765
|
+
);
|
|
3766
|
+
}
|
|
3767
|
+
return runtime.createFarmAuthIntegration(config, {
|
|
3768
|
+
...options,
|
|
3769
|
+
root
|
|
3770
|
+
});
|
|
3771
|
+
}
|
|
3772
|
+
__name(resolveFarmAuthIntegration, "resolveFarmAuthIntegration");
|
|
3773
|
+
function normalizeBasePath(value) {
|
|
3774
|
+
const route = (value || "/api/auth").trim();
|
|
3775
|
+
const withLeadingSlash = route.startsWith("/") ? route : `/${route}`;
|
|
3776
|
+
const normalized = withLeadingSlash.replace(/\/+/g, "/").replace(/\/+$/, "");
|
|
3777
|
+
return normalized || "/api/auth";
|
|
3778
|
+
}
|
|
3779
|
+
__name(normalizeBasePath, "normalizeBasePath");
|
|
3780
|
+
function validateFarmAuthConfig(config) {
|
|
3781
|
+
const { minPasswordLength, maxPasswordLength } = config.emailAndPassword;
|
|
3782
|
+
if (!Number.isInteger(minPasswordLength) || minPasswordLength < 1) {
|
|
3783
|
+
throw new Error("auth.emailAndPassword.minPasswordLength must be a positive integer.");
|
|
3784
|
+
}
|
|
3785
|
+
if (!Number.isInteger(maxPasswordLength) || maxPasswordLength < minPasswordLength) {
|
|
3786
|
+
throw new Error(
|
|
3787
|
+
"auth.emailAndPassword.maxPasswordLength must be an integer greater than or equal to minPasswordLength."
|
|
3788
|
+
);
|
|
3789
|
+
}
|
|
3790
|
+
if (!Number.isInteger(config.session.expiresIn) || config.session.expiresIn < 1) {
|
|
3791
|
+
throw new Error("auth.session.expiresIn must be a positive integer.");
|
|
3792
|
+
}
|
|
3793
|
+
if (!Number.isInteger(config.session.updateAge) || config.session.updateAge < 0) {
|
|
3794
|
+
throw new Error("auth.session.updateAge must be a non-negative integer.");
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
__name(validateFarmAuthConfig, "validateFarmAuthConfig");
|
|
3798
|
+
|
|
3705
3799
|
// src/config.ts
|
|
3706
3800
|
var FARM_RESOLVED_CUSTOM_CONTEXT = /* @__PURE__ */ Symbol.for("farm.resolvedCustomContext");
|
|
3707
3801
|
function normalizeDeployTarget(target) {
|
|
@@ -3853,7 +3947,7 @@ async function findDocsConfigPath(rootDir, configPath) {
|
|
|
3853
3947
|
__name(findDocsConfigPath, "findDocsConfigPath");
|
|
3854
3948
|
async function loadDocsConfig(rootDir, configPath) {
|
|
3855
3949
|
const fs = await import("fs/promises");
|
|
3856
|
-
const { pathToFileURL:
|
|
3950
|
+
const { pathToFileURL: pathToFileURL3 } = await import("url");
|
|
3857
3951
|
const root = import_path.default.resolve(rootDir || process.cwd());
|
|
3858
3952
|
const resolvedPath = await findDocsConfigPath(root, configPath);
|
|
3859
3953
|
if (!resolvedPath) return void 0;
|
|
@@ -3882,7 +3976,7 @@ async function loadDocsConfig(rootDir, configPath) {
|
|
|
3882
3976
|
logLevel: "silent",
|
|
3883
3977
|
sourcemap: "inline"
|
|
3884
3978
|
});
|
|
3885
|
-
const moduleUrl =
|
|
3979
|
+
const moduleUrl = pathToFileURL3(modulePath).href + `?t=${Date.now()}`;
|
|
3886
3980
|
let importedConfig;
|
|
3887
3981
|
try {
|
|
3888
3982
|
importedConfig = await import(
|
|
@@ -3985,6 +4079,17 @@ async function resolveConfig(userConfig, mode) {
|
|
|
3985
4079
|
const mdx = resolveMdxConfig(userConfig.mdx);
|
|
3986
4080
|
const env2 = resolveEnv(userConfig.env, process.env);
|
|
3987
4081
|
setEnv(env2);
|
|
4082
|
+
const auth = resolveFarmAuthConfig(userConfig.auth);
|
|
4083
|
+
if (auth.enabled && userConfig.integrations?.auth) {
|
|
4084
|
+
throw new Error(
|
|
4085
|
+
"Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
4088
|
+
const nativeAuthIntegration = await resolveFarmAuthIntegration(auth, {
|
|
4089
|
+
root,
|
|
4090
|
+
mode
|
|
4091
|
+
});
|
|
4092
|
+
const integrations = nativeAuthIntegration ? { ...userConfig.integrations, auth: nativeAuthIntegration } : userConfig.integrations || {};
|
|
3988
4093
|
const generateBuildId = userConfig.generateBuildId || (() => `build-${Date.now()}`);
|
|
3989
4094
|
const deploymentId = normalizeFarmDeploymentId(
|
|
3990
4095
|
userConfig.deploymentId || process.env.FARM_DEPLOYMENT_ID || process.env.VERCEL_GIT_COMMIT_SHA || process.env.CF_PAGES_COMMIT_SHA || (mode === "production" ? await generateBuildId() : "development")
|
|
@@ -4008,14 +4113,16 @@ async function resolveConfig(userConfig, mode) {
|
|
|
4008
4113
|
observability: userConfig.observability ?? false,
|
|
4009
4114
|
devtools: resolveFarmDevtoolsConfig(userConfig.devtools, mode),
|
|
4010
4115
|
storage: userConfig.storage || {},
|
|
4116
|
+
cache: userConfig.cache || {},
|
|
4117
|
+
auth,
|
|
4011
4118
|
suppressLintOnLink: userConfig.suppressLintOnLink ?? false,
|
|
4012
4119
|
experimental: {
|
|
4013
4120
|
serverComponents: false,
|
|
4014
4121
|
serverActions: false,
|
|
4015
4122
|
...userConfig.experimental
|
|
4016
4123
|
},
|
|
4017
|
-
plugins: [...resolveIntegrationPlugins(
|
|
4018
|
-
integrations
|
|
4124
|
+
plugins: [...resolveIntegrationPlugins(integrations), ...userConfig.plugins || []],
|
|
4125
|
+
integrations,
|
|
4019
4126
|
trailingSlash: userConfig.trailingSlash ?? false,
|
|
4020
4127
|
redirects: /* @__PURE__ */ __name(() => [...redirects, ...routeRuleRedirects], "redirects"),
|
|
4021
4128
|
rewrites: /* @__PURE__ */ __name(() => rewrites, "rewrites"),
|