@farm.js/core 0.1.26 → 0.1.28
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/agent-runtime.d.mts +8 -9
- package/dist/agent-runtime.d.ts +8 -9
- package/dist/api/client.cjs +5 -7
- package/dist/api/client.d.mts +5 -5
- package/dist/api/client.d.ts +5 -5
- package/dist/api/client.mjs +4 -6
- package/dist/api/route-manager.cjs +12 -10
- package/dist/api/route-manager.d.mts +7 -8
- package/dist/api/route-manager.d.ts +7 -8
- package/dist/api/route-manager.mjs +11 -9
- package/dist/api/runtime.cjs +15 -8
- package/dist/api/runtime.d.mts +36 -3
- package/dist/api/runtime.d.ts +36 -3
- package/dist/api/runtime.mjs +14 -7
- package/dist/{api-client-Cx54IR5g.d.mts → api-client-BjMmY8OD.d.mts} +2 -3
- package/dist/{api-client-DykpaKcY.d.ts → api-client-CyFtZFJ4.d.ts} +2 -3
- package/dist/api.cjs +16 -14
- package/dist/api.d.mts +9 -10
- package/dist/api.d.ts +9 -10
- package/dist/api.mjs +16 -14
- package/dist/{app-29vG5tmY.d.mts → app-DSSq6wiN.d.mts} +3 -4
- package/dist/{app-Cx71s_PT.d.ts → app-M8nVWvNU.d.ts} +3 -4
- package/dist/app-markdown.cjs +10 -4
- package/dist/app-markdown.d.mts +9 -10
- package/dist/app-markdown.d.ts +9 -10
- package/dist/app-markdown.mjs +9 -3
- package/dist/cache-invalidation-BD0z_lfu.d.mts +4 -0
- package/dist/cache-invalidation-BD0z_lfu.d.ts +4 -0
- package/dist/cache.cjs +6 -4
- package/dist/cache.d.mts +11 -6
- package/dist/cache.d.ts +11 -6
- package/dist/cache.mjs +7 -5
- package/dist/{chunk-OFKG57MZ.mjs → chunk-2CNBR3EB.mjs} +2 -2
- package/dist/{chunk-JM5GQL4H.mjs → chunk-2DLN6HG4.mjs} +1 -1
- package/dist/{chunk-UUYF3CHN.mjs → chunk-2N5PX3LS.mjs} +2 -2
- package/dist/{chunk-H6G5INWM.cjs → chunk-2SDO73HK.cjs} +14 -156
- package/dist/{chunk-3TQWUUNP.cjs → chunk-3LUF2PE2.cjs} +10 -5
- package/dist/{chunk-SYGGPS4A.mjs → chunk-4IEPYMHF.mjs} +3 -3
- package/dist/{chunk-WD5PNSOB.mjs → chunk-4V7GIE2U.mjs} +6 -4
- package/dist/{chunk-2CT6XUNO.cjs → chunk-55ZY4ZA7.cjs} +4 -4
- package/dist/chunk-5MKEDGLD.cjs +53 -0
- package/dist/{chunk-I7PUUDGY.cjs → chunk-63H6BKXG.cjs} +2 -2
- package/dist/{chunk-FG5H2VCJ.mjs → chunk-6ZCMSZ5U.mjs} +2 -2
- package/dist/{chunk-ZMN3H73H.cjs → chunk-75DYEVXI.cjs} +13 -11
- package/dist/{chunk-QJ4D3UKJ.cjs → chunk-A672WZEG.cjs} +4 -4
- package/dist/{chunk-IXTFU4PL.cjs → chunk-BJPBQNIE.cjs} +14 -14
- package/dist/{chunk-QGG336NI.mjs → chunk-BXFWA23T.mjs} +2 -2
- package/dist/chunk-CNOQY6Z7.mjs +156 -0
- package/dist/{chunk-DW34V5SM.cjs → chunk-CTV2TTNP.cjs} +4 -4
- package/dist/{chunk-OAVTUMJP.cjs → chunk-D4JE5NNV.cjs} +12 -12
- package/dist/{chunk-KLSSO6YD.mjs → chunk-E76XC6ZG.mjs} +2 -2
- package/dist/{chunk-G3HRIVEY.cjs → chunk-ES4B2IXW.cjs} +2 -2
- package/dist/{chunk-W2HZKYES.cjs → chunk-EWZ3XHKQ.cjs} +2 -2
- package/dist/{chunk-BD2U4ZL6.cjs → chunk-EXLKRR4U.cjs} +10 -10
- package/dist/{chunk-SZ4LYNUX.cjs → chunk-F52CDFJM.cjs} +89 -83
- package/dist/{chunk-ARXCHQLX.mjs → chunk-FB3H4INL.mjs} +4 -4
- package/dist/{chunk-QPPQHB6X.mjs → chunk-FVCSLZWT.mjs} +19 -13
- package/dist/{chunk-WD4YXVLV.mjs → chunk-GZYH4OER.mjs} +1 -1
- package/dist/{chunk-DX4VKYAJ.cjs → chunk-I26CZYPV.cjs} +6 -4
- package/dist/{chunk-3TQG7CGC.cjs → chunk-ID6OVSLH.cjs} +164 -129
- package/dist/{chunk-F6SJAKFJ.mjs → chunk-IV6CQY7O.mjs} +12 -154
- package/dist/{chunk-6D242YGO.mjs → chunk-JATSG2ZO.mjs} +1 -1
- package/dist/{chunk-U74A3P2P.cjs → chunk-JLRDISQL.cjs} +7 -7
- package/dist/{chunk-H7CJRJ4L.cjs → chunk-JUFRXDTK.cjs} +18 -18
- package/dist/{chunk-OOIL3BWR.mjs → chunk-K3YEZLSY.mjs} +65 -8
- package/dist/{chunk-Y4YWHNKU.cjs → chunk-KH7BN726.cjs} +9 -9
- package/dist/{chunk-WFPRVVF2.cjs → chunk-KOQ555NR.cjs} +22 -14
- package/dist/{chunk-VZWO3XVL.mjs → chunk-KXGDXYUC.mjs} +3 -3
- package/dist/{chunk-3IL5UC5I.cjs → chunk-KZLND3D2.cjs} +2 -2
- package/dist/{chunk-QLXEYIAW.cjs → chunk-MH24QDVJ.cjs} +13 -13
- package/dist/{chunk-TKDY6AJP.mjs → chunk-MKMBQSNQ.mjs} +1 -1
- package/dist/{chunk-OCE65DDM.mjs → chunk-MNUGPHLN.mjs} +1 -1
- package/dist/{chunk-74RZNRY6.mjs → chunk-NVBS5WSZ.mjs} +1 -1
- package/dist/chunk-NYJMY3JA.cjs +156 -0
- package/dist/{chunk-VVJCWBIE.mjs → chunk-O3DTUAX2.mjs} +2 -2
- package/dist/chunk-O6XNAMBV.mjs +53 -0
- package/dist/{chunk-YAOX43YI.cjs → chunk-PZNCMPJF.cjs} +5 -5
- package/dist/{chunk-YMUH2BLR.mjs → chunk-PZPDGOU5.mjs} +14 -6
- package/dist/{chunk-52SH7TKB.mjs → chunk-QG5HNS7P.mjs} +2 -2
- package/dist/{chunk-CEYUWDWA.mjs → chunk-QZCT2CQ4.mjs} +10 -5
- package/dist/{chunk-RAI7NULA.mjs → chunk-REGFZJEJ.mjs} +1 -1
- package/dist/{chunk-QMV4QELL.mjs → chunk-S5GDHOE4.mjs} +4 -2
- package/dist/{chunk-CRQPYWLK.cjs → chunk-SORB3MAR.cjs} +14 -14
- package/dist/{chunk-DU2CASV6.mjs → chunk-T7HQ3I4C.mjs} +1 -1
- package/dist/{chunk-RCYINC4A.cjs → chunk-TII23GJC.cjs} +3 -3
- package/dist/{chunk-PPIW3MH6.mjs → chunk-UX2DD2VK.mjs} +1 -1
- package/dist/{chunk-I4J452B7.cjs → chunk-VHJGDMCG.cjs} +3 -3
- package/dist/{chunk-3WSWXPYM.cjs → chunk-VQXDC5UV.cjs} +4 -4
- package/dist/{chunk-B6ZCT36X.cjs → chunk-WNLBF77X.cjs} +4 -4
- package/dist/{chunk-GDUYXFIS.mjs → chunk-X7WVQMIB.mjs} +4 -4
- package/dist/{chunk-5SPPCN5J.mjs → chunk-XNPDONUH.mjs} +1 -1
- package/dist/{chunk-QIH2HD6H.cjs → chunk-XSPGWQWA.cjs} +86 -29
- package/dist/{chunk-ALIFMS4A.cjs → chunk-Y7GW7J46.cjs} +1 -1
- package/dist/{chunk-L6V3P73N.mjs → chunk-YDQZGSDS.mjs} +5 -5
- package/dist/{chunk-C3VRMB6H.cjs → chunk-ZCU4NZ3M.cjs} +6 -6
- package/dist/{chunk-UXQXGB5A.mjs → chunk-ZRIE4KMG.mjs} +63 -28
- package/dist/{client-plugins-B8RPJnot.d.mts → client-plugins-CgYNY7jF.d.mts} +1656 -1477
- package/dist/{client-plugins-bPBf4haK.d.ts → client-plugins-Fl9Og3yB.d.ts} +1656 -1477
- package/dist/client-plugins.d.mts +8 -9
- package/dist/client-plugins.d.ts +8 -9
- package/dist/client.cjs +12 -13
- package/dist/client.d.mts +10 -11
- package/dist/client.d.ts +10 -11
- package/dist/client.mjs +11 -12
- package/dist/config.d.mts +8 -9
- package/dist/config.d.ts +8 -9
- package/dist/{devtools-5D4ZDRPR.mjs → devtools-3E7ZANMZ.mjs} +7 -4
- package/dist/{devtools-QZJEUOJW.cjs → devtools-5AREISIA.cjs} +8 -5
- package/dist/docs.cjs +10 -7
- package/dist/docs.mjs +9 -6
- package/dist/{endpoint-1zA994xL.d.ts → endpoint-CA-TNX60.d.ts} +1 -1
- package/dist/{endpoint-DAc96i93.d.mts → endpoint-CCHFqyTE.d.mts} +1 -1
- package/dist/index.cjs +58 -55
- package/dist/index.d.mts +17 -18
- package/dist/index.d.ts +17 -18
- package/dist/index.mjs +69 -66
- package/dist/{integration-api-BbaiokCC.d.ts → integration-api-0y4FXJpC.d.mts} +128 -1
- package/dist/{integration-api-BbaiokCC.d.mts → integration-api-BPJo5oXb.d.ts} +128 -1
- package/dist/integrations.d.mts +8 -9
- package/dist/integrations.d.ts +8 -9
- package/dist/internal/app-markdown-runtime.cjs +9 -3
- package/dist/internal/app-markdown-runtime.d.mts +9 -9
- package/dist/internal/app-markdown-runtime.d.ts +9 -9
- package/dist/internal/app-markdown-runtime.mjs +8 -2
- package/dist/internal/build-runtime.cjs +26 -24
- package/dist/internal/build-runtime.d.mts +10 -11
- package/dist/internal/build-runtime.d.ts +10 -11
- package/dist/internal/build-runtime.mjs +25 -23
- package/dist/internal/cli-runtime.cjs +16 -12
- package/dist/internal/cli-runtime.mjs +15 -11
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +5 -1
- package/dist/internal/client-runtime.d.mts +1 -0
- package/dist/internal/client-runtime.d.ts +1 -0
- package/dist/internal/client-runtime.mjs +4 -0
- package/dist/internal/compression-runtime.d.mts +8 -9
- package/dist/internal/compression-runtime.d.ts +8 -9
- package/dist/internal/config-runtime.cjs +8 -5
- package/dist/internal/config-runtime.d.mts +9 -10
- package/dist/internal/config-runtime.d.ts +9 -10
- package/dist/internal/config-runtime.mjs +7 -4
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +20 -16
- package/dist/internal/production-runtime.d.mts +13 -14
- package/dist/internal/production-runtime.d.ts +13 -14
- package/dist/internal/production-runtime.mjs +20 -16
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +36 -153
- package/dist/markdown.d.ts +36 -153
- package/dist/markdown.mjs +7 -1
- package/dist/{metadata-C3na4CBj.d.mts → metadata-B0X-qtcQ.d.mts} +1 -1
- package/dist/{metadata-CzBP4Mfp.d.ts → metadata-BdDKgd7K.d.ts} +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +9 -10
- package/dist/middleware.d.ts +9 -10
- package/dist/middleware.mjs +3 -3
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +10 -11
- package/dist/navigation.d.ts +10 -11
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-ZKLGOTVY.mjs → nitro-NAKCRVHX.mjs} +4 -3
- package/dist/{nitro-KQDU7CFE.cjs → nitro-VYDZGYFY.cjs} +4 -3
- package/dist/plugin.cjs +26 -21
- package/dist/plugin.d.mts +9 -10
- package/dist/plugin.d.ts +9 -10
- package/dist/plugin.mjs +26 -21
- package/dist/{production-runtime-DP94hPGe.d.mts → production-runtime-BjgFgDIg.d.mts} +1 -1
- package/dist/{production-runtime-CYg4wM4E.d.ts → production-runtime-Dx_qMA3t.d.ts} +1 -1
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-Bl6Fzg5z.d.ts → render-plan-B41EWmBb.d.ts} +1 -1
- package/dist/{render-plan-CKAJg0jC.d.mts → render-plan-_1TAWODt.d.mts} +1 -1
- package/dist/renderer-client.cjs +13 -14
- package/dist/renderer-client.d.mts +6 -7
- package/dist/renderer-client.d.ts +6 -7
- package/dist/renderer-client.mjs +6 -7
- package/dist/{request-CrBCcPZZ.d.mts → request-BhE4luLv.d.mts} +1 -1
- package/dist/{request-CR-Bp1Px.d.ts → request-Dbf3G0zM.d.ts} +1 -1
- package/dist/request.d.mts +9 -10
- package/dist/request.d.ts +9 -10
- package/dist/{route-rendering-CZH5FegB.d.ts → route-rendering-Z7PveTZE.d.ts} +1 -1
- package/dist/{route-rendering-C1NAHo-C.d.mts → route-rendering-zzfx_GHf.d.mts} +1 -1
- package/dist/{router-B57eDJ3u.d.mts → router-BatNMsa1.d.mts} +1 -1
- package/dist/{router-Cg_kD3Bd.d.ts → router-DtNRhQl3.d.ts} +1 -1
- package/dist/routes.cjs +6 -5
- package/dist/routes.d.mts +6 -7
- package/dist/routes.d.ts +6 -7
- package/dist/routes.mjs +5 -4
- package/dist/server-fn-client.d.mts +4 -4
- package/dist/server-fn-client.d.ts +4 -4
- package/dist/server-fn.cjs +6 -5
- package/dist/server-fn.d.mts +2 -1
- package/dist/server-fn.d.ts +2 -1
- package/dist/server-fn.mjs +5 -4
- package/dist/server-plugins.d.mts +8 -9
- package/dist/server-plugins.d.ts +8 -9
- package/dist/server-query-client.cjs +5 -7
- package/dist/server-query-client.d.mts +2 -1
- package/dist/server-query-client.d.ts +2 -1
- package/dist/server-query-client.mjs +4 -6
- package/dist/server-query.cjs +7 -6
- package/dist/server-query.d.mts +2 -1
- package/dist/server-query.d.ts +2 -1
- package/dist/server-query.mjs +6 -5
- package/dist/server.cjs +235 -131
- package/dist/server.d.mts +14 -15
- package/dist/server.d.ts +14 -15
- package/dist/server.mjs +222 -118
- package/dist/{spa-router-BstQUO6Q.d.ts → spa-router-BE3bwU-J.d.ts} +2 -2
- package/dist/{spa-router-DTdbuinx.d.mts → spa-router-DQOnHZVj.d.mts} +2 -2
- package/dist/testing.cjs +17 -15
- package/dist/testing.d.mts +7 -8
- package/dist/testing.d.ts +7 -8
- package/dist/testing.mjs +14 -12
- package/dist/{utils-CS3ZLnEJ.d.mts → utils-DLK1ERNl.d.mts} +1 -1
- package/dist/{utils-D3rdsIvM.d.ts → utils-u7ZBSWAK.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +22 -20
- package/dist/vite.d.mts +8 -9
- package/dist/vite.d.ts +8 -9
- package/dist/vite.mjs +21 -19
- package/package.json +1 -1
- package/dist/route-B0XrsrFk.d.mts +0 -128
- package/dist/route-DOEpbyWZ.d.ts +0 -128
- package/dist/{chunk-YOYF2E4U.mjs → chunk-LNZ7JZUS.mjs} +0 -0
- package/dist/{chunk-N4RLRSWW.cjs → chunk-SUIBNSNO.cjs} +0 -0
- package/dist/{chunk-TIKNUAU7.mjs → chunk-VUMAE7NC.mjs} +3 -3
- package/dist/{chunk-WM6HL7E7.cjs → chunk-ZHVYQL3H.cjs} +2 -2
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-S67OYZU7.mjs";
|
|
7
7
|
import {
|
|
8
8
|
build
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FVCSLZWT.mjs";
|
|
10
10
|
import "./chunk-S3FNNQHR.mjs";
|
|
11
11
|
import "./chunk-655RLQQL.mjs";
|
|
12
12
|
import {
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
createFarmDocsAdapterHandler,
|
|
28
28
|
hasFarmDocsRuntimeAdapter,
|
|
29
29
|
isFarmDocsAPIRequest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2CNBR3EB.mjs";
|
|
31
31
|
import {
|
|
32
32
|
createFarmDocsHandler,
|
|
33
33
|
discoverFarmDocsPages,
|
|
@@ -36,13 +36,13 @@ import {
|
|
|
36
36
|
isFarmDocsRequest,
|
|
37
37
|
loadFarmDocsPage,
|
|
38
38
|
resolveFarmDocsContentDir
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-T7HQ3I4C.mjs";
|
|
40
40
|
import "./chunk-UP4CW6WP.mjs";
|
|
41
41
|
import "./chunk-TFQG7TBC.mjs";
|
|
42
42
|
import {
|
|
43
43
|
usePathname,
|
|
44
44
|
useSearchParams
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-QG5HNS7P.mjs";
|
|
46
46
|
import {
|
|
47
47
|
cookies,
|
|
48
48
|
headers
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
parseProgrammaticRoutePath,
|
|
64
64
|
routesBuilder,
|
|
65
65
|
scanProgrammaticPagePaths
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-S5GDHOE4.mjs";
|
|
67
67
|
import "./chunk-UCNPVBE7.mjs";
|
|
68
68
|
import {
|
|
69
69
|
loadRouteParams,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
memoryRateLimitStorage,
|
|
90
90
|
middleware,
|
|
91
91
|
unwrapMiddleware
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-MNUGPHLN.mjs";
|
|
93
93
|
import {
|
|
94
94
|
applyProductionMiddlewareHeaders,
|
|
95
95
|
createProductionMiddlewareRunner,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
} from "./chunk-N6UROPT7.mjs";
|
|
98
98
|
import {
|
|
99
99
|
farmApiPlugin
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-KXGDXYUC.mjs";
|
|
101
101
|
import "./chunk-MM5D6VLP.mjs";
|
|
102
102
|
import {
|
|
103
103
|
FarmEnvironmentError,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
import {
|
|
109
109
|
FARM_SERVER_QUERY_SYMBOL,
|
|
110
110
|
createServerQuery
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-4V7GIE2U.mjs";
|
|
112
112
|
import {
|
|
113
113
|
FARM_SERVER_FN_SYMBOL,
|
|
114
114
|
_attachServerFunctionDescriptor,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
createServerFn,
|
|
120
120
|
createServerFunctionDescriptor,
|
|
121
121
|
createServerMiddleware
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-GZYH4OER.mjs";
|
|
123
123
|
import "./chunk-2VQKKQ6D.mjs";
|
|
124
124
|
import {
|
|
125
125
|
getDeployTargetForPreset,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
resolveDeployConfig,
|
|
131
131
|
resolveDeployOutputPath,
|
|
132
132
|
resolveMigrationsConfig
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-PZPDGOU5.mjs";
|
|
134
134
|
import {
|
|
135
135
|
defineConfig,
|
|
136
136
|
defineFarmConfig
|
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
storageClientCacheAdapter,
|
|
154
154
|
useFetcher,
|
|
155
155
|
useMutation
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-E76XC6ZG.mjs";
|
|
157
157
|
import {
|
|
158
158
|
installChunkErrorRecovery,
|
|
159
159
|
isChunkLoadError
|
|
@@ -164,14 +164,14 @@ import {
|
|
|
164
164
|
} from "./chunk-SHB3GYXI.mjs";
|
|
165
165
|
import {
|
|
166
166
|
useServerQuery
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-6ZCMSZ5U.mjs";
|
|
168
168
|
import {
|
|
169
169
|
useBlocker,
|
|
170
170
|
useNavigation,
|
|
171
171
|
usePageState,
|
|
172
172
|
useRouter,
|
|
173
173
|
useScrollRestoration
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-MKMBQSNQ.mjs";
|
|
175
175
|
import {
|
|
176
176
|
useTheme
|
|
177
177
|
} from "./chunk-BJIYRUGQ.mjs";
|
|
@@ -197,7 +197,7 @@ import {
|
|
|
197
197
|
isAPIRouteRef,
|
|
198
198
|
resolveServerFnInvalidateTargets,
|
|
199
199
|
settleServerFnOptimisticUpdates
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-YDQZGSDS.mjs";
|
|
201
201
|
import "./chunk-72AK62H5.mjs";
|
|
202
202
|
import {
|
|
203
203
|
beginFarmServerQueryAction,
|
|
@@ -205,7 +205,7 @@ import {
|
|
|
205
205
|
fetchServerQuery,
|
|
206
206
|
prefetchServerQuery,
|
|
207
207
|
shouldApplyFarmServerQueryActionResult
|
|
208
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-2N5PX3LS.mjs";
|
|
209
209
|
import {
|
|
210
210
|
getTheme,
|
|
211
211
|
setTheme,
|
|
@@ -226,14 +226,14 @@ import {
|
|
|
226
226
|
pushState,
|
|
227
227
|
readPageState,
|
|
228
228
|
replaceState
|
|
229
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-JATSG2ZO.mjs";
|
|
230
230
|
import "./chunk-TOVMYGYW.mjs";
|
|
231
231
|
import "./chunk-2PQNJXFM.mjs";
|
|
232
232
|
import "./chunk-5HGR3W6O.mjs";
|
|
233
233
|
import {
|
|
234
234
|
getFarmClientDataCache,
|
|
235
235
|
normalizeFarmClientCacheKey
|
|
236
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-XNPDONUH.mjs";
|
|
237
237
|
import "./chunk-QVYLBY73.mjs";
|
|
238
238
|
import "./chunk-KGB5UXJJ.mjs";
|
|
239
239
|
import {
|
|
@@ -246,7 +246,7 @@ import {
|
|
|
246
246
|
PluginManager,
|
|
247
247
|
createFarmApp,
|
|
248
248
|
definePlugin
|
|
249
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-ZRIE4KMG.mjs";
|
|
250
250
|
import {
|
|
251
251
|
analyzeStaticRouteCandidate,
|
|
252
252
|
collectSSGPages,
|
|
@@ -265,7 +265,7 @@ import {
|
|
|
265
265
|
parseRouteRenderingDirective,
|
|
266
266
|
resolveRouteRenderingConfig,
|
|
267
267
|
resolveRouteRenderingConfigFromFile
|
|
268
|
-
} from "./chunk-
|
|
268
|
+
} from "./chunk-O3DTUAX2.mjs";
|
|
269
269
|
import {
|
|
270
270
|
FARM_SCHEMA_STATE_TABLE,
|
|
271
271
|
FARM_SCHEMA_STEPS_TABLE,
|
|
@@ -305,7 +305,7 @@ import {
|
|
|
305
305
|
import {
|
|
306
306
|
APITypeGenerator
|
|
307
307
|
} from "./chunk-F3VB7ONA.mjs";
|
|
308
|
-
import "./chunk-
|
|
308
|
+
import "./chunk-FB3H4INL.mjs";
|
|
309
309
|
import "./chunk-DAO7JGTS.mjs";
|
|
310
310
|
import "./chunk-BOYNDCZL.mjs";
|
|
311
311
|
import "./chunk-YQVSHTMR.mjs";
|
|
@@ -353,7 +353,7 @@ import {
|
|
|
353
353
|
REACT_RENDERER,
|
|
354
354
|
defineRenderer
|
|
355
355
|
} from "./chunk-DAATZTKJ.mjs";
|
|
356
|
-
import "./chunk-
|
|
356
|
+
import "./chunk-REGFZJEJ.mjs";
|
|
357
357
|
import "./chunk-G2KY33I6.mjs";
|
|
358
358
|
import {
|
|
359
359
|
DEFAULT_FARM_CRON_SECRET_ENV,
|
|
@@ -401,7 +401,7 @@ import {
|
|
|
401
401
|
import {
|
|
402
402
|
createFarmMarkdownRouteModuleFromFile,
|
|
403
403
|
loadFarmMdxComponents
|
|
404
|
-
} from "./chunk-
|
|
404
|
+
} from "./chunk-NVBS5WSZ.mjs";
|
|
405
405
|
import {
|
|
406
406
|
createFarmMarkdownRouteModule,
|
|
407
407
|
createFarmMarkdownSourceResponse,
|
|
@@ -410,7 +410,7 @@ import {
|
|
|
410
410
|
normalizeFarmMarkdownRoutePath,
|
|
411
411
|
parseMarkdownFrontmatter,
|
|
412
412
|
titleFromMarkdown
|
|
413
|
-
} from "./chunk-
|
|
413
|
+
} from "./chunk-2DLN6HG4.mjs";
|
|
414
414
|
import {
|
|
415
415
|
resolveFarmMdxComponentsModulePath,
|
|
416
416
|
resolveMdxConfig
|
|
@@ -431,7 +431,7 @@ import {
|
|
|
431
431
|
requestAcceptsMarkdown,
|
|
432
432
|
resolveMarkdownConfig,
|
|
433
433
|
resolveMarkdownMirrorTarget
|
|
434
|
-
} from "./chunk-
|
|
434
|
+
} from "./chunk-K3YEZLSY.mjs";
|
|
435
435
|
import {
|
|
436
436
|
classifyFarmAgent
|
|
437
437
|
} from "./chunk-MVL2RAJW.mjs";
|
|
@@ -520,7 +520,7 @@ import {
|
|
|
520
520
|
import {
|
|
521
521
|
MiddlewareManager,
|
|
522
522
|
createContext
|
|
523
|
-
} from "./chunk-
|
|
523
|
+
} from "./chunk-VUMAE7NC.mjs";
|
|
524
524
|
import {
|
|
525
525
|
_runWithMiddlewareContext,
|
|
526
526
|
_runWithMiddlewareData,
|
|
@@ -539,8 +539,8 @@ import {
|
|
|
539
539
|
import {
|
|
540
540
|
APIRouteConflictError,
|
|
541
541
|
APIRouteManager
|
|
542
|
-
} from "./chunk-
|
|
543
|
-
import "./chunk-
|
|
542
|
+
} from "./chunk-BXFWA23T.mjs";
|
|
543
|
+
import "./chunk-LNZ7JZUS.mjs";
|
|
544
544
|
import "./chunk-CU625VAY.mjs";
|
|
545
545
|
import "./chunk-JNGIWIY6.mjs";
|
|
546
546
|
import "./chunk-FV45CKBC.mjs";
|
|
@@ -552,7 +552,7 @@ import {
|
|
|
552
552
|
isWebResponse,
|
|
553
553
|
normalizeRouteResponse,
|
|
554
554
|
resolveAPIRouteEndpoint
|
|
555
|
-
} from "./chunk-
|
|
555
|
+
} from "./chunk-X7WVQMIB.mjs";
|
|
556
556
|
import {
|
|
557
557
|
DELETE,
|
|
558
558
|
EndpointFailure,
|
|
@@ -567,12 +567,13 @@ import {
|
|
|
567
567
|
createRouteFactory,
|
|
568
568
|
isEndpointFailure,
|
|
569
569
|
resolvePluginRoutes
|
|
570
|
-
} from "./chunk-
|
|
570
|
+
} from "./chunk-4IEPYMHF.mjs";
|
|
571
571
|
import "./chunk-W3B4PKAW.mjs";
|
|
572
|
+
import "./chunk-5WI2S4CO.mjs";
|
|
573
|
+
import "./chunk-O6XNAMBV.mjs";
|
|
572
574
|
import {
|
|
573
575
|
resolveFarmAPIServerBasePath
|
|
574
576
|
} from "./chunk-I6XDAKWQ.mjs";
|
|
575
|
-
import "./chunk-5WI2S4CO.mjs";
|
|
576
577
|
import "./chunk-EA5K5BKU.mjs";
|
|
577
578
|
import {
|
|
578
579
|
createFarmRouteRuntimeKey,
|
|
@@ -584,6 +585,24 @@ import {
|
|
|
584
585
|
resolveFarmRouteRuleRuntimeConfig,
|
|
585
586
|
resolveFarmRouteRuntimeConfig
|
|
586
587
|
} from "./chunk-2J7W2WND.mjs";
|
|
588
|
+
import {
|
|
589
|
+
FarmDataCache,
|
|
590
|
+
applyFarmCacheInvalidationTargets,
|
|
591
|
+
configureFarmCache,
|
|
592
|
+
createFarmCacheInvalidationStream,
|
|
593
|
+
createPathCacheTag,
|
|
594
|
+
createRouteDataCacheTag,
|
|
595
|
+
defineCacheKey,
|
|
596
|
+
getFarmDataCache,
|
|
597
|
+
invalidate,
|
|
598
|
+
invalidateRouteData,
|
|
599
|
+
normalizeRevalidatePath,
|
|
600
|
+
revalidatePath,
|
|
601
|
+
revalidateTag,
|
|
602
|
+
storageCacheAdapter,
|
|
603
|
+
unstable_cache,
|
|
604
|
+
updateTag
|
|
605
|
+
} from "./chunk-IV6CQY7O.mjs";
|
|
587
606
|
import "./chunk-XF7Q24PF.mjs";
|
|
588
607
|
import "./chunk-I2BHUNBU.mjs";
|
|
589
608
|
import "./chunk-43FMW62B.mjs";
|
|
@@ -606,8 +625,20 @@ import {
|
|
|
606
625
|
toViteModuleId
|
|
607
626
|
} from "./chunk-KI3MESHB.mjs";
|
|
608
627
|
import "./chunk-QVKYGNVM.mjs";
|
|
628
|
+
import {
|
|
629
|
+
configureFarmObservability,
|
|
630
|
+
configureFarmTracing,
|
|
631
|
+
emitFarmEvent,
|
|
632
|
+
getFarmTraceContext,
|
|
633
|
+
normalizeFarmObservabilityConfig,
|
|
634
|
+
normalizeFarmTracingConfig,
|
|
635
|
+
onFarmEvent,
|
|
636
|
+
resetFarmObservability,
|
|
637
|
+
runWithFarmRequestSpan,
|
|
638
|
+
runWithFarmSpan
|
|
639
|
+
} from "./chunk-FUZEBRP3.mjs";
|
|
609
640
|
import "./chunk-Z2RZJZIZ.mjs";
|
|
610
|
-
import "./chunk-
|
|
641
|
+
import "./chunk-UX2DD2VK.mjs";
|
|
611
642
|
import "./chunk-54UPOYFS.mjs";
|
|
612
643
|
import "./chunk-WNSDDRNU.mjs";
|
|
613
644
|
import {
|
|
@@ -617,9 +648,6 @@ import {
|
|
|
617
648
|
endpoint
|
|
618
649
|
} from "./chunk-JPLUGGRV.mjs";
|
|
619
650
|
import "./chunk-G4MWPDSE.mjs";
|
|
620
|
-
import {
|
|
621
|
-
matchAPIRoute
|
|
622
|
-
} from "./chunk-O7BH5O46.mjs";
|
|
623
651
|
import {
|
|
624
652
|
isFarmAPIStream,
|
|
625
653
|
isJSONStreamResponse,
|
|
@@ -629,6 +657,9 @@ import {
|
|
|
629
657
|
readJSONStream,
|
|
630
658
|
toFormData
|
|
631
659
|
} from "./chunk-EMLAPBEM.mjs";
|
|
660
|
+
import {
|
|
661
|
+
matchAPIRoute
|
|
662
|
+
} from "./chunk-O7BH5O46.mjs";
|
|
632
663
|
import {
|
|
633
664
|
DEFAULT_FARM_API_BASE_PATH,
|
|
634
665
|
getFarmAPIBaseURL,
|
|
@@ -638,7 +669,7 @@ import {
|
|
|
638
669
|
resolveFarmAPIRequestURL
|
|
639
670
|
} from "./chunk-7LTCDQRS.mjs";
|
|
640
671
|
import "./chunk-IXUY2F5U.mjs";
|
|
641
|
-
import "./chunk-
|
|
672
|
+
import "./chunk-QZCT2CQ4.mjs";
|
|
642
673
|
import "./chunk-SKNL7VA2.mjs";
|
|
643
674
|
import {
|
|
644
675
|
FARM_DEPLOYMENT_COOKIE,
|
|
@@ -672,42 +703,14 @@ import {
|
|
|
672
703
|
reviveDeferredData,
|
|
673
704
|
snapshotDeferredData
|
|
674
705
|
} from "./chunk-JNZ4TDWM.mjs";
|
|
706
|
+
import "./chunk-C4NCTZLM.mjs";
|
|
675
707
|
import {
|
|
676
|
-
FarmDataCache,
|
|
677
|
-
applyFarmCacheInvalidationTargets,
|
|
678
|
-
configureFarmCache,
|
|
679
|
-
createFarmCacheInvalidationStream,
|
|
680
708
|
createFarmCacheKey,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
createRouteDataCacheTag,
|
|
684
|
-
defineCacheKey,
|
|
685
|
-
getFarmDataCache,
|
|
686
|
-
invalidate,
|
|
687
|
-
invalidateRouteData,
|
|
688
|
-
normalizeRevalidatePath,
|
|
689
|
-
revalidatePath,
|
|
690
|
-
revalidateTag,
|
|
691
|
-
storageCacheAdapter,
|
|
692
|
-
unstable_cache,
|
|
693
|
-
updateTag
|
|
694
|
-
} from "./chunk-F6SJAKFJ.mjs";
|
|
709
|
+
createRouteDataCacheKey
|
|
710
|
+
} from "./chunk-CNOQY6Z7.mjs";
|
|
695
711
|
import {
|
|
696
712
|
applyFarmCacheInvalidations
|
|
697
713
|
} from "./chunk-4SIYUGRY.mjs";
|
|
698
|
-
import "./chunk-C4NCTZLM.mjs";
|
|
699
|
-
import {
|
|
700
|
-
configureFarmObservability,
|
|
701
|
-
configureFarmTracing,
|
|
702
|
-
emitFarmEvent,
|
|
703
|
-
getFarmTraceContext,
|
|
704
|
-
normalizeFarmObservabilityConfig,
|
|
705
|
-
normalizeFarmTracingConfig,
|
|
706
|
-
onFarmEvent,
|
|
707
|
-
resetFarmObservability,
|
|
708
|
-
runWithFarmRequestSpan,
|
|
709
|
-
runWithFarmSpan
|
|
710
|
-
} from "./chunk-FUZEBRP3.mjs";
|
|
711
714
|
import {
|
|
712
715
|
createEnvPlugin,
|
|
713
716
|
createHeadersPlugin,
|
|
@@ -1,3 +1,130 @@
|
|
|
1
|
+
import { a as EndpointMiddlewareResult, R as RouteSchema, b as RouteSchemaOutput, c as EndpointMCPOptions, A as AnyEndpointMiddleware, I as InferEndpointMiddlewareContext, T as TypedEndpoint, d as RouteSchemaInput } from './endpoint-CCHFqyTE.mjs';
|
|
2
|
+
|
|
3
|
+
type RouteMethod = "GET" | "HEAD" | "QUERY" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
|
|
4
|
+
type RoutePathParams<Path extends string> = Path extends `${infer Head}/${infer Tail}` ? RoutePathParams<Head> & RoutePathParams<Tail> : Path extends `[[...${infer Name}]]` ? {
|
|
5
|
+
[K in Name]?: string[];
|
|
6
|
+
} : Path extends `[...${infer Name}]` ? {
|
|
7
|
+
[K in Name]: string[];
|
|
8
|
+
} : Path extends `[${infer Name}]` ? {
|
|
9
|
+
[K in Name]: string;
|
|
10
|
+
} : {};
|
|
11
|
+
interface RouteInputSchemas {
|
|
12
|
+
body?: RouteSchema;
|
|
13
|
+
query?: RouteSchema;
|
|
14
|
+
params?: RouteSchema;
|
|
15
|
+
headers?: RouteSchema;
|
|
16
|
+
}
|
|
17
|
+
type Input<I, K extends PropertyKey> = K extends keyof I ? RouteSchemaInput<I[K]> : never;
|
|
18
|
+
type Output<I, K extends PropertyKey, Fallback = unknown> = K extends keyof I ? RouteSchemaOutput<I[K]> : Fallback;
|
|
19
|
+
/** JSON responses have wire types, not server-side instances such as Date. */
|
|
20
|
+
type RouteJSON<T> = T extends Response ? unknown : T extends {
|
|
21
|
+
toJSON(): infer J;
|
|
22
|
+
} ? RouteJSON<J> : T extends bigint | symbol | ((...args: any[]) => any) ? never : T extends readonly (infer V)[] ? RouteJSON<V>[] : T extends object ? {
|
|
23
|
+
[K in keyof T]: RouteJSON<T[K]>;
|
|
24
|
+
} : T;
|
|
25
|
+
type RouteDefinition<P extends string = string, M extends RouteMethod = RouteMethod, E = any> = {
|
|
26
|
+
readonly path: P;
|
|
27
|
+
readonly method: M;
|
|
28
|
+
readonly endpoint: E;
|
|
29
|
+
};
|
|
30
|
+
type RouteEndpoint<P extends string, I extends RouteInputSchemas, R> = TypedEndpoint<Output<I, "body">, Input<I, "query">, RouteJSON<R>, Input<I, "headers">, never, Input<I, "body">> & {
|
|
31
|
+
__types: {
|
|
32
|
+
params: RoutePathParams<P>;
|
|
33
|
+
inputHeaders: Input<I, "headers">;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type TrimStart<P extends string> = P extends `/${infer Rest}` ? TrimStart<Rest> : P;
|
|
37
|
+
type Join<P extends string, C extends string> = C extends "" ? P : `${P}/${TrimStart<C>}`;
|
|
38
|
+
type ParamsCheck<P extends string, I extends RouteInputSchemas> = I extends {
|
|
39
|
+
params: infer S;
|
|
40
|
+
} ? Exclude<keyof RoutePathParams<P>, keyof RouteSchemaOutput<S>> extends never ? Exclude<keyof RouteSchemaOutput<S>, keyof RoutePathParams<P>> extends never ? unknown : {
|
|
41
|
+
__error_unknown_route_params: never;
|
|
42
|
+
} : {
|
|
43
|
+
__error_missing_route_params: never;
|
|
44
|
+
} : unknown;
|
|
45
|
+
type RouteMiddlewareResults = readonly (EndpointMiddlewareResult | Promise<EndpointMiddlewareResult>)[];
|
|
46
|
+
type RouteMiddlewares<Results extends readonly unknown[]> = {
|
|
47
|
+
readonly [K in keyof Results]: (context: Parameters<AnyEndpointMiddleware>[0]) => Results[K];
|
|
48
|
+
};
|
|
49
|
+
type RouteOptions<P extends string, I extends RouteInputSchemas, O extends RouteSchema | undefined, R, MiddlewareResults extends RouteMiddlewareResults = RouteMiddlewareResults> = {
|
|
50
|
+
input?: I & ParamsCheck<P, I>;
|
|
51
|
+
/** Validate plain JSON handler results. Raw Response/stream results are never buffered. */
|
|
52
|
+
output?: O;
|
|
53
|
+
/** Opt this app-owned endpoint into an installed MCP transport. */
|
|
54
|
+
mcp?: EndpointMCPOptions;
|
|
55
|
+
middleware?: RouteMiddlewares<MiddlewareResults>;
|
|
56
|
+
handler(request: Request, context: {
|
|
57
|
+
input: {
|
|
58
|
+
body: Output<I, "body">;
|
|
59
|
+
query: Output<I, "query", Record<string, string | string[]>>;
|
|
60
|
+
headers: Output<I, "headers", Record<string, string>>;
|
|
61
|
+
params: Output<I, "params", RoutePathParams<P>>;
|
|
62
|
+
};
|
|
63
|
+
params: Output<I, "params", RoutePathParams<P>>;
|
|
64
|
+
context: Readonly<InferEndpointMiddlewareContext<RouteMiddlewares<MiddlewareResults>>>;
|
|
65
|
+
}): R | Promise<R>;
|
|
66
|
+
};
|
|
67
|
+
type RouteBuilder<P extends string, M extends RouteMethod> = <const C extends string, const MiddlewareResults extends RouteMiddlewareResults, const I extends RouteInputSchemas = {}, O extends RouteSchema | undefined = undefined, R = unknown>(path: C, options: RouteOptions<Join<P, C>, I, O, R, MiddlewareResults>) => RouteDefinition<Join<P, C>, M, RouteEndpoint<Join<P, C>, I, Extract<Awaited<R>, Response> extends never ? O extends RouteSchema ? RouteSchemaOutput<O> : Awaited<R> : unknown>>;
|
|
68
|
+
type RouteFactory<P extends string = ""> = {
|
|
69
|
+
[M in Lowercase<RouteMethod>]: RouteBuilder<P, Uppercase<M> & RouteMethod>;
|
|
70
|
+
} & {
|
|
71
|
+
/** Return a new builder; never mutate the parent scope. */
|
|
72
|
+
scope<const C extends string>(path: C): RouteFactory<Join<P, C>>;
|
|
73
|
+
};
|
|
74
|
+
type PluginRoutes = readonly RouteDefinition[];
|
|
75
|
+
interface PluginLocalAPIEndpoint {
|
|
76
|
+
readonly path: string;
|
|
77
|
+
readonly method: RouteMethod;
|
|
78
|
+
readonly input: Readonly<RouteInputSchemas>;
|
|
79
|
+
readonly output?: RouteSchema;
|
|
80
|
+
readonly mcp?: EndpointMCPOptions;
|
|
81
|
+
invoke(request: Request, params?: Readonly<Record<string, string | string[]>>): Promise<Response>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Read-only access to app-owned API endpoints while plugin routes are mounted.
|
|
85
|
+
* Plugin routes are intentionally excluded so a plugin cannot recurse through
|
|
86
|
+
* itself or depend on plugin registration order.
|
|
87
|
+
*/
|
|
88
|
+
interface PluginLocalAPI {
|
|
89
|
+
/** False during type-only route discovery, where app endpoint modules are unavailable. */
|
|
90
|
+
readonly available: boolean;
|
|
91
|
+
get(method: RouteMethod, path: string): PluginLocalAPIEndpoint | undefined;
|
|
92
|
+
/** Enumerate app-owned endpoints. Plugin routes are excluded. */
|
|
93
|
+
list(): readonly PluginLocalAPIEndpoint[];
|
|
94
|
+
}
|
|
95
|
+
type PluginRoutesFactory<R extends PluginRoutes = PluginRoutes> = (context: {
|
|
96
|
+
route: RouteFactory;
|
|
97
|
+
api: PluginLocalAPI;
|
|
98
|
+
}) => R;
|
|
99
|
+
declare function createRouteFactory(): RouteFactory;
|
|
100
|
+
type UnionToIntersection$1<U> = (U extends unknown ? (v: U) => void : never) extends (v: infer I) => void ? I : never;
|
|
101
|
+
type RouteTree<P extends string, M extends string, E> = P extends `${infer Head}/${infer Tail}` ? {
|
|
102
|
+
[K in Head]: RouteTree<Tail, M, E>;
|
|
103
|
+
} : P extends "" ? {
|
|
104
|
+
[K in Lowercase<M>]: E;
|
|
105
|
+
} : {
|
|
106
|
+
[K in P]: {
|
|
107
|
+
[Method in Lowercase<M>]: E;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
type HasMethodSegment<P extends string> = P extends `${infer H}/${infer T}` ? H extends Lowercase<RouteMethod> ? true : HasMethodSegment<T> : P extends Lowercase<RouteMethod> ? true : false;
|
|
111
|
+
type DefinitionTree<D> = D extends RouteDefinition<infer P, infer M, infer E> ? string extends P ? {} : (P extends `/api/integrations${string}` ? true : HasMethodSegment<P>) extends true ? {
|
|
112
|
+
[K in P extends `/api/${infer C}` ? `/${C}` : "/"]: {
|
|
113
|
+
[Method in Lowercase<M>]: E;
|
|
114
|
+
};
|
|
115
|
+
} : RouteTree<P extends `/api/${infer C}` ? C : "", M, E> : {};
|
|
116
|
+
type PluginAPIRouter<C> = C extends {
|
|
117
|
+
plugins: readonly (infer P)[];
|
|
118
|
+
} ? UnionToIntersection$1<P extends {
|
|
119
|
+
routes?: PluginRoutesFactory<infer R>;
|
|
120
|
+
} ? DefinitionTree<R[number]> : {}> : {};
|
|
121
|
+
declare function resolvePluginRoutes(plugins?: readonly {
|
|
122
|
+
name: string;
|
|
123
|
+
routes?: PluginRoutesFactory;
|
|
124
|
+
}[], context?: {
|
|
125
|
+
api?: PluginLocalAPI;
|
|
126
|
+
}): PluginRoutes;
|
|
127
|
+
|
|
1
128
|
type FarmIntegrationAPIMethod = "GET" | "QUERY" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
2
129
|
type FarmIntegrationAPIBodyFormat = "json" | "form" | "none";
|
|
3
130
|
type FarmIntegrationAPIResponseFormat = "json" | "text" | "response";
|
|
@@ -94,4 +221,4 @@ declare const endpoint: {
|
|
|
94
221
|
};
|
|
95
222
|
};
|
|
96
223
|
|
|
97
|
-
export { type FarmIntegrationAPI as F, type InferIntegrationAPIFromRoutes as I, api as a, defineIntegrationAPIOperation as b, type FarmIntegrationAPIBodyFormat as c, defineIntegrationAPI as d, type FarmIntegrationAPIMethod as e, type FarmIntegrationAPIOperation as f, type FarmIntegrationAPIResponseFormat as g, type FarmIntegrationRouteOperationCarrier as h, endpoint as i };
|
|
224
|
+
export { type FarmIntegrationAPI as F, type InferIntegrationAPIFromRoutes as I, type PluginRoutesFactory as P, type RouteMethod as R, api as a, defineIntegrationAPIOperation as b, type FarmIntegrationAPIBodyFormat as c, defineIntegrationAPI as d, type FarmIntegrationAPIMethod as e, type FarmIntegrationAPIOperation as f, type FarmIntegrationAPIResponseFormat as g, type FarmIntegrationRouteOperationCarrier as h, endpoint as i, type RoutePathParams as j, type RouteInputSchemas as k, type RouteJSON as l, type RouteDefinition as m, type RouteOptions as n, type RouteFactory as o, type PluginRoutes as p, type PluginLocalAPIEndpoint as q, type PluginLocalAPI as r, createRouteFactory as s, type PluginAPIRouter as t, resolvePluginRoutes as u };
|
|
@@ -1,3 +1,130 @@
|
|
|
1
|
+
import { a as EndpointMiddlewareResult, R as RouteSchema, b as RouteSchemaOutput, c as EndpointMCPOptions, A as AnyEndpointMiddleware, I as InferEndpointMiddlewareContext, T as TypedEndpoint, d as RouteSchemaInput } from './endpoint-CA-TNX60.js';
|
|
2
|
+
|
|
3
|
+
type RouteMethod = "GET" | "HEAD" | "QUERY" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
|
|
4
|
+
type RoutePathParams<Path extends string> = Path extends `${infer Head}/${infer Tail}` ? RoutePathParams<Head> & RoutePathParams<Tail> : Path extends `[[...${infer Name}]]` ? {
|
|
5
|
+
[K in Name]?: string[];
|
|
6
|
+
} : Path extends `[...${infer Name}]` ? {
|
|
7
|
+
[K in Name]: string[];
|
|
8
|
+
} : Path extends `[${infer Name}]` ? {
|
|
9
|
+
[K in Name]: string;
|
|
10
|
+
} : {};
|
|
11
|
+
interface RouteInputSchemas {
|
|
12
|
+
body?: RouteSchema;
|
|
13
|
+
query?: RouteSchema;
|
|
14
|
+
params?: RouteSchema;
|
|
15
|
+
headers?: RouteSchema;
|
|
16
|
+
}
|
|
17
|
+
type Input<I, K extends PropertyKey> = K extends keyof I ? RouteSchemaInput<I[K]> : never;
|
|
18
|
+
type Output<I, K extends PropertyKey, Fallback = unknown> = K extends keyof I ? RouteSchemaOutput<I[K]> : Fallback;
|
|
19
|
+
/** JSON responses have wire types, not server-side instances such as Date. */
|
|
20
|
+
type RouteJSON<T> = T extends Response ? unknown : T extends {
|
|
21
|
+
toJSON(): infer J;
|
|
22
|
+
} ? RouteJSON<J> : T extends bigint | symbol | ((...args: any[]) => any) ? never : T extends readonly (infer V)[] ? RouteJSON<V>[] : T extends object ? {
|
|
23
|
+
[K in keyof T]: RouteJSON<T[K]>;
|
|
24
|
+
} : T;
|
|
25
|
+
type RouteDefinition<P extends string = string, M extends RouteMethod = RouteMethod, E = any> = {
|
|
26
|
+
readonly path: P;
|
|
27
|
+
readonly method: M;
|
|
28
|
+
readonly endpoint: E;
|
|
29
|
+
};
|
|
30
|
+
type RouteEndpoint<P extends string, I extends RouteInputSchemas, R> = TypedEndpoint<Output<I, "body">, Input<I, "query">, RouteJSON<R>, Input<I, "headers">, never, Input<I, "body">> & {
|
|
31
|
+
__types: {
|
|
32
|
+
params: RoutePathParams<P>;
|
|
33
|
+
inputHeaders: Input<I, "headers">;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type TrimStart<P extends string> = P extends `/${infer Rest}` ? TrimStart<Rest> : P;
|
|
37
|
+
type Join<P extends string, C extends string> = C extends "" ? P : `${P}/${TrimStart<C>}`;
|
|
38
|
+
type ParamsCheck<P extends string, I extends RouteInputSchemas> = I extends {
|
|
39
|
+
params: infer S;
|
|
40
|
+
} ? Exclude<keyof RoutePathParams<P>, keyof RouteSchemaOutput<S>> extends never ? Exclude<keyof RouteSchemaOutput<S>, keyof RoutePathParams<P>> extends never ? unknown : {
|
|
41
|
+
__error_unknown_route_params: never;
|
|
42
|
+
} : {
|
|
43
|
+
__error_missing_route_params: never;
|
|
44
|
+
} : unknown;
|
|
45
|
+
type RouteMiddlewareResults = readonly (EndpointMiddlewareResult | Promise<EndpointMiddlewareResult>)[];
|
|
46
|
+
type RouteMiddlewares<Results extends readonly unknown[]> = {
|
|
47
|
+
readonly [K in keyof Results]: (context: Parameters<AnyEndpointMiddleware>[0]) => Results[K];
|
|
48
|
+
};
|
|
49
|
+
type RouteOptions<P extends string, I extends RouteInputSchemas, O extends RouteSchema | undefined, R, MiddlewareResults extends RouteMiddlewareResults = RouteMiddlewareResults> = {
|
|
50
|
+
input?: I & ParamsCheck<P, I>;
|
|
51
|
+
/** Validate plain JSON handler results. Raw Response/stream results are never buffered. */
|
|
52
|
+
output?: O;
|
|
53
|
+
/** Opt this app-owned endpoint into an installed MCP transport. */
|
|
54
|
+
mcp?: EndpointMCPOptions;
|
|
55
|
+
middleware?: RouteMiddlewares<MiddlewareResults>;
|
|
56
|
+
handler(request: Request, context: {
|
|
57
|
+
input: {
|
|
58
|
+
body: Output<I, "body">;
|
|
59
|
+
query: Output<I, "query", Record<string, string | string[]>>;
|
|
60
|
+
headers: Output<I, "headers", Record<string, string>>;
|
|
61
|
+
params: Output<I, "params", RoutePathParams<P>>;
|
|
62
|
+
};
|
|
63
|
+
params: Output<I, "params", RoutePathParams<P>>;
|
|
64
|
+
context: Readonly<InferEndpointMiddlewareContext<RouteMiddlewares<MiddlewareResults>>>;
|
|
65
|
+
}): R | Promise<R>;
|
|
66
|
+
};
|
|
67
|
+
type RouteBuilder<P extends string, M extends RouteMethod> = <const C extends string, const MiddlewareResults extends RouteMiddlewareResults, const I extends RouteInputSchemas = {}, O extends RouteSchema | undefined = undefined, R = unknown>(path: C, options: RouteOptions<Join<P, C>, I, O, R, MiddlewareResults>) => RouteDefinition<Join<P, C>, M, RouteEndpoint<Join<P, C>, I, Extract<Awaited<R>, Response> extends never ? O extends RouteSchema ? RouteSchemaOutput<O> : Awaited<R> : unknown>>;
|
|
68
|
+
type RouteFactory<P extends string = ""> = {
|
|
69
|
+
[M in Lowercase<RouteMethod>]: RouteBuilder<P, Uppercase<M> & RouteMethod>;
|
|
70
|
+
} & {
|
|
71
|
+
/** Return a new builder; never mutate the parent scope. */
|
|
72
|
+
scope<const C extends string>(path: C): RouteFactory<Join<P, C>>;
|
|
73
|
+
};
|
|
74
|
+
type PluginRoutes = readonly RouteDefinition[];
|
|
75
|
+
interface PluginLocalAPIEndpoint {
|
|
76
|
+
readonly path: string;
|
|
77
|
+
readonly method: RouteMethod;
|
|
78
|
+
readonly input: Readonly<RouteInputSchemas>;
|
|
79
|
+
readonly output?: RouteSchema;
|
|
80
|
+
readonly mcp?: EndpointMCPOptions;
|
|
81
|
+
invoke(request: Request, params?: Readonly<Record<string, string | string[]>>): Promise<Response>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Read-only access to app-owned API endpoints while plugin routes are mounted.
|
|
85
|
+
* Plugin routes are intentionally excluded so a plugin cannot recurse through
|
|
86
|
+
* itself or depend on plugin registration order.
|
|
87
|
+
*/
|
|
88
|
+
interface PluginLocalAPI {
|
|
89
|
+
/** False during type-only route discovery, where app endpoint modules are unavailable. */
|
|
90
|
+
readonly available: boolean;
|
|
91
|
+
get(method: RouteMethod, path: string): PluginLocalAPIEndpoint | undefined;
|
|
92
|
+
/** Enumerate app-owned endpoints. Plugin routes are excluded. */
|
|
93
|
+
list(): readonly PluginLocalAPIEndpoint[];
|
|
94
|
+
}
|
|
95
|
+
type PluginRoutesFactory<R extends PluginRoutes = PluginRoutes> = (context: {
|
|
96
|
+
route: RouteFactory;
|
|
97
|
+
api: PluginLocalAPI;
|
|
98
|
+
}) => R;
|
|
99
|
+
declare function createRouteFactory(): RouteFactory;
|
|
100
|
+
type UnionToIntersection$1<U> = (U extends unknown ? (v: U) => void : never) extends (v: infer I) => void ? I : never;
|
|
101
|
+
type RouteTree<P extends string, M extends string, E> = P extends `${infer Head}/${infer Tail}` ? {
|
|
102
|
+
[K in Head]: RouteTree<Tail, M, E>;
|
|
103
|
+
} : P extends "" ? {
|
|
104
|
+
[K in Lowercase<M>]: E;
|
|
105
|
+
} : {
|
|
106
|
+
[K in P]: {
|
|
107
|
+
[Method in Lowercase<M>]: E;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
type HasMethodSegment<P extends string> = P extends `${infer H}/${infer T}` ? H extends Lowercase<RouteMethod> ? true : HasMethodSegment<T> : P extends Lowercase<RouteMethod> ? true : false;
|
|
111
|
+
type DefinitionTree<D> = D extends RouteDefinition<infer P, infer M, infer E> ? string extends P ? {} : (P extends `/api/integrations${string}` ? true : HasMethodSegment<P>) extends true ? {
|
|
112
|
+
[K in P extends `/api/${infer C}` ? `/${C}` : "/"]: {
|
|
113
|
+
[Method in Lowercase<M>]: E;
|
|
114
|
+
};
|
|
115
|
+
} : RouteTree<P extends `/api/${infer C}` ? C : "", M, E> : {};
|
|
116
|
+
type PluginAPIRouter<C> = C extends {
|
|
117
|
+
plugins: readonly (infer P)[];
|
|
118
|
+
} ? UnionToIntersection$1<P extends {
|
|
119
|
+
routes?: PluginRoutesFactory<infer R>;
|
|
120
|
+
} ? DefinitionTree<R[number]> : {}> : {};
|
|
121
|
+
declare function resolvePluginRoutes(plugins?: readonly {
|
|
122
|
+
name: string;
|
|
123
|
+
routes?: PluginRoutesFactory;
|
|
124
|
+
}[], context?: {
|
|
125
|
+
api?: PluginLocalAPI;
|
|
126
|
+
}): PluginRoutes;
|
|
127
|
+
|
|
1
128
|
type FarmIntegrationAPIMethod = "GET" | "QUERY" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
2
129
|
type FarmIntegrationAPIBodyFormat = "json" | "form" | "none";
|
|
3
130
|
type FarmIntegrationAPIResponseFormat = "json" | "text" | "response";
|
|
@@ -94,4 +221,4 @@ declare const endpoint: {
|
|
|
94
221
|
};
|
|
95
222
|
};
|
|
96
223
|
|
|
97
|
-
export { type FarmIntegrationAPI as F, type InferIntegrationAPIFromRoutes as I, api as a, defineIntegrationAPIOperation as b, type FarmIntegrationAPIBodyFormat as c, defineIntegrationAPI as d, type FarmIntegrationAPIMethod as e, type FarmIntegrationAPIOperation as f, type FarmIntegrationAPIResponseFormat as g, type FarmIntegrationRouteOperationCarrier as h, endpoint as i };
|
|
224
|
+
export { type FarmIntegrationAPI as F, type InferIntegrationAPIFromRoutes as I, type PluginRoutesFactory as P, type RouteMethod as R, api as a, defineIntegrationAPIOperation as b, type FarmIntegrationAPIBodyFormat as c, defineIntegrationAPI as d, type FarmIntegrationAPIMethod as e, type FarmIntegrationAPIOperation as f, type FarmIntegrationAPIResponseFormat as g, type FarmIntegrationRouteOperationCarrier as h, endpoint as i, type RoutePathParams as j, type RouteInputSchemas as k, type RouteJSON as l, type RouteDefinition as m, type RouteOptions as n, type RouteFactory as o, type PluginRoutes as p, type PluginLocalAPIEndpoint as q, type PluginLocalAPI as r, createRouteFactory as s, type PluginAPIRouter as t, resolvePluginRoutes as u };
|