emdash 0.32.0 → 0.34.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 (946) hide show
  1. package/dist/{adapters-C0ONzkUP.d.mts → adapters-34EN2eXO.d.mts} +34 -2
  2. package/dist/adapters-34EN2eXO.d.mts.map +1 -0
  3. package/dist/after-CBU2vkoO.mjs +96 -0
  4. package/dist/after-CBU2vkoO.mjs.map +1 -0
  5. package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-DW7sYyqg.mjs} +2 -2
  6. package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-DW7sYyqg.mjs.map} +1 -1
  7. package/dist/api/route-utils.d.mts +3 -4
  8. package/dist/api/route-utils.d.mts.map +1 -1
  9. package/dist/api/route-utils.mjs +26 -25
  10. package/dist/api/route-utils.mjs.map +1 -1
  11. package/dist/api/schemas/index.d.mts +2 -2
  12. package/dist/api/schemas/index.mjs +6 -5
  13. package/dist/{api-DgPbMlng.mjs → api-DdAsirBe.mjs} +321 -428
  14. package/dist/api-DdAsirBe.mjs.map +1 -0
  15. package/dist/{api-tokens-p-iMzvXR.mjs → api-tokens-CFXu8F_2.mjs} +2 -2
  16. package/dist/{api-tokens-p-iMzvXR.mjs.map → api-tokens-CFXu8F_2.mjs.map} +1 -1
  17. package/dist/{apply-1_6ra7NP.mjs → apply-D5zfeD09.mjs} +139 -102
  18. package/dist/apply-D5zfeD09.mjs.map +1 -0
  19. package/dist/astro/index.d.mts +12 -12
  20. package/dist/astro/index.d.mts.map +1 -1
  21. package/dist/astro/index.mjs +103 -35
  22. package/dist/astro/index.mjs.map +1 -1
  23. package/dist/astro/middleware/auth.d.mts +10 -10
  24. package/dist/astro/middleware/auth.mjs +9 -9
  25. package/dist/astro/middleware/media-usage-write-fence.d.mts +7 -0
  26. package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
  27. package/dist/astro/middleware/media-usage-write-fence.mjs +35 -0
  28. package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
  29. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  30. package/dist/astro/middleware/redirect.mjs +13 -10
  31. package/dist/astro/middleware/redirect.mjs.map +1 -1
  32. package/dist/astro/middleware/request-context.mjs +5 -5
  33. package/dist/astro/middleware/setup.mjs +1 -1
  34. package/dist/astro/middleware.d.mts +12 -11
  35. package/dist/astro/middleware.d.mts.map +1 -1
  36. package/dist/astro/middleware.mjs +1915 -223
  37. package/dist/astro/middleware.mjs.map +1 -1
  38. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
  39. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
  40. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
  41. package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
  42. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
  43. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  44. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
  45. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +12 -11
  46. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
  47. package/dist/astro/routes/api/admin/byline-fields/index.mjs +12 -11
  48. package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
  49. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +12 -11
  50. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
  51. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +20 -20
  52. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +20 -20
  53. package/dist/astro/routes/api/admin/bylines/index.mjs +20 -20
  54. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +18 -17
  55. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
  57. package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
  58. package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
  59. package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
  60. package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
  61. package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
  62. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
  63. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
  64. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
  65. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
  66. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +36 -0
  67. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
  68. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
  69. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
  70. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +36 -0
  71. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
  72. package/dist/astro/routes/api/admin/media-usage/repair.mjs +15 -14
  73. package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
  74. package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
  75. package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
  76. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +37 -0
  77. package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
  78. package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
  79. package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
  80. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +37 -0
  81. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
  82. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
  83. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
  84. package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
  85. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -47
  86. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  87. package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -47
  89. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
  91. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
  93. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +52 -46
  94. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -1
  96. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +55 -46
  97. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  98. package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
  99. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +55 -46
  100. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  101. package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
  102. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  103. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
  104. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +52 -46
  105. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  106. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
  107. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +55 -46
  108. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  109. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
  110. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  111. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -1
  112. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +55 -46
  113. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  114. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
  115. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +56 -47
  116. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  117. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +52 -46
  118. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  119. package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
  120. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +56 -47
  121. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  122. package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
  123. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  124. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
  125. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  126. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
  127. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +52 -46
  128. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  129. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
  130. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
  131. package/dist/astro/routes/api/admin/users/_id_/index.mjs +10 -9
  132. package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
  133. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +6 -6
  134. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
  135. package/dist/astro/routes/api/admin/users/index.mjs +9 -8
  136. package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
  137. package/dist/astro/routes/api/auth/dev-bypass.mjs +8 -8
  138. package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
  139. package/dist/astro/routes/api/auth/invite/complete.mjs +14 -13
  140. package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
  141. package/dist/astro/routes/api/auth/invite/index.mjs +12 -11
  142. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
  143. package/dist/astro/routes/api/auth/invite/register-options.mjs +13 -12
  144. package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
  145. package/dist/astro/routes/api/auth/logout.mjs +4 -4
  146. package/dist/astro/routes/api/auth/magic-link/send.mjs +14 -13
  147. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
  148. package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
  149. package/dist/astro/routes/api/auth/me.mjs +10 -9
  150. package/dist/astro/routes/api/auth/me.mjs.map +1 -1
  151. package/dist/astro/routes/api/auth/mode.mjs +4 -4
  152. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
  153. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  154. package/dist/astro/routes/api/auth/passkey/_id_.mjs +9 -8
  155. package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
  156. package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
  157. package/dist/astro/routes/api/auth/passkey/options.mjs +15 -14
  158. package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
  159. package/dist/astro/routes/api/auth/passkey/register/options.mjs +13 -12
  160. package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
  161. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +14 -13
  162. package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
  163. package/dist/astro/routes/api/auth/passkey/verify.mjs +14 -13
  164. package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
  165. package/dist/astro/routes/api/auth/signup/complete.mjs +14 -13
  166. package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
  167. package/dist/astro/routes/api/auth/signup/request.mjs +14 -13
  168. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
  169. package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
  170. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +20 -19
  171. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  172. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +17 -16
  173. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
  174. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
  175. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
  176. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
  177. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
  178. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +15 -15
  179. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +11 -10
  180. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  181. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +21 -20
  182. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
  183. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +21 -20
  184. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
  185. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
  186. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
  187. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
  188. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
  189. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
  190. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +47 -34
  191. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  192. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
  193. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
  194. package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
  195. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  196. package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
  197. package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
  198. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
  199. package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
  200. package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
  201. package/dist/astro/routes/api/dashboard.mjs +12 -10
  202. package/dist/astro/routes/api/dashboard.mjs.map +1 -1
  203. package/dist/astro/routes/api/dev/emails.mjs +4 -4
  204. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  205. package/dist/astro/routes/api/import/probe.mjs +22 -20
  206. package/dist/astro/routes/api/import/probe.mjs.map +1 -1
  207. package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
  208. package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
  209. package/dist/astro/routes/api/import/wordpress/execute.mjs +18 -18
  210. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  211. package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
  212. package/dist/astro/routes/api/import/wordpress/media.mjs +14 -12
  213. package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
  214. package/dist/astro/routes/api/import/wordpress/prepare.mjs +13 -12
  215. package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
  216. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
  217. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +15 -15
  218. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  219. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -20
  220. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
  221. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  222. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
  223. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +32 -31
  224. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  225. package/dist/astro/routes/api/manifest.mjs +6 -6
  226. package/dist/astro/routes/api/mcp.d.mts.map +1 -1
  227. package/dist/astro/routes/api/mcp.mjs +174 -72
  228. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  229. package/dist/astro/routes/api/media/_id_/confirm.mjs +14 -12
  230. package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
  231. package/dist/astro/routes/api/media/_id_/upload.mjs +7 -7
  232. package/dist/astro/routes/api/media/_id_/usage.mjs +17 -16
  233. package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
  234. package/dist/astro/routes/api/media/_id_.mjs +16 -15
  235. package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
  236. package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
  237. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
  238. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
  239. package/dist/astro/routes/api/media/providers/index.mjs +4 -4
  240. package/dist/astro/routes/api/media/upload-url.mjs +11 -10
  241. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  242. package/dist/astro/routes/api/media.mjs +19 -16
  243. package/dist/astro/routes/api/media.mjs.map +1 -1
  244. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +13 -13
  245. package/dist/astro/routes/api/menus/_name_/items.mjs +13 -13
  246. package/dist/astro/routes/api/menus/_name_/reorder.mjs +13 -13
  247. package/dist/astro/routes/api/menus/_name_/translations.mjs +13 -13
  248. package/dist/astro/routes/api/menus/_name_.mjs +13 -13
  249. package/dist/astro/routes/api/menus/index.mjs +13 -13
  250. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  251. package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
  252. package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
  253. package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
  254. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  255. package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
  256. package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
  257. package/dist/astro/routes/api/oauth/token.mjs +7 -7
  258. package/dist/astro/routes/api/openapi.json.mjs +183 -6
  259. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  260. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
  261. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +8 -7
  262. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
  263. package/dist/astro/routes/api/redirects/404s/index.mjs +14 -13
  264. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  265. package/dist/astro/routes/api/redirects/404s/summary.mjs +14 -13
  266. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  267. package/dist/astro/routes/api/redirects/_id_.mjs +16 -14
  268. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  269. package/dist/astro/routes/api/redirects/index.mjs +16 -14
  270. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  271. package/dist/astro/routes/api/relations/_id_/index.mjs +21 -20
  272. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
  273. package/dist/astro/routes/api/relations/_id_/translations.mjs +16 -15
  274. package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
  275. package/dist/astro/routes/api/relations/index.mjs +21 -20
  276. package/dist/astro/routes/api/relations/index.mjs.map +1 -1
  277. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
  278. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
  279. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +52 -46
  280. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  281. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +52 -46
  282. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  283. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +52 -46
  284. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  285. package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -1
  286. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +52 -46
  287. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  288. package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
  289. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  290. package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
  291. package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
  292. package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -0
  293. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
  294. package/dist/astro/routes/api/schema/index.mjs +14 -11
  295. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  296. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
  297. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  298. package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
  299. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  300. package/dist/astro/routes/api/search/enable.d.mts +1 -0
  301. package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
  302. package/dist/astro/routes/api/search/enable.mjs +19 -15
  303. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  304. package/dist/astro/routes/api/search/index.mjs +13 -13
  305. package/dist/astro/routes/api/search/rebuild.mjs +15 -15
  306. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  307. package/dist/astro/routes/api/search/stats.mjs +9 -9
  308. package/dist/astro/routes/api/search/suggest.mjs +13 -13
  309. package/dist/astro/routes/api/sections/_slug_.mjs +13 -12
  310. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  311. package/dist/astro/routes/api/sections/index.mjs +13 -12
  312. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  313. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
  314. package/dist/astro/routes/api/settings/backups/archives/index.mjs +7 -7
  315. package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
  316. package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
  317. package/dist/astro/routes/api/settings/email.mjs +6 -6
  318. package/dist/astro/routes/api/settings.mjs +18 -17
  319. package/dist/astro/routes/api/settings.mjs.map +1 -1
  320. package/dist/astro/routes/api/setup/admin-verify.mjs +15 -14
  321. package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
  322. package/dist/astro/routes/api/setup/admin.mjs +14 -13
  323. package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
  324. package/dist/astro/routes/api/setup/dev-bypass.mjs +34 -32
  325. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  326. package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
  327. package/dist/astro/routes/api/setup/index.mjs +36 -34
  328. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  329. package/dist/astro/routes/api/setup/status.mjs +5 -5
  330. package/dist/astro/routes/api/snapshot.mjs +10 -10
  331. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
  332. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
  333. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +44 -0
  334. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
  335. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +19 -18
  336. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  337. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +19 -18
  338. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  339. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
  340. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +21 -19
  341. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  342. package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
  343. package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
  344. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +46 -0
  345. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
  346. package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
  347. package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
  348. package/dist/astro/routes/api/taxonomies/_name_.mjs +88 -0
  349. package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
  350. package/dist/astro/routes/api/taxonomies/index.mjs +19 -18
  351. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  352. package/dist/astro/routes/api/themes/preview.mjs +8 -8
  353. package/dist/astro/routes/api/typegen.mjs +6 -6
  354. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  355. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  356. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  357. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -9
  358. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  359. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +13 -12
  360. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  361. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +13 -12
  362. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  363. package/dist/astro/routes/api/widget-areas/_name_.mjs +8 -7
  364. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  365. package/dist/astro/routes/api/widget-areas/index.mjs +13 -12
  366. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  367. package/dist/astro/routes/api/widget-components.mjs +4 -4
  368. package/dist/astro/routes/robots.txt.mjs +11 -10
  369. package/dist/astro/routes/robots.txt.mjs.map +1 -1
  370. package/dist/astro/routes/sitemap-_collection_.xml.mjs +14 -14
  371. package/dist/astro/routes/sitemap.xml.mjs +12 -11
  372. package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
  373. package/dist/astro/types.d.mts +41 -17
  374. package/dist/astro/types.d.mts.map +1 -1
  375. package/dist/auth/providers/github.d.mts +1 -1
  376. package/dist/auth/providers/google.d.mts +1 -1
  377. package/dist/{authorize-R5iYYrpa.mjs → authorize-1iFJzPaZ.mjs} +2 -2
  378. package/dist/{authorize-R5iYYrpa.mjs.map → authorize-1iFJzPaZ.mjs.map} +1 -1
  379. package/dist/{backup-LpQ1V_sR.mjs → backup-LHjIAVNP.mjs} +5 -5
  380. package/dist/{backup-LpQ1V_sR.mjs.map → backup-LHjIAVNP.mjs.map} +1 -1
  381. package/dist/{base64-B-PsqheR.mjs → base64-CvLhUKQv.mjs} +1 -1
  382. package/dist/{base64-B-PsqheR.mjs.map → base64-CvLhUKQv.mjs.map} +1 -1
  383. package/dist/bundle-CBEXrBnb.mjs +663 -0
  384. package/dist/bundle-CBEXrBnb.mjs.map +1 -0
  385. package/dist/{byline-fields-T9ZLZMxJ.mjs → byline-fields-C5S8wygO.mjs} +2 -2
  386. package/dist/{byline-fields-T9ZLZMxJ.mjs.map → byline-fields-C5S8wygO.mjs.map} +1 -1
  387. package/dist/{byline-C5TAqs8N.mjs → byline-pEcoDps8.mjs} +9 -9
  388. package/dist/{byline-C5TAqs8N.mjs.map → byline-pEcoDps8.mjs.map} +1 -1
  389. package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-DDun8sxh.mjs} +4 -4
  390. package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-DDun8sxh.mjs.map} +1 -1
  391. package/dist/{bylines-B8-WGdja.mjs → bylines-BWemdX2k.mjs} +8 -8
  392. package/dist/{bylines-B8-WGdja.mjs.map → bylines-BWemdX2k.mjs.map} +1 -1
  393. package/dist/{bylines-DGuqBLjV.mjs → bylines-DJfSfXCL.mjs} +5 -5
  394. package/dist/{bylines-DGuqBLjV.mjs.map → bylines-DJfSfXCL.mjs.map} +1 -1
  395. package/dist/cache-CBJaDy_E.mjs +108 -0
  396. package/dist/cache-CBJaDy_E.mjs.map +1 -0
  397. package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-CZyFVaad.mjs} +1 -1
  398. package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-CZyFVaad.mjs.map} +1 -1
  399. package/dist/{chunks-D5dlPeRb.mjs → chunks-DfPax1I0.mjs} +2 -2
  400. package/dist/{chunks-D5dlPeRb.mjs.map → chunks-DfPax1I0.mjs.map} +1 -1
  401. package/dist/cli/index.mjs +193 -707
  402. package/dist/cli/index.mjs.map +1 -1
  403. package/dist/client/cf-access.d.mts +1 -1
  404. package/dist/client/index.d.mts +74 -4
  405. package/dist/client/index.d.mts.map +1 -1
  406. package/dist/client/index.mjs +25 -2
  407. package/dist/client/index.mjs.map +1 -1
  408. package/dist/collection-deletion-C8BugSGz.mjs +779 -0
  409. package/dist/collection-deletion-C8BugSGz.mjs.map +1 -0
  410. package/dist/{comment-DnTxxVHv.mjs → comment-Dxlep6cE.mjs} +3 -3
  411. package/dist/{comment-DnTxxVHv.mjs.map → comment-Dxlep6cE.mjs.map} +1 -1
  412. package/dist/{comment-reaction-BUlUz2bh.mjs → comment-reaction-D6qfHKBc.mjs} +2 -2
  413. package/dist/{comment-reaction-BUlUz2bh.mjs.map → comment-reaction-D6qfHKBc.mjs.map} +1 -1
  414. package/dist/{comments-QPKgK3nk.mjs → comments-CTOuhTSX.mjs} +3 -3
  415. package/dist/{comments-QPKgK3nk.mjs.map → comments-CTOuhTSX.mjs.map} +1 -1
  416. package/dist/{components-DZkL4Fx0.mjs → components-CQy3lh9x.mjs} +1 -1
  417. package/dist/{components-DZkL4Fx0.mjs.map → components-CQy3lh9x.mjs.map} +1 -1
  418. package/dist/{config-DyF3OKg_.mjs → config-C3EBstHi.mjs} +18 -2
  419. package/dist/config-C3EBstHi.mjs.map +1 -0
  420. package/dist/{content-CpfKV9QE.mjs → content-BNfwh7xX.mjs} +667 -183
  421. package/dist/content-BNfwh7xX.mjs.map +1 -0
  422. package/dist/content-list-query-DhQ84eVV.d.mts +26 -0
  423. package/dist/content-list-query-DhQ84eVV.d.mts.map +1 -0
  424. package/dist/content-refresh-DNERP4-f.mjs +2560 -0
  425. package/dist/content-refresh-DNERP4-f.mjs.map +1 -0
  426. package/dist/{context-kO4YZB03.mjs → context-DRgOvSnW.mjs} +28 -20
  427. package/dist/context-DRgOvSnW.mjs.map +1 -0
  428. package/dist/{cron-BlKIMD_e.mjs → cron-Y9aLtgrA.mjs} +1 -1
  429. package/dist/{cron-BlKIMD_e.mjs.map → cron-Y9aLtgrA.mjs.map} +1 -1
  430. package/dist/{dashboard-DoBwPnON.mjs → dashboard-CB8J89rJ.mjs} +45 -11
  431. package/dist/dashboard-CB8J89rJ.mjs.map +1 -0
  432. package/dist/db/index.d.mts +4 -4
  433. package/dist/db/index.mjs +3 -3
  434. package/dist/db/index.mjs.map +1 -1
  435. package/dist/db/libsql.d.mts +1 -1
  436. package/dist/db/postgres.d.mts +1 -1
  437. package/dist/db/sqlite.d.mts +1 -1
  438. package/dist/{db-errors-CcWLaRiR.mjs → db-errors-Cl-sKYTm.mjs} +1 -1
  439. package/dist/{db-errors-CcWLaRiR.mjs.map → db-errors-Cl-sKYTm.mjs.map} +1 -1
  440. package/dist/{default-C4v9KP56.mjs → default-DdDl3fxv.mjs} +1 -1
  441. package/dist/{default-C4v9KP56.mjs.map → default-DdDl3fxv.mjs.map} +1 -1
  442. package/dist/deferred-tasks-BMsa9F64.d.mts +9 -0
  443. package/dist/deferred-tasks-BMsa9F64.d.mts.map +1 -0
  444. package/dist/{device-flow-DhUsyJU6.mjs → device-flow-CaioYGK3.mjs} +5 -5
  445. package/dist/{device-flow-DhUsyJU6.mjs.map → device-flow-CaioYGK3.mjs.map} +1 -1
  446. package/dist/{dialect-helpers-DFwyWjTM.mjs → dialect-helpers-BSbfaO3F.mjs} +24 -16
  447. package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
  448. package/dist/dist-D_6CKR8z.mjs +810 -0
  449. package/dist/dist-D_6CKR8z.mjs.map +1 -0
  450. package/dist/{email-console-C-9Ng8DM.mjs → email-console-BHNjIwiB.mjs} +1 -1
  451. package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-BHNjIwiB.mjs.map} +1 -1
  452. package/dist/{enrich-CFJJgxs_.mjs → enrich-_ySMEvEE.mjs} +2 -2
  453. package/dist/{enrich-CFJJgxs_.mjs.map → enrich-_ySMEvEE.mjs.map} +1 -1
  454. package/dist/{error-DmmN74gW.mjs → error-DupyJZE2.mjs} +3 -3
  455. package/dist/{error-DmmN74gW.mjs.map → error-DupyJZE2.mjs.map} +1 -1
  456. package/dist/{errors-DtEXIQQV.mjs → errors-CLUPm7aD.mjs} +15 -2
  457. package/dist/errors-CLUPm7aD.mjs.map +1 -0
  458. package/dist/{escape-CdW31WsG.mjs → escape-C_aLKP3H.mjs} +1 -1
  459. package/dist/{escape-CdW31WsG.mjs.map → escape-C_aLKP3H.mjs.map} +1 -1
  460. package/dist/{field-defs-cache-QMVnzTH6.mjs → field-defs-cache-hg6QkjV9.mjs} +5 -5
  461. package/dist/{field-defs-cache-QMVnzTH6.mjs.map → field-defs-cache-hg6QkjV9.mjs.map} +1 -1
  462. package/dist/{fts-manager-vncsZIJm.mjs → fts-manager-CZ-5dVwJ.mjs} +111 -61
  463. package/dist/fts-manager-CZ-5dVwJ.mjs.map +1 -0
  464. package/dist/{hash-Cb7U1b5M.mjs → hash-Cg0TXJPV.mjs} +1 -1
  465. package/dist/{hash-Cb7U1b5M.mjs.map → hash-Cg0TXJPV.mjs.map} +1 -1
  466. package/dist/{hreflang-CZbSx6Bg.d.mts → hreflang-D3Uehfv2.d.mts} +2 -2
  467. package/dist/{hreflang-CZbSx6Bg.d.mts.map → hreflang-D3Uehfv2.d.mts.map} +1 -1
  468. package/dist/{hreflang-Bg-zMpkr.mjs → hreflang-DNswoYsi.mjs} +7 -7
  469. package/dist/{hreflang-Bg-zMpkr.mjs.map → hreflang-DNswoYsi.mjs.map} +1 -1
  470. package/dist/{import-PKhLeXvn.mjs → import-B41u8Rot.mjs} +7 -7
  471. package/dist/{import-PKhLeXvn.mjs.map → import-B41u8Rot.mjs.map} +1 -1
  472. package/dist/{index-j9rTh3cp.d.mts → index-C3Y-rsyN.d.mts} +286 -93
  473. package/dist/index-C3Y-rsyN.d.mts.map +1 -0
  474. package/dist/{index-BeNto_Vs.d.mts → index-Cof4-Fab.d.mts} +5 -10
  475. package/dist/index-Cof4-Fab.d.mts.map +1 -0
  476. package/dist/index.d.mts +20 -19
  477. package/dist/index.mjs +79 -71
  478. package/dist/{init-lock-DJkX6Hto.mjs → init-lock-6b309ZrF.mjs} +1 -1
  479. package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-6b309ZrF.mjs.map} +1 -1
  480. package/dist/{load-BwTdWE8B.mjs → load-DmvJrtxS.mjs} +2 -2
  481. package/dist/{load-BwTdWE8B.mjs.map → load-DmvJrtxS.mjs.map} +1 -1
  482. package/dist/{loader-C1XOLV5b.mjs → loader-DLBqRiGP.mjs} +120 -64
  483. package/dist/loader-DLBqRiGP.mjs.map +1 -0
  484. package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-BXbUAHod.mjs} +1 -1
  485. package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-BXbUAHod.mjs.map} +1 -1
  486. package/dist/media/image-endpoint.mjs +1 -1
  487. package/dist/media/index.d.mts +1 -1
  488. package/dist/media/index.mjs +3 -2
  489. package/dist/media/index.mjs.map +1 -1
  490. package/dist/media/local-runtime.d.mts +12 -12
  491. package/dist/media/local-runtime.mjs +10 -9
  492. package/dist/media/local-runtime.mjs.map +1 -1
  493. package/dist/{media-DWIzoVFL.mjs → media-BWWWb8kg.mjs} +92 -3
  494. package/dist/media-BWWWb8kg.mjs.map +1 -0
  495. package/dist/{media-tQDZEdu7.mjs → media-CzhAn2--.mjs} +2 -2
  496. package/dist/{media-tQDZEdu7.mjs.map → media-CzhAn2--.mjs.map} +1 -1
  497. package/dist/{media-allowlist-B7TPD6aq.mjs → media-allowlist-BD6HhgXA.mjs} +14 -3
  498. package/dist/media-allowlist-BD6HhgXA.mjs.map +1 -0
  499. package/dist/{media-upload-Bc9Nc5Zf.mjs → media-upload-9yas9zGH.mjs} +11 -9
  500. package/dist/{media-upload-Bc9Nc5Zf.mjs.map → media-upload-9yas9zGH.mjs.map} +1 -1
  501. package/dist/{media-url-BCm5vBn6.mjs → media-url-BvoX88FA.mjs} +1 -1
  502. package/dist/{media-url-BCm5vBn6.mjs.map → media-url-BvoX88FA.mjs.map} +1 -1
  503. package/dist/{media-usage-DPJcNaAq.mjs → media-usage-De3qvwjc.mjs} +138 -61
  504. package/dist/media-usage-De3qvwjc.mjs.map +1 -0
  505. package/dist/media-usage-work-B9Bksh_b.mjs +152 -0
  506. package/dist/media-usage-work-B9Bksh_b.mjs.map +1 -0
  507. package/dist/media-usage-work-DrCbqBcl.mjs +424 -0
  508. package/dist/media-usage-work-DrCbqBcl.mjs.map +1 -0
  509. package/dist/media-usage-write-fence-aHEgN1zB.mjs +42 -0
  510. package/dist/media-usage-write-fence-aHEgN1zB.mjs.map +1 -0
  511. package/dist/{menus-C6qhqP4X.mjs → menus-CC-yn1F9.mjs} +554 -121
  512. package/dist/menus-CC-yn1F9.mjs.map +1 -0
  513. package/dist/{menus-BxPLFfIc.mjs → menus-fxvEDYE6.mjs} +5 -5
  514. package/dist/{menus-BxPLFfIc.mjs.map → menus-fxvEDYE6.mjs.map} +1 -1
  515. package/dist/{mode-fiXRMfeA.mjs → mode-Bpe-tNNy.mjs} +1 -1
  516. package/dist/{mode-fiXRMfeA.mjs.map → mode-Bpe-tNNy.mjs.map} +1 -1
  517. package/dist/{normalize-C-SHXmra.mjs → normalize-Bc-s_r-a.mjs} +1 -1
  518. package/dist/{normalize-C-SHXmra.mjs.map → normalize-Bc-s_r-a.mjs.map} +1 -1
  519. package/dist/{oauth-authorization-C9tFinly.mjs → oauth-authorization-BXO1MKej.mjs} +5 -5
  520. package/dist/{oauth-authorization-C9tFinly.mjs.map → oauth-authorization-BXO1MKej.mjs.map} +1 -1
  521. package/dist/{oauth-clients-BwTxE1aE.mjs → oauth-clients-C_DNqtRu.mjs} +1 -1
  522. package/dist/{oauth-clients-BwTxE1aE.mjs.map → oauth-clients-C_DNqtRu.mjs.map} +1 -1
  523. package/dist/{oauth-state-store-DaRUwPWO.mjs → oauth-state-store-DwAxMtk4.mjs} +1 -1
  524. package/dist/{oauth-state-store-DaRUwPWO.mjs.map → oauth-state-store-DwAxMtk4.mjs.map} +1 -1
  525. package/dist/{oauth-user-lookup-CzuzOSlF.mjs → oauth-user-lookup-BxfZizdk.mjs} +1 -1
  526. package/dist/{oauth-user-lookup-CzuzOSlF.mjs.map → oauth-user-lookup-BxfZizdk.mjs.map} +1 -1
  527. package/dist/object-cache/memory.d.mts +1 -1
  528. package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
  529. package/dist/object-cache-71tPfV4A.mjs.map +1 -0
  530. package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
  531. package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
  532. package/dist/{options-aeIs8WFu.d.mts → options-DRe1pIBL.d.mts} +4 -3
  533. package/dist/options-DRe1pIBL.d.mts.map +1 -0
  534. package/dist/page/index.d.mts +2 -2
  535. package/dist/{parse-BL49yb9D.mjs → parse-DFbuc-Fh.mjs} +2 -2
  536. package/dist/{parse-BL49yb9D.mjs.map → parse-DFbuc-Fh.mjs.map} +1 -1
  537. package/dist/{passkey-config-KMhgFjdQ.mjs → passkey-config-_2GOwwK8.mjs} +1 -1
  538. package/dist/{passkey-config-KMhgFjdQ.mjs.map → passkey-config-_2GOwwK8.mjs.map} +1 -1
  539. package/dist/{placeholder-Dxo5Zt58.d.mts → placeholder-CzW7Lshs.d.mts} +1 -1
  540. package/dist/{placeholder-Dxo5Zt58.d.mts.map → placeholder-CzW7Lshs.d.mts.map} +1 -1
  541. package/dist/plugin-types.d.mts +8 -1
  542. package/dist/plugin-types.d.mts.map +1 -1
  543. package/dist/plugin-utils.d.mts +10 -10
  544. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
  545. package/dist/plugins/adapt-sandbox-entry.mjs +7 -4
  546. package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
  547. package/dist/{portable-text-CNahFfj6.mjs → portable-text-DhKbDAGr.mjs} +1 -1
  548. package/dist/{portable-text-CNahFfj6.mjs.map → portable-text-DhKbDAGr.mjs.map} +1 -1
  549. package/dist/{preview-D4Jnbfx7.mjs → preview-PW-nOnq4.mjs} +2 -2
  550. package/dist/{preview-D4Jnbfx7.mjs.map → preview-PW-nOnq4.mjs.map} +1 -1
  551. package/dist/{public-url-DSGTnJFw.mjs → public-url-CWoFhQT8.mjs} +14 -3
  552. package/dist/public-url-CWoFhQT8.mjs.map +1 -0
  553. package/dist/{query-DCiXI7OZ.mjs → query-BgjfiLUQ.mjs} +38 -77
  554. package/dist/query-BgjfiLUQ.mjs.map +1 -0
  555. package/dist/{query-1xOcEy18.mjs → query-vgZNwIhh.mjs} +4 -4
  556. package/dist/{query-1xOcEy18.mjs.map → query-vgZNwIhh.mjs.map} +1 -1
  557. package/dist/{rate-limit-Vkp9gQ1Y.mjs → rate-limit-L5anykgo.mjs} +2 -2
  558. package/dist/{rate-limit-Vkp9gQ1Y.mjs.map → rate-limit-L5anykgo.mjs.map} +1 -1
  559. package/dist/{redirect-BJ6d1yHh.mjs → redirect-COsS6SWJ.mjs} +3 -3
  560. package/dist/{redirect-BJ6d1yHh.mjs.map → redirect-COsS6SWJ.mjs.map} +1 -1
  561. package/dist/{redirect-CDgfv9vh.mjs → redirect-KBNE3UEs.mjs} +1 -1
  562. package/dist/{redirect-CDgfv9vh.mjs.map → redirect-KBNE3UEs.mjs.map} +1 -1
  563. package/dist/{redirects-Cwkq2H-G.mjs → redirects-CufRQt0Q.mjs} +5 -5
  564. package/dist/{redirects-Cwkq2H-G.mjs.map → redirects-CufRQt0Q.mjs.map} +1 -1
  565. package/dist/{redirects-BOn2DIUs.mjs → redirects-cV9g7V-0.mjs} +149 -16
  566. package/dist/redirects-cV9g7V-0.mjs.map +1 -0
  567. package/dist/registry-C581V4TP.mjs +1275 -0
  568. package/dist/registry-C581V4TP.mjs.map +1 -0
  569. package/dist/{relation-DJ5DZh7B.mjs → relation-DtmAQH7s.mjs} +3 -3
  570. package/dist/{relation-DJ5DZh7B.mjs.map → relation-DtmAQH7s.mjs.map} +1 -1
  571. package/dist/{relations-C4duJnwI.mjs → relations-BBApI4e2.mjs} +3 -3
  572. package/dist/{relations-C4duJnwI.mjs.map → relations-BBApI4e2.mjs.map} +1 -1
  573. package/dist/{relations-DpTjftCl.mjs → relations-DICSyfsh.mjs} +6 -6
  574. package/dist/{relations-DpTjftCl.mjs.map → relations-DICSyfsh.mjs.map} +1 -1
  575. package/dist/{relations-DHFQGX0h.d.mts → relations-DItI3MN9.d.mts} +401 -40
  576. package/dist/relations-DItI3MN9.d.mts.map +1 -0
  577. package/dist/request-context.d.mts +3 -0
  578. package/dist/request-context.d.mts.map +1 -1
  579. package/dist/request-context.mjs.map +1 -1
  580. package/dist/{request-meta-DzXYYI-n.mjs → request-meta-DgZJh3zG.mjs} +2 -2
  581. package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-DgZJh3zG.mjs.map} +1 -1
  582. package/dist/{resolve-BUvFE0Lr.mjs → resolve-DOhVEvty.mjs} +2 -2
  583. package/dist/{resolve-BUvFE0Lr.mjs.map → resolve-DOhVEvty.mjs.map} +1 -1
  584. package/dist/{runner-BsI18UgP.mjs → runner-BiDvq5dv.mjs} +1404 -235
  585. package/dist/runner-BiDvq5dv.mjs.map +1 -0
  586. package/dist/{runner-CHdkERbt.d.mts → runner-CgQbELYC.d.mts} +2 -2
  587. package/dist/{runner-CHdkERbt.d.mts.map → runner-CgQbELYC.d.mts.map} +1 -1
  588. package/dist/runtime.d.mts +11 -11
  589. package/dist/runtime.mjs +5 -4
  590. package/dist/runtime.mjs.map +1 -1
  591. package/dist/{schema-eqZhkR0S.mjs → schema-BFyTg38T.mjs} +3 -3
  592. package/dist/{schema-eqZhkR0S.mjs.map → schema-BFyTg38T.mjs.map} +1 -1
  593. package/dist/schema-CeQSNwB3.mjs +390 -0
  594. package/dist/schema-CeQSNwB3.mjs.map +1 -0
  595. package/dist/{scopes-Be2d8bSb.mjs → scopes-BVeuhGBE.mjs} +3 -3
  596. package/dist/{scopes-Be2d8bSb.mjs.map → scopes-BVeuhGBE.mjs.map} +1 -1
  597. package/dist/{search-CeO678cp.mjs → search-BpuPKZb0.mjs} +26 -16
  598. package/dist/search-BpuPKZb0.mjs.map +1 -0
  599. package/dist/{secrets-870d-7yA.mjs → secrets-dtYs2hDo.mjs} +5 -5
  600. package/dist/{secrets-870d-7yA.mjs.map → secrets-dtYs2hDo.mjs.map} +1 -1
  601. package/dist/{sections-DSuEfirn.mjs → sections-COctk6hf.mjs} +3 -3
  602. package/dist/{sections-DSuEfirn.mjs.map → sections-COctk6hf.mjs.map} +1 -1
  603. package/dist/seed/index.d.mts +2 -2
  604. package/dist/seed/index.mjs +28 -26
  605. package/dist/seo/index.d.mts +3 -3
  606. package/dist/seo/index.mjs +20 -19
  607. package/dist/seo/index.mjs.map +1 -1
  608. package/dist/{seo-C3GDfT0V.mjs → seo-AFpVvTqr.mjs} +6 -4
  609. package/dist/seo-AFpVvTqr.mjs.map +1 -0
  610. package/dist/{seo-BAPKiED8.mjs → seo-CvDxfvFb.mjs} +3 -3
  611. package/dist/{seo-BAPKiED8.mjs.map → seo-CvDxfvFb.mjs.map} +1 -1
  612. package/dist/{service-DyFT-k-R.mjs → service-xMiMSTsR.mjs} +4 -4
  613. package/dist/{service-DyFT-k-R.mjs.map → service-xMiMSTsR.mjs.map} +1 -1
  614. package/dist/{session-user-BrK2zz7S.mjs → session-user-BzVemLkw.mjs} +2 -2
  615. package/dist/{session-user-BrK2zz7S.mjs.map → session-user-BzVemLkw.mjs.map} +1 -1
  616. package/dist/{settings-DgKouY2S.mjs → settings-B372MV0p.mjs} +7 -7
  617. package/dist/{settings-DgKouY2S.mjs.map → settings-B372MV0p.mjs.map} +1 -1
  618. package/dist/{settings-CREKyj8I.mjs → settings-BE9aqn_9.mjs} +3 -3
  619. package/dist/{settings-CREKyj8I.mjs.map → settings-BE9aqn_9.mjs.map} +1 -1
  620. package/dist/{setup-complete-L7bMK2VI.mjs → setup-complete-DF7TAfD5.mjs} +2 -2
  621. package/dist/{setup-complete-L7bMK2VI.mjs.map → setup-complete-DF7TAfD5.mjs.map} +1 -1
  622. package/dist/{setup-nonce-Ct5tjWcq.mjs → setup-nonce-Do-U_cg9.mjs} +1 -1
  623. package/dist/{setup-nonce-Ct5tjWcq.mjs.map → setup-nonce-Do-U_cg9.mjs.map} +1 -1
  624. package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-B0eLKS6K.mjs} +2 -2
  625. package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-B0eLKS6K.mjs.map} +1 -1
  626. package/dist/site-url-Bowsi9T-.mjs +16 -0
  627. package/dist/site-url-Bowsi9T-.mjs.map +1 -0
  628. package/dist/slugify-B994zkXC.mjs +17 -0
  629. package/dist/slugify-B994zkXC.mjs.map +1 -0
  630. package/dist/{snapshot-BdpUJKD-.mjs → snapshot-B5h6aPMh.mjs} +2 -2
  631. package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-B5h6aPMh.mjs.map} +1 -1
  632. package/dist/{ssrf-CviKqWmq.mjs → ssrf-Cpvg_n3A.mjs} +1 -1
  633. package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-Cpvg_n3A.mjs.map} +1 -1
  634. package/dist/{state-xxv6ZTMv.mjs → state-DYwPue40.mjs} +1 -1
  635. package/dist/{state-xxv6ZTMv.mjs.map → state-DYwPue40.mjs.map} +1 -1
  636. package/dist/{status-COfycGIU.mjs → status-CWVYpbD8.mjs} +1 -1
  637. package/dist/{status-COfycGIU.mjs.map → status-CWVYpbD8.mjs.map} +1 -1
  638. package/dist/storage/local.d.mts +1 -1
  639. package/dist/storage/local.mjs +1 -1
  640. package/dist/storage/s3.d.mts +1 -1
  641. package/dist/storage/s3.mjs +1 -1
  642. package/dist/{taxonomies-B61CRSha.mjs → taxonomies-B0o9ExNV.mjs} +85 -75
  643. package/dist/taxonomies-B0o9ExNV.mjs.map +1 -0
  644. package/dist/{taxonomies-Dbdki3Un.mjs → taxonomies-Dk3MAklL.mjs} +360 -56
  645. package/dist/taxonomies-Dk3MAklL.mjs.map +1 -0
  646. package/dist/taxonomy-CPeM8d2o.mjs +484 -0
  647. package/dist/taxonomy-CPeM8d2o.mjs.map +1 -0
  648. package/dist/{tokens-DVltpO2D.mjs → tokens-C39klX8R.mjs} +2 -2
  649. package/dist/{tokens-DVltpO2D.mjs.map → tokens-C39klX8R.mjs.map} +1 -1
  650. package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
  651. package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
  652. package/dist/{transport-BWQo0Foy.mjs → transport--CfOflrp.mjs} +1 -1
  653. package/dist/{transport-BWQo0Foy.mjs.map → transport--CfOflrp.mjs.map} +1 -1
  654. package/dist/{transport-DokJOScS.d.mts → transport-B_rfeU-a.d.mts} +1 -1
  655. package/dist/{transport-DokJOScS.d.mts.map → transport-B_rfeU-a.d.mts.map} +1 -1
  656. package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-CEVekpby.mjs} +1 -1
  657. package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-CEVekpby.mjs.map} +1 -1
  658. package/dist/{types-o7xo7VgH.mjs → types-75KIqzL9.mjs} +20 -3
  659. package/dist/types-75KIqzL9.mjs.map +1 -0
  660. package/dist/{types-C9P3ysxq.d.mts → types-BPuloofb.d.mts} +1 -1
  661. package/dist/{types-C9P3ysxq.d.mts.map → types-BPuloofb.d.mts.map} +1 -1
  662. package/dist/{types-BD40g7zz.mjs → types-BW1syrlw.mjs} +1 -1
  663. package/dist/{types-BD40g7zz.mjs.map → types-BW1syrlw.mjs.map} +1 -1
  664. package/dist/{types-jISEalTX.d.mts → types-C3_AbkDP.d.mts} +53 -10
  665. package/dist/types-C3_AbkDP.d.mts.map +1 -0
  666. package/dist/{types-84Bque3-.d.mts → types-CAGdePf3.d.mts} +133 -1
  667. package/dist/types-CAGdePf3.d.mts.map +1 -0
  668. package/dist/{types-CcSZCcF1.d.mts → types-CFUfyt1s.d.mts} +1 -1
  669. package/dist/{types-CcSZCcF1.d.mts.map → types-CFUfyt1s.d.mts.map} +1 -1
  670. package/dist/{types-DQLZ58GV.d.mts → types-CPx2lIGo.d.mts} +1 -1
  671. package/dist/{types-DQLZ58GV.d.mts.map → types-CPx2lIGo.d.mts.map} +1 -1
  672. package/dist/{types-XrQQ-Aex.mjs → types-CQPWhPxE.mjs} +15 -11
  673. package/dist/types-CQPWhPxE.mjs.map +1 -0
  674. package/dist/{types-BQY7VYw6.d.mts → types-Cs-TFLNf.d.mts} +28 -8
  675. package/dist/types-Cs-TFLNf.d.mts.map +1 -0
  676. package/dist/types-CtzytVXn.mjs +18 -0
  677. package/dist/types-CtzytVXn.mjs.map +1 -0
  678. package/dist/{types-DqZVPILm.d.mts → types-D4_1Ga4L.d.mts} +44 -5
  679. package/dist/types-D4_1Ga4L.d.mts.map +1 -0
  680. package/dist/{types-Dr2GLlwu.d.mts → types-DefV3OiO.d.mts} +1 -1
  681. package/dist/{types-Dr2GLlwu.d.mts.map → types-DefV3OiO.d.mts.map} +1 -1
  682. package/dist/{types-DsAMyD_o.d.mts → types-X0MThr7x.d.mts} +1 -1
  683. package/dist/{types-DsAMyD_o.d.mts.map → types-X0MThr7x.d.mts.map} +1 -1
  684. package/dist/{upload-attempts-C5yd6Gae.mjs → upload-attempts-hlne3iA1.mjs} +1 -1
  685. package/dist/{upload-attempts-C5yd6Gae.mjs.map → upload-attempts-hlne3iA1.mjs.map} +1 -1
  686. package/dist/url-pattern-BHS0V5Ng.mjs +33 -0
  687. package/dist/url-pattern-BHS0V5Ng.mjs.map +1 -0
  688. package/dist/{user-BAumEmpA.mjs → user-sHgJ62SP.mjs} +3 -3
  689. package/dist/{user-BAumEmpA.mjs.map → user-sHgJ62SP.mjs.map} +1 -1
  690. package/dist/{utils-BbUgmeZG.mjs → utils-D4vD_Y98.mjs} +3 -3
  691. package/dist/{utils-BbUgmeZG.mjs.map → utils-D4vD_Y98.mjs.map} +1 -1
  692. package/dist/{validate-Bs_wT2ul.mjs → validate-BkqIG_Uj.mjs} +24 -5
  693. package/dist/validate-BkqIG_Uj.mjs.map +1 -0
  694. package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
  695. package/dist/validate-BpwoDOgt.mjs.map +1 -0
  696. package/dist/{validate-CdYcY-Ln.d.mts → validate-DeGtBN84.d.mts} +25 -7
  697. package/dist/validate-DeGtBN84.d.mts.map +1 -0
  698. package/dist/{validation-BngR0nit.mjs → validation-CiJb_X5o.mjs} +14 -13
  699. package/dist/{validation-BngR0nit.mjs.map → validation-CiJb_X5o.mjs.map} +1 -1
  700. package/dist/version-x0NjTScG.mjs +7 -0
  701. package/dist/{version-Bdfb34kk.mjs.map → version-x0NjTScG.mjs.map} +1 -1
  702. package/dist/{widgets-L-VndTKD.mjs → widgets-Cwzvww0W.mjs} +3 -3
  703. package/dist/{widgets-L-VndTKD.mjs.map → widgets-Cwzvww0W.mjs.map} +1 -1
  704. package/dist/{wxr-taxonomies-DueaLFd9.d.mts → wxr-taxonomies-CmC0ZsDr.d.mts} +1 -1
  705. package/dist/{wxr-taxonomies-DueaLFd9.d.mts.map → wxr-taxonomies-CmC0ZsDr.d.mts.map} +1 -1
  706. package/dist/{wxr-taxonomies-BexjtNid.mjs → wxr-taxonomies-QZjWxjyk.mjs} +13 -32
  707. package/dist/{wxr-taxonomies-BexjtNid.mjs.map → wxr-taxonomies-QZjWxjyk.mjs.map} +1 -1
  708. package/dist/{zod-generator-DMzfga3g.mjs → zod-generator-D11MhxG4.mjs} +53 -6
  709. package/dist/zod-generator-D11MhxG4.mjs.map +1 -0
  710. package/package.json +18 -7
  711. package/src/after.ts +6 -1
  712. package/src/api/errors.ts +13 -0
  713. package/src/api/handlers/content.ts +172 -33
  714. package/src/api/handlers/dashboard.ts +12 -2
  715. package/src/api/handlers/index.ts +16 -0
  716. package/src/api/handlers/manifest.ts +2 -0
  717. package/src/api/handlers/marketplace.ts +14 -0
  718. package/src/api/handlers/media-allowlist.ts +13 -2
  719. package/src/api/handlers/media-usage-work.ts +188 -0
  720. package/src/api/handlers/media-usage.ts +5 -3
  721. package/src/api/handlers/registry.ts +14 -0
  722. package/src/api/handlers/revision.ts +19 -5
  723. package/src/api/handlers/schema.ts +46 -3
  724. package/src/api/handlers/seo.ts +5 -2
  725. package/src/api/handlers/snapshot.ts +1 -1
  726. package/src/api/handlers/taxonomies.ts +446 -83
  727. package/src/api/media-usage-write-fence.ts +64 -0
  728. package/src/api/openapi/document.ts +247 -0
  729. package/src/api/public-url.ts +14 -2
  730. package/src/api/schemas/common.ts +3 -1
  731. package/src/api/schemas/content.ts +122 -1
  732. package/src/api/schemas/media-usage.ts +133 -0
  733. package/src/api/schemas/schema.ts +91 -3
  734. package/src/api/schemas/search.ts +2 -0
  735. package/src/api/schemas/taxonomies.ts +58 -8
  736. package/src/api/site-url.ts +16 -6
  737. package/src/api/types.ts +1 -0
  738. package/src/astro/integration/index.ts +55 -42
  739. package/src/astro/integration/routes.ts +48 -4
  740. package/src/astro/integration/runtime.ts +28 -0
  741. package/src/astro/integration/virtual-modules.ts +27 -1
  742. package/src/astro/integration/vite-config.ts +16 -1
  743. package/src/astro/middleware/media-usage-write-fence.ts +30 -0
  744. package/src/astro/middleware/redirect.ts +14 -12
  745. package/src/astro/middleware/scoped-db.ts +35 -4
  746. package/src/astro/middleware.ts +131 -30
  747. package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
  748. package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
  749. package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
  750. package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
  751. package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
  752. package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -0
  753. package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -0
  754. package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -0
  755. package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -0
  756. package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -0
  757. package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -0
  758. package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
  759. package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
  760. package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
  761. package/src/astro/routes/api/auth/invite/index.ts +2 -2
  762. package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
  763. package/src/astro/routes/api/auth/signup/request.ts +2 -2
  764. package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
  765. package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +67 -31
  766. package/src/astro/routes/api/import/wordpress/execute.ts +3 -10
  767. package/src/astro/routes/api/mcp.ts +1 -0
  768. package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +7 -1
  769. package/src/astro/routes/api/schema/collections/[slug]/index.ts +1 -7
  770. package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
  771. package/src/astro/routes/api/schema/index.ts +2 -0
  772. package/src/astro/routes/api/search/enable.ts +5 -1
  773. package/src/astro/routes/api/search/rebuild.ts +6 -1
  774. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
  775. package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +1 -0
  776. package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
  777. package/src/astro/routes/api/taxonomies/[name].ts +102 -0
  778. package/src/astro/types.ts +31 -4
  779. package/src/cleanup.ts +25 -26
  780. package/src/cli/commands/dev.ts +13 -3
  781. package/src/cli/commands/doctor.ts +193 -6
  782. package/src/cli/commands/export-seed.ts +6 -1
  783. package/src/cli/index.ts +1 -1
  784. package/src/client/index.ts +119 -0
  785. package/src/components/Block.astro +12 -0
  786. package/src/components/CommentForm.astro +1 -1
  787. package/src/components/Comments.astro +1 -1
  788. package/src/components/InlinePortableTextEditor.tsx +260 -32
  789. package/src/components/OrderedList.astro +14 -0
  790. package/src/components/PortableText.astro +26 -4
  791. package/src/components/index.ts +12 -1
  792. package/src/components/ordered-list.ts +549 -0
  793. package/src/content/converters/mark-safety.ts +120 -0
  794. package/src/content/converters/numbered-list.ts +148 -0
  795. package/src/content/converters/portable-text-to-prosemirror.ts +84 -25
  796. package/src/content/converters/prosemirror-to-portable-text.ts +35 -14
  797. package/src/content/converters/types.ts +2 -0
  798. package/src/content/portable-text-lists.ts +205 -0
  799. package/src/content-list-query.ts +29 -0
  800. package/src/database/dialect-helpers.ts +3 -22
  801. package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
  802. package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
  803. package/src/database/migrations/057_collection_hidden.ts +24 -0
  804. package/src/database/migrations/058_collection_sort_order.ts +20 -0
  805. package/src/database/migrations/059_revision_prune_queue.ts +36 -0
  806. package/src/database/migrations/060_collection_admin_config.ts +16 -0
  807. package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
  808. package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
  809. package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
  810. package/src/database/migrations/064_fts_plain_text.ts +253 -0
  811. package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
  812. package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
  813. package/src/database/migrations/067_indexed_content_fields.ts +39 -0
  814. package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
  815. package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
  816. package/src/database/migrations/070_collection_routable.ts +18 -0
  817. package/src/database/migrations/runner.ts +32 -0
  818. package/src/database/repositories/content.ts +1051 -273
  819. package/src/database/repositories/media-usage-work.ts +848 -0
  820. package/src/database/repositories/media-usage.ts +1502 -138
  821. package/src/database/repositories/revision.ts +98 -22
  822. package/src/database/repositories/taxonomy.ts +429 -103
  823. package/src/database/repositories/types.ts +58 -2
  824. package/src/database/types.ts +147 -17
  825. package/src/database/validate.ts +39 -0
  826. package/src/db/adapters.ts +36 -0
  827. package/src/db/index.ts +3 -0
  828. package/src/deferred-tasks.ts +71 -0
  829. package/src/emdash-runtime.ts +493 -110
  830. package/src/fields/file.ts +7 -4
  831. package/src/fields/image.ts +8 -1
  832. package/src/fields/types.ts +18 -5
  833. package/src/i18n/config.ts +32 -0
  834. package/src/i18n/repair-locale-casing.ts +0 -14
  835. package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
  836. package/src/import/wxr-taxonomies.ts +7 -47
  837. package/src/index.ts +27 -2
  838. package/src/loader.ts +165 -89
  839. package/src/mcp/server.ts +242 -34
  840. package/src/media/usage/activation.ts +626 -0
  841. package/src/media/usage/capture-triggers.ts +543 -0
  842. package/src/media/usage/cleanup.ts +305 -0
  843. package/src/media/usage/collection-deletion-processor.ts +356 -0
  844. package/src/media/usage/collection-deletion.ts +836 -0
  845. package/src/media/usage/content-fields.ts +40 -3
  846. package/src/media/usage/content-refresh.ts +356 -47
  847. package/src/media/usage/content-repair.ts +180 -61
  848. package/src/media/usage/content-snapshots.ts +85 -105
  849. package/src/media/usage/gc.ts +50 -0
  850. package/src/media/usage/projection-fingerprint.ts +129 -0
  851. package/src/media/usage/reconciliation-processor.ts +372 -0
  852. package/src/media/usage/reconciliation.ts +1117 -0
  853. package/src/media/usage/source-key.ts +4 -0
  854. package/src/media/usage/types.ts +2 -0
  855. package/src/media/usage/work-processor.ts +248 -0
  856. package/src/menus/index.ts +246 -141
  857. package/src/object-cache/index.ts +160 -3
  858. package/src/plugin-types.ts +8 -0
  859. package/src/plugins/adapt-sandbox-entry.ts +24 -5
  860. package/src/plugins/context.ts +24 -7
  861. package/src/plugins/index.ts +9 -0
  862. package/src/plugins/routes.ts +77 -1
  863. package/src/plugins/sandbox/index.ts +10 -1
  864. package/src/plugins/sandbox/types.ts +78 -1
  865. package/src/plugins/scheduler/node.ts +13 -1
  866. package/src/plugins/scheduler/types.ts +2 -0
  867. package/src/plugins/storage-indexes.ts +50 -11
  868. package/src/plugins/types.ts +39 -2
  869. package/src/query.ts +50 -79
  870. package/src/redirects/cache.ts +79 -19
  871. package/src/request-context.ts +3 -0
  872. package/src/scheduled-publish.ts +6 -1
  873. package/src/scheduler-health.ts +46 -0
  874. package/src/schema/registry.ts +863 -249
  875. package/src/schema/types.ts +74 -8
  876. package/src/schema/url-pattern.ts +33 -0
  877. package/src/schema/zod-generator.ts +77 -5
  878. package/src/search/fts-manager.ts +167 -86
  879. package/src/search/index.ts +2 -0
  880. package/src/search/query.ts +32 -11
  881. package/src/search/types.ts +8 -0
  882. package/src/seed/apply.ts +89 -16
  883. package/src/seed/types.ts +21 -3
  884. package/src/seed/validate.ts +52 -2
  885. package/src/taxonomies/index.ts +88 -82
  886. package/src/taxonomies/term-counts.ts +23 -12
  887. package/src/ui-comments.ts +19 -0
  888. package/src/ui.ts +11 -3
  889. package/src/utils/slugify.ts +1 -29
  890. package/src/virtual-modules.d.ts +24 -0
  891. package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
  892. package/dist/after-B1IIdH3Y.mjs +0 -29
  893. package/dist/after-B1IIdH3Y.mjs.map +0 -1
  894. package/dist/api-DgPbMlng.mjs.map +0 -1
  895. package/dist/apply-1_6ra7NP.mjs.map +0 -1
  896. package/dist/cache-B26cufFd.mjs +0 -65
  897. package/dist/cache-B26cufFd.mjs.map +0 -1
  898. package/dist/config-DyF3OKg_.mjs.map +0 -1
  899. package/dist/content-CpfKV9QE.mjs.map +0 -1
  900. package/dist/content-refresh-DgqUBeTv.mjs +0 -1629
  901. package/dist/content-refresh-DgqUBeTv.mjs.map +0 -1
  902. package/dist/context-kO4YZB03.mjs.map +0 -1
  903. package/dist/dashboard-DoBwPnON.mjs.map +0 -1
  904. package/dist/dialect-helpers-DFwyWjTM.mjs.map +0 -1
  905. package/dist/errors-DtEXIQQV.mjs.map +0 -1
  906. package/dist/fts-manager-vncsZIJm.mjs.map +0 -1
  907. package/dist/index-BeNto_Vs.d.mts.map +0 -1
  908. package/dist/index-j9rTh3cp.d.mts.map +0 -1
  909. package/dist/loader-C1XOLV5b.mjs.map +0 -1
  910. package/dist/media-DWIzoVFL.mjs.map +0 -1
  911. package/dist/media-allowlist-B7TPD6aq.mjs.map +0 -1
  912. package/dist/media-usage-DPJcNaAq.mjs.map +0 -1
  913. package/dist/menus-C6qhqP4X.mjs.map +0 -1
  914. package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
  915. package/dist/options-aeIs8WFu.d.mts.map +0 -1
  916. package/dist/public-url-DSGTnJFw.mjs.map +0 -1
  917. package/dist/query-DCiXI7OZ.mjs.map +0 -1
  918. package/dist/redirects-BOn2DIUs.mjs.map +0 -1
  919. package/dist/registry-BP1JK2xh.mjs +0 -795
  920. package/dist/registry-BP1JK2xh.mjs.map +0 -1
  921. package/dist/relations-DHFQGX0h.d.mts.map +0 -1
  922. package/dist/runner-BsI18UgP.mjs.map +0 -1
  923. package/dist/search-CeO678cp.mjs.map +0 -1
  924. package/dist/seo-C3GDfT0V.mjs.map +0 -1
  925. package/dist/site-url-8N3kSyVZ.mjs +0 -13
  926. package/dist/site-url-8N3kSyVZ.mjs.map +0 -1
  927. package/dist/slugify-C_tqlU4G.mjs +0 -30
  928. package/dist/slugify-C_tqlU4G.mjs.map +0 -1
  929. package/dist/taxonomies-B61CRSha.mjs.map +0 -1
  930. package/dist/taxonomies-Dbdki3Un.mjs.map +0 -1
  931. package/dist/taxonomy-DvwWAPvA.mjs +0 -304
  932. package/dist/taxonomy-DvwWAPvA.mjs.map +0 -1
  933. package/dist/types-84Bque3-.d.mts.map +0 -1
  934. package/dist/types-BQY7VYw6.d.mts.map +0 -1
  935. package/dist/types-DqZVPILm.d.mts.map +0 -1
  936. package/dist/types-XrQQ-Aex.mjs.map +0 -1
  937. package/dist/types-jISEalTX.d.mts.map +0 -1
  938. package/dist/types-o7xo7VgH.mjs.map +0 -1
  939. package/dist/validate-Bs_wT2ul.mjs.map +0 -1
  940. package/dist/validate-CdYcY-Ln.d.mts.map +0 -1
  941. package/dist/validate-VPnKoIzW.mjs.map +0 -1
  942. package/dist/version-Bdfb34kk.mjs +0 -7
  943. package/dist/zod-generator-DMzfga3g.mjs.map +0 -1
  944. /package/dist/{api-tokens-CEsW_jCg.mjs → api-tokens-CyTsLszZ.mjs} +0 -0
  945. /package/dist/{ssrf-BB__xfNM.mjs → ssrf-DpXgKsna.mjs} +0 -0
  946. /package/dist/{types-CK0LxPUQ.mjs → types-CP1CflWf.mjs} +0 -0
@@ -1,19 +1,21 @@
1
- import { _ as UpdateFieldInput, f as FieldValidation, g as UpdateCollectionInput, i as CollectionWithFields, o as CreateCollectionInput, s as CreateFieldInput, t as Collection, u as Field } from "./types-jISEalTX.mjs";
2
- import { f as UpdateContentInput, i as ContentItem, l as FindManyOptions, o as ContentSeoInput, r as ContentDateField, s as CreateContentInput, t as BylineSummary, u as FindManyResult } from "./types-DqZVPILm.mjs";
3
- import { d as ContentListResponse, f as ContentResponse, h as ManifestResponse, u as ApiResult } from "./options-aeIs8WFu.mjs";
4
- import { t as Database } from "./types-84Bque3-.mjs";
5
- import { At as StorageCollection, Ct as QueryOptions, Et as ResolvedPlugin, H as HttpAccess, O as CronEvent, R as EmailMessage, St as PublicPageContext, Z as MediaItem$1, _t as PluginMcpManifestConfig, bt as PortableTextBlockConfig, c as CommentBeforeCreateEvent, ct as PaginatedResult, et as PageFragmentContribution, ft as PluginCapability, gt as PluginManifest, i as CommentAfterCreateEvent, it as PageMetadataEvent, kt as SettingField, mt as PluginDefinition, o as CommentAfterModerateEvent, rt as PageMetadataContribution, tt as PageFragmentEvent, wt as RequestMeta, yt as PluginStorageConfig, z as FieldWidgetConfig, zt as WhereClause } from "./types-BQY7VYw6.mjs";
6
- import { _ as MediaValue, f as MediaProvider, m as MediaProviderDescriptor, p as MediaProviderCapabilities } from "./placeholder-Dxo5Zt58.mjs";
7
- import { w as ContentBylineInput } from "./index-BeNto_Vs.mjs";
8
- import { t as DatabaseDescriptor } from "./adapters-C0ONzkUP.mjs";
9
- import { r as AuthProviderDescriptor, t as AuthDescriptor } from "./types-C9P3ysxq.mjs";
10
- import { r as ObjectCacheDescriptor } from "./types-DsAMyD_o.mjs";
11
- import { d as Storage } from "./types-CcSZCcF1.mjs";
12
- import { i as SiteSettings, r as SiteSettingKey } from "./types-DQLZ58GV.mjs";
1
+ import { r as ContentFieldFilters } from "./content-list-query-DhQ84eVV.mjs";
2
+ import { _ as UpdateCollectionInput, a as CollectionWithFields, c as CreateFieldInput, d as Field, p as FieldValidation, s as CreateCollectionInput, t as Collection, v as UpdateFieldInput } from "./types-C3_AbkDP.mjs";
3
+ import { f as UpdateContentInput, i as ContentItem, l as FindManyOptions, o as ContentSeoInput, r as ContentDateField, s as CreateContentInput, t as BylineSummary, u as FindManyResult } from "./types-D4_1Ga4L.mjs";
4
+ import { d as ContentListResponse, f as ContentResponse, h as ManifestResponse, u as ApiResult } from "./options-DRe1pIBL.mjs";
5
+ import { t as Database } from "./types-CAGdePf3.mjs";
6
+ import { At as SettingField, B as FieldWidgetConfig, Bt as UserInfo, Ct as PublicPageContext, Dt as ResolvedPlugin, Q as MediaItem$1, Tt as RequestMeta, U as HttpAccess, Vt as WhereClause, _t as PluginManifest, at as PageMetadataEvent, bt as PluginStorageConfig, c as CommentBeforeCreateEvent, ht as PluginDefinition, i as CommentAfterCreateEvent, it as PageMetadataContribution, jt as StorageCollection, k as CronEvent, lt as PaginatedResult, nt as PageFragmentEvent, o as CommentAfterModerateEvent, pt as PluginCapability, tt as PageFragmentContribution, vt as PluginMcpManifestConfig, wt as QueryOptions, xt as PortableTextBlockConfig, z as EmailMessage } from "./types-Cs-TFLNf.mjs";
7
+ import { _ as MediaValue, f as MediaProvider, m as MediaProviderDescriptor, p as MediaProviderCapabilities } from "./placeholder-CzW7Lshs.mjs";
8
+ import { T as ContentBylineInput } from "./index-Cof4-Fab.mjs";
9
+ import { r as DatabaseDescriptor } from "./adapters-34EN2eXO.mjs";
10
+ import { r as AuthProviderDescriptor, t as AuthDescriptor } from "./types-BPuloofb.mjs";
11
+ import { r as ObjectCacheDescriptor } from "./types-X0MThr7x.mjs";
12
+ import { d as Storage } from "./types-CFUfyt1s.mjs";
13
+ import { i as SiteSettings, r as SiteSettingKey } from "./types-CPx2lIGo.mjs";
13
14
  import { EmDashManifest } from "./astro/types.mjs";
14
15
  import { Dialect, Kysely, sql } from "kysely";
15
16
  import { z } from "astro/zod";
16
17
  import { z as z$1 } from "zod";
18
+ import { ManifestHookEntry, ManifestRouteEntry } from "@emdash-cms/plugin-types";
17
19
  import "@emdash-cms/registry-client/env";
18
20
  import { LiveLoader } from "astro/loaders";
19
21
 
@@ -55,7 +57,7 @@ declare class ContentRepository {
55
57
  * (optionally scoped to a locale) and appends a numeric suffix (`-1`,
56
58
  * `-2`, etc.) on collision to guarantee uniqueness.
57
59
  *
58
- * Returns `null` if `baseSlug` is empty after slugification.
60
+ * Returns null when slug normalization cannot produce a value.
59
61
  */
60
62
  generateUniqueSlug(type: string, text: string, locale?: string): Promise<string | null>;
61
63
  /**
@@ -101,6 +103,13 @@ declare class ContentRepository {
101
103
  * Update content
102
104
  */
103
105
  update(type: string, id: string, input: UpdateContentInput): Promise<ContentItem>;
106
+ /**
107
+ * Update plugin-authored fields without letting content columns diverge
108
+ * from the revision pointers that publication promotes.
109
+ */
110
+ updateDraftAware(type: string, id: string, input: UpdateContentInput): Promise<ContentItem>;
111
+ private deleteUnstagedRevision;
112
+ private replaceDraftRevisionForUpdate;
104
113
  /**
105
114
  * Delete content (soft delete - moves to trash)
106
115
  */
@@ -109,19 +118,6 @@ declare class ContentRepository {
109
118
  * Restore content from trash
110
119
  */
111
120
  restore(type: string, id: string): Promise<ContentItem | null>;
112
- /**
113
- * Re-stamp the denormalized filter + sort columns on every
114
- * `content_taxonomies` pivot row for an entry from its authoritative `ec_*`
115
- * row (migration 051). Called after any mutation that moves one of those
116
- * columns so a taxonomy-filtered listing can seek the entry directly.
117
- *
118
- * A single correlated `UPDATE` reads the post-mutation values from `ec_*`, so
119
- * the pivot converges to the authoritative row. This is NOT atomic with the
120
- * `ec_*` mutation on D1 (no transactions), which is why the read path
121
- * re-checks the real predicates on the joined `ec_*` row. Untagged entries
122
- * have no pivot rows, so the statement is a cheap no-op for them.
123
- */
124
- private restampEntryPivot;
125
121
  /**
126
122
  * Permanently delete content (cannot be undone)
127
123
  */
@@ -170,10 +166,25 @@ declare class ContentRepository {
170
166
  * range naturally excludes never-published rows (their column is NULL).
171
167
  */
172
168
  private applyDateFilter;
169
+ /**
170
+ * Apply the optional byline filter as a correlated (NOT) EXISTS against
171
+ * `_emdash_content_bylines`.
172
+ *
173
+ * Correlating from the content table preserves the outer sort index so
174
+ * `LIMIT` can short-circuit. `mode: "none"` tests the junction rather than
175
+ * `primary_byline_id` because the two are written in the same call but
176
+ * are not atomically consistent, so the junction is authoritative.
177
+ *
178
+ * Whether a credit *renders* is locale-scoped; whether one *exists* is
179
+ * not. Both are needed: the first decides what the filter matches, the
180
+ * second decides whether the author fallback applies at all.
181
+ */
182
+ private applyBylineFilter;
173
183
  /**
174
184
  * Count content items
175
185
  */
176
186
  count(type: string, where?: FindManyOptions["where"]): Promise<number>;
187
+ private countWithResolvedFilters;
177
188
  /**
178
189
  * Distinct, non-null `author_id` values across the collection's live
179
190
  * (non-trashed) content. Used to populate the admin author filter with
@@ -181,11 +192,12 @@ declare class ContentRepository {
181
192
  * full user directory (which requires admin privileges to read).
182
193
  */
183
194
  findDistinctAuthorIds(type: string): Promise<string[]>;
184
- getStats(type: string): Promise<{
195
+ getStats(type: string, now?: Date): Promise<{
185
196
  total: number;
186
197
  published: number;
187
198
  draft: number;
188
199
  scheduled: number;
200
+ overdueScheduled: number;
189
201
  }>;
190
202
  /**
191
203
  * Schedule content for future publishing
@@ -225,6 +237,10 @@ declare class ContentRepository {
225
237
  * Lets callers resolve many edge groups without an N+1 per group. The caller
226
238
  * groups the flat result by `translationGroup` itself.
227
239
  *
240
+ * `translation_group` leads the sort so the ordering follows
241
+ * `idx_{table}_del_tg_locale` past its `deleted_at` equality; callers group by
242
+ * `translationGroup`, so the per-group locale order they rely on is preserved.
243
+ *
228
244
  * `publishedOnly` restricts the result to `status = 'published'` — reference
229
245
  * reads pass this for callers without `content:read_drafts` so draft/scheduled
230
246
  * entries never leak through an edge traversal.
@@ -258,6 +274,8 @@ declare class ContentRepository {
258
274
  * Syncs the draft revision's data into the content table columns so the
259
275
  * content table always reflects the published version.
260
276
  * If no draft revision exists, creates one from current data and publishes it.
277
+ * When `promoteRevision` is false, publishes the current content-table data
278
+ * by changing lifecycle metadata only.
261
279
  *
262
280
  * `publishedAt` (optional) overrides the publication timestamp. If omitted,
263
281
  * the existing `published_at` is preserved (idempotent re-publish keeps the
@@ -265,15 +283,11 @@ declare class ContentRepository {
265
283
  * an explicit value to backdate a publish (e.g. when migrating content from
266
284
  * another CMS).
267
285
  *
268
- * `requireDue` (optional) gates the publish on the row still being due:
269
- * `scheduled_at` non-null and in the past. Used by the scheduled-publishing
270
- * sweep to avoid publishing content an editor unscheduled or rescheduled
271
- * between selection and publish. It claims the row with a single conditional
272
- * UPDATE (clearing `scheduled_at`) before any other write, so it is atomic
273
- * even on D1 (no multi-statement transactions) and serialises against
274
- * `unschedule()` and concurrent sweeps — no TOCTOU and no double publish.
286
+ * `requireDue` gates the final update on the row still being due.
287
+ * `expectedScheduledAt` additionally fences changes made after a sweep
288
+ * selected the row but before publication preparation began.
275
289
  */
276
- publish(type: string, id: string, publishedAt?: string, requireDue?: boolean): Promise<ContentItem>;
290
+ publish(type: string, id: string, publishedAt?: string, requireDue?: boolean, expectedScheduledAt?: string, promoteRevision?: boolean, requireSlug?: boolean): Promise<ContentItem>;
277
291
  /**
278
292
  * Unpublish content
279
293
  *
@@ -293,6 +307,7 @@ declare class ContentRepository {
293
307
  * content row pointing at a missing or unrelated revision.
294
308
  */
295
309
  setDraftRevision(type: string, id: string, revisionId: string): Promise<void>;
310
+ replaceDraftRevision(type: string, id: string, revisionId: string, expected: Pick<ContentItem, "version" | "liveRevisionId" | "draftRevisionId">): Promise<boolean>;
296
311
  /**
297
312
  * Discard pending draft changes
298
313
  *
@@ -300,12 +315,6 @@ declare class ContentRepository {
300
315
  * published version, so no data sync is needed.
301
316
  */
302
317
  discardDraft(type: string, id: string): Promise<ContentItem>;
303
- /**
304
- * Sync data columns in the content table from a data object.
305
- * Used to promote revision data into the content table on publish.
306
- * Keys starting with _ are revision metadata (e.g. _slug) and are skipped.
307
- */
308
- private syncDataColumns;
309
318
  /**
310
319
  * Count content items with a pending schedule.
311
320
  * Includes both draft-scheduled (status='scheduled') and published
@@ -318,11 +327,17 @@ declare class ContentRepository {
318
327
  * Excludes null values from data to match input semantics
319
328
  */
320
329
  private mapRow;
330
+ private normalizeFilterScalar;
331
+ private normalizeFieldFilter;
332
+ private collectionExists;
333
+ private resolveFieldFilters;
334
+ private applyFieldFilters;
321
335
  /**
322
336
  * Map order field names to database columns.
323
337
  * Only allows known fields to prevent column enumeration via crafted orderBy values.
324
338
  */
325
339
  private mapOrderField;
340
+ private resolveOrderField;
326
341
  }
327
342
  //#endregion
328
343
  //#region src/database/repositories/media.d.ts
@@ -697,14 +712,27 @@ interface PortableTextBlock$1 {
697
712
  */
698
713
  type ImageValue = MediaValue;
699
714
  /**
700
- * File field value
715
+ * Persisted file field value.
716
+ *
717
+ * File values are references with cached metadata, not implicitly hydrated
718
+ * media records. Use the media provider API when current metadata is needed.
701
719
  */
702
720
  interface FileValue {
703
721
  id: string;
704
- url: string;
705
- filename: string;
706
- mimeType: string;
707
- size: number;
722
+ /** Legacy cached URL. Provider-backed values commonly omit this. */
723
+ url?: string;
724
+ /** Direct URL used by external media providers. */
725
+ src?: string;
726
+ /** Cached original filename, when available. */
727
+ filename?: string;
728
+ /** Cached MIME type, when available. */
729
+ mimeType?: string;
730
+ /** Cached file size in bytes, when persisted with the value. */
731
+ size?: number;
732
+ /** Media provider ID. Defaults to `local` when omitted. */
733
+ provider?: string;
734
+ /** Provider-specific data needed to resolve or render the file. */
735
+ meta?: Record<string, unknown>;
708
736
  }
709
737
  //#endregion
710
738
  //#region src/fields/image.d.ts
@@ -773,6 +801,10 @@ declare function handleContentList(db: Kysely<Database>, collection: string, par
773
801
  dateField?: ContentDateField;
774
802
  dateFrom?: string;
775
803
  dateTo?: string;
804
+ bylines?: string[];
805
+ bylinesNone?: boolean;
806
+ includeInferredBylines?: boolean;
807
+ fieldFilters?: ContentFieldFilters;
776
808
  }): Promise<ApiResult<ContentListResponse>>;
777
809
  /** A content author option for the admin author filter. */
778
810
  interface ContentAuthor {
@@ -810,7 +842,7 @@ declare function handleContentGetIncludingTrashed(db: Kysely<Database>, collecti
810
842
  */
811
843
  declare function handleContentCreate(db: Kysely<Database>, collection: string, body: {
812
844
  data: Record<string, unknown>;
813
- slug?: string;
845
+ slug?: string | null;
814
846
  status?: string;
815
847
  authorId?: string;
816
848
  bylines?: ContentBylineInput[];
@@ -830,7 +862,7 @@ declare function handleContentCreate(db: Kysely<Database>, collection: string, b
830
862
  */
831
863
  declare function handleContentUpdate(db: Kysely<Database>, collection: string, id: string, body: {
832
864
  data?: Record<string, unknown>;
833
- slug?: string;
865
+ slug?: string | null;
834
866
  status?: string;
835
867
  authorId?: string | null;
836
868
  bylines?: ContentBylineInput[];
@@ -898,13 +930,13 @@ declare function handleContentUnschedule(db: Kysely<Database>, collection: strin
898
930
  /**
899
931
  * Publish content immediately.
900
932
  *
901
- * Wrapped in a transaction because publish performs multiple writes
902
- * (syncDataColumns, slug sync, status/revision update) that must
903
- * be atomic to prevent FTS shadow table corruption on crash.
933
+ * Publication is one atomic content-row statement. On databases that support
934
+ * transactions, the existing slug-redirect side write remains grouped with it.
904
935
  */
905
936
  declare function handleContentPublish(db: Kysely<Database>, collection: string, id: string, options?: {
906
937
  publishedAt?: string;
907
938
  requireScheduledDue?: boolean;
939
+ expectedScheduledAt?: string;
908
940
  }): Promise<ApiResult<ContentResponse>>;
909
941
  /**
910
942
  * Unpublish content (revert to draft).
@@ -958,6 +990,7 @@ interface CollectionDefinition {
958
990
  label: string;
959
991
  labelSingular?: string;
960
992
  supports?: string[];
993
+ routable?: boolean;
961
994
  };
962
995
  }
963
996
  type CollectionMap = Record<string, CollectionDefinition>;
@@ -1050,7 +1083,7 @@ declare function handleMediaDelete(db: Kysely<Database>, id: string): Promise<Ap
1050
1083
  }>>;
1051
1084
  //#endregion
1052
1085
  //#region src/media/usage/content-refresh.d.ts
1053
- type ContentMediaUsageRefreshErrorCode = "CONTENT_NOT_FOUND" | "DRAFT_REVISION_NOT_FOUND" | "DRAFT_REVISION_MISMATCH" | "DRAFT_REVISION_INVALID" | "CONTENT_USAGE_REFRESH_ERROR" | "CONTENT_USAGE_DELETE_ERROR" | "CONTENT_USAGE_GENERATION_CONFLICT" | "CONTENT_USAGE_STALE";
1086
+ type ContentMediaUsageRefreshErrorCode = "CONTENT_NOT_FOUND" | "DRAFT_REVISION_NOT_FOUND" | "DRAFT_REVISION_MISMATCH" | "DRAFT_REVISION_INVALID" | "CONTENT_USAGE_REFRESH_ERROR" | "CONTENT_USAGE_DELETE_ERROR" | "CONTENT_USAGE_GENERATION_CONFLICT" | "CONTENT_USAGE_RESOURCE_LIMIT" | "CONTENT_USAGE_STALE";
1054
1087
  declare function markContentMediaUsageCollectionStaleSafely(db: Kysely<Database>, collectionSlug: string, lastErrorCode: ContentMediaUsageRefreshErrorCode): Promise<boolean>;
1055
1088
  //#endregion
1056
1089
  //#region src/schema/registry.d.ts
@@ -1100,6 +1133,12 @@ declare class SchemaRegistry {
1100
1133
  * a manifest that is now built fresh per admin request (no cache).
1101
1134
  */
1102
1135
  listCollectionsWithFields(): Promise<CollectionWithFields[]>;
1136
+ /**
1137
+ * Validate `titleField`/`dateField` against the collection's fields:
1138
+ * `titleField` must be a text-like field; `dateField` must be a `datetime` field.
1139
+ * Only truthy values are checked (undefined = unchanged, null/"" = cleared).
1140
+ */
1141
+ private validateTitleDateFields;
1103
1142
  /**
1104
1143
  * Create a new collection
1105
1144
  */
@@ -1115,6 +1154,7 @@ declare class SchemaRegistry {
1115
1154
  * in parameter-safe batches.
1116
1155
  */
1117
1156
  createSeedCollection(input: Omit<CreateCollectionInput, "source">, fields: readonly CreateFieldInput[]): Promise<void>;
1157
+ private assertSeedFieldDefinitions;
1118
1158
  /**
1119
1159
  * Update a collection
1120
1160
  */
@@ -1160,6 +1200,15 @@ declare class SchemaRegistry {
1160
1200
  * Delete a field
1161
1201
  */
1162
1202
  deleteField(collectionSlug: string, fieldSlug: string): Promise<void>;
1203
+ /**
1204
+ * Reorder collections in the admin sidebar.
1205
+ *
1206
+ * `slugs` is the full desired order: every listed collection gets its
1207
+ * index as `sort_order`, and any collection left out has its explicit
1208
+ * position cleared, dropping it back to the alphabetical tail. Unknown or
1209
+ * duplicate slugs throw before anything is written.
1210
+ */
1211
+ reorderCollections(slugs: string[]): Promise<void>;
1163
1212
  /**
1164
1213
  * Reorder fields
1165
1214
  */
@@ -1168,6 +1217,10 @@ declare class SchemaRegistry {
1168
1217
  * Create a content table for a collection
1169
1218
  */
1170
1219
  private createContentTable;
1220
+ private getFieldIndexName;
1221
+ private getLocaleFieldIndexName;
1222
+ private createFieldIndex;
1223
+ private dropFieldIndex;
1171
1224
  /**
1172
1225
  * Add a column to a content table
1173
1226
  */
@@ -1612,6 +1665,17 @@ interface PluginDescriptor<TOptions = Record<string, unknown>> {
1612
1665
  storage?: Record<string, StorageCollectionDeclaration>;
1613
1666
  /** Serialized MCP declarations emitted by the plugin build. */
1614
1667
  mcp?: PluginMcpManifestConfig;
1668
+ /**
1669
+ * Route declarations for sandboxed config-declared plugins. Mirrors
1670
+ * definePlugin({ routes }) and drives route auth decisions; omitted routes
1671
+ * default to non-public.
1672
+ */
1673
+ routes?: Array<ManifestRouteEntry | string>;
1674
+ /**
1675
+ * Hook declarations for sandboxed config-declared plugins. Mirrors
1676
+ * definePlugin({ hooks }).
1677
+ */
1678
+ hooks?: Array<ManifestHookEntry | string>;
1615
1679
  }
1616
1680
  /**
1617
1681
  * Sandboxed plugin descriptor - same format as PluginDescriptor
@@ -1902,6 +1966,19 @@ interface EmDashConfig {
1902
1966
  */
1903
1967
  allowedOrigins?: string[];
1904
1968
  trustedProxyHeaders?: string[];
1969
+ /**
1970
+ * User middleware that wraps the complete EmDash request pipeline.
1971
+ *
1972
+ * Before `next()` it runs before EmDash initializes its runtime or database,
1973
+ * so `locals.emdash`, the authenticated user, and request-scoped EmDash state
1974
+ * are unavailable. This allows cached responses and request gates to return
1975
+ * without paying initialization cost. When it calls `next()`, the resolved
1976
+ * response includes EmDash HTML injection and all other response mutations,
1977
+ * allowing the middleware to finalize caching and response headers safely.
1978
+ */
1979
+ middleware?: {
1980
+ /** Astro middleware module entrypoint. */outer: string | URL;
1981
+ };
1905
1982
  /**
1906
1983
  * Enable playground mode for ephemeral "try EmDash" sites.
1907
1984
  *
@@ -2110,6 +2187,8 @@ interface SandboxOptions {
2110
2187
  storage?: PluginCodeStorage;
2111
2188
  /** Database for bridge operations */
2112
2189
  db: Kysely<Database>;
2190
+ /** Called immediately before a sandboxed plugin content mutation. */
2191
+ beforeContentWrite?: () => Promise<void>;
2113
2192
  /** Default resource limits */
2114
2193
  limits?: ResourceLimits;
2115
2194
  /** Site info for plugin context (injected into wrapper at generation time) */
@@ -2178,7 +2257,36 @@ interface SerializedRequest {
2178
2257
  headers: Record<string, string>;
2179
2258
  /** Normalized request metadata extracted before RPC serialization */
2180
2259
  meta: RequestMeta;
2260
+ /**
2261
+ * Authenticated caller for private routes, resolved by the host before
2262
+ * dispatch. Undefined for public routes and unbound machine tokens.
2263
+ */
2264
+ user?: UserInfo;
2265
+ }
2266
+ declare const SANDBOX_ROUTE_ERROR_DEFINITIONS: {
2267
+ readonly MEDIA_USAGE_ACTIVATION_IN_PROGRESS: {
2268
+ readonly message: "Media usage activation is in progress";
2269
+ readonly status: 503;
2270
+ };
2271
+ readonly MEDIA_USAGE_ACTIVATION_CHECK_FAILED: {
2272
+ readonly message: "Unable to verify media usage activation state";
2273
+ readonly status: 503;
2274
+ };
2275
+ };
2276
+ type SandboxRouteErrorCode = keyof typeof SANDBOX_ROUTE_ERROR_DEFINITIONS;
2277
+ interface SandboxRouteErrorDetails {
2278
+ code: SandboxRouteErrorCode;
2279
+ message: string;
2280
+ status: 503;
2181
2281
  }
2282
+ interface SandboxRouteErrorEnvelope {
2283
+ __emdashSandboxRouteError: true;
2284
+ error: SandboxRouteErrorDetails;
2285
+ }
2286
+ declare function getSandboxRouteErrorDetails(error: unknown): SandboxRouteErrorDetails | null;
2287
+ declare function createSandboxRouteError(code: SandboxRouteErrorCode): Error & SandboxRouteErrorDetails;
2288
+ declare function createSandboxRouteErrorEnvelope(error: unknown): SandboxRouteErrorEnvelope | null;
2289
+ declare function getSandboxRouteErrorEnvelope(value: unknown): SandboxRouteErrorEnvelope | null;
2182
2290
  /**
2183
2291
  * Sandbox runner interface.
2184
2292
  * Platform adapters implement this to provide plugin isolation.
@@ -2314,6 +2422,7 @@ interface SiteInfoOptions {
2314
2422
  }
2315
2423
  interface PluginContextFactoryOptions {
2316
2424
  db: Kysely<Database>;
2425
+ beforeContentWrite?: () => Promise<void>;
2317
2426
  /**
2318
2427
  * Resolver for the database connection, preferred over `db` when present.
2319
2428
  * Called per `createContext()` so connection-backed adapters (e.g. Postgres
@@ -2744,6 +2853,18 @@ interface RouteResult<T = unknown> {
2744
2853
  };
2745
2854
  status: number;
2746
2855
  }
2856
+ /**
2857
+ * Host-side user shape accepted when dispatching a plugin route. Structurally
2858
+ * matches `User` from `@emdash-cms/auth` so hosts can pass `locals.user`
2859
+ * directly without the plugin layer depending on the auth package.
2860
+ */
2861
+ interface RouteCallerInput {
2862
+ id: string;
2863
+ email: string;
2864
+ name: string | null;
2865
+ role: number;
2866
+ createdAt: Date | string;
2867
+ }
2747
2868
  /**
2748
2869
  * Route invocation options
2749
2870
  */
@@ -2752,6 +2873,11 @@ interface InvokeRouteOptions {
2752
2873
  request: Request;
2753
2874
  /** Request body (already parsed) */
2754
2875
  body?: unknown;
2876
+ /**
2877
+ * Authenticated caller resolved by the host, exposed to the handler as
2878
+ * `ctx.user`. Undefined for public routes and unbound machine tokens.
2879
+ */
2880
+ user?: UserInfo;
2755
2881
  }
2756
2882
  /**
2757
2883
  * Error class for plugin routes
@@ -2808,6 +2934,8 @@ interface CronScheduler {
2808
2934
  reschedule(): void;
2809
2935
  /** Register a system cleanup function to run alongside each tick. */
2810
2936
  setSystemCleanup(fn: SystemCleanupFn): void;
2937
+ /** Register bounded Media Usage maintenance to run after the general tick settles. */
2938
+ setMediaUsageMaintenance?(fn: SystemCleanupFn): void;
2811
2939
  }
2812
2940
  /**
2813
2941
  * System cleanup callback invoked alongside each scheduler tick.
@@ -2844,6 +2972,10 @@ interface SandboxedPluginEntry {
2844
2972
  storage: PluginStorageConfig;
2845
2973
  /** Serialized MCP declarations emitted at plugin build time. */
2846
2974
  mcp?: PluginMcpManifestConfig;
2975
+ /** Route declarations (name + public/permission/cacheControl), used for route auth decisions */
2976
+ routes?: PluginManifest["routes"];
2977
+ /** Hook declarations this plugin implements */
2978
+ hooks?: PluginManifest["hooks"];
2847
2979
  /** Admin pages */
2848
2980
  adminPages?: Array<{
2849
2981
  path: string;
@@ -2971,6 +3103,7 @@ interface EmDashRuntimeParts {
2971
3103
  pipelineFactoryOptions: {
2972
3104
  db: Kysely<Database>;
2973
3105
  getDb?: () => Kysely<Database>;
3106
+ beforeContentWrite?: () => Promise<void>;
2974
3107
  storage?: Storage;
2975
3108
  siteInfo?: {
2976
3109
  siteName?: string;
@@ -2984,6 +3117,16 @@ interface EmDashRuntimeParts {
2984
3117
  current: HookPipeline;
2985
3118
  };
2986
3119
  }
3120
+ type MediaUsageMaintenanceTaskClass = "entry_work" | "collection_deletion" | "reconciliation";
3121
+ type MediaUsageMaintenanceResult = {
3122
+ outcome: "inactive" | "admission_closed";
3123
+ taskClass: null;
3124
+ turn: null;
3125
+ } | {
3126
+ outcome: "processed";
3127
+ taskClass: MediaUsageMaintenanceTaskClass;
3128
+ turn: number;
3129
+ };
2987
3130
  /**
2988
3131
  * EmDashRuntime - singleton per worker
2989
3132
  */
@@ -3031,6 +3174,8 @@ declare class EmDashRuntime {
3031
3174
  /** All plugins eligible for the hook pipeline (includes built-in plugins).
3032
3175
  * Stored so we can rebuild the pipeline when plugins are enabled/disabled. */
3033
3176
  private allPipelinePlugins;
3177
+ /** Guards the once-per-process plugin storage-index sync. */
3178
+ private storageIndexesSynced;
3034
3179
  /** Factory options for the hook pipeline context factory */
3035
3180
  private pipelineFactoryOptions;
3036
3181
  /** Dependencies needed for exclusive hook resolution */
@@ -3062,6 +3207,7 @@ declare class EmDashRuntime {
3062
3207
  * Returns the items promoted so callers can invalidate their cache tags.
3063
3208
  */
3064
3209
  publishScheduled(): Promise<PublishedRef[]>;
3210
+ private publishScheduledWithFence;
3065
3211
  /**
3066
3212
  * Run the full scheduled-maintenance batch: cron tasks, scheduled
3067
3213
  * publishing, and system cleanup. For request-less drivers — the
@@ -3081,6 +3227,14 @@ declare class EmDashRuntime {
3081
3227
  }): Promise<{
3082
3228
  published: PublishedRef[];
3083
3229
  }>;
3230
+ runScheduledMediaUsageTasks(): Promise<MediaUsageMaintenanceResult>;
3231
+ /**
3232
+ * Materialize plugin-declared storage indexes, once per process.
3233
+ *
3234
+ * Called from the scheduler path, not from request handlers — configured
3235
+ * plugins have no install handler, so the tick is their only sync moment.
3236
+ */
3237
+ syncPluginStorageIndexesOnce(): Promise<void>;
3084
3238
  /**
3085
3239
  * Stop the cron scheduler gracefully.
3086
3240
  * Call during worker shutdown or hot-reload.
@@ -3298,6 +3452,10 @@ declare class EmDashRuntime {
3298
3452
  dateField?: ContentDateField;
3299
3453
  dateFrom?: string;
3300
3454
  dateTo?: string;
3455
+ bylines?: string[];
3456
+ bylinesNone?: boolean;
3457
+ includeInferredBylines?: boolean;
3458
+ fieldFilters?: ContentFieldFilters;
3301
3459
  }): Promise<ApiResult<ContentListResponse>>;
3302
3460
  handleContentAuthors(collection: string): Promise<ApiResult<{
3303
3461
  items: ContentAuthor[];
@@ -3317,7 +3475,7 @@ declare class EmDashRuntime {
3317
3475
  private hydrateDraftData;
3318
3476
  handleContentCreate(collection: string, body: {
3319
3477
  data: Record<string, unknown>;
3320
- slug?: string;
3478
+ slug?: string | null;
3321
3479
  status?: string;
3322
3480
  authorId?: string;
3323
3481
  bylines?: Array<{
@@ -3346,7 +3504,7 @@ declare class EmDashRuntime {
3346
3504
  }>;
3347
3505
  handleContentUpdate(collection: string, id: string, body: {
3348
3506
  data?: Record<string, unknown>;
3349
- slug?: string;
3507
+ slug?: string | null;
3350
3508
  status?: string;
3351
3509
  authorId?: string | null;
3352
3510
  bylines?: Array<{
@@ -3362,7 +3520,7 @@ declare class EmDashRuntime {
3362
3520
  };
3363
3521
  taxonomies?: Record<string, string[]>;
3364
3522
  publishedAt?: string | null;
3365
- locale?: string; /** Skip revision creation (used by autosave) */
3523
+ locale?: string; /** Replace the previous autosave revision after staging this save. */
3366
3524
  skipRevision?: boolean;
3367
3525
  _rev?: string;
3368
3526
  }): Promise<{
@@ -3421,6 +3579,7 @@ declare class EmDashRuntime {
3421
3579
  handleContentPublish(collection: string, id: string, options?: {
3422
3580
  publishedAt?: string;
3423
3581
  requireScheduledDue?: boolean;
3582
+ expectedScheduledAt?: string;
3424
3583
  }): Promise<ApiResult<ContentResponse>>;
3425
3584
  handleContentUnpublish(collection: string, id: string): Promise<ApiResult<ContentResponse>>;
3426
3585
  handleContentSchedule(collection: string, id: string, scheduledAt: string): Promise<ApiResult<ContentResponse>>;
@@ -3493,13 +3652,14 @@ declare class EmDashRuntime {
3493
3652
  * contract of `getPluginSettingsSchema` for build-time plugins.
3494
3653
  */
3495
3654
  getRuntimePluginSettingsSchema(pluginId: string): Record<string, SettingField> | null;
3496
- handlePluginApiRoute(pluginId: string, _method: string, path: string, request: Request): Promise<{
3655
+ handlePluginApiRoute(pluginId: string, _method: string, path: string, request: Request, user?: RouteCallerInput | null): Promise<{
3497
3656
  success: boolean;
3498
3657
  data?: unknown;
3499
3658
  error?: {
3500
3659
  code: string;
3501
3660
  message: string;
3502
3661
  };
3662
+ status?: number;
3503
3663
  }>;
3504
3664
  getPluginMcpTools(pluginId?: string): Promise<{
3505
3665
  pluginId: string;
@@ -3522,13 +3682,14 @@ declare class EmDashRuntime {
3522
3682
  outputSchema?: z$1.ZodType;
3523
3683
  }[]>;
3524
3684
  serializePluginMcpConsent(tools: Awaited<ReturnType<EmDashRuntime["getPluginMcpTools"]>>, pluginId: string): string;
3525
- handlePluginMcpTool(pluginId: string, toolName: string, route: string, input: unknown, actorId: string, request: Request): Promise<{
3685
+ handlePluginMcpTool(pluginId: string, toolName: string, route: string, input: unknown, actorId: string, request: Request, caller?: RouteCallerInput | null): Promise<{
3526
3686
  success: boolean;
3527
3687
  data?: unknown;
3528
3688
  error?: {
3529
3689
  code: string;
3530
3690
  message: string;
3531
3691
  };
3692
+ status?: number;
3532
3693
  }>;
3533
3694
  handlePluginMcpDenied(pluginId: string, toolName: string, route: string, actorId: string, request: Request, reason: string): Promise<void>;
3534
3695
  private findSandboxedPlugin;
@@ -3704,6 +3865,8 @@ interface PortableTextTextBlock {
3704
3865
  style?: "normal" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "blockquote";
3705
3866
  listItem?: "bullet" | "number";
3706
3867
  level?: number;
3868
+ listId?: string;
3869
+ listStart?: number;
3707
3870
  children: PortableTextSpan[];
3708
3871
  markDefs?: PortableTextMarkDef[];
3709
3872
  textAlign?: "left" | "center" | "right" | "justify";
@@ -4426,6 +4589,8 @@ interface I18nConfig {
4426
4589
  * Returns null if i18n is not configured.
4427
4590
  */
4428
4591
  declare function getI18nConfig(): I18nConfig | null;
4592
+ /** Resolve the locale for a new content row. */
4593
+ declare function resolveContentCreateLocale(locale: unknown, config?: I18nConfig | null): string;
4429
4594
  /**
4430
4595
  * Check if i18n is enabled.
4431
4596
  * Returns true when multiple locales are configured.
@@ -4482,6 +4647,8 @@ declare function cachedQuery<T>(options: CachedQueryOptions<T>): Promise<T>;
4482
4647
  * writing isolate is instantly consistent) and the backend write is deferred
4483
4648
  * via `after`. Other isolates pick up the new epoch within their `revalidate`
4484
4649
  * window. No-ops when the cache is disabled.
4650
+ *
4651
+ * Content namespaces (`content:*`) also stamp {@link getLastContentWriteAt}.
4485
4652
  */
4486
4653
  declare function invalidateObjectCache(namespace: string): void;
4487
4654
  /**
@@ -4779,13 +4946,13 @@ declare const pluginManifestSchema: z$1.ZodObject<{
4779
4946
  string: "string";
4780
4947
  number: "number";
4781
4948
  boolean: "boolean";
4949
+ slug: "slug";
4950
+ text: "text";
4951
+ select: "select";
4782
4952
  file: "file";
4783
4953
  image: "image";
4784
4954
  datetime: "datetime";
4785
- slug: "slug";
4786
- text: "text";
4787
4955
  integer: "integer";
4788
- select: "select";
4789
4956
  multiSelect: "multiSelect";
4790
4957
  portableText: "portableText";
4791
4958
  reference: "reference";
@@ -5038,8 +5205,10 @@ declare class NodeCronScheduler implements CronScheduler {
5038
5205
  private timer;
5039
5206
  private running;
5040
5207
  private systemCleanup;
5208
+ private mediaUsageMaintenance;
5041
5209
  constructor(executor: CronExecutor);
5042
5210
  setSystemCleanup(fn: SystemCleanupFn): void;
5211
+ setMediaUsageMaintenance(fn: SystemCleanupFn): void;
5043
5212
  start(): void;
5044
5213
  stop(): void;
5045
5214
  reschedule(): void;
@@ -5734,8 +5903,8 @@ declare function getTaxonomyTerms(taxonomyName: string, options?: TaxonomyTermsO
5734
5903
  */
5735
5904
  declare function getTerm(taxonomyName: string, slug: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm | null>;
5736
5905
  /**
5737
- * Terms assigned to a content entry, resolved into the active locale. Terms
5738
- * whose translation_group lacks a row in the requested locale are omitted.
5906
+ * Terms assigned to a content entry, resolved into the active locale and then
5907
+ * the configured default locale.
5739
5908
  */
5740
5909
  declare function getEntryTerms(collection: string, entryId: string, taxonomyName?: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm[]>;
5741
5910
  /**
@@ -5834,11 +6003,17 @@ declare function getWidgetComponents(): WidgetComponentDef[];
5834
6003
  /**
5835
6004
  * Search configuration for a collection
5836
6005
  */
6006
+ declare const SEARCH_TOKENIZERS: readonly ["porter unicode61", "unicode61", "trigram"];
6007
+ type SearchTokenizer = (typeof SEARCH_TOKENIZERS)[number];
5837
6008
  interface SearchConfig {
5838
6009
  /** Whether search is enabled for this collection */
5839
6010
  enabled: boolean;
5840
6011
  /** Field weights for ranking (higher = more important) */
5841
6012
  weights?: Record<string, number>;
6013
+ /** Field slug used as the result title, from the collection's titleField. */
6014
+ titleField?: string;
6015
+ /** FTS5 tokenizer configuration (defaults to English Porter stemming) */
6016
+ tokenize?: SearchTokenizer;
5842
6017
  }
5843
6018
  /**
5844
6019
  * Options for search queries
@@ -5972,8 +6147,33 @@ declare class FTSManager {
5972
6147
  * @param collectionSlug - The collection slug
5973
6148
  * @param searchableFields - Array of field names to index
5974
6149
  * @param weights - Optional field weights for ranking
6150
+ * @param tokenize - Optional FTS5 tokenizer configuration
5975
6151
  */
5976
- createFtsTable(collectionSlug: string, searchableFields: string[], _weights?: Record<string, number>): Promise<void>;
6152
+ createFtsTable(collectionSlug: string, searchableFields: string[], _weights?: Record<string, number>, tokenize?: SearchTokenizer): Promise<void>;
6153
+ /**
6154
+ * SQL expression producing the indexed value for one searchable field.
6155
+ *
6156
+ * Portable Text fields are stored as JSON; indexing the raw JSON pollutes
6157
+ * the index with structural tokens (`_type`, style values like `normal`,
6158
+ * `_key` ULIDs) and makes snippets show JSON fragments. Extract the prose
6159
+ * instead: every JSON string under a `text`, `alt`, `caption`, or `code`
6160
+ * key (span text, image alt/caption, code blocks). This is a superset of
6161
+ * `extractPlainText` in text-extraction.ts, which walks only known block
6162
+ * shapes — the SQL variant takes those keys at any depth, so search and
6163
+ * the extractPlainText consumers (vectorize/ai-search) can see different
6164
+ * text for the same document. Only JSON documents
6165
+ * (arrays/objects) are extracted; legacy rows holding a bare string or a
6166
+ * JSON scalar (`Some title`, `2024`) are indexed as-is. Extraction must
6167
+ * live in SQL because the sync triggers cannot call into JS.
6168
+ *
6169
+ * `ref` must be a validated column reference (`NEW.x`, `OLD.x`, `"x"`).
6170
+ */
6171
+ private searchValueExpr;
6172
+ /**
6173
+ * Field type per slug for a collection, for choosing the indexed-value
6174
+ * expression. Fields missing from the schema fall back to raw indexing.
6175
+ */
6176
+ private getFieldTypes;
5977
6177
  /**
5978
6178
  * Create triggers to keep FTS table in sync with content table.
5979
6179
  *
@@ -5982,31 +6182,20 @@ declare class FTSManager {
5982
6182
  * search index and ensures the FTS row count matches the non-deleted
5983
6183
  * content count (which `verifyAndRepairIndex` relies on).
5984
6184
  *
5985
- * IMPORTANT: The FTS5 virtual table is created with `content='ec_<slug>'`
5986
- * which makes it an *external content* FTS5 table. For external-content
5987
- * tables, removing a row must use the documented `'delete'` command and
5988
- * supply the OLD column values explicitly, e.g.:
5989
- *
5990
- * INSERT INTO fts(fts, rowid, col1, col2)
5991
- * VALUES('delete', OLD.rowid, OLD.col1, OLD.col2);
5992
- *
5993
- * Using `DELETE FROM fts WHERE rowid = OLD.rowid` is the correct form
5994
- * for *contentless* tables but is unsafe for external-content tables:
5995
- * FTS5 then reads column values from the backing content table, which
5996
- * in an AFTER UPDATE trigger already holds the NEW values. The wrong
5997
- * tokens get removed and the inverted index drifts out of sync until
5998
- * SQLite raises `SQLITE_CORRUPT_VTAB` on the next mutation. See
5999
- * https://www.sqlite.org/fts5.html#external_content_tables.
6000
- *
6001
- * The UPDATE and DELETE triggers gate the `'delete'` on
6002
- * `OLD.deleted_at IS NULL` because the INSERT trigger never indexed
6003
- * rows that were already soft-deleted. Issuing `'delete'` for a rowid
6004
- * that was never inserted into the FTS index is itself a corruption
6005
- * trigger -- FTS5's `'delete'` is not a no-op on missing rowids and
6006
- * raises `SQLITE_CORRUPT_VTAB`. Affected paths include restore-from-
6007
- * trash (UPDATE where `OLD.deleted_at IS NOT NULL`), permanent-delete
6008
- * from trash (DELETE on a soft-deleted row), and any edit on a row
6009
- * that's currently in the trash.
6185
+ * The FTS table stores its own values (no `content=` option), so removal
6186
+ * is a plain `DELETE FROM fts WHERE rowid = OLD.rowid` — a harmless no-op
6187
+ * for rows that were never indexed (soft-deleted content). The
6188
+ * external-content `'delete'`-command choreography and its corruption
6189
+ * modes (migration 039) do not apply to self-contained tables.
6190
+ *
6191
+ * `INSERT OR REPLACE` keeps the insert path idempotent: re-running a
6192
+ * populate (D1 has no migration lock, so two isolates can race) converges
6193
+ * on one index row per content row instead of failing on the rowid
6194
+ * constraint.
6195
+ *
6196
+ * The trigger SQL emitted here MUST stay in lock-step with migration
6197
+ * `064_fts_plain_text.ts`. If this changes again, add a new migration
6198
+ * rather than editing shipped ones — migrations are forward-only.
6010
6199
  */
6011
6200
  private createTriggers;
6012
6201
  /**
@@ -6022,9 +6211,12 @@ declare class FTSManager {
6022
6211
  *
6023
6212
  * This is useful after bulk imports or if the index gets out of sync.
6024
6213
  */
6025
- rebuildIndex(collectionSlug: string, searchableFields: string[], weights?: Record<string, number>): Promise<void>;
6214
+ rebuildIndex(collectionSlug: string, searchableFields: string[], weights?: Record<string, number>, tokenize?: SearchTokenizer): Promise<void>;
6026
6215
  /**
6027
- * Populate the FTS table from existing content
6216
+ * Populate the FTS table from existing content.
6217
+ *
6218
+ * `INSERT OR REPLACE` so a concurrent double-populate (D1 has no
6219
+ * migration lock) converges instead of failing on the rowid constraint.
6028
6220
  */
6029
6221
  populateFromContent(collectionSlug: string, searchableFields: string[]): Promise<void>;
6030
6222
  /**
@@ -6045,7 +6237,7 @@ declare class FTSManager {
6045
6237
  * `title` is not a system column on `ec_*` tables -- it exists only when a
6046
6238
  * collection defines a field with slug `title`. Search and suggestion SQL
6047
6239
  * that selects `c.title` must check this first; otherwise collections
6048
- * without a title field raise "no such column: c.title" (#1178).
6240
+ * without a title field raise "no such column: c.title".
6049
6241
  */
6050
6242
  hasTitleColumn(collectionSlug: string): Promise<boolean>;
6051
6243
  /**
@@ -6066,6 +6258,7 @@ declare class FTSManager {
6066
6258
  */
6067
6259
  enableSearch(collectionSlug: string, options?: {
6068
6260
  weights?: Record<string, number>;
6261
+ tokenize?: SearchTokenizer;
6069
6262
  }): Promise<void>;
6070
6263
  /**
6071
6264
  * Disable search for a collection
@@ -6201,5 +6394,5 @@ declare function extractPlainText(blocks: PortableTextBlock[] | string | null |
6201
6394
  */
6202
6395
  declare function extractSearchableFields(entry: Record<string, unknown>, fields: string[]): Record<string, string>;
6203
6396
  //#endregion
6204
- export { ReorderMenuItemsInput as $, PluginRouteError as $n, handleContentSchedule as $r, ContentEntry as $t, getEntriesByTerm as A, PortableTextCodeBlock as An, handleMediaList as Ar, pluginManifestSchema as At, TaxonomyTerm as B, ProseMirrorNode as Bn, handleContentCountScheduled as Br, invalidateMenuObjectCache as Bt, ReorderWidgetsInput as C, getDb as Cn, SchemaRegistry as Cr, NoopSandboxRunner as Ct, WidgetComponentDef as D, hashString as Dn, handleMediaCreate as Dr, PluginManager as Dt, WidgetArea as E, computeContentHash as En, MediaResponse as Er, NodeCronScheduler as Et, getTerm as F, PortableTextSpan as Fn, handleRevisionList as Fr, contentNamespace as Ft, getEntriesByByline as G, Section as Gn, handleContentDuplicate as Gr, getFallbackChain as Gt, UpdateTermInput as H, getSections as Hn, handleContentCreate as Hr, invalidateSchemaObjectCache as Ht, getTermsForEntries as I, PortableTextTextBlock as In, handleRevisionRestore as Ir, contentNamespaces as It, CreateMenuInput as J, EmDashRuntime as Jn, handleContentList as Jr, WaitUntilFn as Jt, getMenu as K, SectionSource as Kn, handleContentGet as Kr, getI18nConfig as Kt, invalidateTermCache as L, PortableTextUnknownBlock as Ln, generateManifest as Lr, invalidateBylineObjectCache as Lt, getTaxonomyDef as M, PortableTextImageBlock as Mn, RevisionListResponse as Mr, CacheNamespace as Mt, getTaxonomyDefs as N, PortableTextLinkMark as Nn, RevisionResponse as Nr, CachedQueryOptions as Nt, WidgetType as O, portableTextToProsemirror as On, handleMediaDelete as Or, createPluginManager as Ot, getTaxonomyTerms as P, PortableTextMarkDef as Pn, handleRevisionGet as Pr, cachedQuery as Pt, MenuItemType as Q, SystemCleanupFn as Qn, handleContentRestore as Qr, CollectionResult as Qt, CreateTermInput as R, ProseMirrorDocument as Rn, handleContentAuthors as Rr, invalidateCollectionCache as Rt, PropDef as S, emdashLoader as Sn, SchemaError as Sr, verifyPreviewToken as St, Widget as T, sanitizeHref as Tn, MediaListResponse as Tr, createNoopSandboxRunner as Tt, getByline as U, CreateSectionInput as Un, handleContentDelete as Ur, invalidateTaxonomyObjectCache as Ut, TaxonomyTermRow as V, getSection as Vn, handleContentCountTrashed as Vr, invalidateObjectCache as Vt, getBylineBySlug as W, GetSectionsOptions as Wn, handleContentDiscardDraft as Wr, I18nConfig as Wt, Menu as X, PublishedRef as Xn, handleContentPermanentDelete as Xr, CacheHint as Xt, CreateMenuItemInput as Y, SandboxedPluginEntry as Yn, handleContentListTrashed as Yr, after as Yt, MenuItem as Z, CronScheduler as Zn, handleContentPublish as Zr, CollectionFilter as Zt, getWidgetArea as _, MediaItem as _i, CollectionFilter$1 as _n, getStoredConfig as _r, PreviewTokenPayload as _t, search as a, reference as ai, TranslationSummary as an, createHttpAccess as ar, getComments as at, CreateWidgetAreaInput as b, DatabaseConfig as bi, WhereRange as bn, StorageDescriptor as br, generatePreviewToken as bt, FTSManager as c, FieldDefinition as ci, getEmDashCollection as cn, SandboxEmailSendCallback as cr, getSiteSetting as ct, SearchOptions as d, ImageValue as di, resolveEmDashPath as dn, SandboxRunnerFactory as dr, getPreviewToken as dt, handleContentTranslations as ei, EditFieldMeta as en, RouteMeta as er, UpdateMenuInput as et, SearchResponse as f, PortableTextBlock$1 as fi, CMSAnnotation as fn, SandboxUnavailableError as fr, isPreviewRequest as ft, Suggestion as g, CreateMediaInput as gi, createNoop as gn, PluginDescriptor as gr, GeneratePreviewTokenOptions as gt, SuggestOptions as h, UserRepository as hi, createEditable as hn, EmDashConfig as hr, getPreviewUrl as ht, getSuggestions as i, portableText as ii, ResolvePathResult as in, createHookPipeline as ir, getCommentCount as it, getEntryTerms as j, PortableTextHtmlBlock as jn, handleMediaUpdate as jr, definePlugin as jt, getAllTermsForEntries as k, prosemirrorToPortableText as kn, handleMediaGet as kr, ValidatedPluginManifest as kt, CollectionSearchOptions as l, FieldUIHints as li, getEmDashEntry as ln, SandboxOptions as lr, getSiteSettings as lt, SearchStats as m, PluginStorageRepository as mi, FieldAnnotation as mn, SerializedRequest as mr, buildPreviewUrl as mt, extractSearchableFields as n, handleContentUnschedule as ni, EntryResult as nn, HookPipeline as nr, GetCommentsOptions as nt, searchCollection as o, file as oi, TranslationsResult as on, createUnrestrictedHttpAccess as or, getPluginSetting as ot, SearchResult as p, CompoundSelectLimitedAdapter as pi, EditProxy as pn, SandboxedPluginInstance as pr, GetPreviewUrlOptions as pt, getMenus as q, UpdateSectionInput as qn, handleContentGetIncludingTrashed as qr, isI18nEnabled as qt, getSearchStats as r, handleContentUpdate as ri, InferCollectionData as rn, HookResult as rr, GetCommentsResult as rt, searchWithDb as s, image as si, getEditMeta as sn, SandboxEmailMessage as sr, getPluginSettings as st, extractPlainText as t, handleContentUnpublish as ti, EmDashCollections as tn, EmailPipeline as tr, UpdateMenuItemInput as tt, SearchConfig as u, FileValue as ui, getTranslations as un, SandboxRunner as ur, setSiteSettings as ut, getWidgetAreas as v, MediaRepository as vi, EntryData as vn, LocalStorageConfig as vr, VerifyPreviewTokenOptions as vt, UpdateWidgetInput as w, isSafeHref as wn, markContentMediaUsageCollectionStaleSafely as wr, SandboxNotAvailableError as wt, CreateWidgetInput as x, EmDashDatabaseError as xi, WhereValue as xn, getCollectionInfo as xr, parseContentId as xt, getWidgetComponents as y, ContentRepository as yi, EntryFilter as yn, S3StorageConfig as yr, VerifyPreviewTokenResult as yt, TaxonomyDef as z, ProseMirrorMark as zn, handleContentCompare as zr, invalidateCommentObjectCache as zt };
6205
- //# sourceMappingURL=index-j9rTh3cp.d.mts.map
6397
+ export { MenuItem as $, SandboxedPluginEntry as $n, handleContentCountTrashed as $r, CacheHint as $t, WidgetType as A, MediaRepository as Ai, hashString as An, LocalStorageConfig as Ar, createPluginManager as At, CreateTermInput as B, PortableTextUnknownBlock as Bn, handleMediaDelete as Br, invalidateCollectionCache as Bt, CreateWidgetInput as C, ImageValue as Ci, WhereRange as Cn, createSandboxRouteError as Cr, parseContentId as Ct, Widget as D, UserRepository as Di, isSafeHref as Dn, EmDashConfig as Dr, createNoopSandboxRunner as Dt, UpdateWidgetInput as E, PluginStorageRepository as Ei, getDb as En, getSandboxRouteErrorEnvelope as Er, SandboxNotAvailableError as Et, getTaxonomyDefs as F, PortableTextImageBlock as Fn, SchemaRegistry as Fr, CachedQueryOptions as Ft, getByline as G, getSections as Gn, RevisionResponse as Gr, invalidateTaxonomyObjectCache as Gt, TaxonomyTerm as H, ProseMirrorMark as Hn, handleMediaList as Hr, invalidateMenuObjectCache as Ht, getTaxonomyTerms as I, PortableTextLinkMark as In, markContentMediaUsageCollectionStaleSafely as Ir, cachedQuery as It, getMenu as J, Section as Jn, handleRevisionRestore as Jr, getI18nConfig as Jt, getBylineBySlug as K, CreateSectionInput as Kn, handleRevisionGet as Kr, I18nConfig as Kt, getTerm as L, PortableTextMarkDef as Ln, MediaListResponse as Lr, contentNamespace as Lt, getEntriesByTerm as M, DatabaseConfig as Mi, prosemirrorToPortableText as Mn, StorageDescriptor as Mr, pluginManifestSchema as Mt, getEntryTerms as N, EmDashDatabaseError as Ni, PortableTextCodeBlock as Nn, getCollectionInfo as Nr, definePlugin as Nt, WidgetArea as O, CreateMediaInput as Oi, sanitizeHref as On, PluginDescriptor as Or, NodeCronScheduler as Ot, getTaxonomyDef as P, PortableTextHtmlBlock as Pn, SchemaError as Pr, CacheNamespace as Pt, Menu as Q, MediaUsageMaintenanceResult as Qn, handleContentCountScheduled as Qr, after as Qt, getTermsForEntries as R, PortableTextSpan as Rn, MediaResponse as Rr, contentNamespaces as Rt, CreateWidgetAreaInput as S, FileValue as Si, EntryFilter as Sn, SerializedRequest as Sr, generatePreviewToken as St, ReorderWidgetsInput as T, CompoundSelectLimitedAdapter as Ti, emdashLoader as Tn, getSandboxRouteErrorDetails as Tr, NoopSandboxRunner as Tt, TaxonomyTermRow as U, ProseMirrorNode as Un, handleMediaUpdate as Ur, invalidateObjectCache as Ut, TaxonomyDef as V, ProseMirrorDocument as Vn, handleMediaGet as Vr, invalidateCommentObjectCache as Vt, UpdateTermInput as W, getSection as Wn, RevisionListResponse as Wr, invalidateSchemaObjectCache as Wt, CreateMenuInput as X, UpdateSectionInput as Xn, handleContentAuthors as Xr, resolveContentCreateLocale as Xt, getMenus as Y, SectionSource as Yn, generateManifest as Yr, isI18nEnabled as Yt, CreateMenuItemInput as Z, EmDashRuntime as Zn, handleContentCompare as Zr, WaitUntilFn as Zt, SuggestOptions as _, reference as _i, FieldAnnotation as _n, SandboxRouteErrorEnvelope as _r, getPreviewUrl as _t, search as a, handleContentGetIncludingTrashed as ai, EntryResult as an, RouteMeta as ar, GetCommentsResult as at, getWidgetAreas as b, FieldDefinition as bi, CollectionFilter$1 as bn, SandboxUnavailableError as br, VerifyPreviewTokenOptions as bt, FTSManager as c, handleContentPermanentDelete as ci, TranslationSummary as cn, HookResult as cr, getPluginSetting as ct, SearchConfig as d, handleContentSchedule as di, getEmDashCollection as dn, createUnrestrictedHttpAccess as dr, getSiteSettings as dt, handleContentCreate as ei, CollectionFilter as en, PublishedRef as er, MenuItemType as et, SearchOptions as f, handleContentTranslations as fi, getEmDashEntry as fn, SandboxEmailMessage as fr, setSiteSettings as ft, SearchTokenizer as g, portableText as gi, EditProxy as gn, SandboxRouteErrorDetails as gr, buildPreviewUrl as gt, SearchStats as h, handleContentUpdate as hi, CMSAnnotation as hn, SandboxRouteErrorCode as hr, GetPreviewUrlOptions as ht, getSuggestions as i, handleContentGet as ii, EmDashCollections as in, RouteCallerInput as ir, GetCommentsOptions as it, getAllTermsForEntries as j, ContentRepository as ji, portableTextToProsemirror as jn, S3StorageConfig as jr, ValidatedPluginManifest as jt, WidgetComponentDef as k, MediaItem as ki, computeContentHash as kn, getStoredConfig as kr, PluginManager as kt, CollectionSearchOptions as l, handleContentPublish as li, TranslationsResult as ln, createHookPipeline as lr, getPluginSettings as lt, SearchResult as m, handleContentUnschedule as mi, resolveEmDashPath as mn, SandboxOptions as mr, isPreviewRequest as mt, extractSearchableFields as n, handleContentDiscardDraft as ni, ContentEntry as nn, SystemCleanupFn as nr, UpdateMenuInput as nt, searchCollection as o, handleContentList as oi, InferCollectionData as on, EmailPipeline as or, getCommentCount as ot, SearchResponse as p, handleContentUnpublish as pi, getTranslations as pn, SandboxEmailSendCallback as pr, getPreviewToken as pt, getEntriesByByline as q, GetSectionsOptions as qn, handleRevisionList as qr, getFallbackChain as qt, getSearchStats as r, handleContentDuplicate as ri, EditFieldMeta as rn, PluginRouteError as rr, UpdateMenuItemInput as rt, searchWithDb as s, handleContentListTrashed as si, ResolvePathResult as sn, HookPipeline as sr, getComments as st, extractPlainText as t, handleContentDelete as ti, CollectionResult as tn, CronScheduler as tr, ReorderMenuItemsInput as tt, SEARCH_TOKENIZERS as u, handleContentRestore as ui, getEditMeta as un, createHttpAccess as ur, getSiteSetting as ut, Suggestion as v, file as vi, createEditable as vn, SandboxRunner as vr, GeneratePreviewTokenOptions as vt, PropDef as w, PortableTextBlock$1 as wi, WhereValue as wn, createSandboxRouteErrorEnvelope as wr, verifyPreviewToken as wt, getWidgetComponents as x, FieldUIHints as xi, EntryData as xn, SandboxedPluginInstance as xr, VerifyPreviewTokenResult as xt, getWidgetArea as y, image as yi, createNoop as yn, SandboxRunnerFactory as yr, PreviewTokenPayload as yt, invalidateTermCache as z, PortableTextTextBlock as zn, handleMediaCreate as zr, invalidateBylineObjectCache as zt };
6398
+ //# sourceMappingURL=index-C3Y-rsyN.d.mts.map