emdash 0.20.0 → 0.22.0

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 (685) hide show
  1. package/dist/{adapters-BzIHV3sw.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
  2. package/dist/{adapters-BzIHV3sw.d.mts.map → adapters-hUy8vOB-.d.mts.map} +1 -1
  3. package/dist/after-B1IIdH3Y.mjs +29 -0
  4. package/dist/after-B1IIdH3Y.mjs.map +1 -0
  5. package/dist/{allowed-origins-B1u7Qnvg.mjs → allowed-origins-DjlhyfNN.mjs} +2 -2
  6. package/dist/{allowed-origins-B1u7Qnvg.mjs.map → allowed-origins-DjlhyfNN.mjs.map} +1 -1
  7. package/dist/api/route-utils.d.mts +3 -3
  8. package/dist/api/route-utils.mjs +20 -18
  9. package/dist/api/route-utils.mjs.map +1 -1
  10. package/dist/api/schemas/index.d.mts +2 -2
  11. package/dist/api/schemas/index.mjs +4 -3
  12. package/dist/{api-DStv36ik.mjs → api-BDuM4bEy.mjs} +31 -25
  13. package/dist/api-BDuM4bEy.mjs.map +1 -0
  14. package/dist/{api-tokens-DPfhPu5V.mjs → api-tokens-ViYKeIp9.mjs} +13 -3
  15. package/dist/api-tokens-ViYKeIp9.mjs.map +1 -0
  16. package/dist/{apply-Dr7snAMT.mjs → apply-wDqQoxX4.mjs} +18 -18
  17. package/dist/{apply-Dr7snAMT.mjs.map → apply-wDqQoxX4.mjs.map} +1 -1
  18. package/dist/astro/image-endpoint.d.mts +8 -0
  19. package/dist/astro/image-endpoint.d.mts.map +1 -0
  20. package/dist/astro/image-endpoint.mjs +55 -0
  21. package/dist/astro/image-endpoint.mjs.map +1 -0
  22. package/dist/astro/index.d.mts +36 -11
  23. package/dist/astro/index.d.mts.map +1 -1
  24. package/dist/astro/index.mjs +160 -35
  25. package/dist/astro/index.mjs.map +1 -1
  26. package/dist/astro/middleware/auth.d.mts +9 -9
  27. package/dist/astro/middleware/auth.d.mts.map +1 -1
  28. package/dist/astro/middleware/auth.mjs +12 -10
  29. package/dist/astro/middleware/auth.mjs.map +1 -1
  30. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  31. package/dist/astro/middleware/redirect.mjs +14 -5
  32. package/dist/astro/middleware/redirect.mjs.map +1 -1
  33. package/dist/astro/middleware/request-context.mjs +5 -4
  34. package/dist/astro/middleware/request-context.mjs.map +1 -1
  35. package/dist/astro/middleware/setup.mjs +1 -1
  36. package/dist/astro/middleware.d.mts +1 -1
  37. package/dist/astro/middleware.d.mts.map +1 -1
  38. package/dist/astro/middleware.mjs +157 -80
  39. package/dist/astro/middleware.mjs.map +1 -1
  40. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
  41. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
  42. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
  43. package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
  44. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
  45. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  46. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
  47. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -9
  48. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
  49. package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -9
  50. package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
  51. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -9
  52. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
  53. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
  54. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
  55. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
  56. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  57. package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
  58. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
  59. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +15 -12
  60. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  61. package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -6
  62. package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
  63. package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -9
  64. package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
  65. package/dist/astro/routes/api/admin/comments/counts.mjs +8 -6
  66. package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
  67. package/dist/astro/routes/api/admin/comments/index.mjs +12 -9
  68. package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
  69. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
  70. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
  71. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
  72. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
  73. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +40 -37
  74. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  75. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +40 -37
  76. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  77. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +39 -36
  78. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  79. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +39 -36
  80. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  81. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +39 -36
  82. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  83. package/dist/astro/routes/api/admin/plugins/index.mjs +39 -36
  84. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  85. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
  86. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +39 -36
  87. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +39 -36
  89. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +39 -36
  91. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +39 -36
  93. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  94. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +40 -37
  95. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  96. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +39 -36
  97. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  98. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +40 -37
  99. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  100. package/dist/astro/routes/api/admin/plugins/updates.mjs +39 -36
  101. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  102. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +39 -36
  103. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  104. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
  105. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +39 -36
  106. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  107. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
  108. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
  109. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
  110. package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
  111. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
  112. package/dist/astro/routes/api/admin/users/index.mjs +7 -6
  113. package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
  114. package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -6
  115. package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
  116. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
  117. package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
  118. package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
  119. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
  120. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
  121. package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
  122. package/dist/astro/routes/api/auth/logout.mjs +4 -4
  123. package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
  124. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
  125. package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
  126. package/dist/astro/routes/api/auth/me.mjs +8 -7
  127. package/dist/astro/routes/api/auth/me.mjs.map +1 -1
  128. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  129. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
  130. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  131. package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -6
  132. package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
  133. package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
  134. package/dist/astro/routes/api/auth/passkey/options.mjs +13 -12
  135. package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
  136. package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -10
  137. package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
  138. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -11
  139. package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
  140. package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -11
  141. package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
  142. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
  143. package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
  144. package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
  145. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
  146. package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
  147. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +16 -13
  148. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  149. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +9 -0
  150. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -0
  151. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +179 -0
  152. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -0
  153. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
  154. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
  155. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
  156. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
  157. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -11
  158. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
  159. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -7
  160. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  161. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
  162. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
  163. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -7
  164. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
  165. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -14
  166. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  167. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
  168. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
  169. package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -7
  170. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  171. package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
  172. package/dist/astro/routes/api/content/_collection_/index.mjs +8 -7
  173. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
  174. package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -7
  175. package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
  176. package/dist/astro/routes/api/dashboard.mjs +10 -8
  177. package/dist/astro/routes/api/dashboard.mjs.map +1 -1
  178. package/dist/astro/routes/api/dev/emails.mjs +4 -4
  179. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  180. package/dist/astro/routes/api/import/probe.mjs +12 -11
  181. package/dist/astro/routes/api/import/probe.mjs.map +1 -1
  182. package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
  183. package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
  184. package/dist/astro/routes/api/import/wordpress/execute.mjs +16 -14
  185. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  186. package/dist/astro/routes/api/import/wordpress/media.mjs +10 -9
  187. package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
  188. package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -10
  189. package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
  190. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +10 -9
  191. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
  192. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  193. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +12 -11
  194. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
  195. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  196. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
  197. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +18 -15
  198. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  199. package/dist/astro/routes/api/manifest.mjs +5 -5
  200. package/dist/astro/routes/api/mcp.mjs +213 -45
  201. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  202. package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -7
  203. package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
  204. package/dist/astro/routes/api/media/_id_.mjs +8 -7
  205. package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
  206. package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
  207. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
  208. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
  209. package/dist/astro/routes/api/media/providers/index.mjs +4 -4
  210. package/dist/astro/routes/api/media/upload-url.mjs +10 -9
  211. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  212. package/dist/astro/routes/api/media.mjs +13 -12
  213. package/dist/astro/routes/api/media.mjs.map +1 -1
  214. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -8
  215. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  216. package/dist/astro/routes/api/menus/_name_/items.mjs +11 -8
  217. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  218. package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -8
  219. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  220. package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -8
  221. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  222. package/dist/astro/routes/api/menus/_name_.mjs +11 -8
  223. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  224. package/dist/astro/routes/api/menus/index.mjs +11 -8
  225. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  226. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  227. package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
  228. package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
  229. package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
  230. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  231. package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
  232. package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
  233. package/dist/astro/routes/api/oauth/token.mjs +7 -7
  234. package/dist/astro/routes/api/openapi.json.mjs +5 -4
  235. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  236. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
  237. package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
  238. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  239. package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
  240. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  241. package/dist/astro/routes/api/redirects/_id_.mjs +12 -11
  242. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  243. package/dist/astro/routes/api/redirects/index.mjs +12 -11
  244. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  245. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
  246. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
  247. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +39 -36
  248. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  249. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +39 -36
  250. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  251. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +39 -36
  252. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  253. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +39 -36
  254. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  255. package/dist/astro/routes/api/schema/collections/index.mjs +39 -36
  256. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  257. package/dist/astro/routes/api/schema/index.mjs +7 -7
  258. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +39 -36
  259. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  260. package/dist/astro/routes/api/schema/orphans/index.mjs +39 -36
  261. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  262. package/dist/astro/routes/api/search/enable.mjs +11 -10
  263. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  264. package/dist/astro/routes/api/search/index.mjs +10 -9
  265. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  266. package/dist/astro/routes/api/search/rebuild.mjs +11 -10
  267. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  268. package/dist/astro/routes/api/search/stats.mjs +7 -7
  269. package/dist/astro/routes/api/search/suggest.mjs +10 -9
  270. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  271. package/dist/astro/routes/api/sections/_slug_.mjs +10 -9
  272. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  273. package/dist/astro/routes/api/sections/index.mjs +10 -9
  274. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  275. package/dist/astro/routes/api/settings/email.mjs +6 -6
  276. package/dist/astro/routes/api/settings.mjs +16 -13
  277. package/dist/astro/routes/api/settings.mjs.map +1 -1
  278. package/dist/astro/routes/api/setup/admin-verify.mjs +13 -12
  279. package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
  280. package/dist/astro/routes/api/setup/admin.mjs +12 -11
  281. package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
  282. package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
  283. package/dist/astro/routes/api/setup/dev-bypass.mjs +29 -26
  284. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  285. package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
  286. package/dist/astro/routes/api/setup/index.mjs +29 -26
  287. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  288. package/dist/astro/routes/api/setup/status.mjs +5 -5
  289. package/dist/astro/routes/api/snapshot.d.mts.map +1 -1
  290. package/dist/astro/routes/api/snapshot.mjs +10 -8
  291. package/dist/astro/routes/api/snapshot.mjs.map +1 -1
  292. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -13
  293. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  294. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -13
  295. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  296. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -13
  297. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  298. package/dist/astro/routes/api/taxonomies/index.mjs +16 -13
  299. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  300. package/dist/astro/routes/api/themes/preview.mjs +8 -7
  301. package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
  302. package/dist/astro/routes/api/typegen.mjs +6 -6
  303. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  304. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  305. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  306. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +8 -7
  307. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  308. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -10
  309. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  310. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -10
  311. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  312. package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -7
  313. package/dist/astro/routes/api/widget-areas/index.mjs +11 -10
  314. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  315. package/dist/astro/routes/api/widget-components.mjs +4 -4
  316. package/dist/astro/routes/robots.txt.mjs +10 -8
  317. package/dist/astro/routes/robots.txt.mjs.map +1 -1
  318. package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -11
  319. package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
  320. package/dist/astro/routes/sitemap.xml.mjs +11 -9
  321. package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
  322. package/dist/astro/types.d.mts +16 -12
  323. package/dist/astro/types.d.mts.map +1 -1
  324. package/dist/auth/providers/github.d.mts +1 -1
  325. package/dist/auth/providers/google.d.mts +1 -1
  326. package/dist/{authorize-DsMSVSaY.mjs → authorize-C0EYoUeV.mjs} +2 -2
  327. package/dist/{authorize-DsMSVSaY.mjs.map → authorize-C0EYoUeV.mjs.map} +1 -1
  328. package/dist/{base64-CqR-7kqF.mjs → base64-CmWvODNW.mjs} +1 -1
  329. package/dist/{base64-CqR-7kqF.mjs.map → base64-CmWvODNW.mjs.map} +1 -1
  330. package/dist/{byline-DUx48sJp.mjs → byline-CC0WS4Gu.mjs} +40 -18
  331. package/dist/byline-CC0WS4Gu.mjs.map +1 -0
  332. package/dist/{byline-fields-8TMtkBnH.mjs → byline-fields-53i9Et0x.mjs} +3 -3
  333. package/dist/{byline-fields-8TMtkBnH.mjs.map → byline-fields-53i9Et0x.mjs.map} +1 -1
  334. package/dist/{byline-fields--WxSNS79.mjs → byline-fields-DNp0HNKc.mjs} +2 -2
  335. package/dist/{byline-fields--WxSNS79.mjs.map → byline-fields-DNp0HNKc.mjs.map} +1 -1
  336. package/dist/{byline-fields-DbibsvTl.d.mts → byline-fields-jy07PZJM.d.mts} +9 -4
  337. package/dist/byline-fields-jy07PZJM.d.mts.map +1 -0
  338. package/dist/{byline-registry-CWP7I71B.mjs → byline-registry-BOjqDOim.mjs} +3 -3
  339. package/dist/{byline-registry-CWP7I71B.mjs.map → byline-registry-BOjqDOim.mjs.map} +1 -1
  340. package/dist/{bylines-s8c2DXbH.mjs → bylines-CCO1CYnH.mjs} +8 -8
  341. package/dist/{bylines-s8c2DXbH.mjs.map → bylines-CCO1CYnH.mjs.map} +1 -1
  342. package/dist/{bylines-BdxWCnPL.mjs → bylines-DGekMGGm.mjs} +10 -4
  343. package/dist/{bylines-BdxWCnPL.mjs.map → bylines-DGekMGGm.mjs.map} +1 -1
  344. package/dist/{cache-B_HzASVT.mjs → cache-pXTpun6s.mjs} +3 -3
  345. package/dist/{cache-B_HzASVT.mjs.map → cache-pXTpun6s.mjs.map} +1 -1
  346. package/dist/{challenge-store-DXX3rfdI.mjs → challenge-store-C6E_kWTs.mjs} +1 -1
  347. package/dist/{challenge-store-DXX3rfdI.mjs.map → challenge-store-C6E_kWTs.mjs.map} +1 -1
  348. package/dist/{chunks-BerYVuve.mjs → chunks-SyjZaYwV.mjs} +2 -2
  349. package/dist/{chunks-BerYVuve.mjs.map → chunks-SyjZaYwV.mjs.map} +1 -1
  350. package/dist/cli/index.mjs +29 -27
  351. package/dist/cli/index.mjs.map +1 -1
  352. package/dist/client/cf-access.d.mts +1 -1
  353. package/dist/client/index.d.mts +1 -1
  354. package/dist/client/index.mjs +2 -1
  355. package/dist/client/index.mjs.map +1 -1
  356. package/dist/{comment-sqQxNpN3.mjs → comment-80UyJJUR.mjs} +11 -3
  357. package/dist/comment-80UyJJUR.mjs.map +1 -0
  358. package/dist/comment-reaction-B6AdcpXw.mjs +85 -0
  359. package/dist/comment-reaction-B6AdcpXw.mjs.map +1 -0
  360. package/dist/{comments-Vkivawyl.mjs → comments-CtPkT2tp.mjs} +3 -3
  361. package/dist/{comments-Vkivawyl.mjs.map → comments-CtPkT2tp.mjs.map} +1 -1
  362. package/dist/{components-CK0cuUoH.mjs → components-D6ZnrzbB.mjs} +1 -1
  363. package/dist/{components-CK0cuUoH.mjs.map → components-D6ZnrzbB.mjs.map} +1 -1
  364. package/dist/{content-BIlVx-RX.mjs → content-2PTDNnoh.mjs} +22 -7
  365. package/dist/content-2PTDNnoh.mjs.map +1 -0
  366. package/dist/{context-Y7BRkWes.mjs → context-f1__jpzF.mjs} +11 -11
  367. package/dist/{context-Y7BRkWes.mjs.map → context-f1__jpzF.mjs.map} +1 -1
  368. package/dist/{cron-BJ2ClIlj.mjs → cron-CQPxBjYs.mjs} +1 -1
  369. package/dist/{cron-BJ2ClIlj.mjs.map → cron-CQPxBjYs.mjs.map} +1 -1
  370. package/dist/{dashboard-2JgAMWxK.mjs → dashboard-BOESNcwE.mjs} +4 -4
  371. package/dist/{dashboard-2JgAMWxK.mjs.map → dashboard-BOESNcwE.mjs.map} +1 -1
  372. package/dist/database/instrumentation.d.mts +19 -0
  373. package/dist/database/instrumentation.d.mts.map +1 -1
  374. package/dist/database/instrumentation.mjs +8 -1
  375. package/dist/database/instrumentation.mjs.map +1 -1
  376. package/dist/db/index.d.mts +3 -3
  377. package/dist/db/index.mjs +1 -1
  378. package/dist/db/libsql.d.mts +1 -1
  379. package/dist/db/postgres.d.mts +1 -1
  380. package/dist/db/sqlite.d.mts +1 -1
  381. package/dist/{db-errors-CtzxKBxe.mjs → db-errors-CrC5w3Jz.mjs} +1 -1
  382. package/dist/{db-errors-CtzxKBxe.mjs.map → db-errors-CrC5w3Jz.mjs.map} +1 -1
  383. package/dist/{default-IlBaTFxM.mjs → default-CpBEPn6a.mjs} +1 -1
  384. package/dist/{default-IlBaTFxM.mjs.map → default-CpBEPn6a.mjs.map} +1 -1
  385. package/dist/{device-flow-R23SIbQ2.mjs → device-flow-Bn-qiDrw.mjs} +5 -5
  386. package/dist/{device-flow-R23SIbQ2.mjs.map → device-flow-Bn-qiDrw.mjs.map} +1 -1
  387. package/dist/{email-console-DHT2Fbpj.mjs → email-console-B9VS6eN4.mjs} +1 -1
  388. package/dist/{email-console-DHT2Fbpj.mjs.map → email-console-B9VS6eN4.mjs.map} +1 -1
  389. package/dist/{error-RwM4dD35.mjs → error-BQ1pxs0L.mjs} +2 -2
  390. package/dist/{error-RwM4dD35.mjs.map → error-BQ1pxs0L.mjs.map} +1 -1
  391. package/dist/{escape-Ds07EEyu.mjs → escape-BtbJWyaW.mjs} +1 -1
  392. package/dist/{escape-Ds07EEyu.mjs.map → escape-BtbJWyaW.mjs.map} +1 -1
  393. package/dist/{fts-manager-1RgHmopc.mjs → fts-manager-DtiWqwNJ.mjs} +2 -2
  394. package/dist/{fts-manager-1RgHmopc.mjs.map → fts-manager-DtiWqwNJ.mjs.map} +1 -1
  395. package/dist/{hash-9w3pd3-m.mjs → hash-BowcuPwv.mjs} +1 -1
  396. package/dist/{hash-9w3pd3-m.mjs.map → hash-BowcuPwv.mjs.map} +1 -1
  397. package/dist/{import-Dh8bWmyq.mjs → import-DqSGOlmR.mjs} +4 -4
  398. package/dist/{import-Dh8bWmyq.mjs.map → import-DqSGOlmR.mjs.map} +1 -1
  399. package/dist/{index-B1keaX5Y.d.mts → index-C2dLNT6S.d.mts} +169 -14
  400. package/dist/index-C2dLNT6S.d.mts.map +1 -0
  401. package/dist/{index-DR56od45.d.mts → index-ZDEwR7qW.d.mts} +3 -3
  402. package/dist/{index-DR56od45.d.mts.map → index-ZDEwR7qW.d.mts.map} +1 -1
  403. package/dist/index.d.mts +18 -17
  404. package/dist/index.mjs +63 -59
  405. package/dist/init-lock-6b309ZrF.mjs +56 -0
  406. package/dist/init-lock-6b309ZrF.mjs.map +1 -0
  407. package/dist/{load-BBetCvLC.mjs → load-Dtoo7KcJ.mjs} +2 -2
  408. package/dist/{load-BBetCvLC.mjs.map → load-Dtoo7KcJ.mjs.map} +1 -1
  409. package/dist/{loader-ZN1ll-d-.mjs → loader-C8Z48Uof.mjs} +4 -4
  410. package/dist/{loader-ZN1ll-d-.mjs.map → loader-C8Z48Uof.mjs.map} +1 -1
  411. package/dist/{manifest-schema-BtwbL_vj.mjs → manifest-schema-DDSbwkAL.mjs} +1 -1
  412. package/dist/{manifest-schema-BtwbL_vj.mjs.map → manifest-schema-DDSbwkAL.mjs.map} +1 -1
  413. package/dist/media/image-endpoint.d.mts +74 -0
  414. package/dist/media/image-endpoint.d.mts.map +1 -0
  415. package/dist/media/image-endpoint.mjs +162 -0
  416. package/dist/media/image-endpoint.mjs.map +1 -0
  417. package/dist/media/index.d.mts +1 -1
  418. package/dist/media/index.mjs +2 -2
  419. package/dist/media/local-runtime.d.mts +11 -11
  420. package/dist/media/local-runtime.mjs +9 -7
  421. package/dist/media/local-runtime.mjs.map +1 -1
  422. package/dist/{media-JOf3pNkw.mjs → media-Bw0sA6rb.mjs} +2 -2
  423. package/dist/{media-JOf3pNkw.mjs.map → media-Bw0sA6rb.mjs.map} +1 -1
  424. package/dist/{media-allowlist-Dknq-OFY.mjs → media-allowlist-DunzrKFM.mjs} +2 -2
  425. package/dist/{media-allowlist-Dknq-OFY.mjs.map → media-allowlist-DunzrKFM.mjs.map} +1 -1
  426. package/dist/{media-url-VClf8glU.mjs → media-url-S22B6aPr.mjs} +1 -1
  427. package/dist/{media-url-VClf8glU.mjs.map → media-url-S22B6aPr.mjs.map} +1 -1
  428. package/dist/{menus-DX4_E01q.mjs → menus-CYs0WZoL.mjs} +20 -6
  429. package/dist/menus-CYs0WZoL.mjs.map +1 -0
  430. package/dist/{menus-DrQLusqj.mjs → menus-DOs1MQJg.mjs} +120 -20
  431. package/dist/menus-DOs1MQJg.mjs.map +1 -0
  432. package/dist/{mime-CCEzze7W.mjs → mime-DYpsOAny.mjs} +1 -1
  433. package/dist/{mime-CCEzze7W.mjs.map → mime-DYpsOAny.mjs.map} +1 -1
  434. package/dist/{mode-CO2vQHfq.mjs → mode-CFh8Dw8G.mjs} +1 -1
  435. package/dist/{mode-CO2vQHfq.mjs.map → mode-CFh8Dw8G.mjs.map} +1 -1
  436. package/dist/{normalize-CK5o04zr.mjs → normalize-Uam4_Vkr.mjs} +1 -1
  437. package/dist/{normalize-CK5o04zr.mjs.map → normalize-Uam4_Vkr.mjs.map} +1 -1
  438. package/dist/{oauth-authorization-Bw4NdF_S.mjs → oauth-authorization-BN-t83Uy.mjs} +5 -5
  439. package/dist/{oauth-authorization-Bw4NdF_S.mjs.map → oauth-authorization-BN-t83Uy.mjs.map} +1 -1
  440. package/dist/{oauth-clients-BGGFp57s.mjs → oauth-clients-R6I_V0qz.mjs} +1 -1
  441. package/dist/{oauth-clients-BGGFp57s.mjs.map → oauth-clients-R6I_V0qz.mjs.map} +1 -1
  442. package/dist/{oauth-state-store-97x0xtN2.mjs → oauth-state-store-Csoc6kkR.mjs} +1 -1
  443. package/dist/{oauth-state-store-97x0xtN2.mjs.map → oauth-state-store-Csoc6kkR.mjs.map} +1 -1
  444. package/dist/{oauth-user-lookup-B_vnZHKO.mjs → oauth-user-lookup-d7VYjTpx.mjs} +1 -1
  445. package/dist/{oauth-user-lookup-B_vnZHKO.mjs.map → oauth-user-lookup-d7VYjTpx.mjs.map} +1 -1
  446. package/dist/object-cache/memory.d.mts +15 -0
  447. package/dist/object-cache/memory.d.mts.map +1 -0
  448. package/dist/object-cache/memory.mjs +56 -0
  449. package/dist/object-cache/memory.mjs.map +1 -0
  450. package/dist/object-cache-SEb2IM4Z.mjs +373 -0
  451. package/dist/object-cache-SEb2IM4Z.mjs.map +1 -0
  452. package/dist/{options-DyYIYpPd.d.mts → options-DFFpvNJU.d.mts} +3 -3
  453. package/dist/{options-DyYIYpPd.d.mts.map → options-DFFpvNJU.d.mts.map} +1 -1
  454. package/dist/{options-BPCVnesz.mjs → options-DTTML-Tx.mjs} +1 -1
  455. package/dist/{options-BPCVnesz.mjs.map → options-DTTML-Tx.mjs.map} +1 -1
  456. package/dist/page/index.d.mts +2 -2
  457. package/dist/{parse-CrGndy1A.mjs → parse-qrHlnzTy.mjs} +2 -2
  458. package/dist/{parse-CrGndy1A.mjs.map → parse-qrHlnzTy.mjs.map} +1 -1
  459. package/dist/{passkey-config-C3QgnQnU.mjs → passkey-config-BJTbcnI5.mjs} +1 -1
  460. package/dist/{passkey-config-C3QgnQnU.mjs.map → passkey-config-BJTbcnI5.mjs.map} +1 -1
  461. package/dist/{patterns-p-RBdTbM.mjs → patterns-BKmjvM7K.mjs} +1 -1
  462. package/dist/{patterns-p-RBdTbM.mjs.map → patterns-BKmjvM7K.mjs.map} +1 -1
  463. package/dist/{placeholder-BZxr8W1j.mjs → placeholder-CIDCpyEY.mjs} +1 -1
  464. package/dist/{placeholder-BZxr8W1j.mjs.map → placeholder-CIDCpyEY.mjs.map} +1 -1
  465. package/dist/{placeholder-CVBv5z8k.d.mts → placeholder-CirPauNG.d.mts} +1 -1
  466. package/dist/{placeholder-CVBv5z8k.d.mts.map → placeholder-CirPauNG.d.mts.map} +1 -1
  467. package/dist/plugin-types.d.mts +1 -1
  468. package/dist/plugin-utils.d.mts +9 -9
  469. package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
  470. package/dist/plugins/adapt-sandbox-entry.mjs +4 -2
  471. package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
  472. package/dist/{transport-CmpLD7W3.mjs → portable-text-BIFhrU6T.mjs} +2 -135
  473. package/dist/portable-text-BIFhrU6T.mjs.map +1 -0
  474. package/dist/{preview-BfuRkVKW.mjs → preview-IDye9SPQ.mjs} +2 -2
  475. package/dist/{preview-BfuRkVKW.mjs.map → preview-IDye9SPQ.mjs.map} +1 -1
  476. package/dist/{public-url-BFVC2OTJ.mjs → public-url-8lFyQ8ZF.mjs} +1 -1
  477. package/dist/{public-url-BFVC2OTJ.mjs.map → public-url-8lFyQ8ZF.mjs.map} +1 -1
  478. package/dist/{query-CbUcI4Xk.mjs → query-B1RVFUNM.mjs} +159 -31
  479. package/dist/query-B1RVFUNM.mjs.map +1 -0
  480. package/dist/{rate-limit-C7hjdkS5.mjs → rate-limit-DfNAqIWW.mjs} +2 -2
  481. package/dist/{rate-limit-C7hjdkS5.mjs.map → rate-limit-DfNAqIWW.mjs.map} +1 -1
  482. package/dist/{redirect-B_q19j4v.mjs → redirect-B4wuX2A5.mjs} +1 -1
  483. package/dist/{redirect-B_q19j4v.mjs.map → redirect-B4wuX2A5.mjs.map} +1 -1
  484. package/dist/{redirect-CRWIt8Zj.mjs → redirect-Bifv_yHv.mjs} +3 -3
  485. package/dist/{redirect-CRWIt8Zj.mjs.map → redirect-Bifv_yHv.mjs.map} +1 -1
  486. package/dist/{redirects-DxVoR7PI.mjs → redirects-CT_vb3NV.mjs} +24 -18
  487. package/dist/redirects-CT_vb3NV.mjs.map +1 -0
  488. package/dist/{redirects-CCbCqCCd.mjs → redirects-DUvXgzCX.mjs} +14 -10
  489. package/dist/redirects-DUvXgzCX.mjs.map +1 -0
  490. package/dist/{registry-brYh-rAT.mjs → registry-CjK96fHD.mjs} +6 -6
  491. package/dist/{registry-brYh-rAT.mjs.map → registry-CjK96fHD.mjs.map} +1 -1
  492. package/dist/{request-cache-D32LpnmI.mjs → request-cache-KCNHp_RJ.mjs} +1 -1
  493. package/dist/{request-cache-D32LpnmI.mjs.map → request-cache-KCNHp_RJ.mjs.map} +1 -1
  494. package/dist/{request-meta-7ByVLxB-.mjs → request-meta-ei3ATilC.mjs} +2 -2
  495. package/dist/{request-meta-7ByVLxB-.mjs.map → request-meta-ei3ATilC.mjs.map} +1 -1
  496. package/dist/{resolve-BqYMVG0D.mjs → resolve-CpbBglV0.mjs} +1 -1
  497. package/dist/{resolve-BqYMVG0D.mjs.map → resolve-CpbBglV0.mjs.map} +1 -1
  498. package/dist/{runner--4wMWwKM.mjs → runner-DYYnW530.mjs} +201 -170
  499. package/dist/runner-DYYnW530.mjs.map +1 -0
  500. package/dist/{runner-DTdhuI9i.d.mts → runner-jdXtFEd3.d.mts} +2 -2
  501. package/dist/{runner-DTdhuI9i.d.mts.map → runner-jdXtFEd3.d.mts.map} +1 -1
  502. package/dist/runtime.d.mts +10 -10
  503. package/dist/runtime.mjs +3 -3
  504. package/dist/{schema-C1E70ug_.mjs → schema-5z2Jfnbm.mjs} +13 -8
  505. package/dist/schema-5z2Jfnbm.mjs.map +1 -0
  506. package/dist/{search-B3SGZw91.mjs → search-D9FkoM-k.mjs} +4 -4
  507. package/dist/{search-B3SGZw91.mjs.map → search-D9FkoM-k.mjs.map} +1 -1
  508. package/dist/{secrets-ChPTmy9x.mjs → secrets-BUE5UQys.mjs} +23 -13
  509. package/dist/secrets-BUE5UQys.mjs.map +1 -0
  510. package/dist/{sections-D_lVzwRZ.mjs → sections-DWYZo6HK.mjs} +3 -3
  511. package/dist/{sections-D_lVzwRZ.mjs.map → sections-DWYZo6HK.mjs.map} +1 -1
  512. package/dist/seed/index.d.mts +2 -2
  513. package/dist/seed/index.mjs +22 -20
  514. package/dist/seo/index.d.mts +1 -1
  515. package/dist/seo/index.mjs +1 -1
  516. package/dist/{seo-B5e6y9Wk.mjs → seo-Cu47j3mJ.mjs} +5 -2
  517. package/dist/seo-Cu47j3mJ.mjs.map +1 -0
  518. package/dist/{seo-D_LPkOtu.mjs → seo-DRnqnstF.mjs} +1 -1
  519. package/dist/{seo-D_LPkOtu.mjs.map → seo-DRnqnstF.mjs.map} +1 -1
  520. package/dist/{service-ChDcsTBs.mjs → service-DTmtqCnw.mjs} +3 -3
  521. package/dist/{service-ChDcsTBs.mjs.map → service-DTmtqCnw.mjs.map} +1 -1
  522. package/dist/session-user-DmtPMNa1.mjs +51 -0
  523. package/dist/session-user-DmtPMNa1.mjs.map +1 -0
  524. package/dist/{settings-Cv47v9u8.mjs → settings-DUrVDN0c.mjs} +3 -3
  525. package/dist/{settings-Cv47v9u8.mjs.map → settings-DUrVDN0c.mjs.map} +1 -1
  526. package/dist/settings-yaxu9mU-.mjs +245 -0
  527. package/dist/settings-yaxu9mU-.mjs.map +1 -0
  528. package/dist/{setup-complete-yvPE4OsP.mjs → setup-complete-BWFHzgvZ.mjs} +2 -2
  529. package/dist/{setup-complete-yvPE4OsP.mjs.map → setup-complete-BWFHzgvZ.mjs.map} +1 -1
  530. package/dist/{setup-nonce-C9aFzb94.mjs → setup-nonce-DFWG-J5c.mjs} +1 -1
  531. package/dist/{setup-nonce-C9aFzb94.mjs.map → setup-nonce-DFWG-J5c.mjs.map} +1 -1
  532. package/dist/single-flight-cache-B5p5cNOL.mjs +104 -0
  533. package/dist/single-flight-cache-B5p5cNOL.mjs.map +1 -0
  534. package/dist/{site-url-CnHlmAs9.mjs → site-url-BOTPgmeM.mjs} +2 -2
  535. package/dist/{site-url-CnHlmAs9.mjs.map → site-url-BOTPgmeM.mjs.map} +1 -1
  536. package/dist/{slugify-Cjh1ssOZ.mjs → slugify-Cce3dTdg.mjs} +1 -1
  537. package/dist/{slugify-Cjh1ssOZ.mjs.map → slugify-Cce3dTdg.mjs.map} +1 -1
  538. package/dist/{ssrf-BsVGIE0Z.mjs → ssrf-B0VeRLrp.mjs} +1 -1
  539. package/dist/{ssrf-BsVGIE0Z.mjs.map → ssrf-B0VeRLrp.mjs.map} +1 -1
  540. package/dist/status-CB2basWJ.mjs +30 -0
  541. package/dist/status-CB2basWJ.mjs.map +1 -0
  542. package/dist/storage/local.d.mts +1 -1
  543. package/dist/storage/local.mjs +2 -2
  544. package/dist/storage/s3.d.mts +1 -1
  545. package/dist/storage/s3.mjs +1 -1
  546. package/dist/{taxonomies-BdAmbOwx.mjs → taxonomies-Be9B1jEj.mjs} +156 -122
  547. package/dist/taxonomies-Be9B1jEj.mjs.map +1 -0
  548. package/dist/{taxonomies-BILwiyGk.mjs → taxonomies-CJmkEpdS.mjs} +7 -7
  549. package/dist/{taxonomies-BILwiyGk.mjs.map → taxonomies-CJmkEpdS.mjs.map} +1 -1
  550. package/dist/{taxonomy-CdllE4oq.mjs → taxonomy-B2HQuVf5.mjs} +19 -6
  551. package/dist/taxonomy-B2HQuVf5.mjs.map +1 -0
  552. package/dist/{tokens-Bx2afeT-.mjs → tokens-BvrJvIB6.mjs} +2 -2
  553. package/dist/{tokens-Bx2afeT-.mjs.map → tokens-BvrJvIB6.mjs.map} +1 -1
  554. package/dist/{transaction-x2tJQ-A1.mjs → transaction-qfqpPVpu.mjs} +1 -1
  555. package/dist/{transaction-x2tJQ-A1.mjs.map → transaction-qfqpPVpu.mjs.map} +1 -1
  556. package/dist/transport-B4rXnSTf.mjs +135 -0
  557. package/dist/transport-B4rXnSTf.mjs.map +1 -0
  558. package/dist/{transport-B7PPP2CC.d.mts → transport-k7YjfmEn.d.mts} +1 -1
  559. package/dist/{transport-B7PPP2CC.d.mts.map → transport-k7YjfmEn.d.mts.map} +1 -1
  560. package/dist/{trusted-proxy-B4AfnoAp.mjs → trusted-proxy-DY1_UqHr.mjs} +1 -1
  561. package/dist/{trusted-proxy-B4AfnoAp.mjs.map → trusted-proxy-DY1_UqHr.mjs.map} +1 -1
  562. package/dist/{types-CPAPl93j.d.mts → types-CIKX2HO5.d.mts} +2 -2
  563. package/dist/{types-CPAPl93j.d.mts.map → types-CIKX2HO5.d.mts.map} +1 -1
  564. package/dist/{types-D4kUqbHh.d.mts → types-CKNXt63n.d.mts} +1 -1
  565. package/dist/{types-D4kUqbHh.d.mts.map → types-CKNXt63n.d.mts.map} +1 -1
  566. package/dist/{types-DTniiNto.d.mts → types-CWGYDYqF.d.mts} +2 -2
  567. package/dist/{types-DTniiNto.d.mts.map → types-CWGYDYqF.d.mts.map} +1 -1
  568. package/dist/{types-BH8-30hc.d.mts → types-CgvhU-hF.d.mts} +1 -1
  569. package/dist/{types-BH8-30hc.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
  570. package/dist/{types-BFgrqwSk.d.mts → types-CmivgZbp.d.mts} +1 -1
  571. package/dist/{types-BFgrqwSk.d.mts.map → types-CmivgZbp.d.mts.map} +1 -1
  572. package/dist/{types-BPzXTV9x.d.mts → types-Czg1S3gB.d.mts} +9 -1
  573. package/dist/{types-BPzXTV9x.d.mts.map → types-Czg1S3gB.d.mts.map} +1 -1
  574. package/dist/types-DCNNfeCv.d.mts +124 -0
  575. package/dist/types-DCNNfeCv.d.mts.map +1 -0
  576. package/dist/{types-BUUVn1zr.d.mts → types-DPCpkzvS.d.mts} +1 -1
  577. package/dist/{types-BUUVn1zr.d.mts.map → types-DPCpkzvS.d.mts.map} +1 -1
  578. package/dist/{types-S15DXXNi.d.mts → types-DXLVzV2w.d.mts} +1 -1
  579. package/dist/{types-S15DXXNi.d.mts.map → types-DXLVzV2w.d.mts.map} +1 -1
  580. package/dist/{types-BXSUSAjt.mjs → types-DXOIbece.mjs} +3 -3
  581. package/dist/{types-BXSUSAjt.mjs.map → types-DXOIbece.mjs.map} +1 -1
  582. package/dist/{types-DpFmlNyB.mjs → types-DYF2_Vf4.mjs} +1 -1
  583. package/dist/{types-DpFmlNyB.mjs.map → types-DYF2_Vf4.mjs.map} +1 -1
  584. package/dist/{types-DZk_y-MU.mjs → types-tM44hEcf.mjs} +1 -1
  585. package/dist/{types-DZk_y-MU.mjs.map → types-tM44hEcf.mjs.map} +1 -1
  586. package/dist/{user-C0um7wrg.mjs → user-Db-Rti_z.mjs} +3 -3
  587. package/dist/{user-C0um7wrg.mjs.map → user-Db-Rti_z.mjs.map} +1 -1
  588. package/dist/{utils-C4Ih4DML.mjs → utils-LbHcSRTj.mjs} +2 -2
  589. package/dist/{utils-C4Ih4DML.mjs.map → utils-LbHcSRTj.mjs.map} +1 -1
  590. package/dist/{validate-Bz4vqcX1.mjs → validate-Bwl64sxv.mjs} +3 -3
  591. package/dist/{validate-Bz4vqcX1.mjs.map → validate-Bwl64sxv.mjs.map} +1 -1
  592. package/dist/{validate-CNwkPWzz.d.mts → validate-CE2M0nvx.d.mts} +5 -5
  593. package/dist/{validate-CNwkPWzz.d.mts.map → validate-CE2M0nvx.d.mts.map} +1 -1
  594. package/dist/{validation-DgGTJm3u.mjs → validation-C_yOvFaO.mjs} +6 -6
  595. package/dist/{validation-DgGTJm3u.mjs.map → validation-C_yOvFaO.mjs.map} +1 -1
  596. package/dist/version-RnYXYjzD.mjs +7 -0
  597. package/dist/{version-D-5txk2m.mjs.map → version-RnYXYjzD.mjs.map} +1 -1
  598. package/dist/{widgets-DZfmAbE4.mjs → widgets-8GONuRHo.mjs} +4 -4
  599. package/dist/{widgets-DZfmAbE4.mjs.map → widgets-8GONuRHo.mjs.map} +1 -1
  600. package/dist/{zod-generator-Djo_VHCt.mjs → zod-generator-D481JjzD.mjs} +3 -3
  601. package/dist/{zod-generator-Djo_VHCt.mjs.map → zod-generator-D481JjzD.mjs.map} +1 -1
  602. package/package.json +18 -6
  603. package/src/api/handlers/api-tokens.ts +19 -0
  604. package/src/api/handlers/comment-reactions.ts +165 -0
  605. package/src/api/handlers/redirects.ts +24 -13
  606. package/src/api/handlers/schema.ts +8 -0
  607. package/src/api/schemas/comments.ts +10 -0
  608. package/src/api/schemas/redirects.ts +11 -4
  609. package/src/astro/image-endpoint.ts +84 -0
  610. package/src/astro/index.ts +6 -0
  611. package/src/astro/integration/index.ts +127 -30
  612. package/src/astro/integration/routes.ts +51 -9
  613. package/src/astro/integration/runtime.ts +65 -1
  614. package/src/astro/integration/virtual-modules.ts +32 -0
  615. package/src/astro/integration/vite-config.ts +16 -0
  616. package/src/astro/middleware/auth.ts +4 -3
  617. package/src/astro/middleware/redirect.ts +12 -0
  618. package/src/astro/middleware/stream-end-metrics.ts +11 -1
  619. package/src/astro/middleware.ts +41 -3
  620. package/src/astro/object-cache/adapters.ts +50 -0
  621. package/src/astro/prefetch.ts +77 -0
  622. package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
  623. package/src/astro/routes/api/setup/dev-bypass.ts +5 -1
  624. package/src/astro/routes/api/snapshot.ts +3 -1
  625. package/src/astro/session-user.ts +57 -0
  626. package/src/astro/types.ts +1 -0
  627. package/src/bylines/field-defs-cache.ts +70 -20
  628. package/src/cli/commands/doctor.ts +1 -1
  629. package/src/comments/query.ts +78 -7
  630. package/src/comments/ranking.ts +58 -0
  631. package/src/components/Comments.astro +136 -1
  632. package/src/config/secrets.ts +28 -14
  633. package/src/database/instrumentation.ts +21 -1
  634. package/src/database/migrations/044_comment_reactions.ts +56 -0
  635. package/src/database/migrations/runner.ts +2 -0
  636. package/src/database/repositories/byline.ts +13 -0
  637. package/src/database/repositories/comment-reaction.ts +132 -0
  638. package/src/database/repositories/comment.ts +10 -0
  639. package/src/database/repositories/content.ts +25 -3
  640. package/src/database/repositories/menu.ts +13 -1
  641. package/src/database/repositories/seo.ts +3 -0
  642. package/src/database/repositories/taxonomy.ts +13 -1
  643. package/src/database/types.ts +9 -0
  644. package/src/emdash-runtime.ts +23 -9
  645. package/src/index.ts +22 -0
  646. package/src/mcp/server.ts +307 -20
  647. package/src/media/image-endpoint.ts +167 -0
  648. package/src/menus/index.ts +11 -4
  649. package/src/object-cache/codec.ts +73 -0
  650. package/src/object-cache/index.ts +495 -0
  651. package/src/object-cache/memory.ts +91 -0
  652. package/src/object-cache/types.ts +124 -0
  653. package/src/plugins/adapt-sandbox-entry.ts +11 -1
  654. package/src/query.ts +196 -17
  655. package/src/redirects/status.ts +27 -0
  656. package/src/schema/query.ts +11 -4
  657. package/src/settings/index.ts +30 -17
  658. package/src/taxonomies/index.ts +237 -165
  659. package/src/utils/{isolate-cache.ts → single-flight-cache.ts} +26 -21
  660. package/src/virtual-modules.d.ts +11 -0
  661. package/dist/api-DStv36ik.mjs.map +0 -1
  662. package/dist/api-tokens-DPfhPu5V.mjs.map +0 -1
  663. package/dist/byline-DUx48sJp.mjs.map +0 -1
  664. package/dist/byline-fields-DbibsvTl.d.mts.map +0 -1
  665. package/dist/comment-sqQxNpN3.mjs.map +0 -1
  666. package/dist/content-BIlVx-RX.mjs.map +0 -1
  667. package/dist/index-B1keaX5Y.d.mts.map +0 -1
  668. package/dist/menus-DX4_E01q.mjs.map +0 -1
  669. package/dist/menus-DrQLusqj.mjs.map +0 -1
  670. package/dist/query-CbUcI4Xk.mjs.map +0 -1
  671. package/dist/redirects-CCbCqCCd.mjs.map +0 -1
  672. package/dist/redirects-DxVoR7PI.mjs.map +0 -1
  673. package/dist/runner--4wMWwKM.mjs.map +0 -1
  674. package/dist/schema-C1E70ug_.mjs.map +0 -1
  675. package/dist/secrets-ChPTmy9x.mjs.map +0 -1
  676. package/dist/seo-B5e6y9Wk.mjs.map +0 -1
  677. package/dist/settings-DfxiWY_s.mjs +0 -411
  678. package/dist/settings-DfxiWY_s.mjs.map +0 -1
  679. package/dist/taxonomies-BdAmbOwx.mjs.map +0 -1
  680. package/dist/taxonomy-CdllE4oq.mjs.map +0 -1
  681. package/dist/transport-CmpLD7W3.mjs.map +0 -1
  682. package/dist/version-D-5txk2m.mjs +0 -7
  683. /package/dist/{api-tokens-Oq39ba-Z.mjs → api-tokens-BVH-H8Z9.mjs} +0 -0
  684. /package/dist/{ssrf-BvgVcfNQ.mjs → ssrf-Cz1e2QPn.mjs} +0 -0
  685. /package/dist/{types-CZI4E3qG.mjs → types-Bfr2Pj6z.mjs} +0 -0
@@ -13,6 +13,12 @@
13
13
 
14
14
  import { resolveLocale, resolveLocaleChain } from "../i18n/resolve.js";
15
15
  import { getDb } from "../loader.js";
16
+ import {
17
+ cachedQuery,
18
+ CacheNamespace,
19
+ contentNamespace,
20
+ invalidateTaxonomyObjectCache,
21
+ } from "../object-cache/index.js";
16
22
  import { peekRequestCache, requestCached, setRequestCacheEntry } from "../request-cache.js";
17
23
  import { chunks, SQL_BATCH_SIZE } from "../utils/chunks.js";
18
24
  import { isMissingTableError } from "../utils/db-errors.js";
@@ -23,10 +29,12 @@ export interface TaxonomyQueryOptions {
23
29
  }
24
30
 
25
31
  /**
26
- * No-op kept for API compatibility.
32
+ * Invalidate cached taxonomy data in the distributed object cache (and any
33
+ * content that hydrates taxonomy terms). The legacy in-isolate term cache was
34
+ * removed, so this used to be a no-op; it now drives object-cache invalidation.
27
35
  */
28
36
  export function invalidateTermCache(): void {
29
- // Intentionally empty.
37
+ invalidateTaxonomyObjectCache();
30
38
  }
31
39
 
32
40
  /**
@@ -36,13 +44,19 @@ export function invalidateTermCache(): void {
36
44
  */
37
45
  export async function getTaxonomyDefs(options: TaxonomyQueryOptions = {}): Promise<TaxonomyDef[]> {
38
46
  const locale = resolveLocale(options.locale);
39
- return requestCached(`taxonomy-defs:${locale ?? "*"}`, async () => {
40
- const db = await getDb();
41
- let query = db.selectFrom("_emdash_taxonomy_defs").selectAll();
42
- if (locale !== undefined) query = query.where("locale", "=", locale);
43
- const rows = await query.execute();
44
- return rows.map(rowToTaxonomyDef);
45
- });
47
+ return requestCached(`taxonomy-defs:${locale ?? "*"}`, () =>
48
+ cachedQuery({
49
+ namespace: CacheNamespace.TAXONOMIES,
50
+ key: `defs:${locale ?? "*"}`,
51
+ load: async () => {
52
+ const db = await getDb();
53
+ let query = db.selectFrom("_emdash_taxonomy_defs").selectAll();
54
+ if (locale !== undefined) query = query.where("locale", "=", locale);
55
+ const rows = await query.execute();
56
+ return rows.map(rowToTaxonomyDef);
57
+ },
58
+ }),
59
+ );
46
60
  }
47
61
 
48
62
  /**
@@ -106,50 +120,62 @@ export async function getTaxonomyTerms(
106
120
  options: TaxonomyQueryOptions = {},
107
121
  ): Promise<TaxonomyTerm[]> {
108
122
  const locale = resolveLocale(options.locale);
109
- return requestCached(`taxonomy-terms:${taxonomyName}:${locale ?? "*"}`, async () => {
110
- const db = await getDb();
123
+ return requestCached(`taxonomy-terms:${taxonomyName}:${locale ?? "*"}`, () =>
124
+ cachedQuery({
125
+ namespace: CacheNamespace.TAXONOMIES,
126
+ key: `terms:${taxonomyName}:${locale ?? "*"}`,
127
+ load: () => loadTaxonomyTerms(taxonomyName, locale, options),
128
+ }),
129
+ );
130
+ }
111
131
 
112
- const def = await getTaxonomyDef(taxonomyName, options);
113
- if (!def) return [];
132
+ async function loadTaxonomyTerms(
133
+ taxonomyName: string,
134
+ locale: string | undefined,
135
+ options: TaxonomyQueryOptions,
136
+ ): Promise<TaxonomyTerm[]> {
137
+ const db = await getDb();
114
138
 
115
- let termsQuery = db
116
- .selectFrom("taxonomies")
117
- .selectAll()
118
- .where("name", "=", taxonomyName)
119
- .orderBy("label", "asc");
120
- if (locale !== undefined) termsQuery = termsQuery.where("locale", "=", locale);
121
- const rows = await termsQuery.execute();
122
-
123
- // Counts are keyed by translation_group (what the pivot stores) and are
124
- // locale-independent, so the aggregate is shared across every taxonomy
125
- // rendered in this request (Categories + Tags widgets, etc.).
126
- const counts = await getTaxonomyTermCounts();
127
-
128
- const flatTerms: TaxonomyTermRow[] = rows.map((row) => ({
129
- id: row.id,
130
- name: row.name,
131
- slug: row.slug,
132
- label: row.label,
133
- parent_id: row.parent_id,
134
- data: row.data,
135
- locale: row.locale,
136
- translation_group: row.translation_group,
137
- }));
138
-
139
- if (def.hierarchical) return buildTree(flatTerms, counts);
140
-
141
- return flatTerms.map((term) => ({
142
- id: term.id,
143
- name: term.name,
144
- slug: term.slug,
145
- label: term.label,
146
- description: term.data ? JSON.parse(term.data).description : undefined,
147
- children: [],
148
- count: counts.get(term.translation_group ?? term.id) ?? 0,
149
- locale: term.locale,
150
- translationGroup: term.translation_group,
151
- }));
152
- });
139
+ const def = await getTaxonomyDef(taxonomyName, options);
140
+ if (!def) return [];
141
+
142
+ let termsQuery = db
143
+ .selectFrom("taxonomies")
144
+ .selectAll()
145
+ .where("name", "=", taxonomyName)
146
+ .orderBy("label", "asc");
147
+ if (locale !== undefined) termsQuery = termsQuery.where("locale", "=", locale);
148
+ const rows = await termsQuery.execute();
149
+
150
+ // Counts are keyed by translation_group (what the pivot stores) and are
151
+ // locale-independent, so the aggregate is shared across every taxonomy
152
+ // rendered in this request (Categories + Tags widgets, etc.).
153
+ const counts = await getTaxonomyTermCounts();
154
+
155
+ const flatTerms: TaxonomyTermRow[] = rows.map((row) => ({
156
+ id: row.id,
157
+ name: row.name,
158
+ slug: row.slug,
159
+ label: row.label,
160
+ parent_id: row.parent_id,
161
+ data: row.data,
162
+ locale: row.locale,
163
+ translation_group: row.translation_group,
164
+ }));
165
+
166
+ if (def.hierarchical) return buildTree(flatTerms, counts);
167
+
168
+ return flatTerms.map((term) => ({
169
+ id: term.id,
170
+ name: term.name,
171
+ slug: term.slug,
172
+ label: term.label,
173
+ description: term.data ? JSON.parse(term.data).description : undefined,
174
+ children: [],
175
+ count: counts.get(term.translation_group ?? term.id) ?? 0,
176
+ locale: term.locale,
177
+ translationGroup: term.translation_group,
178
+ }));
153
179
  }
154
180
 
155
181
  /**
@@ -183,8 +209,23 @@ export async function getTerm(
183
209
  slug: string,
184
210
  options: TaxonomyQueryOptions = {},
185
211
  ): Promise<TaxonomyTerm | null> {
186
- const db = await getDb();
187
212
  const chain = resolveLocaleChain(options.locale);
213
+ // Cached under the shared taxonomies epoch (bumped on any taxonomy / term
214
+ // assignment write). The `count` reflects content_taxonomies rows; a stale
215
+ // count after a bare content delete is bounded by the entry's TTL.
216
+ return cachedQuery({
217
+ namespace: CacheNamespace.TAXONOMIES,
218
+ key: `term:${taxonomyName}:${slug}:${chain.join(",")}`,
219
+ load: () => loadTerm(taxonomyName, slug, chain),
220
+ });
221
+ }
222
+
223
+ async function loadTerm(
224
+ taxonomyName: string,
225
+ slug: string,
226
+ chain: string[],
227
+ ): Promise<TaxonomyTerm | null> {
228
+ const db = await getDb();
188
229
 
189
230
  let row: Awaited<ReturnType<ReturnType<typeof selectTerm>["executeTakeFirst"]>>;
190
231
  const selectTerm = () =>
@@ -262,33 +303,46 @@ export function getEntryTerms(
262
303
  options: TaxonomyQueryOptions = {},
263
304
  ): Promise<TaxonomyTerm[]> {
264
305
  const locale = resolveLocale(options.locale);
306
+ // requestCached short-circuits to values primed by getAllTermsForEntries
307
+ // during entry hydration (same key shape). On a warm content-cache hit
308
+ // hydration doesn't run, so the inner cachedQuery serves this from KV
309
+ // instead of falling through to D1 on every request.
265
310
  return requestCached(
266
311
  `terms:${collection}:${entryId}:${taxonomyName ?? "*"}:${locale ?? "*"}`,
267
- async () => {
268
- const db = await getDb();
269
-
270
- let query = db
271
- .selectFrom("content_taxonomies")
272
- .innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id")
273
- .selectAll("taxonomies")
274
- .where("content_taxonomies.collection", "=", collection)
275
- .where("content_taxonomies.entry_id", "=", entryId);
276
-
277
- if (taxonomyName) query = query.where("taxonomies.name", "=", taxonomyName);
278
- if (locale !== undefined) query = query.where("taxonomies.locale", "=", locale);
279
-
280
- const rows = await query.execute();
281
- return rows.map<TaxonomyTerm>((row) => ({
282
- id: row.id,
283
- name: row.name,
284
- slug: row.slug,
285
- label: row.label,
286
- parentId: row.parent_id ?? undefined,
287
- children: [],
288
- locale: row.locale,
289
- translationGroup: row.translation_group,
290
- }));
291
- },
312
+ () =>
313
+ cachedQuery({
314
+ namespace: [contentNamespace(collection), CacheNamespace.TAXONOMIES],
315
+ key: `entryTerms:${collection}:${entryId}:${taxonomyName ?? "*"}:${locale ?? "*"}`,
316
+ load: async () => {
317
+ const db = await getDb();
318
+
319
+ let query = db
320
+ .selectFrom("content_taxonomies")
321
+ .innerJoin(
322
+ "taxonomies",
323
+ "taxonomies.translation_group",
324
+ "content_taxonomies.taxonomy_id",
325
+ )
326
+ .selectAll("taxonomies")
327
+ .where("content_taxonomies.collection", "=", collection)
328
+ .where("content_taxonomies.entry_id", "=", entryId);
329
+
330
+ if (taxonomyName) query = query.where("taxonomies.name", "=", taxonomyName);
331
+ if (locale !== undefined) query = query.where("taxonomies.locale", "=", locale);
332
+
333
+ const rows = await query.execute();
334
+ return rows.map<TaxonomyTerm>((row) => ({
335
+ id: row.id,
336
+ name: row.name,
337
+ slug: row.slug,
338
+ label: row.label,
339
+ parentId: row.parent_id ?? undefined,
340
+ children: [],
341
+ locale: row.locale,
342
+ translationGroup: row.translation_group,
343
+ }));
344
+ },
345
+ }),
292
346
  );
293
347
  }
294
348
 
@@ -301,107 +355,125 @@ export async function getTermsForEntries(
301
355
  taxonomyName: string,
302
356
  options: TaxonomyQueryOptions = {},
303
357
  ): Promise<Map<string, TaxonomyTerm[]>> {
304
- const result = new Map<string, TaxonomyTerm[]>();
305
358
  const uniqueIds = [...new Set(entryIds)];
306
- for (const id of uniqueIds) result.set(id, []);
307
- if (uniqueIds.length === 0) return result;
308
-
359
+ if (uniqueIds.length === 0) return new Map();
309
360
  const locale = resolveLocale(options.locale);
310
361
  const localeKey = locale ?? "*";
311
362
 
312
- // Entry-term hydration (getAllTermsForEntries -> primeEntryTermsCache)
313
- // seeds the per-entry cache under the same key getEntryTerms uses:
314
- // `terms:${collection}:${entryId}:${taxonomyName}:${localeKey}`, storing a
315
- // TaxonomyTerm[] (including `[]` for entries with no terms). Satisfy those
316
- // from cache and run the batched query only for the ids that missed.
317
- const missedIds: string[] = [];
318
- type CacheRead = { id: string; terms: TaxonomyTerm[] } | { id: string; miss: true };
319
- const cacheReads: Array<Promise<CacheRead>> = [];
320
- for (const id of uniqueIds) {
321
- const cached = peekRequestCache<TaxonomyTerm[]>(
322
- `terms:${collection}:${id}:${taxonomyName}:${localeKey}`,
323
- );
324
- if (cached) {
325
- // A peeked promise can reject (e.g. a sibling getEntryTerms hit a
326
- // missing table). Treat a rejection as a cache miss so the batched
327
- // query path -- and its isMissingTableError guard below -- still runs,
328
- // rather than propagating an uncaught error.
329
- cacheReads.push(
330
- cached.then(
331
- (terms): CacheRead => ({ id, terms }),
332
- (): CacheRead => ({ id, miss: true }),
333
- ),
363
+ // The query result is a Map, which JSON can't represent — cache it as an
364
+ // array of [entryId, terms] pairs and rebuild the Map on read.
365
+ const load = async (): Promise<Array<[string, TaxonomyTerm[]]>> => {
366
+ const result = new Map<string, TaxonomyTerm[]>();
367
+ for (const id of uniqueIds) result.set(id, []);
368
+
369
+ // Entry-term hydration (getAllTermsForEntries -> primeEntryTermsCache)
370
+ // seeds the per-entry cache under the same key getEntryTerms uses:
371
+ // `terms:${collection}:${entryId}:${taxonomyName}:${localeKey}`, storing a
372
+ // TaxonomyTerm[] (including `[]` for entries with no terms). Satisfy those
373
+ // from cache and run the batched query only for the ids that missed.
374
+ const missedIds: string[] = [];
375
+ type CacheRead = { id: string; terms: TaxonomyTerm[] } | { id: string; miss: true };
376
+ const cacheReads: Array<Promise<CacheRead>> = [];
377
+ for (const id of uniqueIds) {
378
+ const cached = peekRequestCache<TaxonomyTerm[]>(
379
+ `terms:${collection}:${id}:${taxonomyName}:${localeKey}`,
334
380
  );
335
- } else {
336
- missedIds.push(id);
381
+ if (cached) {
382
+ // A peeked promise can reject (e.g. a sibling getEntryTerms hit a
383
+ // missing table). Treat a rejection as a cache miss so the batched
384
+ // query path -- and its isMissingTableError guard below -- still runs,
385
+ // rather than propagating an uncaught error.
386
+ cacheReads.push(
387
+ cached.then(
388
+ (terms): CacheRead => ({ id, terms }),
389
+ (): CacheRead => ({ id, miss: true }),
390
+ ),
391
+ );
392
+ } else {
393
+ missedIds.push(id);
394
+ }
337
395
  }
338
- }
339
- for (const read of await Promise.all(cacheReads)) {
340
- if ("miss" in read) {
341
- missedIds.push(read.id);
342
- continue;
396
+ for (const read of await Promise.all(cacheReads)) {
397
+ if ("miss" in read) {
398
+ missedIds.push(read.id);
399
+ continue;
400
+ }
401
+ // Return a private copy. The cached array and its term objects are shared
402
+ // with getEntryTerms/getAllTermsForEntries (primeEntryTermsCache stores
403
+ // the same references), so a caller that mutates the result -- sorting in
404
+ // place, pushing into `children` -- must not poison the cache. The
405
+ // pre-cache implementation always returned freshly built arrays.
406
+ result.set(
407
+ read.id,
408
+ read.terms.map((t) => ({ ...t, children: [...t.children] })),
409
+ );
343
410
  }
344
- // Return a private copy. The cached array and its term objects are shared
345
- // with getEntryTerms/getAllTermsForEntries (primeEntryTermsCache stores
346
- // the same references), so a caller that mutates the result -- sorting in
347
- // place, pushing into `children` -- must not poison the cache. The
348
- // pre-cache implementation always returned freshly built arrays.
349
- result.set(
350
- read.id,
351
- read.terms.map((t) => ({ ...t, children: [...t.children] })),
352
- );
353
- }
354
411
 
355
- if (missedIds.length === 0) return result;
412
+ if (missedIds.length === 0) return [...result.entries()];
356
413
 
357
- const db = await getDb();
414
+ const db = await getDb();
415
+ for (const chunk of chunks(missedIds, SQL_BATCH_SIZE)) {
416
+ let rows;
417
+ try {
418
+ let query = db
419
+ .selectFrom("content_taxonomies")
420
+ .innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id")
421
+ .select([
422
+ "content_taxonomies.entry_id",
423
+ "taxonomies.id",
424
+ "taxonomies.name",
425
+ "taxonomies.slug",
426
+ "taxonomies.label",
427
+ "taxonomies.parent_id",
428
+ "taxonomies.locale",
429
+ "taxonomies.translation_group",
430
+ ])
431
+ .where("content_taxonomies.collection", "=", collection)
432
+ .where("content_taxonomies.entry_id", "in", chunk)
433
+ .where("taxonomies.name", "=", taxonomyName)
434
+ // Match the order getAllTermsForEntries (the cache primer) uses, so
435
+ // cache-hit and DB-miss entries in one result are ordered consistently.
436
+ .orderBy("taxonomies.label", "asc");
437
+ if (locale !== undefined) query = query.where("taxonomies.locale", "=", locale);
438
+ rows = await query.execute();
439
+ } catch (error) {
440
+ if (isMissingTableError(error)) return [...result.entries()];
441
+ throw error;
442
+ }
358
443
 
359
- for (const chunk of chunks(missedIds, SQL_BATCH_SIZE)) {
360
- let rows;
361
- try {
362
- let query = db
363
- .selectFrom("content_taxonomies")
364
- .innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id")
365
- .select([
366
- "content_taxonomies.entry_id",
367
- "taxonomies.id",
368
- "taxonomies.name",
369
- "taxonomies.slug",
370
- "taxonomies.label",
371
- "taxonomies.parent_id",
372
- "taxonomies.locale",
373
- "taxonomies.translation_group",
374
- ])
375
- .where("content_taxonomies.collection", "=", collection)
376
- .where("content_taxonomies.entry_id", "in", chunk)
377
- .where("taxonomies.name", "=", taxonomyName)
378
- // Match the order getAllTermsForEntries (the cache primer) uses, so
379
- // cache-hit and DB-miss entries in one result are ordered consistently.
380
- .orderBy("taxonomies.label", "asc");
381
- if (locale !== undefined) query = query.where("taxonomies.locale", "=", locale);
382
- rows = await query.execute();
383
- } catch (error) {
384
- if (isMissingTableError(error)) return result;
385
- throw error;
444
+ for (const row of rows) {
445
+ const term: TaxonomyTerm = {
446
+ id: row.id,
447
+ name: row.name,
448
+ slug: row.slug,
449
+ label: row.label,
450
+ parentId: row.parent_id ?? undefined,
451
+ children: [],
452
+ locale: row.locale,
453
+ translationGroup: row.translation_group,
454
+ };
455
+ const terms = result.get(row.entry_id);
456
+ if (terms) terms.push(term);
457
+ }
386
458
  }
387
459
 
388
- for (const row of rows) {
389
- const term: TaxonomyTerm = {
390
- id: row.id,
391
- name: row.name,
392
- slug: row.slug,
393
- label: row.label,
394
- parentId: row.parent_id ?? undefined,
395
- children: [],
396
- locale: row.locale,
397
- translationGroup: row.translation_group,
398
- };
399
- const terms = result.get(row.entry_id);
400
- if (terms) terms.push(term);
401
- }
402
- }
460
+ return [...result.entries()];
461
+ };
403
462
 
404
- return result;
463
+ // Key on the sorted unique ids. Bound the key length: very large batches
464
+ // (rare; they come from collection hydration, already served by the content
465
+ // cache) bypass the object cache rather than blow past KV's key limit.
466
+ const idKey = uniqueIds.toSorted().join(",");
467
+ const pairs =
468
+ idKey.length <= 256
469
+ ? await cachedQuery({
470
+ namespace: [contentNamespace(collection), CacheNamespace.TAXONOMIES],
471
+ key: `termsForEntries:${collection}:${taxonomyName}:${locale ?? "*"}:${idKey}`,
472
+ load,
473
+ })
474
+ : await load();
475
+
476
+ return new Map(pairs);
405
477
  }
406
478
 
407
479
  /**
@@ -1,16 +1,21 @@
1
1
  /**
2
- * Isolate-lifetime async value cache with single-flight and poison-immunity.
2
+ * Global-scope async value cache with single-flight and poison-immunity.
3
3
  *
4
- * Built for the "compute once per isolate, read on every request" caches
5
- * (site settings, search-health verification, ...). These must coalesce
6
- * concurrent cold-isolate reads into one query but the obvious way to do
7
- * that, caching the in-flight *promise* on an isolate-global and awaiting it
8
- * from later requests, is unsafe on workerd: if the request that created the
9
- * promise is cancelled mid-await (client disconnect, context teardown), its
10
- * continuation never runs, so the promise neither resolves nor rejects. Every
11
- * later request that awaits that shared promise then hangs until the isolate
12
- * is evicted (observed as 524s at the 100s wall, near-zero CPU). A `.catch`
13
- * that clears the cache doesn't help a cancelled request doesn't reject.
4
+ * Built for the "compute once for the lifetime of the JS global scope, read
5
+ * on every request" caches (site settings, search-health verification, ...).
6
+ * That global scope is the process on Node and the isolate on Cloudflare
7
+ * Workers this helper is platform-neutral; the hazard it defends against is
8
+ * specific to workerd but the cache itself is not.
9
+ *
10
+ * These caches must coalesce concurrent cold reads into one query — but the
11
+ * obvious way to do that, caching the in-flight *promise* on a global and
12
+ * awaiting it from later requests, is unsafe on workerd: if the request that
13
+ * created the promise is cancelled mid-await (client disconnect, context
14
+ * teardown), its continuation never runs, so the promise neither resolves nor
15
+ * rejects. Every later request that awaits that shared promise then hangs
16
+ * until the isolate is evicted (observed as 524s at the 100s wall, near-zero
17
+ * CPU). A `.catch`/`.finally` that clears the cache doesn't help — a cancelled
18
+ * request settles neither way.
14
19
  *
15
20
  * This cache stores the resolved *value* (not a promise) and coalesces via
16
21
  * `initWithLock`: one request becomes the owner and runs `fetch`, everyone
@@ -27,7 +32,7 @@
27
32
 
28
33
  import { createInitLock, type InitLock, initWithLock } from "./init-lock.js";
29
34
 
30
- export interface IsolateCache<T> {
35
+ export interface SingleFlightCache<T> {
31
36
  /** Last resolved value, valid only when `hasValue` is true. */
32
37
  value: T | null;
33
38
  /**
@@ -36,7 +41,7 @@ export interface IsolateCache<T> {
36
41
  * undefined" from "never fetched").
37
42
  */
38
43
  hasValue: boolean;
39
- /** Invalidation counter; bumped by `invalidateIsolateCache`. */
44
+ /** Invalidation counter; bumped by `invalidateSingleFlightCache`. */
40
45
  version: number;
41
46
  /** The `version` the cached value was fetched at. */
42
47
  valueVersion: number;
@@ -44,16 +49,16 @@ export interface IsolateCache<T> {
44
49
  lock: InitLock;
45
50
  }
46
51
 
47
- export function createIsolateCache<T>(): IsolateCache<T> {
52
+ export function createSingleFlightCache<T>(): SingleFlightCache<T> {
48
53
  return { value: null, hasValue: false, version: 0, valueVersion: -1, lock: createInitLock() };
49
54
  }
50
55
 
51
56
  /**
52
- * Force the next `isolateCachedAsync` call to refetch. An in-flight owner
57
+ * Force the next `singleFlightCached` call to refetch. An in-flight owner
53
58
  * fetched at the old version will not publish into the new version, so its
54
59
  * result is ignored by subsequent reads.
55
60
  */
56
- export function invalidateIsolateCache(cache: IsolateCache<unknown>): void {
61
+ export function invalidateSingleFlightCache(cache: SingleFlightCache<unknown>): void {
57
62
  cache.version++;
58
63
  cache.hasValue = false;
59
64
  cache.value = null;
@@ -75,7 +80,7 @@ export function invalidateIsolateCache(cache: IsolateCache<unknown>): void {
75
80
  */
76
81
  const RECLAIM_HEADROOM_MS = 5_000;
77
82
 
78
- export interface IsolateCachedOptions {
83
+ export interface SingleFlightCachedOptions {
79
84
  /**
80
85
  * Hand the in-flight fetch to the host's lifetime extender (waitUntil via
81
86
  * `after()`), so a cancelled originating request still drives it to
@@ -105,7 +110,7 @@ interface Box<T> {
105
110
  function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {
106
111
  return new Promise<T>((resolve, reject) => {
107
112
  const timer = setTimeout(() => {
108
- reject(new Error(`isolateCachedAsync: owner fetch exceeded ${ms}ms`));
113
+ reject(new Error(`singleFlightCached: owner fetch exceeded ${ms}ms`));
109
114
  }, ms);
110
115
  // Settle from the underlying promise (whichever wins the race with the
111
116
  // timer), and always clear the timer so a resolved fetch doesn't leave
@@ -121,10 +126,10 @@ function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {
121
126
  * single-flight lock on a miss. Concurrent callers coalesce onto one fetch;
122
127
  * a cancelled owner cannot poison later callers (see file header).
123
128
  */
124
- export function isolateCachedAsync<T>(
125
- cache: IsolateCache<T>,
129
+ export function singleFlightCached<T>(
130
+ cache: SingleFlightCache<T>,
126
131
  fetch: () => Promise<T>,
127
- options: IsolateCachedOptions = {},
132
+ options: SingleFlightCachedOptions = {},
128
133
  ): Promise<T> {
129
134
  // Capture the version once: a value published at this version satisfies
130
135
  // this call; an invalidation that lands mid-fetch makes the published
@@ -65,6 +65,17 @@ declare module "virtual:emdash/storage" {
65
65
  export const createStorage: ((config: Record<string, unknown>) => Storage) | undefined;
66
66
  }
67
67
 
68
+ declare module "virtual:emdash/object-cache" {
69
+ import type {
70
+ CreateObjectCacheBackendFn,
71
+ ObjectCacheRuntimeConfig,
72
+ } from "./object-cache/types.js";
73
+
74
+ // Can be undefined if no object cache is configured.
75
+ export const createObjectCache: CreateObjectCacheBackendFn | undefined;
76
+ export const objectCacheConfig: ObjectCacheRuntimeConfig | undefined;
77
+ }
78
+
68
79
  declare module "virtual:emdash/auth" {
69
80
  import type { AuthResult } from "./auth/types.js";
70
81