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,34 +1,33 @@
1
- import { r as validatePluginIdentifier, t as validateIdentifier } from "./validate-VPnKoIzW.mjs";
2
- import { c as isSqlite } from "./dialect-helpers-DFwyWjTM.mjs";
3
- import { i as resolveConfiguredLocale, n as getI18nConfig, r as isI18nEnabled } from "./config-DyF3OKg_.mjs";
4
- import { o as invalidateCollectionCache } from "./object-cache-Bok5j2ae.mjs";
5
- import { r as RevisionRepository, t as ContentRepository } from "./content-CpfKV9QE.mjs";
6
- import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-D5dlPeRb.mjs";
7
- import { n as isMissingTableError, t as isMissingColumnError } from "./db-errors-CcWLaRiR.mjs";
8
- import { i as encodeBase64, t as decodeBase64 } from "./base64-B-PsqheR.mjs";
9
- import { n as InvalidCursorError, r as ScheduledNotDueError, t as EmDashValidationError } from "./types-XrQQ-Aex.mjs";
10
- import { t as MediaRepository } from "./media-tQDZEdu7.mjs";
11
- import { t as UserRepository } from "./user-BAumEmpA.mjs";
12
- import { t as TaxonomyRepository } from "./taxonomy-DvwWAPvA.mjs";
13
- import { t as CommentRepository } from "./comment-DnTxxVHv.mjs";
14
- import { t as OptionsRepository } from "./options-BlmBHTvX.mjs";
15
- import { t as withTransaction } from "./transaction-D0FOsb3X.mjs";
16
- import { t as RedirectRepository } from "./redirect-BJ6d1yHh.mjs";
1
+ import { i as validateStorageCollectionName, n as validateJsonFieldName, r as validatePluginIdentifier, t as validateIdentifier } from "./validate-BpwoDOgt.mjs";
2
+ import { c as isSqlite, l as jsonExtractExpr, s as isPostgres } from "./dialect-helpers-BSbfaO3F.mjs";
3
+ import { a as resolveConfiguredLocale, i as isI18nEnabled, r as getI18nConfig } from "./config-C3EBstHi.mjs";
4
+ import { t as after } from "./after-CBU2vkoO.mjs";
5
+ import { i as RevisionRepository, r as isSystemOrderField, t as ContentRepository } from "./content-BNfwh7xX.mjs";
6
+ import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DfPax1I0.mjs";
7
+ import { n as isMissingTableError, t as isMissingColumnError } from "./db-errors-Cl-sKYTm.mjs";
8
+ import { i as encodeBase64, t as decodeBase64 } from "./base64-CvLhUKQv.mjs";
9
+ import { a as ScheduledNotDueError, i as InvalidCursorError, n as ContentMutationConflictError, r as EmDashValidationError, t as ContentCollectionNotFoundError } from "./types-CQPWhPxE.mjs";
10
+ import { t as MediaRepository } from "./media-CzhAn2--.mjs";
11
+ import { t as UserRepository } from "./user-sHgJ62SP.mjs";
12
+ import { t as withTransaction } from "./transaction-NQj4VJ7Z.mjs";
13
+ import { t as TaxonomyRepository } from "./taxonomy-CPeM8d2o.mjs";
14
+ import { t as CommentRepository } from "./comment-Dxlep6cE.mjs";
15
+ import { t as OptionsRepository } from "./options-CBXIHUoT.mjs";
16
+ import { t as RedirectRepository } from "./redirect-COsS6SWJ.mjs";
17
17
  import { r as requestCached } from "./request-cache-BSUptuJR.mjs";
18
- import { t as BylineRepository } from "./byline-C5TAqs8N.mjs";
18
+ import { t as BylineRepository } from "./byline-pEcoDps8.mjs";
19
19
  import { r as parseAllowedMimeTypes, t as matchesMimeAllowlist } from "./mime-DfIVjNkr.mjs";
20
- import { t as SeoRepository } from "./seo-BAPKiED8.mjs";
21
- import { r as invalidateRedirectCache } from "./cache-B26cufFd.mjs";
22
- import { t as FTSManager } from "./fts-manager-vncsZIJm.mjs";
23
- import { u as invalidateTermCache } from "./taxonomies-B61CRSha.mjs";
24
- import { r as hashString } from "./hash-Cb7U1b5M.mjs";
25
- import { t as ErrorCode } from "./errors-DtEXIQQV.mjs";
26
- import { n as SchemaRegistry, t as SchemaError } from "./registry-BP1JK2xh.mjs";
27
- import { t as PluginStateRepository } from "./state-xxv6ZTMv.mjs";
28
- import { a as reconcileManifestAccess, i as pluginManifestSchema, r as normalizeManifestRoute } from "./manifest-schema-bCq54i7F.mjs";
29
- import { a as normalizeCapabilities, r as declaredAccessToCapabilities } from "./types-CK0LxPUQ.mjs";
30
- import { t as EmDashStorageError } from "./types-BD40g7zz.mjs";
31
- import { n as resolveAndValidateExternalUrl, t as SsrfError } from "./ssrf-CviKqWmq.mjs";
20
+ import { t as SeoRepository } from "./seo-CvDxfvFb.mjs";
21
+ import { n as invalidateRedirectCache } from "./cache-CBJaDy_E.mjs";
22
+ import { t as FTSManager } from "./fts-manager-CZ-5dVwJ.mjs";
23
+ import { u as invalidateTermCache } from "./taxonomies-B0o9ExNV.mjs";
24
+ import { r as hashString } from "./hash-Cg0TXJPV.mjs";
25
+ import { t as ErrorCode } from "./errors-CLUPm7aD.mjs";
26
+ import { t as PluginStateRepository } from "./state-DYwPue40.mjs";
27
+ import { a as reconcileManifestAccess, i as pluginManifestSchema, r as normalizeManifestRoute } from "./manifest-schema-BXbUAHod.mjs";
28
+ import { a as normalizeCapabilities, r as declaredAccessToCapabilities } from "./types-CP1CflWf.mjs";
29
+ import { t as EmDashStorageError } from "./types-BW1syrlw.mjs";
30
+ import { n as resolveAndValidateExternalUrl, t as SsrfError } from "./ssrf-Cpvg_n3A.mjs";
32
31
  import { sql } from "kysely";
33
32
  import { createGzipDecoder, unpackTar } from "modern-tar";
34
33
  import { ClientResponseError, ClientValidationError } from "@atcute/client";
@@ -189,6 +188,17 @@ const SEO_DEFAULTS = {
189
188
  async function collectionHasSeo(db, collection) {
190
189
  return (await db.selectFrom("_emdash_collections").select("has_seo").where("slug", "=", collection).executeTakeFirst())?.has_seo === 1;
191
190
  }
191
+ async function getCollectionPublishConfig(db, collection) {
192
+ const row = await db.selectFrom("_emdash_collections").select(["supports", "routable"]).where("slug", "=", collection).executeTakeFirst();
193
+ const supports = row?.supports ? JSON.parse(row.supports) : [];
194
+ return {
195
+ supportsRevisions: Array.isArray(supports) && supports.includes("revisions"),
196
+ routable: row?.routable !== 0
197
+ };
198
+ }
199
+ function requireRoutablePublishSlug(routable, slug) {
200
+ if (routable && !slug?.trim()) throw new EmDashValidationError("Cannot publish routable content without a slug");
201
+ }
192
202
  /**
193
203
  * Hydrate SEO data on a single content item if the collection has SEO enabled.
194
204
  */
@@ -332,19 +342,22 @@ async function resolveIdIncludingTrashed(repo, collection, identifier, locale) {
332
342
  }
333
343
  /**
334
344
  * Resolve the columns a content-list search should match against. Always
335
- * includes `slug` (a standard column) and adds the `title`/`name` display
336
- * fields when the collection actually defines them, mirroring the admin's
337
- * item-title resolution (title -> name -> slug). Returning only existing
338
- * columns avoids "no such column" errors on collections without them.
345
+ * includes `slug` (a standard column), adds the configured `titleField` plus
346
+ * the `title`/`name` display fields when the collection actually defines them,
347
+ * mirroring the admin's item-title resolution (titleField -> title -> name ->
348
+ * slug), and includes every field explicitly marked searchable. Returning only
349
+ * schema-backed columns avoids "no such column" errors.
339
350
  */
340
351
  async function resolveSearchColumns(db, collection) {
341
- const columns = ["slug"];
342
- const row = await db.selectFrom("_emdash_collections").select("id").where("slug", "=", collection).executeTakeFirst();
343
- if (!row) return columns;
344
- const fields = await db.selectFrom("_emdash_fields").select("slug").where("collection_id", "=", row.id).execute();
352
+ const row = await db.selectFrom("_emdash_collections").select(["id", "title_field"]).where("slug", "=", collection).executeTakeFirst();
353
+ if (!row) return ["slug"];
354
+ const fields = await db.selectFrom("_emdash_fields").select(["slug", "searchable"]).where("collection_id", "=", row.id).orderBy("sort_order", "asc").execute();
355
+ const columns = new Set(["slug"]);
345
356
  const fieldSlugs = new Set(fields.map((f) => f.slug));
346
- for (const candidate of ["title", "name"]) if (fieldSlugs.has(candidate)) columns.push(candidate);
347
- return columns;
357
+ if (row.title_field && fieldSlugs.has(row.title_field)) columns.add(row.title_field);
358
+ for (const candidate of ["title", "name"]) if (fieldSlugs.has(candidate)) columns.add(candidate);
359
+ for (const field of fields) if (field.searchable === 1) columns.add(field.slug);
360
+ return [...columns];
348
361
  }
349
362
  /**
350
363
  * Decide whether the content-list `q` filter can be served from the
@@ -370,10 +383,22 @@ async function canUseFtsForListFilter(db, collection, searchColumns) {
370
383
  * staged as `_slug` in a draft revision, which only land on publish).
371
384
  */
372
385
  async function createSlugChangeRedirect(db, collection, oldSlug, newSlug, contentId) {
386
+ if (await slugStillTaken(db, collection, oldSlug, contentId)) return;
373
387
  const collectionRow = await db.selectFrom("_emdash_collections").select("url_pattern").where("slug", "=", collection).executeTakeFirst();
374
388
  await new RedirectRepository(db).createAutoRedirect(collection, oldSlug, newSlug, contentId, collectionRow?.url_pattern ?? null);
375
389
  invalidateRedirectCache();
376
390
  }
391
+ /** Whether a row other than `contentId` still holds `slug` in this collection. */
392
+ async function slugStillTaken(db, collection, slug, contentId) {
393
+ validateIdentifier(collection, "collection slug");
394
+ return (await sql`
395
+ SELECT id FROM ${sql.ref(`ec_${collection}`)}
396
+ WHERE slug = ${slug}
397
+ AND id != ${contentId}
398
+ AND deleted_at IS NULL
399
+ LIMIT 1
400
+ `.execute(db)).rows.length > 0;
401
+ }
377
402
  /** Matches a date-only `YYYY-MM-DD` bound (no time component). */
378
403
  const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
379
404
  /**
@@ -391,6 +416,29 @@ function normalizeDateBound(value, edge) {
391
416
  return edge === "start" ? `${value}T00:00:00.000Z` : `${value}T23:59:59.999Z`;
392
417
  }
393
418
  /**
419
+ * Build the repository's byline filter from the wire params.
420
+ *
421
+ * `locale` is the locale the list is scoped to, which is the locale an
422
+ * inferred credit has to resolve at — the admin list is always scoped to the
423
+ * locale picked in its switcher.
424
+ */
425
+ function resolveBylineFilter(params, locale) {
426
+ const includeInferred = params.includeInferredBylines === true;
427
+ if (params.bylinesNone) return {
428
+ mode: "none",
429
+ includeInferred,
430
+ locale
431
+ };
432
+ const bylineIds = params.bylines ?? [];
433
+ if (bylineIds.length === 0) return void 0;
434
+ return {
435
+ mode: "any",
436
+ bylineIds,
437
+ includeInferred,
438
+ locale
439
+ };
440
+ }
441
+ /**
394
442
  * Create content list handler
395
443
  */
396
444
  async function handleContentList(db, collection, params) {
@@ -398,8 +446,12 @@ async function handleContentList(db, collection, params) {
398
446
  const repo = new ContentRepository(db);
399
447
  const where = {};
400
448
  if (params.status) where.status = params.status;
401
- if (params.locale) where.locale = resolveConfiguredLocale(params.locale);
449
+ const locale = params.locale ? resolveConfiguredLocale(params.locale) : void 0;
450
+ if (locale) where.locale = locale;
402
451
  if (params.authorId) where.authorId = params.authorId;
452
+ if (params.fieldFilters && Object.keys(params.fieldFilters).length > 0) where.fieldFilters = params.fieldFilters;
453
+ const bylineFilter = resolveBylineFilter(params, locale);
454
+ if (bylineFilter) where.bylineFilter = bylineFilter;
403
455
  if (params.dateField && (params.dateFrom || params.dateTo)) where.dateFilter = {
404
456
  field: params.dateField,
405
457
  from: normalizeDateBound(params.dateFrom, "start"),
@@ -411,6 +463,11 @@ async function handleContentList(db, collection, params) {
411
463
  where.searchColumns = await resolveSearchColumns(db, collection);
412
464
  where.useFts = await canUseFtsForListFilter(db, collection, where.searchColumns);
413
465
  }
466
+ let sortableExtras;
467
+ if (params.orderBy && !isSystemOrderField(params.orderBy)) {
468
+ const coll = await db.selectFrom("_emdash_collections").select(["title_field", "date_field"]).where("slug", "=", collection).executeTakeFirst();
469
+ sortableExtras = [coll?.title_field, coll?.date_field].filter((slug) => !!slug);
470
+ }
414
471
  const result = await repo.findMany(collection, {
415
472
  cursor: params.cursor,
416
473
  limit: params.limit || 50,
@@ -418,7 +475,8 @@ async function handleContentList(db, collection, params) {
418
475
  orderBy: params.orderBy ? {
419
476
  field: params.orderBy,
420
477
  direction: params.order || "desc"
421
- } : void 0
478
+ } : void 0,
479
+ sortableExtras
422
480
  });
423
481
  const hasSeo = await collectionHasSeo(db, collection);
424
482
  await hydrateSeoMany(db, collection, result.items, hasSeo);
@@ -439,7 +497,7 @@ async function handleContentList(db, collection, params) {
439
497
  message: error.message
440
498
  }
441
499
  };
442
- if (isMissingTableError(error)) return {
500
+ if (error instanceof ContentCollectionNotFoundError || isMissingTableError(error)) return {
443
501
  success: false,
444
502
  error: {
445
503
  code: "COLLECTION_NOT_FOUND",
@@ -607,6 +665,7 @@ async function handleContentCreate(db, collection, body) {
607
665
  const slugSource = getSlugSource(body.data);
608
666
  if (slugSource) slug = await repo.generateUniqueSlug(collection, slugSource, effectiveLocale);
609
667
  }
668
+ if (body.status === "published") requireRoutablePublishSlug((await getCollectionPublishConfig(trx, collection)).routable, slug);
610
669
  const created = await repo.create({
611
670
  type: collection,
612
671
  slug,
@@ -620,7 +679,6 @@ async function handleContentCreate(db, collection, body) {
620
679
  });
621
680
  if (body.bylines !== void 0) created.primaryBylineId = (await bylineRepo.setContentBylines(collection, created.id, body.bylines))[0]?.byline.translationGroup ?? null;
622
681
  if (body.translationOf) {
623
- await new TaxonomyRepository(trx).copyEntryTerms(collection, body.translationOf, created.id);
624
682
  if (body.bylines === void 0) {
625
683
  await bylineRepo.copyContentBylines(collection, body.translationOf, created.id);
626
684
  const source = await repo.findById(collection, body.translationOf);
@@ -707,7 +765,7 @@ async function handleContentUpdate(db, collection, id, body) {
707
765
  const item = await withTransaction(db, async (trx) => {
708
766
  const trxRepo = new ContentRepository(trx);
709
767
  const bylineRepo = new BylineRepository(trx);
710
- const existing = body._rev || body.slug ? await trxRepo.findById(collection, resolvedId) : null;
768
+ const existing = body._rev || body.slug !== void 0 || body.status === "published" ? await trxRepo.findById(collection, resolvedId) : null;
711
769
  if (body._rev) {
712
770
  if (!existing) throw Object.assign(/* @__PURE__ */ new Error(`Content item not found: ${id}`), { apiError: { code: "NOT_FOUND" } });
713
771
  const revCheck = validateRev(body._rev, existing);
@@ -715,6 +773,12 @@ async function handleContentUpdate(db, collection, id, body) {
715
773
  }
716
774
  let oldSlug;
717
775
  if (body.slug && existing?.slug && existing.slug !== body.slug) oldSlug = existing.slug;
776
+ if ((body.status ?? existing?.status) === "published") {
777
+ if (!existing) throw Object.assign(/* @__PURE__ */ new Error(`Content item not found: ${id}`), { apiError: { code: "NOT_FOUND" } });
778
+ const publishConfig = await getCollectionPublishConfig(trx, collection);
779
+ const intendedSlug = body.slug !== void 0 ? body.slug : existing.slug;
780
+ requireRoutablePublishSlug(publishConfig.routable, intendedSlug);
781
+ }
718
782
  const updated = await trxRepo.update(collection, resolvedId, {
719
783
  data: body.data,
720
784
  slug: body.slug,
@@ -1020,7 +1084,9 @@ async function handleContentSchedule(db, collection, id, scheduledAt) {
1020
1084
  try {
1021
1085
  const item = await withTransaction(db, async (trx) => {
1022
1086
  const repo = new ContentRepository(trx);
1023
- const resolvedId = await resolveId(repo, collection, id) ?? id;
1087
+ const existing = await repo.findByIdOrSlug(collection, id);
1088
+ const resolvedId = existing?.id ?? id;
1089
+ if (existing) requireRoutablePublishSlug((await getCollectionPublishConfig(trx, collection)).routable, existing.slug);
1024
1090
  return repo.schedule(collection, resolvedId, scheduledAt);
1025
1091
  });
1026
1092
  await hydrateSeo(db, collection, item, await collectionHasSeo(db, collection));
@@ -1082,17 +1148,17 @@ async function handleContentUnschedule(db, collection, id) {
1082
1148
  /**
1083
1149
  * Publish content immediately.
1084
1150
  *
1085
- * Wrapped in a transaction because publish performs multiple writes
1086
- * (syncDataColumns, slug sync, status/revision update) that must
1087
- * be atomic to prevent FTS shadow table corruption on crash.
1151
+ * Publication is one atomic content-row statement. On databases that support
1152
+ * transactions, the existing slug-redirect side write remains grouped with it.
1088
1153
  */
1089
1154
  async function handleContentPublish(db, collection, id, options = {}) {
1090
1155
  try {
1091
1156
  const item = await withTransaction(db, async (trx) => {
1092
1157
  const repo = new ContentRepository(trx);
1093
1158
  const resolvedId = await resolveId(repo, collection, id) ?? id;
1159
+ const publishConfig = await getCollectionPublishConfig(trx, collection);
1094
1160
  const existing = await repo.findById(collection, resolvedId);
1095
- const published = await repo.publish(collection, resolvedId, options.publishedAt, options.requireScheduledDue);
1161
+ const published = await repo.publish(collection, resolvedId, options.publishedAt, options.requireScheduledDue, options.expectedScheduledAt, publishConfig.supportsRevisions, publishConfig.routable);
1096
1162
  if (existing?.status === "published" && existing.slug && published.slug && existing.slug !== published.slug) await createSlugChangeRedirect(trx, collection, existing.slug, published.slug, resolvedId);
1097
1163
  return published;
1098
1164
  });
@@ -1102,6 +1168,13 @@ async function handleContentPublish(db, collection, id, options = {}) {
1102
1168
  data: { item }
1103
1169
  };
1104
1170
  } catch (error) {
1171
+ if (error instanceof ContentMutationConflictError) return {
1172
+ success: false,
1173
+ error: {
1174
+ code: "CONFLICT",
1175
+ message: error.message
1176
+ }
1177
+ };
1105
1178
  if (error instanceof ScheduledNotDueError) return {
1106
1179
  success: false,
1107
1180
  error: {
@@ -1395,6 +1468,7 @@ async function generateManifest(collections, plugins = {}) {
1395
1468
  label: definition.admin.label,
1396
1469
  labelSingular: definition.admin.labelSingular || definition.admin.label,
1397
1470
  supports: definition.admin.supports || [],
1471
+ routable: definition.admin.routable ?? true,
1398
1472
  fields
1399
1473
  };
1400
1474
  }
@@ -1563,22 +1637,30 @@ async function handleRevisionRestore(db, revisionId, callerUserId) {
1563
1637
  }
1564
1638
  };
1565
1639
  const { _slug, ...fieldData } = revision.data;
1566
- const item = await withTransaction(db, async (trx) => {
1640
+ const { item, queuedRevisionId } = await withTransaction(db, async (trx) => {
1567
1641
  const trxContentRepo = new ContentRepository(trx);
1568
1642
  const trxRevisionRepo = new RevisionRepository(trx);
1569
- const updated = await trxContentRepo.update(revision.collection, revision.entryId, {
1570
- data: fieldData,
1571
- slug: typeof _slug === "string" ? _slug : void 0
1572
- });
1573
- await trxRevisionRepo.create({
1574
- collection: revision.collection,
1575
- entryId: revision.entryId,
1576
- data: revision.data,
1577
- authorId: callerUserId
1578
- });
1579
- return updated;
1643
+ return {
1644
+ item: await trxContentRepo.update(revision.collection, revision.entryId, {
1645
+ data: fieldData,
1646
+ slug: typeof _slug === "string" ? _slug : void 0
1647
+ }),
1648
+ queuedRevisionId: (await trxRevisionRepo.create({
1649
+ collection: revision.collection,
1650
+ entryId: revision.entryId,
1651
+ data: revision.data,
1652
+ authorId: callerUserId
1653
+ })).id
1654
+ };
1655
+ });
1656
+ const pruneRepo = new RevisionRepository(db);
1657
+ after(async () => {
1658
+ try {
1659
+ await pruneRepo.pruneQueuedEntry(revision.collection, revision.entryId, queuedRevisionId, 50);
1660
+ } catch (error) {
1661
+ console.error(`[revisions] Failed to prune revisions for ${revision.collection}/${revision.entryId}:`, error);
1662
+ }
1580
1663
  });
1581
- new RevisionRepository(db).pruneOldRevisions(revision.collection, revision.entryId, 50).catch(() => {});
1582
1664
  return {
1583
1665
  success: true,
1584
1666
  data: { item }
@@ -1735,370 +1817,6 @@ async function handleMediaDelete(db, id) {
1735
1817
  }
1736
1818
  }
1737
1819
 
1738
- //#endregion
1739
- //#region src/api/handlers/schema.ts
1740
- /**
1741
- * List all collections
1742
- */
1743
- async function handleSchemaCollectionList(db) {
1744
- try {
1745
- return {
1746
- success: true,
1747
- data: { items: await new SchemaRegistry(db).listCollections() }
1748
- };
1749
- } catch {
1750
- return {
1751
- success: false,
1752
- error: {
1753
- code: "SCHEMA_LIST_ERROR",
1754
- message: "Failed to list collections"
1755
- }
1756
- };
1757
- }
1758
- }
1759
- /**
1760
- * Get a collection by slug
1761
- */
1762
- async function handleSchemaCollectionGet(db, slug, options) {
1763
- try {
1764
- const registry = new SchemaRegistry(db);
1765
- if (options?.includeFields) {
1766
- const item = await registry.getCollectionWithFields(slug);
1767
- if (!item) return {
1768
- success: false,
1769
- error: {
1770
- code: "NOT_FOUND",
1771
- message: `Collection not found: ${slug}`
1772
- }
1773
- };
1774
- return {
1775
- success: true,
1776
- data: { item }
1777
- };
1778
- }
1779
- const item = await registry.getCollection(slug);
1780
- if (!item) return {
1781
- success: false,
1782
- error: {
1783
- code: "NOT_FOUND",
1784
- message: `Collection not found: ${slug}`
1785
- }
1786
- };
1787
- return {
1788
- success: true,
1789
- data: { item }
1790
- };
1791
- } catch {
1792
- return {
1793
- success: false,
1794
- error: {
1795
- code: "SCHEMA_GET_ERROR",
1796
- message: "Failed to get collection"
1797
- }
1798
- };
1799
- }
1800
- }
1801
- /**
1802
- * Create a collection
1803
- */
1804
- async function handleSchemaCollectionCreate(db, input) {
1805
- try {
1806
- return {
1807
- success: true,
1808
- data: { item: await new SchemaRegistry(db).createCollection(input) }
1809
- };
1810
- } catch (error) {
1811
- if (error instanceof SchemaError) return {
1812
- success: false,
1813
- error: {
1814
- code: error.code,
1815
- message: error.message,
1816
- details: error.details
1817
- }
1818
- };
1819
- console.error("[emdash] Failed to create collection:", error);
1820
- return {
1821
- success: false,
1822
- error: {
1823
- code: "SCHEMA_CREATE_ERROR",
1824
- message: "Failed to create collection"
1825
- }
1826
- };
1827
- }
1828
- }
1829
- /**
1830
- * Update a collection
1831
- */
1832
- async function handleSchemaCollectionUpdate(db, slug, input) {
1833
- try {
1834
- return {
1835
- success: true,
1836
- data: { item: await new SchemaRegistry(db).updateCollection(slug, input) }
1837
- };
1838
- } catch (error) {
1839
- if (error instanceof SchemaError) return {
1840
- success: false,
1841
- error: {
1842
- code: error.code,
1843
- message: error.message,
1844
- details: error.details
1845
- }
1846
- };
1847
- return {
1848
- success: false,
1849
- error: {
1850
- code: "SCHEMA_UPDATE_ERROR",
1851
- message: "Failed to update collection"
1852
- }
1853
- };
1854
- }
1855
- }
1856
- /**
1857
- * Delete a collection
1858
- */
1859
- async function handleSchemaCollectionDelete(db, slug, options) {
1860
- try {
1861
- await new SchemaRegistry(db).deleteCollection(slug, options);
1862
- return {
1863
- success: true,
1864
- data: { success: true }
1865
- };
1866
- } catch (error) {
1867
- if (error instanceof SchemaError) return {
1868
- success: false,
1869
- error: {
1870
- code: error.code,
1871
- message: error.message,
1872
- details: error.details
1873
- }
1874
- };
1875
- return {
1876
- success: false,
1877
- error: {
1878
- code: "SCHEMA_DELETE_ERROR",
1879
- message: "Failed to delete collection"
1880
- }
1881
- };
1882
- }
1883
- }
1884
- /**
1885
- * List fields for a collection
1886
- */
1887
- async function handleSchemaFieldList(db, collectionSlug) {
1888
- try {
1889
- const registry = new SchemaRegistry(db);
1890
- const collection = await registry.getCollection(collectionSlug);
1891
- if (!collection) return {
1892
- success: false,
1893
- error: {
1894
- code: "NOT_FOUND",
1895
- message: `Collection not found: ${collectionSlug}`
1896
- }
1897
- };
1898
- return {
1899
- success: true,
1900
- data: { items: await registry.listFields(collection.id) }
1901
- };
1902
- } catch {
1903
- return {
1904
- success: false,
1905
- error: {
1906
- code: "SCHEMA_FIELD_LIST_ERROR",
1907
- message: "Failed to list fields"
1908
- }
1909
- };
1910
- }
1911
- }
1912
- /**
1913
- * Get a field
1914
- */
1915
- async function handleSchemaFieldGet(db, collectionSlug, fieldSlug) {
1916
- try {
1917
- const item = await new SchemaRegistry(db).getField(collectionSlug, fieldSlug);
1918
- if (!item) return {
1919
- success: false,
1920
- error: {
1921
- code: "NOT_FOUND",
1922
- message: `Field not found: ${fieldSlug} in collection ${collectionSlug}`
1923
- }
1924
- };
1925
- return {
1926
- success: true,
1927
- data: { item }
1928
- };
1929
- } catch {
1930
- return {
1931
- success: false,
1932
- error: {
1933
- code: "SCHEMA_FIELD_GET_ERROR",
1934
- message: "Failed to get field"
1935
- }
1936
- };
1937
- }
1938
- }
1939
- /**
1940
- * Create a field
1941
- */
1942
- async function handleSchemaFieldCreate(db, collectionSlug, input) {
1943
- try {
1944
- const item = await new SchemaRegistry(db).createField(collectionSlug, input);
1945
- invalidateCollectionCache(collectionSlug);
1946
- return {
1947
- success: true,
1948
- data: { item }
1949
- };
1950
- } catch (error) {
1951
- if (error instanceof SchemaError) return {
1952
- success: false,
1953
- error: {
1954
- code: error.code,
1955
- message: error.message,
1956
- details: error.details
1957
- }
1958
- };
1959
- return {
1960
- success: false,
1961
- error: {
1962
- code: "SCHEMA_FIELD_CREATE_ERROR",
1963
- message: "Failed to create field"
1964
- }
1965
- };
1966
- }
1967
- }
1968
- /**
1969
- * Update a field
1970
- */
1971
- async function handleSchemaFieldUpdate(db, collectionSlug, fieldSlug, input) {
1972
- try {
1973
- const item = await new SchemaRegistry(db).updateField(collectionSlug, fieldSlug, input);
1974
- invalidateCollectionCache(collectionSlug);
1975
- return {
1976
- success: true,
1977
- data: { item }
1978
- };
1979
- } catch (error) {
1980
- if (error instanceof SchemaError) return {
1981
- success: false,
1982
- error: {
1983
- code: error.code,
1984
- message: error.message,
1985
- details: error.details
1986
- }
1987
- };
1988
- return {
1989
- success: false,
1990
- error: {
1991
- code: "SCHEMA_FIELD_UPDATE_ERROR",
1992
- message: "Failed to update field"
1993
- }
1994
- };
1995
- }
1996
- }
1997
- /**
1998
- * Delete a field
1999
- */
2000
- async function handleSchemaFieldDelete(db, collectionSlug, fieldSlug) {
2001
- try {
2002
- await new SchemaRegistry(db).deleteField(collectionSlug, fieldSlug);
2003
- invalidateCollectionCache(collectionSlug);
2004
- return {
2005
- success: true,
2006
- data: { success: true }
2007
- };
2008
- } catch (error) {
2009
- if (error instanceof SchemaError) return {
2010
- success: false,
2011
- error: {
2012
- code: error.code,
2013
- message: error.message,
2014
- details: error.details
2015
- }
2016
- };
2017
- return {
2018
- success: false,
2019
- error: {
2020
- code: "SCHEMA_FIELD_DELETE_ERROR",
2021
- message: "Failed to delete field"
2022
- }
2023
- };
2024
- }
2025
- }
2026
- /**
2027
- * Reorder fields
2028
- */
2029
- async function handleSchemaFieldReorder(db, collectionSlug, fieldSlugs) {
2030
- try {
2031
- await new SchemaRegistry(db).reorderFields(collectionSlug, fieldSlugs);
2032
- return {
2033
- success: true,
2034
- data: { success: true }
2035
- };
2036
- } catch (error) {
2037
- if (error instanceof SchemaError) return {
2038
- success: false,
2039
- error: {
2040
- code: error.code,
2041
- message: error.message,
2042
- details: error.details
2043
- }
2044
- };
2045
- return {
2046
- success: false,
2047
- error: {
2048
- code: "SCHEMA_FIELD_REORDER_ERROR",
2049
- message: "Failed to reorder fields"
2050
- }
2051
- };
2052
- }
2053
- }
2054
- /**
2055
- * List orphaned content tables
2056
- */
2057
- async function handleOrphanedTableList(db) {
2058
- try {
2059
- return {
2060
- success: true,
2061
- data: { items: await new SchemaRegistry(db).discoverOrphanedTables() }
2062
- };
2063
- } catch (error) {
2064
- console.error("[emdash] Failed to list orphaned tables:", error);
2065
- return {
2066
- success: false,
2067
- error: {
2068
- code: "ORPHAN_LIST_ERROR",
2069
- message: "Failed to list orphaned tables"
2070
- }
2071
- };
2072
- }
2073
- }
2074
- /**
2075
- * Register an orphaned table as a collection
2076
- */
2077
- async function handleOrphanedTableRegister(db, slug, options) {
2078
- try {
2079
- return {
2080
- success: true,
2081
- data: { item: await new SchemaRegistry(db).registerOrphanedTable(slug, options) }
2082
- };
2083
- } catch (error) {
2084
- if (error instanceof SchemaError) return {
2085
- success: false,
2086
- error: {
2087
- code: error.code,
2088
- message: error.message,
2089
- details: error.details
2090
- }
2091
- };
2092
- return {
2093
- success: false,
2094
- error: {
2095
- code: "ORPHAN_REGISTER_ERROR",
2096
- message: "Failed to register orphaned table"
2097
- }
2098
- };
2099
- }
2100
- }
2101
-
2102
1820
  //#endregion
2103
1821
  //#region src/api/handlers/plugins.ts
2104
1822
  function marketplaceIconUrl(marketplaceUrl, pluginId) {
@@ -2750,6 +2468,171 @@ function createMarketplaceClient(baseUrl, siteOrigin) {
2750
2468
  return new MarketplaceClientImpl(baseUrl, siteOrigin);
2751
2469
  }
2752
2470
 
2471
+ //#endregion
2472
+ //#region src/plugins/storage-indexes.ts
2473
+ /**
2474
+ * Generate a deterministic index name.
2475
+ * Unique indexes use a `uidx_` prefix to avoid collisions with regular indexes on the same fields.
2476
+ */
2477
+ function generateIndexName(pluginId, collection, fields, options) {
2478
+ return `${options?.unique ? "uidx" : "idx"}_plugin_${pluginId}_${collection}_${fields.join("_")}`.substring(0, 128);
2479
+ }
2480
+ /**
2481
+ * Generate a Kysely sql expression for creating an expression index.
2482
+ *
2483
+ * Validates all inputs before interpolation. The collection uses the
2484
+ * permissive manifest-key rules rather than SQL-identifier rules — it is
2485
+ * stored as opaque text and only reaches SQL inside the generated index
2486
+ * name — so kebab-case collections index like any other.
2487
+ */
2488
+ function generateCreateIndexSql(db, pluginId, collection, fields, options) {
2489
+ validatePluginIdentifier(pluginId, "plugin ID");
2490
+ validateStorageCollectionName(collection, "collection name");
2491
+ for (const field of fields) validateJsonFieldName(field, "index field name");
2492
+ const indexName = generateIndexName(pluginId, collection, fields, options);
2493
+ const expressions = fields.map((field) => {
2494
+ if (isPostgres(db)) return `(${jsonExtractExpr(db, "data", field)})`;
2495
+ return jsonExtractExpr(db, "data", field);
2496
+ }).join(", ");
2497
+ const createKeyword = options?.unique ? "CREATE UNIQUE INDEX" : "CREATE INDEX";
2498
+ return sql`${sql.raw(createKeyword)} IF NOT EXISTS ${sql.ref(indexName)}
2499
+ ON _plugin_storage(plugin_id, collection, ${sql.raw(expressions)})
2500
+ `;
2501
+ }
2502
+ /**
2503
+ * Generate a Kysely sql expression for dropping an index.
2504
+ *
2505
+ * Uses sql.ref() for safe identifier quoting.
2506
+ */
2507
+ function generateDropIndexSql(indexName) {
2508
+ return sql`DROP INDEX IF EXISTS ${sql.ref(indexName)}`;
2509
+ }
2510
+ /**
2511
+ * Normalize index declarations to arrays of field arrays
2512
+ */
2513
+ function normalizeIndexes(indexes) {
2514
+ return indexes.map((index) => Array.isArray(index) ? index : [index]);
2515
+ }
2516
+ /**
2517
+ * Create all declared indexes for a plugin collection
2518
+ */
2519
+ async function createStorageIndexes(db, pluginId, collection, indexes, options) {
2520
+ const normalized = normalizeIndexes(indexes);
2521
+ const uniqueNormalized = options?.uniqueIndexes ? normalizeIndexes(options.uniqueIndexes) : [];
2522
+ const uniqueSet = new Set(uniqueNormalized.map((f) => f.join(",")));
2523
+ const allEntries = [...normalized.filter((f) => !uniqueSet.has(f.join(","))).map((fields) => ({
2524
+ fields,
2525
+ unique: false
2526
+ })), ...uniqueNormalized.map((fields) => ({
2527
+ fields,
2528
+ unique: true
2529
+ }))];
2530
+ const created = [];
2531
+ const errors = [];
2532
+ for (const entry of allEntries) {
2533
+ const { fields } = entry;
2534
+ const indexName = generateIndexName(pluginId, collection, fields, { unique: entry.unique });
2535
+ try {
2536
+ await generateCreateIndexSql(db, pluginId, collection, fields, { unique: entry.unique }).execute(db);
2537
+ await db.insertInto("_plugin_indexes").values({
2538
+ plugin_id: pluginId,
2539
+ collection,
2540
+ index_name: indexName,
2541
+ fields: JSON.stringify(fields)
2542
+ }).onConflict((oc) => oc.columns([
2543
+ "plugin_id",
2544
+ "collection",
2545
+ "index_name"
2546
+ ]).doUpdateSet({ fields: JSON.stringify(fields) })).execute();
2547
+ created.push(indexName);
2548
+ } catch (error) {
2549
+ errors.push({
2550
+ index: indexName,
2551
+ error: error instanceof Error ? error.message : String(error)
2552
+ });
2553
+ }
2554
+ }
2555
+ return {
2556
+ created,
2557
+ errors
2558
+ };
2559
+ }
2560
+ /**
2561
+ * Remove indexes that are no longer declared
2562
+ */
2563
+ async function removeOrphanedIndexes(db, pluginId, collection, currentIndexes, options) {
2564
+ const normalized = normalizeIndexes(currentIndexes);
2565
+ const uniqueNormalized = options?.uniqueIndexes ? normalizeIndexes(options.uniqueIndexes) : [];
2566
+ const uniqueSet = new Set(uniqueNormalized.map((f) => f.join(",")));
2567
+ const currentIndexNames = /* @__PURE__ */ new Set();
2568
+ for (const fields of normalized) if (!uniqueSet.has(fields.join(","))) currentIndexNames.add(generateIndexName(pluginId, collection, fields));
2569
+ for (const fields of uniqueNormalized) currentIndexNames.add(generateIndexName(pluginId, collection, fields, { unique: true }));
2570
+ const existingIndexes = await db.selectFrom("_plugin_indexes").select(["index_name"]).where("plugin_id", "=", pluginId).where("collection", "=", collection).execute();
2571
+ const removed = [];
2572
+ const errors = [];
2573
+ for (const { index_name } of existingIndexes) if (!currentIndexNames.has(index_name)) try {
2574
+ await generateDropIndexSql(index_name).execute(db);
2575
+ await db.deleteFrom("_plugin_indexes").where("plugin_id", "=", pluginId).where("collection", "=", collection).where("index_name", "=", index_name).execute();
2576
+ removed.push(index_name);
2577
+ } catch (error) {
2578
+ errors.push({
2579
+ index: index_name,
2580
+ error: error instanceof Error ? error.message : String(error)
2581
+ });
2582
+ }
2583
+ return {
2584
+ removed,
2585
+ errors
2586
+ };
2587
+ }
2588
+ /**
2589
+ * Sync indexes for a plugin collection (create new, remove old)
2590
+ */
2591
+ async function syncStorageIndexes(db, pluginId, collection, indexes, options) {
2592
+ const [createResult, removeResult] = await Promise.all([createStorageIndexes(db, pluginId, collection, indexes, options), removeOrphanedIndexes(db, pluginId, collection, indexes, options)]);
2593
+ return {
2594
+ created: createResult.created,
2595
+ removed: removeResult.removed,
2596
+ errors: [...createResult.errors, ...removeResult.errors]
2597
+ };
2598
+ }
2599
+ /**
2600
+ * Materialize the storage indexes a set of plugins declare in their
2601
+ * manifests. Failures are logged per collection and never thrown — a missing
2602
+ * index affects query performance, not correctness, so it must not fail an
2603
+ * install or a scheduler tick.
2604
+ */
2605
+ async function syncDeclaredStorageIndexes(db, plugins) {
2606
+ for (const plugin of plugins) for (const [collection, config] of Object.entries(plugin.storage ?? {})) try {
2607
+ const result = await syncStorageIndexes(db, plugin.id, collection, config.indexes, { uniqueIndexes: config.uniqueIndexes });
2608
+ for (const failure of result.errors) console.error(`[plugins] Failed to sync storage index ${failure.index} for ${plugin.id}/${collection}: ${failure.error}`);
2609
+ } catch (error) {
2610
+ console.error(`[plugins] Failed to sync storage indexes for ${plugin.id}/${collection}:`, error);
2611
+ }
2612
+ }
2613
+ /**
2614
+ * Remove all indexes for a plugin
2615
+ */
2616
+ async function removeAllPluginIndexes(db, pluginId) {
2617
+ const existingIndexes = await db.selectFrom("_plugin_indexes").select(["index_name", "collection"]).where("plugin_id", "=", pluginId).execute();
2618
+ const removed = [];
2619
+ const errors = [];
2620
+ for (const { index_name } of existingIndexes) try {
2621
+ await generateDropIndexSql(index_name).execute(db);
2622
+ removed.push(index_name);
2623
+ } catch (error) {
2624
+ errors.push({
2625
+ index: index_name,
2626
+ error: error instanceof Error ? error.message : String(error)
2627
+ });
2628
+ }
2629
+ await db.deleteFrom("_plugin_indexes").where("plugin_id", "=", pluginId).execute();
2630
+ return {
2631
+ removed,
2632
+ errors
2633
+ };
2634
+ }
2635
+
2753
2636
  //#endregion
2754
2637
  //#region src/api/handlers/marketplace.ts
2755
2638
  /** Semver-like pattern: digits, dots, hyphens, plus signs (e.g. 1.0.0, 1.0.0-beta.1) */
@@ -2984,6 +2867,7 @@ async function handleMarketplaceInstall(db, storage, sandboxRunner, marketplaceU
2984
2867
  displayName: pluginDetail.name,
2985
2868
  description: pluginDetail.description ?? void 0
2986
2869
  });
2870
+ await syncDeclaredStorageIndexes(db, [bundle.manifest]);
2987
2871
  client.reportInstall(pluginId, version).catch(() => {});
2988
2872
  return {
2989
2873
  success: true,
@@ -3145,6 +3029,7 @@ async function handleMarketplaceUpdate(db, storage, sandboxRunner, marketplaceUr
3145
3029
  mcpToolsEnabled: false,
3146
3030
  mcpToolsConsent: null
3147
3031
  });
3032
+ await syncDeclaredStorageIndexes(db, [bundle.manifest]);
3148
3033
  deleteBundleFromR2(storage, pluginId, oldVersion).catch(() => {});
3149
3034
  return {
3150
3035
  success: true,
@@ -3199,6 +3084,9 @@ async function handleMarketplaceUninstall(db, storage, pluginId, opts) {
3199
3084
  await db.deleteFrom("_plugin_storage").where("plugin_id", "=", pluginId).execute();
3200
3085
  dataDeleted = true;
3201
3086
  } catch {}
3087
+ try {
3088
+ await removeAllPluginIndexes(db, pluginId);
3089
+ } catch {}
3202
3090
  await stateRepo.delete(pluginId);
3203
3091
  return {
3204
3092
  success: true,
@@ -4360,6 +4248,7 @@ async function handleRegistryInstall(db, storage, sandboxRunner, registryConfigI
4360
4248
  }
4361
4249
  throw stateErr;
4362
4250
  }
4251
+ await syncDeclaredStorageIndexes(db, [bundle.manifest]);
4363
4252
  return {
4364
4253
  success: true,
4365
4254
  data: {
@@ -4431,6 +4320,9 @@ async function handleRegistryUninstall(db, storage, pluginId, opts) {
4431
4320
  dataDeleted = true;
4432
4321
  }
4433
4322
  if (storage) await deleteBundleFromR2(storage, pluginId, version, "registry");
4323
+ try {
4324
+ await removeAllPluginIndexes(db, pluginId);
4325
+ } catch {}
4434
4326
  await stateRepo.delete(pluginId);
4435
4327
  return {
4436
4328
  success: true,
@@ -4673,6 +4565,7 @@ async function handleRegistryUpdate(db, storage, sandboxRunner, registryConfigIn
4673
4565
  mcpToolsEnabled: false,
4674
4566
  mcpToolsConsent: null
4675
4567
  });
4568
+ await syncDeclaredStorageIndexes(db, [bundle.manifest]);
4676
4569
  deleteBundleFromR2(storage, pluginId, oldVersion, "registry").catch(() => {});
4677
4570
  return {
4678
4571
  success: true,
@@ -4798,5 +4691,5 @@ async function handleRegistryUpdateCheck(db, registryConfigInput) {
4798
4691
  }
4799
4692
 
4800
4693
  //#endregion
4801
- export { handleContentDiscardDraft as $, handleSchemaCollectionList as A, handleMediaGet as B, handlePluginGet as C, handleSchemaCollectionCreate as D, handleOrphanedTableRegister as E, handleSchemaFieldList as F, handleRevisionRestore as G, handleMediaUpdate as H, handleSchemaFieldReorder as I, handleContentCompare as J, generateManifest as K, handleSchemaFieldUpdate as L, handleSchemaFieldCreate as M, handleSchemaFieldDelete as N, handleSchemaCollectionDelete as O, handleSchemaFieldGet as P, handleContentDelete as Q, handleMediaCreate as R, handlePluginEnable as S, handleOrphanedTableList as T, handleRevisionGet as U, handleMediaList as V, handleRevisionList as W, handleContentCountTrashed as X, handleContentCountScheduled as Y, handleContentCreate as Z, loadBundleFromR2 as _, handleRegistryUpdateCheck as a, handleContentPermanentDelete as at, handlePluginSettingsUpdate as b, validateAggregatorUrl as c, handleContentSchedule as ct, handleMarketplaceSearch as d, handleContentUnschedule as dt, handleContentDuplicate as et, handleMarketplaceUninstall as f, handleContentUpdate as ft, handleThemeSearch as g, handleThemeGetDetail as h, handleRegistryUpdate as i, handleContentListTrashed as it, handleSchemaCollectionUpdate as j, handleSchemaCollectionGet as k, handleMarketplaceGetPlugin as l, handleContentTranslations as lt, handleMarketplaceUpdateCheck as m, handleRegistryInstall as n, handleContentGetIncludingTrashed as nt, coerceRegistryConfig as o, handleContentPublish as ot, handleMarketplaceUpdate as p, validateRev as pt, handleContentAuthors as q, handleRegistryUninstall as r, handleContentList as rt, normalizeRegistryConfig as s, handleContentRestore as st, assertSafeArtifactUrl as t, handleContentGet as tt, handleMarketplaceInstall as u, handleContentUnpublish as ut, getPluginSettingsSchema as v, handlePluginList as w, handlePluginDisable as x, handlePluginSettingsGet as y, handleMediaDelete as z };
4802
- //# sourceMappingURL=api-DgPbMlng.mjs.map
4694
+ export { handleContentUnschedule as $, handleMediaUpdate as A, handleContentDelete as B, handlePluginEnable as C, handleMediaDelete as D, handleMediaCreate as E, handleContentAuthors as F, handleContentList as G, handleContentDuplicate as H, handleContentCompare as I, handleContentPublish as J, handleContentListTrashed as K, handleContentCountScheduled as L, handleRevisionList as M, handleRevisionRestore as N, handleMediaGet as O, generateManifest as P, handleContentUnpublish as Q, handleContentCountTrashed as R, handlePluginDisable as S, handlePluginList as T, handleContentGet as U, handleContentDiscardDraft as V, handleContentGetIncludingTrashed as W, handleContentSchedule as X, handleContentRestore as Y, handleContentTranslations as Z, loadBundleFromR2 as _, handleRegistryUpdateCheck as a, handlePluginSettingsGet as b, validateAggregatorUrl as c, handleMarketplaceSearch as d, handleContentUpdate as et, handleMarketplaceUninstall as f, handleThemeSearch as g, handleThemeGetDetail as h, handleRegistryUpdate as i, handleRevisionGet as j, handleMediaList as k, handleMarketplaceGetPlugin as l, handleMarketplaceUpdateCheck as m, handleRegistryInstall as n, coerceRegistryConfig as o, handleMarketplaceUpdate as p, handleContentPermanentDelete as q, handleRegistryUninstall as r, normalizeRegistryConfig as s, assertSafeArtifactUrl as t, validateRev as tt, handleMarketplaceInstall as u, syncDeclaredStorageIndexes as v, handlePluginGet as w, handlePluginSettingsUpdate as x, getPluginSettingsSchema as y, handleContentCreate as z };
4695
+ //# sourceMappingURL=api-DdAsirBe.mjs.map