@farm.js/core 0.1.0-beta.5 → 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 (424) hide show
  1. package/package.json +1 -1
  2. package/dist/after.cjs +0 -227
  3. package/dist/after.cjs.map +0 -1
  4. package/dist/after.d.mts +0 -25
  5. package/dist/after.d.ts +0 -25
  6. package/dist/after.mjs +0 -14
  7. package/dist/after.mjs.map +0 -1
  8. package/dist/agent-runtime.cjs +0 -2379
  9. package/dist/agent-runtime.cjs.map +0 -1
  10. package/dist/agent-runtime.d.mts +0 -94
  11. package/dist/agent-runtime.d.ts +0 -94
  12. package/dist/agent-runtime.mjs +0 -479
  13. package/dist/agent-runtime.mjs.map +0 -1
  14. package/dist/api/route-manager.d.mts +0 -66
  15. package/dist/api/route-manager.d.ts +0 -66
  16. package/dist/api/runtime.d.mts +0 -3
  17. package/dist/api/runtime.d.ts +0 -3
  18. package/dist/api.cjs +0 -4100
  19. package/dist/api.cjs.map +0 -1
  20. package/dist/api.d.mts +0 -48
  21. package/dist/api.d.ts +0 -48
  22. package/dist/api.mjs +0 -93
  23. package/dist/api.mjs.map +0 -1
  24. package/dist/app-BjN-da13.d.ts +0 -300
  25. package/dist/app-CakAr8Be.d.mts +0 -300
  26. package/dist/app-markdown.cjs +0 -220
  27. package/dist/app-markdown.cjs.map +0 -1
  28. package/dist/app-markdown.d.mts +0 -22
  29. package/dist/app-markdown.d.ts +0 -22
  30. package/dist/app-markdown.mjs +0 -26
  31. package/dist/app-markdown.mjs.map +0 -1
  32. package/dist/cache.cjs +0 -945
  33. package/dist/cache.cjs.map +0 -1
  34. package/dist/cache.d.mts +0 -192
  35. package/dist/cache.d.ts +0 -192
  36. package/dist/cache.mjs +0 -46
  37. package/dist/cache.mjs.map +0 -1
  38. package/dist/chunk-2CUKEMVR.mjs +0 -872
  39. package/dist/chunk-2CUKEMVR.mjs.map +0 -1
  40. package/dist/chunk-2ED5Q2GH.mjs +0 -422
  41. package/dist/chunk-2ED5Q2GH.mjs.map +0 -1
  42. package/dist/chunk-2NHCNRF6.mjs +0 -6241
  43. package/dist/chunk-2NHCNRF6.mjs.map +0 -1
  44. package/dist/chunk-32W4QEJP.mjs +0 -158
  45. package/dist/chunk-32W4QEJP.mjs.map +0 -1
  46. package/dist/chunk-3XNTL3FQ.mjs +0 -452
  47. package/dist/chunk-3XNTL3FQ.mjs.map +0 -1
  48. package/dist/chunk-44ZCFSKE.mjs +0 -84
  49. package/dist/chunk-44ZCFSKE.mjs.map +0 -1
  50. package/dist/chunk-4S3ORGFA.mjs +0 -44
  51. package/dist/chunk-4S3ORGFA.mjs.map +0 -1
  52. package/dist/chunk-5BY76U2M.mjs +0 -1
  53. package/dist/chunk-5BY76U2M.mjs.map +0 -1
  54. package/dist/chunk-5ZGPRGWV.mjs +0 -136
  55. package/dist/chunk-5ZGPRGWV.mjs.map +0 -1
  56. package/dist/chunk-65A7QIKI.mjs +0 -142
  57. package/dist/chunk-65A7QIKI.mjs.map +0 -1
  58. package/dist/chunk-74YTBPTY.mjs +0 -450
  59. package/dist/chunk-74YTBPTY.mjs.map +0 -1
  60. package/dist/chunk-7HO6AEOP.mjs +0 -74
  61. package/dist/chunk-7HO6AEOP.mjs.map +0 -1
  62. package/dist/chunk-7MABZJIM.mjs +0 -29
  63. package/dist/chunk-7MABZJIM.mjs.map +0 -1
  64. package/dist/chunk-7N62DNSO.mjs +0 -41
  65. package/dist/chunk-7N62DNSO.mjs.map +0 -1
  66. package/dist/chunk-7ZY5AIJO.mjs +0 -161
  67. package/dist/chunk-7ZY5AIJO.mjs.map +0 -1
  68. package/dist/chunk-A2LUXHD2.mjs +0 -7631
  69. package/dist/chunk-A2LUXHD2.mjs.map +0 -1
  70. package/dist/chunk-ALCLXXTY.mjs +0 -187
  71. package/dist/chunk-ALCLXXTY.mjs.map +0 -1
  72. package/dist/chunk-AZ7YUVNR.mjs +0 -65
  73. package/dist/chunk-AZ7YUVNR.mjs.map +0 -1
  74. package/dist/chunk-B232I2GP.mjs +0 -163
  75. package/dist/chunk-B232I2GP.mjs.map +0 -1
  76. package/dist/chunk-BHG3LVHH.mjs +0 -176
  77. package/dist/chunk-BHG3LVHH.mjs.map +0 -1
  78. package/dist/chunk-C2ROET2V.mjs +0 -718
  79. package/dist/chunk-C2ROET2V.mjs.map +0 -1
  80. package/dist/chunk-C3DLZMBU.mjs +0 -597
  81. package/dist/chunk-C3DLZMBU.mjs.map +0 -1
  82. package/dist/chunk-CGILA3WO.mjs +0 -14
  83. package/dist/chunk-CGILA3WO.mjs.map +0 -1
  84. package/dist/chunk-E2MPIBRE.mjs +0 -149
  85. package/dist/chunk-E2MPIBRE.mjs.map +0 -1
  86. package/dist/chunk-E6EPN5BT.mjs +0 -203
  87. package/dist/chunk-E6EPN5BT.mjs.map +0 -1
  88. package/dist/chunk-EEABSBKK.mjs +0 -10
  89. package/dist/chunk-EEABSBKK.mjs.map +0 -1
  90. package/dist/chunk-EJ7T4TPB.mjs +0 -622
  91. package/dist/chunk-EJ7T4TPB.mjs.map +0 -1
  92. package/dist/chunk-FQYDHKKU.mjs +0 -128
  93. package/dist/chunk-FQYDHKKU.mjs.map +0 -1
  94. package/dist/chunk-FRPWCMMG.mjs +0 -299
  95. package/dist/chunk-FRPWCMMG.mjs.map +0 -1
  96. package/dist/chunk-GN72QAIH.mjs +0 -146
  97. package/dist/chunk-GN72QAIH.mjs.map +0 -1
  98. package/dist/chunk-GQVGIUSN.mjs +0 -149
  99. package/dist/chunk-GQVGIUSN.mjs.map +0 -1
  100. package/dist/chunk-GS6K5OCM.mjs +0 -407
  101. package/dist/chunk-GS6K5OCM.mjs.map +0 -1
  102. package/dist/chunk-GXASWWJU.mjs +0 -364
  103. package/dist/chunk-GXASWWJU.mjs.map +0 -1
  104. package/dist/chunk-GY2STC2S.mjs +0 -180
  105. package/dist/chunk-GY2STC2S.mjs.map +0 -1
  106. package/dist/chunk-H2FA2SBS.mjs +0 -51
  107. package/dist/chunk-H2FA2SBS.mjs.map +0 -1
  108. package/dist/chunk-HNIQFZKB.mjs +0 -3550
  109. package/dist/chunk-HNIQFZKB.mjs.map +0 -1
  110. package/dist/chunk-ITN462YM.mjs +0 -98
  111. package/dist/chunk-ITN462YM.mjs.map +0 -1
  112. package/dist/chunk-J23HNLFY.mjs +0 -72
  113. package/dist/chunk-J23HNLFY.mjs.map +0 -1
  114. package/dist/chunk-J4FNJ5IU.mjs +0 -179
  115. package/dist/chunk-J4FNJ5IU.mjs.map +0 -1
  116. package/dist/chunk-J5YWQVI5.mjs +0 -211
  117. package/dist/chunk-J5YWQVI5.mjs.map +0 -1
  118. package/dist/chunk-JDEOUK5V.mjs +0 -427
  119. package/dist/chunk-JDEOUK5V.mjs.map +0 -1
  120. package/dist/chunk-JK25YEN6.mjs +0 -219
  121. package/dist/chunk-JK25YEN6.mjs.map +0 -1
  122. package/dist/chunk-K4667E2Q.mjs +0 -1916
  123. package/dist/chunk-K4667E2Q.mjs.map +0 -1
  124. package/dist/chunk-LGHEOHBU.mjs +0 -218
  125. package/dist/chunk-LGHEOHBU.mjs.map +0 -1
  126. package/dist/chunk-LLC7BNXW.mjs +0 -275
  127. package/dist/chunk-LLC7BNXW.mjs.map +0 -1
  128. package/dist/chunk-LM2YNO4U.mjs +0 -24
  129. package/dist/chunk-LM2YNO4U.mjs.map +0 -1
  130. package/dist/chunk-MIUW47JX.mjs +0 -639
  131. package/dist/chunk-MIUW47JX.mjs.map +0 -1
  132. package/dist/chunk-NM3CRAAL.mjs +0 -467
  133. package/dist/chunk-NM3CRAAL.mjs.map +0 -1
  134. package/dist/chunk-NNLCAVB6.mjs +0 -391
  135. package/dist/chunk-NNLCAVB6.mjs.map +0 -1
  136. package/dist/chunk-P7QDS5AT.mjs +0 -191
  137. package/dist/chunk-P7QDS5AT.mjs.map +0 -1
  138. package/dist/chunk-PFE6GMNE.mjs +0 -603
  139. package/dist/chunk-PFE6GMNE.mjs.map +0 -1
  140. package/dist/chunk-QGOHVJ6J.mjs +0 -63
  141. package/dist/chunk-QGOHVJ6J.mjs.map +0 -1
  142. package/dist/chunk-QGQX7SFC.mjs +0 -180
  143. package/dist/chunk-QGQX7SFC.mjs.map +0 -1
  144. package/dist/chunk-QKVUNGAH.mjs +0 -39
  145. package/dist/chunk-QKVUNGAH.mjs.map +0 -1
  146. package/dist/chunk-QM746KUO.mjs +0 -56
  147. package/dist/chunk-QM746KUO.mjs.map +0 -1
  148. package/dist/chunk-QTZZ2ISQ.mjs +0 -753
  149. package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
  150. package/dist/chunk-RBRLLZL5.mjs +0 -81
  151. package/dist/chunk-RBRLLZL5.mjs.map +0 -1
  152. package/dist/chunk-RHIFZZUI.mjs +0 -69
  153. package/dist/chunk-RHIFZZUI.mjs.map +0 -1
  154. package/dist/chunk-RSKVYESE.mjs +0 -187
  155. package/dist/chunk-RSKVYESE.mjs.map +0 -1
  156. package/dist/chunk-SCFX4UTD.mjs +0 -28
  157. package/dist/chunk-SCFX4UTD.mjs.map +0 -1
  158. package/dist/chunk-SL6HTIOK.mjs +0 -66
  159. package/dist/chunk-SL6HTIOK.mjs.map +0 -1
  160. package/dist/chunk-SPBBQLXI.mjs +0 -207
  161. package/dist/chunk-SPBBQLXI.mjs.map +0 -1
  162. package/dist/chunk-T4QJQK76.mjs +0 -459
  163. package/dist/chunk-T4QJQK76.mjs.map +0 -1
  164. package/dist/chunk-TQAEEJB4.mjs +0 -157
  165. package/dist/chunk-TQAEEJB4.mjs.map +0 -1
  166. package/dist/chunk-UB5UOSHB.mjs +0 -458
  167. package/dist/chunk-UB5UOSHB.mjs.map +0 -1
  168. package/dist/chunk-USWZZUEH.mjs +0 -25
  169. package/dist/chunk-USWZZUEH.mjs.map +0 -1
  170. package/dist/chunk-UVCIEUJC.mjs +0 -16
  171. package/dist/chunk-UVCIEUJC.mjs.map +0 -1
  172. package/dist/chunk-UXUAWNO5.mjs +0 -396
  173. package/dist/chunk-UXUAWNO5.mjs.map +0 -1
  174. package/dist/chunk-V3XURYJO.mjs +0 -756
  175. package/dist/chunk-V3XURYJO.mjs.map +0 -1
  176. package/dist/chunk-V6WE6JSZ.mjs +0 -352
  177. package/dist/chunk-V6WE6JSZ.mjs.map +0 -1
  178. package/dist/chunk-V7RBCSDJ.mjs +0 -170
  179. package/dist/chunk-V7RBCSDJ.mjs.map +0 -1
  180. package/dist/chunk-VCANOYFI.mjs +0 -588
  181. package/dist/chunk-VCANOYFI.mjs.map +0 -1
  182. package/dist/chunk-VY2UYN5R.mjs +0 -224
  183. package/dist/chunk-VY2UYN5R.mjs.map +0 -1
  184. package/dist/chunk-W2CRQFF6.mjs +0 -1352
  185. package/dist/chunk-W2CRQFF6.mjs.map +0 -1
  186. package/dist/chunk-WZ5QFROO.mjs +0 -23
  187. package/dist/chunk-WZ5QFROO.mjs.map +0 -1
  188. package/dist/chunk-XIVV5IWN.mjs +0 -541
  189. package/dist/chunk-XIVV5IWN.mjs.map +0 -1
  190. package/dist/chunk-YW7OBE6Q.mjs +0 -119
  191. package/dist/chunk-YW7OBE6Q.mjs.map +0 -1
  192. package/dist/chunk-Z5CQMP54.mjs +0 -365
  193. package/dist/chunk-Z5CQMP54.mjs.map +0 -1
  194. package/dist/chunk-ZBE6MLHL.mjs +0 -230
  195. package/dist/chunk-ZBE6MLHL.mjs.map +0 -1
  196. package/dist/chunk-ZZ57EH5Z.mjs +0 -173
  197. package/dist/chunk-ZZ57EH5Z.mjs.map +0 -1
  198. package/dist/client-BT1mFQas.d.mts +0 -447
  199. package/dist/client-Nn0q4eO4.d.ts +0 -447
  200. package/dist/client-cache-CIlyBlmx.d.ts +0 -6
  201. package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
  202. package/dist/client-plugins-Cw4qUGsw.d.ts +0 -1855
  203. package/dist/client-plugins-DQQ1adXM.d.mts +0 -1855
  204. package/dist/client-plugins.cjs +0 -415
  205. package/dist/client-plugins.cjs.map +0 -1
  206. package/dist/client-plugins.d.mts +0 -22
  207. package/dist/client-plugins.d.ts +0 -22
  208. package/dist/client-plugins.mjs +0 -10
  209. package/dist/client-plugins.mjs.map +0 -1
  210. package/dist/client.cjs +0 -5402
  211. package/dist/client.cjs.map +0 -1
  212. package/dist/client.d.mts +0 -447
  213. package/dist/client.d.ts +0 -447
  214. package/dist/client.mjs +0 -110
  215. package/dist/client.mjs.map +0 -1
  216. package/dist/config.cjs +0 -38
  217. package/dist/config.cjs.map +0 -1
  218. package/dist/config.d.mts +0 -29
  219. package/dist/config.d.ts +0 -29
  220. package/dist/config.mjs +0 -10
  221. package/dist/config.mjs.map +0 -1
  222. package/dist/cron.cjs +0 -406
  223. package/dist/cron.cjs.map +0 -1
  224. package/dist/cron.d.mts +0 -78
  225. package/dist/cron.d.ts +0 -78
  226. package/dist/cron.mjs +0 -30
  227. package/dist/cron.mjs.map +0 -1
  228. package/dist/deferred.cjs +0 -438
  229. package/dist/deferred.cjs.map +0 -1
  230. package/dist/deferred.d.mts +0 -42
  231. package/dist/deferred.d.ts +0 -42
  232. package/dist/deferred.mjs +0 -28
  233. package/dist/deferred.mjs.map +0 -1
  234. package/dist/deployment.cjs +0 -199
  235. package/dist/deployment.cjs.map +0 -1
  236. package/dist/deployment.d.mts +0 -34
  237. package/dist/deployment.d.ts +0 -34
  238. package/dist/deployment.mjs +0 -38
  239. package/dist/deployment.mjs.map +0 -1
  240. package/dist/devtools-LVC3VB5P.mjs +0 -370
  241. package/dist/devtools-LVC3VB5P.mjs.map +0 -1
  242. package/dist/devtools-client-3XRTBND5.mjs +0 -216
  243. package/dist/devtools-client-3XRTBND5.mjs.map +0 -1
  244. package/dist/devtools-ui-NJKFORTG.mjs +0 -1349
  245. package/dist/devtools-ui-NJKFORTG.mjs.map +0 -1
  246. package/dist/docs.cjs +0 -5553
  247. package/dist/docs.cjs.map +0 -1
  248. package/dist/docs.d.mts +0 -69
  249. package/dist/docs.d.ts +0 -69
  250. package/dist/docs.mjs +0 -46
  251. package/dist/docs.mjs.map +0 -1
  252. package/dist/env-types.cjs +0 -223
  253. package/dist/env-types.cjs.map +0 -1
  254. package/dist/env-types.d.mts +0 -11
  255. package/dist/env-types.d.ts +0 -11
  256. package/dist/env-types.mjs +0 -9
  257. package/dist/env-types.mjs.map +0 -1
  258. package/dist/env.cjs +0 -215
  259. package/dist/env.cjs.map +0 -1
  260. package/dist/env.d.mts +0 -45
  261. package/dist/env.d.ts +0 -45
  262. package/dist/env.mjs +0 -22
  263. package/dist/env.mjs.map +0 -1
  264. package/dist/environment/vite.d.mts +0 -22
  265. package/dist/environment/vite.d.ts +0 -22
  266. package/dist/environment.cjs +0 -96
  267. package/dist/environment.cjs.map +0 -1
  268. package/dist/environment.d.mts +0 -18
  269. package/dist/environment.d.ts +0 -18
  270. package/dist/environment.mjs +0 -14
  271. package/dist/environment.mjs.map +0 -1
  272. package/dist/headers.cjs +0 -126
  273. package/dist/headers.cjs.map +0 -1
  274. package/dist/headers.d.mts +0 -22
  275. package/dist/headers.d.ts +0 -22
  276. package/dist/headers.mjs +0 -12
  277. package/dist/headers.mjs.map +0 -1
  278. package/dist/i18n/client.d.mts +0 -32
  279. package/dist/i18n/client.d.ts +0 -32
  280. package/dist/i18n/index.d.mts +0 -20
  281. package/dist/i18n/index.d.ts +0 -20
  282. package/dist/i18n/server.d.mts +0 -30
  283. package/dist/i18n/server.d.ts +0 -30
  284. package/dist/image/server.d.mts +0 -37
  285. package/dist/image/server.d.ts +0 -37
  286. package/dist/image/sharp.d.mts +0 -7
  287. package/dist/image/sharp.d.ts +0 -7
  288. package/dist/image-config-Duob7wER.d.mts +0 -50
  289. package/dist/image-config-Duob7wER.d.ts +0 -50
  290. package/dist/image.cjs +0 -209
  291. package/dist/image.cjs.map +0 -1
  292. package/dist/image.d.mts +0 -39
  293. package/dist/image.d.ts +0 -39
  294. package/dist/image.mjs +0 -165
  295. package/dist/image.mjs.map +0 -1
  296. package/dist/index.cjs +0 -41822
  297. package/dist/index.cjs.map +0 -1
  298. package/dist/index.d.mts +0 -451
  299. package/dist/index.d.ts +0 -451
  300. package/dist/index.mjs +0 -973
  301. package/dist/index.mjs.map +0 -1
  302. package/dist/integration-api-CHT2OKAf.d.mts +0 -93
  303. package/dist/integration-api-CHT2OKAf.d.ts +0 -93
  304. package/dist/integration-orm-GQLGU66X.mjs +0 -13
  305. package/dist/integration-orm-GQLGU66X.mjs.map +0 -1
  306. package/dist/integrations.cjs +0 -2820
  307. package/dist/integrations.cjs.map +0 -1
  308. package/dist/integrations.d.mts +0 -22
  309. package/dist/integrations.d.ts +0 -22
  310. package/dist/integrations.mjs +0 -51
  311. package/dist/integrations.mjs.map +0 -1
  312. package/dist/internal/build-runtime.d.mts +0 -39
  313. package/dist/internal/build-runtime.d.ts +0 -39
  314. package/dist/internal/client-runtime.d.mts +0 -2
  315. package/dist/internal/client-runtime.d.ts +0 -2
  316. package/dist/internal/config-runtime.d.mts +0 -39
  317. package/dist/internal/config-runtime.d.ts +0 -39
  318. package/dist/internal/production-node-env.d.mts +0 -12
  319. package/dist/internal/production-node-env.d.ts +0 -12
  320. package/dist/internal/production-runtime.d.mts +0 -39
  321. package/dist/internal/production-runtime.d.ts +0 -39
  322. package/dist/layers-VWVDTPUZ.mjs +0 -16
  323. package/dist/layers-VWVDTPUZ.mjs.map +0 -1
  324. package/dist/manager-THKFTOFE.mjs +0 -10
  325. package/dist/manager-THKFTOFE.mjs.map +0 -1
  326. package/dist/markdown.cjs +0 -299
  327. package/dist/markdown.cjs.map +0 -1
  328. package/dist/markdown.d.mts +0 -43
  329. package/dist/markdown.d.ts +0 -43
  330. package/dist/markdown.mjs +0 -14
  331. package/dist/markdown.mjs.map +0 -1
  332. package/dist/metadata-BAPg_Nmo.d.ts +0 -22
  333. package/dist/metadata-_6i9oFG3.d.mts +0 -22
  334. package/dist/middleware.cjs +0 -2148
  335. package/dist/middleware.cjs.map +0 -1
  336. package/dist/middleware.d.mts +0 -164
  337. package/dist/middleware.d.ts +0 -164
  338. package/dist/middleware.mjs +0 -49
  339. package/dist/middleware.mjs.map +0 -1
  340. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  341. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  342. package/dist/navigation.cjs +0 -1329
  343. package/dist/navigation.cjs.map +0 -1
  344. package/dist/navigation.d.mts +0 -14
  345. package/dist/navigation.d.ts +0 -14
  346. package/dist/navigation.mjs +0 -33
  347. package/dist/navigation.mjs.map +0 -1
  348. package/dist/nitro-QO5LV6QK.mjs +0 -689
  349. package/dist/nitro-QO5LV6QK.mjs.map +0 -1
  350. package/dist/observability.cjs +0 -186
  351. package/dist/observability.cjs.map +0 -1
  352. package/dist/observability.d.mts +0 -335
  353. package/dist/observability.d.ts +0 -335
  354. package/dist/observability.mjs +0 -16
  355. package/dist/observability.mjs.map +0 -1
  356. package/dist/params-BALtrRim.d.ts +0 -15
  357. package/dist/params-ry-lxqmy.d.mts +0 -15
  358. package/dist/plugin-BJDf43dc.d.mts +0 -165
  359. package/dist/plugin-BJDf43dc.d.ts +0 -165
  360. package/dist/plugin.cjs +0 -23225
  361. package/dist/plugin.d.mts +0 -22
  362. package/dist/plugin.d.ts +0 -22
  363. package/dist/production-runtime-BoJDc5mc.d.ts +0 -79
  364. package/dist/production-runtime-C_B79w2P.d.mts +0 -28
  365. package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
  366. package/dist/production-runtime-DPfgMV9Y.d.mts +0 -79
  367. package/dist/query/client.d.mts +0 -61
  368. package/dist/query/client.d.ts +0 -61
  369. package/dist/query/index.d.mts +0 -90
  370. package/dist/query/index.d.ts +0 -90
  371. package/dist/query/parsers.d.mts +0 -25
  372. package/dist/query/parsers.d.ts +0 -25
  373. package/dist/query/server.d.mts +0 -55
  374. package/dist/query/server.d.ts +0 -55
  375. package/dist/request-BrFBuc8G.d.mts +0 -6
  376. package/dist/request-BslSZIRz.d.ts +0 -6
  377. package/dist/request.d.mts +0 -2
  378. package/dist/request.d.ts +0 -2
  379. package/dist/resolver-C6iecsDV.d.ts +0 -14
  380. package/dist/resolver-DlOPpjkB.d.mts +0 -14
  381. package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
  382. package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
  383. package/dist/router.d.mts +0 -36
  384. package/dist/router.d.ts +0 -36
  385. package/dist/routes.d.mts +0 -224
  386. package/dist/routes.d.ts +0 -224
  387. package/dist/runtime-9nQjVM7X.d.mts +0 -206
  388. package/dist/runtime-B6GvwDS1.d.ts +0 -27
  389. package/dist/runtime-DeAAZ6gO.d.mts +0 -27
  390. package/dist/runtime-DgeS2skB.d.ts +0 -206
  391. package/dist/server-action-security.d.mts +0 -43
  392. package/dist/server-action-security.d.ts +0 -43
  393. package/dist/server-fn-client.d.mts +0 -32
  394. package/dist/server-fn-client.d.ts +0 -32
  395. package/dist/server-fn.d.mts +0 -93
  396. package/dist/server-fn.d.ts +0 -93
  397. package/dist/server-plugins.d.mts +0 -55
  398. package/dist/server-plugins.d.ts +0 -55
  399. package/dist/server-query-client.d.mts +0 -50
  400. package/dist/server-query-client.d.ts +0 -50
  401. package/dist/server-query.d.mts +0 -36
  402. package/dist/server-query.d.ts +0 -36
  403. package/dist/server.d.mts +0 -48
  404. package/dist/server.d.ts +0 -48
  405. package/dist/storage.d.mts +0 -52
  406. package/dist/storage.d.ts +0 -52
  407. package/dist/testing.d.mts +0 -101
  408. package/dist/testing.d.ts +0 -101
  409. package/dist/transport-BmbGTXA5.d.mts +0 -49
  410. package/dist/transport-BmbGTXA5.d.ts +0 -49
  411. package/dist/types-BH1lhg5G.d.mts +0 -81
  412. package/dist/types-BH1lhg5G.d.ts +0 -81
  413. package/dist/types-C9N-nk5R.d.mts +0 -53
  414. package/dist/types-C9N-nk5R.d.ts +0 -53
  415. package/dist/types-D1A6-XvH.d.mts +0 -73
  416. package/dist/types-D1A6-XvH.d.ts +0 -73
  417. package/dist/utils-CHXlMDkg.d.mts +0 -23
  418. package/dist/utils-Drsyz1Vj.d.ts +0 -23
  419. package/dist/version.d.mts +0 -3
  420. package/dist/version.d.ts +0 -3
  421. package/dist/vite.d.mts +0 -22
  422. package/dist/vite.d.ts +0 -22
  423. package/dist/workflows.d.mts +0 -110
  424. 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