@farm.js/core 0.1.0-beta.16 → 0.1.0-beta.17
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.d.mts +25 -0
- package/dist/after.d.ts +25 -0
- package/dist/agent-runtime.d.mts +96 -0
- package/dist/agent-runtime.d.ts +96 -0
- package/dist/api/route-manager.d.mts +66 -0
- package/dist/api/route-manager.d.ts +66 -0
- package/dist/api/runtime.d.mts +3 -0
- package/dist/api/runtime.d.ts +3 -0
- package/dist/api.d.mts +48 -0
- package/dist/api.d.ts +48 -0
- package/dist/app-B0tE1I3o.d.ts +306 -0
- package/dist/app-Dv2JJb7X.d.mts +306 -0
- package/dist/app-markdown.d.mts +24 -0
- package/dist/app-markdown.d.ts +24 -0
- package/dist/cache.d.mts +192 -0
- package/dist/cache.d.ts +192 -0
- package/dist/{chunk-AN3PQVKH.mjs → chunk-2FLBZFPG.mjs} +9 -7
- package/dist/chunk-2FLBZFPG.mjs.map +1 -0
- package/dist/chunk-E257KFBU.mjs +227 -0
- package/dist/chunk-E257KFBU.mjs.map +1 -0
- package/dist/{chunk-SLDBGSC3.mjs → chunk-JAEAE27K.mjs} +2 -2
- package/dist/{chunk-T2KL7VEL.mjs → chunk-PZXBQKCH.mjs} +13 -4
- package/dist/chunk-PZXBQKCH.mjs.map +1 -0
- package/dist/{chunk-UXUAWNO5.mjs → chunk-RIXKJPGI.mjs} +117 -55
- package/dist/chunk-RIXKJPGI.mjs.map +1 -0
- package/dist/{chunk-OSWV5IJB.mjs → chunk-T2M5QANG.mjs} +32 -9
- package/dist/chunk-T2M5QANG.mjs.map +1 -0
- package/dist/{chunk-BWJC5ZOD.mjs → chunk-VFDBC3W7.mjs} +2 -2
- package/dist/{chunk-BWJC5ZOD.mjs.map → chunk-VFDBC3W7.mjs.map} +1 -1
- package/dist/chunk-recovery-lnQFzcQP.d.mts +26 -0
- package/dist/chunk-recovery-lnQFzcQP.d.ts +26 -0
- package/dist/client-BT1mFQas.d.mts +447 -0
- package/dist/client-Nn0q4eO4.d.ts +447 -0
- package/dist/client-cache-CIlyBlmx.d.ts +6 -0
- package/dist/client-cache-D-EZ7XVW.d.mts +6 -0
- package/dist/client-plugins-278AvYHE.d.mts +2021 -0
- package/dist/client-plugins-CTQAkr7R.d.ts +2021 -0
- package/dist/client-plugins.d.mts +24 -0
- package/dist/client-plugins.d.ts +24 -0
- package/dist/client.d.mts +452 -0
- package/dist/client.d.ts +452 -0
- package/dist/config.d.mts +31 -0
- package/dist/config.d.ts +31 -0
- package/dist/cron.d.mts +78 -0
- package/dist/cron.d.ts +78 -0
- package/dist/deferred.d.mts +42 -0
- package/dist/deferred.d.ts +42 -0
- package/dist/deployment.d.mts +36 -0
- package/dist/deployment.d.ts +36 -0
- package/dist/{devtools-E4YNCY5J.mjs → devtools-K2ERKGNI.mjs} +3 -3
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.d.mts +80 -0
- package/dist/docs.d.ts +80 -0
- package/dist/docs.mjs +3 -3
- package/dist/env-types.d.mts +12 -0
- package/dist/env-types.d.ts +12 -0
- package/dist/env.d.mts +45 -0
- package/dist/env.d.ts +45 -0
- package/dist/environment/vite.d.mts +22 -0
- package/dist/environment/vite.d.ts +22 -0
- package/dist/environment.d.mts +18 -0
- package/dist/environment.d.ts +18 -0
- package/dist/font.d.mts +95 -0
- package/dist/font.d.ts +95 -0
- package/dist/headers.d.mts +22 -0
- package/dist/headers.d.ts +22 -0
- package/dist/i18n/client.d.mts +32 -0
- package/dist/i18n/client.d.ts +32 -0
- package/dist/i18n/index.d.mts +20 -0
- package/dist/i18n/index.d.ts +20 -0
- package/dist/i18n/server.d.mts +30 -0
- package/dist/i18n/server.d.ts +30 -0
- package/dist/image/server.d.mts +37 -0
- package/dist/image/server.d.ts +37 -0
- package/dist/image/sharp.d.mts +7 -0
- package/dist/image/sharp.d.ts +7 -0
- package/dist/image-config-Duob7wER.d.mts +50 -0
- package/dist/image-config-Duob7wER.d.ts +50 -0
- package/dist/image.d.mts +39 -0
- package/dist/image.d.ts +39 -0
- package/dist/index.cjs +293 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +477 -0
- package/dist/index.d.ts +477 -0
- package/dist/index.mjs +22 -18
- package/dist/index.mjs.map +1 -1
- package/dist/integration-api-CHT2OKAf.d.mts +93 -0
- package/dist/integration-api-CHT2OKAf.d.ts +93 -0
- package/dist/integrations.d.mts +24 -0
- package/dist/integrations.d.ts +24 -0
- package/dist/internal/build-runtime.cjs +306 -137
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +41 -0
- package/dist/internal/build-runtime.d.ts +41 -0
- package/dist/internal/build-runtime.mjs +7 -7
- package/dist/internal/client-runtime.d.mts +17 -0
- package/dist/internal/client-runtime.d.ts +17 -0
- package/dist/internal/config-runtime.cjs +140 -1
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +41 -0
- package/dist/internal/config-runtime.d.ts +41 -0
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/metadata-image-runtime.d.mts +25 -0
- package/dist/internal/metadata-image-runtime.d.ts +25 -0
- package/dist/internal/production-node-env.d.mts +12 -0
- package/dist/internal/production-node-env.d.ts +12 -0
- package/dist/internal/production-runtime.d.mts +44 -0
- package/dist/internal/production-runtime.d.ts +44 -0
- package/dist/island-CfGru1MO.d.mts +9 -0
- package/dist/island-CfGru1MO.d.ts +9 -0
- package/dist/markdown.d.mts +60 -0
- package/dist/markdown.d.ts +60 -0
- package/dist/metadata-DmCudMw_.d.mts +22 -0
- package/dist/metadata-xghtOlbR.d.ts +22 -0
- package/dist/middleware.cjs +116 -98
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.mts +171 -0
- package/dist/middleware.d.ts +171 -0
- package/dist/middleware.mjs +5 -2
- package/dist/navigation-errors-Dvwpzaer.d.mts +13 -0
- package/dist/navigation-errors-Dvwpzaer.d.ts +13 -0
- package/dist/navigation.d.mts +14 -0
- package/dist/navigation.d.ts +14 -0
- package/dist/observability.d.mts +335 -0
- package/dist/observability.d.ts +335 -0
- package/dist/params-BALtrRim.d.ts +15 -0
- package/dist/params-ry-lxqmy.d.mts +15 -0
- package/dist/plugin-BJDf43dc.d.mts +165 -0
- package/dist/plugin-BJDf43dc.d.ts +165 -0
- package/dist/plugin.cjs +132 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +24 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/plugin.mjs +4 -4
- package/dist/production-runtime-BLxSv9cU.d.ts +79 -0
- package/dist/production-runtime-DFN2_RXq.d.mts +79 -0
- package/dist/query/client.d.mts +61 -0
- package/dist/query/client.d.ts +61 -0
- package/dist/query/index.d.mts +90 -0
- package/dist/query/index.d.ts +90 -0
- package/dist/query/parsers.d.mts +25 -0
- package/dist/query/parsers.d.ts +25 -0
- package/dist/query/server.d.mts +55 -0
- package/dist/query/server.d.ts +55 -0
- package/dist/request-Cq5d6qmE.d.mts +6 -0
- package/dist/request-LoxDW3lp.d.ts +6 -0
- package/dist/request.d.mts +25 -0
- package/dist/request.d.ts +25 -0
- package/dist/resolver-DJqjLMg_.d.mts +14 -0
- package/dist/resolver-IH4RmPEl.d.ts +14 -0
- package/dist/route-runtime-DoOHzCAD.d.mts +38 -0
- package/dist/route-runtime-DoOHzCAD.d.ts +38 -0
- package/dist/router.d.mts +36 -0
- package/dist/router.d.ts +36 -0
- package/dist/routes.d.mts +226 -0
- package/dist/routes.d.ts +226 -0
- package/dist/runtime-BA9TOSu1.d.mts +231 -0
- package/dist/runtime-Cxpq6xZN.d.mts +27 -0
- package/dist/runtime-DTAQ2HDv.d.ts +231 -0
- package/dist/runtime-bv63eUiO.d.ts +27 -0
- package/dist/server-action-security.d.mts +45 -0
- package/dist/server-action-security.d.ts +45 -0
- package/dist/server-fn-client.d.mts +33 -0
- package/dist/server-fn-client.d.ts +33 -0
- package/dist/server-fn-error-DDh14a0V.d.mts +26 -0
- package/dist/server-fn-error-DDh14a0V.d.ts +26 -0
- package/dist/server-fn.d.mts +121 -0
- package/dist/server-fn.d.ts +121 -0
- package/dist/server-plugins.d.mts +57 -0
- package/dist/server-plugins.d.ts +57 -0
- package/dist/server-query-client.d.mts +51 -0
- package/dist/server-query-client.d.ts +51 -0
- package/dist/server-query.d.mts +37 -0
- package/dist/server-query.d.ts +37 -0
- package/dist/server.cjs +170 -3
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +51 -0
- package/dist/server.d.ts +51 -0
- package/dist/server.mjs +6 -6
- package/dist/storage.d.mts +52 -0
- package/dist/storage.d.ts +52 -0
- package/dist/testing.d.mts +103 -0
- package/dist/testing.d.ts +103 -0
- package/dist/transport-BmbGTXA5.d.mts +49 -0
- package/dist/transport-BmbGTXA5.d.ts +49 -0
- package/dist/types-BMxWr97v.d.mts +81 -0
- package/dist/types-BMxWr97v.d.ts +81 -0
- package/dist/types-D1A6-XvH.d.mts +73 -0
- package/dist/types-D1A6-XvH.d.ts +73 -0
- package/dist/types-DTzm4TCl.d.mts +78 -0
- package/dist/types-DTzm4TCl.d.ts +78 -0
- package/dist/utils-B6GaYNJL.d.ts +23 -0
- package/dist/utils-CKSHiip6.d.mts +23 -0
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.mts +3 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +140 -2
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +24 -0
- package/dist/vite.d.ts +24 -0
- package/dist/vite.mjs +4 -4
- package/dist/workflows.d.mts +110 -0
- package/dist/workflows.d.ts +110 -0
- package/package.json +1 -1
- package/types/middleware.d.ts +36 -11
- package/dist/chunk-AN3PQVKH.mjs.map +0 -1
- package/dist/chunk-I4CUBGVF.mjs +0 -93
- package/dist/chunk-I4CUBGVF.mjs.map +0 -1
- package/dist/chunk-OSWV5IJB.mjs.map +0 -1
- package/dist/chunk-T2KL7VEL.mjs.map +0 -1
- package/dist/chunk-UXUAWNO5.mjs.map +0 -1
- /package/dist/{chunk-SLDBGSC3.mjs.map → chunk-JAEAE27K.mjs.map} +0 -0
- /package/dist/{devtools-E4YNCY5J.mjs.map → devtools-K2ERKGNI.mjs.map} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-Dv2JJb7X.mjs';
|
|
2
|
+
import { F as FarmConfig } from './client-plugins-278AvYHE.mjs';
|
|
3
|
+
export { A as AppRoutePattern, D as BuildOptions, r as ErrorBoundary, E as ErrorProps, h as FarmAppContext, g as FarmContextFactory, e as FarmContextFactoryInput, J as FarmLayerEntry, T as FarmLayerResolution, a as FarmMigrationCommand, b as FarmMigrationsConfig, c as FarmMigrationsUserConfig, x as FarmRequest, y as FarmResponse, O as FarmSourceRoot, G as GenerateStaticParams, p as Layout, n as LayoutMetadataProps, v as LayoutModule, l as LayoutProps, q as Loading, L as LoadingProps, w as Metadata, m as MetadataProps, M as MiddlewareProps, N as NitroPreset, o as Page, j as PageProps, k as PagePropsWithMiddleware, P as PageRouteParams, C as ParsedRoute, i as PluginContextProps, Q as ResolveFarmLayersOptions, K as ResolvedFarmLayer, R as ResolvedFarmMigrationsConfig, s as RouteModule, B as RouteSegment, I as SSGCollectionResult, H as SSGPage, z as ServerAction, t as StaticPathParams, S as StaticPathPrimitive, u as StaticRouteParams, d as defineConfig, f as farmPlugin, W as getFarmAppDirectories, X as getFarmLayerAliases, V as getFarmSourceRoots, Y as loadFarmConfigFile, U as resolveFarmLayers } from './client-plugins-278AvYHE.mjs';
|
|
4
|
+
export { f as fileExists, g as globFiles, l as logger, m as matchRoute, p as parseRoutePath, a as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, t as toViteModuleId } from './utils-CKSHiip6.mjs';
|
|
5
|
+
export { createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage } from './storage.mjs';
|
|
6
|
+
export { CacheKeyFactory, DefinedCacheKey, FarmCacheAdapter, FarmCacheEntry, FarmCacheInvalidationTarget, FarmCacheOptions, FarmCacheSetOptions, FarmCacheStorage, FarmCacheUserConfig, FarmDataCache, GetFarmCacheEntryOptions, InferCacheKeyData, RevalidateTagProfile, RouteDataCacheKey, StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag } from './cache.mjs';
|
|
7
|
+
export { AfterCallback, FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after } from './after.mjs';
|
|
8
|
+
export { FARM_SERVER_QUERY_SYMBOL, ServerQuery, ServerQueryKey, ServerQueryOptions, ServerQueryOutputOptions, ServerQueryStaleTime, createServerQuery } from './server-query.mjs';
|
|
9
|
+
import { ViteDevServer } from 'vite';
|
|
10
|
+
export { g as getCurrentRequest } from './request-Cq5d6qmE.mjs';
|
|
11
|
+
export { DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, FarmServerActionsConfig, PreparedServerActionRequest, ResolvedFarmServerActionsConfig, SanitizedServerActionError, ServerActionRequestError, ServerActionRequestKind, createServerActionRequestErrorResponse, getServerActionExecutionContext, getServerActionInvalidations, getServerActionSignal, prepareServerActionRequest, resolveServerActionsConfig, runWithServerActionRequest, sanitizeServerActionError, validateServerActionRequest } from './server-action-security.mjs';
|
|
12
|
+
export { FarmEnvironment, FarmEnvironmentError, FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn } from './environment.mjs';
|
|
13
|
+
export { F as FarmStorageBuiltinDriverConfig, a as FarmStorageClient, b as FarmStorageClientConfig, c as FarmStorageConfigObject, d as FarmStorageCustomDriverConfig, e as FarmStorageDatabaseConfig, f as FarmStorageDatabaseDriverName, g as FarmStorageLocalDriverConfig, i as FarmStorageMountConfig, j as FarmStorageMounts, h as FarmStorageRuntimeClient, k as FarmStorageUserConfig } from './types-D1A6-XvH.mjs';
|
|
14
|
+
export { BuiltinDriverName, BuiltinDriverOptions, Driver, Storage, StorageMeta, StorageValue, TransactionOptions } from 'unstorage';
|
|
15
|
+
export { ConnectorName, ConnectorOptions, Database } from 'db0';
|
|
16
|
+
import './types-DTzm4TCl.mjs';
|
|
17
|
+
import '@farming-labs/docs';
|
|
18
|
+
import './markdown.mjs';
|
|
19
|
+
import './workflows.mjs';
|
|
20
|
+
import './cron.mjs';
|
|
21
|
+
import './image-config-Duob7wER.mjs';
|
|
22
|
+
import './routes.mjs';
|
|
23
|
+
import './route-runtime-DoOHzCAD.mjs';
|
|
24
|
+
import 'react';
|
|
25
|
+
import './metadata-DmCudMw_.mjs';
|
|
26
|
+
import './island-CfGru1MO.mjs';
|
|
27
|
+
import './types-BMxWr97v.mjs';
|
|
28
|
+
import './runtime-Cxpq6xZN.mjs';
|
|
29
|
+
import './resolver-DJqjLMg_.mjs';
|
|
30
|
+
import './plugin-BJDf43dc.mjs';
|
|
31
|
+
import 'http';
|
|
32
|
+
import './integration-api-CHT2OKAf.mjs';
|
|
33
|
+
import '@farming-labs/orm';
|
|
34
|
+
import './observability.mjs';
|
|
35
|
+
import './env.mjs';
|
|
36
|
+
import './font.mjs';
|
|
37
|
+
import 'node:http';
|
|
38
|
+
import './server-fn.mjs';
|
|
39
|
+
import './server-fn-error-DDh14a0V.mjs';
|
|
40
|
+
|
|
41
|
+
declare const DEFAULT_FARM_DEV_SERVER_PORT = 3000;
|
|
42
|
+
/**
|
|
43
|
+
* Create a Vite development server with Farm.js integration
|
|
44
|
+
*/
|
|
45
|
+
declare function createServer(config?: FarmConfig): Promise<ViteDevServer>;
|
|
46
|
+
/**
|
|
47
|
+
* Start the development server
|
|
48
|
+
*/
|
|
49
|
+
declare function startDevServer(config?: FarmConfig, port?: number): Promise<ViteDevServer>;
|
|
50
|
+
|
|
51
|
+
export { DEFAULT_FARM_DEV_SERVER_PORT, FarmConfig, createServer, startDevServer };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-B0tE1I3o.js';
|
|
2
|
+
import { F as FarmConfig } from './client-plugins-CTQAkr7R.js';
|
|
3
|
+
export { A as AppRoutePattern, D as BuildOptions, r as ErrorBoundary, E as ErrorProps, h as FarmAppContext, g as FarmContextFactory, e as FarmContextFactoryInput, J as FarmLayerEntry, T as FarmLayerResolution, a as FarmMigrationCommand, b as FarmMigrationsConfig, c as FarmMigrationsUserConfig, x as FarmRequest, y as FarmResponse, O as FarmSourceRoot, G as GenerateStaticParams, p as Layout, n as LayoutMetadataProps, v as LayoutModule, l as LayoutProps, q as Loading, L as LoadingProps, w as Metadata, m as MetadataProps, M as MiddlewareProps, N as NitroPreset, o as Page, j as PageProps, k as PagePropsWithMiddleware, P as PageRouteParams, C as ParsedRoute, i as PluginContextProps, Q as ResolveFarmLayersOptions, K as ResolvedFarmLayer, R as ResolvedFarmMigrationsConfig, s as RouteModule, B as RouteSegment, I as SSGCollectionResult, H as SSGPage, z as ServerAction, t as StaticPathParams, S as StaticPathPrimitive, u as StaticRouteParams, d as defineConfig, f as farmPlugin, W as getFarmAppDirectories, X as getFarmLayerAliases, V as getFarmSourceRoots, Y as loadFarmConfigFile, U as resolveFarmLayers } from './client-plugins-CTQAkr7R.js';
|
|
4
|
+
export { f as fileExists, g as globFiles, l as logger, m as matchRoute, p as parseRoutePath, a as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, t as toViteModuleId } from './utils-B6GaYNJL.js';
|
|
5
|
+
export { createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage } from './storage.js';
|
|
6
|
+
export { CacheKeyFactory, DefinedCacheKey, FarmCacheAdapter, FarmCacheEntry, FarmCacheInvalidationTarget, FarmCacheOptions, FarmCacheSetOptions, FarmCacheStorage, FarmCacheUserConfig, FarmDataCache, GetFarmCacheEntryOptions, InferCacheKeyData, RevalidateTagProfile, RouteDataCacheKey, StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag } from './cache.js';
|
|
7
|
+
export { AfterCallback, FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after } from './after.js';
|
|
8
|
+
export { FARM_SERVER_QUERY_SYMBOL, ServerQuery, ServerQueryKey, ServerQueryOptions, ServerQueryOutputOptions, ServerQueryStaleTime, createServerQuery } from './server-query.js';
|
|
9
|
+
import { ViteDevServer } from 'vite';
|
|
10
|
+
export { g as getCurrentRequest } from './request-LoxDW3lp.js';
|
|
11
|
+
export { DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, FarmServerActionsConfig, PreparedServerActionRequest, ResolvedFarmServerActionsConfig, SanitizedServerActionError, ServerActionRequestError, ServerActionRequestKind, createServerActionRequestErrorResponse, getServerActionExecutionContext, getServerActionInvalidations, getServerActionSignal, prepareServerActionRequest, resolveServerActionsConfig, runWithServerActionRequest, sanitizeServerActionError, validateServerActionRequest } from './server-action-security.js';
|
|
12
|
+
export { FarmEnvironment, FarmEnvironmentError, FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn } from './environment.js';
|
|
13
|
+
export { F as FarmStorageBuiltinDriverConfig, a as FarmStorageClient, b as FarmStorageClientConfig, c as FarmStorageConfigObject, d as FarmStorageCustomDriverConfig, e as FarmStorageDatabaseConfig, f as FarmStorageDatabaseDriverName, g as FarmStorageLocalDriverConfig, i as FarmStorageMountConfig, j as FarmStorageMounts, h as FarmStorageRuntimeClient, k as FarmStorageUserConfig } from './types-D1A6-XvH.js';
|
|
14
|
+
export { BuiltinDriverName, BuiltinDriverOptions, Driver, Storage, StorageMeta, StorageValue, TransactionOptions } from 'unstorage';
|
|
15
|
+
export { ConnectorName, ConnectorOptions, Database } from 'db0';
|
|
16
|
+
import './types-DTzm4TCl.js';
|
|
17
|
+
import '@farming-labs/docs';
|
|
18
|
+
import './markdown.js';
|
|
19
|
+
import './workflows.js';
|
|
20
|
+
import './cron.js';
|
|
21
|
+
import './image-config-Duob7wER.js';
|
|
22
|
+
import './routes.js';
|
|
23
|
+
import './route-runtime-DoOHzCAD.js';
|
|
24
|
+
import 'react';
|
|
25
|
+
import './metadata-xghtOlbR.js';
|
|
26
|
+
import './island-CfGru1MO.js';
|
|
27
|
+
import './types-BMxWr97v.js';
|
|
28
|
+
import './runtime-bv63eUiO.js';
|
|
29
|
+
import './resolver-IH4RmPEl.js';
|
|
30
|
+
import './plugin-BJDf43dc.js';
|
|
31
|
+
import 'http';
|
|
32
|
+
import './integration-api-CHT2OKAf.js';
|
|
33
|
+
import '@farming-labs/orm';
|
|
34
|
+
import './observability.js';
|
|
35
|
+
import './env.js';
|
|
36
|
+
import './font.js';
|
|
37
|
+
import 'node:http';
|
|
38
|
+
import './server-fn.js';
|
|
39
|
+
import './server-fn-error-DDh14a0V.js';
|
|
40
|
+
|
|
41
|
+
declare const DEFAULT_FARM_DEV_SERVER_PORT = 3000;
|
|
42
|
+
/**
|
|
43
|
+
* Create a Vite development server with Farm.js integration
|
|
44
|
+
*/
|
|
45
|
+
declare function createServer(config?: FarmConfig): Promise<ViteDevServer>;
|
|
46
|
+
/**
|
|
47
|
+
* Start the development server
|
|
48
|
+
*/
|
|
49
|
+
declare function startDevServer(config?: FarmConfig, port?: number): Promise<ViteDevServer>;
|
|
50
|
+
|
|
51
|
+
export { DEFAULT_FARM_DEV_SERVER_PORT, FarmConfig, createServer, startDevServer };
|
package/dist/server.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import "./chunk-VPCFICID.mjs";
|
|
|
12
12
|
import {
|
|
13
13
|
loadConfig,
|
|
14
14
|
resolveConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PZXBQKCH.mjs";
|
|
16
16
|
import "./chunk-UVCIEUJC.mjs";
|
|
17
17
|
import {
|
|
18
18
|
PluginManager
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
farmI18nClientBridgePlugin,
|
|
31
31
|
farmPlugin,
|
|
32
32
|
mergeFarmViteConfig
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-T2M5QANG.mjs";
|
|
34
34
|
import "./chunk-LGHEOHBU.mjs";
|
|
35
35
|
import "./chunk-FRPWCMMG.mjs";
|
|
36
36
|
import "./chunk-53MVSX3R.mjs";
|
|
@@ -44,7 +44,7 @@ import "./chunk-USWZZUEH.mjs";
|
|
|
44
44
|
import "./chunk-XMFTIVJH.mjs";
|
|
45
45
|
import "./chunk-7HO6AEOP.mjs";
|
|
46
46
|
import "./chunk-USLFXFFH.mjs";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-E257KFBU.mjs";
|
|
48
48
|
import "./chunk-7MABZJIM.mjs";
|
|
49
49
|
import "./chunk-YW7OBE6Q.mjs";
|
|
50
50
|
import {
|
|
@@ -74,8 +74,6 @@ import "./chunk-7FBJLMQH.mjs";
|
|
|
74
74
|
import "./chunk-XIVV5IWN.mjs";
|
|
75
75
|
import "./chunk-GXASWWJU.mjs";
|
|
76
76
|
import "./chunk-K4667E2Q.mjs";
|
|
77
|
-
import "./chunk-MIUW47JX.mjs";
|
|
78
|
-
import "./chunk-P7QDS5AT.mjs";
|
|
79
77
|
import {
|
|
80
78
|
createFarmStorage,
|
|
81
79
|
createStorageClient,
|
|
@@ -104,6 +102,8 @@ import {
|
|
|
104
102
|
vercelBlobStorage,
|
|
105
103
|
vercelKVStorage
|
|
106
104
|
} from "./chunk-T4QJQK76.mjs";
|
|
105
|
+
import "./chunk-MIUW47JX.mjs";
|
|
106
|
+
import "./chunk-P7QDS5AT.mjs";
|
|
107
107
|
import {
|
|
108
108
|
_runWithAfterNodeResponse,
|
|
109
109
|
_runWithAfterRequest,
|
|
@@ -136,7 +136,7 @@ import {
|
|
|
136
136
|
import "./chunk-LM2YNO4U.mjs";
|
|
137
137
|
import {
|
|
138
138
|
FARM_VERSION
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-VFDBC3W7.mjs";
|
|
140
140
|
import "./chunk-B3FFOIWS.mjs";
|
|
141
141
|
import "./chunk-ITN462YM.mjs";
|
|
142
142
|
import "./chunk-3HIVDX7J.mjs";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Driver, Storage } from 'unstorage';
|
|
2
|
+
export { BuiltinDriverName, BuiltinDriverOptions, Driver, Storage, StorageMeta, StorageValue, TransactionOptions } from 'unstorage';
|
|
3
|
+
import { Database } from 'db0';
|
|
4
|
+
export { ConnectorName, ConnectorOptions, Database } from 'db0';
|
|
5
|
+
import { a as FarmStorageClient, b as FarmStorageClientConfig, g as FarmStorageLocalDriverConfig, e as FarmStorageDatabaseConfig, k as FarmStorageUserConfig } from './types-D1A6-XvH.mjs';
|
|
6
|
+
export { F as FarmStorageBuiltinDriverConfig, c as FarmStorageConfigObject, d as FarmStorageCustomDriverConfig, f as FarmStorageDatabaseDriverName, i as FarmStorageMountConfig, j as FarmStorageMounts, h as FarmStorageRuntimeClient } from './types-D1A6-XvH.mjs';
|
|
7
|
+
|
|
8
|
+
type DriverResolver = () => Driver | Promise<Driver>;
|
|
9
|
+
declare function defineStorageClient(resolveDriver: DriverResolver): FarmStorageClient;
|
|
10
|
+
declare function createStorageClient(config: FarmStorageClientConfig): FarmStorageClient;
|
|
11
|
+
declare function driverStorage(driver: Driver | (() => Driver | Promise<Driver>)): FarmStorageClient;
|
|
12
|
+
declare function databaseStorage(database: Database, options?: {
|
|
13
|
+
tableName?: string;
|
|
14
|
+
}): FarmStorageClient;
|
|
15
|
+
declare function memoryStorage(): FarmStorageClient;
|
|
16
|
+
declare function localStorage(options?: Omit<FarmStorageLocalDriverConfig, "driver">): FarmStorageClient;
|
|
17
|
+
declare function sqliteStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
18
|
+
declare function mysqlStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
19
|
+
declare function mysql2Storage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
20
|
+
declare function postgresStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
21
|
+
declare function pgStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
22
|
+
declare function pgliteStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
23
|
+
declare function planetscaleStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
24
|
+
declare function libsqlStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
25
|
+
declare function redisStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
26
|
+
driver: "redis";
|
|
27
|
+
}>, "driver">): FarmStorageClient;
|
|
28
|
+
declare function s3Storage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
29
|
+
driver: "s3";
|
|
30
|
+
}>, "driver">): FarmStorageClient;
|
|
31
|
+
declare function mongodbStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
32
|
+
driver: "mongodb";
|
|
33
|
+
}>, "driver">): FarmStorageClient;
|
|
34
|
+
declare function upstashStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
35
|
+
driver: "upstash";
|
|
36
|
+
}>, "driver">): FarmStorageClient;
|
|
37
|
+
declare function netlifyBlobsStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
38
|
+
driver: "netlify-blobs";
|
|
39
|
+
}>, "driver">): FarmStorageClient;
|
|
40
|
+
declare function vercelKVStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
41
|
+
driver: "vercel-kv";
|
|
42
|
+
}>, "driver">): FarmStorageClient;
|
|
43
|
+
declare function vercelBlobStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
44
|
+
driver: "vercel-blob";
|
|
45
|
+
}>, "driver">): FarmStorageClient;
|
|
46
|
+
declare function createFarmStorage(config?: FarmStorageUserConfig): Promise<Storage>;
|
|
47
|
+
declare function resolveStorageRuntimeClient(config: FarmStorageUserConfig | undefined): Promise<unknown | undefined>;
|
|
48
|
+
declare function initStorage(config?: FarmStorageUserConfig): Promise<Storage>;
|
|
49
|
+
declare function getStorage(namespace?: string): Storage;
|
|
50
|
+
declare function disposeStorage(): Promise<void>;
|
|
51
|
+
|
|
52
|
+
export { FarmStorageClient, FarmStorageClientConfig, FarmStorageDatabaseConfig, FarmStorageLocalDriverConfig, FarmStorageUserConfig, createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Driver, Storage } from 'unstorage';
|
|
2
|
+
export { BuiltinDriverName, BuiltinDriverOptions, Driver, Storage, StorageMeta, StorageValue, TransactionOptions } from 'unstorage';
|
|
3
|
+
import { Database } from 'db0';
|
|
4
|
+
export { ConnectorName, ConnectorOptions, Database } from 'db0';
|
|
5
|
+
import { a as FarmStorageClient, b as FarmStorageClientConfig, g as FarmStorageLocalDriverConfig, e as FarmStorageDatabaseConfig, k as FarmStorageUserConfig } from './types-D1A6-XvH.js';
|
|
6
|
+
export { F as FarmStorageBuiltinDriverConfig, c as FarmStorageConfigObject, d as FarmStorageCustomDriverConfig, f as FarmStorageDatabaseDriverName, i as FarmStorageMountConfig, j as FarmStorageMounts, h as FarmStorageRuntimeClient } from './types-D1A6-XvH.js';
|
|
7
|
+
|
|
8
|
+
type DriverResolver = () => Driver | Promise<Driver>;
|
|
9
|
+
declare function defineStorageClient(resolveDriver: DriverResolver): FarmStorageClient;
|
|
10
|
+
declare function createStorageClient(config: FarmStorageClientConfig): FarmStorageClient;
|
|
11
|
+
declare function driverStorage(driver: Driver | (() => Driver | Promise<Driver>)): FarmStorageClient;
|
|
12
|
+
declare function databaseStorage(database: Database, options?: {
|
|
13
|
+
tableName?: string;
|
|
14
|
+
}): FarmStorageClient;
|
|
15
|
+
declare function memoryStorage(): FarmStorageClient;
|
|
16
|
+
declare function localStorage(options?: Omit<FarmStorageLocalDriverConfig, "driver">): FarmStorageClient;
|
|
17
|
+
declare function sqliteStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
18
|
+
declare function mysqlStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
19
|
+
declare function mysql2Storage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
20
|
+
declare function postgresStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
21
|
+
declare function pgStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
22
|
+
declare function pgliteStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
23
|
+
declare function planetscaleStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
24
|
+
declare function libsqlStorage(options: Omit<FarmStorageDatabaseConfig, "driver">): FarmStorageClient;
|
|
25
|
+
declare function redisStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
26
|
+
driver: "redis";
|
|
27
|
+
}>, "driver">): FarmStorageClient;
|
|
28
|
+
declare function s3Storage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
29
|
+
driver: "s3";
|
|
30
|
+
}>, "driver">): FarmStorageClient;
|
|
31
|
+
declare function mongodbStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
32
|
+
driver: "mongodb";
|
|
33
|
+
}>, "driver">): FarmStorageClient;
|
|
34
|
+
declare function upstashStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
35
|
+
driver: "upstash";
|
|
36
|
+
}>, "driver">): FarmStorageClient;
|
|
37
|
+
declare function netlifyBlobsStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
38
|
+
driver: "netlify-blobs";
|
|
39
|
+
}>, "driver">): FarmStorageClient;
|
|
40
|
+
declare function vercelKVStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
41
|
+
driver: "vercel-kv";
|
|
42
|
+
}>, "driver">): FarmStorageClient;
|
|
43
|
+
declare function vercelBlobStorage(options: Omit<Extract<FarmStorageClientConfig, {
|
|
44
|
+
driver: "vercel-blob";
|
|
45
|
+
}>, "driver">): FarmStorageClient;
|
|
46
|
+
declare function createFarmStorage(config?: FarmStorageUserConfig): Promise<Storage>;
|
|
47
|
+
declare function resolveStorageRuntimeClient(config: FarmStorageUserConfig | undefined): Promise<unknown | undefined>;
|
|
48
|
+
declare function initStorage(config?: FarmStorageUserConfig): Promise<Storage>;
|
|
49
|
+
declare function getStorage(namespace?: string): Storage;
|
|
50
|
+
declare function disposeStorage(): Promise<void>;
|
|
51
|
+
|
|
52
|
+
export { FarmStorageClient, FarmStorageClientConfig, FarmStorageDatabaseConfig, FarmStorageLocalDriverConfig, FarmStorageUserConfig, createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import './types-BMxWr97v.mjs';
|
|
3
|
+
import { b as APIRouteParams } from './runtime-BA9TOSu1.mjs';
|
|
4
|
+
import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.mjs';
|
|
5
|
+
import { FarmRouterQueryValue, FarmRouterPathParams } from './router.mjs';
|
|
6
|
+
import { ServerFn } from './server-fn.mjs';
|
|
7
|
+
import { g as FarmContextFactory, M as MiddlewareProps, i as PluginContextProps, s as RouteModule } from './client-plugins-278AvYHE.mjs';
|
|
8
|
+
import './cache.mjs';
|
|
9
|
+
import './transport-BmbGTXA5.mjs';
|
|
10
|
+
import './route-runtime-DoOHzCAD.mjs';
|
|
11
|
+
import './plugin-BJDf43dc.mjs';
|
|
12
|
+
import 'http';
|
|
13
|
+
import './types-D1A6-XvH.mjs';
|
|
14
|
+
import 'db0';
|
|
15
|
+
import 'unstorage';
|
|
16
|
+
import './integration-api-CHT2OKAf.mjs';
|
|
17
|
+
import '@farming-labs/orm';
|
|
18
|
+
import './types-DTzm4TCl.mjs';
|
|
19
|
+
import '@farming-labs/docs';
|
|
20
|
+
import './markdown.mjs';
|
|
21
|
+
import './observability.mjs';
|
|
22
|
+
import 'vite';
|
|
23
|
+
import './workflows.mjs';
|
|
24
|
+
import './cron.mjs';
|
|
25
|
+
import './env.mjs';
|
|
26
|
+
import './server-action-security.mjs';
|
|
27
|
+
import './server-fn-error-DDh14a0V.mjs';
|
|
28
|
+
import './image-config-Duob7wER.mjs';
|
|
29
|
+
import './font.mjs';
|
|
30
|
+
|
|
31
|
+
type FarmTestQuery = URLSearchParams | Record<string, FarmRouterQueryValue>;
|
|
32
|
+
type FarmTestPathParams = FarmRouterPathParams;
|
|
33
|
+
type FarmTestFormValues = Record<string, FormDataEntryValue | readonly FormDataEntryValue[]>;
|
|
34
|
+
interface FarmTestRequestOptions extends Omit<RequestInit, "body" | "headers"> {
|
|
35
|
+
origin?: string;
|
|
36
|
+
headers?: HeadersInit;
|
|
37
|
+
query?: FarmTestQuery;
|
|
38
|
+
cookies?: Record<string, string>;
|
|
39
|
+
json?: unknown;
|
|
40
|
+
form?: FormData | FarmTestFormValues;
|
|
41
|
+
body?: BodyInit | null;
|
|
42
|
+
}
|
|
43
|
+
interface FarmTestHarnessOptions<TContext = unknown> {
|
|
44
|
+
origin?: string;
|
|
45
|
+
headers?: HeadersInit;
|
|
46
|
+
cookies?: Record<string, string>;
|
|
47
|
+
context?: FarmContextFactory<TContext>;
|
|
48
|
+
}
|
|
49
|
+
type AnyProgrammaticPageRoute = ProgrammaticPageRoute<any, any, any, any>;
|
|
50
|
+
type InferFarmTestRouteParams<TRoute> = TRoute extends ProgrammaticPageRoute<infer TParams, any, any, any> ? TParams : never;
|
|
51
|
+
type InferFarmTestRouteSearch<TRoute> = TRoute extends ProgrammaticPageRoute<any, infer TSearch, any, any> ? TSearch : never;
|
|
52
|
+
type InferFarmTestRouteData<TRoute> = TRoute extends ProgrammaticPageRoute<any, any, infer TDataHooks, any> ? InferProgrammaticRouteData<TDataHooks> : never;
|
|
53
|
+
type FarmTestRouteProps<TRoute extends AnyProgrammaticPageRoute> = ProgrammaticRouteComponentProps<InferFarmTestRouteParams<TRoute>, InferFarmTestRouteSearch<TRoute>, InferFarmTestRouteData<TRoute>>;
|
|
54
|
+
type FarmTestRouteParamsInput<TRoute> = InferFarmTestRouteParams<TRoute> extends Record<string, unknown> ? Partial<InferFarmTestRouteParams<TRoute>> : FarmTestPathParams;
|
|
55
|
+
type FarmTestRouteSearchInput<TRoute> = InferFarmTestRouteSearch<TRoute> extends Record<string, unknown> ? Partial<InferFarmTestRouteSearch<TRoute>> | URLSearchParams : FarmTestQuery;
|
|
56
|
+
interface FarmTestRouteOptions<TRoute extends AnyProgrammaticPageRoute, TContext = unknown> extends Pick<FarmTestRequestOptions, "origin" | "headers" | "cookies" | "signal"> {
|
|
57
|
+
path?: string | URL;
|
|
58
|
+
params?: FarmTestRouteParamsInput<TRoute>;
|
|
59
|
+
search?: FarmTestRouteSearchInput<TRoute>;
|
|
60
|
+
context?: TContext;
|
|
61
|
+
middleware?: MiddlewareProps;
|
|
62
|
+
pluginContext?: PluginContextProps;
|
|
63
|
+
}
|
|
64
|
+
interface FarmTestRouteResult<TRoute extends AnyProgrammaticPageRoute> {
|
|
65
|
+
route: TRoute;
|
|
66
|
+
module: RouteModule;
|
|
67
|
+
request: Request;
|
|
68
|
+
props: FarmTestRouteProps<TRoute>;
|
|
69
|
+
element: ReactElement;
|
|
70
|
+
canonicalPath?: string;
|
|
71
|
+
}
|
|
72
|
+
interface FarmTestApiOptions extends FarmTestRequestOptions {
|
|
73
|
+
path?: string | URL;
|
|
74
|
+
params?: FarmTestPathParams;
|
|
75
|
+
throwOnError?: boolean;
|
|
76
|
+
}
|
|
77
|
+
interface FarmTestEndpointOptions extends FarmTestRequestOptions {
|
|
78
|
+
path?: string | URL;
|
|
79
|
+
params?: APIRouteParams;
|
|
80
|
+
throwOnError?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface FarmTestServerFnOptions extends Pick<FarmTestRequestOptions, "origin" | "headers" | "cookies" | "signal"> {
|
|
83
|
+
path?: string | URL;
|
|
84
|
+
request?: Request;
|
|
85
|
+
}
|
|
86
|
+
type FarmTestServerFnArguments<TInput> = [unknown] extends [TInput] ? [input?: TInput | FormData, options?: FarmTestServerFnOptions] : [input: TInput | FormData, options?: FarmTestServerFnOptions];
|
|
87
|
+
interface FarmTestHarness<TContext = unknown> {
|
|
88
|
+
request(path?: string | URL, options?: FarmTestRequestOptions): Request;
|
|
89
|
+
route<TRoute extends AnyProgrammaticPageRoute>(route: TRoute, options?: FarmTestRouteOptions<TRoute, TContext>): Promise<FarmTestRouteResult<TRoute>>;
|
|
90
|
+
api(route: ProgrammaticApiRoute, options?: FarmTestApiOptions): Promise<Response>;
|
|
91
|
+
endpoint(endpoint: unknown, options?: FarmTestEndpointOptions): Promise<Response>;
|
|
92
|
+
serverFn<TInput, TResult>(serverFn: ServerFn<TInput, TResult>, ...args: FarmTestServerFnArguments<TInput>): Promise<TResult>;
|
|
93
|
+
clearCache(): void;
|
|
94
|
+
}
|
|
95
|
+
/** Create a deterministic Web Request without depending on a test runner. */
|
|
96
|
+
declare function createTestRequest(path?: string | URL, options?: FarmTestRequestOptions): Request;
|
|
97
|
+
/**
|
|
98
|
+
* Create test helpers that exercise Farm's real route, API, and server-function runtimes.
|
|
99
|
+
* The harness has no dependency on Vitest, Jest, or a DOM environment.
|
|
100
|
+
*/
|
|
101
|
+
declare function createFarmTestHarness<TContext = unknown>(options?: FarmTestHarnessOptions<TContext>): FarmTestHarness<TContext>;
|
|
102
|
+
|
|
103
|
+
export { type FarmTestApiOptions, type FarmTestEndpointOptions, type FarmTestFormValues, type FarmTestHarness, type FarmTestHarnessOptions, type FarmTestPathParams, type FarmTestQuery, type FarmTestRequestOptions, type FarmTestRouteOptions, type FarmTestRouteProps, type FarmTestRouteResult, type FarmTestServerFnArguments, type FarmTestServerFnOptions, type InferFarmTestRouteData, type InferFarmTestRouteParams, type InferFarmTestRouteSearch, createFarmTestHarness, createTestRequest };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import './types-BMxWr97v.js';
|
|
3
|
+
import { b as APIRouteParams } from './runtime-DTAQ2HDv.js';
|
|
4
|
+
import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.js';
|
|
5
|
+
import { FarmRouterQueryValue, FarmRouterPathParams } from './router.js';
|
|
6
|
+
import { ServerFn } from './server-fn.js';
|
|
7
|
+
import { g as FarmContextFactory, M as MiddlewareProps, i as PluginContextProps, s as RouteModule } from './client-plugins-CTQAkr7R.js';
|
|
8
|
+
import './cache.js';
|
|
9
|
+
import './transport-BmbGTXA5.js';
|
|
10
|
+
import './route-runtime-DoOHzCAD.js';
|
|
11
|
+
import './plugin-BJDf43dc.js';
|
|
12
|
+
import 'http';
|
|
13
|
+
import './types-D1A6-XvH.js';
|
|
14
|
+
import 'db0';
|
|
15
|
+
import 'unstorage';
|
|
16
|
+
import './integration-api-CHT2OKAf.js';
|
|
17
|
+
import '@farming-labs/orm';
|
|
18
|
+
import './types-DTzm4TCl.js';
|
|
19
|
+
import '@farming-labs/docs';
|
|
20
|
+
import './markdown.js';
|
|
21
|
+
import './observability.js';
|
|
22
|
+
import 'vite';
|
|
23
|
+
import './workflows.js';
|
|
24
|
+
import './cron.js';
|
|
25
|
+
import './env.js';
|
|
26
|
+
import './server-action-security.js';
|
|
27
|
+
import './server-fn-error-DDh14a0V.js';
|
|
28
|
+
import './image-config-Duob7wER.js';
|
|
29
|
+
import './font.js';
|
|
30
|
+
|
|
31
|
+
type FarmTestQuery = URLSearchParams | Record<string, FarmRouterQueryValue>;
|
|
32
|
+
type FarmTestPathParams = FarmRouterPathParams;
|
|
33
|
+
type FarmTestFormValues = Record<string, FormDataEntryValue | readonly FormDataEntryValue[]>;
|
|
34
|
+
interface FarmTestRequestOptions extends Omit<RequestInit, "body" | "headers"> {
|
|
35
|
+
origin?: string;
|
|
36
|
+
headers?: HeadersInit;
|
|
37
|
+
query?: FarmTestQuery;
|
|
38
|
+
cookies?: Record<string, string>;
|
|
39
|
+
json?: unknown;
|
|
40
|
+
form?: FormData | FarmTestFormValues;
|
|
41
|
+
body?: BodyInit | null;
|
|
42
|
+
}
|
|
43
|
+
interface FarmTestHarnessOptions<TContext = unknown> {
|
|
44
|
+
origin?: string;
|
|
45
|
+
headers?: HeadersInit;
|
|
46
|
+
cookies?: Record<string, string>;
|
|
47
|
+
context?: FarmContextFactory<TContext>;
|
|
48
|
+
}
|
|
49
|
+
type AnyProgrammaticPageRoute = ProgrammaticPageRoute<any, any, any, any>;
|
|
50
|
+
type InferFarmTestRouteParams<TRoute> = TRoute extends ProgrammaticPageRoute<infer TParams, any, any, any> ? TParams : never;
|
|
51
|
+
type InferFarmTestRouteSearch<TRoute> = TRoute extends ProgrammaticPageRoute<any, infer TSearch, any, any> ? TSearch : never;
|
|
52
|
+
type InferFarmTestRouteData<TRoute> = TRoute extends ProgrammaticPageRoute<any, any, infer TDataHooks, any> ? InferProgrammaticRouteData<TDataHooks> : never;
|
|
53
|
+
type FarmTestRouteProps<TRoute extends AnyProgrammaticPageRoute> = ProgrammaticRouteComponentProps<InferFarmTestRouteParams<TRoute>, InferFarmTestRouteSearch<TRoute>, InferFarmTestRouteData<TRoute>>;
|
|
54
|
+
type FarmTestRouteParamsInput<TRoute> = InferFarmTestRouteParams<TRoute> extends Record<string, unknown> ? Partial<InferFarmTestRouteParams<TRoute>> : FarmTestPathParams;
|
|
55
|
+
type FarmTestRouteSearchInput<TRoute> = InferFarmTestRouteSearch<TRoute> extends Record<string, unknown> ? Partial<InferFarmTestRouteSearch<TRoute>> | URLSearchParams : FarmTestQuery;
|
|
56
|
+
interface FarmTestRouteOptions<TRoute extends AnyProgrammaticPageRoute, TContext = unknown> extends Pick<FarmTestRequestOptions, "origin" | "headers" | "cookies" | "signal"> {
|
|
57
|
+
path?: string | URL;
|
|
58
|
+
params?: FarmTestRouteParamsInput<TRoute>;
|
|
59
|
+
search?: FarmTestRouteSearchInput<TRoute>;
|
|
60
|
+
context?: TContext;
|
|
61
|
+
middleware?: MiddlewareProps;
|
|
62
|
+
pluginContext?: PluginContextProps;
|
|
63
|
+
}
|
|
64
|
+
interface FarmTestRouteResult<TRoute extends AnyProgrammaticPageRoute> {
|
|
65
|
+
route: TRoute;
|
|
66
|
+
module: RouteModule;
|
|
67
|
+
request: Request;
|
|
68
|
+
props: FarmTestRouteProps<TRoute>;
|
|
69
|
+
element: ReactElement;
|
|
70
|
+
canonicalPath?: string;
|
|
71
|
+
}
|
|
72
|
+
interface FarmTestApiOptions extends FarmTestRequestOptions {
|
|
73
|
+
path?: string | URL;
|
|
74
|
+
params?: FarmTestPathParams;
|
|
75
|
+
throwOnError?: boolean;
|
|
76
|
+
}
|
|
77
|
+
interface FarmTestEndpointOptions extends FarmTestRequestOptions {
|
|
78
|
+
path?: string | URL;
|
|
79
|
+
params?: APIRouteParams;
|
|
80
|
+
throwOnError?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface FarmTestServerFnOptions extends Pick<FarmTestRequestOptions, "origin" | "headers" | "cookies" | "signal"> {
|
|
83
|
+
path?: string | URL;
|
|
84
|
+
request?: Request;
|
|
85
|
+
}
|
|
86
|
+
type FarmTestServerFnArguments<TInput> = [unknown] extends [TInput] ? [input?: TInput | FormData, options?: FarmTestServerFnOptions] : [input: TInput | FormData, options?: FarmTestServerFnOptions];
|
|
87
|
+
interface FarmTestHarness<TContext = unknown> {
|
|
88
|
+
request(path?: string | URL, options?: FarmTestRequestOptions): Request;
|
|
89
|
+
route<TRoute extends AnyProgrammaticPageRoute>(route: TRoute, options?: FarmTestRouteOptions<TRoute, TContext>): Promise<FarmTestRouteResult<TRoute>>;
|
|
90
|
+
api(route: ProgrammaticApiRoute, options?: FarmTestApiOptions): Promise<Response>;
|
|
91
|
+
endpoint(endpoint: unknown, options?: FarmTestEndpointOptions): Promise<Response>;
|
|
92
|
+
serverFn<TInput, TResult>(serverFn: ServerFn<TInput, TResult>, ...args: FarmTestServerFnArguments<TInput>): Promise<TResult>;
|
|
93
|
+
clearCache(): void;
|
|
94
|
+
}
|
|
95
|
+
/** Create a deterministic Web Request without depending on a test runner. */
|
|
96
|
+
declare function createTestRequest(path?: string | URL, options?: FarmTestRequestOptions): Request;
|
|
97
|
+
/**
|
|
98
|
+
* Create test helpers that exercise Farm's real route, API, and server-function runtimes.
|
|
99
|
+
* The harness has no dependency on Vitest, Jest, or a DOM environment.
|
|
100
|
+
*/
|
|
101
|
+
declare function createFarmTestHarness<TContext = unknown>(options?: FarmTestHarnessOptions<TContext>): FarmTestHarness<TContext>;
|
|
102
|
+
|
|
103
|
+
export { type FarmTestApiOptions, type FarmTestEndpointOptions, type FarmTestFormValues, type FarmTestHarness, type FarmTestHarnessOptions, type FarmTestPathParams, type FarmTestQuery, type FarmTestRequestOptions, type FarmTestRouteOptions, type FarmTestRouteProps, type FarmTestRouteResult, type FarmTestServerFnArguments, type FarmTestServerFnOptions, type InferFarmTestRouteData, type InferFarmTestRouteParams, type InferFarmTestRouteSearch, createFarmTestHarness, createTestRequest };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type MultipartField = string | number | boolean | bigint | Blob | Date | null | undefined;
|
|
2
|
+
type MultipartValues = Record<string, MultipartField | readonly MultipartField[]>;
|
|
3
|
+
/**
|
|
4
|
+
* A real FormData value that retains the submitted value shape for generated
|
|
5
|
+
* API-client inference.
|
|
6
|
+
*/
|
|
7
|
+
type TypedFormData<TValues> = FormData & {
|
|
8
|
+
readonly __farmMultipartInput: TValues;
|
|
9
|
+
};
|
|
10
|
+
type MultipartSchema<TSchema> = TSchema & {
|
|
11
|
+
readonly __farmMultipartSchema: true;
|
|
12
|
+
};
|
|
13
|
+
type FarmStreamResponse<TItem> = Response & {
|
|
14
|
+
readonly __farmStreamItem: TItem;
|
|
15
|
+
};
|
|
16
|
+
interface FarmAPIStream<TItem> extends AsyncIterable<TItem> {
|
|
17
|
+
readonly response: Response;
|
|
18
|
+
cancel(reason?: unknown): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
type SchemaLike = {
|
|
21
|
+
parse(data: unknown): unknown;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Mark a body schema as multipart. The handler still receives the schema's
|
|
25
|
+
* parsed object; generated clients require `toFormData(...)` for the request.
|
|
26
|
+
*/
|
|
27
|
+
declare function multipart<TSchema extends SchemaLike>(schema: TSchema): MultipartSchema<TSchema>;
|
|
28
|
+
declare function isMultipartSchema(value: unknown): value is MultipartSchema<SchemaLike>;
|
|
29
|
+
/**
|
|
30
|
+
* Encode a typed object as multipart FormData without converting File or Blob
|
|
31
|
+
* values to JSON or base64.
|
|
32
|
+
*/
|
|
33
|
+
declare function toFormData<TValues extends MultipartValues>(values: TValues): TypedFormData<TValues>;
|
|
34
|
+
/**
|
|
35
|
+
* Stream JSON values as newline-delimited JSON. Each source value becomes one
|
|
36
|
+
* independently decodable item instead of buffering the whole response.
|
|
37
|
+
*/
|
|
38
|
+
declare function jsonStream<TItem>(source: AsyncIterable<TItem> | Iterable<TItem>, init?: ResponseInit): FarmStreamResponse<TItem>;
|
|
39
|
+
declare function isJSONStreamResponse(response: {
|
|
40
|
+
headers?: Pick<Headers, "get"> | null;
|
|
41
|
+
}): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Decode a Farm JSON stream lazily. The response body is read only as the
|
|
44
|
+
* consumer advances the async iterator, preserving fetch backpressure.
|
|
45
|
+
*/
|
|
46
|
+
declare function readJSONStream<TItem>(response: Response): FarmAPIStream<TItem>;
|
|
47
|
+
declare function isFarmAPIStream(value: unknown): value is FarmAPIStream<unknown>;
|
|
48
|
+
|
|
49
|
+
export { type FarmAPIStream as F, type MultipartSchema as M, type TypedFormData as T, type MultipartField as a, type MultipartValues as b, type FarmStreamResponse as c, isJSONStreamResponse as d, isFarmAPIStream as e, isMultipartSchema as i, jsonStream as j, multipart as m, readJSONStream as r, toFormData as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type MultipartField = string | number | boolean | bigint | Blob | Date | null | undefined;
|
|
2
|
+
type MultipartValues = Record<string, MultipartField | readonly MultipartField[]>;
|
|
3
|
+
/**
|
|
4
|
+
* A real FormData value that retains the submitted value shape for generated
|
|
5
|
+
* API-client inference.
|
|
6
|
+
*/
|
|
7
|
+
type TypedFormData<TValues> = FormData & {
|
|
8
|
+
readonly __farmMultipartInput: TValues;
|
|
9
|
+
};
|
|
10
|
+
type MultipartSchema<TSchema> = TSchema & {
|
|
11
|
+
readonly __farmMultipartSchema: true;
|
|
12
|
+
};
|
|
13
|
+
type FarmStreamResponse<TItem> = Response & {
|
|
14
|
+
readonly __farmStreamItem: TItem;
|
|
15
|
+
};
|
|
16
|
+
interface FarmAPIStream<TItem> extends AsyncIterable<TItem> {
|
|
17
|
+
readonly response: Response;
|
|
18
|
+
cancel(reason?: unknown): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
type SchemaLike = {
|
|
21
|
+
parse(data: unknown): unknown;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Mark a body schema as multipart. The handler still receives the schema's
|
|
25
|
+
* parsed object; generated clients require `toFormData(...)` for the request.
|
|
26
|
+
*/
|
|
27
|
+
declare function multipart<TSchema extends SchemaLike>(schema: TSchema): MultipartSchema<TSchema>;
|
|
28
|
+
declare function isMultipartSchema(value: unknown): value is MultipartSchema<SchemaLike>;
|
|
29
|
+
/**
|
|
30
|
+
* Encode a typed object as multipart FormData without converting File or Blob
|
|
31
|
+
* values to JSON or base64.
|
|
32
|
+
*/
|
|
33
|
+
declare function toFormData<TValues extends MultipartValues>(values: TValues): TypedFormData<TValues>;
|
|
34
|
+
/**
|
|
35
|
+
* Stream JSON values as newline-delimited JSON. Each source value becomes one
|
|
36
|
+
* independently decodable item instead of buffering the whole response.
|
|
37
|
+
*/
|
|
38
|
+
declare function jsonStream<TItem>(source: AsyncIterable<TItem> | Iterable<TItem>, init?: ResponseInit): FarmStreamResponse<TItem>;
|
|
39
|
+
declare function isJSONStreamResponse(response: {
|
|
40
|
+
headers?: Pick<Headers, "get"> | null;
|
|
41
|
+
}): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Decode a Farm JSON stream lazily. The response body is read only as the
|
|
44
|
+
* consumer advances the async iterator, preserving fetch backpressure.
|
|
45
|
+
*/
|
|
46
|
+
declare function readJSONStream<TItem>(response: Response): FarmAPIStream<TItem>;
|
|
47
|
+
declare function isFarmAPIStream(value: unknown): value is FarmAPIStream<unknown>;
|
|
48
|
+
|
|
49
|
+
export { type FarmAPIStream as F, type MultipartSchema as M, type TypedFormData as T, type MultipartField as a, type MultipartValues as b, type FarmStreamResponse as c, isJSONStreamResponse as d, isFarmAPIStream as e, isMultipartSchema as i, jsonStream as j, multipart as m, readJSONStream as r, toFormData as t };
|