@farm.js/core 0.1.36 → 0.1.37
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-mcp-BVExL8rZ.d.mts → agent-mcp-BC0bAGVF.d.mts} +1 -1
- package/dist/{agent-mcp-luzfXK-P.d.ts → agent-mcp-jyDHbQKe.d.ts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +6 -6
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +8 -7
- package/dist/{app-Yfa2dsFy.d.ts → app-CKO3iN1c.d.ts} +3 -3
- package/dist/{app-BukwkFIu.d.mts → app-Cbkj9ufe.d.mts} +3 -3
- package/dist/app-markdown.cjs +5 -3
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +4 -2
- package/dist/{chunk-UVW64BCB.cjs → chunk-3A4KGQYI.cjs} +2 -2
- package/dist/{chunk-AO6RYU5N.cjs → chunk-3IP27TCG.cjs} +30 -22
- package/dist/{chunk-FDR64H6B.mjs → chunk-3KGDJLJK.mjs} +41 -2
- package/dist/{chunk-KXWRO25S.cjs → chunk-4GPOC4LN.cjs} +3 -3
- package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
- package/dist/{chunk-276VJSM6.mjs → chunk-4P6ULFMD.mjs} +43 -30
- package/dist/{chunk-BPMATOP2.cjs → chunk-5BXGGEC7.cjs} +25 -20
- package/dist/{chunk-JNUWCDTF.cjs → chunk-5D2JIPLH.cjs} +2 -2
- package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
- package/dist/{chunk-BO36SELV.cjs → chunk-6LGFV2CQ.cjs} +2 -2
- package/dist/{chunk-2YTDKNH3.cjs → chunk-6TJITR2B.cjs} +192 -120
- package/dist/{chunk-JZVADIOD.cjs → chunk-75X755YZ.cjs} +2 -2
- package/dist/{chunk-VQLJWDVW.cjs → chunk-7DWNJI73.cjs} +2 -2
- package/dist/{chunk-N2NAS2AM.cjs → chunk-7O5M4UKW.cjs} +2 -2
- package/dist/{chunk-BJPBQNIE.cjs → chunk-7SQ5SGYZ.cjs} +2 -2
- package/dist/{chunk-27ZWSI3W.cjs → chunk-ADOAUDQ6.cjs} +2 -2
- package/dist/{chunk-YKX5BK66.cjs → chunk-ATWHHSY2.cjs} +7 -7
- package/dist/{chunk-42NHY7HW.cjs → chunk-B5PFZLKV.cjs} +40 -9
- package/dist/{chunk-FNO7A7CM.cjs → chunk-BHY547NB.cjs} +34 -16
- package/dist/{chunk-4GLOOWKE.mjs → chunk-CQMVIOYP.mjs} +1 -1
- package/dist/{chunk-D2BB47NB.cjs → chunk-CVH2BXPY.cjs} +6 -6
- package/dist/{chunk-TKSCR644.cjs → chunk-D3C5LBQY.cjs} +2 -2
- package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
- package/dist/{chunk-GQ3Z3IZI.cjs → chunk-EMMQ64QW.cjs} +18 -18
- package/dist/{chunk-OHLSEQ57.mjs → chunk-EXG5LD6B.mjs} +1 -1
- package/dist/{chunk-WZ77PUAM.mjs → chunk-FBOJ55OM.mjs} +1 -1
- package/dist/{chunk-OTC5BDGO.mjs → chunk-FGRYBX5X.mjs} +12 -7
- package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
- package/dist/{chunk-3BU22U3M.cjs → chunk-G2TEB74S.cjs} +5 -2
- package/dist/{chunk-O6I6VWKK.mjs → chunk-HEVMCTSR.mjs} +1 -1
- package/dist/{chunk-W7LF2J2S.mjs → chunk-HMRSWN47.mjs} +1 -1
- package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
- package/dist/{chunk-35GKZR22.mjs → chunk-IAIYV4RZ.mjs} +1 -1
- package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
- package/dist/{chunk-2NNMOPDN.mjs → chunk-J3ANCZKA.mjs} +4 -1
- package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
- package/dist/{chunk-SC2WYWPF.mjs → chunk-JPNFPAZ4.mjs} +3 -3
- package/dist/{chunk-HOXTWRGB.mjs → chunk-K3SAEIM3.mjs} +5 -2
- package/dist/{chunk-35WV46VL.mjs → chunk-K4I4O5TS.mjs} +98 -26
- package/dist/{chunk-KN7K4VQN.mjs → chunk-KDTBF3UU.mjs} +1 -1
- package/dist/{chunk-QORUJDIV.mjs → chunk-KPFKMDM7.mjs} +2 -2
- package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
- package/dist/{chunk-YDQZGSDS.mjs → chunk-LBDP3YT3.mjs} +1 -1
- package/dist/{chunk-LSZAVSGY.mjs → chunk-LBGILORX.mjs} +1 -1
- package/dist/{chunk-ADEA7PN3.cjs → chunk-LOFKRKO7.cjs} +2 -2
- package/dist/{chunk-ZWM5KGAA.cjs → chunk-LPFV45AY.cjs} +23 -20
- package/dist/{chunk-3KZS4SUS.mjs → chunk-MCIZVNOQ.mjs} +1 -1
- package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
- package/dist/{chunk-S6VYG6XU.cjs → chunk-NDILNQ4L.cjs} +2 -2
- package/dist/{chunk-BPOF5U4N.mjs → chunk-NFMDCAOS.mjs} +10 -7
- package/dist/{chunk-UXFQ3UDA.cjs → chunk-NICDYKBS.cjs} +42 -3
- package/dist/{chunk-EZDQRNQ7.mjs → chunk-NNSAQX3U.mjs} +23 -5
- package/dist/{chunk-DZ5ZVB2K.cjs → chunk-NQ6QFZWD.cjs} +1 -1
- package/dist/{chunk-U4KT7QP3.cjs → chunk-OW67PDDS.cjs} +14 -1
- package/dist/{chunk-77GNHH2Z.cjs → chunk-PMQHMWZU.cjs} +3 -3
- package/dist/{chunk-NMHWYWDR.cjs → chunk-Q5FYSK45.cjs} +169 -156
- package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
- package/dist/{chunk-EWET4D2Y.mjs → chunk-RRMVL6CJ.mjs} +3 -3
- package/dist/{chunk-IZY3V5XW.mjs → chunk-S3VWVTVA.mjs} +14 -1
- package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
- package/dist/chunk-SGBZPZUW.mjs +75 -0
- package/dist/{chunk-2ELDTQRN.mjs → chunk-TDNWPAVR.mjs} +1 -1
- package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
- package/dist/{chunk-4WCZJQUO.mjs → chunk-TPLJVC7E.mjs} +37 -6
- package/dist/{chunk-NRSN7G7E.mjs → chunk-TW4GYDBJ.mjs} +1 -1
- package/dist/{chunk-FO427P6I.cjs → chunk-U6MPZ35Q.cjs} +10 -10
- package/dist/{chunk-CBJJH36A.cjs → chunk-UJZLSXUB.cjs} +3 -3
- package/dist/chunk-UXHS27O6.cjs +75 -0
- package/dist/{chunk-DQQOKWYA.cjs → chunk-VR4GD5I3.cjs} +3 -3
- package/dist/{chunk-T4OGRVNS.mjs → chunk-VXAWRDK7.mjs} +2 -2
- package/dist/{chunk-4NU4GGTC.cjs → chunk-W2YDNK66.cjs} +6 -3
- package/dist/{chunk-GQRWBCWK.mjs → chunk-WQ7T2263.mjs} +13 -5
- package/dist/chunk-WRPHYQVY.mjs +109 -0
- package/dist/chunk-WT4TGLXT.cjs +109 -0
- package/dist/{chunk-4E5AEDKY.mjs → chunk-XOPOIFTJ.mjs} +1 -1
- package/dist/{chunk-OO7GXVSR.mjs → chunk-YCKO6FRS.mjs} +1 -1
- package/dist/{chunk-MKYBIIAQ.mjs → chunk-Z5BEWYVO.mjs} +1 -1
- package/dist/{chunk-VILIPRS6.mjs → chunk-Z7LA7MHQ.mjs} +1 -1
- package/dist/{client-plugins-r1mOtSC1.d.ts → client-plugins-C8DjftDF.d.ts} +14 -0
- package/dist/{client-plugins-C3mK9Pol.d.mts → client-plugins-CV4eJ9De.d.mts} +14 -0
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-JZJJY5CK.cjs → devtools-JXFQNWSH.cjs} +4 -4
- package/dist/{devtools-ERIKFEXX.mjs → devtools-KVOY2TCZ.mjs} +3 -3
- package/dist/docs.cjs +5 -5
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +4 -4
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +11 -11
- package/dist/i18n/client.mjs +3 -3
- package/dist/index.cjs +42 -39
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +41 -38
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.cjs +4 -2
- package/dist/internal/app-markdown-runtime.d.mts +19 -5
- package/dist/internal/app-markdown-runtime.d.ts +19 -5
- package/dist/internal/app-markdown-runtime.mjs +3 -1
- package/dist/internal/build-runtime.cjs +25 -23
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +24 -22
- package/dist/internal/cli-runtime.cjs +8 -8
- package/dist/internal/cli-runtime.mjs +7 -7
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +15 -50
- package/dist/internal/production-runtime.d.mts +8 -8
- package/dist/internal/production-runtime.d.ts +8 -8
- package/dist/internal/production-runtime.mjs +11 -46
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +8 -8
- package/dist/middleware.d.mts +6 -4
- package/dist/middleware.d.ts +6 -4
- package/dist/middleware.mjs +7 -7
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +6 -6
- package/dist/plugin.cjs +19 -18
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +18 -17
- package/dist/{production-runtime-DPnsggY3.d.ts → production-runtime-C2kkrPVZ.d.ts} +1 -1
- package/dist/{production-runtime-CCeVZXst.d.mts → production-runtime-Du_FHb2-.d.mts} +1 -1
- package/dist/query/client.cjs +9 -9
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-Cw4f5E_R.d.ts → render-plan-BnnPTpus.d.ts} +1 -1
- package/dist/{render-plan-BuGaPFe6.d.mts → render-plan-Cgx7v8tJ.d.mts} +1 -1
- package/dist/renderer-client.cjs +12 -12
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +4 -4
- package/dist/{request-Bkg-hERy.d.ts → request-BNWr7r5e.d.ts} +1 -1
- package/dist/{request-CsGARcAw.d.mts → request-sKayKcop.d.mts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-BUZMH_64.d.ts → route-rendering-Bx4Auw6Q.d.ts} +1 -1
- package/dist/{route-rendering-f11yh5dp.d.mts → route-rendering-DWFp3Yq4.d.mts} +1 -1
- package/dist/{router-Cp6yRE8A.d.mts → router-BK6K42Ij.d.mts} +1 -1
- package/dist/{router-B8CR9GbD.d.ts → router-DnW_2tQi.d.ts} +1 -1
- package/dist/routes.cjs +2 -2
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/{runtime-CQVsT330.d.ts → runtime-CA3Ei5k_.d.ts} +1 -1
- package/dist/{runtime-CAEv36S_.d.mts → runtime-DJDaCMd_.d.mts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +45 -44
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +23 -22
- package/dist/{spa-router-DwbqGkGj.d.mts → spa-router-D6fUA4Rn.d.mts} +2 -2
- package/dist/{spa-router-BuciWGCZ.d.ts → spa-router-Mwbd7g2L.d.ts} +2 -2
- package/dist/testing.cjs +8 -8
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +6 -6
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-CaoWKtYM.d.ts → utils-BwVcAfUR.d.ts} +1 -1
- package/dist/{utils-B9V0S_yL.d.mts → utils-p9Hs-jCc.d.mts} +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 +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +18 -17
- package/package.json +1 -1
- package/types/middleware.d.ts +5 -1
- package/dist/chunk-FXEF4PPL.mjs +0 -47
- package/dist/chunk-XD32KALF.cjs +0 -47
- /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
- /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
|
@@ -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 _chunkB5PFZLKVcjs = require('./chunk-B5PFZLKV.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 _chunkB5PFZLKVcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
15
15
|
source,
|
|
16
16
|
filePath,
|
|
17
17
|
components: options.components,
|
|
@@ -10,7 +10,7 @@ var _chunkTE2G5IONcjs = require('./chunk-TE2G5ION.cjs');
|
|
|
10
10
|
var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk3A4KGQYIcjs = require('./chunk-3A4KGQYI.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -551,7 +551,7 @@ async function resolveAPIContext(options) {
|
|
|
551
551
|
config: options.config,
|
|
552
552
|
configPath: options.configPath
|
|
553
553
|
}));
|
|
554
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
554
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunk3A4KGQYIcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
555
555
|
return {
|
|
556
556
|
root,
|
|
557
557
|
srcDir,
|
|
@@ -27,7 +27,7 @@ var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
|
|
|
27
27
|
var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkUJZLSXUBcjs = require('./chunk-UJZLSXUB.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -119,7 +119,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, withTimeout, "withTimeout");
|
|
|
119
119
|
var formatSeconds = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`, "formatSeconds");
|
|
120
120
|
function collectSchemaOwners(config) {
|
|
121
121
|
const owners = [];
|
|
122
|
-
const integrationSchemas =
|
|
122
|
+
const integrationSchemas = _chunkUJZLSXUBcjs.getIntegrationSchemas.call(void 0, config.integrations);
|
|
123
123
|
let integrationClient;
|
|
124
124
|
for (const [name, schema] of Object.entries(integrationSchemas)) {
|
|
125
125
|
owners.push({
|
|
@@ -34,7 +34,7 @@ var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
|
|
|
34
34
|
var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkOW67PDDScjs = require('./chunk-OW67PDDS.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -1119,7 +1119,7 @@ function createApiClients(options = {}) {
|
|
|
1119
1119
|
"api is server-only. Use apiClient from createApiClients() in the browser."
|
|
1120
1120
|
);
|
|
1121
1121
|
}
|
|
1122
|
-
const currentRequest =
|
|
1122
|
+
const currentRequest = _chunkOW67PDDScjs._resolveCurrentRequest.call(void 0, );
|
|
1123
1123
|
const runtime = _chunk72ADZ6GQcjs.resolveAPIRequestRuntime.call(void 0, );
|
|
1124
1124
|
if (!currentRequest || !runtime) {
|
|
1125
1125
|
throw new Error(
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var _chunkDVM4FKZLcjs = require('./chunk-DVM4FKZL.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -29,7 +29,7 @@ function createRewritesPlugin(rewrites, {
|
|
|
29
29
|
if (overrideBeforeRequest) {
|
|
30
30
|
await overrideBeforeRequest(req, res, context);
|
|
31
31
|
}
|
|
32
|
-
const url =
|
|
32
|
+
const url = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req);
|
|
33
33
|
const routePath = _chunkDVM4FKZLcjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n);
|
|
34
34
|
const pathname = routePath.pathname;
|
|
35
35
|
for (const { rewrite, pattern } of compiledRewrites) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEMMQ64QWcjs = require('./chunk-EMMQ64QW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFWE7LEQCcjs = require('./chunk-FWE7LEQC.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 = _chunkEMMQ64QWcjs.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 _chunkFWE7LEQCcjs.getRouter.call(void 0, ).refresh();
|
|
25
25
|
},
|
|
26
26
|
prefetch(href) {
|
|
27
27
|
if (typeof window === "undefined") return Promise.resolve();
|
|
28
|
-
return
|
|
28
|
+
return _chunkFWE7LEQCcjs.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 _chunkEMMQ64QWcjs.useRouter.call(void 0, ).pathname;
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePathname, "usePathname");
|
|
37
37
|
function useSearchParams() {
|
|
38
|
-
return
|
|
38
|
+
return _chunkEMMQ64QWcjs.useRouter.call(void 0, ).searchParams;
|
|
39
39
|
}
|
|
40
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useSearchParams, "useSearchParams");
|
|
41
41
|
|
|
@@ -119,7 +119,6 @@ var ANONYMOUS_REQUEST_HEADERS = /* @__PURE__ */ new Set([
|
|
|
119
119
|
"cache-control",
|
|
120
120
|
"connection",
|
|
121
121
|
"dnt",
|
|
122
|
-
"forwarded",
|
|
123
122
|
"host",
|
|
124
123
|
"if-match",
|
|
125
124
|
"if-modified-since",
|
|
@@ -141,12 +140,9 @@ var ANONYMOUS_REQUEST_HEADERS = /* @__PURE__ */ new Set([
|
|
|
141
140
|
"tracestate",
|
|
142
141
|
"upgrade-insecure-requests",
|
|
143
142
|
"user-agent",
|
|
144
|
-
"via",
|
|
145
|
-
"x-forwarded-for",
|
|
146
143
|
"x-forwarded-host",
|
|
147
144
|
"x-forwarded-port",
|
|
148
145
|
"x-forwarded-proto",
|
|
149
|
-
"x-real-ip",
|
|
150
146
|
"x-request-id"
|
|
151
147
|
]);
|
|
152
148
|
function isAnonymousRequestHeader(name) {
|
|
@@ -154,6 +150,36 @@ function isAnonymousRequestHeader(name) {
|
|
|
154
150
|
return ANONYMOUS_REQUEST_HEADERS.has(lower) || lower.startsWith("sec-fetch-") || lower.startsWith("sec-ch-");
|
|
155
151
|
}
|
|
156
152
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isAnonymousRequestHeader, "isAnonymousRequestHeader");
|
|
153
|
+
var PAGE_CHECK_DROPPED_HEADERS = /* @__PURE__ */ new Set([
|
|
154
|
+
"accept-encoding",
|
|
155
|
+
"if-match",
|
|
156
|
+
"if-modified-since",
|
|
157
|
+
"if-none-match",
|
|
158
|
+
"if-range",
|
|
159
|
+
"if-unmodified-since",
|
|
160
|
+
"range"
|
|
161
|
+
]);
|
|
162
|
+
async function anonymousVisitorOpensPage(options, url, targetPathname) {
|
|
163
|
+
const pageUrl = new URL(url);
|
|
164
|
+
pageUrl.pathname = targetPathname;
|
|
165
|
+
const headers = new Headers();
|
|
166
|
+
for (const [name, value] of options.request.headers) {
|
|
167
|
+
if (!PAGE_CHECK_DROPPED_HEADERS.has(name.toLowerCase())) headers.append(name, value);
|
|
168
|
+
}
|
|
169
|
+
headers.set("accept", "text/html");
|
|
170
|
+
const response = await options.renderPage(
|
|
171
|
+
new Request(pageUrl, {
|
|
172
|
+
method: "GET",
|
|
173
|
+
headers,
|
|
174
|
+
redirect: "manual",
|
|
175
|
+
signal: options.request.signal
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
void _optionalChain([response, 'access', _9 => _9.body, 'optionalAccess', _10 => _10.cancel, 'call', _11 => _11(), 'access', _12 => _12.catch, 'call', _13 => _13(() => {
|
|
179
|
+
})]);
|
|
180
|
+
return response.status >= 200 && response.status < 300 && Boolean(_optionalChain([response, 'access', _14 => _14.headers, 'access', _15 => _15.get, 'call', _16 => _16("content-type"), 'optionalAccess', _17 => _17.toLowerCase, 'call', _18 => _18(), 'access', _19 => _19.includes, 'call', _20 => _20("text/html")]));
|
|
181
|
+
}
|
|
182
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, anonymousVisitorOpensPage, "anonymousVisitorOpensPage");
|
|
157
183
|
function hasOnlyAnonymousHeaders(headers) {
|
|
158
184
|
for (const name of headers.keys()) {
|
|
159
185
|
if (!isAnonymousRequestHeader(name)) return false;
|
|
@@ -161,11 +187,12 @@ function hasOnlyAnonymousHeaders(headers) {
|
|
|
161
187
|
return true;
|
|
162
188
|
}
|
|
163
189
|
_chunkS3JO3N4Hcjs.__name.call(void 0, hasOnlyAnonymousHeaders, "hasOnlyAnonymousHeaders");
|
|
190
|
+
var FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS = "192.0.2.1";
|
|
164
191
|
async function createFarmMarkdownSourceResponse(options) {
|
|
165
192
|
if (options.request.method !== "GET" && options.request.method !== "HEAD") {
|
|
166
193
|
return null;
|
|
167
194
|
}
|
|
168
|
-
if (_optionalChain([options, 'access',
|
|
195
|
+
if (_optionalChain([options, 'access', _21 => _21.config, 'optionalAccess', _22 => _22.markdownRoutes]) === false) {
|
|
169
196
|
return null;
|
|
170
197
|
}
|
|
171
198
|
const url = new URL(options.request.url);
|
|
@@ -178,7 +205,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
178
205
|
if (!source) {
|
|
179
206
|
return null;
|
|
180
207
|
}
|
|
181
|
-
const anonymous = hasOnlyAnonymousHeaders(options.request.headers);
|
|
208
|
+
const anonymous = hasOnlyAnonymousHeaders(options.request.headers) && (!options.clientAddress || options.clientAddress === FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS);
|
|
182
209
|
if (options.renderPage && (hasMarkdownExtension || !anonymous)) {
|
|
183
210
|
const publicUrl = new URL(url);
|
|
184
211
|
publicUrl.pathname = targetPathname;
|
|
@@ -194,11 +221,11 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
194
221
|
signal: options.request.signal
|
|
195
222
|
})
|
|
196
223
|
);
|
|
197
|
-
if (publicResponse.headers.get("X-Farm-Markdown-Route") === targetPathname) {
|
|
224
|
+
if (publicResponse.headers.get("X-Farm-Markdown-Route") === targetPathname && publicResponse.headers.has("X-Farm-Markdown-Source")) {
|
|
198
225
|
publicSourceResponses.add(publicResponse);
|
|
199
226
|
return publicResponse;
|
|
200
227
|
}
|
|
201
|
-
await _optionalChain([publicResponse, 'access',
|
|
228
|
+
await _optionalChain([publicResponse, 'access', _23 => _23.body, 'optionalAccess', _24 => _24.cancel, 'call', _25 => _25()]);
|
|
202
229
|
if (!hasMarkdownExtension) return null;
|
|
203
230
|
return new Response(`No public Markdown version of ${targetPathname}.
|
|
204
231
|
`, {
|
|
@@ -209,6 +236,9 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
209
236
|
}
|
|
210
237
|
});
|
|
211
238
|
}
|
|
239
|
+
if (options.renderPage && !await anonymousVisitorOpensPage(options, url, targetPathname)) {
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
212
242
|
const headers = new Headers({
|
|
213
243
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
214
244
|
"Content-Location": targetPathname === "/" ? "/index.md" : `${targetPathname}.md`,
|
|
@@ -239,4 +269,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmMarkdownSourceResponse, "createF
|
|
|
239
269
|
|
|
240
270
|
|
|
241
271
|
|
|
242
|
-
|
|
272
|
+
|
|
273
|
+
exports.isFarmMarkdownPageFile = isFarmMarkdownPageFile; exports.normalizeFarmMarkdownRoutePath = normalizeFarmMarkdownRoutePath; exports.parseMarkdownFrontmatter = parseMarkdownFrontmatter; exports.titleFromMarkdown = titleFromMarkdown; exports.createMarkdownMetadata = createMarkdownMetadata; exports.createFarmMarkdownRouteModule = createFarmMarkdownRouteModule; exports.isFarmMarkdownPublicSourceResponse = isFarmMarkdownPublicSourceResponse; exports.FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS = FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS; exports.createFarmMarkdownSourceResponse = createFarmMarkdownSourceResponse;
|
|
@@ -7,7 +7,7 @@ var _chunkD7JTOLFKcjs = require('./chunk-D7JTOLFK.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk7SQ5SGYZcjs = require('./chunk-7SQ5SGYZ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkLTNGXMQ6cjs = require('./chunk-LTNGXMQ6.cjs');
|
|
@@ -17,10 +17,12 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunkJEZO6VURcjs = require('./chunk-JEZO6VUR.cjs');
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
var _chunk63H6BKXGcjs = require('./chunk-63H6BKXG.cjs');
|
|
@@ -147,9 +149,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
147
149
|
};
|
|
148
150
|
});
|
|
149
151
|
const mutationTarget = targetRef.current;
|
|
150
|
-
const isAPITarget =
|
|
152
|
+
const isAPITarget = _chunk7SQ5SGYZcjs.isAPIRouteRef.call(void 0, mutationTarget);
|
|
151
153
|
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]) ?
|
|
154
|
+
const sharedSnapshots = _optionalChain([sharedOptimistic, 'optionalAccess', _5 => _5.update, 'optionalAccess', _6 => _6.length]) ? _chunk7SQ5SGYZcjs.applyServerFnOptimisticUpdates.call(void 0, sharedOptimistic.update) : [];
|
|
153
155
|
try {
|
|
154
156
|
if (preparationFailed) throw preparationError;
|
|
155
157
|
let data;
|
|
@@ -176,9 +178,9 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
176
178
|
throw cause;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
|
-
|
|
181
|
+
_chunk7SQ5SGYZcjs.settleServerFnOptimisticUpdates.call(void 0, sharedSnapshots, "commit");
|
|
180
182
|
if (!isAPITarget && _optionalChain([currentOptions, 'access', _9 => _9.request, 'optionalAccess', _10 => _10.invalidate])) {
|
|
181
|
-
for (const key of
|
|
183
|
+
for (const key of _chunk7SQ5SGYZcjs.resolveServerFnInvalidateTargets.call(void 0, currentOptions.request.invalidate)) {
|
|
182
184
|
_chunkZEG3OPIBcjs.notifyFarmCacheInvalidation.call(void 0, key);
|
|
183
185
|
}
|
|
184
186
|
}
|
|
@@ -213,7 +215,7 @@ function useMutationLifecycle(target, options = {}) {
|
|
|
213
215
|
}
|
|
214
216
|
return data;
|
|
215
217
|
} catch (cause) {
|
|
216
|
-
|
|
218
|
+
_chunk7SQ5SGYZcjs.settleServerFnOptimisticUpdates.call(void 0,
|
|
217
219
|
sharedSnapshots,
|
|
218
220
|
_optionalChain([sharedOptimistic, 'optionalAccess', _11 => _11.rollbackOnError]) ? "rollback" : "invalidate"
|
|
219
221
|
);
|
|
@@ -389,7 +391,7 @@ function useFetcher(target, options = {}) {
|
|
|
389
391
|
const Form = _react.useMemo.call(void 0, () => {
|
|
390
392
|
const FetcherForm = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, ({ action, method, encType, onSubmit, ...props }) => {
|
|
391
393
|
const targetValue = targetRef.current;
|
|
392
|
-
const metadata =
|
|
394
|
+
const metadata = _chunk7SQ5SGYZcjs.getAPIRouteRefMetadata.call(void 0, targetValue);
|
|
393
395
|
const nativeAction = _nullishCoalesce(action, () => ( resolveFetcherFormAction(targetValue, metadata)));
|
|
394
396
|
const nativeMethod = _nullishCoalesce(method, () => ( (metadata && (metadata.method === "GET" || metadata.method === "POST") ? metadata.method.toLowerCase() : metadata ? "post" : void 0)));
|
|
395
397
|
const functionAction = typeof nativeAction === "function";
|
|
@@ -458,10 +460,10 @@ function mapFetcherFormData(target, formData, options) {
|
|
|
458
460
|
if (options.mapFormData) {
|
|
459
461
|
return options.mapFormData(formData, context);
|
|
460
462
|
}
|
|
461
|
-
if (!
|
|
463
|
+
if (!_chunk7SQ5SGYZcjs.isAPIRouteRef.call(void 0, target)) {
|
|
462
464
|
return formData;
|
|
463
465
|
}
|
|
464
|
-
const method = _optionalChain([
|
|
466
|
+
const method = _optionalChain([_chunk7SQ5SGYZcjs.getAPIRouteRefMetadata.call(void 0, target), 'optionalAccess', _14 => _14.method]);
|
|
465
467
|
const query = method === "GET" || method === "HEAD";
|
|
466
468
|
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
469
|
if (!query && (_optionalChain([encoding, 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]) === "multipart/form-data" || Array.from(formData.values()).some((value) => typeof value !== "string"))) {
|
|
@@ -1213,9 +1215,10 @@ function LinkInner({
|
|
|
1213
1215
|
hash,
|
|
1214
1216
|
trailingSlash: _nullishCoalesce(trailingSlash, () => ( _chunkOYEUREB6cjs.getFarmTrailingSlashPreference.call(void 0, )))
|
|
1215
1217
|
});
|
|
1216
|
-
const localizedHref =
|
|
1218
|
+
const localizedHref = _chunkS6FJO323cjs.localizeActiveFarmHref.call(void 0, baseHref, locale);
|
|
1217
1219
|
const resolvedHref = isExternalUrl(localizedHref) ? localizedHref : _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, localizedHref, _nullishCoalesce(_optionalChain([farm, 'optionalAccess', _34 => _34.basePath]), () => ( _chunkI57LW5VZcjs.getFarmBasePath.call(void 0, ))));
|
|
1218
1220
|
const isExternal = isExternalUrl(resolvedHref);
|
|
1221
|
+
const isScriptHref = _chunkJEZO6VURcjs.isFarmScriptURL.call(void 0, resolvedHref);
|
|
1219
1222
|
const doPrefetch = _react.useCallback.call(void 0, () => {
|
|
1220
1223
|
if (isExternal || activePrefetch.current) return;
|
|
1221
1224
|
const router = getRouter();
|
|
@@ -1325,6 +1328,11 @@ function LinkInner({
|
|
|
1325
1328
|
const handleClick = _react.useCallback.call(void 0,
|
|
1326
1329
|
(event) => {
|
|
1327
1330
|
_optionalChain([onClick, 'optionalCall', _40 => _40(event)]);
|
|
1331
|
+
if (isScriptHref) {
|
|
1332
|
+
event.preventDefault();
|
|
1333
|
+
_chunkJEZO6VURcjs.isFarmBlockedNavigationURL.call(void 0, _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, resolvedHref, window.location.href));
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1328
1336
|
if (event.defaultPrevented) return;
|
|
1329
1337
|
if (isExternal) return;
|
|
1330
1338
|
if (event.currentTarget.hasAttribute("download")) return;
|
|
@@ -1333,7 +1341,7 @@ function LinkInner({
|
|
|
1333
1341
|
if (event.button !== 0) return;
|
|
1334
1342
|
if (typeof window !== "undefined") {
|
|
1335
1343
|
event.preventDefault();
|
|
1336
|
-
if (
|
|
1344
|
+
if (_chunkS6FJO323cjs.isFarmLocaleChangeHref.call(void 0, localizedHref)) {
|
|
1337
1345
|
window.location.assign(resolvedHref);
|
|
1338
1346
|
return;
|
|
1339
1347
|
}
|
|
@@ -1346,7 +1354,17 @@ function LinkInner({
|
|
|
1346
1354
|
}
|
|
1347
1355
|
}
|
|
1348
1356
|
},
|
|
1349
|
-
[
|
|
1357
|
+
[
|
|
1358
|
+
localizedHref,
|
|
1359
|
+
resolvedHref,
|
|
1360
|
+
replace,
|
|
1361
|
+
scroll,
|
|
1362
|
+
viewTransition,
|
|
1363
|
+
target,
|
|
1364
|
+
isExternal,
|
|
1365
|
+
isScriptHref,
|
|
1366
|
+
onClick
|
|
1367
|
+
]
|
|
1350
1368
|
);
|
|
1351
1369
|
const setRefs = _react.useCallback.call(void 0,
|
|
1352
1370
|
(node) => {
|
|
@@ -1360,7 +1378,7 @@ function LinkInner({
|
|
|
1360
1378
|
"a",
|
|
1361
1379
|
{
|
|
1362
1380
|
ref: setRefs,
|
|
1363
|
-
href: resolvedHref,
|
|
1381
|
+
href: isScriptHref ? void 0 : resolvedHref,
|
|
1364
1382
|
target,
|
|
1365
1383
|
onClick: handleClick,
|
|
1366
1384
|
onMouseEnter: handleMouseEnter,
|
|
@@ -1433,7 +1451,7 @@ function applyPreservedSearchParams(href) {
|
|
|
1433
1451
|
const manifest = window.__FARM_MANIFEST__;
|
|
1434
1452
|
const routes = _optionalChain([manifest, 'optionalAccess', _41 => _41.routes]) && typeof manifest.routes === "object" ? Object.values(manifest.routes) : [];
|
|
1435
1453
|
if (routes.length === 0) return href;
|
|
1436
|
-
const url =
|
|
1454
|
+
const url = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
1437
1455
|
const route = routes.find((candidate) => matchManifestRoute(url.pathname, candidate));
|
|
1438
1456
|
const preserve = Array.isArray(_optionalChain([route, 'optionalAccess', _42 => _42.search, 'optionalAccess', _43 => _43.preserve])) ? route.search.preserve : [];
|
|
1439
1457
|
if (preserve.length === 0) return href;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk6LGFV2CQcjs = require('./chunk-6LGFV2CQ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkSK35NQKKcjs = require('./chunk-SK35NQKK.cjs');
|
|
@@ -35,7 +35,7 @@ function createServerQuery(options) {
|
|
|
35
35
|
throw new TypeError("createServerQuery requires a key function");
|
|
36
36
|
}
|
|
37
37
|
const staleTime = normalizeServerQueryStaleTime(options.staleTime);
|
|
38
|
-
const execute =
|
|
38
|
+
const execute = _chunk6LGFV2CQcjs.createServerFn.call(void 0, {
|
|
39
39
|
input: options.input,
|
|
40
40
|
middleware: options.middleware,
|
|
41
41
|
handler: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (context) => {
|
|
@@ -45,7 +45,7 @@ function createServerQuery(options) {
|
|
|
45
45
|
const cacheKey = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["route-data", routeKey]);
|
|
46
46
|
const producer = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
47
47
|
const value = await options.handler(context);
|
|
48
|
-
return
|
|
48
|
+
return _chunk6LGFV2CQcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
|
|
49
49
|
}, "producer");
|
|
50
50
|
let data;
|
|
51
51
|
let updatedAt;
|
|
@@ -90,10 +90,10 @@ function createServerQuery(options) {
|
|
|
90
90
|
enumerable: false
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
_chunk6LGFV2CQcjs._attachServerFunctionDescriptor.call(void 0,
|
|
94
94
|
query,
|
|
95
|
-
|
|
96
|
-
const result = await
|
|
95
|
+
_chunk6LGFV2CQcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
|
|
96
|
+
const result = await _chunk6LGFV2CQcjs._runServerFunctionForCaller.call(void 0,
|
|
97
97
|
execute,
|
|
98
98
|
value
|
|
99
99
|
);
|
|
@@ -6,7 +6,7 @@ var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
|
6
6
|
var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -299,7 +299,7 @@ function farmInfraAnalyticsPlugin(options, send) {
|
|
|
299
299
|
context.state.unsubscribe = _chunkE3UK5IIBcjs.onFarmEvent.call(void 0,
|
|
300
300
|
(event) => {
|
|
301
301
|
if (!isToolEvent(event)) return;
|
|
302
|
-
const request =
|
|
302
|
+
const request = _chunkNICDYKBScjs.getCurrentRequestOrNull.call(void 0, );
|
|
303
303
|
if (!request) return;
|
|
304
304
|
const metadata = context.requestContext.get(request, contextKey);
|
|
305
305
|
if (!metadata) return;
|
|
@@ -569,6 +569,10 @@ async function resolveProgrammaticRouteData(route, dataHooks, context) {
|
|
|
569
569
|
if (routeDataKey == null) {
|
|
570
570
|
return dataHooks.main(context);
|
|
571
571
|
}
|
|
572
|
+
const revalidate = normalizeProgrammaticRouteStaleTime(dataHooks.staleTime, route.path);
|
|
573
|
+
if (revalidate === 0) {
|
|
574
|
+
return dataHooks.main(context);
|
|
575
|
+
}
|
|
572
576
|
const cacheKey = createFarmCacheKey(["route-data", routeDataKey]);
|
|
573
577
|
const cacheOptions = {
|
|
574
578
|
tags: [
|
|
@@ -579,7 +583,7 @@ async function resolveProgrammaticRouteData(route, dataHooks, context) {
|
|
|
579
583
|
...typeof context.path === "string" ? [context.path] : [],
|
|
580
584
|
...await resolveProgrammaticRouteDataKeys(dataHooks.paths, context)
|
|
581
585
|
],
|
|
582
|
-
revalidate
|
|
586
|
+
revalidate
|
|
583
587
|
};
|
|
584
588
|
return getFarmDataCache().getOrSet(cacheKey, () => dataHooks.main(context), cacheOptions);
|
|
585
589
|
}
|
|
@@ -590,20 +594,26 @@ async function resolveProgrammaticRouteDataKeys(input, context) {
|
|
|
590
594
|
return value.filter((item) => typeof item === "string" && item.trim().length > 0);
|
|
591
595
|
}
|
|
592
596
|
__name(resolveProgrammaticRouteDataKeys, "resolveProgrammaticRouteDataKeys");
|
|
593
|
-
function normalizeProgrammaticRouteStaleTime(staleTime) {
|
|
597
|
+
function normalizeProgrammaticRouteStaleTime(staleTime, routePath) {
|
|
594
598
|
if (staleTime === void 0) return void 0;
|
|
595
599
|
if (staleTime === false) return false;
|
|
600
|
+
let milliseconds;
|
|
596
601
|
if (typeof staleTime === "number") {
|
|
597
|
-
|
|
598
|
-
|
|
602
|
+
milliseconds = staleTime;
|
|
603
|
+
} else {
|
|
604
|
+
const match = typeof staleTime === "string" && staleTime.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)$/);
|
|
605
|
+
if (!match) {
|
|
606
|
+
throw new TypeError(
|
|
607
|
+
`Route "${routePath}" data.staleTime must be milliseconds or a duration like "250ms", "30s", "5m", or "1h".`
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
const unit = match[2];
|
|
611
|
+
milliseconds = Number(match[1]) * (unit === "ms" ? 1 : unit === "s" ? 1e3 : unit === "m" ? 6e4 : 36e5);
|
|
612
|
+
}
|
|
613
|
+
if (!Number.isFinite(milliseconds) || milliseconds < 0) {
|
|
614
|
+
throw new TypeError(`Route "${routePath}" data.staleTime must be a non-negative duration.`);
|
|
599
615
|
}
|
|
600
|
-
|
|
601
|
-
if (!match) return void 0;
|
|
602
|
-
const value = Number(match[1]);
|
|
603
|
-
if (!Number.isFinite(value) || value <= 0) return void 0;
|
|
604
|
-
const unit = match[2];
|
|
605
|
-
const milliseconds = unit === "ms" ? value : unit === "s" ? value * 1e3 : unit === "m" ? value * 6e4 : value * 36e5;
|
|
606
|
-
return Math.max(1, Math.ceil(milliseconds / 1e3));
|
|
616
|
+
return milliseconds === 0 ? 0 : Math.max(1, Math.ceil(milliseconds / 1e3));
|
|
607
617
|
}
|
|
608
618
|
__name(normalizeProgrammaticRouteStaleTime, "normalizeProgrammaticRouteStaleTime");
|
|
609
619
|
function isProgrammaticRoutePropsResolved(value) {
|
|
@@ -662,6 +672,7 @@ function normalizeProgrammaticRoute(route) {
|
|
|
662
672
|
};
|
|
663
673
|
}
|
|
664
674
|
const routeActions = route.kind === "page" ? normalizeProgrammaticRouteActions(route) : void 0;
|
|
675
|
+
normalizeProgrammaticRouteStaleTime(route.data?.staleTime, route.path);
|
|
665
676
|
return {
|
|
666
677
|
...route,
|
|
667
678
|
...routeActions,
|