@farm.js/core 0.1.0-beta.4 → 0.1.0-beta.6

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 (441) hide show
  1. package/dist/internal/build-runtime.cjs +1 -1
  2. package/dist/internal/build-runtime.cjs.map +1 -1
  3. package/dist/internal/build-runtime.mjs +5 -5
  4. package/dist/plugin.cjs.map +1 -1
  5. package/dist/plugin.mjs +4 -4
  6. package/dist/server-query-client.cjs +1 -1
  7. package/dist/server-query-client.cjs.map +1 -1
  8. package/dist/server-query-client.mjs +1 -1
  9. package/dist/server.cjs +1 -1
  10. package/dist/server.cjs.map +1 -1
  11. package/dist/server.mjs +4 -4
  12. package/dist/version.cjs +1 -1
  13. package/dist/version.cjs.map +1 -1
  14. package/dist/version.mjs +1 -1
  15. package/dist/vite.cjs +1 -1
  16. package/dist/vite.cjs.map +1 -1
  17. package/dist/vite.mjs +4 -4
  18. package/package.json +1 -1
  19. package/dist/after.cjs +0 -227
  20. package/dist/after.cjs.map +0 -1
  21. package/dist/after.d.mts +0 -25
  22. package/dist/after.d.ts +0 -25
  23. package/dist/after.mjs +0 -14
  24. package/dist/after.mjs.map +0 -1
  25. package/dist/agent-runtime.cjs +0 -2379
  26. package/dist/agent-runtime.cjs.map +0 -1
  27. package/dist/agent-runtime.d.mts +0 -94
  28. package/dist/agent-runtime.d.ts +0 -94
  29. package/dist/agent-runtime.mjs +0 -479
  30. package/dist/agent-runtime.mjs.map +0 -1
  31. package/dist/api/route-manager.d.mts +0 -66
  32. package/dist/api/route-manager.d.ts +0 -66
  33. package/dist/api/runtime.d.mts +0 -3
  34. package/dist/api/runtime.d.ts +0 -3
  35. package/dist/api.cjs +0 -4100
  36. package/dist/api.cjs.map +0 -1
  37. package/dist/api.d.mts +0 -48
  38. package/dist/api.d.ts +0 -48
  39. package/dist/api.mjs +0 -93
  40. package/dist/api.mjs.map +0 -1
  41. package/dist/app-BjN-da13.d.ts +0 -300
  42. package/dist/app-CakAr8Be.d.mts +0 -300
  43. package/dist/app-markdown.cjs +0 -220
  44. package/dist/app-markdown.cjs.map +0 -1
  45. package/dist/app-markdown.d.mts +0 -22
  46. package/dist/app-markdown.d.ts +0 -22
  47. package/dist/app-markdown.mjs +0 -26
  48. package/dist/app-markdown.mjs.map +0 -1
  49. package/dist/cache.cjs +0 -945
  50. package/dist/cache.cjs.map +0 -1
  51. package/dist/cache.d.mts +0 -192
  52. package/dist/cache.d.ts +0 -192
  53. package/dist/cache.mjs +0 -46
  54. package/dist/cache.mjs.map +0 -1
  55. package/dist/chunk-2CUKEMVR.mjs +0 -872
  56. package/dist/chunk-2CUKEMVR.mjs.map +0 -1
  57. package/dist/chunk-2ED5Q2GH.mjs +0 -422
  58. package/dist/chunk-2ED5Q2GH.mjs.map +0 -1
  59. package/dist/chunk-32W4QEJP.mjs +0 -158
  60. package/dist/chunk-32W4QEJP.mjs.map +0 -1
  61. package/dist/chunk-3U3ZUQAQ.mjs +0 -41
  62. package/dist/chunk-3U3ZUQAQ.mjs.map +0 -1
  63. package/dist/chunk-3XNTL3FQ.mjs +0 -452
  64. package/dist/chunk-3XNTL3FQ.mjs.map +0 -1
  65. package/dist/chunk-44ZCFSKE.mjs +0 -84
  66. package/dist/chunk-44ZCFSKE.mjs.map +0 -1
  67. package/dist/chunk-4S3ORGFA.mjs +0 -44
  68. package/dist/chunk-4S3ORGFA.mjs.map +0 -1
  69. package/dist/chunk-5BY76U2M.mjs +0 -1
  70. package/dist/chunk-5BY76U2M.mjs.map +0 -1
  71. package/dist/chunk-5ZGPRGWV.mjs +0 -136
  72. package/dist/chunk-5ZGPRGWV.mjs.map +0 -1
  73. package/dist/chunk-65A7QIKI.mjs +0 -142
  74. package/dist/chunk-65A7QIKI.mjs.map +0 -1
  75. package/dist/chunk-74YTBPTY.mjs +0 -450
  76. package/dist/chunk-74YTBPTY.mjs.map +0 -1
  77. package/dist/chunk-7HO6AEOP.mjs +0 -74
  78. package/dist/chunk-7HO6AEOP.mjs.map +0 -1
  79. package/dist/chunk-7MABZJIM.mjs +0 -29
  80. package/dist/chunk-7MABZJIM.mjs.map +0 -1
  81. package/dist/chunk-7ZY5AIJO.mjs +0 -161
  82. package/dist/chunk-7ZY5AIJO.mjs.map +0 -1
  83. package/dist/chunk-AJWRO5WE.mjs +0 -6241
  84. package/dist/chunk-AJWRO5WE.mjs.map +0 -1
  85. package/dist/chunk-ALCLXXTY.mjs +0 -187
  86. package/dist/chunk-ALCLXXTY.mjs.map +0 -1
  87. package/dist/chunk-AOBXKNS5.mjs +0 -7631
  88. package/dist/chunk-AOBXKNS5.mjs.map +0 -1
  89. package/dist/chunk-AZ7YUVNR.mjs +0 -65
  90. package/dist/chunk-AZ7YUVNR.mjs.map +0 -1
  91. package/dist/chunk-B232I2GP.mjs +0 -163
  92. package/dist/chunk-B232I2GP.mjs.map +0 -1
  93. package/dist/chunk-BHG3LVHH.mjs +0 -176
  94. package/dist/chunk-BHG3LVHH.mjs.map +0 -1
  95. package/dist/chunk-C2ROET2V.mjs +0 -718
  96. package/dist/chunk-C2ROET2V.mjs.map +0 -1
  97. package/dist/chunk-C3DLZMBU.mjs +0 -597
  98. package/dist/chunk-C3DLZMBU.mjs.map +0 -1
  99. package/dist/chunk-CGILA3WO.mjs +0 -14
  100. package/dist/chunk-CGILA3WO.mjs.map +0 -1
  101. package/dist/chunk-E2MPIBRE.mjs +0 -149
  102. package/dist/chunk-E2MPIBRE.mjs.map +0 -1
  103. package/dist/chunk-E6EPN5BT.mjs +0 -203
  104. package/dist/chunk-E6EPN5BT.mjs.map +0 -1
  105. package/dist/chunk-EJ7T4TPB.mjs +0 -622
  106. package/dist/chunk-EJ7T4TPB.mjs.map +0 -1
  107. package/dist/chunk-FQYDHKKU.mjs +0 -128
  108. package/dist/chunk-FQYDHKKU.mjs.map +0 -1
  109. package/dist/chunk-FRPWCMMG.mjs +0 -299
  110. package/dist/chunk-FRPWCMMG.mjs.map +0 -1
  111. package/dist/chunk-GN72QAIH.mjs +0 -146
  112. package/dist/chunk-GN72QAIH.mjs.map +0 -1
  113. package/dist/chunk-GQVGIUSN.mjs +0 -149
  114. package/dist/chunk-GQVGIUSN.mjs.map +0 -1
  115. package/dist/chunk-GS6K5OCM.mjs +0 -407
  116. package/dist/chunk-GS6K5OCM.mjs.map +0 -1
  117. package/dist/chunk-GXASWWJU.mjs +0 -364
  118. package/dist/chunk-GXASWWJU.mjs.map +0 -1
  119. package/dist/chunk-GY2STC2S.mjs +0 -180
  120. package/dist/chunk-GY2STC2S.mjs.map +0 -1
  121. package/dist/chunk-H2FA2SBS.mjs +0 -51
  122. package/dist/chunk-H2FA2SBS.mjs.map +0 -1
  123. package/dist/chunk-HNIQFZKB.mjs +0 -3550
  124. package/dist/chunk-HNIQFZKB.mjs.map +0 -1
  125. package/dist/chunk-ITN462YM.mjs +0 -98
  126. package/dist/chunk-ITN462YM.mjs.map +0 -1
  127. package/dist/chunk-J23HNLFY.mjs +0 -72
  128. package/dist/chunk-J23HNLFY.mjs.map +0 -1
  129. package/dist/chunk-J4FNJ5IU.mjs +0 -179
  130. package/dist/chunk-J4FNJ5IU.mjs.map +0 -1
  131. package/dist/chunk-JDEOUK5V.mjs +0 -427
  132. package/dist/chunk-JDEOUK5V.mjs.map +0 -1
  133. package/dist/chunk-JK25YEN6.mjs +0 -219
  134. package/dist/chunk-JK25YEN6.mjs.map +0 -1
  135. package/dist/chunk-K4667E2Q.mjs +0 -1916
  136. package/dist/chunk-K4667E2Q.mjs.map +0 -1
  137. package/dist/chunk-LGHEOHBU.mjs +0 -218
  138. package/dist/chunk-LGHEOHBU.mjs.map +0 -1
  139. package/dist/chunk-LLC7BNXW.mjs +0 -275
  140. package/dist/chunk-LLC7BNXW.mjs.map +0 -1
  141. package/dist/chunk-LM2YNO4U.mjs +0 -24
  142. package/dist/chunk-LM2YNO4U.mjs.map +0 -1
  143. package/dist/chunk-MIUW47JX.mjs +0 -639
  144. package/dist/chunk-MIUW47JX.mjs.map +0 -1
  145. package/dist/chunk-NM3CRAAL.mjs +0 -467
  146. package/dist/chunk-NM3CRAAL.mjs.map +0 -1
  147. package/dist/chunk-NNLCAVB6.mjs +0 -391
  148. package/dist/chunk-NNLCAVB6.mjs.map +0 -1
  149. package/dist/chunk-P7QDS5AT.mjs +0 -191
  150. package/dist/chunk-P7QDS5AT.mjs.map +0 -1
  151. package/dist/chunk-PFE6GMNE.mjs +0 -603
  152. package/dist/chunk-PFE6GMNE.mjs.map +0 -1
  153. package/dist/chunk-QGOHVJ6J.mjs +0 -63
  154. package/dist/chunk-QGOHVJ6J.mjs.map +0 -1
  155. package/dist/chunk-QGQX7SFC.mjs +0 -180
  156. package/dist/chunk-QGQX7SFC.mjs.map +0 -1
  157. package/dist/chunk-QKVUNGAH.mjs +0 -39
  158. package/dist/chunk-QKVUNGAH.mjs.map +0 -1
  159. package/dist/chunk-QM746KUO.mjs +0 -56
  160. package/dist/chunk-QM746KUO.mjs.map +0 -1
  161. package/dist/chunk-RBRLLZL5.mjs +0 -81
  162. package/dist/chunk-RBRLLZL5.mjs.map +0 -1
  163. package/dist/chunk-RHIFZZUI.mjs +0 -69
  164. package/dist/chunk-RHIFZZUI.mjs.map +0 -1
  165. package/dist/chunk-RSKVYESE.mjs +0 -187
  166. package/dist/chunk-RSKVYESE.mjs.map +0 -1
  167. package/dist/chunk-SADGIRS2.mjs +0 -211
  168. package/dist/chunk-SADGIRS2.mjs.map +0 -1
  169. package/dist/chunk-SCFX4UTD.mjs +0 -28
  170. package/dist/chunk-SCFX4UTD.mjs.map +0 -1
  171. package/dist/chunk-SL6HTIOK.mjs +0 -66
  172. package/dist/chunk-SL6HTIOK.mjs.map +0 -1
  173. package/dist/chunk-SPBBQLXI.mjs +0 -207
  174. package/dist/chunk-SPBBQLXI.mjs.map +0 -1
  175. package/dist/chunk-T4QJQK76.mjs +0 -459
  176. package/dist/chunk-T4QJQK76.mjs.map +0 -1
  177. package/dist/chunk-TQAEEJB4.mjs +0 -157
  178. package/dist/chunk-TQAEEJB4.mjs.map +0 -1
  179. package/dist/chunk-UB5UOSHB.mjs +0 -458
  180. package/dist/chunk-UB5UOSHB.mjs.map +0 -1
  181. package/dist/chunk-USWZZUEH.mjs +0 -25
  182. package/dist/chunk-USWZZUEH.mjs.map +0 -1
  183. package/dist/chunk-UVCIEUJC.mjs +0 -16
  184. package/dist/chunk-UVCIEUJC.mjs.map +0 -1
  185. package/dist/chunk-UXUAWNO5.mjs +0 -396
  186. package/dist/chunk-UXUAWNO5.mjs.map +0 -1
  187. package/dist/chunk-V3XURYJO.mjs +0 -756
  188. package/dist/chunk-V3XURYJO.mjs.map +0 -1
  189. package/dist/chunk-V6WE6JSZ.mjs +0 -352
  190. package/dist/chunk-V6WE6JSZ.mjs.map +0 -1
  191. package/dist/chunk-V7RBCSDJ.mjs +0 -170
  192. package/dist/chunk-V7RBCSDJ.mjs.map +0 -1
  193. package/dist/chunk-VCANOYFI.mjs +0 -588
  194. package/dist/chunk-VCANOYFI.mjs.map +0 -1
  195. package/dist/chunk-VVKWFZAH.mjs +0 -753
  196. package/dist/chunk-VVKWFZAH.mjs.map +0 -1
  197. package/dist/chunk-VY2UYN5R.mjs +0 -224
  198. package/dist/chunk-VY2UYN5R.mjs.map +0 -1
  199. package/dist/chunk-W2CRQFF6.mjs +0 -1352
  200. package/dist/chunk-W2CRQFF6.mjs.map +0 -1
  201. package/dist/chunk-W4UIVMVI.mjs +0 -10
  202. package/dist/chunk-W4UIVMVI.mjs.map +0 -1
  203. package/dist/chunk-WZ5QFROO.mjs +0 -23
  204. package/dist/chunk-WZ5QFROO.mjs.map +0 -1
  205. package/dist/chunk-XIVV5IWN.mjs +0 -541
  206. package/dist/chunk-XIVV5IWN.mjs.map +0 -1
  207. package/dist/chunk-YW7OBE6Q.mjs +0 -119
  208. package/dist/chunk-YW7OBE6Q.mjs.map +0 -1
  209. package/dist/chunk-Z5CQMP54.mjs +0 -365
  210. package/dist/chunk-Z5CQMP54.mjs.map +0 -1
  211. package/dist/chunk-ZBE6MLHL.mjs +0 -230
  212. package/dist/chunk-ZBE6MLHL.mjs.map +0 -1
  213. package/dist/chunk-ZZ57EH5Z.mjs +0 -173
  214. package/dist/chunk-ZZ57EH5Z.mjs.map +0 -1
  215. package/dist/client-BT1mFQas.d.mts +0 -447
  216. package/dist/client-Nn0q4eO4.d.ts +0 -447
  217. package/dist/client-cache-CIlyBlmx.d.ts +0 -6
  218. package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
  219. package/dist/client-plugins-Cw4qUGsw.d.ts +0 -1855
  220. package/dist/client-plugins-DQQ1adXM.d.mts +0 -1855
  221. package/dist/client-plugins.cjs +0 -415
  222. package/dist/client-plugins.cjs.map +0 -1
  223. package/dist/client-plugins.d.mts +0 -22
  224. package/dist/client-plugins.d.ts +0 -22
  225. package/dist/client-plugins.mjs +0 -10
  226. package/dist/client-plugins.mjs.map +0 -1
  227. package/dist/client.cjs +0 -5402
  228. package/dist/client.cjs.map +0 -1
  229. package/dist/client.d.mts +0 -447
  230. package/dist/client.d.ts +0 -447
  231. package/dist/client.mjs +0 -110
  232. package/dist/client.mjs.map +0 -1
  233. package/dist/config.cjs +0 -38
  234. package/dist/config.cjs.map +0 -1
  235. package/dist/config.d.mts +0 -29
  236. package/dist/config.d.ts +0 -29
  237. package/dist/config.mjs +0 -10
  238. package/dist/config.mjs.map +0 -1
  239. package/dist/cron.cjs +0 -406
  240. package/dist/cron.cjs.map +0 -1
  241. package/dist/cron.d.mts +0 -78
  242. package/dist/cron.d.ts +0 -78
  243. package/dist/cron.mjs +0 -30
  244. package/dist/cron.mjs.map +0 -1
  245. package/dist/deferred.cjs +0 -438
  246. package/dist/deferred.cjs.map +0 -1
  247. package/dist/deferred.d.mts +0 -42
  248. package/dist/deferred.d.ts +0 -42
  249. package/dist/deferred.mjs +0 -28
  250. package/dist/deferred.mjs.map +0 -1
  251. package/dist/deployment.cjs +0 -199
  252. package/dist/deployment.cjs.map +0 -1
  253. package/dist/deployment.d.mts +0 -34
  254. package/dist/deployment.d.ts +0 -34
  255. package/dist/deployment.mjs +0 -38
  256. package/dist/deployment.mjs.map +0 -1
  257. package/dist/devtools-LVC3VB5P.mjs +0 -370
  258. package/dist/devtools-LVC3VB5P.mjs.map +0 -1
  259. package/dist/devtools-client-3XRTBND5.mjs +0 -216
  260. package/dist/devtools-client-3XRTBND5.mjs.map +0 -1
  261. package/dist/devtools-ui-NJKFORTG.mjs +0 -1349
  262. package/dist/devtools-ui-NJKFORTG.mjs.map +0 -1
  263. package/dist/docs.cjs +0 -5553
  264. package/dist/docs.cjs.map +0 -1
  265. package/dist/docs.d.mts +0 -69
  266. package/dist/docs.d.ts +0 -69
  267. package/dist/docs.mjs +0 -46
  268. package/dist/docs.mjs.map +0 -1
  269. package/dist/env-types.cjs +0 -223
  270. package/dist/env-types.cjs.map +0 -1
  271. package/dist/env-types.d.mts +0 -11
  272. package/dist/env-types.d.ts +0 -11
  273. package/dist/env-types.mjs +0 -9
  274. package/dist/env-types.mjs.map +0 -1
  275. package/dist/env.cjs +0 -215
  276. package/dist/env.cjs.map +0 -1
  277. package/dist/env.d.mts +0 -45
  278. package/dist/env.d.ts +0 -45
  279. package/dist/env.mjs +0 -22
  280. package/dist/env.mjs.map +0 -1
  281. package/dist/environment/vite.d.mts +0 -22
  282. package/dist/environment/vite.d.ts +0 -22
  283. package/dist/environment.cjs +0 -96
  284. package/dist/environment.cjs.map +0 -1
  285. package/dist/environment.d.mts +0 -18
  286. package/dist/environment.d.ts +0 -18
  287. package/dist/environment.mjs +0 -14
  288. package/dist/environment.mjs.map +0 -1
  289. package/dist/headers.cjs +0 -126
  290. package/dist/headers.cjs.map +0 -1
  291. package/dist/headers.d.mts +0 -22
  292. package/dist/headers.d.ts +0 -22
  293. package/dist/headers.mjs +0 -12
  294. package/dist/headers.mjs.map +0 -1
  295. package/dist/i18n/client.d.mts +0 -32
  296. package/dist/i18n/client.d.ts +0 -32
  297. package/dist/i18n/index.d.mts +0 -20
  298. package/dist/i18n/index.d.ts +0 -20
  299. package/dist/i18n/server.d.mts +0 -30
  300. package/dist/i18n/server.d.ts +0 -30
  301. package/dist/image/server.d.mts +0 -37
  302. package/dist/image/server.d.ts +0 -37
  303. package/dist/image/sharp.d.mts +0 -7
  304. package/dist/image/sharp.d.ts +0 -7
  305. package/dist/image-config-Duob7wER.d.mts +0 -50
  306. package/dist/image-config-Duob7wER.d.ts +0 -50
  307. package/dist/image.cjs +0 -209
  308. package/dist/image.cjs.map +0 -1
  309. package/dist/image.d.mts +0 -39
  310. package/dist/image.d.ts +0 -39
  311. package/dist/image.mjs +0 -165
  312. package/dist/image.mjs.map +0 -1
  313. package/dist/index.cjs +0 -41822
  314. package/dist/index.cjs.map +0 -1
  315. package/dist/index.d.mts +0 -452
  316. package/dist/index.d.ts +0 -452
  317. package/dist/index.mjs +0 -973
  318. package/dist/index.mjs.map +0 -1
  319. package/dist/integration-api-CHT2OKAf.d.mts +0 -93
  320. package/dist/integration-api-CHT2OKAf.d.ts +0 -93
  321. package/dist/integration-orm-GQLGU66X.mjs +0 -13
  322. package/dist/integration-orm-GQLGU66X.mjs.map +0 -1
  323. package/dist/integrations.cjs +0 -2820
  324. package/dist/integrations.cjs.map +0 -1
  325. package/dist/integrations.d.mts +0 -22
  326. package/dist/integrations.d.ts +0 -22
  327. package/dist/integrations.mjs +0 -51
  328. package/dist/integrations.mjs.map +0 -1
  329. package/dist/internal/build-runtime.d.mts +0 -39
  330. package/dist/internal/build-runtime.d.ts +0 -39
  331. package/dist/internal/client-runtime.d.mts +0 -2
  332. package/dist/internal/client-runtime.d.ts +0 -2
  333. package/dist/internal/config-runtime.d.mts +0 -39
  334. package/dist/internal/config-runtime.d.ts +0 -39
  335. package/dist/internal/production-node-env.d.mts +0 -12
  336. package/dist/internal/production-node-env.d.ts +0 -12
  337. package/dist/internal/production-runtime.d.mts +0 -39
  338. package/dist/internal/production-runtime.d.ts +0 -39
  339. package/dist/layers-VWVDTPUZ.mjs +0 -16
  340. package/dist/layers-VWVDTPUZ.mjs.map +0 -1
  341. package/dist/manager-THKFTOFE.mjs +0 -10
  342. package/dist/manager-THKFTOFE.mjs.map +0 -1
  343. package/dist/markdown.cjs +0 -299
  344. package/dist/markdown.cjs.map +0 -1
  345. package/dist/markdown.d.mts +0 -43
  346. package/dist/markdown.d.ts +0 -43
  347. package/dist/markdown.mjs +0 -14
  348. package/dist/markdown.mjs.map +0 -1
  349. package/dist/metadata-BAPg_Nmo.d.ts +0 -22
  350. package/dist/metadata-_6i9oFG3.d.mts +0 -22
  351. package/dist/middleware.cjs +0 -2148
  352. package/dist/middleware.cjs.map +0 -1
  353. package/dist/middleware.d.mts +0 -164
  354. package/dist/middleware.d.ts +0 -164
  355. package/dist/middleware.mjs +0 -49
  356. package/dist/middleware.mjs.map +0 -1
  357. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  358. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  359. package/dist/navigation.cjs +0 -1329
  360. package/dist/navigation.cjs.map +0 -1
  361. package/dist/navigation.d.mts +0 -14
  362. package/dist/navigation.d.ts +0 -14
  363. package/dist/navigation.mjs +0 -33
  364. package/dist/navigation.mjs.map +0 -1
  365. package/dist/nitro-QO5LV6QK.mjs +0 -689
  366. package/dist/nitro-QO5LV6QK.mjs.map +0 -1
  367. package/dist/observability.cjs +0 -186
  368. package/dist/observability.cjs.map +0 -1
  369. package/dist/observability.d.mts +0 -335
  370. package/dist/observability.d.ts +0 -335
  371. package/dist/observability.mjs +0 -16
  372. package/dist/observability.mjs.map +0 -1
  373. package/dist/params-BALtrRim.d.ts +0 -15
  374. package/dist/params-ry-lxqmy.d.mts +0 -15
  375. package/dist/plugin-BJDf43dc.d.mts +0 -165
  376. package/dist/plugin-BJDf43dc.d.ts +0 -165
  377. package/dist/plugin.cjs +0 -23225
  378. package/dist/plugin.d.mts +0 -22
  379. package/dist/plugin.d.ts +0 -22
  380. package/dist/production-runtime-BoJDc5mc.d.ts +0 -79
  381. package/dist/production-runtime-C_B79w2P.d.mts +0 -28
  382. package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
  383. package/dist/production-runtime-DPfgMV9Y.d.mts +0 -79
  384. package/dist/query/client.d.mts +0 -61
  385. package/dist/query/client.d.ts +0 -61
  386. package/dist/query/index.d.mts +0 -90
  387. package/dist/query/index.d.ts +0 -90
  388. package/dist/query/parsers.d.mts +0 -25
  389. package/dist/query/parsers.d.ts +0 -25
  390. package/dist/query/server.d.mts +0 -55
  391. package/dist/query/server.d.ts +0 -55
  392. package/dist/request-BrFBuc8G.d.mts +0 -6
  393. package/dist/request-BslSZIRz.d.ts +0 -6
  394. package/dist/request.d.mts +0 -2
  395. package/dist/request.d.ts +0 -2
  396. package/dist/resolver-C6iecsDV.d.ts +0 -14
  397. package/dist/resolver-DlOPpjkB.d.mts +0 -14
  398. package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
  399. package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
  400. package/dist/router.d.mts +0 -36
  401. package/dist/router.d.ts +0 -36
  402. package/dist/routes.d.mts +0 -224
  403. package/dist/routes.d.ts +0 -224
  404. package/dist/runtime-9nQjVM7X.d.mts +0 -206
  405. package/dist/runtime-B6GvwDS1.d.ts +0 -27
  406. package/dist/runtime-DeAAZ6gO.d.mts +0 -27
  407. package/dist/runtime-DgeS2skB.d.ts +0 -206
  408. package/dist/server-action-security.d.mts +0 -43
  409. package/dist/server-action-security.d.ts +0 -43
  410. package/dist/server-fn-client.d.mts +0 -32
  411. package/dist/server-fn-client.d.ts +0 -32
  412. package/dist/server-fn.d.mts +0 -93
  413. package/dist/server-fn.d.ts +0 -93
  414. package/dist/server-plugins.d.mts +0 -55
  415. package/dist/server-plugins.d.ts +0 -55
  416. package/dist/server-query-client.d.mts +0 -50
  417. package/dist/server-query-client.d.ts +0 -50
  418. package/dist/server-query.d.mts +0 -36
  419. package/dist/server-query.d.ts +0 -36
  420. package/dist/server.d.mts +0 -48
  421. package/dist/server.d.ts +0 -48
  422. package/dist/storage.d.mts +0 -52
  423. package/dist/storage.d.ts +0 -52
  424. package/dist/testing.d.mts +0 -101
  425. package/dist/testing.d.ts +0 -101
  426. package/dist/transport-BmbGTXA5.d.mts +0 -49
  427. package/dist/transport-BmbGTXA5.d.ts +0 -49
  428. package/dist/types-BH1lhg5G.d.mts +0 -81
  429. package/dist/types-BH1lhg5G.d.ts +0 -81
  430. package/dist/types-C9N-nk5R.d.mts +0 -53
  431. package/dist/types-C9N-nk5R.d.ts +0 -53
  432. package/dist/types-D1A6-XvH.d.mts +0 -73
  433. package/dist/types-D1A6-XvH.d.ts +0 -73
  434. package/dist/utils-CHXlMDkg.d.mts +0 -23
  435. package/dist/utils-Drsyz1Vj.d.ts +0 -23
  436. package/dist/version.d.mts +0 -3
  437. package/dist/version.d.ts +0 -3
  438. package/dist/vite.d.mts +0 -22
  439. package/dist/vite.d.ts +0 -22
  440. package/dist/workflows.d.mts +0 -110
  441. package/dist/workflows.d.ts +0 -110
@@ -1,756 +0,0 @@
1
- import {
2
- getActiveFarmI18nSnapshot
3
- } from "./chunk-WZ5QFROO.mjs";
4
- import {
5
- notifyFarmCacheInvalidation,
6
- notifyFarmCacheTask
7
- } from "./chunk-RBRLLZL5.mjs";
8
- import {
9
- emitFarmEvent
10
- } from "./chunk-7ZY5AIJO.mjs";
11
- import {
12
- __name
13
- } from "./chunk-CGILA3WO.mjs";
14
-
15
- // src/cache.ts
16
- function defineCacheKey() {
17
- return (factory) => {
18
- if (typeof factory !== "function") {
19
- throw new TypeError("defineCacheKey expects a key factory function.");
20
- }
21
- return ((...args) => {
22
- const key = factory(...args);
23
- if (typeof key !== "string" && !Array.isArray(key)) {
24
- throw new TypeError(
25
- "A defined cache key factory must return a string or structured array."
26
- );
27
- }
28
- return key;
29
- });
30
- };
31
- }
32
- __name(defineCacheKey, "defineCacheKey");
33
- function storageCacheAdapter(storage, options = {}) {
34
- if (!storage || typeof storage.getItem !== "function" || typeof storage.setItem !== "function") {
35
- throw new TypeError("storageCacheAdapter expects a compatible storage client.");
36
- }
37
- const base = normalizeCacheNamespace(options.base || "farm-cache");
38
- const entryKey = /* @__PURE__ */ __name((key) => `${base}:entry:${key}`, "entryKey");
39
- const tagKey = /* @__PURE__ */ __name((tag) => `${base}:tag:${tag}`, "tagKey");
40
- return {
41
- name: "storage",
42
- get: /* @__PURE__ */ __name((key) => storage.getItem(entryKey(key)), "get"),
43
- set: /* @__PURE__ */ __name(async (key, entry) => {
44
- await storage.setItem(entryKey(key), entry);
45
- }, "set"),
46
- delete: /* @__PURE__ */ __name(async (key) => {
47
- await storage.removeItem(entryKey(key));
48
- }, "delete"),
49
- clear: storage.clear ? async () => {
50
- await storage.clear(base);
51
- } : void 0,
52
- getTagVersions: /* @__PURE__ */ __name(async (tags) => {
53
- const versions = await Promise.all(
54
- tags.map(async (tag) => {
55
- const value = await storage.getItem(tagKey(tag));
56
- return [tag, normalizeAdapterVersion(value)];
57
- })
58
- );
59
- return Object.fromEntries(versions);
60
- }, "getTagVersions"),
61
- invalidateTags: /* @__PURE__ */ __name(async (tags) => {
62
- await Promise.all(
63
- tags.map(async (tag) => {
64
- const key = tagKey(tag);
65
- const current = normalizeAdapterVersion(await storage.getItem(key));
66
- await storage.setItem(key, Math.max(Date.now(), current + 1));
67
- })
68
- );
69
- }, "invalidateTags")
70
- };
71
- }
72
- __name(storageCacheAdapter, "storageCacheAdapter");
73
- var _FarmDataCache = class _FarmDataCache {
74
- constructor(config = {}) {
75
- this.entries = /* @__PURE__ */ new Map();
76
- this.inflight = /* @__PURE__ */ new Map();
77
- this.invalidatedTagVersions = /* @__PURE__ */ new Map();
78
- this.version = 0;
79
- this.namespace = "farm";
80
- this.local = true;
81
- this.lease = {
82
- enabled: true,
83
- ttlMs: 1e4,
84
- waitTimeoutMs: 1e4,
85
- pollIntervalMs: 25
86
- };
87
- this.configure(config);
88
- }
89
- configure(config = {}) {
90
- this.adapter = config.adapter;
91
- this.namespace = normalizeCacheNamespace(config.namespace || "farm");
92
- this.local = !config.adapter;
93
- this.lease = config.lease === false ? { ...this.lease, enabled: false } : {
94
- enabled: true,
95
- ttlMs: normalizePositiveDuration(config.lease?.ttlMs, 1e4, "cache.lease.ttlMs"),
96
- waitTimeoutMs: normalizePositiveDuration(
97
- config.lease?.waitTimeoutMs,
98
- 1e4,
99
- "cache.lease.waitTimeoutMs"
100
- ),
101
- pollIntervalMs: normalizePositiveDuration(
102
- config.lease?.pollIntervalMs,
103
- 25,
104
- "cache.lease.pollIntervalMs"
105
- )
106
- };
107
- if (!this.local) {
108
- this.entries.clear();
109
- this.inflight.clear();
110
- this.invalidatedTagVersions.clear();
111
- this.version = 0;
112
- }
113
- }
114
- get adapterName() {
115
- return this.adapter?.name || (this.adapter ? "custom" : "memory");
116
- }
117
- get hasAdapter() {
118
- return this.adapter !== void 0;
119
- }
120
- get size() {
121
- return this.entries.size;
122
- }
123
- get(key, options = {}) {
124
- return this.getEntry(key, options)?.value;
125
- }
126
- getEntry(key, options = {}) {
127
- const entry = this.entries.get(key);
128
- if (!entry) {
129
- emitFarmEvent({ type: "cache.miss", key });
130
- return void 0;
131
- }
132
- const stale = this.isStale(entry, options.now);
133
- if (stale) {
134
- emitFarmEvent({
135
- type: "cache.stale",
136
- key,
137
- tags: Array.from(entry.tags),
138
- revalidate: entry.revalidate
139
- });
140
- }
141
- if (!options.allowStale && stale) {
142
- emitFarmEvent({ type: "cache.miss", key, reason: "stale" });
143
- return void 0;
144
- }
145
- emitFarmEvent({
146
- type: "cache.hit",
147
- key,
148
- tags: Array.from(entry.tags),
149
- revalidate: entry.revalidate,
150
- stale
151
- });
152
- return this.toPublicEntry(entry);
153
- }
154
- async getEntryAsync(key, options = {}) {
155
- if (this.local) {
156
- const localEntry = this.getEntry(key, options);
157
- if (localEntry) return localEntry;
158
- }
159
- if (!this.adapter) {
160
- return this.local ? void 0 : this.getEntry(key, options);
161
- }
162
- const entry = await this.adapter.get(this.createAdapterKey(key));
163
- if (!entry) {
164
- emitFarmEvent({ type: "cache.miss", key });
165
- return void 0;
166
- }
167
- assertFarmCacheEntry(entry, key);
168
- const stale = await this.isAdapterEntryStale(entry, options.now);
169
- if (stale) {
170
- emitFarmEvent({
171
- type: "cache.stale",
172
- key,
173
- tags: [...entry.tags],
174
- revalidate: entry.revalidate
175
- });
176
- if (!options.allowStale) {
177
- emitFarmEvent({ type: "cache.miss", key, reason: "stale" });
178
- return void 0;
179
- }
180
- }
181
- emitFarmEvent({
182
- type: "cache.hit",
183
- key,
184
- tags: [...entry.tags],
185
- revalidate: entry.revalidate,
186
- stale
187
- });
188
- if (this.local && !stale) {
189
- this.hydrateLocalEntry(entry);
190
- }
191
- return { ...entry, key };
192
- }
193
- set(key, value, options = {}) {
194
- const tags = /* @__PURE__ */ new Set();
195
- for (const tag of options.tags ?? []) {
196
- tags.add(normalizeCacheTag(tag));
197
- }
198
- for (const routePath of options.paths ?? []) {
199
- tags.add(createPathCacheTag(routePath));
200
- }
201
- const entry = {
202
- key,
203
- value,
204
- tags,
205
- tagVersions: void 0,
206
- createdAt: options.createdAt ?? Date.now(),
207
- createdVersion: ++this.version,
208
- revalidate: normalizeRevalidate(options.revalidate)
209
- };
210
- this.entries.set(key, entry);
211
- emitFarmEvent({
212
- type: "cache.set",
213
- key,
214
- tags: Array.from(tags),
215
- revalidate: entry.revalidate
216
- });
217
- return this.toPublicEntry(entry);
218
- }
219
- async setAsync(key, value, options = {}, tagVersions) {
220
- const tags = normalizeCacheOptionsTags(options);
221
- const capturedVersions = tagVersions ?? await this.getAdapterTagVersions(Array.from(tags.values()));
222
- const entry = {
223
- key,
224
- value,
225
- tags: Array.from(tags),
226
- tagVersions: capturedVersions,
227
- createdAt: options.createdAt ?? Date.now(),
228
- createdVersion: ++this.version,
229
- revalidate: normalizeRevalidate(options.revalidate)
230
- };
231
- if (this.local) {
232
- this.hydrateLocalEntry(entry);
233
- }
234
- if (this.adapter) {
235
- await this.adapter.set(this.createAdapterKey(key), entry);
236
- }
237
- emitFarmEvent({
238
- type: "cache.set",
239
- key,
240
- tags: [...entry.tags],
241
- revalidate: entry.revalidate
242
- });
243
- return entry;
244
- }
245
- delete(key) {
246
- const deleted = this.entries.delete(key);
247
- emitFarmEvent({ type: "cache.delete", key, deleted });
248
- return deleted;
249
- }
250
- async deleteAsync(key) {
251
- const deleted = this.entries.delete(key);
252
- if (this.adapter) {
253
- await this.adapter.delete(this.createAdapterKey(key));
254
- }
255
- emitFarmEvent({ type: "cache.delete", key, deleted: this.adapter ? true : deleted });
256
- return this.adapter ? true : deleted;
257
- }
258
- clear() {
259
- const count = this.entries.size;
260
- this.entries.clear();
261
- this.inflight.clear();
262
- this.invalidatedTagVersions.clear();
263
- this.version = 0;
264
- emitFarmEvent({ type: "cache.clear", count });
265
- }
266
- async clearAsync() {
267
- this.clear();
268
- await this.adapter?.clear?.();
269
- }
270
- isStale(entry, now = Date.now()) {
271
- if (typeof entry.revalidate === "number" && entry.revalidate > 0 && now - entry.createdAt >= entry.revalidate * 1e3) {
272
- return true;
273
- }
274
- for (const tag of entry.tags) {
275
- const invalidatedVersion = this.invalidatedTagVersions.get(normalizeCacheTag(tag));
276
- if (typeof invalidatedVersion === "number" && typeof entry.createdVersion === "number" && invalidatedVersion > entry.createdVersion) {
277
- return true;
278
- }
279
- }
280
- return false;
281
- }
282
- async isStaleAsync(entry, now = Date.now()) {
283
- if (this.adapter) {
284
- return this.isAdapterEntryStale(entry, now);
285
- }
286
- return this.isStale(entry, now);
287
- }
288
- revalidateTag(tag, options = {}) {
289
- const normalized = normalizeCacheTag(tag);
290
- const count = this.invalidateTag(normalized);
291
- emitFarmEvent(
292
- options.source === "updateTag" ? { type: "cache.updateTag", tag: normalized, count } : { type: "cache.revalidateTag", tag: normalized, profile: options.profile, count }
293
- );
294
- return count;
295
- }
296
- async revalidateTagAsync(tag, options = {}) {
297
- const normalized = normalizeCacheTag(tag);
298
- const count = this.invalidateTag(normalized);
299
- await this.adapter?.invalidateTags?.([this.createAdapterTag(normalized)]);
300
- emitFarmEvent(
301
- options.source === "updateTag" ? { type: "cache.updateTag", tag: normalized, count } : { type: "cache.revalidateTag", tag: normalized, profile: options.profile, count }
302
- );
303
- return count;
304
- }
305
- revalidatePath(routePath) {
306
- const normalizedPath = normalizeRevalidatePath(routePath);
307
- const pathTag = createPathCacheTag(normalizedPath);
308
- const pprCount = this.countEntriesForTags([pathTag, "ppr"]);
309
- const count = this.invalidateTag(pathTag);
310
- emitFarmEvent({ type: "cache.revalidatePath", path: normalizedPath, count });
311
- if (pprCount > 0) {
312
- emitFarmEvent({
313
- type: "ppr.shell.invalidated",
314
- route: normalizedPath,
315
- reason: "revalidatePath",
316
- count: pprCount
317
- });
318
- }
319
- return count;
320
- }
321
- async revalidatePathAsync(routePath) {
322
- const normalizedPath = normalizeRevalidatePath(routePath);
323
- const pathTag = createPathCacheTag(normalizedPath);
324
- const pprCount = this.countEntriesForTags([pathTag, "ppr"]);
325
- const count = this.invalidateTag(pathTag);
326
- await this.adapter?.invalidateTags?.([this.createAdapterTag(pathTag)]);
327
- emitFarmEvent({ type: "cache.revalidatePath", path: normalizedPath, count });
328
- if (pprCount > 0) {
329
- emitFarmEvent({
330
- type: "ppr.shell.invalidated",
331
- route: normalizedPath,
332
- reason: "revalidatePath",
333
- count: pprCount
334
- });
335
- }
336
- return count;
337
- }
338
- async getOrSet(key, producer, options = {}) {
339
- const cached = await this.getEntryAsync(key);
340
- if (cached) {
341
- return cached.value;
342
- }
343
- const inflight = this.inflight.get(key);
344
- if (inflight) {
345
- emitFarmEvent({ type: "cache.dedupe", key });
346
- return inflight;
347
- }
348
- const tags = Array.from(normalizeCacheOptionsTags(options));
349
- const promise = this.fillCacheEntry(key, producer, options, tags).catch((error) => {
350
- emitFarmEvent({ type: "cache.error", key, operation: "set", error });
351
- throw error;
352
- }).finally(() => {
353
- this.inflight.delete(key);
354
- });
355
- this.inflight.set(key, promise);
356
- return promise;
357
- }
358
- async fillCacheEntry(key, producer, options, tags) {
359
- const leaseKey = `${this.namespace}:lease:${key}`;
360
- let leaseToken;
361
- if (this.adapter?.acquireLease && this.adapter.releaseLease && this.lease.enabled) {
362
- leaseToken = await this.adapter.acquireLease(leaseKey, this.lease.ttlMs);
363
- if (!leaseToken) {
364
- const shared = await this.waitForAdapterEntry(key);
365
- if (shared) {
366
- emitFarmEvent({ type: "cache.dedupe", key });
367
- return shared.value;
368
- }
369
- leaseToken = await this.adapter.acquireLease(leaseKey, this.lease.ttlMs);
370
- }
371
- }
372
- try {
373
- const initialTagVersions = await this.getAdapterTagVersions(tags);
374
- const value = await producer();
375
- await this.setAsync(key, value, options, initialTagVersions);
376
- return value;
377
- } finally {
378
- if (leaseToken && this.adapter?.releaseLease) {
379
- await this.adapter.releaseLease(leaseKey, leaseToken);
380
- }
381
- }
382
- }
383
- async waitForAdapterEntry(key) {
384
- const deadline = Date.now() + this.lease.waitTimeoutMs;
385
- while (Date.now() < deadline) {
386
- await delay(this.lease.pollIntervalMs);
387
- const entry = await this.getEntryAsync(key);
388
- if (entry) return entry;
389
- }
390
- return void 0;
391
- }
392
- countEntriesForTag(tag) {
393
- let count = 0;
394
- for (const entry of this.entries.values()) {
395
- if (entry.tags.has(tag)) {
396
- count++;
397
- }
398
- }
399
- return count;
400
- }
401
- countEntriesForTags(tags) {
402
- let count = 0;
403
- for (const entry of this.entries.values()) {
404
- if (tags.every((tag) => entry.tags.has(tag))) {
405
- count++;
406
- }
407
- }
408
- return count;
409
- }
410
- invalidateTag(normalizedTag) {
411
- this.invalidatedTagVersions.set(normalizedTag, ++this.version);
412
- return this.countEntriesForTag(normalizedTag);
413
- }
414
- toPublicEntry(entry) {
415
- return {
416
- key: entry.key,
417
- value: entry.value,
418
- tags: Array.from(entry.tags),
419
- tagVersions: entry.tagVersions,
420
- createdAt: entry.createdAt,
421
- createdVersion: entry.createdVersion,
422
- revalidate: entry.revalidate
423
- };
424
- }
425
- hydrateLocalEntry(entry) {
426
- this.entries.set(entry.key, {
427
- key: entry.key,
428
- value: entry.value,
429
- tags: new Set(entry.tags.map(normalizeCacheTag)),
430
- tagVersions: entry.tagVersions,
431
- createdAt: entry.createdAt,
432
- createdVersion: entry.createdVersion ?? ++this.version,
433
- revalidate: normalizeRevalidate(entry.revalidate)
434
- });
435
- }
436
- createAdapterKey(key) {
437
- return `${this.namespace}:entry:${key}`;
438
- }
439
- createAdapterTag(tag) {
440
- return `${this.namespace}:tag:${tag}`;
441
- }
442
- async getAdapterTagVersions(tags) {
443
- if (!this.adapter?.getTagVersions || tags.length === 0) return {};
444
- const normalized = tags.map(normalizeCacheTag);
445
- const physicalTags = normalized.map((tag) => this.createAdapterTag(tag));
446
- const versions = await this.adapter.getTagVersions(physicalTags);
447
- return Object.fromEntries(
448
- normalized.map((tag, index) => [
449
- tag,
450
- normalizeAdapterVersion(versions[physicalTags[index]])
451
- ])
452
- );
453
- }
454
- async isAdapterEntryStale(entry, now = Date.now()) {
455
- if (typeof entry.revalidate === "number" && entry.revalidate > 0 && now - entry.createdAt >= entry.revalidate * 1e3) {
456
- return true;
457
- }
458
- const currentVersions = await this.getAdapterTagVersions(entry.tags);
459
- for (const tag of entry.tags) {
460
- if (normalizeAdapterVersion(currentVersions[tag]) > normalizeAdapterVersion(entry.tagVersions?.[tag])) {
461
- return true;
462
- }
463
- }
464
- return false;
465
- }
466
- };
467
- __name(_FarmDataCache, "FarmDataCache");
468
- var FarmDataCache = _FarmDataCache;
469
- var FARM_DATA_CACHE_SYMBOL = /* @__PURE__ */ Symbol.for("farm.dataCache");
470
- var farmDataCacheGlobal = globalThis;
471
- var sharedFarmDataCache = farmDataCacheGlobal[FARM_DATA_CACHE_SYMBOL] ?? (farmDataCacheGlobal[FARM_DATA_CACHE_SYMBOL] = new FarmDataCache());
472
- var functionIds = /* @__PURE__ */ new WeakMap();
473
- var nextFunctionId = 0;
474
- function getFarmDataCache() {
475
- return sharedFarmDataCache;
476
- }
477
- __name(getFarmDataCache, "getFarmDataCache");
478
- function configureFarmCache(config) {
479
- sharedFarmDataCache.configure(config);
480
- }
481
- __name(configureFarmCache, "configureFarmCache");
482
- function unstable_cache(fn, keyParts = [], options = {}) {
483
- return async (...args) => {
484
- const locale = getActiveFarmI18nSnapshot()?.locale;
485
- const key = createFarmCacheKey([
486
- "unstable_cache",
487
- getFunctionCacheIdentity(fn),
488
- locale ? ["locale", locale] : null,
489
- keyParts,
490
- args
491
- ]);
492
- return getFarmDataCache().getOrSet(key, () => fn(...args), options);
493
- };
494
- }
495
- __name(unstable_cache, "unstable_cache");
496
- function revalidateTag(_tag, _profile) {
497
- const cache = getFarmDataCache();
498
- if (cache.hasAdapter) {
499
- const task = cache.revalidateTagAsync(_tag, {
500
- source: "revalidateTag",
501
- profile: _profile
502
- }).then(() => void 0);
503
- notifyFarmCacheTask(task);
504
- return task;
505
- }
506
- cache.revalidateTag(_tag, {
507
- source: "revalidateTag",
508
- profile: _profile
509
- });
510
- }
511
- __name(revalidateTag, "revalidateTag");
512
- function updateTag(tag) {
513
- const cache = getFarmDataCache();
514
- if (cache.hasAdapter) {
515
- const task = cache.revalidateTagAsync(tag, { source: "updateTag" }).then(() => void 0);
516
- notifyFarmCacheTask(task);
517
- return task;
518
- }
519
- cache.revalidateTag(tag, { source: "updateTag" });
520
- }
521
- __name(updateTag, "updateTag");
522
- function revalidatePath(routePath) {
523
- const cache = getFarmDataCache();
524
- if (cache.hasAdapter) {
525
- const task = cache.revalidatePathAsync(routePath).then(() => void 0);
526
- notifyFarmCacheTask(task);
527
- return task;
528
- }
529
- cache.revalidatePath(routePath);
530
- }
531
- __name(revalidatePath, "revalidatePath");
532
- function invalidate(key) {
533
- const clientKey = createRouteDataCacheKey(key);
534
- const task = updateTag(createRouteDataCacheTag(key));
535
- notifyFarmCacheInvalidation(clientKey);
536
- return task;
537
- }
538
- __name(invalidate, "invalidate");
539
- function invalidateRouteData(key) {
540
- return invalidate(key);
541
- }
542
- __name(invalidateRouteData, "invalidateRouteData");
543
- async function applyFarmCacheInvalidationTargets(targets) {
544
- if (!Array.isArray(targets)) {
545
- throw new TypeError("Cache invalidations must resolve to an array of targets.");
546
- }
547
- const clientKeys = [];
548
- for (const target of targets) {
549
- assertFarmCacheInvalidationTarget(target);
550
- if ("key" in target) {
551
- await invalidate(target.key);
552
- clientKeys.push(createRouteDataCacheKey(target.key));
553
- } else if ("path" in target) {
554
- await revalidatePath(target.path);
555
- } else {
556
- await updateTag(target.tag);
557
- }
558
- }
559
- return Array.from(new Set(clientKeys));
560
- }
561
- __name(applyFarmCacheInvalidationTargets, "applyFarmCacheInvalidationTargets");
562
- function createPathCacheTag(routePath) {
563
- return `path:${normalizeRevalidatePath(routePath)}`;
564
- }
565
- __name(createPathCacheTag, "createPathCacheTag");
566
- function createRouteDataCacheTag(key) {
567
- return `route-data:${createRouteDataCacheKey(key)}`;
568
- }
569
- __name(createRouteDataCacheTag, "createRouteDataCacheTag");
570
- function createRouteDataCacheKey(key) {
571
- return createFarmCacheKey(Array.isArray(key) ? key : [key]);
572
- }
573
- __name(createRouteDataCacheKey, "createRouteDataCacheKey");
574
- function normalizeRevalidatePath(routePath) {
575
- if (typeof routePath !== "string") {
576
- throw new TypeError("revalidatePath expects a path string.");
577
- }
578
- let normalized = routePath.trim();
579
- if (!normalized) {
580
- throw new Error("revalidatePath expects a non-empty path.");
581
- }
582
- try {
583
- if (/^https?:\/\//.test(normalized)) {
584
- normalized = new URL(normalized).pathname;
585
- }
586
- } catch {
587
- }
588
- normalized = normalized.split("?")[0] ?? normalized;
589
- normalized = normalized.startsWith("/") ? normalized : `/${normalized}`;
590
- normalized = normalized.replace(/\/{2,}/g, "/");
591
- if (normalized.length > 1) {
592
- normalized = normalized.replace(/\/+$/, "");
593
- }
594
- return normalized || "/";
595
- }
596
- __name(normalizeRevalidatePath, "normalizeRevalidatePath");
597
- function createFarmCacheKey(parts) {
598
- return stableSerialize(parts);
599
- }
600
- __name(createFarmCacheKey, "createFarmCacheKey");
601
- function normalizeRevalidate(revalidate) {
602
- if (revalidate === false || revalidate === void 0) {
603
- return revalidate;
604
- }
605
- if (!Number.isFinite(revalidate) || revalidate <= 0) {
606
- return void 0;
607
- }
608
- return revalidate;
609
- }
610
- __name(normalizeRevalidate, "normalizeRevalidate");
611
- function normalizeCacheTag(tag) {
612
- if (typeof tag !== "string") {
613
- throw new TypeError("Cache tags must be strings.");
614
- }
615
- const normalized = tag.trim();
616
- if (!normalized) {
617
- throw new Error("Cache tags cannot be empty.");
618
- }
619
- return normalized;
620
- }
621
- __name(normalizeCacheTag, "normalizeCacheTag");
622
- function normalizeCacheNamespace(namespace) {
623
- if (typeof namespace !== "string") {
624
- throw new TypeError("Cache namespace must be a string.");
625
- }
626
- const normalized = namespace.trim().replace(/:+$/g, "");
627
- if (!normalized) {
628
- throw new Error("Cache namespace cannot be empty.");
629
- }
630
- return normalized;
631
- }
632
- __name(normalizeCacheNamespace, "normalizeCacheNamespace");
633
- function normalizeAdapterVersion(value) {
634
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
635
- }
636
- __name(normalizeAdapterVersion, "normalizeAdapterVersion");
637
- function normalizePositiveDuration(value, fallback, name) {
638
- if (value === void 0) return fallback;
639
- if (!Number.isFinite(value) || value <= 0) {
640
- throw new TypeError(`${name} must be a positive number of milliseconds.`);
641
- }
642
- return Math.floor(value);
643
- }
644
- __name(normalizePositiveDuration, "normalizePositiveDuration");
645
- function delay(ms) {
646
- return new Promise((resolve) => setTimeout(resolve, ms));
647
- }
648
- __name(delay, "delay");
649
- function normalizeCacheOptionsTags(options) {
650
- const tags = /* @__PURE__ */ new Set();
651
- for (const tag of options.tags ?? []) {
652
- tags.add(normalizeCacheTag(tag));
653
- }
654
- for (const routePath of options.paths ?? []) {
655
- tags.add(createPathCacheTag(routePath));
656
- }
657
- return tags;
658
- }
659
- __name(normalizeCacheOptionsTags, "normalizeCacheOptionsTags");
660
- function assertFarmCacheEntry(entry, expectedKey) {
661
- if (!entry || typeof entry !== "object" || entry.key !== expectedKey || !Array.isArray(entry.tags) || typeof entry.createdAt !== "number") {
662
- throw new TypeError(
663
- `Cache adapter returned an invalid entry for ${JSON.stringify(expectedKey)}.`
664
- );
665
- }
666
- }
667
- __name(assertFarmCacheEntry, "assertFarmCacheEntry");
668
- function assertFarmCacheInvalidationTarget(target) {
669
- if (!target || typeof target !== "object") {
670
- throw new TypeError("Cache invalidation targets must be { key }, { path }, or { tag }.");
671
- }
672
- if ("key" in target) {
673
- const key = target.key;
674
- if (typeof key === "string" || Array.isArray(key)) return;
675
- } else if ("path" in target && typeof target.path === "string") {
676
- return;
677
- } else if ("tag" in target && typeof target.tag === "string") {
678
- return;
679
- }
680
- throw new TypeError("Cache invalidation targets must contain a string/array key, path, or tag.");
681
- }
682
- __name(assertFarmCacheInvalidationTarget, "assertFarmCacheInvalidationTarget");
683
- function getFunctionCacheIdentity(fn) {
684
- if (fn.name) {
685
- return `name:${fn.name}`;
686
- }
687
- let id = functionIds.get(fn);
688
- if (!id) {
689
- id = ++nextFunctionId;
690
- functionIds.set(fn, id);
691
- }
692
- return `anonymous:${id}`;
693
- }
694
- __name(getFunctionCacheIdentity, "getFunctionCacheIdentity");
695
- function stableSerialize(value, seen = /* @__PURE__ */ new WeakSet()) {
696
- if (value === null) return "null";
697
- if (value === void 0) return "undefined";
698
- const valueType = typeof value;
699
- if (valueType === "string") return JSON.stringify(value);
700
- if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
701
- return `${valueType}:${String(value)}`;
702
- }
703
- if (valueType === "symbol") {
704
- return `symbol:${String(value)}`;
705
- }
706
- if (valueType === "function") {
707
- return `function:${getFunctionCacheIdentity(value)}`;
708
- }
709
- if (value instanceof Date) {
710
- return `date:${value.toISOString()}`;
711
- }
712
- if (value instanceof URL) {
713
- return `url:${value.toString()}`;
714
- }
715
- if (value instanceof RegExp) {
716
- return `regexp:${value.toString()}`;
717
- }
718
- if (Array.isArray(value)) {
719
- return `[${value.map((item) => stableSerialize(item, seen)).join(",")}]`;
720
- }
721
- if (value && typeof value === "object") {
722
- if (seen.has(value)) {
723
- return "[Circular]";
724
- }
725
- seen.add(value);
726
- const entries = Object.entries(value).sort(
727
- ([a], [b]) => a.localeCompare(b)
728
- );
729
- const serialized = entries.map(([key, item]) => `${JSON.stringify(key)}:${stableSerialize(item, seen)}`).join(",");
730
- seen.delete(value);
731
- return `{${serialized}}`;
732
- }
733
- return String(value);
734
- }
735
- __name(stableSerialize, "stableSerialize");
736
-
737
- export {
738
- defineCacheKey,
739
- storageCacheAdapter,
740
- FarmDataCache,
741
- getFarmDataCache,
742
- configureFarmCache,
743
- unstable_cache,
744
- revalidateTag,
745
- updateTag,
746
- revalidatePath,
747
- invalidate,
748
- invalidateRouteData,
749
- applyFarmCacheInvalidationTargets,
750
- createPathCacheTag,
751
- createRouteDataCacheTag,
752
- createRouteDataCacheKey,
753
- normalizeRevalidatePath,
754
- createFarmCacheKey
755
- };
756
- //# sourceMappingURL=chunk-V3XURYJO.mjs.map