@farm.js/core 0.1.27 → 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 +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/api/client.cjs +4 -6
- package/dist/api/client.d.mts +1 -0
- package/dist/api/client.d.ts +1 -0
- package/dist/api/client.mjs +3 -5
- package/dist/api/route-manager.cjs +9 -8
- package/dist/api/route-manager.d.mts +2 -1
- package/dist/api/route-manager.d.ts +2 -1
- package/dist/api/route-manager.mjs +8 -7
- package/dist/api/runtime.cjs +7 -6
- package/dist/api/runtime.d.mts +2 -1
- package/dist/api/runtime.d.ts +2 -1
- package/dist/api/runtime.mjs +6 -5
- package/dist/api.cjs +12 -11
- package/dist/api.d.mts +3 -2
- package/dist/api.d.ts +3 -2
- package/dist/api.mjs +11 -10
- package/dist/{app-BfzZdjgX.d.mts → app-DSSq6wiN.d.mts} +3 -3
- package/dist/{app-CXK7Prrt.d.ts → app-M8nVWvNU.d.ts} +3 -3
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/app-markdown.mjs +4 -4
- 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-4FHDV7VM.mjs → chunk-2CNBR3EB.mjs} +2 -2
- package/dist/{chunk-MBFURXAC.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-DQMTHWPI.cjs → chunk-55ZY4ZA7.cjs} +4 -4
- 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-WJKVTJJR.cjs → chunk-A672WZEG.cjs} +2 -2
- package/dist/{chunk-NL3ZSMZB.cjs → chunk-BJPBQNIE.cjs} +12 -12
- package/dist/{chunk-Q4BHBO6V.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-YXM74XOW.cjs → chunk-D4JE5NNV.cjs} +12 -12
- package/dist/{chunk-4UNKCNSL.mjs → chunk-E76XC6ZG.mjs} +2 -2
- package/dist/{chunk-G3HRIVEY.cjs → chunk-ES4B2IXW.cjs} +2 -2
- package/dist/{chunk-TDWFCC2T.cjs → chunk-EWZ3XHKQ.cjs} +2 -2
- package/dist/{chunk-JQGDQO2I.cjs → chunk-EXLKRR4U.cjs} +10 -10
- package/dist/{chunk-YZBV7733.cjs → chunk-F52CDFJM.cjs} +81 -81
- package/dist/{chunk-HG237IEY.mjs → chunk-FB3H4INL.mjs} +1 -1
- package/dist/{chunk-UWTQTZFN.mjs → chunk-FVCSLZWT.mjs} +11 -11
- package/dist/{chunk-WD4YXVLV.mjs → chunk-GZYH4OER.mjs} +1 -1
- package/dist/{chunk-DX4VKYAJ.cjs → chunk-I26CZYPV.cjs} +6 -4
- package/dist/{chunk-UNSKL6BI.cjs → chunk-ID6OVSLH.cjs} +163 -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-LAHZ7LZA.cjs → chunk-JUFRXDTK.cjs} +18 -18
- package/dist/{chunk-POXI72VV.mjs → chunk-K3YEZLSY.mjs} +53 -8
- package/dist/{chunk-Y4YWHNKU.cjs → chunk-KH7BN726.cjs} +9 -9
- package/dist/{chunk-KAERLFD3.cjs → chunk-KOQ555NR.cjs} +16 -13
- package/dist/{chunk-O2LV5XDG.mjs → chunk-KXGDXYUC.mjs} +3 -3
- package/dist/{chunk-3IL5UC5I.cjs → chunk-KZLND3D2.cjs} +2 -2
- package/dist/{chunk-NPFGGBM5.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-3PTVHMLD.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-C7OUJ6JI.cjs → chunk-PZNCMPJF.cjs} +3 -3
- package/dist/{chunk-WIVTGKLY.mjs → chunk-PZPDGOU5.mjs} +9 -6
- package/dist/{chunk-52SH7TKB.mjs → chunk-QG5HNS7P.mjs} +2 -2
- package/dist/{chunk-CEYUWDWA.mjs → chunk-QZCT2CQ4.mjs} +10 -5
- package/dist/{chunk-JT25KHDI.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-FPW4W3VW.mjs → chunk-T7HQ3I4C.mjs} +1 -1
- package/dist/{chunk-HF5SIACK.cjs → chunk-TII23GJC.cjs} +3 -3
- package/dist/{chunk-QQQNJS2E.mjs → chunk-UX2DD2VK.mjs} +1 -1
- package/dist/{chunk-I4J452B7.cjs → chunk-VHJGDMCG.cjs} +3 -3
- package/dist/{chunk-QI7WQSMI.cjs → chunk-VQXDC5UV.cjs} +4 -4
- package/dist/{chunk-B6ZCT36X.cjs → chunk-WNLBF77X.cjs} +4 -4
- package/dist/{chunk-6EG7U4NF.mjs → chunk-X7WVQMIB.mjs} +1 -1
- package/dist/{chunk-5SPPCN5J.mjs → chunk-XNPDONUH.mjs} +1 -1
- package/dist/{chunk-ZSO5GWGD.cjs → chunk-XSPGWQWA.cjs} +75 -30
- package/dist/{chunk-FOT7LZEO.cjs → chunk-Y7GW7J46.cjs} +1 -1
- package/dist/{chunk-UOXGA6TO.mjs → chunk-YDQZGSDS.mjs} +1 -1
- package/dist/{chunk-C3VRMB6H.cjs → chunk-ZCU4NZ3M.cjs} +6 -6
- package/dist/{chunk-OGHTEYXS.mjs → chunk-ZRIE4KMG.mjs} +62 -28
- package/dist/{client-plugins-1GS4zubE.d.mts → client-plugins-CgYNY7jF.d.mts} +35 -32
- package/dist/{client-plugins-B1Za6F5x.d.ts → client-plugins-Fl9Og3yB.d.ts} +35 -32
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +11 -12
- package/dist/client.d.mts +6 -5
- package/dist/client.d.ts +6 -5
- package/dist/client.mjs +10 -11
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/{devtools-6RN6KHTW.mjs → devtools-3E7ZANMZ.mjs} +4 -4
- package/dist/{devtools-CQJ3H6MX.cjs → devtools-5AREISIA.cjs} +5 -5
- package/dist/docs.cjs +7 -7
- package/dist/docs.mjs +6 -6
- package/dist/index.cjs +56 -54
- package/dist/index.d.mts +14 -13
- package/dist/index.d.ts +14 -13
- package/dist/index.mjs +64 -62
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +3 -2
- package/dist/internal/app-markdown-runtime.d.ts +3 -2
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +23 -22
- package/dist/internal/build-runtime.d.mts +4 -3
- package/dist/internal/build-runtime.d.ts +4 -3
- package/dist/internal/build-runtime.mjs +22 -21
- package/dist/internal/cli-runtime.cjs +13 -12
- package/dist/internal/cli-runtime.mjs +12 -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 +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +5 -5
- package/dist/internal/config-runtime.d.mts +3 -2
- package/dist/internal/config-runtime.d.ts +3 -2
- package/dist/internal/config-runtime.mjs +4 -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 +17 -15
- package/dist/internal/production-runtime.d.mts +8 -7
- package/dist/internal/production-runtime.d.ts +8 -7
- package/dist/internal/production-runtime.mjs +17 -15
- package/dist/markdown.cjs +3 -3
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/markdown.mjs +2 -2
- package/dist/{metadata-B9mCxKgp.d.mts → metadata-B0X-qtcQ.d.mts} +1 -1
- package/dist/{metadata-7LKgQEWF.d.ts → metadata-BdDKgd7K.d.ts} +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +4 -3
- package/dist/middleware.d.ts +4 -3
- package/dist/middleware.mjs +3 -3
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +5 -4
- package/dist/navigation.d.ts +5 -4
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +23 -19
- package/dist/plugin.d.mts +2 -1
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.mjs +23 -19
- package/dist/{production-runtime-DramhI0c.d.mts → production-runtime-BjgFgDIg.d.mts} +1 -1
- package/dist/{production-runtime-B3xnY6fI.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-CpW32tOL.d.ts → render-plan-B41EWmBb.d.ts} +1 -1
- package/dist/{render-plan-CtQB-zHS.d.mts → render-plan-_1TAWODt.d.mts} +1 -1
- package/dist/renderer-client.cjs +13 -14
- package/dist/renderer-client.d.mts +4 -3
- package/dist/renderer-client.d.ts +4 -3
- package/dist/renderer-client.mjs +6 -7
- package/dist/{request-DlLVBKe3.d.mts → request-BhE4luLv.d.mts} +1 -1
- package/dist/{request-BVGGeQv4.d.ts → request-Dbf3G0zM.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering-BdEldajn.d.ts → route-rendering-Z7PveTZE.d.ts} +1 -1
- package/dist/{route-rendering-DChYLNdh.d.mts → route-rendering-zzfx_GHf.d.mts} +1 -1
- package/dist/{router-D5htHn_M.d.mts → router-BatNMsa1.d.mts} +1 -1
- package/dist/{router-D0Az-1Nu.d.ts → router-DtNRhQl3.d.ts} +1 -1
- package/dist/routes.cjs +6 -5
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/routes.mjs +5 -4
- package/dist/server-fn-client.d.mts +1 -0
- package/dist/server-fn-client.d.ts +1 -0
- package/dist/server-fn.cjs +6 -5
- package/dist/server-fn.d.mts +1 -0
- package/dist/server-fn.d.ts +1 -0
- package/dist/server-fn.mjs +5 -4
- package/dist/server-plugins.d.mts +3 -2
- package/dist/server-plugins.d.ts +3 -2
- package/dist/server-query-client.cjs +5 -7
- package/dist/server-query-client.d.mts +1 -0
- package/dist/server-query-client.d.ts +1 -0
- package/dist/server-query-client.mjs +4 -6
- package/dist/server-query.cjs +7 -6
- package/dist/server-query.d.mts +1 -0
- package/dist/server-query.d.ts +1 -0
- package/dist/server-query.mjs +6 -5
- package/dist/server.cjs +64 -54
- package/dist/server.d.mts +9 -8
- package/dist/server.d.ts +9 -8
- package/dist/server.mjs +48 -38
- package/dist/{spa-router-DmwP_7QL.d.ts → spa-router-BE3bwU-J.d.ts} +2 -2
- package/dist/{spa-router-DVfSJZ5o.d.mts → spa-router-DQOnHZVj.d.mts} +2 -2
- package/dist/testing.cjs +14 -13
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.mjs +11 -10
- package/dist/{utils-B_Rmr0-n.d.mts → utils-DLK1ERNl.d.mts} +1 -1
- package/dist/{utils-Dv0OuLtF.d.ts → utils-u7ZBSWAK.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +19 -18
- package/dist/vite.d.mts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.mjs +18 -17
- package/package.json +1 -1
- 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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkES4B2IXWcjs = require('./chunk-ES4B2IXW.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkSK35NQKKcjs = require('./chunk-SK35NQKK.cjs');
|
|
@@ -14,9 +14,11 @@ var _chunkT5CERMEHcjs = require('./chunk-T5CERMEH.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
var _chunk2SDO73HKcjs = require('./chunk-2SDO73HK.cjs');
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -33,17 +35,17 @@ function createServerQuery(options) {
|
|
|
33
35
|
throw new TypeError("createServerQuery requires a key function");
|
|
34
36
|
}
|
|
35
37
|
const staleTime = normalizeServerQueryStaleTime(options.staleTime);
|
|
36
|
-
const execute =
|
|
38
|
+
const execute = _chunkES4B2IXWcjs.createServerFn.call(void 0, {
|
|
37
39
|
input: options.input,
|
|
38
40
|
middleware: options.middleware,
|
|
39
41
|
handler: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (context) => {
|
|
40
42
|
const routeKey = await options.key(context);
|
|
41
43
|
assertServerQueryKey(routeKey);
|
|
42
|
-
const clientKey =
|
|
43
|
-
const cacheKey =
|
|
44
|
+
const clientKey = _chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, routeKey);
|
|
45
|
+
const cacheKey = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["route-data", routeKey]);
|
|
44
46
|
const producer = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
45
47
|
const value = await options.handler(context);
|
|
46
|
-
return
|
|
48
|
+
return _chunkES4B2IXWcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
|
|
47
49
|
}, "producer");
|
|
48
50
|
let data;
|
|
49
51
|
let updatedAt;
|
|
@@ -51,9 +53,9 @@ function createServerQuery(options) {
|
|
|
51
53
|
data = await dedupeServerQueryRequest(cacheKey, context.request, producer);
|
|
52
54
|
updatedAt = Date.now();
|
|
53
55
|
} else {
|
|
54
|
-
const cache =
|
|
56
|
+
const cache = _chunk2SDO73HKcjs.getFarmDataCache.call(void 0, );
|
|
55
57
|
data = await cache.getOrSet(cacheKey, producer, {
|
|
56
|
-
tags: [
|
|
58
|
+
tags: [_chunk2SDO73HKcjs.createRouteDataCacheTag.call(void 0, routeKey)],
|
|
57
59
|
revalidate: staleTime === false ? false : staleTime / 1e3
|
|
58
60
|
});
|
|
59
61
|
updatedAt = await _asyncNullishCoalesce(await _asyncOptionalChain([(await cache.getEntryAsync(cacheKey, { allowStale: true })), 'optionalAccess', async _ => _.createdAt]), async () => ( Date.now()));
|
|
@@ -88,10 +90,10 @@ function createServerQuery(options) {
|
|
|
88
90
|
enumerable: false
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
|
-
|
|
93
|
+
_chunkES4B2IXWcjs._attachServerFunctionDescriptor.call(void 0,
|
|
92
94
|
query,
|
|
93
|
-
|
|
94
|
-
const result = await
|
|
95
|
+
_chunkES4B2IXWcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
|
|
96
|
+
const result = await _chunkES4B2IXWcjs._runServerFunctionForCaller.call(void 0,
|
|
95
97
|
execute,
|
|
96
98
|
value
|
|
97
99
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk55ZY4ZA7cjs = require('./chunk-55ZY4ZA7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
@@ -210,7 +210,7 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
|
|
|
210
210
|
if (isResponse(value)) {
|
|
211
211
|
return method === "HEAD" ? _chunkTKJZFIMLcjs.omitFarmResponseBody.call(void 0, value) : value;
|
|
212
212
|
}
|
|
213
|
-
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ?
|
|
213
|
+
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunk55ZY4ZA7cjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
|
|
214
214
|
const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
|
|
215
215
|
return new Response(method === "HEAD" ? null : body, {
|
|
216
216
|
headers: {
|
|
@@ -7,7 +7,7 @@ var _chunkLTNGXMQ6cjs = require('./chunk-LTNGXMQ6.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk63H6BKXGcjs = require('./chunk-63H6BKXG.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkJ7FSKED3cjs = require('./chunk-J7FSKED3.cjs');
|
|
@@ -1148,7 +1148,7 @@ function createApiClients(options = {}) {
|
|
|
1148
1148
|
{
|
|
1149
1149
|
headers,
|
|
1150
1150
|
signal: currentRequest.signal,
|
|
1151
|
-
cache: new (0,
|
|
1151
|
+
cache: new (0, _chunk63H6BKXGcjs.FarmClientDataCache)({ subscribeToInvalidation: false }),
|
|
1152
1152
|
routeMeta,
|
|
1153
1153
|
fetch: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (url, init) => {
|
|
1154
1154
|
if (new URL(url).origin !== origin) {
|
|
@@ -1211,7 +1211,7 @@ function createAPIClientRuntime(options = {}, transport) {
|
|
|
1211
1211
|
const rootAliases = integrationOptions === false ? void 0 : {
|
|
1212
1212
|
integrations: integrationsClient(integrationOptions)
|
|
1213
1213
|
};
|
|
1214
|
-
const sharedCacheState = _nullishCoalesce(_optionalChain([transport, 'optionalAccess', _46 => _46.cache]), () => (
|
|
1214
|
+
const sharedCacheState = _nullishCoalesce(_optionalChain([transport, 'optionalAccess', _46 => _46.cache]), () => ( _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, )));
|
|
1215
1215
|
const localCaches = transport ? /* @__PURE__ */ new Set([sharedCacheState]) : void 0;
|
|
1216
1216
|
const sharedInflightState = /* @__PURE__ */ new Map();
|
|
1217
1217
|
let scopedRequestState;
|
|
@@ -1309,7 +1309,7 @@ function createAPIClientRuntime(options = {}, transport) {
|
|
|
1309
1309
|
...clientOptions.cache
|
|
1310
1310
|
} : void 0;
|
|
1311
1311
|
const configuredCacheKey = _nullishCoalesce(_optionalChain([clientOptions, 'optionalAccess', _65 => _65.key]), () => ( _optionalChain([cacheOptions, 'optionalAccess', _66 => _66.key])));
|
|
1312
|
-
const cacheKey =
|
|
1312
|
+
const cacheKey = _chunk63H6BKXGcjs.normalizeFarmClientCacheKey.call(void 0,
|
|
1313
1313
|
_nullishCoalesce(configuredCacheKey, () => ( buildCacheKey(methodUpper, path, input, baseURL, defaultHeaders)))
|
|
1314
1314
|
);
|
|
1315
1315
|
const now = Date.now();
|
|
@@ -1360,7 +1360,7 @@ function createAPIClientRuntime(options = {}, transport) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
_nullishCoalesce(scopedRequestState, () => ( (scopedRequestState = {
|
|
1362
1362
|
context: requestCacheContext,
|
|
1363
|
-
cache: new (0,
|
|
1363
|
+
cache: new (0, _chunk63H6BKXGcjs.FarmClientDataCache)({ subscribeToInvalidation: !transport }),
|
|
1364
1364
|
inflight: /* @__PURE__ */ new Map(),
|
|
1365
1365
|
retired: false
|
|
1366
1366
|
})));
|
|
@@ -2045,14 +2045,14 @@ function settleOptimisticUpdates(cacheState, optimisticState, snapshots, outcome
|
|
|
2045
2045
|
}
|
|
2046
2046
|
_chunkS3JO3N4Hcjs.__name.call(void 0, settleOptimisticUpdates, "settleOptimisticUpdates");
|
|
2047
2047
|
function applyServerFnOptimisticUpdates(updates, now = Date.now()) {
|
|
2048
|
-
const cacheState =
|
|
2048
|
+
const cacheState = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, );
|
|
2049
2049
|
const optimisticState = getOptimisticState(cacheState);
|
|
2050
2050
|
const snapshots = /* @__PURE__ */ new Map();
|
|
2051
2051
|
for (const update of updates) {
|
|
2052
2052
|
if (update.length !== 2) continue;
|
|
2053
2053
|
const [target, updater] = update;
|
|
2054
2054
|
if (typeof updater !== "function") continue;
|
|
2055
|
-
const targetKey = typeof target === "string" || Array.isArray(target) ?
|
|
2055
|
+
const targetKey = typeof target === "string" || Array.isArray(target) ? _chunk63H6BKXGcjs.normalizeFarmClientCacheKey.call(void 0, target) : null;
|
|
2056
2056
|
if (!targetKey) continue;
|
|
2057
2057
|
const targetEntry = getValidCacheEntry(cacheState, targetKey, now);
|
|
2058
2058
|
const currentEntry = cacheState.get(targetKey);
|
|
@@ -2102,7 +2102,7 @@ function applyServerFnOptimisticUpdates(updates, now = Date.now()) {
|
|
|
2102
2102
|
_chunkS3JO3N4Hcjs.__name.call(void 0, applyServerFnOptimisticUpdates, "applyServerFnOptimisticUpdates");
|
|
2103
2103
|
function settleServerFnOptimisticUpdates(snapshots, outcome) {
|
|
2104
2104
|
if (snapshots.length === 0) return;
|
|
2105
|
-
const cacheState =
|
|
2105
|
+
const cacheState = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, );
|
|
2106
2106
|
settleOptimisticUpdates(cacheState, getOptimisticState(cacheState), snapshots, outcome);
|
|
2107
2107
|
}
|
|
2108
2108
|
_chunkS3JO3N4Hcjs.__name.call(void 0, settleServerFnOptimisticUpdates, "settleServerFnOptimisticUpdates");
|
|
@@ -2112,9 +2112,9 @@ function resolveServerFnInvalidateTargets(invalidate) {
|
|
|
2112
2112
|
for (const target of targets) {
|
|
2113
2113
|
if (typeof target === "string" || Array.isArray(target)) {
|
|
2114
2114
|
if (Array.isArray(target) && typeof target[0] === "function") continue;
|
|
2115
|
-
keys.push(
|
|
2115
|
+
keys.push(_chunk63H6BKXGcjs.normalizeFarmClientCacheKey.call(void 0, target));
|
|
2116
2116
|
} else if (target && typeof target === "object" && "key" in target) {
|
|
2117
|
-
keys.push(
|
|
2117
|
+
keys.push(_chunk63H6BKXGcjs.normalizeFarmClientCacheKey.call(void 0, target.key));
|
|
2118
2118
|
}
|
|
2119
2119
|
}
|
|
2120
2120
|
return keys;
|
|
@@ -2219,9 +2219,9 @@ function resolveTargetKey(routeMeta, target, input, baseURL = "http://localhost:
|
|
|
2219
2219
|
if (typeof route === "function") {
|
|
2220
2220
|
return resolveTargetKey(routeMeta, route, routeInput, baseURL, defaultHeaders, localBaseURL);
|
|
2221
2221
|
}
|
|
2222
|
-
return
|
|
2222
|
+
return _chunk63H6BKXGcjs.normalizeFarmClientCacheKey.call(void 0, target);
|
|
2223
2223
|
}
|
|
2224
|
-
if ("key" in target) return
|
|
2224
|
+
if ("key" in target) return _chunk63H6BKXGcjs.normalizeFarmClientCacheKey.call(void 0, target.key);
|
|
2225
2225
|
if ("path" in target) {
|
|
2226
2226
|
const method = _nullishCoalesce(target.method, () => ( "GET"));
|
|
2227
2227
|
return buildCacheKey(method, target.path, _nullishCoalesce(target.input, () => ( {})), baseURL, defaultHeaders);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findProgrammaticRouteFilesInDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LNZ7JZUS.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isFarmAPIRouteFileName
|
|
6
6
|
} from "./chunk-CU625VAY.mjs";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
matchAPIRouteAtBasePath,
|
|
18
18
|
mergePluginAPIRoutes,
|
|
19
19
|
resolveAPIRouteEndpoint
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-X7WVQMIB.mjs";
|
|
21
21
|
import {
|
|
22
22
|
registerAPIRouteShape
|
|
23
23
|
} from "./chunk-W3B4PKAW.mjs";
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-LPEX4YW6.mjs";
|
|
4
|
+
|
|
5
|
+
// src/cache-key.ts
|
|
6
|
+
function createRouteDataCacheKey(key) {
|
|
7
|
+
return createFarmCacheKey(Array.isArray(key) ? key : [key]);
|
|
8
|
+
}
|
|
9
|
+
__name(createRouteDataCacheKey, "createRouteDataCacheKey");
|
|
10
|
+
function createFarmCacheKey(parts) {
|
|
11
|
+
return stableSerialize(parts);
|
|
12
|
+
}
|
|
13
|
+
__name(createFarmCacheKey, "createFarmCacheKey");
|
|
14
|
+
function getFunctionCacheIdentity(fn) {
|
|
15
|
+
const name = fn.name || "anonymous";
|
|
16
|
+
return `${name}:${hashFunctionSource(String(fn))}`;
|
|
17
|
+
}
|
|
18
|
+
__name(getFunctionCacheIdentity, "getFunctionCacheIdentity");
|
|
19
|
+
function hashFunctionSource(source) {
|
|
20
|
+
let hash = 2166136261;
|
|
21
|
+
for (let index = 0; index < source.length; index++) {
|
|
22
|
+
hash ^= source.charCodeAt(index);
|
|
23
|
+
hash = Math.imul(hash, 16777619);
|
|
24
|
+
}
|
|
25
|
+
return (hash >>> 0).toString(36);
|
|
26
|
+
}
|
|
27
|
+
__name(hashFunctionSource, "hashFunctionSource");
|
|
28
|
+
function compareCodepoint(a, b) {
|
|
29
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
30
|
+
}
|
|
31
|
+
__name(compareCodepoint, "compareCodepoint");
|
|
32
|
+
function serializeBinaryBytes(bytes) {
|
|
33
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
34
|
+
}
|
|
35
|
+
__name(serializeBinaryBytes, "serializeBinaryBytes");
|
|
36
|
+
function serializeCanonicalStringEntries(entries, seen) {
|
|
37
|
+
const valuesByKey = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const [key, item] of entries) {
|
|
39
|
+
const values = valuesByKey.get(key);
|
|
40
|
+
if (values) values.push(item);
|
|
41
|
+
else valuesByKey.set(key, [item]);
|
|
42
|
+
}
|
|
43
|
+
return Array.from(valuesByKey.keys()).sort(compareCodepoint).flatMap(
|
|
44
|
+
(key) => valuesByKey.get(key).map((item) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`)
|
|
45
|
+
).join(",");
|
|
46
|
+
}
|
|
47
|
+
__name(serializeCanonicalStringEntries, "serializeCanonicalStringEntries");
|
|
48
|
+
function isPlainCacheKeyObject(value) {
|
|
49
|
+
const prototype = Object.getPrototypeOf(value);
|
|
50
|
+
if (prototype === null) return true;
|
|
51
|
+
const constructor = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
|
|
52
|
+
return Object.getPrototypeOf(prototype) === null && typeof constructor === "function" && constructor.name === "Object";
|
|
53
|
+
}
|
|
54
|
+
__name(isPlainCacheKeyObject, "isPlainCacheKeyObject");
|
|
55
|
+
function getCacheKeyValueType(value) {
|
|
56
|
+
const prototype = Object.getPrototypeOf(value);
|
|
57
|
+
const constructor = prototype ? Object.getOwnPropertyDescriptor(prototype, "constructor")?.value : void 0;
|
|
58
|
+
if (typeof constructor === "function" && constructor.name) {
|
|
59
|
+
return constructor.name;
|
|
60
|
+
}
|
|
61
|
+
return Object.prototype.toString.call(value).slice(8, -1) || "object";
|
|
62
|
+
}
|
|
63
|
+
__name(getCacheKeyValueType, "getCacheKeyValueType");
|
|
64
|
+
function stableSerialize(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
65
|
+
if (value === null) return "null";
|
|
66
|
+
if (value === void 0) return "undefined";
|
|
67
|
+
const valueType = typeof value;
|
|
68
|
+
if (valueType === "string") return JSON.stringify(value);
|
|
69
|
+
if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
|
|
70
|
+
return `${valueType}:${String(value)}`;
|
|
71
|
+
}
|
|
72
|
+
if (valueType === "symbol") {
|
|
73
|
+
return `symbol:${String(value)}`;
|
|
74
|
+
}
|
|
75
|
+
if (valueType === "function") {
|
|
76
|
+
return `function:${getFunctionCacheIdentity(value)}`;
|
|
77
|
+
}
|
|
78
|
+
if (value instanceof Date) {
|
|
79
|
+
return Number.isNaN(value.getTime()) ? "date:invalid" : `date:${value.toISOString()}`;
|
|
80
|
+
}
|
|
81
|
+
if (value instanceof URL) {
|
|
82
|
+
return `url:${value.toString()}`;
|
|
83
|
+
}
|
|
84
|
+
if (value instanceof RegExp) {
|
|
85
|
+
return `regexp:${value.toString()}`;
|
|
86
|
+
}
|
|
87
|
+
if (value instanceof ArrayBuffer) {
|
|
88
|
+
return `arraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
|
|
89
|
+
}
|
|
90
|
+
if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer) {
|
|
91
|
+
return `sharedarraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
|
|
92
|
+
}
|
|
93
|
+
if (ArrayBuffer.isView(value)) {
|
|
94
|
+
const viewType = Object.prototype.toString.call(value).slice(8, -1);
|
|
95
|
+
const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
96
|
+
return `binary:${viewType}:${serializeBinaryBytes(bytes)}`;
|
|
97
|
+
}
|
|
98
|
+
if (value && typeof value === "object") {
|
|
99
|
+
if (seen.has(value)) {
|
|
100
|
+
return "[Circular]";
|
|
101
|
+
}
|
|
102
|
+
seen.add(value);
|
|
103
|
+
if (Array.isArray(value)) {
|
|
104
|
+
const items = [];
|
|
105
|
+
for (let index = 0; index < value.length; index++) {
|
|
106
|
+
items.push(
|
|
107
|
+
Object.prototype.hasOwnProperty.call(value, index) ? stableSerialize(value[index], seen) : "[Hole]"
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
seen.delete(value);
|
|
111
|
+
return `[${items.join(",")}]`;
|
|
112
|
+
}
|
|
113
|
+
if (value instanceof Set) {
|
|
114
|
+
const items = Array.from(value, (item) => stableSerialize(item, seen)).sort(compareCodepoint);
|
|
115
|
+
seen.delete(value);
|
|
116
|
+
return `set:[${items.join(",")}]`;
|
|
117
|
+
}
|
|
118
|
+
if (value instanceof Map) {
|
|
119
|
+
const items = Array.from(
|
|
120
|
+
value,
|
|
121
|
+
([key, item]) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`
|
|
122
|
+
).sort(compareCodepoint);
|
|
123
|
+
seen.delete(value);
|
|
124
|
+
return `map:[${items.join(",")}]`;
|
|
125
|
+
}
|
|
126
|
+
if (value instanceof URLSearchParams) {
|
|
127
|
+
const serialized2 = serializeCanonicalStringEntries(value, seen);
|
|
128
|
+
seen.delete(value);
|
|
129
|
+
return `urlsearchparams:[${serialized2}]`;
|
|
130
|
+
}
|
|
131
|
+
if (value instanceof Headers) {
|
|
132
|
+
const serialized2 = serializeCanonicalStringEntries(value, seen);
|
|
133
|
+
seen.delete(value);
|
|
134
|
+
return `headers:[${serialized2}]`;
|
|
135
|
+
}
|
|
136
|
+
if (!isPlainCacheKeyObject(value)) {
|
|
137
|
+
throw new TypeError(
|
|
138
|
+
`Cache keys do not support ${getCacheKeyValueType(value)} values. Convert the value to an explicit stable string or structured key before caching.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
const entries = Object.entries(value).sort(
|
|
142
|
+
([a], [b]) => compareCodepoint(a, b)
|
|
143
|
+
);
|
|
144
|
+
const serialized = entries.map(([key, item]) => `${JSON.stringify(key)}:${stableSerialize(item, seen)}`).join(",");
|
|
145
|
+
seen.delete(value);
|
|
146
|
+
return `{${serialized}}`;
|
|
147
|
+
}
|
|
148
|
+
return String(value);
|
|
149
|
+
}
|
|
150
|
+
__name(stableSerialize, "stableSerialize");
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
createRouteDataCacheKey,
|
|
154
|
+
createFarmCacheKey,
|
|
155
|
+
getFunctionCacheIdentity
|
|
156
|
+
};
|
|
@@ -26,13 +26,13 @@ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
|
|
|
26
26
|
var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkSUIBNSNOcjs = require('./chunk-SUIBNSNO.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
var _chunkIQXFRNY2cjs = require('./chunk-IQXFRNY2.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkVHJGDMCGcjs = require('./chunk-VHJGDMCG.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
@@ -805,7 +805,7 @@ async function createRouteTypeDeclarations(options, outPath) {
|
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
|
-
for (const route of await
|
|
808
|
+
for (const route of await _chunkSUIBNSNOcjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
|
|
809
809
|
patterns.add(route);
|
|
810
810
|
routeModulePatterns.add(route);
|
|
811
811
|
}
|
|
@@ -1201,7 +1201,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
1201
1201
|
const generator = new (0, _chunkXSIRSMAScjs.APITypeGenerator)(appDirs);
|
|
1202
1202
|
const apiRoutes = generator.scanAPIRoutes();
|
|
1203
1203
|
const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
|
|
1204
|
-
const pluginRoutes =
|
|
1204
|
+
const pluginRoutes = _chunkVHJGDMCGcjs.resolvePluginRoutes.call(void 0, options.plugins);
|
|
1205
1205
|
const configFiles = [
|
|
1206
1206
|
...(_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.configFile).filter((file) => Boolean(file)),
|
|
1207
1207
|
options.configPath ? _path.resolve.call(void 0, root, options.configPath) : [
|
|
@@ -7,7 +7,7 @@ var _chunkD7JTOLFKcjs = require('./chunk-D7JTOLFK.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkBJPBQNIEcjs = require('./chunk-BJPBQNIE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkLTNGXMQ6cjs = require('./chunk-LTNGXMQ6.cjs');
|
|
@@ -23,7 +23,7 @@ var _chunk5OVTOKGHcjs = require('./chunk-5OVTOKGH.cjs');
|
|
|
23
23
|
var _chunkSWN467MPcjs = require('./chunk-SWN467MP.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunk63H6BKXGcjs = require('./chunk-63H6BKXG.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
var _chunkOYEUREB6cjs = require('./chunk-OYEUREB6.cjs');
|
|
@@ -147,9 +147,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
147
147
|
};
|
|
148
148
|
});
|
|
149
149
|
const mutationTarget = targetRef.current;
|
|
150
|
-
const isAPITarget =
|
|
150
|
+
const isAPITarget = _chunkBJPBQNIEcjs.isAPIRouteRef.call(void 0, mutationTarget);
|
|
151
151
|
const sharedOptimistic = !preparationFailed && !isAPITarget ? _optionalChain([currentOptions, 'access', _3 => _3.request, 'optionalAccess', _4 => _4.optimistic]) : void 0;
|
|
152
|
-
const sharedSnapshots = _optionalChain([sharedOptimistic, 'optionalAccess', _5 => _5.update, 'optionalAccess', _6 => _6.length]) ?
|
|
152
|
+
const sharedSnapshots = _optionalChain([sharedOptimistic, 'optionalAccess', _5 => _5.update, 'optionalAccess', _6 => _6.length]) ? _chunkBJPBQNIEcjs.applyServerFnOptimisticUpdates.call(void 0, sharedOptimistic.update) : [];
|
|
153
153
|
try {
|
|
154
154
|
if (preparationFailed) throw preparationError;
|
|
155
155
|
let data;
|
|
@@ -176,9 +176,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
176
176
|
throw cause;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
_chunkBJPBQNIEcjs.settleServerFnOptimisticUpdates.call(void 0, sharedSnapshots, "commit");
|
|
180
180
|
if (!isAPITarget && _optionalChain([currentOptions, 'access', _9 => _9.request, 'optionalAccess', _10 => _10.invalidate])) {
|
|
181
|
-
for (const key of
|
|
181
|
+
for (const key of _chunkBJPBQNIEcjs.resolveServerFnInvalidateTargets.call(void 0, currentOptions.request.invalidate)) {
|
|
182
182
|
_chunkZEG3OPIBcjs.notifyFarmCacheInvalidation.call(void 0, key);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -213,7 +213,7 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
213
213
|
}
|
|
214
214
|
return data;
|
|
215
215
|
} catch (cause) {
|
|
216
|
-
|
|
216
|
+
_chunkBJPBQNIEcjs.settleServerFnOptimisticUpdates.call(void 0,
|
|
217
217
|
sharedSnapshots,
|
|
218
218
|
_optionalChain([sharedOptimistic, 'optionalAccess', _11 => _11.rollbackOnError]) ? "rollback" : "invalidate"
|
|
219
219
|
);
|
|
@@ -389,7 +389,7 @@ function useFetcher(target, options = {}) {
|
|
|
389
389
|
const Form = _react.useMemo.call(void 0, () => {
|
|
390
390
|
const FetcherForm = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, ({ action, method, encType, onSubmit, ...props }) => {
|
|
391
391
|
const targetValue = targetRef.current;
|
|
392
|
-
const metadata =
|
|
392
|
+
const metadata = _chunkBJPBQNIEcjs.getAPIRouteRefMetadata.call(void 0, targetValue);
|
|
393
393
|
const nativeAction = _nullishCoalesce(action, () => ( resolveFetcherFormAction(targetValue, metadata)));
|
|
394
394
|
const nativeMethod = _nullishCoalesce(method, () => ( (metadata && (metadata.method === "GET" || metadata.method === "POST") ? metadata.method.toLowerCase() : metadata ? "post" : void 0)));
|
|
395
395
|
const functionAction = typeof nativeAction === "function";
|
|
@@ -458,10 +458,10 @@ function mapFetcherFormData(target, formData, options) {
|
|
|
458
458
|
if (options.mapFormData) {
|
|
459
459
|
return options.mapFormData(formData, context);
|
|
460
460
|
}
|
|
461
|
-
if (!
|
|
461
|
+
if (!_chunkBJPBQNIEcjs.isAPIRouteRef.call(void 0, target)) {
|
|
462
462
|
return formData;
|
|
463
463
|
}
|
|
464
|
-
const method = _optionalChain([
|
|
464
|
+
const method = _optionalChain([_chunkBJPBQNIEcjs.getAPIRouteRefMetadata.call(void 0, target), 'optionalAccess', _14 => _14.method]);
|
|
465
465
|
const query = method === "GET" || method === "HEAD";
|
|
466
466
|
const encoding = _nullishCoalesce(_optionalChain([context, 'access', _15 => _15.submitter, 'optionalAccess', _16 => _16.getAttribute, 'call', _17 => _17("formenctype")]), () => ( _optionalChain([context, 'access', _18 => _18.form, 'optionalAccess', _19 => _19.enctype])));
|
|
467
467
|
if (!query && (_optionalChain([encoding, 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]) === "multipart/form-data" || Array.from(formData.values()).some((value) => typeof value !== "string"))) {
|
|
@@ -843,7 +843,7 @@ function initPersistedClientCache(adapter, options = {}) {
|
|
|
843
843
|
disposePersistedClientCache();
|
|
844
844
|
const engine = {
|
|
845
845
|
adapter,
|
|
846
|
-
cache:
|
|
846
|
+
cache: _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, ),
|
|
847
847
|
version: options.version ? `${FARM_CLIENT_CACHE_PERSIST_VERSION}:${options.version}` : FARM_CLIENT_CACHE_PERSIST_VERSION,
|
|
848
848
|
persistKey: options.persistKey,
|
|
849
849
|
flushDelayMs: _nullishCoalesce(options.flushDelayMs, () => ( 300)),
|
|
@@ -896,7 +896,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, disposePersistedClientCache, "disposePersi
|
|
|
896
896
|
async function clearPersistedCache() {
|
|
897
897
|
const engine = activeEngine;
|
|
898
898
|
if (!engine) {
|
|
899
|
-
|
|
899
|
+
_chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, ).clear();
|
|
900
900
|
return;
|
|
901
901
|
}
|
|
902
902
|
engine.clearing = true;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
isAPIRouteRef,
|
|
8
8
|
resolveServerFnInvalidateTargets,
|
|
9
9
|
settleServerFnOptimisticUpdates
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YDQZGSDS.mjs";
|
|
11
11
|
import {
|
|
12
12
|
notifyClientObserver
|
|
13
13
|
} from "./chunk-72AK62H5.mjs";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-5HGR3W6O.mjs";
|
|
24
24
|
import {
|
|
25
25
|
getFarmClientDataCache
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XNPDONUH.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getFarmTrailingSlashPreference
|
|
29
29
|
} from "./chunk-54UPOYFS.mjs";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
var _chunkT5CERMEHcjs = require('./chunk-T5CERMEH.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk2SDO73HKcjs = require('./chunk-2SDO73HK.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
@@ -139,7 +139,7 @@ function createServerFn(options) {
|
|
|
139
139
|
context: resolvedContext,
|
|
140
140
|
result: parsedResult
|
|
141
141
|
}) : options.invalidates;
|
|
142
|
-
await
|
|
142
|
+
await _chunk2SDO73HKcjs.applyFarmCacheInvalidationTargets.call(void 0, declaration);
|
|
143
143
|
}
|
|
144
144
|
return parsedResult;
|
|
145
145
|
}, "run");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTII23GJCcjs = require('./chunk-TII23GJC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -11,7 +11,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
11
11
|
var _url = require('url');
|
|
12
12
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
13
13
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
14
|
-
return
|
|
14
|
+
return _chunkTII23GJCcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
15
15
|
source,
|
|
16
16
|
filePath,
|
|
17
17
|
components: options.components,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSUIBNSNOcjs = require('./chunk-SUIBNSNO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
@@ -17,7 +17,7 @@ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkPZNCMPJFcjs = require('./chunk-PZNCMPJF.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
|
|
@@ -93,7 +93,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
93
93
|
await this.loadProgrammaticApiRoutes(appDir);
|
|
94
94
|
}
|
|
95
95
|
this.routes = new Map(
|
|
96
|
-
|
|
96
|
+
_chunkPZNCMPJFcjs.mergePluginAPIRoutes.call(void 0, [...this.routes.values()], this.plugins, void 0, {
|
|
97
97
|
bodySizeLimit: this.bodySizeLimit
|
|
98
98
|
}).map((route) => [route.path, route])
|
|
99
99
|
);
|
|
@@ -140,7 +140,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
140
140
|
const routeModule = await this.loadModule(filePath);
|
|
141
141
|
const endpoints = {};
|
|
142
142
|
const availableMethods = [];
|
|
143
|
-
for (const method of
|
|
143
|
+
for (const method of _chunkPZNCMPJFcjs.API_ROUTE_METHODS) {
|
|
144
144
|
if (routeModule[method]) {
|
|
145
145
|
endpoints[method] = routeModule[method];
|
|
146
146
|
availableMethods.push(method);
|
|
@@ -210,7 +210,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
210
210
|
async loadProgrammaticApiRoutes(appDir) {
|
|
211
211
|
const candidateRoots = [path.dirname(appDir), appDir];
|
|
212
212
|
const routeFiles = Array.from(
|
|
213
|
-
new Set(candidateRoots.flatMap((srcRoot) =>
|
|
213
|
+
new Set(candidateRoots.flatMap((srcRoot) => _chunkSUIBNSNOcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot)))
|
|
214
214
|
);
|
|
215
215
|
if (routeFiles.length === 0) return;
|
|
216
216
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
@@ -322,7 +322,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
322
322
|
const url = new URL(request.url);
|
|
323
323
|
const pathname = url.pathname;
|
|
324
324
|
const method = request.method.toUpperCase();
|
|
325
|
-
const match =
|
|
325
|
+
const match = _chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
326
326
|
if (!match) {
|
|
327
327
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
328
328
|
status: 404,
|
|
@@ -330,19 +330,19 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
const { route, params } = match;
|
|
333
|
-
const endpoint =
|
|
333
|
+
const endpoint = _chunkPZNCMPJFcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
334
334
|
if (!endpoint) {
|
|
335
335
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
336
336
|
status: 405,
|
|
337
337
|
headers: {
|
|
338
|
-
Allow:
|
|
338
|
+
Allow: _chunkPZNCMPJFcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
339
339
|
"Content-Type": "application/json"
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
const invoke = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
344
344
|
try {
|
|
345
|
-
return await
|
|
345
|
+
return await _chunkPZNCMPJFcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, this.bodySizeLimit);
|
|
346
346
|
} catch (error) {
|
|
347
347
|
if (options.throwOnError) throw error;
|
|
348
348
|
console.error(`[API Error] ${pathname}:`, error);
|
|
@@ -364,7 +364,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
364
364
|
return Boolean(this.matchRoute(pathname));
|
|
365
365
|
}
|
|
366
366
|
matchRoute(pathname) {
|
|
367
|
-
return
|
|
367
|
+
return _chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
370
|
* Get all routes for client type generation
|