@farm.js/core 0.1.0-beta.14 → 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.cjs.map +1 -1
- package/dist/api/route-manager.d.mts +66 -0
- package/dist/api/route-manager.d.ts +66 -0
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api/runtime.cjs.map +1 -1
- package/dist/api/runtime.d.mts +3 -0
- package/dist/api/runtime.d.ts +3 -0
- package/dist/api/runtime.mjs +1 -1
- package/dist/api.cjs +18 -10
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.mts +48 -0
- package/dist/api.d.ts +48 -0
- package/dist/api.mjs +3 -3
- 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-VUL55IAX.mjs → chunk-2FLBZFPG.mjs} +19 -19
- package/dist/chunk-2FLBZFPG.mjs.map +1 -0
- package/dist/{chunk-B232I2GP.mjs → chunk-3HIVDX7J.mjs} +12 -1
- package/dist/chunk-3HIVDX7J.mjs.map +1 -0
- package/dist/{chunk-JDEOUK5V.mjs → chunk-6YXKHAFU.mjs} +3 -3
- package/dist/{chunk-Z5CQMP54.mjs → chunk-ARRYKOI5.mjs} +2 -2
- package/dist/{chunk-KLA67WKG.mjs → chunk-B3FFOIWS.mjs} +2 -2
- package/dist/chunk-E257KFBU.mjs +227 -0
- package/dist/chunk-E257KFBU.mjs.map +1 -0
- package/dist/{chunk-PFE6GMNE.mjs → chunk-HMRFYJK6.mjs} +19 -11
- package/dist/chunk-HMRFYJK6.mjs.map +1 -0
- package/dist/{chunk-OPHK6OJN.mjs → chunk-JAEAE27K.mjs} +2 -2
- package/dist/{chunk-32W4QEJP.mjs → chunk-KFTGPFRD.mjs} +1 -1
- package/dist/chunk-KFTGPFRD.mjs.map +1 -0
- package/dist/{chunk-L2PE36GQ.mjs → chunk-PZXBQKCH.mjs} +15 -6
- 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-PNFQQSRA.mjs → chunk-T2M5QANG.mjs} +143 -41
- package/dist/chunk-T2M5QANG.mjs.map +1 -0
- package/dist/{chunk-WDU6QXNK.mjs → chunk-UCYWGN2P.mjs} +1 -1
- package/dist/chunk-UCYWGN2P.mjs.map +1 -0
- package/dist/{chunk-65A7QIKI.mjs → chunk-UMVLB3PN.mjs} +3 -3
- package/dist/chunk-UMVLB3PN.mjs.map +1 -0
- package/dist/{chunk-ARCGE2VT.mjs → chunk-VFDBC3W7.mjs} +2 -2
- package/dist/{chunk-ARCGE2VT.mjs.map → chunk-VFDBC3W7.mjs.map} +1 -1
- package/dist/{chunk-VY2UYN5R.mjs → chunk-VPCFICID.mjs} +82 -3
- package/dist/chunk-VPCFICID.mjs.map +1 -0
- package/dist/{chunk-H3TE3LOV.mjs → chunk-XMFTIVJH.mjs} +2 -2
- package/dist/{chunk-UB5UOSHB.mjs → chunk-ZVMV3THA.mjs} +71 -2
- package/dist/chunk-ZVMV3THA.mjs.map +1 -0
- 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.cjs.map +1 -1
- package/dist/client.d.mts +452 -0
- package/dist/client.d.ts +452 -0
- package/dist/client.mjs +3 -3
- 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.cjs +12 -0
- package/dist/deployment.cjs.map +1 -1
- package/dist/deployment.d.mts +36 -0
- package/dist/deployment.d.ts +36 -0
- package/dist/deployment.mjs +3 -1
- package/dist/{devtools-GAZ7F3KL.mjs → devtools-K2ERKGNI.mjs} +5 -5
- 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 +5 -5
- 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 +598 -109
- 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 +45 -29
- 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 +438 -176
- 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 +13 -13
- 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 +4 -4
- 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.cjs.map +1 -1
- package/dist/navigation.d.mts +14 -0
- package/dist/navigation.d.ts +14 -0
- package/dist/navigation.mjs +3 -3
- 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 +247 -28
- 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 +10 -10
- 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.cjs +23 -1
- package/dist/server-action-security.cjs.map +1 -1
- package/dist/server-action-security.d.mts +45 -0
- package/dist/server-action-security.d.ts +45 -0
- package/dist/server-action-security.mjs +1 -1
- package/dist/server-fn-client.cjs.map +1 -1
- package/dist/server-fn-client.d.mts +33 -0
- package/dist/server-fn-client.d.ts +33 -0
- package/dist/server-fn-client.mjs +1 -1
- package/dist/server-fn-error-DDh14a0V.d.mts +26 -0
- package/dist/server-fn-error-DDh14a0V.d.ts +26 -0
- package/dist/server-fn.cjs +140 -3
- package/dist/server-fn.cjs.map +1 -1
- package/dist/server-fn.d.mts +121 -0
- package/dist/server-fn.d.ts +121 -0
- package/dist/server-fn.mjs +14 -3
- 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.cjs +99 -1
- package/dist/server-query.cjs.map +1 -1
- package/dist/server-query.d.mts +37 -0
- package/dist/server-query.d.ts +37 -0
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +403 -33
- 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 +14 -14
- package/dist/storage.d.mts +52 -0
- package/dist/storage.d.ts +52 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.mts +103 -0
- package/dist/testing.d.ts +103 -0
- package/dist/testing.mjs +3 -3
- 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 +255 -30
- 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 +10 -10
- 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-32W4QEJP.mjs.map +0 -1
- package/dist/chunk-65A7QIKI.mjs.map +0 -1
- package/dist/chunk-B232I2GP.mjs.map +0 -1
- package/dist/chunk-I4CUBGVF.mjs +0 -93
- package/dist/chunk-I4CUBGVF.mjs.map +0 -1
- package/dist/chunk-L2PE36GQ.mjs.map +0 -1
- package/dist/chunk-PFE6GMNE.mjs.map +0 -1
- package/dist/chunk-PNFQQSRA.mjs.map +0 -1
- package/dist/chunk-UB5UOSHB.mjs.map +0 -1
- package/dist/chunk-UXUAWNO5.mjs.map +0 -1
- package/dist/chunk-VUL55IAX.mjs.map +0 -1
- package/dist/chunk-VY2UYN5R.mjs.map +0 -1
- package/dist/chunk-WDU6QXNK.mjs.map +0 -1
- /package/dist/{chunk-JDEOUK5V.mjs.map → chunk-6YXKHAFU.mjs.map} +0 -0
- /package/dist/{chunk-Z5CQMP54.mjs.map → chunk-ARRYKOI5.mjs.map} +0 -0
- /package/dist/{chunk-KLA67WKG.mjs.map → chunk-B3FFOIWS.mjs.map} +0 -0
- /package/dist/{chunk-OPHK6OJN.mjs.map → chunk-JAEAE27K.mjs.map} +0 -0
- /package/dist/{chunk-H3TE3LOV.mjs.map → chunk-XMFTIVJH.mjs.map} +0 -0
- /package/dist/{devtools-GAZ7F3KL.mjs.map → devtools-K2ERKGNI.mjs.map} +0 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
type FarmEventLevel = "debug" | "info" | "warn" | "error";
|
|
2
|
+
interface FarmEventBase {
|
|
3
|
+
type: string;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
level: FarmEventLevel;
|
|
6
|
+
requestId?: string;
|
|
7
|
+
route?: string;
|
|
8
|
+
pathname?: string;
|
|
9
|
+
}
|
|
10
|
+
type FarmServerEvent = (FarmEventBase & {
|
|
11
|
+
type: "server.start";
|
|
12
|
+
mode: "dev" | "preview" | "production";
|
|
13
|
+
port?: number;
|
|
14
|
+
}) | (FarmEventBase & {
|
|
15
|
+
type: "server.ready";
|
|
16
|
+
url?: string;
|
|
17
|
+
}) | (FarmEventBase & {
|
|
18
|
+
type: "server.shutdown";
|
|
19
|
+
reason?: string;
|
|
20
|
+
});
|
|
21
|
+
type FarmRouteEvent = (FarmEventBase & {
|
|
22
|
+
type: "route.discovered";
|
|
23
|
+
route: string;
|
|
24
|
+
filePath: string;
|
|
25
|
+
}) | (FarmEventBase & {
|
|
26
|
+
type: "route.matched";
|
|
27
|
+
pathname: string;
|
|
28
|
+
route: string;
|
|
29
|
+
params?: Record<string, string>;
|
|
30
|
+
}) | (FarmEventBase & {
|
|
31
|
+
type: "route.notFound";
|
|
32
|
+
pathname: string;
|
|
33
|
+
}) | (FarmEventBase & {
|
|
34
|
+
type: "route.redirect";
|
|
35
|
+
from: string;
|
|
36
|
+
to: string;
|
|
37
|
+
status?: number;
|
|
38
|
+
}) | (FarmEventBase & {
|
|
39
|
+
type: "route.rewrite";
|
|
40
|
+
from: string;
|
|
41
|
+
to: string;
|
|
42
|
+
});
|
|
43
|
+
type FarmRenderEvent = (FarmEventBase & {
|
|
44
|
+
type: "render.start";
|
|
45
|
+
route: string;
|
|
46
|
+
pathname?: string;
|
|
47
|
+
}) | (FarmEventBase & {
|
|
48
|
+
type: "render.complete";
|
|
49
|
+
route: string;
|
|
50
|
+
durationMs: number;
|
|
51
|
+
status?: number;
|
|
52
|
+
}) | (FarmEventBase & {
|
|
53
|
+
type: "render.error";
|
|
54
|
+
route?: string;
|
|
55
|
+
error: unknown;
|
|
56
|
+
}) | (FarmEventBase & {
|
|
57
|
+
type: "render.stream.start";
|
|
58
|
+
route: string;
|
|
59
|
+
}) | (FarmEventBase & {
|
|
60
|
+
type: "render.stream.shellReady";
|
|
61
|
+
route: string;
|
|
62
|
+
durationMs: number;
|
|
63
|
+
}) | (FarmEventBase & {
|
|
64
|
+
type: "render.stream.complete";
|
|
65
|
+
route: string;
|
|
66
|
+
durationMs: number;
|
|
67
|
+
});
|
|
68
|
+
type FarmCacheEvent = (FarmEventBase & {
|
|
69
|
+
type: "cache.hit";
|
|
70
|
+
key: string;
|
|
71
|
+
route?: string;
|
|
72
|
+
tags?: readonly string[];
|
|
73
|
+
revalidate?: number | false;
|
|
74
|
+
stale?: boolean;
|
|
75
|
+
}) | (FarmEventBase & {
|
|
76
|
+
type: "cache.miss";
|
|
77
|
+
key: string;
|
|
78
|
+
route?: string;
|
|
79
|
+
reason?: string;
|
|
80
|
+
}) | (FarmEventBase & {
|
|
81
|
+
type: "cache.set";
|
|
82
|
+
key: string;
|
|
83
|
+
route?: string;
|
|
84
|
+
tags?: readonly string[];
|
|
85
|
+
revalidate?: number | false;
|
|
86
|
+
}) | (FarmEventBase & {
|
|
87
|
+
type: "cache.dedupe";
|
|
88
|
+
key: string;
|
|
89
|
+
}) | (FarmEventBase & {
|
|
90
|
+
type: "cache.bypass";
|
|
91
|
+
key?: string;
|
|
92
|
+
route?: string;
|
|
93
|
+
reason: string;
|
|
94
|
+
}) | (FarmEventBase & {
|
|
95
|
+
type: "cache.stale";
|
|
96
|
+
key: string;
|
|
97
|
+
route?: string;
|
|
98
|
+
tags?: readonly string[];
|
|
99
|
+
revalidate?: number | false;
|
|
100
|
+
}) | (FarmEventBase & {
|
|
101
|
+
type: "cache.revalidatePath";
|
|
102
|
+
path: string;
|
|
103
|
+
count: number;
|
|
104
|
+
}) | (FarmEventBase & {
|
|
105
|
+
type: "cache.revalidateTag";
|
|
106
|
+
tag: string;
|
|
107
|
+
profile?: unknown;
|
|
108
|
+
count: number;
|
|
109
|
+
}) | (FarmEventBase & {
|
|
110
|
+
type: "cache.updateTag";
|
|
111
|
+
tag: string;
|
|
112
|
+
count: number;
|
|
113
|
+
}) | (FarmEventBase & {
|
|
114
|
+
type: "cache.invalidated";
|
|
115
|
+
key?: string;
|
|
116
|
+
route?: string;
|
|
117
|
+
tag?: string;
|
|
118
|
+
reason?: string;
|
|
119
|
+
count?: number;
|
|
120
|
+
}) | (FarmEventBase & {
|
|
121
|
+
type: "cache.delete";
|
|
122
|
+
key: string;
|
|
123
|
+
deleted: boolean;
|
|
124
|
+
}) | (FarmEventBase & {
|
|
125
|
+
type: "cache.clear";
|
|
126
|
+
count: number;
|
|
127
|
+
}) | (FarmEventBase & {
|
|
128
|
+
type: "cache.error";
|
|
129
|
+
key?: string;
|
|
130
|
+
operation: "get" | "set" | "delete" | "revalidate";
|
|
131
|
+
error: unknown;
|
|
132
|
+
});
|
|
133
|
+
type FarmPPREvent = (FarmEventBase & {
|
|
134
|
+
type: "ppr.shell.hit";
|
|
135
|
+
route: string;
|
|
136
|
+
key: string;
|
|
137
|
+
}) | (FarmEventBase & {
|
|
138
|
+
type: "ppr.shell.miss";
|
|
139
|
+
route: string;
|
|
140
|
+
key: string;
|
|
141
|
+
}) | (FarmEventBase & {
|
|
142
|
+
type: "ppr.shell.cached";
|
|
143
|
+
route: string;
|
|
144
|
+
key: string;
|
|
145
|
+
revalidate?: number;
|
|
146
|
+
}) | (FarmEventBase & {
|
|
147
|
+
type: "ppr.shell.bypass";
|
|
148
|
+
route: string;
|
|
149
|
+
reason: string;
|
|
150
|
+
}) | (FarmEventBase & {
|
|
151
|
+
type: "ppr.shell.invalidated";
|
|
152
|
+
route: string;
|
|
153
|
+
reason?: string;
|
|
154
|
+
count?: number;
|
|
155
|
+
}) | (FarmEventBase & {
|
|
156
|
+
type: "ppr.suspense.holeDetected";
|
|
157
|
+
route: string;
|
|
158
|
+
}) | (FarmEventBase & {
|
|
159
|
+
type: "ppr.refresh.start";
|
|
160
|
+
route: string;
|
|
161
|
+
}) | (FarmEventBase & {
|
|
162
|
+
type: "ppr.refresh.complete";
|
|
163
|
+
route: string;
|
|
164
|
+
durationMs: number;
|
|
165
|
+
}) | (FarmEventBase & {
|
|
166
|
+
type: "ppr.refresh.error";
|
|
167
|
+
route: string;
|
|
168
|
+
error: unknown;
|
|
169
|
+
});
|
|
170
|
+
type FarmAPIEvent = (FarmEventBase & {
|
|
171
|
+
type: "api.request.start";
|
|
172
|
+
route: string;
|
|
173
|
+
method: string;
|
|
174
|
+
}) | (FarmEventBase & {
|
|
175
|
+
type: "api.request.complete";
|
|
176
|
+
route: string;
|
|
177
|
+
method: string;
|
|
178
|
+
status: number;
|
|
179
|
+
durationMs: number;
|
|
180
|
+
}) | (FarmEventBase & {
|
|
181
|
+
type: "api.validation.failed";
|
|
182
|
+
route: string;
|
|
183
|
+
method: string;
|
|
184
|
+
issues?: unknown;
|
|
185
|
+
}) | (FarmEventBase & {
|
|
186
|
+
type: "api.error";
|
|
187
|
+
route: string;
|
|
188
|
+
method: string;
|
|
189
|
+
error: unknown;
|
|
190
|
+
});
|
|
191
|
+
type FarmIntegrationEvent = (FarmEventBase & {
|
|
192
|
+
type: "integration.registered";
|
|
193
|
+
name: string;
|
|
194
|
+
}) | (FarmEventBase & {
|
|
195
|
+
type: "integration.config.validated";
|
|
196
|
+
name: string;
|
|
197
|
+
}) | (FarmEventBase & {
|
|
198
|
+
type: "integration.ready";
|
|
199
|
+
name: string;
|
|
200
|
+
}) | (FarmEventBase & {
|
|
201
|
+
type: "integration.disposed";
|
|
202
|
+
name: string;
|
|
203
|
+
}) | (FarmEventBase & {
|
|
204
|
+
type: "integration.api.call.start";
|
|
205
|
+
integration: string;
|
|
206
|
+
operation: string;
|
|
207
|
+
}) | (FarmEventBase & {
|
|
208
|
+
type: "integration.api.call.complete";
|
|
209
|
+
integration: string;
|
|
210
|
+
operation: string;
|
|
211
|
+
durationMs: number;
|
|
212
|
+
}) | (FarmEventBase & {
|
|
213
|
+
type: "integration.api.call.error";
|
|
214
|
+
integration: string;
|
|
215
|
+
operation: string;
|
|
216
|
+
error: unknown;
|
|
217
|
+
}) | (FarmEventBase & {
|
|
218
|
+
type: "integration.webhook.received";
|
|
219
|
+
integration: string;
|
|
220
|
+
event?: string;
|
|
221
|
+
}) | (FarmEventBase & {
|
|
222
|
+
type: "integration.webhook.verified";
|
|
223
|
+
integration: string;
|
|
224
|
+
event?: string;
|
|
225
|
+
}) | (FarmEventBase & {
|
|
226
|
+
type: "integration.webhook.failed";
|
|
227
|
+
integration: string;
|
|
228
|
+
reason: string;
|
|
229
|
+
});
|
|
230
|
+
type FarmMiddlewareEvent = (FarmEventBase & {
|
|
231
|
+
type: "middleware.start";
|
|
232
|
+
route?: string;
|
|
233
|
+
name?: string;
|
|
234
|
+
}) | (FarmEventBase & {
|
|
235
|
+
type: "middleware.complete";
|
|
236
|
+
route?: string;
|
|
237
|
+
name?: string;
|
|
238
|
+
durationMs: number;
|
|
239
|
+
}) | (FarmEventBase & {
|
|
240
|
+
type: "middleware.shortCircuit";
|
|
241
|
+
route?: string;
|
|
242
|
+
name?: string;
|
|
243
|
+
status?: number;
|
|
244
|
+
}) | (FarmEventBase & {
|
|
245
|
+
type: "middleware.error";
|
|
246
|
+
route?: string;
|
|
247
|
+
name?: string;
|
|
248
|
+
error: unknown;
|
|
249
|
+
});
|
|
250
|
+
type FarmStorageEvent = (FarmEventBase & {
|
|
251
|
+
type: "storage.query.start";
|
|
252
|
+
integration?: string;
|
|
253
|
+
operation: string;
|
|
254
|
+
}) | (FarmEventBase & {
|
|
255
|
+
type: "storage.query.complete";
|
|
256
|
+
integration?: string;
|
|
257
|
+
operation: string;
|
|
258
|
+
durationMs: number;
|
|
259
|
+
}) | (FarmEventBase & {
|
|
260
|
+
type: "storage.query.error";
|
|
261
|
+
integration?: string;
|
|
262
|
+
operation: string;
|
|
263
|
+
error: unknown;
|
|
264
|
+
}) | (FarmEventBase & {
|
|
265
|
+
type: "storage.schema.ready";
|
|
266
|
+
integration?: string;
|
|
267
|
+
}) | (FarmEventBase & {
|
|
268
|
+
type: "storage.schema.error";
|
|
269
|
+
integration?: string;
|
|
270
|
+
error: unknown;
|
|
271
|
+
});
|
|
272
|
+
type FarmBuildEvent = (FarmEventBase & {
|
|
273
|
+
type: "build.start";
|
|
274
|
+
target?: string;
|
|
275
|
+
}) | (FarmEventBase & {
|
|
276
|
+
type: "build.complete";
|
|
277
|
+
target?: string;
|
|
278
|
+
durationMs: number;
|
|
279
|
+
}) | (FarmEventBase & {
|
|
280
|
+
type: "build.error";
|
|
281
|
+
target?: string;
|
|
282
|
+
error: unknown;
|
|
283
|
+
}) | (FarmEventBase & {
|
|
284
|
+
type: "routes.generated";
|
|
285
|
+
pageCount: number;
|
|
286
|
+
apiCount?: number;
|
|
287
|
+
}) | (FarmEventBase & {
|
|
288
|
+
type: "types.generated";
|
|
289
|
+
filePath: string;
|
|
290
|
+
}) | (FarmEventBase & {
|
|
291
|
+
type: "manifest.generated";
|
|
292
|
+
routeCount: number;
|
|
293
|
+
});
|
|
294
|
+
type FarmPluginEvent = (FarmEventBase & {
|
|
295
|
+
type: "plugin.hook.start";
|
|
296
|
+
plugin: string;
|
|
297
|
+
hook: string;
|
|
298
|
+
}) | (FarmEventBase & {
|
|
299
|
+
type: "plugin.hook.complete";
|
|
300
|
+
plugin: string;
|
|
301
|
+
hook: string;
|
|
302
|
+
durationMs: number;
|
|
303
|
+
}) | (FarmEventBase & {
|
|
304
|
+
type: "plugin.hook.error";
|
|
305
|
+
plugin: string;
|
|
306
|
+
hook: string;
|
|
307
|
+
error: unknown;
|
|
308
|
+
});
|
|
309
|
+
type FarmErrorEvent = FarmEventBase & {
|
|
310
|
+
type: "error";
|
|
311
|
+
source: string;
|
|
312
|
+
error: unknown;
|
|
313
|
+
route?: string;
|
|
314
|
+
};
|
|
315
|
+
type FarmEvent = FarmServerEvent | FarmRouteEvent | FarmRenderEvent | FarmCacheEvent | FarmPPREvent | FarmAPIEvent | FarmIntegrationEvent | FarmMiddlewareEvent | FarmStorageEvent | FarmBuildEvent | FarmPluginEvent | FarmErrorEvent;
|
|
316
|
+
type FarmEventType = FarmEvent["type"];
|
|
317
|
+
type FarmEventHandler = (event: FarmEvent) => void | Promise<void>;
|
|
318
|
+
type FarmEventInput = FarmEvent extends infer T ? T extends FarmEvent ? Omit<T, "timestamp" | "level"> & Partial<Pick<T, "timestamp" | "level">> : never : never;
|
|
319
|
+
type FarmObservabilityUserConfig = boolean | {
|
|
320
|
+
logs?: boolean;
|
|
321
|
+
onEvent?: FarmEventHandler | readonly FarmEventHandler[];
|
|
322
|
+
events?: readonly FarmEventType[];
|
|
323
|
+
};
|
|
324
|
+
interface FarmResolvedObservabilityConfig {
|
|
325
|
+
logs: boolean;
|
|
326
|
+
handlers: FarmEventHandler[];
|
|
327
|
+
events?: Set<FarmEventType>;
|
|
328
|
+
}
|
|
329
|
+
declare function configureFarmObservability(config: FarmObservabilityUserConfig | undefined): void;
|
|
330
|
+
declare function normalizeFarmObservabilityConfig(config: FarmObservabilityUserConfig | undefined): FarmResolvedObservabilityConfig;
|
|
331
|
+
declare function onFarmEvent(handler: FarmEventHandler): () => void;
|
|
332
|
+
declare function resetFarmObservability(): void;
|
|
333
|
+
declare function emitFarmEvent(input: FarmEventInput): FarmEvent;
|
|
334
|
+
|
|
335
|
+
export { type FarmAPIEvent, type FarmBuildEvent, type FarmCacheEvent, type FarmErrorEvent, type FarmEvent, type FarmEventBase, type FarmEventHandler, type FarmEventInput, type FarmEventLevel, type FarmEventType, type FarmIntegrationEvent, type FarmMiddlewareEvent, type FarmObservabilityUserConfig, type FarmPPREvent, type FarmPluginEvent, type FarmRenderEvent, type FarmResolvedObservabilityConfig, type FarmRouteEvent, type FarmServerEvent, type FarmStorageEvent, configureFarmObservability, emitFarmEvent, normalizeFarmObservabilityConfig, onFarmEvent, resetFarmObservability };
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
type FarmEventLevel = "debug" | "info" | "warn" | "error";
|
|
2
|
+
interface FarmEventBase {
|
|
3
|
+
type: string;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
level: FarmEventLevel;
|
|
6
|
+
requestId?: string;
|
|
7
|
+
route?: string;
|
|
8
|
+
pathname?: string;
|
|
9
|
+
}
|
|
10
|
+
type FarmServerEvent = (FarmEventBase & {
|
|
11
|
+
type: "server.start";
|
|
12
|
+
mode: "dev" | "preview" | "production";
|
|
13
|
+
port?: number;
|
|
14
|
+
}) | (FarmEventBase & {
|
|
15
|
+
type: "server.ready";
|
|
16
|
+
url?: string;
|
|
17
|
+
}) | (FarmEventBase & {
|
|
18
|
+
type: "server.shutdown";
|
|
19
|
+
reason?: string;
|
|
20
|
+
});
|
|
21
|
+
type FarmRouteEvent = (FarmEventBase & {
|
|
22
|
+
type: "route.discovered";
|
|
23
|
+
route: string;
|
|
24
|
+
filePath: string;
|
|
25
|
+
}) | (FarmEventBase & {
|
|
26
|
+
type: "route.matched";
|
|
27
|
+
pathname: string;
|
|
28
|
+
route: string;
|
|
29
|
+
params?: Record<string, string>;
|
|
30
|
+
}) | (FarmEventBase & {
|
|
31
|
+
type: "route.notFound";
|
|
32
|
+
pathname: string;
|
|
33
|
+
}) | (FarmEventBase & {
|
|
34
|
+
type: "route.redirect";
|
|
35
|
+
from: string;
|
|
36
|
+
to: string;
|
|
37
|
+
status?: number;
|
|
38
|
+
}) | (FarmEventBase & {
|
|
39
|
+
type: "route.rewrite";
|
|
40
|
+
from: string;
|
|
41
|
+
to: string;
|
|
42
|
+
});
|
|
43
|
+
type FarmRenderEvent = (FarmEventBase & {
|
|
44
|
+
type: "render.start";
|
|
45
|
+
route: string;
|
|
46
|
+
pathname?: string;
|
|
47
|
+
}) | (FarmEventBase & {
|
|
48
|
+
type: "render.complete";
|
|
49
|
+
route: string;
|
|
50
|
+
durationMs: number;
|
|
51
|
+
status?: number;
|
|
52
|
+
}) | (FarmEventBase & {
|
|
53
|
+
type: "render.error";
|
|
54
|
+
route?: string;
|
|
55
|
+
error: unknown;
|
|
56
|
+
}) | (FarmEventBase & {
|
|
57
|
+
type: "render.stream.start";
|
|
58
|
+
route: string;
|
|
59
|
+
}) | (FarmEventBase & {
|
|
60
|
+
type: "render.stream.shellReady";
|
|
61
|
+
route: string;
|
|
62
|
+
durationMs: number;
|
|
63
|
+
}) | (FarmEventBase & {
|
|
64
|
+
type: "render.stream.complete";
|
|
65
|
+
route: string;
|
|
66
|
+
durationMs: number;
|
|
67
|
+
});
|
|
68
|
+
type FarmCacheEvent = (FarmEventBase & {
|
|
69
|
+
type: "cache.hit";
|
|
70
|
+
key: string;
|
|
71
|
+
route?: string;
|
|
72
|
+
tags?: readonly string[];
|
|
73
|
+
revalidate?: number | false;
|
|
74
|
+
stale?: boolean;
|
|
75
|
+
}) | (FarmEventBase & {
|
|
76
|
+
type: "cache.miss";
|
|
77
|
+
key: string;
|
|
78
|
+
route?: string;
|
|
79
|
+
reason?: string;
|
|
80
|
+
}) | (FarmEventBase & {
|
|
81
|
+
type: "cache.set";
|
|
82
|
+
key: string;
|
|
83
|
+
route?: string;
|
|
84
|
+
tags?: readonly string[];
|
|
85
|
+
revalidate?: number | false;
|
|
86
|
+
}) | (FarmEventBase & {
|
|
87
|
+
type: "cache.dedupe";
|
|
88
|
+
key: string;
|
|
89
|
+
}) | (FarmEventBase & {
|
|
90
|
+
type: "cache.bypass";
|
|
91
|
+
key?: string;
|
|
92
|
+
route?: string;
|
|
93
|
+
reason: string;
|
|
94
|
+
}) | (FarmEventBase & {
|
|
95
|
+
type: "cache.stale";
|
|
96
|
+
key: string;
|
|
97
|
+
route?: string;
|
|
98
|
+
tags?: readonly string[];
|
|
99
|
+
revalidate?: number | false;
|
|
100
|
+
}) | (FarmEventBase & {
|
|
101
|
+
type: "cache.revalidatePath";
|
|
102
|
+
path: string;
|
|
103
|
+
count: number;
|
|
104
|
+
}) | (FarmEventBase & {
|
|
105
|
+
type: "cache.revalidateTag";
|
|
106
|
+
tag: string;
|
|
107
|
+
profile?: unknown;
|
|
108
|
+
count: number;
|
|
109
|
+
}) | (FarmEventBase & {
|
|
110
|
+
type: "cache.updateTag";
|
|
111
|
+
tag: string;
|
|
112
|
+
count: number;
|
|
113
|
+
}) | (FarmEventBase & {
|
|
114
|
+
type: "cache.invalidated";
|
|
115
|
+
key?: string;
|
|
116
|
+
route?: string;
|
|
117
|
+
tag?: string;
|
|
118
|
+
reason?: string;
|
|
119
|
+
count?: number;
|
|
120
|
+
}) | (FarmEventBase & {
|
|
121
|
+
type: "cache.delete";
|
|
122
|
+
key: string;
|
|
123
|
+
deleted: boolean;
|
|
124
|
+
}) | (FarmEventBase & {
|
|
125
|
+
type: "cache.clear";
|
|
126
|
+
count: number;
|
|
127
|
+
}) | (FarmEventBase & {
|
|
128
|
+
type: "cache.error";
|
|
129
|
+
key?: string;
|
|
130
|
+
operation: "get" | "set" | "delete" | "revalidate";
|
|
131
|
+
error: unknown;
|
|
132
|
+
});
|
|
133
|
+
type FarmPPREvent = (FarmEventBase & {
|
|
134
|
+
type: "ppr.shell.hit";
|
|
135
|
+
route: string;
|
|
136
|
+
key: string;
|
|
137
|
+
}) | (FarmEventBase & {
|
|
138
|
+
type: "ppr.shell.miss";
|
|
139
|
+
route: string;
|
|
140
|
+
key: string;
|
|
141
|
+
}) | (FarmEventBase & {
|
|
142
|
+
type: "ppr.shell.cached";
|
|
143
|
+
route: string;
|
|
144
|
+
key: string;
|
|
145
|
+
revalidate?: number;
|
|
146
|
+
}) | (FarmEventBase & {
|
|
147
|
+
type: "ppr.shell.bypass";
|
|
148
|
+
route: string;
|
|
149
|
+
reason: string;
|
|
150
|
+
}) | (FarmEventBase & {
|
|
151
|
+
type: "ppr.shell.invalidated";
|
|
152
|
+
route: string;
|
|
153
|
+
reason?: string;
|
|
154
|
+
count?: number;
|
|
155
|
+
}) | (FarmEventBase & {
|
|
156
|
+
type: "ppr.suspense.holeDetected";
|
|
157
|
+
route: string;
|
|
158
|
+
}) | (FarmEventBase & {
|
|
159
|
+
type: "ppr.refresh.start";
|
|
160
|
+
route: string;
|
|
161
|
+
}) | (FarmEventBase & {
|
|
162
|
+
type: "ppr.refresh.complete";
|
|
163
|
+
route: string;
|
|
164
|
+
durationMs: number;
|
|
165
|
+
}) | (FarmEventBase & {
|
|
166
|
+
type: "ppr.refresh.error";
|
|
167
|
+
route: string;
|
|
168
|
+
error: unknown;
|
|
169
|
+
});
|
|
170
|
+
type FarmAPIEvent = (FarmEventBase & {
|
|
171
|
+
type: "api.request.start";
|
|
172
|
+
route: string;
|
|
173
|
+
method: string;
|
|
174
|
+
}) | (FarmEventBase & {
|
|
175
|
+
type: "api.request.complete";
|
|
176
|
+
route: string;
|
|
177
|
+
method: string;
|
|
178
|
+
status: number;
|
|
179
|
+
durationMs: number;
|
|
180
|
+
}) | (FarmEventBase & {
|
|
181
|
+
type: "api.validation.failed";
|
|
182
|
+
route: string;
|
|
183
|
+
method: string;
|
|
184
|
+
issues?: unknown;
|
|
185
|
+
}) | (FarmEventBase & {
|
|
186
|
+
type: "api.error";
|
|
187
|
+
route: string;
|
|
188
|
+
method: string;
|
|
189
|
+
error: unknown;
|
|
190
|
+
});
|
|
191
|
+
type FarmIntegrationEvent = (FarmEventBase & {
|
|
192
|
+
type: "integration.registered";
|
|
193
|
+
name: string;
|
|
194
|
+
}) | (FarmEventBase & {
|
|
195
|
+
type: "integration.config.validated";
|
|
196
|
+
name: string;
|
|
197
|
+
}) | (FarmEventBase & {
|
|
198
|
+
type: "integration.ready";
|
|
199
|
+
name: string;
|
|
200
|
+
}) | (FarmEventBase & {
|
|
201
|
+
type: "integration.disposed";
|
|
202
|
+
name: string;
|
|
203
|
+
}) | (FarmEventBase & {
|
|
204
|
+
type: "integration.api.call.start";
|
|
205
|
+
integration: string;
|
|
206
|
+
operation: string;
|
|
207
|
+
}) | (FarmEventBase & {
|
|
208
|
+
type: "integration.api.call.complete";
|
|
209
|
+
integration: string;
|
|
210
|
+
operation: string;
|
|
211
|
+
durationMs: number;
|
|
212
|
+
}) | (FarmEventBase & {
|
|
213
|
+
type: "integration.api.call.error";
|
|
214
|
+
integration: string;
|
|
215
|
+
operation: string;
|
|
216
|
+
error: unknown;
|
|
217
|
+
}) | (FarmEventBase & {
|
|
218
|
+
type: "integration.webhook.received";
|
|
219
|
+
integration: string;
|
|
220
|
+
event?: string;
|
|
221
|
+
}) | (FarmEventBase & {
|
|
222
|
+
type: "integration.webhook.verified";
|
|
223
|
+
integration: string;
|
|
224
|
+
event?: string;
|
|
225
|
+
}) | (FarmEventBase & {
|
|
226
|
+
type: "integration.webhook.failed";
|
|
227
|
+
integration: string;
|
|
228
|
+
reason: string;
|
|
229
|
+
});
|
|
230
|
+
type FarmMiddlewareEvent = (FarmEventBase & {
|
|
231
|
+
type: "middleware.start";
|
|
232
|
+
route?: string;
|
|
233
|
+
name?: string;
|
|
234
|
+
}) | (FarmEventBase & {
|
|
235
|
+
type: "middleware.complete";
|
|
236
|
+
route?: string;
|
|
237
|
+
name?: string;
|
|
238
|
+
durationMs: number;
|
|
239
|
+
}) | (FarmEventBase & {
|
|
240
|
+
type: "middleware.shortCircuit";
|
|
241
|
+
route?: string;
|
|
242
|
+
name?: string;
|
|
243
|
+
status?: number;
|
|
244
|
+
}) | (FarmEventBase & {
|
|
245
|
+
type: "middleware.error";
|
|
246
|
+
route?: string;
|
|
247
|
+
name?: string;
|
|
248
|
+
error: unknown;
|
|
249
|
+
});
|
|
250
|
+
type FarmStorageEvent = (FarmEventBase & {
|
|
251
|
+
type: "storage.query.start";
|
|
252
|
+
integration?: string;
|
|
253
|
+
operation: string;
|
|
254
|
+
}) | (FarmEventBase & {
|
|
255
|
+
type: "storage.query.complete";
|
|
256
|
+
integration?: string;
|
|
257
|
+
operation: string;
|
|
258
|
+
durationMs: number;
|
|
259
|
+
}) | (FarmEventBase & {
|
|
260
|
+
type: "storage.query.error";
|
|
261
|
+
integration?: string;
|
|
262
|
+
operation: string;
|
|
263
|
+
error: unknown;
|
|
264
|
+
}) | (FarmEventBase & {
|
|
265
|
+
type: "storage.schema.ready";
|
|
266
|
+
integration?: string;
|
|
267
|
+
}) | (FarmEventBase & {
|
|
268
|
+
type: "storage.schema.error";
|
|
269
|
+
integration?: string;
|
|
270
|
+
error: unknown;
|
|
271
|
+
});
|
|
272
|
+
type FarmBuildEvent = (FarmEventBase & {
|
|
273
|
+
type: "build.start";
|
|
274
|
+
target?: string;
|
|
275
|
+
}) | (FarmEventBase & {
|
|
276
|
+
type: "build.complete";
|
|
277
|
+
target?: string;
|
|
278
|
+
durationMs: number;
|
|
279
|
+
}) | (FarmEventBase & {
|
|
280
|
+
type: "build.error";
|
|
281
|
+
target?: string;
|
|
282
|
+
error: unknown;
|
|
283
|
+
}) | (FarmEventBase & {
|
|
284
|
+
type: "routes.generated";
|
|
285
|
+
pageCount: number;
|
|
286
|
+
apiCount?: number;
|
|
287
|
+
}) | (FarmEventBase & {
|
|
288
|
+
type: "types.generated";
|
|
289
|
+
filePath: string;
|
|
290
|
+
}) | (FarmEventBase & {
|
|
291
|
+
type: "manifest.generated";
|
|
292
|
+
routeCount: number;
|
|
293
|
+
});
|
|
294
|
+
type FarmPluginEvent = (FarmEventBase & {
|
|
295
|
+
type: "plugin.hook.start";
|
|
296
|
+
plugin: string;
|
|
297
|
+
hook: string;
|
|
298
|
+
}) | (FarmEventBase & {
|
|
299
|
+
type: "plugin.hook.complete";
|
|
300
|
+
plugin: string;
|
|
301
|
+
hook: string;
|
|
302
|
+
durationMs: number;
|
|
303
|
+
}) | (FarmEventBase & {
|
|
304
|
+
type: "plugin.hook.error";
|
|
305
|
+
plugin: string;
|
|
306
|
+
hook: string;
|
|
307
|
+
error: unknown;
|
|
308
|
+
});
|
|
309
|
+
type FarmErrorEvent = FarmEventBase & {
|
|
310
|
+
type: "error";
|
|
311
|
+
source: string;
|
|
312
|
+
error: unknown;
|
|
313
|
+
route?: string;
|
|
314
|
+
};
|
|
315
|
+
type FarmEvent = FarmServerEvent | FarmRouteEvent | FarmRenderEvent | FarmCacheEvent | FarmPPREvent | FarmAPIEvent | FarmIntegrationEvent | FarmMiddlewareEvent | FarmStorageEvent | FarmBuildEvent | FarmPluginEvent | FarmErrorEvent;
|
|
316
|
+
type FarmEventType = FarmEvent["type"];
|
|
317
|
+
type FarmEventHandler = (event: FarmEvent) => void | Promise<void>;
|
|
318
|
+
type FarmEventInput = FarmEvent extends infer T ? T extends FarmEvent ? Omit<T, "timestamp" | "level"> & Partial<Pick<T, "timestamp" | "level">> : never : never;
|
|
319
|
+
type FarmObservabilityUserConfig = boolean | {
|
|
320
|
+
logs?: boolean;
|
|
321
|
+
onEvent?: FarmEventHandler | readonly FarmEventHandler[];
|
|
322
|
+
events?: readonly FarmEventType[];
|
|
323
|
+
};
|
|
324
|
+
interface FarmResolvedObservabilityConfig {
|
|
325
|
+
logs: boolean;
|
|
326
|
+
handlers: FarmEventHandler[];
|
|
327
|
+
events?: Set<FarmEventType>;
|
|
328
|
+
}
|
|
329
|
+
declare function configureFarmObservability(config: FarmObservabilityUserConfig | undefined): void;
|
|
330
|
+
declare function normalizeFarmObservabilityConfig(config: FarmObservabilityUserConfig | undefined): FarmResolvedObservabilityConfig;
|
|
331
|
+
declare function onFarmEvent(handler: FarmEventHandler): () => void;
|
|
332
|
+
declare function resetFarmObservability(): void;
|
|
333
|
+
declare function emitFarmEvent(input: FarmEventInput): FarmEvent;
|
|
334
|
+
|
|
335
|
+
export { type FarmAPIEvent, type FarmBuildEvent, type FarmCacheEvent, type FarmErrorEvent, type FarmEvent, type FarmEventBase, type FarmEventHandler, type FarmEventInput, type FarmEventLevel, type FarmEventType, type FarmIntegrationEvent, type FarmMiddlewareEvent, type FarmObservabilityUserConfig, type FarmPPREvent, type FarmPluginEvent, type FarmRenderEvent, type FarmResolvedObservabilityConfig, type FarmRouteEvent, type FarmServerEvent, type FarmStorageEvent, configureFarmObservability, emitFarmEvent, normalizeFarmObservabilityConfig, onFarmEvent, resetFarmObservability };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Parser } from './query/parsers.js';
|
|
2
|
+
|
|
3
|
+
type RouteParamsInput = Record<string, string | undefined> | URLSearchParams | Promise<Record<string, string | undefined> | URLSearchParams>;
|
|
4
|
+
declare function loadRouteParams<T extends Record<string, Parser<any>>>(input: RouteParamsInput, parsers: T, options?: {
|
|
5
|
+
strict?: boolean;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
8
|
+
}>;
|
|
9
|
+
declare function parseRouteParams<T extends Record<string, Parser<any>>>(input: Record<string, string | undefined> | URLSearchParams, parsers: T, options?: {
|
|
10
|
+
strict?: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { type RouteParamsInput as R, loadRouteParams as l, parseRouteParams as p };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Parser } from './query/parsers.mjs';
|
|
2
|
+
|
|
3
|
+
type RouteParamsInput = Record<string, string | undefined> | URLSearchParams | Promise<Record<string, string | undefined> | URLSearchParams>;
|
|
4
|
+
declare function loadRouteParams<T extends Record<string, Parser<any>>>(input: RouteParamsInput, parsers: T, options?: {
|
|
5
|
+
strict?: boolean;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
8
|
+
}>;
|
|
9
|
+
declare function parseRouteParams<T extends Record<string, Parser<any>>>(input: Record<string, string | undefined> | URLSearchParams, parsers: T, options?: {
|
|
10
|
+
strict?: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { type RouteParamsInput as R, loadRouteParams as l, parseRouteParams as p };
|