@farm.js/core 0.1.0-beta.10 → 0.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/after.d.mts +25 -0
- package/dist/after.d.ts +25 -0
- package/dist/agent-runtime.d.mts +94 -0
- package/dist/agent-runtime.d.ts +94 -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-BNE2FoZ4.d.mts +302 -0
- package/dist/app-DRGUmJ3s.d.ts +302 -0
- package/dist/app-markdown.d.mts +22 -0
- package/dist/app-markdown.d.ts +22 -0
- package/dist/cache.d.mts +192 -0
- package/dist/cache.d.ts +192 -0
- package/dist/{chunk-DTOWEQRV.mjs → chunk-4677KXB7.mjs} +2 -2
- package/dist/{chunk-3QDB3IA6.mjs → chunk-5EVQFRL2.mjs} +2 -2
- package/dist/{chunk-3QDB3IA6.mjs.map → chunk-5EVQFRL2.mjs.map} +1 -1
- package/dist/{chunk-E2AI2CW7.mjs → chunk-77BOAQHI.mjs} +4 -3
- package/dist/chunk-77BOAQHI.mjs.map +1 -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-Bc5jHcNr.d.ts +1927 -0
- package/dist/client-plugins-jsk-ZLzJ.d.mts +1927 -0
- package/dist/client-plugins.d.mts +22 -0
- package/dist/client-plugins.d.ts +22 -0
- package/dist/client.d.mts +447 -0
- package/dist/client.d.ts +447 -0
- package/dist/config.d.mts +29 -0
- package/dist/config.d.ts +29 -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 +34 -0
- package/dist/deployment.d.ts +34 -0
- package/dist/docs.d.mts +69 -0
- package/dist/docs.d.ts +69 -0
- 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 +70 -0
- package/dist/font.d.ts +70 -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 +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +455 -0
- package/dist/index.d.ts +455 -0
- package/dist/index.mjs +3 -3
- package/dist/integration-api-CHT2OKAf.d.mts +93 -0
- package/dist/integration-api-CHT2OKAf.d.ts +93 -0
- package/dist/integrations.d.mts +22 -0
- package/dist/integrations.d.ts +22 -0
- package/dist/internal/build-runtime.cjs +3 -2
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +39 -0
- package/dist/internal/build-runtime.d.ts +39 -0
- package/dist/internal/build-runtime.mjs +3 -3
- package/dist/internal/client-runtime.d.mts +2 -0
- package/dist/internal/client-runtime.d.ts +2 -0
- package/dist/internal/config-runtime.d.mts +39 -0
- package/dist/internal/config-runtime.d.ts +39 -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 +41 -0
- package/dist/internal/production-runtime.d.ts +41 -0
- package/dist/markdown.d.mts +60 -0
- package/dist/markdown.d.ts +60 -0
- package/dist/metadata-7ffpT3jr.d.mts +22 -0
- package/dist/metadata-JHn-8eht.d.ts +22 -0
- package/dist/middleware.d.mts +164 -0
- package/dist/middleware.d.ts +164 -0
- 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 +2 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +22 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/plugin.mjs +2 -2
- package/dist/production-runtime-9KG7GuvW.d.ts +79 -0
- package/dist/production-runtime-B-fweKts.d.mts +79 -0
- package/dist/production-runtime-C_B79w2P.d.mts +28 -0
- package/dist/production-runtime-DDEM1D2q.d.ts +28 -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-Dsq4kGW0.d.mts +6 -0
- package/dist/request-udtobOLv.d.ts +6 -0
- package/dist/request.d.mts +2 -0
- package/dist/request.d.ts +2 -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 +224 -0
- package/dist/routes.d.ts +224 -0
- package/dist/runtime-9nQjVM7X.d.mts +206 -0
- package/dist/runtime-Cxpq6xZN.d.mts +27 -0
- package/dist/runtime-DgeS2skB.d.ts +206 -0
- package/dist/runtime-bv63eUiO.d.ts +27 -0
- package/dist/server-action-security.d.mts +43 -0
- package/dist/server-action-security.d.ts +43 -0
- package/dist/server-fn-client.d.mts +32 -0
- package/dist/server-fn-client.d.ts +32 -0
- package/dist/server-fn.d.mts +93 -0
- package/dist/server-fn.d.ts +93 -0
- package/dist/server-plugins.d.mts +55 -0
- package/dist/server-plugins.d.ts +55 -0
- package/dist/server-query-client.d.mts +50 -0
- package/dist/server-query-client.d.ts +50 -0
- package/dist/server-query.d.mts +36 -0
- package/dist/server-query.d.ts +36 -0
- package/dist/server.cjs +3 -2
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +48 -0
- package/dist/server.d.ts +48 -0
- package/dist/server.mjs +2 -2
- package/dist/storage.d.mts +52 -0
- package/dist/storage.d.ts +52 -0
- package/dist/testing.d.mts +101 -0
- package/dist/testing.d.ts +101 -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-C9N-nk5R.d.mts +53 -0
- package/dist/types-C9N-nk5R.d.ts +53 -0
- package/dist/types-D1A6-XvH.d.mts +73 -0
- package/dist/types-D1A6-XvH.d.ts +73 -0
- package/dist/utils-CA0z0c-2.d.ts +23 -0
- package/dist/utils-mYVkSOt2.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 +3 -2
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +22 -0
- package/dist/vite.d.ts +22 -0
- package/dist/vite.mjs +2 -2
- package/dist/workflows.d.mts +110 -0
- package/dist/workflows.d.ts +110 -0
- package/package.json +1 -1
- package/dist/chunk-E2AI2CW7.mjs.map +0 -1
- /package/dist/{chunk-DTOWEQRV.mjs.map → chunk-4677KXB7.mjs.map} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { aU as ResolvedFarmConfig } from '../client-plugins-jsk-ZLzJ.mjs';
|
|
2
|
+
export { a5 as loadConfig, a4 as resolveConfig, a6 as resolveDeployConfig } from '../client-plugins-jsk-ZLzJ.mjs';
|
|
3
|
+
import { FarmProductionViteRuntime } from './config-runtime.mjs';
|
|
4
|
+
export { l as logger } from '../utils-mYVkSOt2.mjs';
|
|
5
|
+
import '../plugin-BJDf43dc.mjs';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'http';
|
|
8
|
+
import '../types-D1A6-XvH.mjs';
|
|
9
|
+
import 'db0';
|
|
10
|
+
import 'unstorage';
|
|
11
|
+
import '../integration-api-CHT2OKAf.mjs';
|
|
12
|
+
import '@farming-labs/orm';
|
|
13
|
+
import '../types-C9N-nk5R.mjs';
|
|
14
|
+
import '@farming-labs/docs';
|
|
15
|
+
import '../markdown.mjs';
|
|
16
|
+
import '../observability.mjs';
|
|
17
|
+
import 'vite';
|
|
18
|
+
import '../workflows.mjs';
|
|
19
|
+
import '../cron.mjs';
|
|
20
|
+
import '../env.mjs';
|
|
21
|
+
import '../server-action-security.mjs';
|
|
22
|
+
import '../image-config-Duob7wER.mjs';
|
|
23
|
+
import '../types-BMxWr97v.mjs';
|
|
24
|
+
import '../cache.mjs';
|
|
25
|
+
import '../route-runtime-DoOHzCAD.mjs';
|
|
26
|
+
|
|
27
|
+
interface BuildOptions {
|
|
28
|
+
preset?: string;
|
|
29
|
+
root?: string;
|
|
30
|
+
universal?: boolean;
|
|
31
|
+
/** @internal Production Vite preload started by the CLI. */
|
|
32
|
+
productionVite?: FarmProductionViteRuntime | Promise<FarmProductionViteRuntime>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build Farm.js application for production
|
|
36
|
+
*/
|
|
37
|
+
declare function build(config: ResolvedFarmConfig, options?: BuildOptions): Promise<void>;
|
|
38
|
+
|
|
39
|
+
export { build };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { aU as ResolvedFarmConfig } from '../client-plugins-Bc5jHcNr.js';
|
|
2
|
+
export { a5 as loadConfig, a4 as resolveConfig, a6 as resolveDeployConfig } from '../client-plugins-Bc5jHcNr.js';
|
|
3
|
+
import { FarmProductionViteRuntime } from './config-runtime.js';
|
|
4
|
+
export { l as logger } from '../utils-CA0z0c-2.js';
|
|
5
|
+
import '../plugin-BJDf43dc.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'http';
|
|
8
|
+
import '../types-D1A6-XvH.js';
|
|
9
|
+
import 'db0';
|
|
10
|
+
import 'unstorage';
|
|
11
|
+
import '../integration-api-CHT2OKAf.js';
|
|
12
|
+
import '@farming-labs/orm';
|
|
13
|
+
import '../types-C9N-nk5R.js';
|
|
14
|
+
import '@farming-labs/docs';
|
|
15
|
+
import '../markdown.js';
|
|
16
|
+
import '../observability.js';
|
|
17
|
+
import 'vite';
|
|
18
|
+
import '../workflows.js';
|
|
19
|
+
import '../cron.js';
|
|
20
|
+
import '../env.js';
|
|
21
|
+
import '../server-action-security.js';
|
|
22
|
+
import '../image-config-Duob7wER.js';
|
|
23
|
+
import '../types-BMxWr97v.js';
|
|
24
|
+
import '../cache.js';
|
|
25
|
+
import '../route-runtime-DoOHzCAD.js';
|
|
26
|
+
|
|
27
|
+
interface BuildOptions {
|
|
28
|
+
preset?: string;
|
|
29
|
+
root?: string;
|
|
30
|
+
universal?: boolean;
|
|
31
|
+
/** @internal Production Vite preload started by the CLI. */
|
|
32
|
+
productionVite?: FarmProductionViteRuntime | Promise<FarmProductionViteRuntime>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build Farm.js application for production
|
|
36
|
+
*/
|
|
37
|
+
declare function build(config: ResolvedFarmConfig, options?: BuildOptions): Promise<void>;
|
|
38
|
+
|
|
39
|
+
export { build };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-4677KXB7.mjs";
|
|
4
4
|
import "../chunk-SL6HTIOK.mjs";
|
|
5
5
|
import "../chunk-4S3ORGFA.mjs";
|
|
6
6
|
import "../chunk-4LND3PXF.mjs";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import "../chunk-UVCIEUJC.mjs";
|
|
15
15
|
import "../chunk-DJSGLHCN.mjs";
|
|
16
16
|
import "../chunk-RQ633A5I.mjs";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-77BOAQHI.mjs";
|
|
18
18
|
import "../chunk-LGHEOHBU.mjs";
|
|
19
19
|
import "../chunk-FRPWCMMG.mjs";
|
|
20
20
|
import "../chunk-V6WE6JSZ.mjs";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
import "../chunk-PFE6GMNE.mjs";
|
|
53
53
|
import "../chunk-RHIFZZUI.mjs";
|
|
54
54
|
import "../chunk-LM2YNO4U.mjs";
|
|
55
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-5EVQFRL2.mjs";
|
|
56
56
|
import "../chunk-QTZZ2ISQ.mjs";
|
|
57
57
|
import "../chunk-ITN462YM.mjs";
|
|
58
58
|
import "../chunk-B232I2GP.mjs";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { a5 as loadConfig, a4 as resolveConfig, a6 as resolveDeployConfig } from '../client-plugins-jsk-ZLzJ.mjs';
|
|
2
|
+
import { build, createServer, loadEnv } from 'vite';
|
|
3
|
+
export { l as logger } from '../utils-mYVkSOt2.mjs';
|
|
4
|
+
import '../plugin-BJDf43dc.mjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'http';
|
|
7
|
+
import '../types-D1A6-XvH.mjs';
|
|
8
|
+
import 'db0';
|
|
9
|
+
import 'unstorage';
|
|
10
|
+
import '../integration-api-CHT2OKAf.mjs';
|
|
11
|
+
import '@farming-labs/orm';
|
|
12
|
+
import '../types-C9N-nk5R.mjs';
|
|
13
|
+
import '@farming-labs/docs';
|
|
14
|
+
import '../markdown.mjs';
|
|
15
|
+
import '../observability.mjs';
|
|
16
|
+
import '../workflows.mjs';
|
|
17
|
+
import '../cron.mjs';
|
|
18
|
+
import '../env.mjs';
|
|
19
|
+
import '../server-action-security.mjs';
|
|
20
|
+
import '../image-config-Duob7wER.mjs';
|
|
21
|
+
import '../types-BMxWr97v.mjs';
|
|
22
|
+
import '../cache.mjs';
|
|
23
|
+
import '../route-runtime-DoOHzCAD.mjs';
|
|
24
|
+
|
|
25
|
+
type FarmProductionViteBuilder = "rollup" | "rolldown";
|
|
26
|
+
interface FarmProductionViteRuntime {
|
|
27
|
+
build: typeof build;
|
|
28
|
+
createServer: typeof createServer;
|
|
29
|
+
loadEnv: typeof loadEnv;
|
|
30
|
+
builder: FarmProductionViteBuilder;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Prefer Vite's Rolldown-powered production builder on supported Node releases.
|
|
34
|
+
* Vite 5 remains the compatibility path for Node 18, --no-optional installs,
|
|
35
|
+
* and projects that explicitly request Rollup.
|
|
36
|
+
*/
|
|
37
|
+
declare function loadFarmProductionVite(): Promise<FarmProductionViteRuntime>;
|
|
38
|
+
|
|
39
|
+
export { type FarmProductionViteRuntime, loadFarmProductionVite };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { a5 as loadConfig, a4 as resolveConfig, a6 as resolveDeployConfig } from '../client-plugins-Bc5jHcNr.js';
|
|
2
|
+
import { build, createServer, loadEnv } from 'vite';
|
|
3
|
+
export { l as logger } from '../utils-CA0z0c-2.js';
|
|
4
|
+
import '../plugin-BJDf43dc.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'http';
|
|
7
|
+
import '../types-D1A6-XvH.js';
|
|
8
|
+
import 'db0';
|
|
9
|
+
import 'unstorage';
|
|
10
|
+
import '../integration-api-CHT2OKAf.js';
|
|
11
|
+
import '@farming-labs/orm';
|
|
12
|
+
import '../types-C9N-nk5R.js';
|
|
13
|
+
import '@farming-labs/docs';
|
|
14
|
+
import '../markdown.js';
|
|
15
|
+
import '../observability.js';
|
|
16
|
+
import '../workflows.js';
|
|
17
|
+
import '../cron.js';
|
|
18
|
+
import '../env.js';
|
|
19
|
+
import '../server-action-security.js';
|
|
20
|
+
import '../image-config-Duob7wER.js';
|
|
21
|
+
import '../types-BMxWr97v.js';
|
|
22
|
+
import '../cache.js';
|
|
23
|
+
import '../route-runtime-DoOHzCAD.js';
|
|
24
|
+
|
|
25
|
+
type FarmProductionViteBuilder = "rollup" | "rolldown";
|
|
26
|
+
interface FarmProductionViteRuntime {
|
|
27
|
+
build: typeof build;
|
|
28
|
+
createServer: typeof createServer;
|
|
29
|
+
loadEnv: typeof loadEnv;
|
|
30
|
+
builder: FarmProductionViteBuilder;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Prefer Vite's Rolldown-powered production builder on supported Node releases.
|
|
34
|
+
* Vite 5 remains the compatibility path for Node 18, --no-optional installs,
|
|
35
|
+
* and projects that explicitly request Rollup.
|
|
36
|
+
*/
|
|
37
|
+
declare function loadFarmProductionVite(): Promise<FarmProductionViteRuntime>;
|
|
38
|
+
|
|
39
|
+
export { type FarmProductionViteRuntime, loadFarmProductionVite };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep overlapping production operations on the production condition.
|
|
3
|
+
*
|
|
4
|
+
* The state lives on `globalThis` so independently loaded CJS/ESM copies of
|
|
5
|
+
* Farm share one refcount. The first entrant captures the caller's value and
|
|
6
|
+
* only the last operation to settle restores it.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
declare function withProductionNodeEnv<T>(operation: () => T | PromiseLike<T>): Promise<T>;
|
|
11
|
+
|
|
12
|
+
export { withProductionNodeEnv };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep overlapping production operations on the production condition.
|
|
3
|
+
*
|
|
4
|
+
* The state lives on `globalThis` so independently loaded CJS/ESM copies of
|
|
5
|
+
* Farm share one refcount. The first entrant captures the caller's value and
|
|
6
|
+
* only the last operation to settle restores it.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
declare function withProductionNodeEnv<T>(operation: () => T | PromiseLike<T>): Promise<T>;
|
|
11
|
+
|
|
12
|
+
export { withProductionNodeEnv };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export { _runWithAfterRequest } from '../after.mjs';
|
|
2
|
+
export { _ as _runWithCurrentRequest, g as getCurrentRequest } from '../request-Dsq4kGW0.mjs';
|
|
3
|
+
export { configureFarmCache, createFarmCacheKey, getFarmDataCache, normalizeRevalidatePath } from '../cache.mjs';
|
|
4
|
+
export { c as createFarmLocaleCookie, g as getFarmLocaleVaryHeaders } from '../resolver-DJqjLMg_.mjs';
|
|
5
|
+
export { localizeFarmHref, localizeFarmPathname, stripFarmLocaleFromPathname } from '../i18n/index.mjs';
|
|
6
|
+
export { a as addMetadataImageReference, m as mergeMetadata, r as renderMetadataHead } from '../metadata-7ffpT3jr.mjs';
|
|
7
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-B-fweKts.mjs';
|
|
8
|
+
export { g as getFarmRedirectError, i as isFarmNotFoundError, a as isFarmRedirectError } from '../navigation-errors-Dvwpzaer.mjs';
|
|
9
|
+
export { configureFarmObservability, emitFarmEvent } from '../observability.mjs';
|
|
10
|
+
import { F as FarmConfig, e as FarmContextFactoryInput } from '../client-plugins-jsk-ZLzJ.mjs';
|
|
11
|
+
import 'node:http';
|
|
12
|
+
import '../types-BMxWr97v.mjs';
|
|
13
|
+
import '../plugin-BJDf43dc.mjs';
|
|
14
|
+
import 'react';
|
|
15
|
+
import 'http';
|
|
16
|
+
import '../types-D1A6-XvH.mjs';
|
|
17
|
+
import 'db0';
|
|
18
|
+
import 'unstorage';
|
|
19
|
+
import '../integration-api-CHT2OKAf.mjs';
|
|
20
|
+
import '@farming-labs/orm';
|
|
21
|
+
import '../types-C9N-nk5R.mjs';
|
|
22
|
+
import '@farming-labs/docs';
|
|
23
|
+
import '../markdown.mjs';
|
|
24
|
+
import 'vite';
|
|
25
|
+
import '../workflows.mjs';
|
|
26
|
+
import '../cron.mjs';
|
|
27
|
+
import '../env.mjs';
|
|
28
|
+
import '../server-action-security.mjs';
|
|
29
|
+
import '../image-config-Duob7wER.mjs';
|
|
30
|
+
import '../route-runtime-DoOHzCAD.mjs';
|
|
31
|
+
|
|
32
|
+
declare const FARM_ROUTE_CONTEXT_SYMBOL: unique symbol;
|
|
33
|
+
type FarmRouteContextCarrier<TContext = unknown> = {
|
|
34
|
+
[FARM_ROUTE_CONTEXT_SYMBOL]?: TContext;
|
|
35
|
+
};
|
|
36
|
+
declare function resolveFarmRouteContext(config: Pick<FarmConfig, "context">, input: FarmContextFactoryInput): Promise<unknown>;
|
|
37
|
+
declare function withFarmRouteContext<TProps extends object, TContext>(props: TProps, context: TContext | undefined): TProps & FarmRouteContextCarrier<TContext>;
|
|
38
|
+
|
|
39
|
+
declare function appendFarmLinkHeader(headers: Headers, value: string): void;
|
|
40
|
+
|
|
41
|
+
export { appendFarmLinkHeader, resolveFarmRouteContext, withFarmRouteContext };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export { _runWithAfterRequest } from '../after.js';
|
|
2
|
+
export { _ as _runWithCurrentRequest, g as getCurrentRequest } from '../request-udtobOLv.js';
|
|
3
|
+
export { configureFarmCache, createFarmCacheKey, getFarmDataCache, normalizeRevalidatePath } from '../cache.js';
|
|
4
|
+
export { c as createFarmLocaleCookie, g as getFarmLocaleVaryHeaders } from '../resolver-IH4RmPEl.js';
|
|
5
|
+
export { localizeFarmHref, localizeFarmPathname, stripFarmLocaleFromPathname } from '../i18n/index.js';
|
|
6
|
+
export { a as addMetadataImageReference, m as mergeMetadata, r as renderMetadataHead } from '../metadata-JHn-8eht.js';
|
|
7
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-9KG7GuvW.js';
|
|
8
|
+
export { g as getFarmRedirectError, i as isFarmNotFoundError, a as isFarmRedirectError } from '../navigation-errors-Dvwpzaer.js';
|
|
9
|
+
export { configureFarmObservability, emitFarmEvent } from '../observability.js';
|
|
10
|
+
import { F as FarmConfig, e as FarmContextFactoryInput } from '../client-plugins-Bc5jHcNr.js';
|
|
11
|
+
import 'node:http';
|
|
12
|
+
import '../types-BMxWr97v.js';
|
|
13
|
+
import '../plugin-BJDf43dc.js';
|
|
14
|
+
import 'react';
|
|
15
|
+
import 'http';
|
|
16
|
+
import '../types-D1A6-XvH.js';
|
|
17
|
+
import 'db0';
|
|
18
|
+
import 'unstorage';
|
|
19
|
+
import '../integration-api-CHT2OKAf.js';
|
|
20
|
+
import '@farming-labs/orm';
|
|
21
|
+
import '../types-C9N-nk5R.js';
|
|
22
|
+
import '@farming-labs/docs';
|
|
23
|
+
import '../markdown.js';
|
|
24
|
+
import 'vite';
|
|
25
|
+
import '../workflows.js';
|
|
26
|
+
import '../cron.js';
|
|
27
|
+
import '../env.js';
|
|
28
|
+
import '../server-action-security.js';
|
|
29
|
+
import '../image-config-Duob7wER.js';
|
|
30
|
+
import '../route-runtime-DoOHzCAD.js';
|
|
31
|
+
|
|
32
|
+
declare const FARM_ROUTE_CONTEXT_SYMBOL: unique symbol;
|
|
33
|
+
type FarmRouteContextCarrier<TContext = unknown> = {
|
|
34
|
+
[FARM_ROUTE_CONTEXT_SYMBOL]?: TContext;
|
|
35
|
+
};
|
|
36
|
+
declare function resolveFarmRouteContext(config: Pick<FarmConfig, "context">, input: FarmContextFactoryInput): Promise<unknown>;
|
|
37
|
+
declare function withFarmRouteContext<TProps extends object, TContext>(props: TProps, context: TContext | undefined): TProps & FarmRouteContextCarrier<TContext>;
|
|
38
|
+
|
|
39
|
+
declare function appendFarmLinkHeader(headers: Headers, value: string): void;
|
|
40
|
+
|
|
41
|
+
export { appendFarmLinkHeader, resolveFarmRouteContext, withFarmRouteContext };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type FarmMarkdownRouteInput = string | {
|
|
2
|
+
route: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
cache?: number | false;
|
|
5
|
+
};
|
|
6
|
+
interface FarmMarkdownUserConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Enable generated markdown representations for React pages.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Routes that may expose generated markdown. Every page is exposed by default.
|
|
14
|
+
*/
|
|
15
|
+
expose?: boolean | FarmMarkdownRouteInput[];
|
|
16
|
+
/** @deprecated Use `expose`. */
|
|
17
|
+
routes?: FarmMarkdownRouteInput[];
|
|
18
|
+
cache?: number | false;
|
|
19
|
+
includeMetadata?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface FarmMarkdownResolvedRoute {
|
|
22
|
+
route: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
cache?: number | false;
|
|
25
|
+
}
|
|
26
|
+
interface FarmMarkdownResolvedConfig {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
expose: true | FarmMarkdownResolvedRoute[];
|
|
29
|
+
cache: number | false;
|
|
30
|
+
includeMetadata: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FarmMarkdownMirrorTarget {
|
|
33
|
+
pathname: string;
|
|
34
|
+
route: FarmMarkdownResolvedRoute | null;
|
|
35
|
+
}
|
|
36
|
+
interface ResolveMarkdownMirrorTargetOptions {
|
|
37
|
+
accept?: string | null;
|
|
38
|
+
}
|
|
39
|
+
interface CreateMarkdownMirrorResponseOptions {
|
|
40
|
+
request: Request;
|
|
41
|
+
config?: FarmMarkdownResolvedConfig;
|
|
42
|
+
routeExists?: (pathname: string) => boolean;
|
|
43
|
+
renderPage: (request: Request) => Response | Promise<Response>;
|
|
44
|
+
}
|
|
45
|
+
interface ApplyMarkdownNegotiationHeadersOptions {
|
|
46
|
+
config?: FarmMarkdownResolvedConfig;
|
|
47
|
+
pathname: string;
|
|
48
|
+
}
|
|
49
|
+
declare function resolveMarkdownConfig(config: FarmMarkdownUserConfig | boolean | undefined): FarmMarkdownResolvedConfig;
|
|
50
|
+
declare function resolveMarkdownMirrorTarget(config: FarmMarkdownResolvedConfig | undefined, pathname: string, options?: ResolveMarkdownMirrorTargetOptions): FarmMarkdownMirrorTarget | null;
|
|
51
|
+
declare function createMarkdownMirrorResponse(options: CreateMarkdownMirrorResponseOptions): Promise<Response | null>;
|
|
52
|
+
declare function applyMarkdownNegotiationHeaders(response: Response, options: ApplyMarkdownNegotiationHeadersOptions): Response;
|
|
53
|
+
declare function htmlToMarkdown(html: string, options?: {
|
|
54
|
+
title?: string;
|
|
55
|
+
sourcePath?: string;
|
|
56
|
+
includeMetadata?: boolean;
|
|
57
|
+
}): string;
|
|
58
|
+
declare function requestAcceptsMarkdown(accept: string | null | undefined): boolean;
|
|
59
|
+
|
|
60
|
+
export { type ApplyMarkdownNegotiationHeadersOptions, type CreateMarkdownMirrorResponseOptions, type FarmMarkdownMirrorTarget, type FarmMarkdownResolvedConfig, type FarmMarkdownResolvedRoute, type FarmMarkdownRouteInput, type FarmMarkdownUserConfig, type ResolveMarkdownMirrorTargetOptions, applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, htmlToMarkdown, requestAcceptsMarkdown, resolveMarkdownConfig, resolveMarkdownMirrorTarget };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type FarmMarkdownRouteInput = string | {
|
|
2
|
+
route: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
cache?: number | false;
|
|
5
|
+
};
|
|
6
|
+
interface FarmMarkdownUserConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Enable generated markdown representations for React pages.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Routes that may expose generated markdown. Every page is exposed by default.
|
|
14
|
+
*/
|
|
15
|
+
expose?: boolean | FarmMarkdownRouteInput[];
|
|
16
|
+
/** @deprecated Use `expose`. */
|
|
17
|
+
routes?: FarmMarkdownRouteInput[];
|
|
18
|
+
cache?: number | false;
|
|
19
|
+
includeMetadata?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface FarmMarkdownResolvedRoute {
|
|
22
|
+
route: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
cache?: number | false;
|
|
25
|
+
}
|
|
26
|
+
interface FarmMarkdownResolvedConfig {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
expose: true | FarmMarkdownResolvedRoute[];
|
|
29
|
+
cache: number | false;
|
|
30
|
+
includeMetadata: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FarmMarkdownMirrorTarget {
|
|
33
|
+
pathname: string;
|
|
34
|
+
route: FarmMarkdownResolvedRoute | null;
|
|
35
|
+
}
|
|
36
|
+
interface ResolveMarkdownMirrorTargetOptions {
|
|
37
|
+
accept?: string | null;
|
|
38
|
+
}
|
|
39
|
+
interface CreateMarkdownMirrorResponseOptions {
|
|
40
|
+
request: Request;
|
|
41
|
+
config?: FarmMarkdownResolvedConfig;
|
|
42
|
+
routeExists?: (pathname: string) => boolean;
|
|
43
|
+
renderPage: (request: Request) => Response | Promise<Response>;
|
|
44
|
+
}
|
|
45
|
+
interface ApplyMarkdownNegotiationHeadersOptions {
|
|
46
|
+
config?: FarmMarkdownResolvedConfig;
|
|
47
|
+
pathname: string;
|
|
48
|
+
}
|
|
49
|
+
declare function resolveMarkdownConfig(config: FarmMarkdownUserConfig | boolean | undefined): FarmMarkdownResolvedConfig;
|
|
50
|
+
declare function resolveMarkdownMirrorTarget(config: FarmMarkdownResolvedConfig | undefined, pathname: string, options?: ResolveMarkdownMirrorTargetOptions): FarmMarkdownMirrorTarget | null;
|
|
51
|
+
declare function createMarkdownMirrorResponse(options: CreateMarkdownMirrorResponseOptions): Promise<Response | null>;
|
|
52
|
+
declare function applyMarkdownNegotiationHeaders(response: Response, options: ApplyMarkdownNegotiationHeadersOptions): Response;
|
|
53
|
+
declare function htmlToMarkdown(html: string, options?: {
|
|
54
|
+
title?: string;
|
|
55
|
+
sourcePath?: string;
|
|
56
|
+
includeMetadata?: boolean;
|
|
57
|
+
}): string;
|
|
58
|
+
declare function requestAcceptsMarkdown(accept: string | null | undefined): boolean;
|
|
59
|
+
|
|
60
|
+
export { type ApplyMarkdownNegotiationHeadersOptions, type CreateMarkdownMirrorResponseOptions, type FarmMarkdownMirrorTarget, type FarmMarkdownResolvedConfig, type FarmMarkdownResolvedRoute, type FarmMarkdownRouteInput, type FarmMarkdownUserConfig, type ResolveMarkdownMirrorTargetOptions, applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, htmlToMarkdown, requestAcceptsMarkdown, resolveMarkdownConfig, resolveMarkdownMirrorTarget };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { s as Metadata } from './client-plugins-jsk-ZLzJ.mjs';
|
|
2
|
+
|
|
3
|
+
type MetadataImageKind = "opengraph" | "twitter";
|
|
4
|
+
interface FarmMetadataImageReference {
|
|
5
|
+
kind: MetadataImageKind;
|
|
6
|
+
href: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
contentType?: string;
|
|
11
|
+
}
|
|
12
|
+
interface RenderedMetadataHead {
|
|
13
|
+
title: string;
|
|
14
|
+
tags: string;
|
|
15
|
+
hasFavicon: boolean;
|
|
16
|
+
}
|
|
17
|
+
type MetadataRecord = Metadata & Record<string, any>;
|
|
18
|
+
declare function mergeMetadata(base: MetadataRecord | undefined, next: MetadataRecord | undefined): MetadataRecord;
|
|
19
|
+
declare function addMetadataImageReference(metadata: MetadataRecord, reference: FarmMetadataImageReference): MetadataRecord;
|
|
20
|
+
declare function renderMetadataHead(metadata: MetadataRecord | undefined): RenderedMetadataHead;
|
|
21
|
+
|
|
22
|
+
export { type MetadataImageKind as M, addMetadataImageReference as a, mergeMetadata as m, renderMetadataHead as r };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { s as Metadata } from './client-plugins-Bc5jHcNr.js';
|
|
2
|
+
|
|
3
|
+
type MetadataImageKind = "opengraph" | "twitter";
|
|
4
|
+
interface FarmMetadataImageReference {
|
|
5
|
+
kind: MetadataImageKind;
|
|
6
|
+
href: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
contentType?: string;
|
|
11
|
+
}
|
|
12
|
+
interface RenderedMetadataHead {
|
|
13
|
+
title: string;
|
|
14
|
+
tags: string;
|
|
15
|
+
hasFavicon: boolean;
|
|
16
|
+
}
|
|
17
|
+
type MetadataRecord = Metadata & Record<string, any>;
|
|
18
|
+
declare function mergeMetadata(base: MetadataRecord | undefined, next: MetadataRecord | undefined): MetadataRecord;
|
|
19
|
+
declare function addMetadataImageReference(metadata: MetadataRecord, reference: FarmMetadataImageReference): MetadataRecord;
|
|
20
|
+
declare function renderMetadataHead(metadata: MetadataRecord | undefined): RenderedMetadataHead;
|
|
21
|
+
|
|
22
|
+
export { type MetadataImageKind as M, addMetadataImageReference as a, mergeMetadata as m, renderMetadataHead as r };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { cs as MiddlewareChain, cw as RateLimitStorage, cx as RateLimitStatus, cn as MiddlewareContext, Y as FarmMiddlewareConfig, co as MiddlewareFunction, d2 as MiddlewareConfig, M as MiddlewareProps } from './client-plugins-jsk-ZLzJ.mjs';
|
|
2
|
+
export { ct as CookieJar, cu as CookieOptions, cz as MiddlewareResult, cr as MiddlewareStore, cy as NextFunction, cv as RateLimitConfig, X as ReadonlyMiddlewareStore, cp as RequestMiddleware, cq as RequestMiddlewareContext } from './client-plugins-jsk-ZLzJ.mjs';
|
|
3
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
+
import { ViteDevServer, Plugin } from 'vite';
|
|
5
|
+
import { R as ResolvedFarmI18nConfig } from './types-BMxWr97v.mjs';
|
|
6
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner, g as getMiddlewareContext, d as getMiddlewareData, e as getMiddlewareValue } from './production-runtime-B-fweKts.mjs';
|
|
7
|
+
import './plugin-BJDf43dc.mjs';
|
|
8
|
+
import 'react';
|
|
9
|
+
import './types-D1A6-XvH.mjs';
|
|
10
|
+
import 'db0';
|
|
11
|
+
import 'unstorage';
|
|
12
|
+
import './integration-api-CHT2OKAf.mjs';
|
|
13
|
+
import '@farming-labs/orm';
|
|
14
|
+
import './types-C9N-nk5R.mjs';
|
|
15
|
+
import '@farming-labs/docs';
|
|
16
|
+
import './markdown.mjs';
|
|
17
|
+
import './observability.mjs';
|
|
18
|
+
import './workflows.mjs';
|
|
19
|
+
import './cron.mjs';
|
|
20
|
+
import './env.mjs';
|
|
21
|
+
import './server-action-security.mjs';
|
|
22
|
+
import './image-config-Duob7wER.mjs';
|
|
23
|
+
import './cache.mjs';
|
|
24
|
+
import './route-runtime-DoOHzCAD.mjs';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Middleware Chain Builder
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get rate limit status for a key
|
|
32
|
+
* @example
|
|
33
|
+
* const status = await getRateLimitStatus('user:123', 100, storage);
|
|
34
|
+
*/
|
|
35
|
+
declare function getRateLimitStatus(key: string, limit: number, storage?: RateLimitStorage): Promise<RateLimitStatus>;
|
|
36
|
+
declare function middleware(basePath?: string): MiddlewareChain;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Middleware Context Implementation
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create a middleware context from request/response
|
|
44
|
+
*/
|
|
45
|
+
declare function createContext(req: IncomingMessage, res: ServerResponse, viteServer?: ViteDevServer, parent?: MiddlewareContext["parent"]): MiddlewareContext;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Middleware Manager
|
|
49
|
+
*
|
|
50
|
+
* Discovers and executes middleware files in the file system
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
interface DiscoveredMiddleware {
|
|
54
|
+
path: string;
|
|
55
|
+
filePath: string;
|
|
56
|
+
handlers: MiddlewareFunction[];
|
|
57
|
+
config?: MiddlewareConfig;
|
|
58
|
+
source?: "config" | "file";
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Middleware Manager - discovers and executes middleware
|
|
62
|
+
*/
|
|
63
|
+
declare class MiddlewareManager {
|
|
64
|
+
private middleware;
|
|
65
|
+
private configMiddleware;
|
|
66
|
+
private globalConfig?;
|
|
67
|
+
private viteServer?;
|
|
68
|
+
private appDirs;
|
|
69
|
+
private i18n?;
|
|
70
|
+
constructor(appDir: string | readonly string[], viteServer?: ViteDevServer, config?: FarmMiddlewareConfig, i18n?: ResolvedFarmI18nConfig);
|
|
71
|
+
configure(config?: FarmMiddlewareConfig): void;
|
|
72
|
+
/**
|
|
73
|
+
* Discover all middleware.ts files
|
|
74
|
+
*/
|
|
75
|
+
discover(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Recursively discover middleware files
|
|
78
|
+
*/
|
|
79
|
+
private discoverInDirectory;
|
|
80
|
+
/**
|
|
81
|
+
* Find middleware file in directory
|
|
82
|
+
*/
|
|
83
|
+
private findMiddlewareFile;
|
|
84
|
+
/**
|
|
85
|
+
* Load a middleware file
|
|
86
|
+
*/
|
|
87
|
+
private loadMiddleware;
|
|
88
|
+
/**
|
|
89
|
+
* Execute middleware for a request
|
|
90
|
+
*/
|
|
91
|
+
execute(req: IncomingMessage, res: ServerResponse): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* Check if pathname matches middleware config
|
|
94
|
+
*/
|
|
95
|
+
private matchesConfig;
|
|
96
|
+
/**
|
|
97
|
+
* Match a pattern against pathname
|
|
98
|
+
*/
|
|
99
|
+
private matchPattern;
|
|
100
|
+
/**
|
|
101
|
+
* Reload middleware (for HMR)
|
|
102
|
+
*/
|
|
103
|
+
reload(): Promise<void>;
|
|
104
|
+
getMiddlewares(): DiscoveredMiddleware[];
|
|
105
|
+
hasMiddleware(): boolean;
|
|
106
|
+
private matchRoutePath;
|
|
107
|
+
private toMatcherList;
|
|
108
|
+
private getConfigHandlers;
|
|
109
|
+
private toMiddlewareConfig;
|
|
110
|
+
private compilePathPattern;
|
|
111
|
+
private parseColonParam;
|
|
112
|
+
private escapeRegex;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Middleware helper utilities for pages
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Unwrap middleware data from PageProps
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* export default async function Page(props: PageProps) {
|
|
125
|
+
* const { user, stats } = await unwrapMiddleware(props.middleware, {
|
|
126
|
+
* user: null,
|
|
127
|
+
* stats: { views: 0, clicks: 0 }
|
|
128
|
+
* });
|
|
129
|
+
*
|
|
130
|
+
* return <div>Welcome {user?.name}</div>;
|
|
131
|
+
* }
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
declare function unwrapMiddleware<T extends Record<string, any>>(middleware: MiddlewareProps | undefined, defaults?: Partial<T>): Partial<T>;
|
|
135
|
+
/**
|
|
136
|
+
* Get a single value from middleware with a default
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```tsx
|
|
140
|
+
* export default async function Page(props: PageProps) {
|
|
141
|
+
* const user = await getMiddlewareValue(props.middleware, 'user', null);
|
|
142
|
+
* return <div>Welcome {user?.name || 'Guest'}</div>;
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
declare function getFromMiddleware<T = any>(middleware: MiddlewareProps | undefined, key: string, defaultValue?: T): T | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Check if middleware data exists
|
|
149
|
+
*/
|
|
150
|
+
declare function hasMiddlewareData(middleware: MiddlewareProps | undefined): boolean;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Standalone Vite middleware support used by Farm's RSC and API plugins.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
interface FarmMiddlewarePluginOptions {
|
|
157
|
+
/** Source directory (default: `src`). */
|
|
158
|
+
srcDir?: string;
|
|
159
|
+
/** Enable debug logging. */
|
|
160
|
+
debug?: boolean;
|
|
161
|
+
}
|
|
162
|
+
declare function farmMiddlewarePlugin(options?: FarmMiddlewarePluginOptions): Plugin;
|
|
163
|
+
|
|
164
|
+
export { FarmMiddlewareConfig, type FarmMiddlewarePluginOptions, MiddlewareChain, MiddlewareConfig, MiddlewareContext, MiddlewareFunction, MiddlewareManager, RateLimitStatus, RateLimitStorage, createContext, farmMiddlewarePlugin, getFromMiddleware, getRateLimitStatus, hasMiddlewareData, middleware, unwrapMiddleware };
|