@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
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
emitFarmEvent
|
|
3
|
+
} from "./chunk-FUZEBRP3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getActiveFarmI18nSnapshot
|
|
6
|
+
} from "./chunk-C4NCTZLM.mjs";
|
|
7
|
+
import {
|
|
8
|
+
createFarmCacheKey,
|
|
9
|
+
createRouteDataCacheKey,
|
|
10
|
+
getFunctionCacheIdentity
|
|
11
|
+
} from "./chunk-CNOQY6Z7.mjs";
|
|
1
12
|
import {
|
|
2
13
|
encodeFarmCacheInvalidations,
|
|
3
14
|
notifyFarmCacheInvalidation,
|
|
4
15
|
notifyFarmCacheTask,
|
|
5
16
|
subscribeFarmCacheInvalidation
|
|
6
17
|
} from "./chunk-4SIYUGRY.mjs";
|
|
7
|
-
import {
|
|
8
|
-
getActiveFarmI18nSnapshot
|
|
9
|
-
} from "./chunk-C4NCTZLM.mjs";
|
|
10
|
-
import {
|
|
11
|
-
emitFarmEvent
|
|
12
|
-
} from "./chunk-FUZEBRP3.mjs";
|
|
13
18
|
import {
|
|
14
19
|
__name
|
|
15
20
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -812,10 +817,6 @@ function createRouteDataCacheTag(key) {
|
|
|
812
817
|
return `route-data:${createRouteDataCacheKey(key)}`;
|
|
813
818
|
}
|
|
814
819
|
__name(createRouteDataCacheTag, "createRouteDataCacheTag");
|
|
815
|
-
function createRouteDataCacheKey(key) {
|
|
816
|
-
return createFarmCacheKey(Array.isArray(key) ? key : [key]);
|
|
817
|
-
}
|
|
818
|
-
__name(createRouteDataCacheKey, "createRouteDataCacheKey");
|
|
819
820
|
function normalizeRevalidatePath(routePath) {
|
|
820
821
|
if (typeof routePath !== "string") {
|
|
821
822
|
throw new TypeError("revalidatePath expects a path string.");
|
|
@@ -840,10 +841,6 @@ function normalizeRevalidatePath(routePath) {
|
|
|
840
841
|
return normalized || "/";
|
|
841
842
|
}
|
|
842
843
|
__name(normalizeRevalidatePath, "normalizeRevalidatePath");
|
|
843
|
-
function createFarmCacheKey(parts) {
|
|
844
|
-
return stableSerialize(parts);
|
|
845
|
-
}
|
|
846
|
-
__name(createFarmCacheKey, "createFarmCacheKey");
|
|
847
844
|
function normalizeRevalidate(revalidate) {
|
|
848
845
|
if (revalidate === false || revalidate === void 0) {
|
|
849
846
|
return revalidate;
|
|
@@ -934,143 +931,6 @@ function assertFarmCacheInvalidationTarget(target) {
|
|
|
934
931
|
throw new TypeError("Cache invalidation targets must contain a string/array key, path, or tag.");
|
|
935
932
|
}
|
|
936
933
|
__name(assertFarmCacheInvalidationTarget, "assertFarmCacheInvalidationTarget");
|
|
937
|
-
function getFunctionCacheIdentity(fn) {
|
|
938
|
-
const name = fn.name || "anonymous";
|
|
939
|
-
return `${name}:${hashFunctionSource(String(fn))}`;
|
|
940
|
-
}
|
|
941
|
-
__name(getFunctionCacheIdentity, "getFunctionCacheIdentity");
|
|
942
|
-
function hashFunctionSource(source) {
|
|
943
|
-
let hash = 2166136261;
|
|
944
|
-
for (let index = 0; index < source.length; index++) {
|
|
945
|
-
hash ^= source.charCodeAt(index);
|
|
946
|
-
hash = Math.imul(hash, 16777619);
|
|
947
|
-
}
|
|
948
|
-
return (hash >>> 0).toString(36);
|
|
949
|
-
}
|
|
950
|
-
__name(hashFunctionSource, "hashFunctionSource");
|
|
951
|
-
function compareCodepoint(a, b) {
|
|
952
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
953
|
-
}
|
|
954
|
-
__name(compareCodepoint, "compareCodepoint");
|
|
955
|
-
function serializeBinaryBytes(bytes) {
|
|
956
|
-
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
957
|
-
}
|
|
958
|
-
__name(serializeBinaryBytes, "serializeBinaryBytes");
|
|
959
|
-
function serializeCanonicalStringEntries(entries, seen) {
|
|
960
|
-
const valuesByKey = /* @__PURE__ */ new Map();
|
|
961
|
-
for (const [key, item] of entries) {
|
|
962
|
-
const values = valuesByKey.get(key);
|
|
963
|
-
if (values) values.push(item);
|
|
964
|
-
else valuesByKey.set(key, [item]);
|
|
965
|
-
}
|
|
966
|
-
return Array.from(valuesByKey.keys()).sort(compareCodepoint).flatMap(
|
|
967
|
-
(key) => valuesByKey.get(key).map((item) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`)
|
|
968
|
-
).join(",");
|
|
969
|
-
}
|
|
970
|
-
__name(serializeCanonicalStringEntries, "serializeCanonicalStringEntries");
|
|
971
|
-
function isPlainCacheKeyObject(value) {
|
|
972
|
-
const prototype = Object.getPrototypeOf(value);
|
|
973
|
-
if (prototype === null) return true;
|
|
974
|
-
const constructor = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
|
|
975
|
-
return Object.getPrototypeOf(prototype) === null && typeof constructor === "function" && constructor.name === "Object";
|
|
976
|
-
}
|
|
977
|
-
__name(isPlainCacheKeyObject, "isPlainCacheKeyObject");
|
|
978
|
-
function getCacheKeyValueType(value) {
|
|
979
|
-
const prototype = Object.getPrototypeOf(value);
|
|
980
|
-
const constructor = prototype ? Object.getOwnPropertyDescriptor(prototype, "constructor")?.value : void 0;
|
|
981
|
-
if (typeof constructor === "function" && constructor.name) {
|
|
982
|
-
return constructor.name;
|
|
983
|
-
}
|
|
984
|
-
return Object.prototype.toString.call(value).slice(8, -1) || "object";
|
|
985
|
-
}
|
|
986
|
-
__name(getCacheKeyValueType, "getCacheKeyValueType");
|
|
987
|
-
function stableSerialize(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
988
|
-
if (value === null) return "null";
|
|
989
|
-
if (value === void 0) return "undefined";
|
|
990
|
-
const valueType = typeof value;
|
|
991
|
-
if (valueType === "string") return JSON.stringify(value);
|
|
992
|
-
if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
|
|
993
|
-
return `${valueType}:${String(value)}`;
|
|
994
|
-
}
|
|
995
|
-
if (valueType === "symbol") {
|
|
996
|
-
return `symbol:${String(value)}`;
|
|
997
|
-
}
|
|
998
|
-
if (valueType === "function") {
|
|
999
|
-
return `function:${getFunctionCacheIdentity(value)}`;
|
|
1000
|
-
}
|
|
1001
|
-
if (value instanceof Date) {
|
|
1002
|
-
return Number.isNaN(value.getTime()) ? "date:invalid" : `date:${value.toISOString()}`;
|
|
1003
|
-
}
|
|
1004
|
-
if (value instanceof URL) {
|
|
1005
|
-
return `url:${value.toString()}`;
|
|
1006
|
-
}
|
|
1007
|
-
if (value instanceof RegExp) {
|
|
1008
|
-
return `regexp:${value.toString()}`;
|
|
1009
|
-
}
|
|
1010
|
-
if (value instanceof ArrayBuffer) {
|
|
1011
|
-
return `arraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
|
|
1012
|
-
}
|
|
1013
|
-
if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer) {
|
|
1014
|
-
return `sharedarraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
|
|
1015
|
-
}
|
|
1016
|
-
if (ArrayBuffer.isView(value)) {
|
|
1017
|
-
const viewType = Object.prototype.toString.call(value).slice(8, -1);
|
|
1018
|
-
const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
1019
|
-
return `binary:${viewType}:${serializeBinaryBytes(bytes)}`;
|
|
1020
|
-
}
|
|
1021
|
-
if (value && typeof value === "object") {
|
|
1022
|
-
if (seen.has(value)) {
|
|
1023
|
-
return "[Circular]";
|
|
1024
|
-
}
|
|
1025
|
-
seen.add(value);
|
|
1026
|
-
if (Array.isArray(value)) {
|
|
1027
|
-
const items = [];
|
|
1028
|
-
for (let index = 0; index < value.length; index++) {
|
|
1029
|
-
items.push(
|
|
1030
|
-
Object.prototype.hasOwnProperty.call(value, index) ? stableSerialize(value[index], seen) : "[Hole]"
|
|
1031
|
-
);
|
|
1032
|
-
}
|
|
1033
|
-
seen.delete(value);
|
|
1034
|
-
return `[${items.join(",")}]`;
|
|
1035
|
-
}
|
|
1036
|
-
if (value instanceof Set) {
|
|
1037
|
-
const items = Array.from(value, (item) => stableSerialize(item, seen)).sort(compareCodepoint);
|
|
1038
|
-
seen.delete(value);
|
|
1039
|
-
return `set:[${items.join(",")}]`;
|
|
1040
|
-
}
|
|
1041
|
-
if (value instanceof Map) {
|
|
1042
|
-
const items = Array.from(
|
|
1043
|
-
value,
|
|
1044
|
-
([key, item]) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`
|
|
1045
|
-
).sort(compareCodepoint);
|
|
1046
|
-
seen.delete(value);
|
|
1047
|
-
return `map:[${items.join(",")}]`;
|
|
1048
|
-
}
|
|
1049
|
-
if (value instanceof URLSearchParams) {
|
|
1050
|
-
const serialized2 = serializeCanonicalStringEntries(value, seen);
|
|
1051
|
-
seen.delete(value);
|
|
1052
|
-
return `urlsearchparams:[${serialized2}]`;
|
|
1053
|
-
}
|
|
1054
|
-
if (value instanceof Headers) {
|
|
1055
|
-
const serialized2 = serializeCanonicalStringEntries(value, seen);
|
|
1056
|
-
seen.delete(value);
|
|
1057
|
-
return `headers:[${serialized2}]`;
|
|
1058
|
-
}
|
|
1059
|
-
if (!isPlainCacheKeyObject(value)) {
|
|
1060
|
-
throw new TypeError(
|
|
1061
|
-
`Cache keys do not support ${getCacheKeyValueType(value)} values. Convert the value to an explicit stable string or structured key before caching.`
|
|
1062
|
-
);
|
|
1063
|
-
}
|
|
1064
|
-
const entries = Object.entries(value).sort(
|
|
1065
|
-
([a], [b]) => compareCodepoint(a, b)
|
|
1066
|
-
);
|
|
1067
|
-
const serialized = entries.map(([key, item]) => `${JSON.stringify(key)}:${stableSerialize(item, seen)}`).join(",");
|
|
1068
|
-
seen.delete(value);
|
|
1069
|
-
return `{${serialized}}`;
|
|
1070
|
-
}
|
|
1071
|
-
return String(value);
|
|
1072
|
-
}
|
|
1073
|
-
__name(stableSerialize, "stableSerialize");
|
|
1074
934
|
|
|
1075
935
|
export {
|
|
1076
936
|
createFarmCacheInvalidationStream,
|
|
@@ -1088,7 +948,5 @@ export {
|
|
|
1088
948
|
applyFarmCacheInvalidationTargets,
|
|
1089
949
|
createPathCacheTag,
|
|
1090
950
|
createRouteDataCacheTag,
|
|
1091
|
-
|
|
1092
|
-
normalizeRevalidatePath,
|
|
1093
|
-
createFarmCacheKey
|
|
951
|
+
normalizeRevalidatePath
|
|
1094
952
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSORB3MARcjs = require('./chunk-SORB3MAR.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkWNLBF77Xcjs = require('./chunk-WNLBF77X.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
@@ -13,7 +13,7 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
13
13
|
|
|
14
14
|
// src/navigation.ts
|
|
15
15
|
function useRouter2() {
|
|
16
|
-
const router =
|
|
16
|
+
const router = _chunkSORB3MARcjs.useRouter.call(void 0, );
|
|
17
17
|
return {
|
|
18
18
|
push: router.push,
|
|
19
19
|
replace: router.replace,
|
|
@@ -21,21 +21,21 @@ function useRouter2() {
|
|
|
21
21
|
forward: router.forward,
|
|
22
22
|
refresh() {
|
|
23
23
|
if (typeof window === "undefined") return Promise.resolve();
|
|
24
|
-
return
|
|
24
|
+
return _chunkWNLBF77Xcjs.getRouter.call(void 0, ).refresh();
|
|
25
25
|
},
|
|
26
26
|
prefetch(href) {
|
|
27
27
|
if (typeof window === "undefined") return Promise.resolve();
|
|
28
|
-
return
|
|
28
|
+
return _chunkWNLBF77Xcjs.getRouter.call(void 0, ).prefetch(_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter2, "useRouter");
|
|
33
33
|
function usePathname() {
|
|
34
|
-
return
|
|
34
|
+
return _chunkSORB3MARcjs.useRouter.call(void 0, ).pathname;
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePathname, "usePathname");
|
|
37
37
|
function useSearchParams() {
|
|
38
|
-
return
|
|
38
|
+
return _chunkSORB3MARcjs.useRouter.call(void 0, ).searchParams;
|
|
39
39
|
}
|
|
40
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useSearchParams, "useSearchParams");
|
|
41
41
|
|
|
@@ -6,10 +6,10 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
|
6
6
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkEXLKRR4Ucjs = require('./chunk-EXLKRR4U.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkSUIBNSNOcjs = require('./chunk-SUIBNSNO.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
@@ -19,7 +19,7 @@ var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkPZNCMPJFcjs = require('./chunk-PZNCMPJF.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
|
|
@@ -105,7 +105,7 @@ function farmApiPlugin(options = {}) {
|
|
|
105
105
|
const existing = apiRoutesCache.get(routePath);
|
|
106
106
|
const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
|
|
107
107
|
if (existingFile) {
|
|
108
|
-
throw new (0,
|
|
108
|
+
throw new (0, _chunkEXLKRR4Ucjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
109
109
|
}
|
|
110
110
|
if (existing) {
|
|
111
111
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -189,7 +189,7 @@ function farmApiPlugin(options = {}) {
|
|
|
189
189
|
const url = new URL(request.url);
|
|
190
190
|
const method = request.method.toUpperCase();
|
|
191
191
|
const pathname = url.pathname;
|
|
192
|
-
const match =
|
|
192
|
+
const match = _chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath);
|
|
193
193
|
if (!match) {
|
|
194
194
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
195
195
|
status: 404,
|
|
@@ -197,18 +197,18 @@ function farmApiPlugin(options = {}) {
|
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
const { route, params } = match;
|
|
200
|
-
const endpoint =
|
|
200
|
+
const endpoint = _chunkPZNCMPJFcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
201
201
|
if (!endpoint) {
|
|
202
202
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
203
203
|
status: 405,
|
|
204
204
|
headers: {
|
|
205
|
-
Allow:
|
|
205
|
+
Allow: _chunkPZNCMPJFcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
206
206
|
"Content-Type": "application/json"
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
try {
|
|
211
|
-
return await
|
|
211
|
+
return await _chunkPZNCMPJFcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
|
|
212
212
|
} catch (error) {
|
|
213
213
|
return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
|
|
214
214
|
status: 500,
|
|
@@ -255,7 +255,7 @@ function farmApiPlugin(options = {}) {
|
|
|
255
255
|
const routeModule = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
256
256
|
const endpoints = {};
|
|
257
257
|
const availableMethods = [];
|
|
258
|
-
for (const method of
|
|
258
|
+
for (const method of _chunkPZNCMPJFcjs.API_ROUTE_METHODS) {
|
|
259
259
|
if (routeModule[method]) {
|
|
260
260
|
availableMethods.push(method);
|
|
261
261
|
endpoints[method] = routeModule[method];
|
|
@@ -268,7 +268,7 @@ function farmApiPlugin(options = {}) {
|
|
|
268
268
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
269
269
|
}
|
|
270
270
|
} catch (e) {
|
|
271
|
-
if (e instanceof
|
|
271
|
+
if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
272
272
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
@@ -295,7 +295,7 @@ function farmApiPlugin(options = {}) {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
} catch (e) {
|
|
298
|
-
if (e instanceof
|
|
298
|
+
if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
299
299
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
300
300
|
}
|
|
301
301
|
break;
|
|
@@ -305,7 +305,7 @@ function farmApiPlugin(options = {}) {
|
|
|
305
305
|
const discoverProgrammaticRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
306
306
|
const path = await import("path");
|
|
307
307
|
const srcRoot = path.join(server.config.root, srcDir);
|
|
308
|
-
const routeFiles =
|
|
308
|
+
const routeFiles = _chunkSUIBNSNOcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
|
|
309
309
|
if (routeFiles.length === 0) return;
|
|
310
310
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
311
311
|
for (const routeFile of routeFiles) {
|
|
@@ -326,7 +326,7 @@ function farmApiPlugin(options = {}) {
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
} catch (e) {
|
|
329
|
-
if (e instanceof
|
|
329
|
+
if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
330
330
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
@@ -378,7 +378,7 @@ function farmApiPlugin(options = {}) {
|
|
|
378
378
|
const pathname = url.split("?")[0];
|
|
379
379
|
const method = req.method || "GET";
|
|
380
380
|
if (discoveryPromise) await waitForDiscovery();
|
|
381
|
-
if (!
|
|
381
|
+
if (!_chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath)) {
|
|
382
382
|
return next();
|
|
383
383
|
}
|
|
384
384
|
if (!apiRouterHandler) {
|
|
@@ -399,7 +399,7 @@ function farmApiPlugin(options = {}) {
|
|
|
399
399
|
}
|
|
400
400
|
const currentUrl = req.url || url;
|
|
401
401
|
const currentPathname = currentUrl.split("?")[0];
|
|
402
|
-
if (currentPathname !== pathname && !
|
|
402
|
+
if (currentPathname !== pathname && !_chunkPZNCMPJFcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, currentPathname, basePath)) {
|
|
403
403
|
return next();
|
|
404
404
|
}
|
|
405
405
|
const fullUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req);
|
|
@@ -503,7 +503,7 @@ function farmApiPlugin(options = {}) {
|
|
|
503
503
|
log(`API router recreated`);
|
|
504
504
|
} catch (e) {
|
|
505
505
|
restoreRouteState(previousState);
|
|
506
|
-
if (e instanceof
|
|
506
|
+
if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
507
507
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
508
508
|
}
|
|
509
509
|
return [];
|
|
@@ -531,7 +531,7 @@ function farmApiPlugin(options = {}) {
|
|
|
531
531
|
const routeModule = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
532
532
|
removeEndpointsFromFile(file);
|
|
533
533
|
const availableMethods = [];
|
|
534
|
-
for (const method of
|
|
534
|
+
for (const method of _chunkPZNCMPJFcjs.API_ROUTE_METHODS) {
|
|
535
535
|
if (!routeModule[method]) continue;
|
|
536
536
|
availableMethods.push(method);
|
|
537
537
|
addEndpoint(routePath, file, method, routeModule[method]);
|
|
@@ -541,7 +541,7 @@ function farmApiPlugin(options = {}) {
|
|
|
541
541
|
log(`API router recreated`);
|
|
542
542
|
} catch (e) {
|
|
543
543
|
restoreRouteState(previousState);
|
|
544
|
-
if (e instanceof
|
|
544
|
+
if (e instanceof _chunkEXLKRR4Ucjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
545
545
|
log(`API route HMR failed: ${e.message}`);
|
|
546
546
|
}
|
|
547
547
|
return [];
|
|
@@ -282,8 +282,14 @@ function ifNoneMatchIncludes(header, etag) {
|
|
|
282
282
|
__name(ifNoneMatchIncludes, "ifNoneMatchIncludes");
|
|
283
283
|
function createFarmMarkdownViewResponse(options) {
|
|
284
284
|
const url = options.requestUrl ?? new URL(options.request.url);
|
|
285
|
-
const view = url.searchParams.has("actions") ? selectFarmPageActionsView(options.markdownPath, options.actions ?? [], options.headers) : selectFarmMarkdownView(options.markdown, url.searchParams, options.markdownPath);
|
|
286
|
-
|
|
285
|
+
const view = options.status >= 400 ? { status: options.status, body: options.markdown } : url.searchParams.has("actions") ? selectFarmPageActionsView(options.markdownPath, options.actions ?? [], options.headers) : selectFarmMarkdownView(options.markdown, url.searchParams, options.markdownPath);
|
|
286
|
+
let status = view.status === 200 ? options.status : view.status;
|
|
287
|
+
const ifMatch = options.request.headers.get("if-match");
|
|
288
|
+
const preconditionFailed = status >= 200 && status < 300 && ifMatch !== null && ifMatch.trim() !== "*";
|
|
289
|
+
if (preconditionFailed) {
|
|
290
|
+
status = 412;
|
|
291
|
+
options.headers.set("Cache-Control", "no-store");
|
|
292
|
+
}
|
|
287
293
|
emitFarmAgentRead(options.request, "markdown", status, readMarkdownViewName(url.searchParams));
|
|
288
294
|
for (const [name, value] of Object.entries(view.headers ?? {}))
|
|
289
295
|
options.headers.append(name, value);
|
|
@@ -292,7 +298,7 @@ function createFarmMarkdownViewResponse(options) {
|
|
|
292
298
|
if (status === 200 && ifNoneMatchIncludes(options.request.headers.get("if-none-match"), etag)) {
|
|
293
299
|
return new Response(null, { status: 304, headers: options.headers });
|
|
294
300
|
}
|
|
295
|
-
return new Response(options.request.method === "HEAD" ? null : view.body, {
|
|
301
|
+
return new Response(preconditionFailed || options.request.method === "HEAD" ? null : view.body, {
|
|
296
302
|
status,
|
|
297
303
|
headers: options.headers
|
|
298
304
|
});
|
|
@@ -380,24 +386,44 @@ async function createMarkdownMirrorResponse(options) {
|
|
|
380
386
|
for (const name of FARM_MARKDOWN_VIEW_PARAMS) pageUrl.searchParams.delete(name);
|
|
381
387
|
const headers = new Headers(options.request.headers);
|
|
382
388
|
headers.set("accept", "text/html");
|
|
389
|
+
headers.delete("if-match");
|
|
390
|
+
headers.delete("if-unmodified-since");
|
|
391
|
+
headers.delete("if-none-match");
|
|
392
|
+
headers.delete("if-modified-since");
|
|
393
|
+
headers.delete("range");
|
|
394
|
+
headers.delete("if-range");
|
|
383
395
|
const pageResponse = await options.renderPage(
|
|
384
396
|
new Request(pageUrl, {
|
|
385
397
|
method: "GET",
|
|
386
|
-
headers
|
|
398
|
+
headers,
|
|
399
|
+
signal: options.request.signal
|
|
387
400
|
})
|
|
388
401
|
);
|
|
402
|
+
if (pageResponse.status === 204 || pageResponse.status === 205 || pageResponse.status === 304) {
|
|
403
|
+
return pageResponse;
|
|
404
|
+
}
|
|
389
405
|
const redirects = pageResponse.status >= 300 && pageResponse.status < 400 && pageResponse.headers.has("location");
|
|
390
406
|
if (redirects || !isHtmlResponse(pageResponse)) {
|
|
391
|
-
|
|
407
|
+
const accessResponse = createMarkdownAccessResponse(
|
|
392
408
|
pageResponse,
|
|
393
409
|
target.pathname,
|
|
394
410
|
pageUrl,
|
|
395
411
|
options.request.method === "HEAD"
|
|
396
412
|
);
|
|
413
|
+
if (accessResponse || options.request.method === "HEAD") {
|
|
414
|
+
void pageResponse.body?.cancel().catch(() => {
|
|
415
|
+
});
|
|
416
|
+
return accessResponse ?? new Response(null, {
|
|
417
|
+
status: pageResponse.status,
|
|
418
|
+
statusText: pageResponse.statusText,
|
|
419
|
+
headers: pageResponse.headers
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
return pageResponse;
|
|
397
423
|
}
|
|
398
424
|
const html = await pageResponse.text();
|
|
399
425
|
const markdownPath = target.pathname === "/" ? "/index.md" : `${target.pathname}.md`;
|
|
400
|
-
const actions = extractFarmPageActions(html, pageUrl);
|
|
426
|
+
const actions = pageResponse.status >= 400 ? [] : extractFarmPageActions(html, pageUrl);
|
|
401
427
|
for (const form of actions) {
|
|
402
428
|
if (!form.action?.startsWith("/")) continue;
|
|
403
429
|
const pathname = new URL(form.action, pageUrl.origin).pathname;
|
|
@@ -428,6 +454,10 @@ async function createMarkdownMirrorResponse(options) {
|
|
|
428
454
|
"Cache-Control",
|
|
429
455
|
pageCacheControl && isPrivateCacheControl(pageCacheControl) ? pageCacheControl : createMarkdownCacheHeader(cache)
|
|
430
456
|
);
|
|
457
|
+
preserveMarkdownResponseCookies(pageResponse.headers, headersOut);
|
|
458
|
+
if (pageResponse.status >= 400) {
|
|
459
|
+
preserveMarkdownResponseControlHeaders(pageResponse.headers, headersOut);
|
|
460
|
+
}
|
|
431
461
|
const robots = [pageResponse.headers.get("x-robots-tag"), readHtmlMetaContent(html, "robots")].filter((value) => Boolean(value?.trim())).join(", ");
|
|
432
462
|
if (robots) headersOut.set("X-Robots-Tag", robots);
|
|
433
463
|
const canonical = readHtmlCanonicalHref(html);
|
|
@@ -457,6 +487,8 @@ function createMarkdownAccessResponse(pageResponse, pathname, pageUrl, head) {
|
|
|
457
487
|
"Cache-Control": "no-store",
|
|
458
488
|
"X-Farm-Markdown-Route": pathname
|
|
459
489
|
});
|
|
490
|
+
preserveMarkdownResponseCookies(pageResponse.headers, headers);
|
|
491
|
+
preserveMarkdownResponseControlHeaders(pageResponse.headers, headers);
|
|
460
492
|
let body;
|
|
461
493
|
if (redirect) {
|
|
462
494
|
let target;
|
|
@@ -471,8 +503,6 @@ function createMarkdownAccessResponse(pageResponse, pathname, pageUrl, head) {
|
|
|
471
503
|
\`${pathname}\` redirects to [${target}](${target}). The page may require signing in.
|
|
472
504
|
`;
|
|
473
505
|
} else {
|
|
474
|
-
const authenticate = pageResponse.headers.get("www-authenticate");
|
|
475
|
-
if (authenticate) headers.set("WWW-Authenticate", authenticate);
|
|
476
506
|
body = pageResponse.status === 401 ? `# Sign-in required
|
|
477
507
|
|
|
478
508
|
\`${pathname}\` requires signing in.
|
|
@@ -484,6 +514,21 @@ This account cannot read \`${pathname}\`.
|
|
|
484
514
|
return new Response(head ? null : body, { status: pageResponse.status, headers });
|
|
485
515
|
}
|
|
486
516
|
__name(createMarkdownAccessResponse, "createMarkdownAccessResponse");
|
|
517
|
+
function preserveMarkdownResponseControlHeaders(source, target) {
|
|
518
|
+
for (const name of ["WWW-Authenticate", "Proxy-Authenticate", "Retry-After", "Allow"]) {
|
|
519
|
+
const value = source.get(name);
|
|
520
|
+
if (value !== null) target.set(name, value);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
__name(preserveMarkdownResponseControlHeaders, "preserveMarkdownResponseControlHeaders");
|
|
524
|
+
function preserveMarkdownResponseCookies(source, target) {
|
|
525
|
+
const getSetCookie = source.getSetCookie;
|
|
526
|
+
const cookies = typeof getSetCookie === "function" ? getSetCookie.call(source) : source.has("set-cookie") ? [source.get("set-cookie")] : [];
|
|
527
|
+
if (cookies.length === 0) return;
|
|
528
|
+
for (const cookie of cookies) target.append("Set-Cookie", cookie);
|
|
529
|
+
target.set("Cache-Control", "private, no-store");
|
|
530
|
+
}
|
|
531
|
+
__name(preserveMarkdownResponseCookies, "preserveMarkdownResponseCookies");
|
|
487
532
|
function applyMarkdownNegotiationHeaders(response, options) {
|
|
488
533
|
if (!isHtmlResponse(response)) {
|
|
489
534
|
return response;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk63H6BKXGcjs = require('./chunk-63H6BKXG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkSK35NQKKcjs = require('./chunk-SK35NQKK.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -40,7 +40,7 @@ var serverQueryClientState = _nullishCoalesce(serverQueryClientGlobal[FARM_SERVE
|
|
|
40
40
|
_nullishCoalesce(serverQueryClientState.latestOwners, () => ( (serverQueryClientState.latestOwners = /* @__PURE__ */ new Map())));
|
|
41
41
|
_nullishCoalesce(serverQueryClientState.owners, () => ( (serverQueryClientState.owners = /* @__PURE__ */ new Set())));
|
|
42
42
|
function isServerQueryOwnerSuperseded(owner, key) {
|
|
43
|
-
const cache =
|
|
43
|
+
const cache = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, );
|
|
44
44
|
const resolved = cache.resolveKey(key);
|
|
45
45
|
for (const superseded of _nullishCoalesce(owner.supersededKeys, () => ( []))) {
|
|
46
46
|
if (cache.resolveKey(superseded) === resolved) return true;
|
|
@@ -50,7 +50,7 @@ function isServerQueryOwnerSuperseded(owner, key) {
|
|
|
50
50
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isServerQueryOwnerSuperseded, "isServerQueryOwnerSuperseded");
|
|
51
51
|
function claimServerQueryKey(owner, key) {
|
|
52
52
|
if (isServerQueryOwnerSuperseded(owner, key)) return false;
|
|
53
|
-
const resolved =
|
|
53
|
+
const resolved = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, ).resolveKey(key);
|
|
54
54
|
for (const older of serverQueryClientState.owners) {
|
|
55
55
|
if (older === owner) break;
|
|
56
56
|
older.supersededKeys.add(resolved);
|
|
@@ -83,7 +83,7 @@ function beginFarmServerQueryAction(actionId, args) {
|
|
|
83
83
|
_chunkS3JO3N4Hcjs.__name.call(void 0, beginFarmServerQueryAction, "beginFarmServerQueryAction");
|
|
84
84
|
function completeFarmServerQueryAction(invocation, value) {
|
|
85
85
|
if (!_chunkSK35NQKKcjs.isFarmServerQueryResult.call(void 0, value)) return value;
|
|
86
|
-
const cache =
|
|
86
|
+
const cache = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, );
|
|
87
87
|
const metadata = value.__farmServerQuery;
|
|
88
88
|
if (!shouldApplyFarmServerQueryActionResult(invocation)) {
|
|
89
89
|
return value.data;
|
|
@@ -125,11 +125,11 @@ function createServerQueryCallKey(query, input) {
|
|
|
125
125
|
id = ++serverQueryClientState.nextFunctionId;
|
|
126
126
|
serverQueryClientState.functionIds.set(query, id);
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["server-query-call", id, input]);
|
|
129
129
|
}
|
|
130
130
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createServerQueryCallKey, "createServerQueryCallKey");
|
|
131
131
|
async function fetchServerQuery(query, input, options = {}) {
|
|
132
|
-
const cache =
|
|
132
|
+
const cache = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, );
|
|
133
133
|
const provisionalKey = createServerQueryCallKey(query, input);
|
|
134
134
|
const entry = cache.get(provisionalKey);
|
|
135
135
|
const stale = cache.isStale(provisionalKey);
|
|
@@ -151,11 +151,11 @@ function prefetchServerQuery(query, input, options = {}) {
|
|
|
151
151
|
_chunkS3JO3N4Hcjs.__name.call(void 0, prefetchServerQuery, "prefetchServerQuery");
|
|
152
152
|
async function executeServerQuery(query, input, provisionalKey, options) {
|
|
153
153
|
assertNotRawServerQueryInBrowser(query);
|
|
154
|
-
const cache =
|
|
154
|
+
const cache = _chunk63H6BKXGcjs.getFarmClientDataCache.call(void 0, );
|
|
155
155
|
const inflight = cache.getInflight(provisionalKey);
|
|
156
156
|
if (inflight && !options.force) return inflight;
|
|
157
157
|
const owner = {
|
|
158
|
-
invalidations:
|
|
158
|
+
invalidations: _chunk63H6BKXGcjs.trackFarmClientCacheInvalidations.call(void 0, cache),
|
|
159
159
|
supersededKeys: /* @__PURE__ */ new Set()
|
|
160
160
|
};
|
|
161
161
|
serverQueryClientState.latestOwners.set(provisionalKey, owner);
|