@farm.js/core 0.1.0-beta.97 → 0.1.0-beta.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/after.cjs.map +1 -0
- package/dist/agent-runtime.cjs +7 -3
- package/dist/agent-runtime.cjs.map +1 -0
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +2 -1
- package/dist/agent-runtime.mjs.map +1 -1
- package/dist/api/route-manager.cjs.map +1 -0
- package/dist/api/route-manager.d.mts +2 -2
- package/dist/api/route-manager.d.ts +2 -2
- package/dist/api/runtime.cjs.map +1 -0
- package/dist/api.cjs +26 -1
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +2 -2
- package/dist/{app-CIOx3LvY.d.ts → app-CJKz2mbi.d.ts} +4 -4
- package/dist/{app-DBd6437H.d.mts → app-DMEGFLR2.d.mts} +4 -4
- package/dist/app-markdown.cjs.map +1 -0
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/cache.cjs.map +1 -0
- package/dist/{chunk-WD2EBM3I.mjs → chunk-3CQJV3NC.mjs} +2 -2
- package/dist/{chunk-I3OOUWO5.mjs → chunk-3GDRV7SG.mjs} +2 -2
- package/dist/{chunk-X4SFHKFH.mjs → chunk-6KJY25DQ.mjs} +5 -5
- package/dist/{chunk-FP5Q67FO.mjs → chunk-AAEZP2EY.mjs} +9 -9
- package/dist/{chunk-WMJGA32P.mjs → chunk-BXVOHG6B.mjs} +27 -2
- package/dist/{chunk-WMJGA32P.mjs.map → chunk-BXVOHG6B.mjs.map} +1 -1
- package/dist/{chunk-BZAIS65C.mjs → chunk-DIHNOVZZ.mjs} +40 -13
- package/dist/chunk-DIHNOVZZ.mjs.map +1 -0
- package/dist/{chunk-ISSFLGJ5.mjs → chunk-FDWECN3W.mjs} +8 -4
- package/dist/chunk-FDWECN3W.mjs.map +1 -0
- package/dist/chunk-FDWXXTWR.mjs +114 -0
- package/dist/chunk-FDWXXTWR.mjs.map +1 -0
- package/dist/{chunk-J3MPQ4MQ.mjs → chunk-IHADQ6J7.mjs} +2 -2
- package/dist/{chunk-J3MPQ4MQ.mjs.map → chunk-IHADQ6J7.mjs.map} +1 -1
- package/dist/{chunk-FSIXEIOB.mjs → chunk-L7FSTPGS.mjs} +2 -2
- package/dist/{chunk-AAC66ILR.mjs → chunk-LXXG3K2Y.mjs} +61 -2
- package/dist/chunk-LXXG3K2Y.mjs.map +1 -0
- package/dist/{chunk-GJ7W6LNK.mjs → chunk-N5RK4LK6.mjs} +3 -3
- package/dist/{chunk-WKDAA6V2.mjs → chunk-NBF56FXB.mjs} +20 -5
- package/dist/chunk-NBF56FXB.mjs.map +1 -0
- package/dist/chunk-RKUPOYQV.mjs +28 -0
- package/dist/chunk-RKUPOYQV.mjs.map +1 -0
- package/dist/{chunk-2SKCXYLB.mjs → chunk-RL3THP3L.mjs} +54 -5
- package/dist/chunk-RL3THP3L.mjs.map +1 -0
- package/dist/{chunk-52BR7LTX.mjs → chunk-STSPSJUI.mjs} +3 -3
- package/dist/{chunk-EPDIF432.mjs → chunk-UOGX6UNO.mjs} +37 -17
- package/dist/chunk-UOGX6UNO.mjs.map +1 -0
- package/dist/{chunk-YIBV77KZ.mjs → chunk-URQELPSH.mjs} +2 -2
- package/dist/{chunk-UMUWR5XA.mjs → chunk-UWQ4EEW7.mjs} +2 -2
- package/dist/{chunk-IZBX2TEU.mjs → chunk-VQG3QWWK.mjs} +2 -2
- package/dist/{chunk-D7F7YZ7L.mjs → chunk-WA77FWAO.mjs} +8 -8
- package/dist/{chunk-35NPLKQJ.mjs → chunk-XWM2C267.mjs} +21 -105
- package/dist/chunk-XWM2C267.mjs.map +1 -0
- package/dist/client/lifecycle.cjs.map +1 -0
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/{client-plugins-B6-07YmP.d.mts → client-plugins-CyTLPqjP.d.mts} +38 -2
- package/dist/{client-plugins-By6MVUX-.d.ts → client-plugins-D-UgzngJ.d.ts} +38 -2
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -0
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +61 -16
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/cron.cjs +48 -12
- package/dist/cron.cjs.map +1 -0
- package/dist/cron.mjs +2 -1
- package/dist/deferred.cjs.map +1 -0
- package/dist/deployment.cjs.map +1 -0
- package/dist/{devtools-XWZX6CCL.mjs → devtools-KQ2PXSIC.mjs} +8 -6
- package/dist/{devtools-XWZX6CCL.mjs.map → devtools-KQ2PXSIC.mjs.map} +1 -1
- package/dist/docs.cjs +7 -3
- package/dist/docs.cjs.map +1 -0
- package/dist/docs.mjs +8 -6
- package/dist/env-types.cjs.map +1 -0
- package/dist/env.cjs.map +1 -0
- package/dist/environment/vite.cjs.map +1 -0
- package/dist/environment.cjs.map +1 -0
- package/dist/font.cjs.map +1 -0
- package/dist/headers.cjs.map +1 -0
- package/dist/i18n/client.cjs.map +1 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/server.cjs.map +1 -0
- package/dist/image/server.cjs +19 -4
- package/dist/image/server.cjs.map +1 -0
- package/dist/image/server.d.mts +6 -0
- package/dist/image/server.d.ts +6 -0
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +1 -0
- package/dist/image/sharp.cjs.map +1 -0
- package/dist/image/sharp.mjs +1 -1
- package/dist/image.cjs.map +1 -0
- package/dist/index.cjs +370 -143
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.mjs +29 -21
- package/dist/index.mjs.map +1 -1
- package/dist/instrumentation.cjs.map +1 -0
- package/dist/{integration-orm-LLW6WZNK.mjs → integration-orm-G5BPBT5X.mjs} +3 -3
- package/dist/integrations.cjs +168 -5
- package/dist/integrations.cjs.map +1 -0
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +10 -3
- package/dist/internal/build-runtime.cjs +178 -51
- package/dist/internal/build-runtime.cjs.map +1 -0
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +13 -11
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.cjs.map +1 -0
- package/dist/internal/client-runtime.mjs +2 -2
- package/dist/internal/config-runtime.cjs +48 -42
- package/dist/internal/config-runtime.cjs.map +1 -0
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +7 -5
- package/dist/internal/isolated-boundary.cjs.map +1 -0
- package/dist/internal/metadata-image-runtime.cjs.map +1 -0
- package/dist/internal/product-telemetry-runtime.cjs +6 -2
- package/dist/internal/product-telemetry-runtime.cjs.map +1 -0
- package/dist/internal/product-telemetry-runtime.mjs +6 -2
- package/dist/internal/product-telemetry-runtime.mjs.map +1 -1
- package/dist/internal/production-node-env.cjs.map +1 -0
- package/dist/internal/production-runtime.cjs.map +1 -0
- package/dist/internal/production-runtime.d.mts +8 -8
- package/dist/internal/production-runtime.d.ts +8 -8
- package/dist/markdown.cjs.map +1 -0
- package/dist/{metadata-route-8_V3UonT.d.ts → metadata-route-BpU8K9RI.d.ts} +1 -1
- package/dist/{metadata-route-CWP_HjGU.d.mts → metadata-route-D1AYgWni.d.mts} +1 -1
- package/dist/middleware.cjs.map +1 -0
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/navigation.cjs.map +1 -0
- package/dist/{nitro-EGRNOB5P.mjs → nitro-IITKBMUI.mjs} +4 -3
- package/dist/{nitro-EGRNOB5P.mjs.map → nitro-IITKBMUI.mjs.map} +1 -1
- package/dist/observability.cjs.map +1 -0
- package/dist/plugin.cjs +143 -50
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.mjs +10 -8
- package/dist/{production-runtime-BGRH1dKG.d.mts → production-runtime-BIKA-BVT.d.mts} +2 -2
- package/dist/{production-runtime-CdmzsDax.d.ts → production-runtime-DtCUEELY.d.ts} +2 -2
- package/dist/query/client.cjs.map +1 -0
- package/dist/query/index.cjs.map +1 -0
- package/dist/query/parsers.cjs.map +1 -0
- package/dist/query/server.cjs.map +1 -0
- package/dist/{render-plan-DLxJYAA5.d.mts → render-plan-Dimb23ux.d.mts} +1 -1
- package/dist/{render-plan-0GeHiGVZ.d.ts → render-plan-rg3uiSo3.d.ts} +1 -1
- package/dist/renderer/react/client.cjs.map +1 -0
- package/dist/renderer/react/server.cjs.map +1 -0
- package/dist/renderer/react/vite.cjs.map +1 -0
- package/dist/renderer-client.cjs +26 -1
- package/dist/renderer-client.cjs.map +1 -0
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.cjs.map +1 -0
- package/dist/{request-BstWbZ6O.d.ts → request-ColD-ChW.d.ts} +1 -1
- package/dist/{request-BCNXSXLh.d.mts → request-D5zvbU2Z.d.mts} +1 -1
- package/dist/request.cjs.map +1 -0
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/router.cjs.map +1 -0
- package/dist/routes.cjs.map +1 -0
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/server-action-security.cjs +117 -104
- package/dist/server-action-security.cjs.map +1 -0
- package/dist/server-action-security.mjs +2 -1
- package/dist/server-fn-client.cjs.map +1 -0
- package/dist/server-fn.cjs.map +1 -0
- package/dist/server-fn.mjs +3 -2
- package/dist/server-plugins.cjs.map +1 -0
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-query-client.cjs +26 -1
- package/dist/server-query-client.cjs.map +1 -0
- package/dist/server-query-client.mjs +3 -3
- package/dist/server-query.cjs.map +1 -0
- package/dist/server-query.mjs +4 -3
- package/dist/server.cjs +221 -116
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.mts +8 -8
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +13 -11
- package/dist/server.mjs.map +1 -1
- package/dist/{spa-router-BeyAVSc6.d.mts → spa-router-BlilYGAN.d.mts} +1 -1
- package/dist/{spa-router-COgu4txb.d.ts → spa-router-kXORcsT_.d.ts} +1 -1
- package/dist/storage.cjs +7 -3
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.mjs +1 -1
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +2 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/theme/client.cjs.map +1 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/runtime.cjs.map +1 -0
- package/dist/theme/server.cjs.map +1 -0
- package/dist/{utils-DkU2c_1B.d.ts → utils-BhvF7Hhl.d.ts} +1 -1
- package/dist/{utils-DL2VwDQl.d.mts → utils-uF32evNX.d.mts} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -0
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +143 -50
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +10 -8
- package/dist/{workflows-ChyK_oTu.d.mts → workflows-BantWytQ.d.mts} +7 -0
- package/dist/{workflows-ChyK_oTu.d.ts → workflows-BantWytQ.d.ts} +7 -0
- package/dist/workflows.cjs +67 -4
- package/dist/workflows.cjs.map +1 -0
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +2 -1
- package/package.json +17 -17
- package/dist/chunk-2SKCXYLB.mjs.map +0 -1
- package/dist/chunk-35NPLKQJ.mjs.map +0 -1
- package/dist/chunk-AAC66ILR.mjs.map +0 -1
- package/dist/chunk-BZAIS65C.mjs.map +0 -1
- package/dist/chunk-EPDIF432.mjs.map +0 -1
- package/dist/chunk-ISSFLGJ5.mjs.map +0 -1
- package/dist/chunk-WKDAA6V2.mjs.map +0 -1
- /package/dist/{chunk-WD2EBM3I.mjs.map → chunk-3CQJV3NC.mjs.map} +0 -0
- /package/dist/{chunk-I3OOUWO5.mjs.map → chunk-3GDRV7SG.mjs.map} +0 -0
- /package/dist/{chunk-X4SFHKFH.mjs.map → chunk-6KJY25DQ.mjs.map} +0 -0
- /package/dist/{chunk-FP5Q67FO.mjs.map → chunk-AAEZP2EY.mjs.map} +0 -0
- /package/dist/{chunk-FSIXEIOB.mjs.map → chunk-L7FSTPGS.mjs.map} +0 -0
- /package/dist/{chunk-GJ7W6LNK.mjs.map → chunk-N5RK4LK6.mjs.map} +0 -0
- /package/dist/{chunk-52BR7LTX.mjs.map → chunk-STSPSJUI.mjs.map} +0 -0
- /package/dist/{chunk-YIBV77KZ.mjs.map → chunk-URQELPSH.mjs.map} +0 -0
- /package/dist/{chunk-UMUWR5XA.mjs.map → chunk-UWQ4EEW7.mjs.map} +0 -0
- /package/dist/{chunk-IZBX2TEU.mjs.map → chunk-VQG3QWWK.mjs.map} +0 -0
- /package/dist/{chunk-D7F7YZ7L.mjs.map → chunk-WA77FWAO.mjs.map} +0 -0
- /package/dist/{integration-orm-LLW6WZNK.mjs.map → integration-orm-G5BPBT5X.mjs.map} +0 -0
package/dist/integrations.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export { cG as DefinedIntegration, bV as FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, p as FarmIntegration, bG as FarmIntegrationCategory, bZ as FarmIntegrationConfigContext, b_ as FarmIntegrationConfigDefinition, b$ as FarmIntegrationConfigInput, ct as FarmIntegrationContributedPlugin, c4 as FarmIntegrationData, cf as FarmIntegrationDocumentNavigation, cA as FarmIntegrationEndpointValue, cB as FarmIntegrationEndpoints, cD as FarmIntegrationEndpointsFactory, cC as FarmIntegrationEndpointsFactoryContext, c5 as FarmIntegrationHandlerContext, bS as FarmIntegrationInputSchema, c2 as FarmIntegrationLifecycleContext, c3 as FarmIntegrationLifecycleHook, c0 as FarmIntegrationLifecycleLogLevel, c1 as FarmIntegrationLifecycleLogger, cq as FarmIntegrationLogEvent, cp as FarmIntegrationLogPhase, cr as FarmIntegrationLogger, cb as FarmIntegrationMiddleware, cs as FarmIntegrationPluginOwner, ce as FarmIntegrationProvider, cd as FarmIntegrationProviderComponentReference, cc as FarmIntegrationProviderProps, bU as FarmIntegrationRequestContextStore, c8 as FarmIntegrationRoute, bY as FarmIntegrationRouteArgs, bW as FarmIntegrationRouteDb, cx as FarmIntegrationRouteFactory, c7 as FarmIntegrationRouteHook, c6 as FarmIntegrationRouteHookContext, bN as FarmIntegrationRouteInput, bT as FarmIntegrationRouteInputSchemas, bL as FarmIntegrationRouteInputSource, bK as FarmIntegrationRouteMethod, ca as FarmIntegrationRouteMiddleware, bI as FarmIntegrationRouteParamValue, bJ as FarmIntegrationRouteParams, bX as FarmIntegrationRouteStorageArgs, cz as FarmIntegrationRoutesFactory, cy as FarmIntegrationRoutesFactoryContext, cn as FarmIntegrationSchema, cj as FarmIntegrationSchemaConstraint, ci as FarmIntegrationSchemaField, cg as FarmIntegrationSchemaFieldType, ck as FarmIntegrationSchemaModel, cl as FarmIntegrationSchemaModelExtension, cm as FarmIntegrationSchemaModelOverride, ch as FarmIntegrationSchemaReference, bH as FarmIntegrationSlot, bR as FarmIntegrationStandardValidationResult, bP as FarmIntegrationValidationErrorLike, bO as FarmIntegrationValidationIssue, bM as FarmIntegrationValidationPathSegment, bQ as FarmIntegrationValidationResult, cu as FarmIntegrationsUserConfig, c9 as FarmTypedIntegrationRoute, cY as IntegrationOriginPolicy, cZ as IntegrationOriginRejection, c_ as IntegrationOriginResult, cE as createIntegrationRoute, cH as defineIntegration, co as defineIntegrationSchema, cV as describeIntegrationOriginRejection, cU as dispatchIntegrationRequest, cw as getFarmIntegrationPluginOwner, cv as getFarmIntegrationPluginServerRuntime, cM as getIntegrationDocumentNavigationMatchers, cK as getIntegrationProviders, cN as getIntegrationSchemas, cT as getRegisteredIntegrationAPIManifest, cO as getRegisteredIntegrationRuntime, cQ as getRegisteredIntegrationSchemas, cP as getRegisteredIntegrations, cF as integrationRoute, cI as isFarmIntegration, cL as isFarmIntegrationProviderComponentReference, cR as matchIntegrationRoute, cS as matchRegisteredIntegrationRoute, cW as resolveIntegrationAllowedOrigins, cJ as resolveIntegrationPlugins, cX as validateIntegrationRequestOrigin } from './client-plugins-CyTLPqjP.mjs';
|
|
1
2
|
import 'react';
|
|
2
3
|
export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation } from './integration-api-BT024nuJ.mjs';
|
|
3
|
-
export { cG as DefinedIntegration, bV as FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, p as FarmIntegration, bG as FarmIntegrationCategory, bZ as FarmIntegrationConfigContext, b_ as FarmIntegrationConfigDefinition, b$ as FarmIntegrationConfigInput, ct as FarmIntegrationContributedPlugin, c4 as FarmIntegrationData, cf as FarmIntegrationDocumentNavigation, cA as FarmIntegrationEndpointValue, cB as FarmIntegrationEndpoints, cD as FarmIntegrationEndpointsFactory, cC as FarmIntegrationEndpointsFactoryContext, c5 as FarmIntegrationHandlerContext, bS as FarmIntegrationInputSchema, c2 as FarmIntegrationLifecycleContext, c3 as FarmIntegrationLifecycleHook, c0 as FarmIntegrationLifecycleLogLevel, c1 as FarmIntegrationLifecycleLogger, cq as FarmIntegrationLogEvent, cp as FarmIntegrationLogPhase, cr as FarmIntegrationLogger, cb as FarmIntegrationMiddleware, cs as FarmIntegrationPluginOwner, ce as FarmIntegrationProvider, cd as FarmIntegrationProviderComponentReference, cc as FarmIntegrationProviderProps, bU as FarmIntegrationRequestContextStore, c8 as FarmIntegrationRoute, bY as FarmIntegrationRouteArgs, bW as FarmIntegrationRouteDb, cx as FarmIntegrationRouteFactory, c7 as FarmIntegrationRouteHook, c6 as FarmIntegrationRouteHookContext, bN as FarmIntegrationRouteInput, bT as FarmIntegrationRouteInputSchemas, bL as FarmIntegrationRouteInputSource, bK as FarmIntegrationRouteMethod, ca as FarmIntegrationRouteMiddleware, bI as FarmIntegrationRouteParamValue, bJ as FarmIntegrationRouteParams, bX as FarmIntegrationRouteStorageArgs, cz as FarmIntegrationRoutesFactory, cy as FarmIntegrationRoutesFactoryContext, cn as FarmIntegrationSchema, cj as FarmIntegrationSchemaConstraint, ci as FarmIntegrationSchemaField, cg as FarmIntegrationSchemaFieldType, ck as FarmIntegrationSchemaModel, cl as FarmIntegrationSchemaModelExtension, cm as FarmIntegrationSchemaModelOverride, ch as FarmIntegrationSchemaReference, bH as FarmIntegrationSlot, bR as FarmIntegrationStandardValidationResult, bP as FarmIntegrationValidationErrorLike, bO as FarmIntegrationValidationIssue, bM as FarmIntegrationValidationPathSegment, bQ as FarmIntegrationValidationResult, cu as FarmIntegrationsUserConfig, c9 as FarmTypedIntegrationRoute, cE as createIntegrationRoute, cH as defineIntegration, co as defineIntegrationSchema, cU as dispatchIntegrationRequest, cw as getFarmIntegrationPluginOwner, cv as getFarmIntegrationPluginServerRuntime, cM as getIntegrationDocumentNavigationMatchers, cK as getIntegrationProviders, cN as getIntegrationSchemas, cT as getRegisteredIntegrationAPIManifest, cO as getRegisteredIntegrationRuntime, cQ as getRegisteredIntegrationSchemas, cP as getRegisteredIntegrations, cF as integrationRoute, cI as isFarmIntegration, cL as isFarmIntegrationProviderComponentReference, cR as matchIntegrationRoute, cS as matchRegisteredIntegrationRoute, cJ as resolveIntegrationPlugins } from './client-plugins-B6-07YmP.mjs';
|
|
4
4
|
import './lifecycle-De0vQG45.mjs';
|
|
5
5
|
import './route-CvEr4Uc9.mjs';
|
|
6
6
|
import './cache.mjs';
|
|
@@ -16,7 +16,7 @@ import './markdown.mjs';
|
|
|
16
16
|
import './observability.mjs';
|
|
17
17
|
import '@opentelemetry/api';
|
|
18
18
|
import 'vite';
|
|
19
|
-
import './workflows-
|
|
19
|
+
import './workflows-BantWytQ.mjs';
|
|
20
20
|
import './cron.mjs';
|
|
21
21
|
import './env.mjs';
|
|
22
22
|
import './navigation-errors-Dvwpzaer.mjs';
|
package/dist/integrations.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export { cG as DefinedIntegration, bV as FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, p as FarmIntegration, bG as FarmIntegrationCategory, bZ as FarmIntegrationConfigContext, b_ as FarmIntegrationConfigDefinition, b$ as FarmIntegrationConfigInput, ct as FarmIntegrationContributedPlugin, c4 as FarmIntegrationData, cf as FarmIntegrationDocumentNavigation, cA as FarmIntegrationEndpointValue, cB as FarmIntegrationEndpoints, cD as FarmIntegrationEndpointsFactory, cC as FarmIntegrationEndpointsFactoryContext, c5 as FarmIntegrationHandlerContext, bS as FarmIntegrationInputSchema, c2 as FarmIntegrationLifecycleContext, c3 as FarmIntegrationLifecycleHook, c0 as FarmIntegrationLifecycleLogLevel, c1 as FarmIntegrationLifecycleLogger, cq as FarmIntegrationLogEvent, cp as FarmIntegrationLogPhase, cr as FarmIntegrationLogger, cb as FarmIntegrationMiddleware, cs as FarmIntegrationPluginOwner, ce as FarmIntegrationProvider, cd as FarmIntegrationProviderComponentReference, cc as FarmIntegrationProviderProps, bU as FarmIntegrationRequestContextStore, c8 as FarmIntegrationRoute, bY as FarmIntegrationRouteArgs, bW as FarmIntegrationRouteDb, cx as FarmIntegrationRouteFactory, c7 as FarmIntegrationRouteHook, c6 as FarmIntegrationRouteHookContext, bN as FarmIntegrationRouteInput, bT as FarmIntegrationRouteInputSchemas, bL as FarmIntegrationRouteInputSource, bK as FarmIntegrationRouteMethod, ca as FarmIntegrationRouteMiddleware, bI as FarmIntegrationRouteParamValue, bJ as FarmIntegrationRouteParams, bX as FarmIntegrationRouteStorageArgs, cz as FarmIntegrationRoutesFactory, cy as FarmIntegrationRoutesFactoryContext, cn as FarmIntegrationSchema, cj as FarmIntegrationSchemaConstraint, ci as FarmIntegrationSchemaField, cg as FarmIntegrationSchemaFieldType, ck as FarmIntegrationSchemaModel, cl as FarmIntegrationSchemaModelExtension, cm as FarmIntegrationSchemaModelOverride, ch as FarmIntegrationSchemaReference, bH as FarmIntegrationSlot, bR as FarmIntegrationStandardValidationResult, bP as FarmIntegrationValidationErrorLike, bO as FarmIntegrationValidationIssue, bM as FarmIntegrationValidationPathSegment, bQ as FarmIntegrationValidationResult, cu as FarmIntegrationsUserConfig, c9 as FarmTypedIntegrationRoute, cY as IntegrationOriginPolicy, cZ as IntegrationOriginRejection, c_ as IntegrationOriginResult, cE as createIntegrationRoute, cH as defineIntegration, co as defineIntegrationSchema, cV as describeIntegrationOriginRejection, cU as dispatchIntegrationRequest, cw as getFarmIntegrationPluginOwner, cv as getFarmIntegrationPluginServerRuntime, cM as getIntegrationDocumentNavigationMatchers, cK as getIntegrationProviders, cN as getIntegrationSchemas, cT as getRegisteredIntegrationAPIManifest, cO as getRegisteredIntegrationRuntime, cQ as getRegisteredIntegrationSchemas, cP as getRegisteredIntegrations, cF as integrationRoute, cI as isFarmIntegration, cL as isFarmIntegrationProviderComponentReference, cR as matchIntegrationRoute, cS as matchRegisteredIntegrationRoute, cW as resolveIntegrationAllowedOrigins, cJ as resolveIntegrationPlugins, cX as validateIntegrationRequestOrigin } from './client-plugins-D-UgzngJ.js';
|
|
1
2
|
import 'react';
|
|
2
3
|
export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation } from './integration-api-BT024nuJ.js';
|
|
3
|
-
export { cG as DefinedIntegration, bV as FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, p as FarmIntegration, bG as FarmIntegrationCategory, bZ as FarmIntegrationConfigContext, b_ as FarmIntegrationConfigDefinition, b$ as FarmIntegrationConfigInput, ct as FarmIntegrationContributedPlugin, c4 as FarmIntegrationData, cf as FarmIntegrationDocumentNavigation, cA as FarmIntegrationEndpointValue, cB as FarmIntegrationEndpoints, cD as FarmIntegrationEndpointsFactory, cC as FarmIntegrationEndpointsFactoryContext, c5 as FarmIntegrationHandlerContext, bS as FarmIntegrationInputSchema, c2 as FarmIntegrationLifecycleContext, c3 as FarmIntegrationLifecycleHook, c0 as FarmIntegrationLifecycleLogLevel, c1 as FarmIntegrationLifecycleLogger, cq as FarmIntegrationLogEvent, cp as FarmIntegrationLogPhase, cr as FarmIntegrationLogger, cb as FarmIntegrationMiddleware, cs as FarmIntegrationPluginOwner, ce as FarmIntegrationProvider, cd as FarmIntegrationProviderComponentReference, cc as FarmIntegrationProviderProps, bU as FarmIntegrationRequestContextStore, c8 as FarmIntegrationRoute, bY as FarmIntegrationRouteArgs, bW as FarmIntegrationRouteDb, cx as FarmIntegrationRouteFactory, c7 as FarmIntegrationRouteHook, c6 as FarmIntegrationRouteHookContext, bN as FarmIntegrationRouteInput, bT as FarmIntegrationRouteInputSchemas, bL as FarmIntegrationRouteInputSource, bK as FarmIntegrationRouteMethod, ca as FarmIntegrationRouteMiddleware, bI as FarmIntegrationRouteParamValue, bJ as FarmIntegrationRouteParams, bX as FarmIntegrationRouteStorageArgs, cz as FarmIntegrationRoutesFactory, cy as FarmIntegrationRoutesFactoryContext, cn as FarmIntegrationSchema, cj as FarmIntegrationSchemaConstraint, ci as FarmIntegrationSchemaField, cg as FarmIntegrationSchemaFieldType, ck as FarmIntegrationSchemaModel, cl as FarmIntegrationSchemaModelExtension, cm as FarmIntegrationSchemaModelOverride, ch as FarmIntegrationSchemaReference, bH as FarmIntegrationSlot, bR as FarmIntegrationStandardValidationResult, bP as FarmIntegrationValidationErrorLike, bO as FarmIntegrationValidationIssue, bM as FarmIntegrationValidationPathSegment, bQ as FarmIntegrationValidationResult, cu as FarmIntegrationsUserConfig, c9 as FarmTypedIntegrationRoute, cE as createIntegrationRoute, cH as defineIntegration, co as defineIntegrationSchema, cU as dispatchIntegrationRequest, cw as getFarmIntegrationPluginOwner, cv as getFarmIntegrationPluginServerRuntime, cM as getIntegrationDocumentNavigationMatchers, cK as getIntegrationProviders, cN as getIntegrationSchemas, cT as getRegisteredIntegrationAPIManifest, cO as getRegisteredIntegrationRuntime, cQ as getRegisteredIntegrationSchemas, cP as getRegisteredIntegrations, cF as integrationRoute, cI as isFarmIntegration, cL as isFarmIntegrationProviderComponentReference, cR as matchIntegrationRoute, cS as matchRegisteredIntegrationRoute, cJ as resolveIntegrationPlugins } from './client-plugins-By6MVUX-.js';
|
|
4
4
|
import './lifecycle-De0vQG45.js';
|
|
5
5
|
import './route-4pd-EVtw.js';
|
|
6
6
|
import './cache.js';
|
|
@@ -16,7 +16,7 @@ import './markdown.js';
|
|
|
16
16
|
import './observability.js';
|
|
17
17
|
import '@opentelemetry/api';
|
|
18
18
|
import 'vite';
|
|
19
|
-
import './workflows-
|
|
19
|
+
import './workflows-BantWytQ.js';
|
|
20
20
|
import './cron.js';
|
|
21
21
|
import './env.js';
|
|
22
22
|
import './navigation-errors-Dvwpzaer.js';
|
package/dist/integrations.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createIntegrationRoute,
|
|
4
4
|
defineIntegration,
|
|
5
5
|
defineIntegrationSchema,
|
|
6
|
+
describeIntegrationOriginRejection,
|
|
6
7
|
dispatchIntegrationRequest,
|
|
7
8
|
getFarmIntegrationPluginOwner,
|
|
8
9
|
getFarmIntegrationPluginServerRuntime,
|
|
@@ -18,8 +19,11 @@ import {
|
|
|
18
19
|
isFarmIntegrationProviderComponentReference,
|
|
19
20
|
matchIntegrationRoute,
|
|
20
21
|
matchRegisteredIntegrationRoute,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
resolveIntegrationAllowedOrigins,
|
|
23
|
+
resolveIntegrationPlugins,
|
|
24
|
+
validateIntegrationRequestOrigin
|
|
25
|
+
} from "./chunk-LXXG3K2Y.mjs";
|
|
26
|
+
import "./chunk-FDWXXTWR.mjs";
|
|
23
27
|
import "./chunk-VFPFBYG5.mjs";
|
|
24
28
|
import "./chunk-35SSRS5K.mjs";
|
|
25
29
|
import "./chunk-ZHQMHJAV.mjs";
|
|
@@ -41,6 +45,7 @@ export {
|
|
|
41
45
|
defineIntegrationAPI,
|
|
42
46
|
defineIntegrationAPIOperation,
|
|
43
47
|
defineIntegrationSchema,
|
|
48
|
+
describeIntegrationOriginRejection,
|
|
44
49
|
dispatchIntegrationRequest,
|
|
45
50
|
getFarmIntegrationPluginOwner,
|
|
46
51
|
getFarmIntegrationPluginServerRuntime,
|
|
@@ -56,6 +61,8 @@ export {
|
|
|
56
61
|
isFarmIntegrationProviderComponentReference,
|
|
57
62
|
matchIntegrationRoute,
|
|
58
63
|
matchRegisteredIntegrationRoute,
|
|
59
|
-
|
|
64
|
+
resolveIntegrationAllowedOrigins,
|
|
65
|
+
resolveIntegrationPlugins,
|
|
66
|
+
validateIntegrationRequestOrigin
|
|
60
67
|
};
|
|
61
68
|
//# sourceMappingURL=integrations.mjs.map
|
|
@@ -410,6 +410,54 @@ var init_route_pattern = __esm({
|
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
412
|
|
|
413
|
+
// src/request-origin.ts
|
|
414
|
+
function normalizeAllowedOriginPattern(value, label) {
|
|
415
|
+
const pattern = value.trim().toLowerCase();
|
|
416
|
+
if (!pattern) {
|
|
417
|
+
throw new TypeError(`${label} cannot contain empty values`);
|
|
418
|
+
}
|
|
419
|
+
if (pattern.includes("*")) {
|
|
420
|
+
if (!/^(?:https?:\/\/)?\*\.[a-z0-9.-]+(?::\d+)?$/.test(pattern)) {
|
|
421
|
+
throw new TypeError(`Invalid ${label} pattern: ${JSON.stringify(value)}`);
|
|
422
|
+
}
|
|
423
|
+
return pattern;
|
|
424
|
+
}
|
|
425
|
+
if (pattern.includes("://")) {
|
|
426
|
+
let parsed;
|
|
427
|
+
try {
|
|
428
|
+
parsed = new URL(pattern);
|
|
429
|
+
} catch {
|
|
430
|
+
throw new TypeError(`Invalid ${label} value: ${JSON.stringify(value)}`);
|
|
431
|
+
}
|
|
432
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:" || parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
|
|
433
|
+
throw new TypeError(`${label} must contain origins without paths: ${JSON.stringify(value)}`);
|
|
434
|
+
}
|
|
435
|
+
return parsed.origin;
|
|
436
|
+
}
|
|
437
|
+
if (/[/@?#]/.test(pattern)) {
|
|
438
|
+
throw new TypeError(`${label} must contain origins or hosts: ${JSON.stringify(value)}`);
|
|
439
|
+
}
|
|
440
|
+
try {
|
|
441
|
+
return new URL(`http://${pattern}`).host;
|
|
442
|
+
} catch {
|
|
443
|
+
throw new TypeError(`Invalid ${label} value: ${JSON.stringify(value)}`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
var init_request_origin = __esm({
|
|
447
|
+
"src/request-origin.ts"() {
|
|
448
|
+
"use strict";
|
|
449
|
+
__name(normalizeAllowedOriginPattern, "normalizeAllowedOriginPattern");
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// src/integration-request-security.ts
|
|
454
|
+
var init_integration_request_security = __esm({
|
|
455
|
+
"src/integration-request-security.ts"() {
|
|
456
|
+
"use strict";
|
|
457
|
+
init_request_origin();
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
|
|
413
461
|
// src/integration-api.ts
|
|
414
462
|
function defineIntegrationAPIOperation(operation) {
|
|
415
463
|
return {
|
|
@@ -1426,9 +1474,13 @@ function getStorage(namespace) {
|
|
|
1426
1474
|
const namespaced = (0, import_unstorage.prefixStorage)(globalStorage, base);
|
|
1427
1475
|
return {
|
|
1428
1476
|
...namespaced,
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1477
|
+
// Scope the wipe to the namespace instead of the whole storage, and keep
|
|
1478
|
+
// the caller's base so `clear("sessions")` cannot take unrelated keys with
|
|
1479
|
+
// it. Dropping the argument silently widens a targeted clear into a
|
|
1480
|
+
// namespace-wide delete.
|
|
1481
|
+
async clear(base2, opts) {
|
|
1482
|
+
const keys = await namespaced.getKeys(base2);
|
|
1483
|
+
await Promise.all(keys.map((key) => namespaced.removeItem(key, opts)));
|
|
1432
1484
|
}
|
|
1433
1485
|
};
|
|
1434
1486
|
}
|
|
@@ -3456,6 +3508,7 @@ var init_integrations = __esm({
|
|
|
3456
3508
|
"src/integrations.ts"() {
|
|
3457
3509
|
"use strict";
|
|
3458
3510
|
init_route_pattern();
|
|
3511
|
+
init_integration_request_security();
|
|
3459
3512
|
init_integration_api();
|
|
3460
3513
|
init_plugin_integration_context();
|
|
3461
3514
|
init_decode();
|
|
@@ -3885,6 +3938,29 @@ var init_search_params = __esm({
|
|
|
3885
3938
|
}
|
|
3886
3939
|
});
|
|
3887
3940
|
|
|
3941
|
+
// src/utils/runtime-env.ts
|
|
3942
|
+
function getFarmRuntimeBindings() {
|
|
3943
|
+
const runtimeBindings = globalThis.__env__;
|
|
3944
|
+
return runtimeBindings && typeof runtimeBindings === "object" ? runtimeBindings : void 0;
|
|
3945
|
+
}
|
|
3946
|
+
function readFarmEnvironmentValue(name2) {
|
|
3947
|
+
const runtimeValue = getFarmRuntimeBindings()?.[name2];
|
|
3948
|
+
if (typeof runtimeValue === "string") return runtimeValue;
|
|
3949
|
+
return typeof process !== "undefined" ? process.env?.[name2] : void 0;
|
|
3950
|
+
}
|
|
3951
|
+
function isFarmDeployedRuntime() {
|
|
3952
|
+
if (getFarmRuntimeBindings()) return true;
|
|
3953
|
+
return readFarmEnvironmentValue("NODE_ENV") === "production";
|
|
3954
|
+
}
|
|
3955
|
+
var init_runtime_env = __esm({
|
|
3956
|
+
"src/utils/runtime-env.ts"() {
|
|
3957
|
+
"use strict";
|
|
3958
|
+
__name(getFarmRuntimeBindings, "getFarmRuntimeBindings");
|
|
3959
|
+
__name(readFarmEnvironmentValue, "readFarmEnvironmentValue");
|
|
3960
|
+
__name(isFarmDeployedRuntime, "isFarmDeployedRuntime");
|
|
3961
|
+
}
|
|
3962
|
+
});
|
|
3963
|
+
|
|
3888
3964
|
// src/utils.ts
|
|
3889
3965
|
function parseRoutePath(filePath) {
|
|
3890
3966
|
const segments = [];
|
|
@@ -4109,7 +4185,8 @@ function resolveWorkflowsConfig(workflows) {
|
|
|
4109
4185
|
dirs,
|
|
4110
4186
|
route: normalizeWorkflowRoute(options.route || DEFAULT_FARM_WORKFLOW_ROUTE),
|
|
4111
4187
|
secretEnv: options.secretEnv || DEFAULT_FARM_WORKFLOW_SECRET_ENV,
|
|
4112
|
-
secret: options.secret
|
|
4188
|
+
secret: options.secret,
|
|
4189
|
+
allowUnsecured: options.allowUnsecured === true
|
|
4113
4190
|
};
|
|
4114
4191
|
}
|
|
4115
4192
|
async function discoverFarmWorkflows(config, options = {}) {
|
|
@@ -4235,8 +4312,11 @@ async function prepareFarmWorkflowsForNitro(config) {
|
|
|
4235
4312
|
await fs15.mkdir(generatedDir, { recursive: true });
|
|
4236
4313
|
const tasks = {};
|
|
4237
4314
|
const scheduledTasks = createScheduledTasks(workflows);
|
|
4315
|
+
const wrapperNames = resolveWorkflowWrapperFileNames(workflows.map((workflow) => workflow.id));
|
|
4238
4316
|
for (const workflow of workflows) {
|
|
4239
|
-
const wrapperPath = toPosixPath(
|
|
4317
|
+
const wrapperPath = toPosixPath(
|
|
4318
|
+
path42.join(generatedDir, `${wrapperNames.get(workflow.id)}.mjs`)
|
|
4319
|
+
);
|
|
4240
4320
|
await fs15.writeFile(wrapperPath, createNitroTaskWrapper(workflow), "utf8");
|
|
4241
4321
|
tasks[workflow.id] = {
|
|
4242
4322
|
handler: wrapperPath,
|
|
@@ -4597,8 +4677,16 @@ function readScheduledTime(payload) {
|
|
|
4597
4677
|
return payload && typeof payload === "object" && "scheduledTime" in payload ? payload.scheduledTime : void 0;
|
|
4598
4678
|
}
|
|
4599
4679
|
function verifyWorkflowSecret(request, config) {
|
|
4600
|
-
const secret = config.secret ||
|
|
4601
|
-
if (!secret)
|
|
4680
|
+
const secret = config.secret || readFarmEnvironmentValue(config.secretEnv) || "";
|
|
4681
|
+
if (!secret) {
|
|
4682
|
+
if (config.allowUnsecured === true || !isFarmDeployedRuntime()) return null;
|
|
4683
|
+
return Response.json(
|
|
4684
|
+
{
|
|
4685
|
+
error: "Workflow route requires a secret. Set the CRON_SECRET environment variable, configure workflows.secret, or set workflows.allowUnsecured to true."
|
|
4686
|
+
},
|
|
4687
|
+
{ status: 401 }
|
|
4688
|
+
);
|
|
4689
|
+
}
|
|
4602
4690
|
const authorization = request.headers.get("authorization") || "";
|
|
4603
4691
|
const bearer = authorization.match(/^Bearer\s+(.+)$/i)?.[1] || "";
|
|
4604
4692
|
const headerSecret = request.headers.get("x-farm-workflow-secret") || "";
|
|
@@ -4611,6 +4699,37 @@ function joinRoute(...parts) {
|
|
|
4611
4699
|
function trimSlashes(value) {
|
|
4612
4700
|
return value.replace(/^\/+|\/+$/g, "");
|
|
4613
4701
|
}
|
|
4702
|
+
function resolveWorkflowWrapperFileNames(ids) {
|
|
4703
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4704
|
+
for (const id of ids) {
|
|
4705
|
+
const key = safeFileName(id).toLowerCase();
|
|
4706
|
+
groups.set(key, (groups.get(key) ?? 0) + 1);
|
|
4707
|
+
}
|
|
4708
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
4709
|
+
const claimed = /* @__PURE__ */ new Map();
|
|
4710
|
+
for (const id of ids) {
|
|
4711
|
+
const base = safeFileName(id);
|
|
4712
|
+
const key = base.toLowerCase();
|
|
4713
|
+
const fileName = (groups.get(key) ?? 0) > 1 ? `${key}-${workflowIdFingerprint(id)}` : base;
|
|
4714
|
+
const claimedBy = claimed.get(fileName.toLowerCase());
|
|
4715
|
+
if (claimedBy !== void 0) {
|
|
4716
|
+
throw new Error(
|
|
4717
|
+
`Farm workflows ${JSON.stringify(claimedBy)} and ${JSON.stringify(id)} generate the same wrapper file ${JSON.stringify(`${fileName}.mjs`)}. Rename one of them.`
|
|
4718
|
+
);
|
|
4719
|
+
}
|
|
4720
|
+
claimed.set(fileName.toLowerCase(), id);
|
|
4721
|
+
resolved.set(id, fileName);
|
|
4722
|
+
}
|
|
4723
|
+
return resolved;
|
|
4724
|
+
}
|
|
4725
|
+
function workflowIdFingerprint(value) {
|
|
4726
|
+
let hash = 2166136261;
|
|
4727
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
4728
|
+
hash ^= value.charCodeAt(index);
|
|
4729
|
+
hash = Math.imul(hash, 16777619);
|
|
4730
|
+
}
|
|
4731
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
4732
|
+
}
|
|
4614
4733
|
function safeFileName(value) {
|
|
4615
4734
|
return value.replace(/[^a-zA-Z0-9._-]+/g, "-") || "workflow";
|
|
4616
4735
|
}
|
|
@@ -4623,6 +4742,7 @@ var init_workflows = __esm({
|
|
|
4623
4742
|
"use strict";
|
|
4624
4743
|
init_server_http();
|
|
4625
4744
|
init_search_params();
|
|
4745
|
+
init_runtime_env();
|
|
4626
4746
|
init_decode();
|
|
4627
4747
|
init_utils();
|
|
4628
4748
|
init_route_pattern();
|
|
@@ -4662,6 +4782,8 @@ var init_workflows = __esm({
|
|
|
4662
4782
|
__name(verifyWorkflowSecret, "verifyWorkflowSecret");
|
|
4663
4783
|
__name(joinRoute, "joinRoute");
|
|
4664
4784
|
__name(trimSlashes, "trimSlashes");
|
|
4785
|
+
__name(resolveWorkflowWrapperFileNames, "resolveWorkflowWrapperFileNames");
|
|
4786
|
+
__name(workflowIdFingerprint, "workflowIdFingerprint");
|
|
4665
4787
|
__name(safeFileName, "safeFileName");
|
|
4666
4788
|
__name(relativePath, "relativePath");
|
|
4667
4789
|
}
|
|
@@ -4713,9 +4835,10 @@ async function prepareFarmCronForNitro(config) {
|
|
|
4713
4835
|
await fs15.rm(generatedDir, { recursive: true, force: true });
|
|
4714
4836
|
await fs15.mkdir(generatedDir, { recursive: true });
|
|
4715
4837
|
const tasks = {};
|
|
4838
|
+
const wrapperNames = resolveCronWrapperFileNames(cron.jobs.map((job) => job.name));
|
|
4716
4839
|
for (const job of cron.jobs) {
|
|
4717
4840
|
const taskName = getFarmCronTaskName(job.name);
|
|
4718
|
-
const wrapperPath = toPosixPath(path42.join(generatedDir, `${
|
|
4841
|
+
const wrapperPath = toPosixPath(path42.join(generatedDir, `${wrapperNames.get(job.name)}.mjs`));
|
|
4719
4842
|
await fs15.writeFile(wrapperPath, createNitroCronTaskWrapper(job, cron.secretEnv), "utf8");
|
|
4720
4843
|
tasks[taskName] = {
|
|
4721
4844
|
handler: wrapperPath,
|
|
@@ -4977,6 +5100,37 @@ export default defineTask({
|
|
|
4977
5100
|
});
|
|
4978
5101
|
`.trim();
|
|
4979
5102
|
}
|
|
5103
|
+
function resolveCronWrapperFileNames(names) {
|
|
5104
|
+
const groups = /* @__PURE__ */ new Map();
|
|
5105
|
+
for (const name2 of names) {
|
|
5106
|
+
const key = safeFileName2(name2).toLowerCase();
|
|
5107
|
+
groups.set(key, (groups.get(key) ?? 0) + 1);
|
|
5108
|
+
}
|
|
5109
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
5110
|
+
const claimed = /* @__PURE__ */ new Map();
|
|
5111
|
+
for (const name2 of names) {
|
|
5112
|
+
const base = safeFileName2(name2);
|
|
5113
|
+
const key = base.toLowerCase();
|
|
5114
|
+
const fileName = (groups.get(key) ?? 0) > 1 ? `${key}-${cronNameFingerprint(name2)}` : base;
|
|
5115
|
+
const claimedBy = claimed.get(fileName.toLowerCase());
|
|
5116
|
+
if (claimedBy !== void 0) {
|
|
5117
|
+
throw new Error(
|
|
5118
|
+
`Farm cron jobs ${JSON.stringify(claimedBy)} and ${JSON.stringify(name2)} generate the same wrapper file ${JSON.stringify(`${fileName}.mjs`)}. Rename one of them.`
|
|
5119
|
+
);
|
|
5120
|
+
}
|
|
5121
|
+
claimed.set(fileName.toLowerCase(), name2);
|
|
5122
|
+
resolved.set(name2, fileName);
|
|
5123
|
+
}
|
|
5124
|
+
return resolved;
|
|
5125
|
+
}
|
|
5126
|
+
function cronNameFingerprint(value) {
|
|
5127
|
+
let hash = 2166136261;
|
|
5128
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
5129
|
+
hash ^= value.charCodeAt(index);
|
|
5130
|
+
hash = Math.imul(hash, 16777619);
|
|
5131
|
+
}
|
|
5132
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
5133
|
+
}
|
|
4980
5134
|
function safeFileName2(value) {
|
|
4981
5135
|
return value.replace(/[^a-zA-Z0-9._-]+/g, "-") || "cron";
|
|
4982
5136
|
}
|
|
@@ -4985,6 +5139,7 @@ var init_cron = __esm({
|
|
|
4985
5139
|
"src/cron.ts"() {
|
|
4986
5140
|
"use strict";
|
|
4987
5141
|
init_utils();
|
|
5142
|
+
init_runtime_env();
|
|
4988
5143
|
DEFAULT_FARM_CRON_SECRET_ENV = "CRON_SECRET";
|
|
4989
5144
|
FARM_CRON_MANIFEST = "cron-manifest.json";
|
|
4990
5145
|
CRON_FIELD_RANGES = [
|
|
@@ -5013,6 +5168,8 @@ var init_cron = __esm({
|
|
|
5013
5168
|
__name(mergeTaskNames, "mergeTaskNames");
|
|
5014
5169
|
__name(getFarmCronTaskName, "getFarmCronTaskName");
|
|
5015
5170
|
__name(createNitroCronTaskWrapper, "createNitroCronTaskWrapper");
|
|
5171
|
+
__name(resolveCronWrapperFileNames, "resolveCronWrapperFileNames");
|
|
5172
|
+
__name(cronNameFingerprint, "cronNameFingerprint");
|
|
5016
5173
|
__name(safeFileName2, "safeFileName");
|
|
5017
5174
|
}
|
|
5018
5175
|
});
|
|
@@ -5604,7 +5761,9 @@ var init_server_fn_error = __esm({
|
|
|
5604
5761
|
|
|
5605
5762
|
// src/server-action-security.ts
|
|
5606
5763
|
function resolveServerActionsConfig(config) {
|
|
5607
|
-
const allowedOrigins = (config?.allowedOrigins ?? []).map(
|
|
5764
|
+
const allowedOrigins = (config?.allowedOrigins ?? []).map(
|
|
5765
|
+
(value) => normalizeAllowedOriginPattern(value, SERVER_ACTION_ALLOWED_ORIGINS_LABEL)
|
|
5766
|
+
);
|
|
5608
5767
|
const bodySizeLimit = parseBodySizeLimit(
|
|
5609
5768
|
config?.bodySizeLimit ?? DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT,
|
|
5610
5769
|
"serverActions.bodySizeLimit"
|
|
@@ -5624,50 +5783,16 @@ function getServerActionStorage() {
|
|
|
5624
5783
|
}
|
|
5625
5784
|
return globalState2[SERVER_ACTION_STORAGE_KEY];
|
|
5626
5785
|
}
|
|
5627
|
-
|
|
5628
|
-
const pattern = value.trim().toLowerCase();
|
|
5629
|
-
if (!pattern) {
|
|
5630
|
-
throw new TypeError("serverActions.allowedOrigins cannot contain empty values");
|
|
5631
|
-
}
|
|
5632
|
-
if (pattern.includes("*")) {
|
|
5633
|
-
if (!/^(?:https?:\/\/)?\*\.[a-z0-9.-]+(?::\d+)?$/.test(pattern)) {
|
|
5634
|
-
throw new TypeError(`Invalid serverActions.allowedOrigins pattern: ${JSON.stringify(value)}`);
|
|
5635
|
-
}
|
|
5636
|
-
return pattern;
|
|
5637
|
-
}
|
|
5638
|
-
if (pattern.includes("://")) {
|
|
5639
|
-
let parsed;
|
|
5640
|
-
try {
|
|
5641
|
-
parsed = new URL(pattern);
|
|
5642
|
-
} catch {
|
|
5643
|
-
throw new TypeError(`Invalid serverActions.allowedOrigins value: ${JSON.stringify(value)}`);
|
|
5644
|
-
}
|
|
5645
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:" || parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
|
|
5646
|
-
throw new TypeError(
|
|
5647
|
-
`serverActions.allowedOrigins must contain origins without paths: ${JSON.stringify(value)}`
|
|
5648
|
-
);
|
|
5649
|
-
}
|
|
5650
|
-
return parsed.origin;
|
|
5651
|
-
}
|
|
5652
|
-
if (/[/@?#]/.test(pattern)) {
|
|
5653
|
-
throw new TypeError(
|
|
5654
|
-
`serverActions.allowedOrigins must contain origins or hosts: ${JSON.stringify(value)}`
|
|
5655
|
-
);
|
|
5656
|
-
}
|
|
5657
|
-
try {
|
|
5658
|
-
return new URL(`http://${pattern}`).host;
|
|
5659
|
-
} catch {
|
|
5660
|
-
throw new TypeError(`Invalid serverActions.allowedOrigins value: ${JSON.stringify(value)}`);
|
|
5661
|
-
}
|
|
5662
|
-
}
|
|
5663
|
-
var import_node_async_hooks, DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, SERVER_ACTION_STORAGE_KEY;
|
|
5786
|
+
var import_node_async_hooks, SERVER_ACTION_ALLOWED_ORIGINS_LABEL, DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, SERVER_ACTION_STORAGE_KEY;
|
|
5664
5787
|
var init_server_action_security = __esm({
|
|
5665
5788
|
"src/server-action-security.ts"() {
|
|
5666
5789
|
"use strict";
|
|
5667
5790
|
import_node_async_hooks = require("async_hooks");
|
|
5668
5791
|
init_cache_invalidation();
|
|
5792
|
+
init_request_origin();
|
|
5669
5793
|
init_server_fn_error();
|
|
5670
5794
|
init_server_http();
|
|
5795
|
+
SERVER_ACTION_ALLOWED_ORIGINS_LABEL = "serverActions.allowedOrigins";
|
|
5671
5796
|
DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT = 1e6;
|
|
5672
5797
|
SERVER_ACTION_STORAGE_KEY = /* @__PURE__ */ Symbol.for("farm.serverActionStorage");
|
|
5673
5798
|
__name(resolveServerActionsConfig, "resolveServerActionsConfig");
|
|
@@ -5679,7 +5804,6 @@ var init_server_action_security = __esm({
|
|
|
5679
5804
|
getServerActionExecutionContext()?.cacheTasks.add(task);
|
|
5680
5805
|
});
|
|
5681
5806
|
__name(getServerActionStorage, "getServerActionStorage");
|
|
5682
|
-
__name(normalizeAllowedOriginPattern, "normalizeAllowedOriginPattern");
|
|
5683
5807
|
}
|
|
5684
5808
|
});
|
|
5685
5809
|
|
|
@@ -17097,7 +17221,7 @@ var init_server3 = __esm({
|
|
|
17097
17221
|
var version;
|
|
17098
17222
|
var init_package = __esm({
|
|
17099
17223
|
"package.json"() {
|
|
17100
|
-
version = "0.1.0-beta.
|
|
17224
|
+
version = "0.1.0-beta.98";
|
|
17101
17225
|
}
|
|
17102
17226
|
});
|
|
17103
17227
|
|
|
@@ -25232,10 +25356,11 @@ function createFarmImageHandler(config, options) {
|
|
|
25232
25356
|
"quality"
|
|
25233
25357
|
);
|
|
25234
25358
|
const accept = request.headers.get("accept") ?? "";
|
|
25359
|
+
const negotiatedFormat = selectOutputFormat(accept, config.formats) ?? "";
|
|
25235
25360
|
const cacheKey = `${sourceUrl.href}
|
|
25236
25361
|
${width}
|
|
25237
25362
|
${quality}
|
|
25238
|
-
${
|
|
25363
|
+
${negotiatedFormat}`;
|
|
25239
25364
|
let optimized = cache.get(cacheKey);
|
|
25240
25365
|
if (!optimized) {
|
|
25241
25366
|
const fetchedSource = await fetchImageSource(
|
|
@@ -25262,7 +25387,8 @@ ${accept}`;
|
|
|
25262
25387
|
quality,
|
|
25263
25388
|
accept,
|
|
25264
25389
|
formats: config.formats,
|
|
25265
|
-
signal: request.signal
|
|
25390
|
+
signal: request.signal,
|
|
25391
|
+
maximumResponseBody: config.maximumResponseBody
|
|
25266
25392
|
});
|
|
25267
25393
|
throwIfAborted2(request.signal);
|
|
25268
25394
|
validateTransformedResult(result, config);
|
|
@@ -25593,7 +25719,7 @@ function throwIfAborted2(signal) {
|
|
|
25593
25719
|
function isAbortError(error) {
|
|
25594
25720
|
return error instanceof Error && error.name === "AbortError";
|
|
25595
25721
|
}
|
|
25596
|
-
var _FarmImageRequestError, FarmImageRequestError, _FarmImageMemoryCache, FarmImageMemoryCache;
|
|
25722
|
+
var _FarmImageRequestError, FarmImageRequestError, DEFAULT_IMAGE_TRANSFORM_BODY_LIMIT, _FarmImageMemoryCache, FarmImageMemoryCache;
|
|
25597
25723
|
var init_image_server = __esm({
|
|
25598
25724
|
"src/image-server.ts"() {
|
|
25599
25725
|
"use strict";
|
|
@@ -25609,6 +25735,7 @@ var init_image_server = __esm({
|
|
|
25609
25735
|
__name(_FarmImageRequestError, "FarmImageRequestError");
|
|
25610
25736
|
FarmImageRequestError = _FarmImageRequestError;
|
|
25611
25737
|
__name(createFarmImageHandler, "createFarmImageHandler");
|
|
25738
|
+
DEFAULT_IMAGE_TRANSFORM_BODY_LIMIT = 10 * 1024 * 1024;
|
|
25612
25739
|
__name(selectOutputFormat, "selectOutputFormat");
|
|
25613
25740
|
__name(isPrivateImageAddress, "isPrivateImageAddress");
|
|
25614
25741
|
__name(parseAllowedInteger, "parseAllowedInteger");
|