@farm.js/core 0.1.0-beta.96 → 0.1.0-beta.97

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.
Files changed (311) hide show
  1. package/dist/after.cjs +1 -1
  2. package/dist/after.mjs +1 -1
  3. package/dist/agent-runtime.d.mts +3 -2
  4. package/dist/agent-runtime.d.ts +3 -2
  5. package/dist/api/route-manager.cjs +43 -4
  6. package/dist/api/route-manager.d.mts +4 -3
  7. package/dist/api/route-manager.d.ts +4 -3
  8. package/dist/api/route-manager.mjs +6 -6
  9. package/dist/api/runtime.cjs +43 -4
  10. package/dist/api/runtime.d.mts +1 -1
  11. package/dist/api/runtime.d.ts +1 -1
  12. package/dist/api/runtime.mjs +4 -4
  13. package/dist/api.cjs +239 -70
  14. package/dist/api.d.mts +7 -6
  15. package/dist/api.d.ts +7 -6
  16. package/dist/api.mjs +17 -11
  17. package/dist/{app-CIIEvA4r.d.ts → app-CIOx3LvY.d.ts} +4 -4
  18. package/dist/{app-O4AEC1OH.d.mts → app-DBd6437H.d.mts} +4 -4
  19. package/dist/app-markdown.d.mts +4 -3
  20. package/dist/app-markdown.d.ts +4 -3
  21. package/dist/cache.cjs +42 -4
  22. package/dist/cache.d.mts +68 -1
  23. package/dist/cache.d.ts +68 -1
  24. package/dist/cache.mjs +3 -3
  25. package/dist/{chunk-AXVJCMVF.mjs → chunk-2HDOV47R.mjs} +3 -3
  26. package/dist/chunk-2HDOV47R.mjs.map +1 -0
  27. package/dist/{chunk-RBRLLZL5.mjs → chunk-34IAPZBG.mjs} +16 -3
  28. package/dist/chunk-34IAPZBG.mjs.map +1 -0
  29. package/dist/{chunk-VV24CC42.mjs → chunk-35NPLKQJ.mjs} +2 -2
  30. package/dist/{chunk-MM46HTX6.mjs → chunk-3TWQERDE.mjs} +4 -3
  31. package/dist/chunk-3TWQERDE.mjs.map +1 -0
  32. package/dist/{chunk-RWYRFCLG.mjs → chunk-4X57GXQA.mjs} +2 -2
  33. package/dist/{chunk-3I55IGXU.mjs → chunk-52BR7LTX.mjs} +14 -15
  34. package/dist/chunk-52BR7LTX.mjs.map +1 -0
  35. package/dist/{chunk-RAGSHKDC.mjs → chunk-6EJHNHH4.mjs} +38 -3
  36. package/dist/chunk-6EJHNHH4.mjs.map +1 -0
  37. package/dist/{chunk-ZFNK77WN.mjs → chunk-6JNGOC37.mjs} +2 -2
  38. package/dist/{after.cjs.map → chunk-6JNGOC37.mjs.map} +1 -1
  39. package/dist/{chunk-MOW47IF5.mjs → chunk-6UYVU46O.mjs} +2 -2
  40. package/dist/{chunk-7MABZJIM.mjs → chunk-7PYVLJ4J.mjs} +1 -1
  41. package/dist/chunk-7PYVLJ4J.mjs.map +1 -0
  42. package/dist/{chunk-54XSGLKT.mjs → chunk-D7F7YZ7L.mjs} +93 -67
  43. package/dist/chunk-D7F7YZ7L.mjs.map +1 -0
  44. package/dist/{chunk-SCFX4UTD.mjs → chunk-EHTUKVSW.mjs} +1 -1
  45. package/dist/chunk-EHTUKVSW.mjs.map +1 -0
  46. package/dist/{chunk-LZTGDH3H.mjs → chunk-EPDIF432.mjs} +424 -10
  47. package/dist/chunk-EPDIF432.mjs.map +1 -0
  48. package/dist/{chunk-GZHKWHCH.mjs → chunk-FP5Q67FO.mjs} +167 -96
  49. package/dist/chunk-FP5Q67FO.mjs.map +1 -0
  50. package/dist/{chunk-HHZAOTQD.mjs → chunk-GJ7W6LNK.mjs} +7 -6
  51. package/dist/chunk-GJ7W6LNK.mjs.map +1 -0
  52. package/dist/{chunk-RLGUZ3HS.mjs → chunk-I3OOUWO5.mjs} +3 -3
  53. package/dist/{chunk-LKKMI7JG.mjs → chunk-IZBX2TEU.mjs} +153 -68
  54. package/dist/chunk-IZBX2TEU.mjs.map +1 -0
  55. package/dist/{chunk-74QPONAN.mjs → chunk-J3MPQ4MQ.mjs} +2 -2
  56. package/dist/{chunk-74QPONAN.mjs.map → chunk-J3MPQ4MQ.mjs.map} +1 -1
  57. package/dist/{chunk-ODJGAWDH.mjs → chunk-JV7JUD7Q.mjs} +4 -4
  58. package/dist/{chunk-Q3OX763A.mjs → chunk-LXDASSTE.mjs} +2 -2
  59. package/dist/{chunk-ZRBCBOEX.mjs → chunk-N2FY2QZ7.mjs} +28 -3
  60. package/dist/chunk-N2FY2QZ7.mjs.map +1 -0
  61. package/dist/{chunk-MRVJCLYQ.mjs → chunk-PSQ7N4XP.mjs} +4 -2
  62. package/dist/chunk-PSQ7N4XP.mjs.map +1 -0
  63. package/dist/{chunk-HVG3HLQZ.mjs → chunk-Q7WGOOAI.mjs} +3 -3
  64. package/dist/{chunk-WTYAPO5I.mjs → chunk-RCNWMEBT.mjs} +3 -2
  65. package/dist/{chunk-WTYAPO5I.mjs.map → chunk-RCNWMEBT.mjs.map} +1 -1
  66. package/dist/{chunk-3INDBMUU.mjs → chunk-TGDIACZT.mjs} +2 -2
  67. package/dist/{chunk-WB75GIX2.mjs → chunk-TQTB33JS.mjs} +14 -3
  68. package/dist/chunk-TQTB33JS.mjs.map +1 -0
  69. package/dist/{chunk-WMAYETRD.mjs → chunk-TT3E2JOF.mjs} +3 -3
  70. package/dist/{chunk-FVAM43KI.mjs → chunk-UMUWR5XA.mjs} +2 -2
  71. package/dist/{chunk-VOUJW4FL.mjs → chunk-WD2EBM3I.mjs} +70 -15
  72. package/dist/chunk-WD2EBM3I.mjs.map +1 -0
  73. package/dist/{chunk-ZPG6SNHH.mjs → chunk-WMJGA32P.mjs} +47 -5
  74. package/dist/chunk-WMJGA32P.mjs.map +1 -0
  75. package/dist/{chunk-TKQCJMY7.mjs → chunk-X4SFHKFH.mjs} +7 -4
  76. package/dist/{chunk-TKQCJMY7.mjs.map → chunk-X4SFHKFH.mjs.map} +1 -1
  77. package/dist/{chunk-Q7GPJZCO.mjs → chunk-YIBV77KZ.mjs} +26 -7
  78. package/dist/chunk-YIBV77KZ.mjs.map +1 -0
  79. package/dist/client/lifecycle.mjs +2 -2
  80. package/dist/{client-mcMC334J.d.mts → client-DWoLZ3QU.d.mts} +52 -5
  81. package/dist/{client-d5ONQ-Pd.d.ts → client-DuQuQC1h.d.ts} +52 -5
  82. package/dist/client-cache-BMxuFqwH.d.ts +18 -0
  83. package/dist/client-cache-CCK-fCe0.d.mts +18 -0
  84. package/dist/{client-plugins-BvClItiL.d.mts → client-plugins-B6-07YmP.d.mts} +52 -99
  85. package/dist/{client-plugins-B9Sq-iMg.d.ts → client-plugins-By6MVUX-.d.ts} +52 -99
  86. package/dist/client-plugins.cjs +1 -1
  87. package/dist/client-plugins.d.mts +3 -2
  88. package/dist/client-plugins.d.ts +3 -2
  89. package/dist/client-plugins.mjs +2 -2
  90. package/dist/client.cjs +757 -104
  91. package/dist/client.d.mts +124 -16
  92. package/dist/client.d.ts +124 -16
  93. package/dist/client.mjs +28 -14
  94. package/dist/config.d.mts +3 -2
  95. package/dist/config.d.ts +3 -2
  96. package/dist/{devtools-S52RRRMN.mjs → devtools-XWZX6CCL.mjs} +5 -5
  97. package/dist/{devtools-client-EOVDBPOI.mjs → devtools-client-Z7QQA3Q2.mjs} +2 -2
  98. package/dist/{devtools-ui-NJKFORTG.mjs → devtools-ui-2HG5M4EL.mjs} +3 -1
  99. package/dist/devtools-ui-2HG5M4EL.mjs.map +1 -0
  100. package/dist/docs.cjs +24 -5
  101. package/dist/docs.mjs +5 -5
  102. package/dist/i18n/server.cjs +13 -2
  103. package/dist/i18n/server.d.mts +2 -2
  104. package/dist/i18n/server.d.ts +2 -2
  105. package/dist/i18n/server.mjs +1 -1
  106. package/dist/index.cjs +1578 -772
  107. package/dist/index.d.mts +28 -20
  108. package/dist/index.d.ts +28 -20
  109. package/dist/index.mjs +53 -33
  110. package/dist/index.mjs.map +1 -1
  111. package/dist/integration-api-BT024nuJ.d.mts +97 -0
  112. package/dist/integration-api-BT024nuJ.d.ts +97 -0
  113. package/dist/integrations.d.mts +3 -2
  114. package/dist/integrations.d.ts +3 -2
  115. package/dist/internal/build-runtime.cjs +710 -532
  116. package/dist/internal/build-runtime.d.mts +5 -4
  117. package/dist/internal/build-runtime.d.ts +5 -4
  118. package/dist/internal/build-runtime.mjs +15 -15
  119. package/dist/internal/client-runtime.cjs +1 -1
  120. package/dist/internal/client-runtime.mjs +2 -2
  121. package/dist/internal/config-runtime.cjs +4 -1
  122. package/dist/internal/config-runtime.d.mts +4 -3
  123. package/dist/internal/config-runtime.d.ts +4 -3
  124. package/dist/internal/config-runtime.mjs +4 -4
  125. package/dist/internal/product-telemetry-runtime.cjs +1 -1
  126. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  127. package/dist/internal/production-runtime.cjs +29 -3
  128. package/dist/internal/production-runtime.d.mts +8 -7
  129. package/dist/internal/production-runtime.d.ts +8 -7
  130. package/dist/internal/production-runtime.mjs +5 -5
  131. package/dist/{metadata-route-yV4U6X8h.d.ts → metadata-route-8_V3UonT.d.ts} +1 -1
  132. package/dist/{metadata-route-p4K1l92V.d.mts → metadata-route-CWP_HjGU.d.mts} +1 -1
  133. package/dist/middleware.cjs +28 -2
  134. package/dist/middleware.d.mts +5 -4
  135. package/dist/middleware.d.ts +5 -4
  136. package/dist/middleware.mjs +4 -4
  137. package/dist/navigation.cjs +3 -1
  138. package/dist/navigation.mjs +3 -3
  139. package/dist/observability.cjs +27 -2
  140. package/dist/observability.mjs +1 -1
  141. package/dist/plugin.cjs +474 -334
  142. package/dist/plugin.d.mts +3 -2
  143. package/dist/plugin.d.ts +3 -2
  144. package/dist/plugin.mjs +12 -12
  145. package/dist/{production-runtime-IkB0Qj4i.d.mts → production-runtime-BGRH1dKG.d.mts} +1 -1
  146. package/dist/{production-runtime-0JTch4_d.d.ts → production-runtime-CdmzsDax.d.ts} +1 -1
  147. package/dist/query/client.cjs +11 -3
  148. package/dist/query/client.mjs +12 -4
  149. package/dist/query/client.mjs.map +1 -1
  150. package/dist/{render-plan-Dc8CjNI7.d.ts → render-plan-0GeHiGVZ.d.ts} +1 -1
  151. package/dist/{render-plan-CU31j-Jk.d.mts → render-plan-DLxJYAA5.d.mts} +1 -1
  152. package/dist/renderer-client.cjs +140 -26
  153. package/dist/renderer-client.d.mts +7 -6
  154. package/dist/renderer-client.d.ts +7 -6
  155. package/dist/renderer-client.mjs +16 -19
  156. package/dist/renderer-client.mjs.map +1 -1
  157. package/dist/{request-BXa1KY8i.d.mts → request-BCNXSXLh.d.mts} +1 -1
  158. package/dist/{request-CUUBujZt.d.ts → request-BstWbZ6O.d.ts} +1 -1
  159. package/dist/request.d.mts +4 -3
  160. package/dist/request.d.ts +4 -3
  161. package/dist/{route-Y8lfz1wF.d.ts → route-4pd-EVtw.d.ts} +45 -50
  162. package/dist/{route-Cq3aObmj.d.mts → route-CvEr4Uc9.d.mts} +45 -50
  163. package/dist/routes.cjs +27 -2
  164. package/dist/routes.d.mts +3 -2
  165. package/dist/routes.d.ts +3 -2
  166. package/dist/routes.mjs +4 -4
  167. package/dist/{runtime-j1S3sDTh.d.ts → runtime-BgDQzBiu.d.ts} +1 -0
  168. package/dist/{runtime-DDwvDtS4.d.mts → runtime-CV2UCV-5.d.mts} +1 -0
  169. package/dist/server-action-security.mjs +2 -2
  170. package/dist/server-fn-client.cjs +34 -2
  171. package/dist/server-fn-client.d.mts +6 -0
  172. package/dist/server-fn-client.d.ts +6 -0
  173. package/dist/server-fn-client.mjs +1 -1
  174. package/dist/server-fn.cjs +42 -4
  175. package/dist/server-fn.mjs +5 -5
  176. package/dist/server-plugins.d.mts +4 -3
  177. package/dist/server-plugins.d.ts +4 -3
  178. package/dist/server-query-client.cjs +146 -27
  179. package/dist/server-query-client.d.mts +3 -3
  180. package/dist/server-query-client.d.ts +3 -3
  181. package/dist/server-query-client.mjs +7 -7
  182. package/dist/{server-query-runtime-3zAj77yv.d.ts → server-query-runtime-DXRNhX_3.d.ts} +2 -0
  183. package/dist/{server-query-runtime-B50KAcj5.d.mts → server-query-runtime-aP52iuL5.d.mts} +2 -0
  184. package/dist/server-query.cjs +44 -5
  185. package/dist/server-query.d.mts +4 -0
  186. package/dist/server-query.d.ts +4 -0
  187. package/dist/server-query.mjs +7 -7
  188. package/dist/server.cjs +499 -355
  189. package/dist/server.d.mts +11 -10
  190. package/dist/server.d.ts +11 -10
  191. package/dist/server.mjs +16 -16
  192. package/dist/{spa-router-CyLkwst6.d.mts → spa-router-BeyAVSc6.d.mts} +1 -1
  193. package/dist/{spa-router-BkqGXaV_.d.ts → spa-router-COgu4txb.d.ts} +1 -1
  194. package/dist/testing.cjs +27 -2
  195. package/dist/testing.d.mts +3 -2
  196. package/dist/testing.d.ts +3 -2
  197. package/dist/testing.mjs +8 -8
  198. package/dist/{utils-NKR6SoNv.d.mts → utils-DL2VwDQl.d.mts} +1 -1
  199. package/dist/{utils-B2OHrb9F.d.ts → utils-DkU2c_1B.d.ts} +1 -1
  200. package/dist/version.cjs +1 -1
  201. package/dist/version.mjs +1 -1
  202. package/dist/vite.cjs +482 -338
  203. package/dist/vite.d.mts +3 -2
  204. package/dist/vite.d.ts +3 -2
  205. package/dist/vite.mjs +16 -12
  206. package/package.json +17 -17
  207. package/types/client.d.ts +87 -1
  208. package/dist/agent-runtime.cjs.map +0 -1
  209. package/dist/api/route-manager.cjs.map +0 -1
  210. package/dist/api/runtime.cjs.map +0 -1
  211. package/dist/api.cjs.map +0 -1
  212. package/dist/app-markdown.cjs.map +0 -1
  213. package/dist/cache.cjs.map +0 -1
  214. package/dist/chunk-3I55IGXU.mjs.map +0 -1
  215. package/dist/chunk-54XSGLKT.mjs.map +0 -1
  216. package/dist/chunk-7MABZJIM.mjs.map +0 -1
  217. package/dist/chunk-AXVJCMVF.mjs.map +0 -1
  218. package/dist/chunk-GZHKWHCH.mjs.map +0 -1
  219. package/dist/chunk-HHZAOTQD.mjs.map +0 -1
  220. package/dist/chunk-LKKMI7JG.mjs.map +0 -1
  221. package/dist/chunk-LZTGDH3H.mjs.map +0 -1
  222. package/dist/chunk-MM46HTX6.mjs.map +0 -1
  223. package/dist/chunk-MRVJCLYQ.mjs.map +0 -1
  224. package/dist/chunk-Q7GPJZCO.mjs.map +0 -1
  225. package/dist/chunk-RAGSHKDC.mjs.map +0 -1
  226. package/dist/chunk-RBRLLZL5.mjs.map +0 -1
  227. package/dist/chunk-SCFX4UTD.mjs.map +0 -1
  228. package/dist/chunk-VOUJW4FL.mjs.map +0 -1
  229. package/dist/chunk-WB75GIX2.mjs.map +0 -1
  230. package/dist/chunk-ZFNK77WN.mjs.map +0 -1
  231. package/dist/chunk-ZPG6SNHH.mjs.map +0 -1
  232. package/dist/chunk-ZRBCBOEX.mjs.map +0 -1
  233. package/dist/client/lifecycle.cjs.map +0 -1
  234. package/dist/client-cache-CopR_MaI.d.mts +0 -6
  235. package/dist/client-cache-Djy_TlE8.d.ts +0 -6
  236. package/dist/client-plugins.cjs.map +0 -1
  237. package/dist/client.cjs.map +0 -1
  238. package/dist/config.cjs.map +0 -1
  239. package/dist/cron.cjs.map +0 -1
  240. package/dist/deferred.cjs.map +0 -1
  241. package/dist/deployment.cjs.map +0 -1
  242. package/dist/devtools-ui-NJKFORTG.mjs.map +0 -1
  243. package/dist/docs.cjs.map +0 -1
  244. package/dist/env-types.cjs.map +0 -1
  245. package/dist/env.cjs.map +0 -1
  246. package/dist/environment/vite.cjs.map +0 -1
  247. package/dist/environment.cjs.map +0 -1
  248. package/dist/font.cjs.map +0 -1
  249. package/dist/headers.cjs.map +0 -1
  250. package/dist/i18n/client.cjs.map +0 -1
  251. package/dist/i18n/index.cjs.map +0 -1
  252. package/dist/i18n/server.cjs.map +0 -1
  253. package/dist/image/server.cjs.map +0 -1
  254. package/dist/image/sharp.cjs.map +0 -1
  255. package/dist/image.cjs.map +0 -1
  256. package/dist/index.cjs.map +0 -1
  257. package/dist/instrumentation.cjs.map +0 -1
  258. package/dist/integrations.cjs.map +0 -1
  259. package/dist/internal/build-runtime.cjs.map +0 -1
  260. package/dist/internal/client-runtime.cjs.map +0 -1
  261. package/dist/internal/config-runtime.cjs.map +0 -1
  262. package/dist/internal/isolated-boundary.cjs.map +0 -1
  263. package/dist/internal/metadata-image-runtime.cjs.map +0 -1
  264. package/dist/internal/product-telemetry-runtime.cjs.map +0 -1
  265. package/dist/internal/production-node-env.cjs.map +0 -1
  266. package/dist/internal/production-runtime.cjs.map +0 -1
  267. package/dist/markdown.cjs.map +0 -1
  268. package/dist/middleware.cjs.map +0 -1
  269. package/dist/navigation.cjs.map +0 -1
  270. package/dist/observability.cjs.map +0 -1
  271. package/dist/plugin.cjs.map +0 -1
  272. package/dist/query/client.cjs.map +0 -1
  273. package/dist/query/index.cjs.map +0 -1
  274. package/dist/query/parsers.cjs.map +0 -1
  275. package/dist/query/server.cjs.map +0 -1
  276. package/dist/renderer/react/client.cjs.map +0 -1
  277. package/dist/renderer/react/server.cjs.map +0 -1
  278. package/dist/renderer/react/vite.cjs.map +0 -1
  279. package/dist/renderer-client.cjs.map +0 -1
  280. package/dist/renderer.cjs.map +0 -1
  281. package/dist/request.cjs.map +0 -1
  282. package/dist/router.cjs.map +0 -1
  283. package/dist/routes.cjs.map +0 -1
  284. package/dist/server-action-security.cjs.map +0 -1
  285. package/dist/server-fn-client.cjs.map +0 -1
  286. package/dist/server-fn.cjs.map +0 -1
  287. package/dist/server-plugins.cjs.map +0 -1
  288. package/dist/server-query-client.cjs.map +0 -1
  289. package/dist/server-query.cjs.map +0 -1
  290. package/dist/server.cjs.map +0 -1
  291. package/dist/storage.cjs.map +0 -1
  292. package/dist/testing.cjs.map +0 -1
  293. package/dist/theme/client.cjs.map +0 -1
  294. package/dist/theme/index.cjs.map +0 -1
  295. package/dist/theme/runtime.cjs.map +0 -1
  296. package/dist/theme/server.cjs.map +0 -1
  297. package/dist/version.cjs.map +0 -1
  298. package/dist/vite.cjs.map +0 -1
  299. package/dist/workflows.cjs.map +0 -1
  300. /package/dist/{chunk-VV24CC42.mjs.map → chunk-35NPLKQJ.mjs.map} +0 -0
  301. /package/dist/{chunk-RWYRFCLG.mjs.map → chunk-4X57GXQA.mjs.map} +0 -0
  302. /package/dist/{chunk-MOW47IF5.mjs.map → chunk-6UYVU46O.mjs.map} +0 -0
  303. /package/dist/{chunk-RLGUZ3HS.mjs.map → chunk-I3OOUWO5.mjs.map} +0 -0
  304. /package/dist/{chunk-ODJGAWDH.mjs.map → chunk-JV7JUD7Q.mjs.map} +0 -0
  305. /package/dist/{chunk-Q3OX763A.mjs.map → chunk-LXDASSTE.mjs.map} +0 -0
  306. /package/dist/{chunk-HVG3HLQZ.mjs.map → chunk-Q7WGOOAI.mjs.map} +0 -0
  307. /package/dist/{chunk-3INDBMUU.mjs.map → chunk-TGDIACZT.mjs.map} +0 -0
  308. /package/dist/{chunk-WMAYETRD.mjs.map → chunk-TT3E2JOF.mjs.map} +0 -0
  309. /package/dist/{chunk-FVAM43KI.mjs.map → chunk-UMUWR5XA.mjs.map} +0 -0
  310. /package/dist/{devtools-S52RRRMN.mjs.map → devtools-XWZX6CCL.mjs.map} +0 -0
  311. /package/dist/{devtools-client-EOVDBPOI.mjs.map → devtools-client-Z7QQA3Q2.mjs.map} +0 -0
package/dist/client.d.mts CHANGED
@@ -1,24 +1,28 @@
1
- import { q as ClientOptions, g as APIResult } from './client-mcMC334J.mjs';
2
- export { s as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, u as ApiClients, D as ClientHeaders, E as ClientLifecycleHooks, G as ClientRequestEvent, H as ClientResponseEvent, a3 as InferIntegrationOperationBody, a4 as InferIntegrationOperationQuery, a5 as InferIntegrationOperationResponse, $ as IntegrationAPI, W as IntegrationClient, X as IntegrationClientAliases, a1 as IntegrationClientData, K as IntegrationClientError, Z as IntegrationClientOptions, _ as IntegrationClientRequestOptions, Y as IntegrationClientRoot, a0 as IntegrationClients, a2 as IntegrationOperationResult, a6 as IntegrationServerClient, a7 as IntegrationServerClientAliases, a8 as IntegrationServerClientOptions, a9 as IntegrationServerClientRequestOptions, aa as IntegrationServerClientRoot, ab as IntegrationServerRequestLike, r as RouteAPIClient, t as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, w as createAPIClient, v as createApiClients, L as createIntegrationApi, J as createIntegrationClient, M as createIntegrationClients, P as createIntegrationServerClient, N as createIntegrations, z as createServerAPIClient, Q as getIntegrationAPIManifest, T as integrationClients, U as integrationsClient, V as integrationsServer } from './client-mcMC334J.mjs';
3
- export { F as FarmAPIStream } from './route-Cq3aObmj.mjs';
1
+ import { q as ClientOptions, g as APIResult } from './client-DWoLZ3QU.mjs';
2
+ export { s as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, u as ApiClients, H as ClientHeaders, J as ClientLifecycleHooks, K as ClientRequestEvent, L as ClientResponseEvent, a6 as InferIntegrationOperationBody, a7 as InferIntegrationOperationQuery, a8 as InferIntegrationOperationResponse, a2 as IntegrationAPI, Z as IntegrationClient, _ as IntegrationClientAliases, a4 as IntegrationClientData, N as IntegrationClientError, a0 as IntegrationClientOptions, a1 as IntegrationClientRequestOptions, $ as IntegrationClientRoot, a3 as IntegrationClients, a5 as IntegrationOperationResult, a9 as IntegrationServerClient, aa as IntegrationServerClientAliases, ab as IntegrationServerClientOptions, ac as IntegrationServerClientRequestOptions, ad as IntegrationServerClientRoot, ae as IntegrationServerRequestLike, r as RouteAPIClient, t as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, w as createAPIClient, v as createApiClients, P as createIntegrationApi, M as createIntegrationClient, Q as createIntegrationClients, U as createIntegrationServerClient, T as createIntegrations, z as createServerAPIClient, V as getIntegrationAPIManifest, W as integrationClients, X as integrationsClient, Y as integrationsServer } from './client-DWoLZ3QU.mjs';
3
+ export { F as FarmAPIStream } from './route-CvEr4Uc9.mjs';
4
4
  import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react';
5
5
  export { RouteActionTarget, UseActionFormProps, UseActionReturn, UseServerFnOptions, useAction } from './server-fn-client.mjs';
6
6
  export { UseServerQueryOptions, UseServerQueryResult, useServerQuery } from './server-query-client.mjs';
7
- export { an as FarmIntegrationAPI, c_ as FarmIntegrationAPIBodyFormat, c$ as FarmIntegrationAPIMethod, ao as FarmIntegrationAPIOperation, d0 as FarmIntegrationAPIResponseFormat, cX as api, cY as defineIntegrationAPI, cZ as defineIntegrationAPIOperation, de as endpoint } from './client-plugins-BvClItiL.mjs';
7
+ export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation, i as endpoint } from './integration-api-BT024nuJ.mjs';
8
8
  export { UseThemeResult, useTheme } from './theme/client.mjs';
9
9
  import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.mjs';
10
- import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-CyLkwst6.mjs';
11
- export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-CyLkwst6.mjs';
10
+ import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-BeyAVSc6.mjs';
11
+ export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-BeyAVSc6.mjs';
12
12
  import { b as FarmI18nLocale } from './types-CnH8DOqo.mjs';
13
13
  export { F as FarmChunkRecoveryOptions, i as installChunkErrorRecovery, a as isChunkLoadError } from './chunk-recovery-lnQFzcQP.mjs';
14
14
  export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './lifecycle-De0vQG45.mjs';
15
- export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-B50KAcj5.mjs';
15
+ export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-aP52iuL5.mjs';
16
16
  export { getTheme, setTheme, toggleTheme } from './theme/runtime.mjs';
17
- import './client-cache-CopR_MaI.mjs';
17
+ import './client-cache-CCK-fCe0.mjs';
18
18
  import './cache.mjs';
19
19
  import './server-fn.mjs';
20
20
  import './server-fn-error-DDh14a0V.mjs';
21
21
  import './server-query.mjs';
22
+ import './types-DQnyD3VD.mjs';
23
+ import './island-CfGru1MO.mjs';
24
+ import './render-plan-DLxJYAA5.mjs';
25
+ import './client-plugins-B6-07YmP.mjs';
22
26
  import './renderer.mjs';
23
27
  import 'http';
24
28
  import './types-Cc8l9IqS.mjs';
@@ -38,12 +42,9 @@ import './navigation-errors-Dvwpzaer.mjs';
38
42
  import './server-action-security.mjs';
39
43
  import 'esbuild';
40
44
  import './image-config-Duob7wER.mjs';
41
- import './types-DQnyD3VD.mjs';
42
45
  import './font.mjs';
43
46
  import './after.mjs';
44
47
  import 'node:http';
45
- import './island-CfGru1MO.mjs';
46
- import './render-plan-CU31j-Jk.mjs';
47
48
 
48
49
  type MutationStatus = "idle" | "pending" | "success" | "error";
49
50
  type AnyMutationTarget = (...args: any[]) => Promise<any>;
@@ -58,14 +59,24 @@ type MutationOptimisticContext<TVariables, TData> = {
58
59
  variables: TVariables | undefined;
59
60
  current: TData | null;
60
61
  };
62
+ type MutationNetworkMode = "always" | "online";
61
63
  type UseMutationOptions<TVariables, TData, TError = Error> = {
62
64
  initialData?: TData | null;
63
65
  resetOnMutate?: boolean;
66
+ /**
67
+ * `"always"` (default) dispatches regardless of connectivity, preserving
68
+ * existing behavior. `"online"` pauses a submission while the browser is
69
+ * offline — including one whose dispatch failed while offline — and resumes
70
+ * it on the `online` event instead of failing it.
71
+ */
72
+ networkMode?: MutationNetworkMode;
64
73
  optimistic?: (context: MutationOptimisticContext<TVariables, TData>) => TData | null | undefined;
65
74
  rollbackOnError?: boolean;
66
75
  /**
67
76
  * Options forwarded to generated `api.route.method` clients.
68
- * Server functions ignore this field.
77
+ * Server-function targets honor `request.retry`, key-targeted
78
+ * `request.optimistic` updates, and key-targeted `request.invalidate`;
79
+ * the remaining request options apply to API routes only.
69
80
  */
70
81
  request?: ClientOptions<TData, TError>;
71
82
  onSuccess?: (data: TData, variables: TVariables | undefined) => void;
@@ -81,6 +92,8 @@ type MutationTrigger<TTarget extends AnyMutationTarget> = [
81
92
  ] extends Parameters<TTarget> ? (variables?: MutationInput<TTarget>) => void : (variables: MutationInput<TTarget>) => void;
82
93
  type UseMutationReturn<TTarget extends AnyMutationTarget, TData = MutationData<TTarget>, TError = MutationError<TTarget>> = {
83
94
  pending: boolean;
95
+ /** True while a submission is waiting for the browser to come back online. */
96
+ paused: boolean;
84
97
  status: MutationStatus;
85
98
  data: TData | null;
86
99
  error: TError | null;
@@ -117,9 +130,9 @@ type UseFetcherOptions<TTarget extends AnyMutationTarget> = Omit<UseMutationOpti
117
130
  /**
118
131
  * Convert browser FormData into the target's typed variables.
119
132
  *
120
- * Generated API routes default to `{ body: Object.fromEntries(formData) }`
121
- * (or `{ query: ... }` for GET/HEAD). Server functions receive FormData
122
- * directly so their input schema remains authoritative.
133
+ * Generated API routes preserve multipart forms and file values as a FormData
134
+ * body; text-only submissions default to a JSON object (or query for GET/HEAD).
135
+ * Server functions receive FormData directly. This mapper overrides defaults.
123
136
  */
124
137
  mapFormData?: (formData: FormData, context: FetcherFormDataContext) => InferMutationVariables<TTarget>;
125
138
  };
@@ -140,6 +153,8 @@ type UseFetcherReturn<TTarget extends AnyMutationTarget> = {
140
153
  state: FetcherState;
141
154
  status: MutationStatus;
142
155
  pending: boolean;
156
+ /** True while a submission is waiting for the browser to come back online. */
157
+ paused: boolean;
143
158
  data: InferMutationData<TTarget> | null;
144
159
  error: InferMutationError<TTarget> | FetcherInputError | null;
145
160
  variables: InferMutationVariables<TTarget> | undefined;
@@ -157,6 +172,99 @@ type UseFetcherReturn<TTarget extends AnyMutationTarget> = {
157
172
  */
158
173
  declare function useFetcher<TTarget extends AnyMutationTarget>(target: TTarget, options?: UseFetcherOptions<TTarget>): UseFetcherReturn<TTarget>;
159
174
 
175
+ declare const FARM_CACHE_INVALIDATION_CHANNEL = "farm:cache-invalidation";
176
+ type CrossTabCacheInvalidationOptions = {
177
+ /** Override the BroadcastChannel name, e.g. to isolate multiple apps on one origin. */
178
+ channelName?: string;
179
+ };
180
+ /**
181
+ * Bridge the cache invalidation bus across tabs of the same origin.
182
+ *
183
+ * Local invalidations are posted to a BroadcastChannel and applied in every
184
+ * other tab through the normal invalidation path, so mounted stale queries
185
+ * there refetch on their own. Only invalidation keys cross the channel, never
186
+ * cached data, which keeps private and credentialed cache scoping untouched.
187
+ *
188
+ * Opt-in and idempotent. Returns a disposer; a no-op where BroadcastChannel
189
+ * is unavailable (server rendering, older browsers).
190
+ */
191
+ declare function enableCrossTabCacheInvalidation(options?: CrossTabCacheInvalidationOptions): () => void;
192
+
193
+ /**
194
+ * Protocol version stamped into every persisted entry. Bump when the
195
+ * persisted shape changes; mismatched entries are dropped on load.
196
+ */
197
+ declare const FARM_CLIENT_CACHE_PERSIST_VERSION = "1";
198
+ /** Snapshot of a confirmed cache entry as stored by an adapter. */
199
+ type PersistedEntry = {
200
+ data: unknown;
201
+ updatedAt: number;
202
+ staleAt: number;
203
+ gcAt?: number;
204
+ version: string;
205
+ };
206
+ /**
207
+ * Storage contract for client cache persistence. Implement these callbacks
208
+ * over any storage: IndexedDB, localStorage, OPFS, a native bridge. Farm owns
209
+ * every policy decision (what, when, and whether to persist); the adapter is
210
+ * plain keyed storage. `set` is an upsert.
211
+ */
212
+ type FarmClientCacheAdapter = {
213
+ keys(): Promise<string[]>;
214
+ get(key: string): Promise<PersistedEntry | null>;
215
+ set(key: string, entry: PersistedEntry): Promise<void>;
216
+ delete(key: string): Promise<void>;
217
+ clear(): Promise<void>;
218
+ /** Optional batch fast paths; the engine prefers them when present. */
219
+ getMany?(keys: string[]): Promise<Array<PersistedEntry | null>>;
220
+ setMany?(entries: Array<[string, PersistedEntry]>): Promise<void>;
221
+ };
222
+ /** Key-value client shape accepted by {@link storageClientCacheAdapter}. */
223
+ type FarmClientCacheStorage = {
224
+ getItem<T = unknown>(key: string): Promise<T | null>;
225
+ setItem<T = unknown>(key: string, value: T): Promise<unknown>;
226
+ removeItem(key: string): Promise<unknown>;
227
+ getKeys?(base?: string): Promise<string[]>;
228
+ keys?(base?: string): Promise<string[]>;
229
+ clear?(base?: string): Promise<unknown>;
230
+ };
231
+ type ClientCachePersistenceOptions = {
232
+ /**
233
+ * Extra version salt, typically an app build or deploy id. Entries written
234
+ * under a different value are dropped on load.
235
+ */
236
+ version?: string;
237
+ /** Coarse additional filter on top of per-declaration `persist: true`. */
238
+ persistKey?: (key: string) => boolean;
239
+ /** Debounce for write-behind flushes. */
240
+ flushDelayMs?: number;
241
+ };
242
+ /**
243
+ * Validate and type an adapter definition. Identity at runtime beyond shape
244
+ * checking, mirroring `defineConfig`-style helpers.
245
+ */
246
+ declare function defineClientCacheAdapter(adapter: FarmClientCacheAdapter): FarmClientCacheAdapter;
247
+ /**
248
+ * Adapt any Farm/unstorage-compatible key-value client to the client cache
249
+ * adapter contract, mirroring the server's `storageCacheAdapter`. Without a
250
+ * key enumeration method the adapter still persists but cannot warm-start.
251
+ */
252
+ declare function storageClientCacheAdapter(storage: FarmClientCacheStorage, options?: {
253
+ base?: string;
254
+ }): FarmClientCacheAdapter;
255
+ /**
256
+ * @internal Wire an adapter to the shared client cache. Called by the
257
+ * generated client entry from the `cache.client.adapter` configuration; not
258
+ * part of the public API. Returns a disposer.
259
+ */
260
+ declare function initPersistedClientCache(adapter: FarmClientCacheAdapter, options?: ClientCachePersistenceOptions): () => void;
261
+ /**
262
+ * Remove every persisted cache entry. Call on logout or any session change so
263
+ * the next visitor on this device cannot warm-start into another user's data.
264
+ * Safe to call when persistence is not configured.
265
+ */
266
+ declare function clearPersistedCache(): Promise<void>;
267
+
160
268
  type StoreState = Record<string, any>;
161
269
  type StoreValueUpdater<T> = T | ((previous: T) => T);
162
270
  type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
@@ -349,4 +457,4 @@ declare function useNavigation(): FarmNavigationState;
349
457
  declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
350
458
  declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement | null>;
351
459
 
352
- export { type AnyMutationTarget, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FarmNavigationBlockerContext, FarmNavigationState, FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, FetcherInputError, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkExternalUriSchemes, type LinkProps, type MutationAsync, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, createStore, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
460
+ export { type AnyMutationTarget, type ClientCachePersistenceOptions, type CrossTabCacheInvalidationOptions, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FARM_CACHE_INVALIDATION_CHANNEL, FARM_CLIENT_CACHE_PERSIST_VERSION, type FarmClientCacheAdapter, type FarmClientCacheStorage, FarmNavigationBlockerContext, FarmNavigationState, FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, FetcherInputError, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkExternalUriSchemes, type LinkProps, type MutationAsync, type MutationNetworkMode, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PersistedEntry, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, clearPersistedCache, createStore, defineClientCacheAdapter, enableCrossTabCacheInvalidation, initPersistedClientCache, storageClientCacheAdapter, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
package/dist/client.d.ts CHANGED
@@ -1,24 +1,28 @@
1
- import { q as ClientOptions, g as APIResult } from './client-d5ONQ-Pd.js';
2
- export { s as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, u as ApiClients, D as ClientHeaders, E as ClientLifecycleHooks, G as ClientRequestEvent, H as ClientResponseEvent, a3 as InferIntegrationOperationBody, a4 as InferIntegrationOperationQuery, a5 as InferIntegrationOperationResponse, $ as IntegrationAPI, W as IntegrationClient, X as IntegrationClientAliases, a1 as IntegrationClientData, K as IntegrationClientError, Z as IntegrationClientOptions, _ as IntegrationClientRequestOptions, Y as IntegrationClientRoot, a0 as IntegrationClients, a2 as IntegrationOperationResult, a6 as IntegrationServerClient, a7 as IntegrationServerClientAliases, a8 as IntegrationServerClientOptions, a9 as IntegrationServerClientRequestOptions, aa as IntegrationServerClientRoot, ab as IntegrationServerRequestLike, r as RouteAPIClient, t as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, w as createAPIClient, v as createApiClients, L as createIntegrationApi, J as createIntegrationClient, M as createIntegrationClients, P as createIntegrationServerClient, N as createIntegrations, z as createServerAPIClient, Q as getIntegrationAPIManifest, T as integrationClients, U as integrationsClient, V as integrationsServer } from './client-d5ONQ-Pd.js';
3
- export { F as FarmAPIStream } from './route-Y8lfz1wF.js';
1
+ import { q as ClientOptions, g as APIResult } from './client-DuQuQC1h.js';
2
+ export { s as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, u as ApiClients, H as ClientHeaders, J as ClientLifecycleHooks, K as ClientRequestEvent, L as ClientResponseEvent, a6 as InferIntegrationOperationBody, a7 as InferIntegrationOperationQuery, a8 as InferIntegrationOperationResponse, a2 as IntegrationAPI, Z as IntegrationClient, _ as IntegrationClientAliases, a4 as IntegrationClientData, N as IntegrationClientError, a0 as IntegrationClientOptions, a1 as IntegrationClientRequestOptions, $ as IntegrationClientRoot, a3 as IntegrationClients, a5 as IntegrationOperationResult, a9 as IntegrationServerClient, aa as IntegrationServerClientAliases, ab as IntegrationServerClientOptions, ac as IntegrationServerClientRequestOptions, ad as IntegrationServerClientRoot, ae as IntegrationServerRequestLike, r as RouteAPIClient, t as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, w as createAPIClient, v as createApiClients, P as createIntegrationApi, M as createIntegrationClient, Q as createIntegrationClients, U as createIntegrationServerClient, T as createIntegrations, z as createServerAPIClient, V as getIntegrationAPIManifest, W as integrationClients, X as integrationsClient, Y as integrationsServer } from './client-DuQuQC1h.js';
3
+ export { F as FarmAPIStream } from './route-4pd-EVtw.js';
4
4
  import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react';
5
5
  export { RouteActionTarget, UseActionFormProps, UseActionReturn, UseServerFnOptions, useAction } from './server-fn-client.js';
6
6
  export { UseServerQueryOptions, UseServerQueryResult, useServerQuery } from './server-query-client.js';
7
- export { an as FarmIntegrationAPI, c_ as FarmIntegrationAPIBodyFormat, c$ as FarmIntegrationAPIMethod, ao as FarmIntegrationAPIOperation, d0 as FarmIntegrationAPIResponseFormat, cX as api, cY as defineIntegrationAPI, cZ as defineIntegrationAPIOperation, de as endpoint } from './client-plugins-B9Sq-iMg.js';
7
+ export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation, i as endpoint } from './integration-api-BT024nuJ.js';
8
8
  export { UseThemeResult, useTheme } from './theme/client.js';
9
9
  import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.js';
10
- import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-BkqGXaV_.js';
11
- export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-BkqGXaV_.js';
10
+ import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-COgu4txb.js';
11
+ export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-COgu4txb.js';
12
12
  import { b as FarmI18nLocale } from './types-CnH8DOqo.js';
13
13
  export { F as FarmChunkRecoveryOptions, i as installChunkErrorRecovery, a as isChunkLoadError } from './chunk-recovery-lnQFzcQP.js';
14
14
  export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './lifecycle-De0vQG45.js';
15
- export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-3zAj77yv.js';
15
+ export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-DXRNhX_3.js';
16
16
  export { getTheme, setTheme, toggleTheme } from './theme/runtime.js';
17
- import './client-cache-Djy_TlE8.js';
17
+ import './client-cache-BMxuFqwH.js';
18
18
  import './cache.js';
19
19
  import './server-fn.js';
20
20
  import './server-fn-error-DDh14a0V.js';
21
21
  import './server-query.js';
22
+ import './types-DQnyD3VD.js';
23
+ import './island-CfGru1MO.js';
24
+ import './render-plan-0GeHiGVZ.js';
25
+ import './client-plugins-By6MVUX-.js';
22
26
  import './renderer.js';
23
27
  import 'http';
24
28
  import './types-Cc8l9IqS.js';
@@ -38,12 +42,9 @@ import './navigation-errors-Dvwpzaer.js';
38
42
  import './server-action-security.js';
39
43
  import 'esbuild';
40
44
  import './image-config-Duob7wER.js';
41
- import './types-DQnyD3VD.js';
42
45
  import './font.js';
43
46
  import './after.js';
44
47
  import 'node:http';
45
- import './island-CfGru1MO.js';
46
- import './render-plan-Dc8CjNI7.js';
47
48
 
48
49
  type MutationStatus = "idle" | "pending" | "success" | "error";
49
50
  type AnyMutationTarget = (...args: any[]) => Promise<any>;
@@ -58,14 +59,24 @@ type MutationOptimisticContext<TVariables, TData> = {
58
59
  variables: TVariables | undefined;
59
60
  current: TData | null;
60
61
  };
62
+ type MutationNetworkMode = "always" | "online";
61
63
  type UseMutationOptions<TVariables, TData, TError = Error> = {
62
64
  initialData?: TData | null;
63
65
  resetOnMutate?: boolean;
66
+ /**
67
+ * `"always"` (default) dispatches regardless of connectivity, preserving
68
+ * existing behavior. `"online"` pauses a submission while the browser is
69
+ * offline — including one whose dispatch failed while offline — and resumes
70
+ * it on the `online` event instead of failing it.
71
+ */
72
+ networkMode?: MutationNetworkMode;
64
73
  optimistic?: (context: MutationOptimisticContext<TVariables, TData>) => TData | null | undefined;
65
74
  rollbackOnError?: boolean;
66
75
  /**
67
76
  * Options forwarded to generated `api.route.method` clients.
68
- * Server functions ignore this field.
77
+ * Server-function targets honor `request.retry`, key-targeted
78
+ * `request.optimistic` updates, and key-targeted `request.invalidate`;
79
+ * the remaining request options apply to API routes only.
69
80
  */
70
81
  request?: ClientOptions<TData, TError>;
71
82
  onSuccess?: (data: TData, variables: TVariables | undefined) => void;
@@ -81,6 +92,8 @@ type MutationTrigger<TTarget extends AnyMutationTarget> = [
81
92
  ] extends Parameters<TTarget> ? (variables?: MutationInput<TTarget>) => void : (variables: MutationInput<TTarget>) => void;
82
93
  type UseMutationReturn<TTarget extends AnyMutationTarget, TData = MutationData<TTarget>, TError = MutationError<TTarget>> = {
83
94
  pending: boolean;
95
+ /** True while a submission is waiting for the browser to come back online. */
96
+ paused: boolean;
84
97
  status: MutationStatus;
85
98
  data: TData | null;
86
99
  error: TError | null;
@@ -117,9 +130,9 @@ type UseFetcherOptions<TTarget extends AnyMutationTarget> = Omit<UseMutationOpti
117
130
  /**
118
131
  * Convert browser FormData into the target's typed variables.
119
132
  *
120
- * Generated API routes default to `{ body: Object.fromEntries(formData) }`
121
- * (or `{ query: ... }` for GET/HEAD). Server functions receive FormData
122
- * directly so their input schema remains authoritative.
133
+ * Generated API routes preserve multipart forms and file values as a FormData
134
+ * body; text-only submissions default to a JSON object (or query for GET/HEAD).
135
+ * Server functions receive FormData directly. This mapper overrides defaults.
123
136
  */
124
137
  mapFormData?: (formData: FormData, context: FetcherFormDataContext) => InferMutationVariables<TTarget>;
125
138
  };
@@ -140,6 +153,8 @@ type UseFetcherReturn<TTarget extends AnyMutationTarget> = {
140
153
  state: FetcherState;
141
154
  status: MutationStatus;
142
155
  pending: boolean;
156
+ /** True while a submission is waiting for the browser to come back online. */
157
+ paused: boolean;
143
158
  data: InferMutationData<TTarget> | null;
144
159
  error: InferMutationError<TTarget> | FetcherInputError | null;
145
160
  variables: InferMutationVariables<TTarget> | undefined;
@@ -157,6 +172,99 @@ type UseFetcherReturn<TTarget extends AnyMutationTarget> = {
157
172
  */
158
173
  declare function useFetcher<TTarget extends AnyMutationTarget>(target: TTarget, options?: UseFetcherOptions<TTarget>): UseFetcherReturn<TTarget>;
159
174
 
175
+ declare const FARM_CACHE_INVALIDATION_CHANNEL = "farm:cache-invalidation";
176
+ type CrossTabCacheInvalidationOptions = {
177
+ /** Override the BroadcastChannel name, e.g. to isolate multiple apps on one origin. */
178
+ channelName?: string;
179
+ };
180
+ /**
181
+ * Bridge the cache invalidation bus across tabs of the same origin.
182
+ *
183
+ * Local invalidations are posted to a BroadcastChannel and applied in every
184
+ * other tab through the normal invalidation path, so mounted stale queries
185
+ * there refetch on their own. Only invalidation keys cross the channel, never
186
+ * cached data, which keeps private and credentialed cache scoping untouched.
187
+ *
188
+ * Opt-in and idempotent. Returns a disposer; a no-op where BroadcastChannel
189
+ * is unavailable (server rendering, older browsers).
190
+ */
191
+ declare function enableCrossTabCacheInvalidation(options?: CrossTabCacheInvalidationOptions): () => void;
192
+
193
+ /**
194
+ * Protocol version stamped into every persisted entry. Bump when the
195
+ * persisted shape changes; mismatched entries are dropped on load.
196
+ */
197
+ declare const FARM_CLIENT_CACHE_PERSIST_VERSION = "1";
198
+ /** Snapshot of a confirmed cache entry as stored by an adapter. */
199
+ type PersistedEntry = {
200
+ data: unknown;
201
+ updatedAt: number;
202
+ staleAt: number;
203
+ gcAt?: number;
204
+ version: string;
205
+ };
206
+ /**
207
+ * Storage contract for client cache persistence. Implement these callbacks
208
+ * over any storage: IndexedDB, localStorage, OPFS, a native bridge. Farm owns
209
+ * every policy decision (what, when, and whether to persist); the adapter is
210
+ * plain keyed storage. `set` is an upsert.
211
+ */
212
+ type FarmClientCacheAdapter = {
213
+ keys(): Promise<string[]>;
214
+ get(key: string): Promise<PersistedEntry | null>;
215
+ set(key: string, entry: PersistedEntry): Promise<void>;
216
+ delete(key: string): Promise<void>;
217
+ clear(): Promise<void>;
218
+ /** Optional batch fast paths; the engine prefers them when present. */
219
+ getMany?(keys: string[]): Promise<Array<PersistedEntry | null>>;
220
+ setMany?(entries: Array<[string, PersistedEntry]>): Promise<void>;
221
+ };
222
+ /** Key-value client shape accepted by {@link storageClientCacheAdapter}. */
223
+ type FarmClientCacheStorage = {
224
+ getItem<T = unknown>(key: string): Promise<T | null>;
225
+ setItem<T = unknown>(key: string, value: T): Promise<unknown>;
226
+ removeItem(key: string): Promise<unknown>;
227
+ getKeys?(base?: string): Promise<string[]>;
228
+ keys?(base?: string): Promise<string[]>;
229
+ clear?(base?: string): Promise<unknown>;
230
+ };
231
+ type ClientCachePersistenceOptions = {
232
+ /**
233
+ * Extra version salt, typically an app build or deploy id. Entries written
234
+ * under a different value are dropped on load.
235
+ */
236
+ version?: string;
237
+ /** Coarse additional filter on top of per-declaration `persist: true`. */
238
+ persistKey?: (key: string) => boolean;
239
+ /** Debounce for write-behind flushes. */
240
+ flushDelayMs?: number;
241
+ };
242
+ /**
243
+ * Validate and type an adapter definition. Identity at runtime beyond shape
244
+ * checking, mirroring `defineConfig`-style helpers.
245
+ */
246
+ declare function defineClientCacheAdapter(adapter: FarmClientCacheAdapter): FarmClientCacheAdapter;
247
+ /**
248
+ * Adapt any Farm/unstorage-compatible key-value client to the client cache
249
+ * adapter contract, mirroring the server's `storageCacheAdapter`. Without a
250
+ * key enumeration method the adapter still persists but cannot warm-start.
251
+ */
252
+ declare function storageClientCacheAdapter(storage: FarmClientCacheStorage, options?: {
253
+ base?: string;
254
+ }): FarmClientCacheAdapter;
255
+ /**
256
+ * @internal Wire an adapter to the shared client cache. Called by the
257
+ * generated client entry from the `cache.client.adapter` configuration; not
258
+ * part of the public API. Returns a disposer.
259
+ */
260
+ declare function initPersistedClientCache(adapter: FarmClientCacheAdapter, options?: ClientCachePersistenceOptions): () => void;
261
+ /**
262
+ * Remove every persisted cache entry. Call on logout or any session change so
263
+ * the next visitor on this device cannot warm-start into another user's data.
264
+ * Safe to call when persistence is not configured.
265
+ */
266
+ declare function clearPersistedCache(): Promise<void>;
267
+
160
268
  type StoreState = Record<string, any>;
161
269
  type StoreValueUpdater<T> = T | ((previous: T) => T);
162
270
  type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
@@ -349,4 +457,4 @@ declare function useNavigation(): FarmNavigationState;
349
457
  declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
350
458
  declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement | null>;
351
459
 
352
- export { type AnyMutationTarget, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FarmNavigationBlockerContext, FarmNavigationState, FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, FetcherInputError, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkExternalUriSchemes, type LinkProps, type MutationAsync, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, createStore, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
460
+ export { type AnyMutationTarget, type ClientCachePersistenceOptions, type CrossTabCacheInvalidationOptions, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FARM_CACHE_INVALIDATION_CHANNEL, FARM_CLIENT_CACHE_PERSIST_VERSION, type FarmClientCacheAdapter, type FarmClientCacheStorage, FarmNavigationBlockerContext, FarmNavigationState, FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, FetcherInputError, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkExternalUriSchemes, type LinkProps, type MutationAsync, type MutationNetworkMode, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PersistedEntry, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, clearPersistedCache, createStore, defineClientCacheAdapter, enableCrossTabCacheInvalidation, initPersistedClientCache, storageClientCacheAdapter, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
package/dist/client.mjs CHANGED
@@ -1,23 +1,30 @@
1
1
  import {
2
+ FARM_CACHE_INVALIDATION_CHANNEL,
3
+ FARM_CLIENT_CACHE_PERSIST_VERSION,
2
4
  FetcherInputError,
3
5
  Link,
6
+ clearPersistedCache,
4
7
  createStore,
8
+ defineClientCacheAdapter,
9
+ enableCrossTabCacheInvalidation,
10
+ initPersistedClientCache,
11
+ storageClientCacheAdapter,
5
12
  useFetcher,
6
13
  useMutation
7
- } from "./chunk-LZTGDH3H.mjs";
14
+ } from "./chunk-EPDIF432.mjs";
8
15
  import {
9
16
  useAction
10
- } from "./chunk-RAGSHKDC.mjs";
17
+ } from "./chunk-6EJHNHH4.mjs";
11
18
  import {
12
19
  useServerQuery
13
- } from "./chunk-3I55IGXU.mjs";
20
+ } from "./chunk-52BR7LTX.mjs";
14
21
  import {
15
22
  useBlocker,
16
23
  useNavigation,
17
24
  usePageState,
18
25
  useRouter,
19
26
  useScrollRestoration
20
- } from "./chunk-MOW47IF5.mjs";
27
+ } from "./chunk-6UYVU46O.mjs";
21
28
  import {
22
29
  useTheme
23
30
  } from "./chunk-CHITERV2.mjs";
@@ -36,12 +43,12 @@ import {
36
43
  integrationClients,
37
44
  integrationsClient,
38
45
  integrationsServer
39
- } from "./chunk-LKKMI7JG.mjs";
46
+ } from "./chunk-IZBX2TEU.mjs";
40
47
  import "./chunk-DU3PKDVQ.mjs";
41
48
  import {
42
49
  fetchServerQuery,
43
50
  prefetchServerQuery
44
- } from "./chunk-VOUJW4FL.mjs";
51
+ } from "./chunk-WD2EBM3I.mjs";
45
52
  import {
46
53
  getTheme,
47
54
  setTheme,
@@ -56,17 +63,17 @@ import {
56
63
  pushState,
57
64
  readPageState,
58
65
  replaceState
59
- } from "./chunk-MRVJCLYQ.mjs";
66
+ } from "./chunk-PSQ7N4XP.mjs";
60
67
  import "./chunk-ULD4ENAH.mjs";
61
68
  import "./chunk-JIT7GXDP.mjs";
62
- import "./chunk-ZPG6SNHH.mjs";
63
- import "./chunk-SCFX4UTD.mjs";
69
+ import "./chunk-WMJGA32P.mjs";
70
+ import "./chunk-EHTUKVSW.mjs";
64
71
  import {
65
72
  FarmClientPluginManager,
66
73
  createClientPluginManager,
67
74
  installChunkErrorRecovery,
68
75
  isChunkLoadError
69
- } from "./chunk-FVAM43KI.mjs";
76
+ } from "./chunk-UMUWR5XA.mjs";
70
77
  import "./chunk-RCNUKRBF.mjs";
71
78
  import "./chunk-GQVQESLY.mjs";
72
79
  import {
@@ -80,12 +87,12 @@ import "./chunk-V4VRLVLW.mjs";
80
87
  import "./chunk-6YPPIPKR.mjs";
81
88
  import "./chunk-3BXGOVKE.mjs";
82
89
  import "./chunk-4C3Z34O7.mjs";
83
- import "./chunk-AXVJCMVF.mjs";
84
- import "./chunk-RBRLLZL5.mjs";
90
+ import "./chunk-2HDOV47R.mjs";
91
+ import "./chunk-34IAPZBG.mjs";
85
92
  import "./chunk-WZ5QFROO.mjs";
86
- import "./chunk-ZRBCBOEX.mjs";
93
+ import "./chunk-N2FY2QZ7.mjs";
87
94
  import "./chunk-FXG2PS27.mjs";
88
- import "./chunk-74QPONAN.mjs";
95
+ import "./chunk-J3MPQ4MQ.mjs";
89
96
  import "./chunk-LM2YNO4U.mjs";
90
97
  import "./chunk-W4ZNS76E.mjs";
91
98
  import "./chunk-IBULMPCM.mjs";
@@ -93,12 +100,15 @@ import "./chunk-DZU3EKQP.mjs";
93
100
  import "./chunk-CGILA3WO.mjs";
94
101
  export {
95
102
  APIClientError,
103
+ FARM_CACHE_INVALIDATION_CHANNEL,
104
+ FARM_CLIENT_CACHE_PERSIST_VERSION,
96
105
  FarmClientPluginManager,
97
106
  FetcherInputError,
98
107
  IntegrationClientError,
99
108
  Link,
100
109
  SPARouter,
101
110
  api,
111
+ clearPersistedCache,
102
112
  createAPIClient,
103
113
  createApiClients,
104
114
  createClientPluginManager,
@@ -109,13 +119,16 @@ export {
109
119
  createIntegrations,
110
120
  createServerAPIClient,
111
121
  createStore,
122
+ defineClientCacheAdapter,
112
123
  defineIntegrationAPI,
113
124
  defineIntegrationAPIOperation,
125
+ enableCrossTabCacheInvalidation,
114
126
  endpoint,
115
127
  fetchServerQuery,
116
128
  getIntegrationAPIManifest,
117
129
  getRouter,
118
130
  getTheme,
131
+ initPersistedClientCache,
119
132
  installChunkErrorRecovery,
120
133
  integrationClients,
121
134
  integrationsClient,
@@ -128,6 +141,7 @@ export {
128
141
  readPageState,
129
142
  replaceState,
130
143
  setTheme,
144
+ storageClientCacheAdapter,
131
145
  toggleTheme,
132
146
  useAction,
133
147
  useBlocker,
package/dist/config.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { m as FarmUserConfig } from './client-plugins-BvClItiL.mjs';
1
+ import { m as FarmUserConfig } from './client-plugins-B6-07YmP.mjs';
2
2
  import './lifecycle-De0vQG45.mjs';
3
- import './route-Cq3aObmj.mjs';
3
+ import './route-CvEr4Uc9.mjs';
4
4
  import './cache.mjs';
5
5
  import './renderer.mjs';
6
6
  import 'http';
@@ -8,6 +8,7 @@ import './types-Cc8l9IqS.mjs';
8
8
  import 'db0';
9
9
  import 'unstorage';
10
10
  import 'react';
11
+ import './integration-api-BT024nuJ.mjs';
11
12
  import '@farming-labs/orm';
12
13
  import './types-CKwggz9n.mjs';
13
14
  import '@farming-labs/docs';
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { m as FarmUserConfig } from './client-plugins-B9Sq-iMg.js';
1
+ import { m as FarmUserConfig } from './client-plugins-By6MVUX-.js';
2
2
  import './lifecycle-De0vQG45.js';
3
- import './route-Y8lfz1wF.js';
3
+ import './route-4pd-EVtw.js';
4
4
  import './cache.js';
5
5
  import './renderer.js';
6
6
  import 'http';
@@ -8,6 +8,7 @@ import './types-Cc8l9IqS.js';
8
8
  import 'db0';
9
9
  import 'unstorage';
10
10
  import 'react';
11
+ import './integration-api-BT024nuJ.js';
11
12
  import '@farming-labs/orm';
12
13
  import './types-CKwggz9n.js';
13
14
  import '@farming-labs/docs';
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getDeployTargetForPreset
3
- } from "./chunk-TKQCJMY7.mjs";
3
+ } from "./chunk-X4SFHKFH.mjs";
4
4
  import "./chunk-UVCIEUJC.mjs";
5
5
  import "./chunk-CG4GPK3Z.mjs";
6
6
  import "./chunk-YKAUAZA4.mjs";
7
- import "./chunk-7MABZJIM.mjs";
7
+ import "./chunk-7PYVLJ4J.mjs";
8
8
  import "./chunk-7T2QYWDH.mjs";
9
9
  import "./chunk-5EZRXIFH.mjs";
10
10
  import "./chunk-7ZVN3YZI.mjs";
@@ -16,7 +16,7 @@ import "./chunk-2SKCXYLB.mjs";
16
16
  import {
17
17
  resolveCronConfig
18
18
  } from "./chunk-BZAIS65C.mjs";
19
- import "./chunk-VV24CC42.mjs";
19
+ import "./chunk-35NPLKQJ.mjs";
20
20
  import "./chunk-H53KVQUU.mjs";
21
21
  import "./chunk-AAC66ILR.mjs";
22
22
  import "./chunk-STV7A2LH.mjs";
@@ -33,7 +33,7 @@ import "./chunk-ZHQMHJAV.mjs";
33
33
  import "./chunk-HKXMMPYI.mjs";
34
34
  import "./chunk-6YPPIPKR.mjs";
35
35
  import "./chunk-3BXGOVKE.mjs";
36
- import "./chunk-RBRLLZL5.mjs";
36
+ import "./chunk-34IAPZBG.mjs";
37
37
  import "./chunk-OMQWEX4N.mjs";
38
38
  import "./chunk-QALB4BF5.mjs";
39
39
  import "./chunk-W4ZNS76E.mjs";
@@ -381,4 +381,4 @@ __name(createFarmDevtoolsSnapshot, "createFarmDevtoolsSnapshot");
381
381
  export {
382
382
  createFarmDevtoolsSnapshot
383
383
  };
384
- //# sourceMappingURL=devtools-S52RRRMN.mjs.map
384
+ //# sourceMappingURL=devtools-XWZX6CCL.mjs.map