emdash 1.0.0 → 1.0.1-rc.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 (2449) hide show
  1. package/README.md +4 -0
  2. package/dist/action-token-DBki7IT4.mjs +26 -0
  3. package/dist/action-token-DBki7IT4.mjs.map +1 -0
  4. package/dist/activation-DDuqAat2.mjs +387 -0
  5. package/dist/activation-DDuqAat2.mjs.map +1 -0
  6. package/dist/adapters-DcqT_GzQ.d.mts +171 -0
  7. package/dist/adapters-DcqT_GzQ.d.mts.map +1 -0
  8. package/dist/after-PcEvMY_6.mjs +96 -0
  9. package/dist/after-PcEvMY_6.mjs.map +1 -0
  10. package/dist/allowed-origins-CFtudhyw.mjs +116 -0
  11. package/dist/allowed-origins-CFtudhyw.mjs.map +1 -0
  12. package/dist/api/route-utils.d.mts +69 -0
  13. package/dist/api/route-utils.d.mts.map +1 -0
  14. package/dist/api/route-utils.mjs +85 -0
  15. package/dist/api/route-utils.mjs.map +1 -0
  16. package/dist/api/schemas/index.d.mts +2 -0
  17. package/dist/api/schemas/index.mjs +13 -0
  18. package/dist/api-BJFwdTiG.mjs +4974 -0
  19. package/dist/api-BJFwdTiG.mjs.map +1 -0
  20. package/dist/api-tokens-BLz2MtQs.mjs +3 -0
  21. package/dist/api-tokens-P3mAaQgr.mjs +166 -0
  22. package/dist/api-tokens-P3mAaQgr.mjs.map +1 -0
  23. package/dist/apply-BNvvsD51.mjs +1672 -0
  24. package/dist/apply-BNvvsD51.mjs.map +1 -0
  25. package/dist/approvals-quy61IC4.mjs +460 -0
  26. package/dist/approvals-quy61IC4.mjs.map +1 -0
  27. package/dist/artifact-fetch-CWxyELVI.mjs +659 -0
  28. package/dist/artifact-fetch-CWxyELVI.mjs.map +1 -0
  29. package/dist/astro/image-endpoint.d.mts +8 -0
  30. package/dist/astro/image-endpoint.d.mts.map +1 -0
  31. package/dist/astro/image-endpoint.mjs +55 -0
  32. package/dist/astro/image-endpoint.mjs.map +1 -0
  33. package/dist/astro/index.d.mts +39 -7
  34. package/dist/astro/index.d.mts.map +1 -1
  35. package/dist/astro/index.mjs +908 -514
  36. package/dist/astro/index.mjs.map +1 -1
  37. package/dist/astro/middleware/auth.d.mts +15 -7
  38. package/dist/astro/middleware/auth.d.mts.map +1 -1
  39. package/dist/astro/middleware/auth.mjs +146 -211
  40. package/dist/astro/middleware/auth.mjs.map +1 -1
  41. package/dist/astro/middleware/media-usage-write-fence.d.mts +15 -0
  42. package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
  43. package/dist/astro/middleware/media-usage-write-fence.mjs +117 -0
  44. package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
  45. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  46. package/dist/astro/middleware/redirect.mjs +48 -15
  47. package/dist/astro/middleware/redirect.mjs.map +1 -1
  48. package/dist/astro/middleware/request-context.d.mts +5 -1
  49. package/dist/astro/middleware/request-context.d.mts.map +1 -1
  50. package/dist/astro/middleware/request-context.mjs +542 -76
  51. package/dist/astro/middleware/request-context.mjs.map +1 -1
  52. package/dist/astro/middleware/setup.mjs +1 -1
  53. package/dist/astro/middleware.d.mts +66 -4
  54. package/dist/astro/middleware.d.mts.map +1 -1
  55. package/dist/astro/middleware.mjs +817 -1844
  56. package/dist/astro/middleware.mjs.map +1 -1
  57. package/dist/astro/routes/PluginRegistry.d.mts +19 -0
  58. package/dist/astro/routes/PluginRegistry.d.mts.map +1 -0
  59. package/dist/astro/routes/PluginRegistry.mjs +26 -0
  60. package/dist/astro/routes/PluginRegistry.mjs.map +1 -0
  61. package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts +15 -0
  62. package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts.map +1 -0
  63. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +78 -0
  64. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -0
  65. package/dist/astro/routes/api/admin/allowed-domains/index.d.mts +15 -0
  66. package/dist/astro/routes/api/admin/allowed-domains/index.d.mts.map +1 -0
  67. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +78 -0
  68. package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -0
  69. package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts +11 -0
  70. package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts.map +1 -0
  71. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +35 -0
  72. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -0
  73. package/dist/astro/routes/api/admin/api-tokens/index.d.mts +17 -0
  74. package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -0
  75. package/dist/astro/routes/api/admin/api-tokens/index.mjs +54 -0
  76. package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -0
  77. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts +8 -0
  78. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts.map +1 -0
  79. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +25 -0
  80. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -0
  81. package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts +10 -0
  82. package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts.map +1 -0
  83. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +66 -0
  84. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -0
  85. package/dist/astro/routes/api/admin/byline-fields/index.d.mts +9 -0
  86. package/dist/astro/routes/api/admin/byline-fields/index.d.mts.map +1 -0
  87. package/dist/astro/routes/api/admin/byline-fields/index.mjs +54 -0
  88. package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -0
  89. package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts +8 -0
  90. package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts.map +1 -0
  91. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +38 -0
  92. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -0
  93. package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts +10 -0
  94. package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts.map +1 -0
  95. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +92 -0
  96. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -0
  97. package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +9 -0
  98. package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts.map +1 -0
  99. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +84 -0
  100. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -0
  101. package/dist/astro/routes/api/admin/bylines/index.d.mts +9 -0
  102. package/dist/astro/routes/api/admin/bylines/index.d.mts.map +1 -0
  103. package/dist/astro/routes/api/admin/bylines/index.mjs +91 -0
  104. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -0
  105. package/dist/astro/routes/api/admin/comments/_id_/status.d.mts +8 -0
  106. package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -0
  107. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +59 -0
  108. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -0
  109. package/dist/astro/routes/api/admin/comments/_id_.d.mts +15 -0
  110. package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -0
  111. package/dist/astro/routes/api/admin/comments/_id_.mjs +51 -0
  112. package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -0
  113. package/dist/astro/routes/api/admin/comments/bulk.d.mts +8 -0
  114. package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -0
  115. package/dist/astro/routes/api/admin/comments/bulk.mjs +49 -0
  116. package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -0
  117. package/dist/astro/routes/api/admin/comments/counts.d.mts +8 -0
  118. package/dist/astro/routes/api/admin/comments/counts.d.mts.map +1 -0
  119. package/dist/astro/routes/api/admin/comments/counts.mjs +29 -0
  120. package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -0
  121. package/dist/astro/routes/api/admin/comments/index.d.mts +11 -0
  122. package/dist/astro/routes/api/admin/comments/index.d.mts.map +1 -0
  123. package/dist/astro/routes/api/admin/comments/index.mjs +53 -0
  124. package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -0
  125. package/dist/astro/routes/api/admin/core-update.d.mts +8 -0
  126. package/dist/astro/routes/api/admin/core-update.d.mts.map +1 -0
  127. package/dist/astro/routes/api/admin/core-update.mjs +28 -0
  128. package/dist/astro/routes/api/admin/core-update.mjs.map +1 -0
  129. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts +8 -0
  130. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts.map +1 -0
  131. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +50 -0
  132. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -0
  133. package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts +8 -0
  134. package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts.map +1 -0
  135. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +35 -0
  136. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -0
  137. package/dist/astro/routes/api/admin/media-usage/activation.d.mts +9 -0
  138. package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -0
  139. package/dist/astro/routes/api/admin/media-usage/activation.mjs +54 -0
  140. package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -0
  141. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
  142. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
  143. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +45 -0
  144. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
  145. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
  146. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
  147. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +45 -0
  148. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
  149. package/dist/astro/routes/api/admin/media-usage/progress.d.mts +9 -0
  150. package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -0
  151. package/dist/astro/routes/api/admin/media-usage/progress.mjs +56 -0
  152. package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -0
  153. package/dist/astro/routes/api/admin/media-usage/repair.d.mts +8 -0
  154. package/dist/astro/routes/api/admin/media-usage/repair.d.mts.map +1 -0
  155. package/dist/astro/routes/api/admin/media-usage/repair.mjs +53 -0
  156. package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -0
  157. package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
  158. package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
  159. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +46 -0
  160. package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
  161. package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
  162. package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
  163. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +46 -0
  164. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
  165. package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts +19 -0
  166. package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts.map +1 -0
  167. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +71 -0
  168. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -0
  169. package/dist/astro/routes/api/admin/oauth-clients/index.d.mts +15 -0
  170. package/dist/astro/routes/api/admin/oauth-clients/index.d.mts.map +1 -0
  171. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +52 -0
  172. package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -0
  173. package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts +8 -0
  174. package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -0
  175. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +28 -0
  176. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -0
  177. package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts +8 -0
  178. package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -0
  179. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +28 -0
  180. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -0
  181. package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts +8 -0
  182. package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts.map +1 -0
  183. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +105 -0
  184. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -0
  185. package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts +8 -0
  186. package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts.map +1 -0
  187. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +41 -0
  188. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -0
  189. package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts +9 -0
  190. package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts.map +1 -0
  191. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +116 -0
  192. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -0
  193. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts +8 -0
  194. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -0
  195. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +112 -0
  196. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -0
  197. package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts +8 -0
  198. package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -0
  199. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +139 -0
  200. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -0
  201. package/dist/astro/routes/api/admin/plugins/index.d.mts +8 -0
  202. package/dist/astro/routes/api/admin/plugins/index.d.mts.map +1 -0
  203. package/dist/astro/routes/api/admin/plugins/index.mjs +103 -0
  204. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -0
  205. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts +8 -0
  206. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts.map +1 -0
  207. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +44 -0
  208. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -0
  209. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts +8 -0
  210. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts.map +1 -0
  211. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +99 -0
  212. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -0
  213. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts +8 -0
  214. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -0
  215. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +142 -0
  216. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -0
  217. package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts +8 -0
  218. package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts.map +1 -0
  219. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +106 -0
  220. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -0
  221. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts +8 -0
  222. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -0
  223. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +112 -0
  224. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -0
  225. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts +8 -0
  226. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -0
  227. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +160 -0
  228. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -0
  229. package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts +8 -0
  230. package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -0
  231. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +362 -0
  232. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -0
  233. package/dist/astro/routes/api/admin/plugins/registry/install.d.mts +8 -0
  234. package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -0
  235. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +155 -0
  236. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -0
  237. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts +8 -0
  238. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts.map +1 -0
  239. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +221 -0
  240. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -0
  241. package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts +8 -0
  242. package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
  243. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +117 -0
  244. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
  245. package/dist/astro/routes/api/admin/plugins/updates.d.mts +8 -0
  246. package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -0
  247. package/dist/astro/routes/api/admin/plugins/updates.mjs +109 -0
  248. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -0
  249. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts +8 -0
  250. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts.map +1 -0
  251. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +29 -0
  252. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -0
  253. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts +8 -0
  254. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts.map +1 -0
  255. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +99 -0
  256. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -0
  257. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts +8 -0
  258. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts.map +1 -0
  259. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +44 -0
  260. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -0
  261. package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts +8 -0
  262. package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts.map +1 -0
  263. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +115 -0
  264. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -0
  265. package/dist/astro/routes/api/admin/transfer/_...path_.d.mts +12 -0
  266. package/dist/astro/routes/api/admin/transfer/_...path_.d.mts.map +1 -0
  267. package/dist/astro/routes/api/admin/transfer/_...path_.mjs +144 -0
  268. package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -0
  269. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts +8 -0
  270. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts.map +1 -0
  271. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +69 -0
  272. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -0
  273. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts +8 -0
  274. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts.map +1 -0
  275. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +69 -0
  276. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -0
  277. package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts +8 -0
  278. package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts.map +1 -0
  279. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +68 -0
  280. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -0
  281. package/dist/astro/routes/api/admin/transfer/capabilities.d.mts +8 -0
  282. package/dist/astro/routes/api/admin/transfer/capabilities.d.mts.map +1 -0
  283. package/dist/astro/routes/api/admin/transfer/capabilities.mjs +71 -0
  284. package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -0
  285. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts +8 -0
  286. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts.map +1 -0
  287. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +68 -0
  288. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -0
  289. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts +8 -0
  290. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts.map +1 -0
  291. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +71 -0
  292. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -0
  293. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts +8 -0
  294. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts.map +1 -0
  295. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +70 -0
  296. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -0
  297. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts +8 -0
  298. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts.map +1 -0
  299. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +67 -0
  300. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -0
  301. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts +8 -0
  302. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts.map +1 -0
  303. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +70 -0
  304. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -0
  305. package/dist/astro/routes/api/admin/transfer/exports/index.d.mts +9 -0
  306. package/dist/astro/routes/api/admin/transfer/exports/index.d.mts.map +1 -0
  307. package/dist/astro/routes/api/admin/transfer/exports/index.mjs +92 -0
  308. package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -0
  309. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts +8 -0
  310. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts.map +1 -0
  311. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +67 -0
  312. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -0
  313. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts +8 -0
  314. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts.map +1 -0
  315. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +71 -0
  316. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -0
  317. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts +8 -0
  318. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts.map +1 -0
  319. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +79 -0
  320. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -0
  321. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts +8 -0
  322. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts.map +1 -0
  323. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +67 -0
  324. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -0
  325. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts +8 -0
  326. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts.map +1 -0
  327. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +78 -0
  328. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -0
  329. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts +8 -0
  330. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts.map +1 -0
  331. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +78 -0
  332. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -0
  333. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts +8 -0
  334. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts.map +1 -0
  335. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +67 -0
  336. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -0
  337. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts +8 -0
  338. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts.map +1 -0
  339. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +71 -0
  340. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -0
  341. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts +8 -0
  342. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts.map +1 -0
  343. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +68 -0
  344. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -0
  345. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts +8 -0
  346. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts.map +1 -0
  347. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +67 -0
  348. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -0
  349. package/dist/astro/routes/api/admin/transfer/imports/index.d.mts +9 -0
  350. package/dist/astro/routes/api/admin/transfer/imports/index.d.mts.map +1 -0
  351. package/dist/astro/routes/api/admin/transfer/imports/index.mjs +100 -0
  352. package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -0
  353. package/dist/astro/routes/api/admin/users/_id_/disable.d.mts +8 -0
  354. package/dist/astro/routes/api/admin/users/_id_/disable.d.mts.map +1 -0
  355. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +45 -0
  356. package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -0
  357. package/dist/astro/routes/api/admin/users/_id_/enable.d.mts +8 -0
  358. package/dist/astro/routes/api/admin/users/_id_/enable.d.mts.map +1 -0
  359. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +34 -0
  360. package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -0
  361. package/dist/astro/routes/api/admin/users/_id_/index.d.mts +9 -0
  362. package/dist/astro/routes/api/admin/users/_id_/index.d.mts.map +1 -0
  363. package/dist/astro/routes/api/admin/users/_id_/index.mjs +117 -0
  364. package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -0
  365. package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts +8 -0
  366. package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -0
  367. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +56 -0
  368. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -0
  369. package/dist/astro/routes/api/admin/users/index.d.mts +8 -0
  370. package/dist/astro/routes/api/admin/users/index.d.mts.map +1 -0
  371. package/dist/astro/routes/api/admin/users/index.mjs +67 -0
  372. package/dist/astro/routes/api/admin/users/index.mjs.map +1 -0
  373. package/dist/astro/routes/api/auth/dev-bypass.d.mts +9 -0
  374. package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -0
  375. package/dist/astro/routes/api/auth/dev-bypass.mjs +83 -0
  376. package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -0
  377. package/dist/astro/routes/api/auth/invite/accept.d.mts +8 -0
  378. package/dist/astro/routes/api/auth/invite/accept.d.mts.map +1 -0
  379. package/dist/astro/routes/api/auth/invite/accept.mjs +36 -0
  380. package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -0
  381. package/dist/astro/routes/api/auth/invite/complete.d.mts +8 -0
  382. package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -0
  383. package/dist/astro/routes/api/auth/invite/complete.mjs +70 -0
  384. package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -0
  385. package/dist/astro/routes/api/auth/invite/index.d.mts +8 -0
  386. package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -0
  387. package/dist/astro/routes/api/auth/invite/index.mjs +70 -0
  388. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -0
  389. package/dist/astro/routes/api/auth/invite/register-options.d.mts +8 -0
  390. package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -0
  391. package/dist/astro/routes/api/auth/invite/register-options.mjs +57 -0
  392. package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -0
  393. package/dist/astro/routes/api/auth/logout.d.mts +8 -0
  394. package/dist/astro/routes/api/auth/logout.d.mts.map +1 -0
  395. package/dist/astro/routes/api/auth/logout.mjs +29 -0
  396. package/dist/astro/routes/api/auth/logout.mjs.map +1 -0
  397. package/dist/astro/routes/api/auth/magic-link/send.d.mts +8 -0
  398. package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -0
  399. package/dist/astro/routes/api/auth/magic-link/send.mjs +69 -0
  400. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -0
  401. package/dist/astro/routes/api/auth/magic-link/verify.d.mts +9 -0
  402. package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -0
  403. package/dist/astro/routes/api/auth/magic-link/verify.mjs +59 -0
  404. package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -0
  405. package/dist/astro/routes/api/auth/me.d.mts +14 -0
  406. package/dist/astro/routes/api/auth/me.d.mts.map +1 -0
  407. package/dist/astro/routes/api/auth/me.mjs +71 -0
  408. package/dist/astro/routes/api/auth/me.mjs.map +1 -0
  409. package/dist/astro/routes/api/auth/mode.d.mts +8 -0
  410. package/dist/astro/routes/api/auth/mode.d.mts.map +1 -0
  411. package/dist/astro/routes/api/auth/mode.mjs +34 -0
  412. package/dist/astro/routes/api/auth/mode.mjs.map +1 -0
  413. package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts +8 -0
  414. package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -0
  415. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +149 -0
  416. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -0
  417. package/dist/astro/routes/api/auth/oauth/_provider_.d.mts +8 -0
  418. package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -0
  419. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +66 -0
  420. package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -0
  421. package/dist/astro/routes/api/auth/passkey/_id_.d.mts +15 -0
  422. package/dist/astro/routes/api/auth/passkey/_id_.d.mts.map +1 -0
  423. package/dist/astro/routes/api/auth/passkey/_id_.mjs +75 -0
  424. package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -0
  425. package/dist/astro/routes/api/auth/passkey/index.d.mts +8 -0
  426. package/dist/astro/routes/api/auth/passkey/index.d.mts.map +1 -0
  427. package/dist/astro/routes/api/auth/passkey/index.mjs +30 -0
  428. package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -0
  429. package/dist/astro/routes/api/auth/passkey/options.d.mts +8 -0
  430. package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -0
  431. package/dist/astro/routes/api/auth/passkey/options.mjs +50 -0
  432. package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -0
  433. package/dist/astro/routes/api/auth/passkey/register/options.d.mts +8 -0
  434. package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -0
  435. package/dist/astro/routes/api/auth/passkey/register/options.mjs +57 -0
  436. package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -0
  437. package/dist/astro/routes/api/auth/passkey/register/verify.d.mts +8 -0
  438. package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -0
  439. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +72 -0
  440. package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -0
  441. package/dist/astro/routes/api/auth/passkey/verify.d.mts +8 -0
  442. package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -0
  443. package/dist/astro/routes/api/auth/passkey/verify.mjs +63 -0
  444. package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -0
  445. package/dist/astro/routes/api/auth/signup/complete.d.mts +8 -0
  446. package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -0
  447. package/dist/astro/routes/api/auth/signup/complete.mjs +71 -0
  448. package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -0
  449. package/dist/astro/routes/api/auth/signup/request.d.mts +8 -0
  450. package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -0
  451. package/dist/astro/routes/api/auth/signup/request.mjs +57 -0
  452. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -0
  453. package/dist/astro/routes/api/auth/signup/verify.d.mts +8 -0
  454. package/dist/astro/routes/api/auth/signup/verify.d.mts.map +1 -0
  455. package/dist/astro/routes/api/auth/signup/verify.mjs +37 -0
  456. package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -0
  457. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +15 -0
  458. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -0
  459. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +60 -0
  460. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -0
  461. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +9 -0
  462. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -0
  463. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +189 -0
  464. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -0
  465. package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts +8 -0
  466. package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts.map +1 -0
  467. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +22 -0
  468. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -0
  469. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts +8 -0
  470. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -0
  471. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +51 -0
  472. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -0
  473. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts +8 -0
  474. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts.map +1 -0
  475. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +32 -0
  476. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -0
  477. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
  478. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
  479. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +73 -0
  480. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
  481. package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts +8 -0
  482. package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts.map +1 -0
  483. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +25 -0
  484. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -0
  485. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts +8 -0
  486. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts.map +1 -0
  487. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +38 -0
  488. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -0
  489. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts +8 -0
  490. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts.map +1 -0
  491. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +135 -0
  492. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -0
  493. package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts +15 -0
  494. package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -0
  495. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +74 -0
  496. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -0
  497. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts +8 -0
  498. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts.map +1 -0
  499. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +80 -0
  500. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -0
  501. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.d.mts +8 -0
  502. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.d.mts.map +1 -0
  503. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +75 -0
  504. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -0
  505. package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts +8 -0
  506. package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts.map +1 -0
  507. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +30 -0
  508. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -0
  509. package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +8 -0
  510. package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -0
  511. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +24 -0
  512. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -0
  513. package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts +9 -0
  514. package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -0
  515. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +85 -0
  516. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -0
  517. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts +15 -0
  518. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -0
  519. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +133 -0
  520. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -0
  521. package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts +8 -0
  522. package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts.map +1 -0
  523. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +45 -0
  524. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -0
  525. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts +8 -0
  526. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -0
  527. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +58 -0
  528. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -0
  529. package/dist/astro/routes/api/content/_collection_/_id_.d.mts +10 -0
  530. package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -0
  531. package/dist/astro/routes/api/content/_collection_/_id_.mjs +114 -0
  532. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -0
  533. package/dist/astro/routes/api/content/_collection_/authors.d.mts +8 -0
  534. package/dist/astro/routes/api/content/_collection_/authors.d.mts.map +1 -0
  535. package/dist/astro/routes/api/content/_collection_/authors.mjs +21 -0
  536. package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -0
  537. package/dist/astro/routes/api/content/_collection_/index.d.mts +9 -0
  538. package/dist/astro/routes/api/content/_collection_/index.d.mts.map +1 -0
  539. package/dist/astro/routes/api/content/_collection_/index.mjs +77 -0
  540. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -0
  541. package/dist/astro/routes/api/content/_collection_/trash.d.mts +8 -0
  542. package/dist/astro/routes/api/content/_collection_/trash.d.mts.map +1 -0
  543. package/dist/astro/routes/api/content/_collection_/trash.mjs +36 -0
  544. package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -0
  545. package/dist/astro/routes/api/dashboard.d.mts +8 -0
  546. package/dist/astro/routes/api/dashboard.d.mts.map +1 -0
  547. package/dist/astro/routes/api/dashboard.mjs +37 -0
  548. package/dist/astro/routes/api/dashboard.mjs.map +1 -0
  549. package/dist/astro/routes/api/dev/emails.d.mts +9 -0
  550. package/dist/astro/routes/api/dev/emails.d.mts.map +1 -0
  551. package/dist/astro/routes/api/dev/emails.mjs +22 -0
  552. package/dist/astro/routes/api/dev/emails.mjs.map +1 -0
  553. package/dist/astro/routes/api/health.d.mts +8 -0
  554. package/dist/astro/routes/api/health.d.mts.map +1 -0
  555. package/dist/astro/routes/api/health.mjs +23 -0
  556. package/dist/astro/routes/api/health.mjs.map +1 -0
  557. package/dist/astro/routes/api/import/probe.d.mts +18 -0
  558. package/dist/astro/routes/api/import/probe.d.mts.map +1 -0
  559. package/dist/astro/routes/api/import/probe.mjs +56 -0
  560. package/dist/astro/routes/api/import/probe.mjs.map +1 -0
  561. package/dist/astro/routes/api/import/wordpress/analyze.d.mts +88 -0
  562. package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -0
  563. package/dist/astro/routes/api/import/wordpress/analyze.mjs +315 -0
  564. package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -0
  565. package/dist/astro/routes/api/import/wordpress/execute.d.mts +66 -0
  566. package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -0
  567. package/dist/astro/routes/api/import/wordpress/execute.mjs +353 -0
  568. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -0
  569. package/dist/astro/routes/api/import/wordpress/media.d.mts +51 -0
  570. package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -0
  571. package/dist/astro/routes/api/import/wordpress/media.mjs +241 -0
  572. package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -0
  573. package/dist/astro/routes/api/import/wordpress/prepare.d.mts +20 -0
  574. package/dist/astro/routes/api/import/wordpress/prepare.d.mts.map +1 -0
  575. package/dist/astro/routes/api/import/wordpress/prepare.mjs +131 -0
  576. package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -0
  577. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +63 -0
  578. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -0
  579. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +149 -0
  580. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -0
  581. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +37 -0
  582. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -0
  583. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +179 -0
  584. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -0
  585. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +16 -0
  586. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts.map +1 -0
  587. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +92 -0
  588. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -0
  589. package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts +8 -0
  590. package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts.map +1 -0
  591. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +29 -0
  592. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs.map +1 -0
  593. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +60 -0
  594. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -0
  595. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +718 -0
  596. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -0
  597. package/dist/astro/routes/api/manifest.d.mts +8 -0
  598. package/dist/astro/routes/api/manifest.d.mts.map +1 -0
  599. package/dist/astro/routes/api/manifest.mjs +65 -0
  600. package/dist/astro/routes/api/manifest.mjs.map +1 -0
  601. package/dist/astro/routes/api/mcp.d.mts +16 -0
  602. package/dist/astro/routes/api/mcp.d.mts.map +1 -0
  603. package/dist/astro/routes/api/mcp.mjs +2693 -0
  604. package/dist/astro/routes/api/mcp.mjs.map +1 -0
  605. package/dist/astro/routes/api/media/_id_/confirm.d.mts +11 -0
  606. package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -0
  607. package/dist/astro/routes/api/media/_id_/confirm.mjs +178 -0
  608. package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -0
  609. package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
  610. package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
  611. package/dist/astro/routes/api/media/_id_/replace.mjs +99 -0
  612. package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
  613. package/dist/astro/routes/api/media/_id_/upload.d.mts +8 -0
  614. package/dist/astro/routes/api/media/_id_/upload.d.mts.map +1 -0
  615. package/dist/astro/routes/api/media/_id_/upload.mjs +170 -0
  616. package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -0
  617. package/dist/astro/routes/api/media/_id_/usage.d.mts +8 -0
  618. package/dist/astro/routes/api/media/_id_/usage.d.mts.map +1 -0
  619. package/dist/astro/routes/api/media/_id_/usage.mjs +60 -0
  620. package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -0
  621. package/dist/astro/routes/api/media/_id_.d.mts +23 -0
  622. package/dist/astro/routes/api/media/_id_.d.mts.map +1 -0
  623. package/dist/astro/routes/api/media/_id_.mjs +129 -0
  624. package/dist/astro/routes/api/media/_id_.mjs.map +1 -0
  625. package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts +8 -0
  626. package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -0
  627. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +54 -0
  628. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -0
  629. package/dist/astro/routes/api/media/file/_...key_.d.mts +8 -0
  630. package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -0
  631. package/dist/astro/routes/api/media/file/_...key_.mjs +83 -0
  632. package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -0
  633. package/dist/astro/routes/api/media/folders/_id_.d.mts +10 -0
  634. package/dist/astro/routes/api/media/folders/_id_.d.mts.map +1 -0
  635. package/dist/astro/routes/api/media/folders/_id_.mjs +60 -0
  636. package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -0
  637. package/dist/astro/routes/api/media/folders/index.d.mts +9 -0
  638. package/dist/astro/routes/api/media/folders/index.d.mts.map +1 -0
  639. package/dist/astro/routes/api/media/folders/index.mjs +49 -0
  640. package/dist/astro/routes/api/media/folders/index.mjs.map +1 -0
  641. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts +15 -0
  642. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts.map +1 -0
  643. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +54 -0
  644. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -0
  645. package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts +15 -0
  646. package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts.map +1 -0
  647. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +77 -0
  648. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -0
  649. package/dist/astro/routes/api/media/providers/index.d.mts +11 -0
  650. package/dist/astro/routes/api/media/providers/index.d.mts.map +1 -0
  651. package/dist/astro/routes/api/media/providers/index.mjs +23 -0
  652. package/dist/astro/routes/api/media/providers/index.mjs.map +1 -0
  653. package/dist/astro/routes/api/media/upload-url.d.mts +11 -0
  654. package/dist/astro/routes/api/media/upload-url.d.mts.map +1 -0
  655. package/dist/astro/routes/api/media/upload-url.mjs +106 -0
  656. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -0
  657. package/dist/astro/routes/api/media.d.mts +17 -0
  658. package/dist/astro/routes/api/media.d.mts.map +1 -0
  659. package/dist/astro/routes/api/media.mjs +211 -0
  660. package/dist/astro/routes/api/media.mjs.map +1 -0
  661. package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts +9 -0
  662. package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -0
  663. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +68 -0
  664. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -0
  665. package/dist/astro/routes/api/menus/_name_/items.d.mts +8 -0
  666. package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -0
  667. package/dist/astro/routes/api/menus/_name_/items.mjs +48 -0
  668. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -0
  669. package/dist/astro/routes/api/menus/_name_/reorder.d.mts +8 -0
  670. package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -0
  671. package/dist/astro/routes/api/menus/_name_/reorder.mjs +48 -0
  672. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -0
  673. package/dist/astro/routes/api/menus/_name_/translations.d.mts +9 -0
  674. package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -0
  675. package/dist/astro/routes/api/menus/_name_/translations.mjs +79 -0
  676. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -0
  677. package/dist/astro/routes/api/menus/_name_.d.mts +10 -0
  678. package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -0
  679. package/dist/astro/routes/api/menus/_name_.mjs +80 -0
  680. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -0
  681. package/dist/astro/routes/api/menus/index.d.mts +9 -0
  682. package/dist/astro/routes/api/menus/index.d.mts.map +1 -0
  683. package/dist/astro/routes/api/menus/index.mjs +57 -0
  684. package/dist/astro/routes/api/menus/index.mjs.map +1 -0
  685. package/dist/astro/routes/api/oauth/authorize.d.mts +9 -0
  686. package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -0
  687. package/dist/astro/routes/api/oauth/authorize.mjs +276 -0
  688. package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -0
  689. package/dist/astro/routes/api/oauth/device/authorize.d.mts +9 -0
  690. package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -0
  691. package/dist/astro/routes/api/oauth/device/authorize.mjs +48 -0
  692. package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -0
  693. package/dist/astro/routes/api/oauth/device/code.d.mts +8 -0
  694. package/dist/astro/routes/api/oauth/device/code.d.mts.map +1 -0
  695. package/dist/astro/routes/api/oauth/device/code.mjs +38 -0
  696. package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -0
  697. package/dist/astro/routes/api/oauth/device/token.d.mts +8 -0
  698. package/dist/astro/routes/api/oauth/device/token.d.mts.map +1 -0
  699. package/dist/astro/routes/api/oauth/device/token.mjs +49 -0
  700. package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -0
  701. package/dist/astro/routes/api/oauth/register.d.mts +9 -0
  702. package/dist/astro/routes/api/oauth/register.d.mts.map +1 -0
  703. package/dist/astro/routes/api/oauth/register.mjs +123 -0
  704. package/dist/astro/routes/api/oauth/register.mjs.map +1 -0
  705. package/dist/astro/routes/api/oauth/token/refresh.d.mts +8 -0
  706. package/dist/astro/routes/api/oauth/token/refresh.d.mts.map +1 -0
  707. package/dist/astro/routes/api/oauth/token/refresh.mjs +32 -0
  708. package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -0
  709. package/dist/astro/routes/api/oauth/token/revoke.d.mts +8 -0
  710. package/dist/astro/routes/api/oauth/token/revoke.d.mts.map +1 -0
  711. package/dist/astro/routes/api/oauth/token/revoke.mjs +29 -0
  712. package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -0
  713. package/dist/astro/routes/api/oauth/token.d.mts +9 -0
  714. package/dist/astro/routes/api/oauth/token.d.mts.map +1 -0
  715. package/dist/astro/routes/api/oauth/token.mjs +143 -0
  716. package/dist/astro/routes/api/oauth/token.mjs.map +1 -0
  717. package/dist/astro/routes/api/openapi.json.d.mts +8 -0
  718. package/dist/astro/routes/api/openapi.json.d.mts.map +1 -0
  719. package/dist/astro/routes/api/openapi.json.mjs +3676 -0
  720. package/dist/astro/routes/api/openapi.json.mjs.map +1 -0
  721. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts +13 -0
  722. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -0
  723. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +44 -0
  724. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -0
  725. package/dist/astro/routes/api/redirects/404s/index.d.mts +10 -0
  726. package/dist/astro/routes/api/redirects/404s/index.d.mts.map +1 -0
  727. package/dist/astro/routes/api/redirects/404s/index.mjs +76 -0
  728. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -0
  729. package/dist/astro/routes/api/redirects/404s/summary.d.mts +8 -0
  730. package/dist/astro/routes/api/redirects/404s/summary.d.mts.map +1 -0
  731. package/dist/astro/routes/api/redirects/404s/summary.mjs +48 -0
  732. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -0
  733. package/dist/astro/routes/api/redirects/_id_.d.mts +10 -0
  734. package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -0
  735. package/dist/astro/routes/api/redirects/_id_.mjs +80 -0
  736. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -0
  737. package/dist/astro/routes/api/redirects/index.d.mts +9 -0
  738. package/dist/astro/routes/api/redirects/index.d.mts.map +1 -0
  739. package/dist/astro/routes/api/redirects/index.mjs +63 -0
  740. package/dist/astro/routes/api/redirects/index.mjs.map +1 -0
  741. package/dist/astro/routes/api/relations/_id_/index.d.mts +10 -0
  742. package/dist/astro/routes/api/relations/_id_/index.d.mts.map +1 -0
  743. package/dist/astro/routes/api/relations/_id_/index.mjs +94 -0
  744. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -0
  745. package/dist/astro/routes/api/relations/index.d.mts +9 -0
  746. package/dist/astro/routes/api/relations/index.d.mts.map +1 -0
  747. package/dist/astro/routes/api/relations/index.mjs +78 -0
  748. package/dist/astro/routes/api/relations/index.mjs.map +1 -0
  749. package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts +8 -0
  750. package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts.map +1 -0
  751. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +21 -0
  752. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -0
  753. package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts +8 -0
  754. package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts.map +1 -0
  755. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +48 -0
  756. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -0
  757. package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts +9 -0
  758. package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts.map +1 -0
  759. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +109 -0
  760. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -0
  761. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts +8 -0
  762. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts.map +1 -0
  763. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +103 -0
  764. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -0
  765. package/dist/astro/routes/api/schema/block-types/index.d.mts +9 -0
  766. package/dist/astro/routes/api/schema/block-types/index.d.mts.map +1 -0
  767. package/dist/astro/routes/api/schema/block-types/index.mjs +109 -0
  768. package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -0
  769. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts +10 -0
  770. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts.map +1 -0
  771. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +123 -0
  772. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -0
  773. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts +9 -0
  774. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts.map +1 -0
  775. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +111 -0
  776. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -0
  777. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts +8 -0
  778. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts.map +1 -0
  779. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +102 -0
  780. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -0
  781. package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts +10 -0
  782. package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -0
  783. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +127 -0
  784. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -0
  785. package/dist/astro/routes/api/schema/collections/index.d.mts +9 -0
  786. package/dist/astro/routes/api/schema/collections/index.d.mts.map +1 -0
  787. package/dist/astro/routes/api/schema/collections/index.mjs +111 -0
  788. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -0
  789. package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
  790. package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
  791. package/dist/astro/routes/api/schema/collections/reorder.mjs +101 -0
  792. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
  793. package/dist/astro/routes/api/schema/index.d.mts +8 -0
  794. package/dist/astro/routes/api/schema/index.d.mts.map +1 -0
  795. package/dist/astro/routes/api/schema/index.mjs +92 -0
  796. package/dist/astro/routes/api/schema/index.mjs.map +1 -0
  797. package/dist/astro/routes/api/schema/orphans/_slug_.d.mts +8 -0
  798. package/dist/astro/routes/api/schema/orphans/_slug_.d.mts.map +1 -0
  799. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +103 -0
  800. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -0
  801. package/dist/astro/routes/api/schema/orphans/index.d.mts +8 -0
  802. package/dist/astro/routes/api/schema/orphans/index.d.mts.map +1 -0
  803. package/dist/astro/routes/api/schema/orphans/index.mjs +98 -0
  804. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -0
  805. package/dist/astro/routes/api/search/enable.d.mts +17 -0
  806. package/dist/astro/routes/api/search/enable.d.mts.map +1 -0
  807. package/dist/astro/routes/api/search/enable.mjs +71 -0
  808. package/dist/astro/routes/api/search/enable.mjs.map +1 -0
  809. package/dist/astro/routes/api/search/index.d.mts +17 -0
  810. package/dist/astro/routes/api/search/index.d.mts.map +1 -0
  811. package/dist/astro/routes/api/search/index.mjs +66 -0
  812. package/dist/astro/routes/api/search/index.mjs.map +1 -0
  813. package/dist/astro/routes/api/search/rebuild.d.mts +14 -0
  814. package/dist/astro/routes/api/search/rebuild.d.mts.map +1 -0
  815. package/dist/astro/routes/api/search/rebuild.mjs +60 -0
  816. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -0
  817. package/dist/astro/routes/api/search/stats.d.mts +11 -0
  818. package/dist/astro/routes/api/search/stats.d.mts.map +1 -0
  819. package/dist/astro/routes/api/search/stats.mjs +33 -0
  820. package/dist/astro/routes/api/search/stats.mjs.map +1 -0
  821. package/dist/astro/routes/api/search/suggest.d.mts +16 -0
  822. package/dist/astro/routes/api/search/suggest.d.mts.map +1 -0
  823. package/dist/astro/routes/api/search/suggest.mjs +55 -0
  824. package/dist/astro/routes/api/search/suggest.mjs.map +1 -0
  825. package/dist/astro/routes/api/sections/_slug_.d.mts +10 -0
  826. package/dist/astro/routes/api/sections/_slug_.d.mts.map +1 -0
  827. package/dist/astro/routes/api/sections/_slug_.mjs +77 -0
  828. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -0
  829. package/dist/astro/routes/api/sections/index.d.mts +9 -0
  830. package/dist/astro/routes/api/sections/index.d.mts.map +1 -0
  831. package/dist/astro/routes/api/sections/index.mjs +60 -0
  832. package/dist/astro/routes/api/sections/index.mjs.map +1 -0
  833. package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts +9 -0
  834. package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts.map +1 -0
  835. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +50 -0
  836. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -0
  837. package/dist/astro/routes/api/settings/backups/archives/index.d.mts +8 -0
  838. package/dist/astro/routes/api/settings/backups/archives/index.d.mts.map +1 -0
  839. package/dist/astro/routes/api/settings/backups/archives/index.mjs +26 -0
  840. package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -0
  841. package/dist/astro/routes/api/settings/backups/export.d.mts +8 -0
  842. package/dist/astro/routes/api/settings/backups/export.d.mts.map +1 -0
  843. package/dist/astro/routes/api/settings/backups/export.mjs +37 -0
  844. package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -0
  845. package/dist/astro/routes/api/settings/backups/index.d.mts +9 -0
  846. package/dist/astro/routes/api/settings/backups/index.d.mts.map +1 -0
  847. package/dist/astro/routes/api/settings/backups/index.mjs +54 -0
  848. package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -0
  849. package/dist/astro/routes/api/settings/email.d.mts +18 -0
  850. package/dist/astro/routes/api/settings/email.d.mts.map +1 -0
  851. package/dist/astro/routes/api/settings/email.mjs +107 -0
  852. package/dist/astro/routes/api/settings/email.mjs.map +1 -0
  853. package/dist/astro/routes/api/settings.d.mts +21 -0
  854. package/dist/astro/routes/api/settings.d.mts.map +1 -0
  855. package/dist/astro/routes/api/settings.mjs +76 -0
  856. package/dist/astro/routes/api/settings.mjs.map +1 -0
  857. package/dist/astro/routes/api/setup/admin-verify.d.mts +8 -0
  858. package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -0
  859. package/dist/astro/routes/api/setup/admin-verify.mjs +83 -0
  860. package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -0
  861. package/dist/astro/routes/api/setup/admin.d.mts +8 -0
  862. package/dist/astro/routes/api/setup/admin.d.mts.map +1 -0
  863. package/dist/astro/routes/api/setup/admin.mjs +83 -0
  864. package/dist/astro/routes/api/setup/admin.mjs.map +1 -0
  865. package/dist/astro/routes/api/setup/dev-bypass.d.mts +9 -0
  866. package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -0
  867. package/dist/astro/routes/api/setup/dev-bypass.mjs +172 -0
  868. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -0
  869. package/dist/astro/routes/api/setup/dev-reset.d.mts +8 -0
  870. package/dist/astro/routes/api/setup/dev-reset.d.mts.map +1 -0
  871. package/dist/astro/routes/api/setup/dev-reset.mjs +27 -0
  872. package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -0
  873. package/dist/astro/routes/api/setup/index.d.mts +8 -0
  874. package/dist/astro/routes/api/setup/index.d.mts.map +1 -0
  875. package/dist/astro/routes/api/setup/index.mjs +147 -0
  876. package/dist/astro/routes/api/setup/index.mjs.map +1 -0
  877. package/dist/astro/routes/api/setup/status.d.mts +8 -0
  878. package/dist/astro/routes/api/setup/status.d.mts.map +1 -0
  879. package/dist/astro/routes/api/setup/status.mjs +62 -0
  880. package/dist/astro/routes/api/setup/status.mjs.map +1 -0
  881. package/dist/astro/routes/api/snapshot.d.mts +8 -0
  882. package/dist/astro/routes/api/snapshot.d.mts.map +1 -0
  883. package/dist/astro/routes/api/snapshot.mjs +68 -0
  884. package/dist/astro/routes/api/snapshot.mjs.map +1 -0
  885. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
  886. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
  887. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +57 -0
  888. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
  889. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts +9 -0
  890. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -0
  891. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +92 -0
  892. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -0
  893. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts +19 -0
  894. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -0
  895. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +103 -0
  896. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -0
  897. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts +15 -0
  898. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -0
  899. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +83 -0
  900. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -0
  901. package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
  902. package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
  903. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +55 -0
  904. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
  905. package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
  906. package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
  907. package/dist/astro/routes/api/taxonomies/_name_.mjs +104 -0
  908. package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
  909. package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts +8 -0
  910. package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts.map +1 -0
  911. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +297 -0
  912. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -0
  913. package/dist/astro/routes/api/taxonomies/index.d.mts +15 -0
  914. package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -0
  915. package/dist/astro/routes/api/taxonomies/index.mjs +75 -0
  916. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -0
  917. package/dist/astro/routes/api/themes/preview.d.mts +8 -0
  918. package/dist/astro/routes/api/themes/preview.d.mts.map +1 -0
  919. package/dist/astro/routes/api/themes/preview.mjs +52 -0
  920. package/dist/astro/routes/api/themes/preview.mjs.map +1 -0
  921. package/dist/astro/routes/api/typegen.d.mts +18 -0
  922. package/dist/astro/routes/api/typegen.d.mts.map +1 -0
  923. package/dist/astro/routes/api/typegen.mjs +50 -0
  924. package/dist/astro/routes/api/typegen.mjs.map +1 -0
  925. package/dist/astro/routes/api/visual-editing/action-token.d.mts +8 -0
  926. package/dist/astro/routes/api/visual-editing/action-token.d.mts.map +1 -0
  927. package/dist/astro/routes/api/visual-editing/action-token.mjs +27 -0
  928. package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -0
  929. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts +8 -0
  930. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts.map +1 -0
  931. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +44 -0
  932. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -0
  933. package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts +8 -0
  934. package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts.map +1 -0
  935. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +22 -0
  936. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -0
  937. package/dist/astro/routes/api/well-known/auth.d.mts +8 -0
  938. package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -0
  939. package/dist/astro/routes/api/well-known/auth.mjs +42 -0
  940. package/dist/astro/routes/api/well-known/auth.mjs.map +1 -0
  941. package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts +8 -0
  942. package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts.map +1 -0
  943. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +33 -0
  944. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs.map +1 -0
  945. package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts +8 -0
  946. package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts.map +1 -0
  947. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +22 -0
  948. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs.map +1 -0
  949. package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts +8 -0
  950. package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -0
  951. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +49 -0
  952. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -0
  953. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts +9 -0
  954. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -0
  955. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +78 -0
  956. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -0
  957. package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts +8 -0
  958. package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -0
  959. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +64 -0
  960. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -0
  961. package/dist/astro/routes/api/widget-areas/_name_.d.mts +9 -0
  962. package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -0
  963. package/dist/astro/routes/api/widget-areas/_name_.mjs +55 -0
  964. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -0
  965. package/dist/astro/routes/api/widget-areas/index.d.mts +9 -0
  966. package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -0
  967. package/dist/astro/routes/api/widget-areas/index.mjs +74 -0
  968. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -0
  969. package/dist/astro/routes/api/widget-components.d.mts +8 -0
  970. package/dist/astro/routes/api/widget-components.d.mts.map +1 -0
  971. package/dist/astro/routes/api/widget-components.mjs +20 -0
  972. package/dist/astro/routes/api/widget-components.mjs.map +1 -0
  973. package/dist/astro/routes/robots.txt.d.mts +8 -0
  974. package/dist/astro/routes/robots.txt.d.mts.map +1 -0
  975. package/dist/astro/routes/robots.txt.mjs +65 -0
  976. package/dist/astro/routes/robots.txt.mjs.map +1 -0
  977. package/dist/astro/routes/sitemap-_collection_.xml.d.mts +8 -0
  978. package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -0
  979. package/dist/astro/routes/sitemap-_collection_.xml.mjs +131 -0
  980. package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -0
  981. package/dist/astro/routes/sitemap.xml.d.mts +8 -0
  982. package/dist/astro/routes/sitemap.xml.d.mts.map +1 -0
  983. package/dist/astro/routes/sitemap.xml.mjs +68 -0
  984. package/dist/astro/routes/sitemap.xml.mjs.map +1 -0
  985. package/dist/astro/types.d.mts +246 -25
  986. package/dist/astro/types.d.mts.map +1 -1
  987. package/dist/audit-BszbE_BP.mjs +127 -0
  988. package/dist/audit-BszbE_BP.mjs.map +1 -0
  989. package/dist/auth/providers/github.d.mts +13 -0
  990. package/dist/auth/providers/github.d.mts.map +1 -0
  991. package/dist/auth/providers/github.mjs +18 -0
  992. package/dist/auth/providers/github.mjs.map +1 -0
  993. package/dist/auth/providers/google.d.mts +13 -0
  994. package/dist/auth/providers/google.d.mts.map +1 -0
  995. package/dist/auth/providers/google.mjs +18 -0
  996. package/dist/auth/providers/google.mjs.map +1 -0
  997. package/dist/authoritative-records-dSvXCfzb.mjs +5172 -0
  998. package/dist/authoritative-records-dSvXCfzb.mjs.map +1 -0
  999. package/dist/authorize-CJtizVbp.mjs +49 -0
  1000. package/dist/authorize-CJtizVbp.mjs.map +1 -0
  1001. package/dist/backup-Cpl8TqRz.mjs +246 -0
  1002. package/dist/backup-Cpl8TqRz.mjs.map +1 -0
  1003. package/dist/base64-DvnNgP7e.mjs +63 -0
  1004. package/dist/base64-DvnNgP7e.mjs.map +1 -0
  1005. package/dist/block-types-DIG_KZwi.mjs +132 -0
  1006. package/dist/block-types-DIG_KZwi.mjs.map +1 -0
  1007. package/dist/block-values-BrTrtA-v.mjs +175 -0
  1008. package/dist/block-values-BrTrtA-v.mjs.map +1 -0
  1009. package/dist/byline-02tu_Uc-.mjs +909 -0
  1010. package/dist/byline-02tu_Uc-.mjs.map +1 -0
  1011. package/dist/byline-fields-DHJs0Mja.mjs +280 -0
  1012. package/dist/byline-fields-DHJs0Mja.mjs.map +1 -0
  1013. package/dist/byline-fields-xdxE9kxZ.mjs +123 -0
  1014. package/dist/byline-fields-xdxE9kxZ.mjs.map +1 -0
  1015. package/dist/byline-registry-dvt4N3xV.mjs +406 -0
  1016. package/dist/byline-registry-dvt4N3xV.mjs.map +1 -0
  1017. package/dist/bylines-CTGTsEAs.mjs +150 -0
  1018. package/dist/bylines-CTGTsEAs.mjs.map +1 -0
  1019. package/dist/bylines-DATJ0B8u.mjs +214 -0
  1020. package/dist/bylines-DATJ0B8u.mjs.map +1 -0
  1021. package/dist/cache-CPanL9IO.mjs +114 -0
  1022. package/dist/cache-CPanL9IO.mjs.map +1 -0
  1023. package/dist/canonical-CAecl1UQ.mjs +174 -0
  1024. package/dist/canonical-CAecl1UQ.mjs.map +1 -0
  1025. package/dist/capture-triggers-CdZfvHtF.mjs +362 -0
  1026. package/dist/capture-triggers-CdZfvHtF.mjs.map +1 -0
  1027. package/dist/challenge-store-CxZxPqaw.mjs +51 -0
  1028. package/dist/challenge-store-CxZxPqaw.mjs.map +1 -0
  1029. package/dist/checksum-DtH6m5uk.mjs +162 -0
  1030. package/dist/checksum-DtH6m5uk.mjs.map +1 -0
  1031. package/dist/chrome-tags-CKELm-bo.mjs +24 -0
  1032. package/dist/chrome-tags-CKELm-bo.mjs.map +1 -0
  1033. package/dist/chunks-DBmkKmBH.mjs +25 -0
  1034. package/dist/chunks-DBmkKmBH.mjs.map +1 -0
  1035. package/dist/cli/index.mjs +3021 -1548
  1036. package/dist/cli/index.mjs.map +1 -1
  1037. package/dist/client/cf-access.d.mts +1 -1
  1038. package/dist/client/index.d.mts +1296 -11
  1039. package/dist/client/index.d.mts.map +1 -1
  1040. package/dist/client/index.mjs +313 -27
  1041. package/dist/client/index.mjs.map +1 -1
  1042. package/dist/collection-deletion-JecE26cS.mjs +436 -0
  1043. package/dist/collection-deletion-JecE26cS.mjs.map +1 -0
  1044. package/dist/collection-deletion-processor-DgCfF3a1.mjs +217 -0
  1045. package/dist/collection-deletion-processor-DgCfF3a1.mjs.map +1 -0
  1046. package/dist/collection-slugs-cache-BNRAPNiu.mjs +85 -0
  1047. package/dist/collection-slugs-cache-BNRAPNiu.mjs.map +1 -0
  1048. package/dist/comment-Cq1UYN8_.mjs +313 -0
  1049. package/dist/comment-Cq1UYN8_.mjs.map +1 -0
  1050. package/dist/comment-reaction-DPeGAfjd.mjs +85 -0
  1051. package/dist/comment-reaction-DPeGAfjd.mjs.map +1 -0
  1052. package/dist/comments-BRtp992B.mjs +99 -0
  1053. package/dist/comments-BRtp992B.mjs.map +1 -0
  1054. package/dist/comments-Bi2j9IoX.mjs +195 -0
  1055. package/dist/comments-Bi2j9IoX.mjs.map +1 -0
  1056. package/dist/components-CQY-Sgm-.mjs +108 -0
  1057. package/dist/components-CQY-Sgm-.mjs.map +1 -0
  1058. package/dist/config-B-uePMLj.d.mts +39 -0
  1059. package/dist/config-B-uePMLj.d.mts.map +1 -0
  1060. package/dist/config-BVX7iYr4.d.mts +6679 -0
  1061. package/dist/config-BVX7iYr4.d.mts.map +1 -0
  1062. package/dist/config-CXPcy2iY.mjs +228 -0
  1063. package/dist/config-CXPcy2iY.mjs.map +1 -0
  1064. package/dist/config-CvmjJcVw.mjs +73 -0
  1065. package/dist/config-CvmjJcVw.mjs.map +1 -0
  1066. package/dist/connection-B9pIasFd.mjs +36 -0
  1067. package/dist/connection-B9pIasFd.mjs.map +1 -0
  1068. package/dist/content-RzEXY3QX.mjs +2020 -0
  1069. package/dist/content-RzEXY3QX.mjs.map +1 -0
  1070. package/dist/content-list-query-DiNwyKtd.d.mts +26 -0
  1071. package/dist/content-list-query-DiNwyKtd.d.mts.map +1 -0
  1072. package/dist/content-policy-Dm32n9C6.mjs +46 -0
  1073. package/dist/content-policy-Dm32n9C6.mjs.map +1 -0
  1074. package/dist/content-repair-B-k5JrVN.mjs +442 -0
  1075. package/dist/content-repair-B-k5JrVN.mjs.map +1 -0
  1076. package/dist/context-CTkYVMZV.mjs +2026 -0
  1077. package/dist/context-CTkYVMZV.mjs.map +1 -0
  1078. package/dist/credits-CAFPFhuk.mjs +110 -0
  1079. package/dist/credits-CAFPFhuk.mjs.map +1 -0
  1080. package/dist/cron-xe5XKqA-.mjs +306 -0
  1081. package/dist/cron-xe5XKqA-.mjs.map +1 -0
  1082. package/dist/dashboard-BoV4pwPP.mjs +151 -0
  1083. package/dist/dashboard-BoV4pwPP.mjs.map +1 -0
  1084. package/dist/database/instrumentation.d.mts +35 -5
  1085. package/dist/database/instrumentation.d.mts.map +1 -1
  1086. package/dist/database/instrumentation.mjs +40 -9
  1087. package/dist/database/instrumentation.mjs.map +1 -1
  1088. package/dist/database/migration-lock.d.mts +37 -0
  1089. package/dist/database/migration-lock.d.mts.map +1 -0
  1090. package/dist/database/migration-lock.mjs +76 -0
  1091. package/dist/database/migration-lock.mjs.map +1 -0
  1092. package/dist/database/pg-migration-lock.d.mts +21 -0
  1093. package/dist/database/pg-migration-lock.d.mts.map +1 -0
  1094. package/dist/database/pg-migration-lock.mjs +42 -0
  1095. package/dist/database/pg-migration-lock.mjs.map +1 -0
  1096. package/dist/datetime-normalization-PeiEdcRY.mjs +187 -0
  1097. package/dist/datetime-normalization-PeiEdcRY.mjs.map +1 -0
  1098. package/dist/db/index.d.mts +4 -4
  1099. package/dist/db/index.mjs +35 -10
  1100. package/dist/db/index.mjs.map +1 -1
  1101. package/dist/db/libsql-migrations.d.mts +11 -0
  1102. package/dist/db/libsql-migrations.d.mts.map +1 -0
  1103. package/dist/db/libsql-migrations.mjs +58 -0
  1104. package/dist/db/libsql-migrations.mjs.map +1 -0
  1105. package/dist/db/libsql.d.mts +1 -1
  1106. package/dist/db/libsql.d.mts.map +1 -1
  1107. package/dist/db/libsql.mjs +7 -2
  1108. package/dist/db/libsql.mjs.map +1 -1
  1109. package/dist/db/postgres-migrations.d.mts +10 -0
  1110. package/dist/db/postgres-migrations.d.mts.map +1 -0
  1111. package/dist/db/postgres-migrations.mjs +48 -0
  1112. package/dist/db/postgres-migrations.mjs.map +1 -0
  1113. package/dist/db/postgres.d.mts +1 -1
  1114. package/dist/db/postgres.d.mts.map +1 -1
  1115. package/dist/db/postgres.mjs +20 -10
  1116. package/dist/db/postgres.mjs.map +1 -1
  1117. package/dist/db/sqlite-migrations.d.mts +10 -0
  1118. package/dist/db/sqlite-migrations.d.mts.map +1 -0
  1119. package/dist/db/sqlite-migrations.mjs +29 -0
  1120. package/dist/db/sqlite-migrations.mjs.map +1 -0
  1121. package/dist/db/sqlite.d.mts +1 -1
  1122. package/dist/db/sqlite.d.mts.map +1 -1
  1123. package/dist/db/sqlite.mjs +9 -4
  1124. package/dist/db/sqlite.mjs.map +1 -1
  1125. package/dist/db-errors-CBD5yMro.mjs +55 -0
  1126. package/dist/db-errors-CBD5yMro.mjs.map +1 -0
  1127. package/dist/default-DaoYyFRS.mjs +81 -0
  1128. package/dist/default-DaoYyFRS.mjs.map +1 -0
  1129. package/dist/deferred-tasks-BYcDx2o_.d.mts +9 -0
  1130. package/dist/deferred-tasks-BYcDx2o_.d.mts.map +1 -0
  1131. package/dist/destination-r2zIAZ2S.mjs +18 -0
  1132. package/dist/destination-r2zIAZ2S.mjs.map +1 -0
  1133. package/dist/dev-typegen-8JlYYFno.mjs +29 -0
  1134. package/dist/dev-typegen-8JlYYFno.mjs.map +1 -0
  1135. package/dist/device-flow-Ma5P5d2e.mjs +521 -0
  1136. package/dist/device-flow-Ma5P5d2e.mjs.map +1 -0
  1137. package/dist/dialect-helpers-7_IqPdh9.mjs +307 -0
  1138. package/dist/dialect-helpers-7_IqPdh9.mjs.map +1 -0
  1139. package/dist/digest-DiYAoZpf.mjs +194 -0
  1140. package/dist/digest-DiYAoZpf.mjs.map +1 -0
  1141. package/dist/direct-executor-FCIRepAU.mjs +104 -0
  1142. package/dist/direct-executor-FCIRepAU.mjs.map +1 -0
  1143. package/dist/dist-Cfu8mMBs.mjs +810 -0
  1144. package/dist/dist-Cfu8mMBs.mjs.map +1 -0
  1145. package/dist/email-console-DmqVF5J_.mjs +50 -0
  1146. package/dist/email-console-DmqVF5J_.mjs.map +1 -0
  1147. package/dist/email-locale-Cc5YSXfJ.mjs +25 -0
  1148. package/dist/email-locale-Cc5YSXfJ.mjs.map +1 -0
  1149. package/dist/emdash-runtime-YPrVnr6x.mjs +4226 -0
  1150. package/dist/emdash-runtime-YPrVnr6x.mjs.map +1 -0
  1151. package/dist/enrich-BDdVNeDK.mjs +194 -0
  1152. package/dist/enrich-BDdVNeDK.mjs.map +1 -0
  1153. package/dist/entry-lock-BtDo1zFm.d.mts +4544 -0
  1154. package/dist/entry-lock-BtDo1zFm.d.mts.map +1 -0
  1155. package/dist/entry-lock-PP1JCXBB.mjs +1180 -0
  1156. package/dist/entry-lock-PP1JCXBB.mjs.map +1 -0
  1157. package/dist/entry-lock-WyppUeRW.mjs +163 -0
  1158. package/dist/entry-lock-WyppUeRW.mjs.map +1 -0
  1159. package/dist/entry-locks-DJAqVweV.mjs +167 -0
  1160. package/dist/entry-locks-DJAqVweV.mjs.map +1 -0
  1161. package/dist/env-types-BaTCgn-y.mjs +38 -0
  1162. package/dist/env-types-BaTCgn-y.mjs.map +1 -0
  1163. package/dist/error-CEdm_AWU.mjs +90 -0
  1164. package/dist/error-CEdm_AWU.mjs.map +1 -0
  1165. package/dist/errors-9P_FDrJ_.mjs +17 -0
  1166. package/dist/errors-9P_FDrJ_.mjs.map +1 -0
  1167. package/dist/errors-CNvATh_7.mjs +469 -0
  1168. package/dist/errors-CNvATh_7.mjs.map +1 -0
  1169. package/dist/errors-CjXd1LgH.mjs +120 -0
  1170. package/dist/errors-CjXd1LgH.mjs.map +1 -0
  1171. package/dist/escape-nJW7dR0s.mjs +9 -0
  1172. package/dist/escape-nJW7dR0s.mjs.map +1 -0
  1173. package/dist/fence-BrnQffdY.mjs +162 -0
  1174. package/dist/fence-BrnQffdY.mjs.map +1 -0
  1175. package/dist/field-defs-cache-DEkFYCDE.mjs +77 -0
  1176. package/dist/field-defs-cache-DEkFYCDE.mjs.map +1 -0
  1177. package/dist/field-map-BfYMstlG.mjs +83 -0
  1178. package/dist/field-map-BfYMstlG.mjs.map +1 -0
  1179. package/dist/focal-point-JX8kcOTQ.mjs +23 -0
  1180. package/dist/focal-point-JX8kcOTQ.mjs.map +1 -0
  1181. package/dist/fts-manager-DU03MxWu.mjs +443 -0
  1182. package/dist/fts-manager-DU03MxWu.mjs.map +1 -0
  1183. package/dist/gc-BO9NqlAe.mjs +75 -0
  1184. package/dist/gc-BO9NqlAe.mjs.map +1 -0
  1185. package/dist/hash-CY4QdeMJ.mjs +37 -0
  1186. package/dist/hash-CY4QdeMJ.mjs.map +1 -0
  1187. package/dist/hook-result-DSRRxu_-.d.mts +31 -0
  1188. package/dist/hook-result-DSRRxu_-.d.mts.map +1 -0
  1189. package/dist/hreflang--av8HanY.d.mts +50 -0
  1190. package/dist/hreflang--av8HanY.d.mts.map +1 -0
  1191. package/dist/hreflang-CNbZjm4g.mjs +105 -0
  1192. package/dist/hreflang-CNbZjm4g.mjs.map +1 -0
  1193. package/dist/http-route-dispatch-16nzAM5m.mjs +339 -0
  1194. package/dist/http-route-dispatch-16nzAM5m.mjs.map +1 -0
  1195. package/dist/identity-DNaOsiip.mjs +35 -0
  1196. package/dist/identity-DNaOsiip.mjs.map +1 -0
  1197. package/dist/import-DUV3Gl6-.mjs +2020 -0
  1198. package/dist/import-DUV3Gl6-.mjs.map +1 -0
  1199. package/dist/index-m-lYQRqs.d.mts +623 -0
  1200. package/dist/index-m-lYQRqs.d.mts.map +1 -0
  1201. package/dist/index.d.mts +27 -11
  1202. package/dist/index.mjs +120 -28
  1203. package/dist/init-lock-4eRRB4Le.mjs +56 -0
  1204. package/dist/init-lock-4eRRB4Le.mjs.map +1 -0
  1205. package/dist/install-finalization-CPM7Gged.mjs +58 -0
  1206. package/dist/install-finalization-CPM7Gged.mjs.map +1 -0
  1207. package/dist/keys-B8g41vwJ.mjs +61 -0
  1208. package/dist/keys-B8g41vwJ.mjs.map +1 -0
  1209. package/dist/kinds-BKu9nb7q.mjs +974 -0
  1210. package/dist/kinds-BKu9nb7q.mjs.map +1 -0
  1211. package/dist/lifecycle-CpebZNAA.mjs +25 -0
  1212. package/dist/lifecycle-CpebZNAA.mjs.map +1 -0
  1213. package/dist/load-dHcR5yh9.mjs +28 -0
  1214. package/dist/load-dHcR5yh9.mjs.map +1 -0
  1215. package/dist/loader-CWb-ja1p.mjs +1197 -0
  1216. package/dist/loader-CWb-ja1p.mjs.map +1 -0
  1217. package/dist/loops-Dn1i16FP.mjs +205 -0
  1218. package/dist/loops-Dn1i16FP.mjs.map +1 -0
  1219. package/dist/manifest-builder-0ZHXBxOL.mjs +189 -0
  1220. package/dist/manifest-builder-0ZHXBxOL.mjs.map +1 -0
  1221. package/dist/manifest-schema-gy37bD_D.mjs +496 -0
  1222. package/dist/manifest-schema-gy37bD_D.mjs.map +1 -0
  1223. package/dist/marketplace-tHWSsCUo.mjs +257 -0
  1224. package/dist/marketplace-tHWSsCUo.mjs.map +1 -0
  1225. package/dist/media/image-endpoint.d.mts +104 -0
  1226. package/dist/media/image-endpoint.d.mts.map +1 -0
  1227. package/dist/media/image-endpoint.mjs +190 -0
  1228. package/dist/media/image-endpoint.mjs.map +1 -0
  1229. package/dist/media/index.d.mts +45 -2
  1230. package/dist/media/index.d.mts.map +1 -1
  1231. package/dist/media/index.mjs +17 -3
  1232. package/dist/media/index.mjs.map +1 -1
  1233. package/dist/media/local-runtime.d.mts +24 -7
  1234. package/dist/media/local-runtime.d.mts.map +1 -1
  1235. package/dist/media/local-runtime.mjs +41 -12
  1236. package/dist/media/local-runtime.mjs.map +1 -1
  1237. package/dist/media-3v7mqAVX.mjs +294 -0
  1238. package/dist/media-3v7mqAVX.mjs.map +1 -0
  1239. package/dist/media-CputjGE1.mjs +373 -0
  1240. package/dist/media-CputjGE1.mjs.map +1 -0
  1241. package/dist/media-D1z_jisb.mjs +408 -0
  1242. package/dist/media-D1z_jisb.mjs.map +1 -0
  1243. package/dist/media-allowlist-D5a4d-RA.mjs +44 -0
  1244. package/dist/media-allowlist-D5a4d-RA.mjs.map +1 -0
  1245. package/dist/media-folders-D2VdVBf6.mjs +210 -0
  1246. package/dist/media-folders-D2VdVBf6.mjs.map +1 -0
  1247. package/dist/media-url-DloW2xrP.mjs +43 -0
  1248. package/dist/media-url-DloW2xrP.mjs.map +1 -0
  1249. package/dist/media-usage-B8q0owWQ.mjs +1629 -0
  1250. package/dist/media-usage-B8q0owWQ.mjs.map +1 -0
  1251. package/dist/media-usage-activation-CQWOOTJi.mjs +78 -0
  1252. package/dist/media-usage-activation-CQWOOTJi.mjs.map +1 -0
  1253. package/dist/media-usage-work-BC0qpkMD.mjs +152 -0
  1254. package/dist/media-usage-work-BC0qpkMD.mjs.map +1 -0
  1255. package/dist/media-usage-work-BlMjwPg8.mjs +586 -0
  1256. package/dist/media-usage-work-BlMjwPg8.mjs.map +1 -0
  1257. package/dist/menus-BQKqf0Up.mjs +92 -0
  1258. package/dist/menus-BQKqf0Up.mjs.map +1 -0
  1259. package/dist/menus-XQdKk-87.mjs +3647 -0
  1260. package/dist/menus-XQdKk-87.mjs.map +1 -0
  1261. package/dist/menus-trvc6_fW.mjs +753 -0
  1262. package/dist/menus-trvc6_fW.mjs.map +1 -0
  1263. package/dist/migrations/index.d.mts +22 -0
  1264. package/dist/migrations/index.d.mts.map +1 -0
  1265. package/dist/migrations/index.mjs +8 -0
  1266. package/dist/mime-IZf-LHIS.mjs +36 -0
  1267. package/dist/mime-IZf-LHIS.mjs.map +1 -0
  1268. package/dist/mode-nh0ppSX5.mjs +23 -0
  1269. package/dist/mode-nh0ppSX5.mjs.map +1 -0
  1270. package/dist/node-sqlite-compat-CDOEcc97.mjs +63 -0
  1271. package/dist/node-sqlite-compat-CDOEcc97.mjs.map +1 -0
  1272. package/dist/normalize-BuWa0lvd.mjs +191 -0
  1273. package/dist/normalize-BuWa0lvd.mjs.map +1 -0
  1274. package/dist/oauth-authorization-BtYQ80uU.mjs +274 -0
  1275. package/dist/oauth-authorization-BtYQ80uU.mjs.map +1 -0
  1276. package/dist/oauth-clients-C1S4NQHh.mjs +266 -0
  1277. package/dist/oauth-clients-C1S4NQHh.mjs.map +1 -0
  1278. package/dist/oauth-state-store-CpGi2FZH.mjs +50 -0
  1279. package/dist/oauth-state-store-CpGi2FZH.mjs.map +1 -0
  1280. package/dist/oauth-user-lookup-BNp1aFAr.mjs +26 -0
  1281. package/dist/oauth-user-lookup-BNp1aFAr.mjs.map +1 -0
  1282. package/dist/object-cache/memory.d.mts +15 -0
  1283. package/dist/object-cache/memory.d.mts.map +1 -0
  1284. package/dist/object-cache/memory.mjs +56 -0
  1285. package/dist/object-cache/memory.mjs.map +1 -0
  1286. package/dist/object-cache-Bo6DGaC9.mjs +586 -0
  1287. package/dist/object-cache-Bo6DGaC9.mjs.map +1 -0
  1288. package/dist/options-DhrI7eMv.mjs +208 -0
  1289. package/dist/options-DhrI7eMv.mjs.map +1 -0
  1290. package/dist/options-Dl_W57-_.d.mts +81 -0
  1291. package/dist/options-Dl_W57-_.d.mts.map +1 -0
  1292. package/dist/ownership-DoeAIuTg.mjs +12 -0
  1293. package/dist/ownership-DoeAIuTg.mjs.map +1 -0
  1294. package/dist/page/index.d.mts +19 -5
  1295. package/dist/page/index.d.mts.map +1 -1
  1296. package/dist/page/index.mjs +32 -7
  1297. package/dist/page/index.mjs.map +1 -1
  1298. package/dist/parse-Gt2l4Sld.mjs +81 -0
  1299. package/dist/parse-Gt2l4Sld.mjs.map +1 -0
  1300. package/dist/parse-QVS0t5oR.d.mts +172 -0
  1301. package/dist/parse-QVS0t5oR.d.mts.map +1 -0
  1302. package/dist/passkey-config-C-MxsV22.mjs +46 -0
  1303. package/dist/passkey-config-C-MxsV22.mjs.map +1 -0
  1304. package/dist/paths-CqFwkjY8.mjs +77 -0
  1305. package/dist/paths-CqFwkjY8.mjs.map +1 -0
  1306. package/dist/patterns-DyZJ67I7.mjs +140 -0
  1307. package/dist/patterns-DyZJ67I7.mjs.map +1 -0
  1308. package/dist/placeholder-Dn7MMdWr.d.mts +306 -0
  1309. package/dist/placeholder-Dn7MMdWr.d.mts.map +1 -0
  1310. package/dist/plan-D8s1n84S.mjs +135 -0
  1311. package/dist/plan-D8s1n84S.mjs.map +1 -0
  1312. package/dist/plugin-test-runtime.d.mts +120 -0
  1313. package/dist/plugin-test-runtime.d.mts.map +1 -0
  1314. package/dist/plugin-test-runtime.mjs +126 -0
  1315. package/dist/plugin-types.d.mts +196 -0
  1316. package/dist/plugin-types.d.mts.map +1 -0
  1317. package/dist/plugin-types.mjs +18 -0
  1318. package/dist/plugin-types.mjs.map +1 -0
  1319. package/dist/plugin-utils.d.mts +36 -16
  1320. package/dist/plugin-utils.d.mts.map +1 -1
  1321. package/dist/plugin-utils.mjs +19 -16
  1322. package/dist/plugin-utils.mjs.map +1 -1
  1323. package/dist/plugins/adapt-sandbox-entry.d.mts +23 -12
  1324. package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
  1325. package/dist/plugins/adapt-sandbox-entry.mjs +124 -28
  1326. package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
  1327. package/dist/plugins/host.d.mts +7 -0
  1328. package/dist/plugins/host.mjs +59 -0
  1329. package/dist/plugins/http-wire.d.mts +25 -0
  1330. package/dist/plugins/http-wire.d.mts.map +1 -0
  1331. package/dist/plugins/http-wire.mjs +148 -0
  1332. package/dist/plugins/http-wire.mjs.map +1 -0
  1333. package/dist/plugins/secret-redactor.d.mts +9 -0
  1334. package/dist/plugins/secret-redactor.d.mts.map +1 -0
  1335. package/dist/plugins/secret-redactor.mjs +51 -0
  1336. package/dist/plugins/secret-redactor.mjs.map +1 -0
  1337. package/dist/plugins-BpLkXA1S.mjs +277 -0
  1338. package/dist/plugins-BpLkXA1S.mjs.map +1 -0
  1339. package/dist/policy-C1qpNxrr.mjs +45 -0
  1340. package/dist/policy-C1qpNxrr.mjs.map +1 -0
  1341. package/dist/portable-text-BnRuiR1-.mjs +307 -0
  1342. package/dist/portable-text-BnRuiR1-.mjs.map +1 -0
  1343. package/dist/preview-DU5rwz_m.mjs +107 -0
  1344. package/dist/preview-DU5rwz_m.mjs.map +1 -0
  1345. package/dist/protocol-cEfbPvM6.d.mts +61 -0
  1346. package/dist/protocol-cEfbPvM6.d.mts.map +1 -0
  1347. package/dist/public-submission-x1eaT6Tx.mjs +250 -0
  1348. package/dist/public-submission-x1eaT6Tx.mjs.map +1 -0
  1349. package/dist/public-url-B5a0QAh6.mjs +101 -0
  1350. package/dist/public-url-B5a0QAh6.mjs.map +1 -0
  1351. package/dist/query-DSEkrw_m.mjs +41 -0
  1352. package/dist/query-DSEkrw_m.mjs.map +1 -0
  1353. package/dist/query-dHwqNf85.mjs +1161 -0
  1354. package/dist/query-dHwqNf85.mjs.map +1 -0
  1355. package/dist/rate-limit-BXx3Ecp9.mjs +120 -0
  1356. package/dist/rate-limit-BXx3Ecp9.mjs.map +1 -0
  1357. package/dist/receipt-RG5_pwsj.mjs +43 -0
  1358. package/dist/receipt-RG5_pwsj.mjs.map +1 -0
  1359. package/dist/redirect-BRoLiWQE.mjs +19 -0
  1360. package/dist/redirect-BRoLiWQE.mjs.map +1 -0
  1361. package/dist/redirect-BvFKh8Sz.mjs +416 -0
  1362. package/dist/redirect-BvFKh8Sz.mjs.map +1 -0
  1363. package/dist/redirects-CWQMKYOS.mjs +446 -0
  1364. package/dist/redirects-CWQMKYOS.mjs.map +1 -0
  1365. package/dist/redirects-D4EWeXAo.mjs +148 -0
  1366. package/dist/redirects-D4EWeXAo.mjs.map +1 -0
  1367. package/dist/registry/testing.d.mts +26 -0
  1368. package/dist/registry/testing.d.mts.map +1 -0
  1369. package/dist/registry/testing.mjs +265 -0
  1370. package/dist/registry/testing.mjs.map +1 -0
  1371. package/dist/registry-CtHRqVe-.mjs +6771 -0
  1372. package/dist/registry-CtHRqVe-.mjs.map +1 -0
  1373. package/dist/relations-CVI2nbrn.mjs +776 -0
  1374. package/dist/relations-CVI2nbrn.mjs.map +1 -0
  1375. package/dist/request-cache-C4CIo5ad.mjs +104 -0
  1376. package/dist/request-cache-C4CIo5ad.mjs.map +1 -0
  1377. package/dist/request-context.d.mts +45 -1
  1378. package/dist/request-context.d.mts.map +1 -1
  1379. package/dist/request-context.mjs +17 -3
  1380. package/dist/request-context.mjs.map +1 -1
  1381. package/dist/request-meta-B6blULFY.mjs +141 -0
  1382. package/dist/request-meta-B6blULFY.mjs.map +1 -0
  1383. package/dist/resolve-Cw4rWFJl.mjs +100 -0
  1384. package/dist/resolve-Cw4rWFJl.mjs.map +1 -0
  1385. package/dist/resolve-D-kqyKns.mjs +199 -0
  1386. package/dist/resolve-D-kqyKns.mjs.map +1 -0
  1387. package/dist/revision-CGkQA0e5.mjs +366 -0
  1388. package/dist/revision-CGkQA0e5.mjs.map +1 -0
  1389. package/dist/route-wire-DK600v4u.mjs +197 -0
  1390. package/dist/route-wire-DK600v4u.mjs.map +1 -0
  1391. package/dist/routes-D0u5zK2P.mjs +272 -0
  1392. package/dist/routes-D0u5zK2P.mjs.map +1 -0
  1393. package/dist/runner-CC8LZx97.d.mts +68 -0
  1394. package/dist/runner-CC8LZx97.d.mts.map +1 -0
  1395. package/dist/runner-CLpxmhl8.mjs +6197 -0
  1396. package/dist/runner-CLpxmhl8.mjs.map +1 -0
  1397. package/dist/runtime.d.mts +13 -6
  1398. package/dist/runtime.d.mts.map +1 -1
  1399. package/dist/runtime.mjs +6 -4
  1400. package/dist/runtime.mjs.map +1 -1
  1401. package/dist/schema/project-env-types.d.mts +12 -0
  1402. package/dist/schema/project-env-types.d.mts.map +1 -0
  1403. package/dist/schema/project-env-types.mjs +86 -0
  1404. package/dist/schema/project-env-types.mjs.map +1 -0
  1405. package/dist/schema-BZPj3kwZ.mjs +13 -0
  1406. package/dist/schema-BZPj3kwZ.mjs.map +1 -0
  1407. package/dist/schema-Berj5VQx.mjs +815 -0
  1408. package/dist/schema-Berj5VQx.mjs.map +1 -0
  1409. package/dist/scopes-CxvclshI.mjs +34 -0
  1410. package/dist/scopes-CxvclshI.mjs.map +1 -0
  1411. package/dist/search-CD5MiMdh.mjs +448 -0
  1412. package/dist/search-CD5MiMdh.mjs.map +1 -0
  1413. package/dist/secrets-CIi0nFiR.mjs +341 -0
  1414. package/dist/secrets-CIi0nFiR.mjs.map +1 -0
  1415. package/dist/sections-Do5KdTSQ.mjs +346 -0
  1416. package/dist/sections-Do5KdTSQ.mjs.map +1 -0
  1417. package/dist/seed/index.d.mts +2 -2
  1418. package/dist/seed/index.mjs +47 -14
  1419. package/dist/seo/index.d.mts +15 -2
  1420. package/dist/seo/index.d.mts.map +1 -1
  1421. package/dist/seo/index.mjs +39 -18
  1422. package/dist/seo/index.mjs.map +1 -1
  1423. package/dist/seo-C61bnPuV.mjs +114 -0
  1424. package/dist/seo-C61bnPuV.mjs.map +1 -0
  1425. package/dist/seo-DpYxmGaL.mjs +133 -0
  1426. package/dist/seo-DpYxmGaL.mjs.map +1 -0
  1427. package/dist/service-BFUImckH.mjs +150 -0
  1428. package/dist/service-BFUImckH.mjs.map +1 -0
  1429. package/dist/session-user-DVcHsFD5.mjs +61 -0
  1430. package/dist/session-user-DVcHsFD5.mjs.map +1 -0
  1431. package/dist/settings-B0zQj_Tj.mjs +61 -0
  1432. package/dist/settings-B0zQj_Tj.mjs.map +1 -0
  1433. package/dist/settings-Ckzmx-A1.mjs +51 -0
  1434. package/dist/settings-Ckzmx-A1.mjs.map +1 -0
  1435. package/dist/settings-CnWoEDb0.mjs +439 -0
  1436. package/dist/settings-CnWoEDb0.mjs.map +1 -0
  1437. package/dist/setup-complete-B2_dhZZz.mjs +65 -0
  1438. package/dist/setup-complete-B2_dhZZz.mjs.map +1 -0
  1439. package/dist/setup-nonce-CJV9ftSK.mjs +25 -0
  1440. package/dist/setup-nonce-CJV9ftSK.mjs.map +1 -0
  1441. package/dist/single-flight-cache-B5O2qhO1.mjs +104 -0
  1442. package/dist/single-flight-cache-B5O2qhO1.mjs.map +1 -0
  1443. package/dist/site-settings-AYFvhwQn.mjs +50 -0
  1444. package/dist/site-settings-AYFvhwQn.mjs.map +1 -0
  1445. package/dist/site-url-Ceq_AUK0.mjs +16 -0
  1446. package/dist/site-url-Ceq_AUK0.mjs.map +1 -0
  1447. package/dist/slugify-T5GHH42D.mjs +17 -0
  1448. package/dist/slugify-T5GHH42D.mjs.map +1 -0
  1449. package/dist/snapshot-Dzsn3NZa.mjs +414 -0
  1450. package/dist/snapshot-Dzsn3NZa.mjs.map +1 -0
  1451. package/dist/ssrf-DsmvZB80.mjs +406 -0
  1452. package/dist/ssrf-DsmvZB80.mjs.map +1 -0
  1453. package/dist/ssrf-tA45vIPX.mjs +1 -0
  1454. package/dist/stage-BcuakqfP.mjs +662 -0
  1455. package/dist/stage-BcuakqfP.mjs.map +1 -0
  1456. package/dist/staged-Bw5eHbKS.mjs +686 -0
  1457. package/dist/staged-Bw5eHbKS.mjs.map +1 -0
  1458. package/dist/state-kGdOMQRY.mjs +153 -0
  1459. package/dist/state-kGdOMQRY.mjs.map +1 -0
  1460. package/dist/status-D39Fpy8R.mjs +30 -0
  1461. package/dist/status-D39Fpy8R.mjs.map +1 -0
  1462. package/dist/storage/local.d.mts +2 -1
  1463. package/dist/storage/local.d.mts.map +1 -1
  1464. package/dist/storage/local.mjs +2 -2
  1465. package/dist/storage/local.mjs.map +1 -1
  1466. package/dist/storage/s3.d.mts +2 -1
  1467. package/dist/storage/s3.d.mts.map +1 -1
  1468. package/dist/storage/s3.mjs +4 -3
  1469. package/dist/storage/s3.mjs.map +1 -1
  1470. package/dist/storage-query-CKNIJhjo.d.mts +1614 -0
  1471. package/dist/storage-query-CKNIJhjo.d.mts.map +1 -0
  1472. package/dist/tar-n2OXqKpZ.mjs +449 -0
  1473. package/dist/tar-n2OXqKpZ.mjs.map +1 -0
  1474. package/dist/target-DOFs5oUC.mjs +27 -0
  1475. package/dist/target-DOFs5oUC.mjs.map +1 -0
  1476. package/dist/taxonomies-CMCnItWf.mjs +939 -0
  1477. package/dist/taxonomies-CMCnItWf.mjs.map +1 -0
  1478. package/dist/taxonomies-CvBe3xhM.mjs +697 -0
  1479. package/dist/taxonomies-CvBe3xhM.mjs.map +1 -0
  1480. package/dist/taxonomy-BesdHIwi.mjs +525 -0
  1481. package/dist/taxonomy-BesdHIwi.mjs.map +1 -0
  1482. package/dist/tokens-BIGxi8sP.mjs +171 -0
  1483. package/dist/tokens-BIGxi8sP.mjs.map +1 -0
  1484. package/dist/transaction-BVYIo_yu.mjs +29 -0
  1485. package/dist/transaction-BVYIo_yu.mjs.map +1 -0
  1486. package/dist/transfer-5Ce0QuNS.mjs +8856 -0
  1487. package/dist/transfer-5Ce0QuNS.mjs.map +1 -0
  1488. package/dist/transfer-CzdXsFRx.mjs +166 -0
  1489. package/dist/transfer-CzdXsFRx.mjs.map +1 -0
  1490. package/dist/transfer-download-Dc-ltjZY.mjs +33 -0
  1491. package/dist/transfer-download-Dc-ltjZY.mjs.map +1 -0
  1492. package/dist/transformations-BLzqMnpY.mjs +196 -0
  1493. package/dist/transformations-BLzqMnpY.mjs.map +1 -0
  1494. package/dist/transport-k1fykDBh.d.mts +42 -0
  1495. package/dist/transport-k1fykDBh.d.mts.map +1 -0
  1496. package/dist/transport-umzEbgYO.mjs +136 -0
  1497. package/dist/transport-umzEbgYO.mjs.map +1 -0
  1498. package/dist/trusted-proxy-BqfQFs6a.mjs +51 -0
  1499. package/dist/trusted-proxy-BqfQFs6a.mjs.map +1 -0
  1500. package/dist/turnstile-CvvKLtqE.mjs +53 -0
  1501. package/dist/turnstile-CvvKLtqE.mjs.map +1 -0
  1502. package/dist/types-B8tO_KdV.d.mts +896 -0
  1503. package/dist/types-B8tO_KdV.d.mts.map +1 -0
  1504. package/dist/types-BGmQ0uXs.mjs +201 -0
  1505. package/dist/types-BGmQ0uXs.mjs.map +1 -0
  1506. package/dist/types-BYaPWs_F.d.mts +198 -0
  1507. package/dist/types-BYaPWs_F.d.mts.map +1 -0
  1508. package/dist/types-CLTQ9b_r.d.mts +374 -0
  1509. package/dist/types-CLTQ9b_r.d.mts.map +1 -0
  1510. package/dist/types-CPkQw2T2.d.mts +85 -0
  1511. package/dist/types-CPkQw2T2.d.mts.map +1 -0
  1512. package/dist/types-CQLvuXoZ.d.mts +198 -0
  1513. package/dist/types-CQLvuXoZ.d.mts.map +1 -0
  1514. package/dist/types-CV5xszpF.d.mts +363 -0
  1515. package/dist/types-CV5xszpF.d.mts.map +1 -0
  1516. package/dist/types-CVsmpTcU.mjs +18 -0
  1517. package/dist/types-CVsmpTcU.mjs.map +1 -0
  1518. package/dist/types-CdEMurNh.mjs +77 -0
  1519. package/dist/types-CdEMurNh.mjs.map +1 -0
  1520. package/dist/types-CxwtnuSS.mjs +37 -0
  1521. package/dist/types-CxwtnuSS.mjs.map +1 -0
  1522. package/dist/types-DGw8KMX_.mjs +16 -0
  1523. package/dist/types-DGw8KMX_.mjs.map +1 -0
  1524. package/dist/types-DOfVMPoo.d.mts +125 -0
  1525. package/dist/types-DOfVMPoo.d.mts.map +1 -0
  1526. package/dist/types-Dsco9Y38.d.mts +1720 -0
  1527. package/dist/types-Dsco9Y38.d.mts.map +1 -0
  1528. package/dist/types-LtS0SM4F.d.mts +287 -0
  1529. package/dist/types-LtS0SM4F.d.mts.map +1 -0
  1530. package/dist/types-j6MBDjlZ.mjs +103 -0
  1531. package/dist/types-j6MBDjlZ.mjs.map +1 -0
  1532. package/dist/update-check-B2JKz5cr.mjs +161 -0
  1533. package/dist/update-check-B2JKz5cr.mjs.map +1 -0
  1534. package/dist/upload-attempts-BodUoFBu.mjs +32 -0
  1535. package/dist/upload-attempts-BodUoFBu.mjs.map +1 -0
  1536. package/dist/url-Dn3IStq8.mjs +104 -0
  1537. package/dist/url-Dn3IStq8.mjs.map +1 -0
  1538. package/dist/url-pattern-DGAG6ZP2.mjs +41 -0
  1539. package/dist/url-pattern-DGAG6ZP2.mjs.map +1 -0
  1540. package/dist/user-BOvuF1sQ.mjs +171 -0
  1541. package/dist/user-BOvuF1sQ.mjs.map +1 -0
  1542. package/dist/utils-CoV-PYhg.mjs +439 -0
  1543. package/dist/utils-CoV-PYhg.mjs.map +1 -0
  1544. package/dist/validate-DANX1-Qi.mjs +120 -0
  1545. package/dist/validate-DANX1-Qi.mjs.map +1 -0
  1546. package/dist/validate-DpP1QUiV.d.mts +468 -0
  1547. package/dist/validate-DpP1QUiV.d.mts.map +1 -0
  1548. package/dist/validate-WkjGwBSO.mjs +516 -0
  1549. package/dist/validate-WkjGwBSO.mjs.map +1 -0
  1550. package/dist/validation-DG7Y9H4u.mjs +219 -0
  1551. package/dist/validation-DG7Y9H4u.mjs.map +1 -0
  1552. package/dist/version-BnlfLUa6.mjs +7 -0
  1553. package/dist/version-BnlfLUa6.mjs.map +1 -0
  1554. package/dist/version-BwEGkqkx.mjs +9 -0
  1555. package/dist/version-BwEGkqkx.mjs.map +1 -0
  1556. package/dist/virtual-modules-B6vJW15k.mjs +516 -0
  1557. package/dist/virtual-modules-B6vJW15k.mjs.map +1 -0
  1558. package/dist/widgets-D7I_9xff.mjs +126 -0
  1559. package/dist/widgets-D7I_9xff.mjs.map +1 -0
  1560. package/dist/wxr-taxonomies-Di1w9HDU.d.mts +34 -0
  1561. package/dist/wxr-taxonomies-Di1w9HDU.d.mts.map +1 -0
  1562. package/dist/wxr-taxonomies-m_141EtN.mjs +453 -0
  1563. package/dist/wxr-taxonomies-m_141EtN.mjs.map +1 -0
  1564. package/dist/zod-generator-DnfG5sGQ.mjs +424 -0
  1565. package/dist/zod-generator-DnfG5sGQ.mjs.map +1 -0
  1566. package/locals.d.ts +1 -6
  1567. package/package.json +142 -31
  1568. package/src/after.ts +6 -1
  1569. package/src/api/authorize.ts +27 -1
  1570. package/src/api/email-locale.ts +24 -0
  1571. package/src/api/error.ts +22 -7
  1572. package/src/api/errors.ts +131 -0
  1573. package/src/api/handlers/api-tokens.ts +37 -3
  1574. package/src/api/handlers/backup.ts +318 -0
  1575. package/src/api/handlers/block-types.ts +129 -0
  1576. package/src/api/handlers/bulk-tag.ts +309 -0
  1577. package/src/api/handlers/byline-fields.ts +212 -0
  1578. package/src/api/handlers/bylines.ts +283 -0
  1579. package/src/api/handlers/comment-reactions.ts +165 -0
  1580. package/src/api/handlers/comments.ts +6 -32
  1581. package/src/api/handlers/content.ts +1552 -156
  1582. package/src/api/handlers/dashboard.ts +73 -38
  1583. package/src/api/handlers/device-flow.ts +80 -23
  1584. package/src/api/handlers/entry-lock.ts +206 -0
  1585. package/src/api/handlers/index.ts +90 -0
  1586. package/src/api/handlers/manifest.ts +245 -12
  1587. package/src/api/handlers/marketplace.ts +251 -53
  1588. package/src/api/handlers/media-allowlist.ts +52 -0
  1589. package/src/api/handlers/media-folders.ts +130 -0
  1590. package/src/api/handlers/media-upload.ts +186 -0
  1591. package/src/api/handlers/media-usage-activation.ts +102 -0
  1592. package/src/api/handlers/media-usage-work.ts +188 -0
  1593. package/src/api/handlers/media-usage.ts +418 -0
  1594. package/src/api/handlers/media.ts +207 -16
  1595. package/src/api/handlers/menus.ts +294 -392
  1596. package/src/api/handlers/oauth-authorization.ts +74 -39
  1597. package/src/api/handlers/oauth-clients.ts +1 -1
  1598. package/src/api/handlers/plugin-settings.ts +250 -0
  1599. package/src/api/handlers/plugins.ts +195 -41
  1600. package/src/api/handlers/redirects.ts +225 -131
  1601. package/src/api/handlers/registry.ts +1844 -0
  1602. package/src/api/handlers/relations.ts +960 -0
  1603. package/src/api/handlers/revision.ts +70 -20
  1604. package/src/api/handlers/schema.ts +486 -8
  1605. package/src/api/handlers/seo.ts +68 -5
  1606. package/src/api/handlers/settings.ts +2 -2
  1607. package/src/api/handlers/snapshot.ts +359 -68
  1608. package/src/api/handlers/staged-references.ts +208 -0
  1609. package/src/api/handlers/taxonomies.ts +887 -156
  1610. package/src/api/handlers/transfer.ts +1347 -0
  1611. package/src/api/handlers/update-check.ts +236 -0
  1612. package/src/api/handlers/validate-media-fields.ts +237 -0
  1613. package/src/api/handlers/validate-references.ts +146 -0
  1614. package/src/api/handlers/validation.ts +120 -19
  1615. package/src/api/media-usage-write-fence.ts +43 -0
  1616. package/src/api/openapi/document.ts +1644 -262
  1617. package/src/api/parse.ts +3 -17
  1618. package/src/api/public-url.ts +66 -6
  1619. package/src/api/redirect.ts +9 -1
  1620. package/src/api/schemas/auth.ts +10 -4
  1621. package/src/api/schemas/byline-fields.ts +188 -0
  1622. package/src/api/schemas/bylines.ts +97 -1
  1623. package/src/api/schemas/comments.ts +19 -3
  1624. package/src/api/schemas/common.ts +29 -9
  1625. package/src/api/schemas/content.ts +302 -8
  1626. package/src/api/schemas/entry-lock.ts +57 -0
  1627. package/src/api/schemas/import.ts +69 -14
  1628. package/src/api/schemas/index.ts +4 -0
  1629. package/src/api/schemas/media-usage.ts +341 -0
  1630. package/src/api/schemas/media.ts +186 -5
  1631. package/src/api/schemas/menus.ts +50 -22
  1632. package/src/api/schemas/redirects.ts +17 -5
  1633. package/src/api/schemas/relations.ts +121 -0
  1634. package/src/api/schemas/schema.ts +267 -7
  1635. package/src/api/schemas/search.ts +7 -0
  1636. package/src/api/schemas/sections.ts +3 -3
  1637. package/src/api/schemas/settings.ts +41 -9
  1638. package/src/api/schemas/setup.ts +1 -1
  1639. package/src/api/schemas/taxonomies.ts +134 -10
  1640. package/src/api/schemas/transfer.ts +249 -0
  1641. package/src/api/schemas/users.ts +2 -2
  1642. package/src/api/setup-complete.ts +49 -1
  1643. package/src/api/site-url.ts +16 -6
  1644. package/src/api/transfer-download.ts +36 -0
  1645. package/src/api/types.ts +45 -10
  1646. package/src/astro/dev-typegen.ts +28 -0
  1647. package/src/astro/image-endpoint.ts +84 -0
  1648. package/src/astro/index.ts +6 -0
  1649. package/src/astro/integration/dev-typegen.ts +120 -0
  1650. package/src/astro/integration/index.ts +501 -122
  1651. package/src/astro/integration/route-naming.ts +19 -0
  1652. package/src/astro/integration/routes.ts +367 -16
  1653. package/src/astro/integration/runtime.ts +250 -24
  1654. package/src/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
  1655. package/src/astro/integration/shims/use-sync-external-store.js +1 -0
  1656. package/src/astro/integration/virtual-modules.ts +213 -7
  1657. package/src/astro/integration/vite-config.ts +261 -31
  1658. package/src/astro/middleware/auth.ts +157 -102
  1659. package/src/astro/middleware/csp.ts +79 -3
  1660. package/src/astro/middleware/media-usage-write-fence.ts +125 -0
  1661. package/src/astro/middleware/redirect.ts +68 -24
  1662. package/src/astro/middleware/request-context.ts +223 -27
  1663. package/src/astro/middleware/scoped-db.ts +183 -0
  1664. package/src/astro/middleware/stream-end-metrics.ts +102 -0
  1665. package/src/astro/middleware.ts +699 -115
  1666. package/src/astro/object-cache/adapters.ts +50 -0
  1667. package/src/astro/prefetch.ts +82 -0
  1668. package/src/astro/public-plugin-api-routes.ts +42 -0
  1669. package/src/astro/routes/PluginRegistry.tsx +5 -2
  1670. package/src/astro/routes/admin.astro +74 -19
  1671. package/src/astro/routes/api/admin/api-tokens/index.ts +6 -3
  1672. package/src/astro/routes/api/admin/byline-fields/[slug]/usage.ts +36 -0
  1673. package/src/astro/routes/api/admin/byline-fields/[slug].ts +92 -0
  1674. package/src/astro/routes/api/admin/byline-fields/index.ts +66 -0
  1675. package/src/astro/routes/api/admin/byline-fields/reorder.ts +39 -0
  1676. package/src/astro/routes/api/admin/bylines/[id]/index.ts +34 -31
  1677. package/src/astro/routes/api/admin/bylines/[id]/translations.ts +102 -0
  1678. package/src/astro/routes/api/admin/bylines/index.ts +25 -11
  1679. package/src/astro/routes/api/admin/comments/[id]/status.ts +23 -60
  1680. package/src/astro/routes/api/admin/comments/index.ts +1 -2
  1681. package/src/astro/routes/api/admin/core-update.ts +34 -0
  1682. package/src/astro/routes/api/admin/hooks/exclusive/index.ts +1 -5
  1683. package/src/astro/routes/api/admin/media-usage/activation.ts +42 -0
  1684. package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
  1685. package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
  1686. package/src/astro/routes/api/admin/media-usage/progress.ts +37 -0
  1687. package/src/astro/routes/api/admin/media-usage/repair.ts +24 -0
  1688. package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
  1689. package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
  1690. package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
  1691. package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
  1692. package/src/astro/routes/api/admin/plugins/[id]/disable.ts +7 -10
  1693. package/src/astro/routes/api/admin/plugins/[id]/enable.ts +7 -10
  1694. package/src/astro/routes/api/admin/plugins/[id]/index.ts +7 -0
  1695. package/src/astro/routes/api/admin/plugins/[id]/mcp.ts +42 -0
  1696. package/src/astro/routes/api/admin/plugins/[id]/settings.ts +80 -0
  1697. package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +6 -0
  1698. package/src/astro/routes/api/admin/plugins/[id]/update.ts +31 -4
  1699. package/src/astro/routes/api/admin/plugins/index.ts +10 -0
  1700. package/src/astro/routes/api/admin/plugins/marketplace/[id]/icon.ts +6 -2
  1701. package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +25 -3
  1702. package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +57 -0
  1703. package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +112 -0
  1704. package/src/astro/routes/api/admin/plugins/registry/artifact.ts +538 -0
  1705. package/src/astro/routes/api/admin/plugins/registry/install.ts +134 -0
  1706. package/src/astro/routes/api/admin/plugins/registry/publisher-handle.ts +59 -0
  1707. package/src/astro/routes/api/admin/plugins/registry/verify.ts +61 -0
  1708. package/src/astro/routes/api/admin/plugins/updates.ts +45 -6
  1709. package/src/astro/routes/api/admin/scheduled-policy-rejections/[collection]/[id].ts +34 -0
  1710. package/src/astro/routes/api/admin/themes/marketplace/[id]/thumbnail.ts +6 -2
  1711. package/src/astro/routes/api/admin/themes/marketplace/index.ts +1 -1
  1712. package/src/astro/routes/api/admin/transfer/[...path].ts +143 -0
  1713. package/src/astro/routes/api/admin/transfer/approvals/[id]/approve.ts +35 -0
  1714. package/src/astro/routes/api/admin/transfer/approvals/[id]/deny.ts +35 -0
  1715. package/src/astro/routes/api/admin/transfer/approvals/index.ts +33 -0
  1716. package/src/astro/routes/api/admin/transfer/capabilities.ts +36 -0
  1717. package/src/astro/routes/api/admin/transfer/exports/[id]/advance.ts +34 -0
  1718. package/src/astro/routes/api/admin/transfer/exports/[id]/archive.ts +35 -0
  1719. package/src/astro/routes/api/admin/transfer/exports/[id]/files/[...path].ts +40 -0
  1720. package/src/astro/routes/api/admin/transfer/exports/[id]/index.ts +25 -0
  1721. package/src/astro/routes/api/admin/transfer/exports/[id]/manifest.ts +38 -0
  1722. package/src/astro/routes/api/admin/transfer/exports/index.ts +64 -0
  1723. package/src/astro/routes/api/admin/transfer/imports/[id]/abandon.ts +28 -0
  1724. package/src/astro/routes/api/admin/transfer/imports/[id]/advance.ts +37 -0
  1725. package/src/astro/routes/api/admin/transfer/imports/[id]/analyze.ts +51 -0
  1726. package/src/astro/routes/api/admin/transfer/imports/[id]/cancel.ts +27 -0
  1727. package/src/astro/routes/api/admin/transfer/imports/[id]/execute.ts +48 -0
  1728. package/src/astro/routes/api/admin/transfer/imports/[id]/files/[...path].ts +54 -0
  1729. package/src/astro/routes/api/admin/transfer/imports/[id]/index.ts +25 -0
  1730. package/src/astro/routes/api/admin/transfer/imports/[id]/missing.ts +34 -0
  1731. package/src/astro/routes/api/admin/transfer/imports/[id]/plan.ts +29 -0
  1732. package/src/astro/routes/api/admin/transfer/imports/[id]/receipt.ts +25 -0
  1733. package/src/astro/routes/api/admin/transfer/imports/index.ts +85 -0
  1734. package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +11 -3
  1735. package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
  1736. package/src/astro/routes/api/auth/invite/complete.ts +10 -5
  1737. package/src/astro/routes/api/auth/invite/index.ts +17 -3
  1738. package/src/astro/routes/api/auth/invite/register-options.ts +8 -1
  1739. package/src/astro/routes/api/auth/magic-link/send.ts +11 -3
  1740. package/src/astro/routes/api/auth/magic-link/verify.ts +40 -39
  1741. package/src/astro/routes/api/auth/me.ts +34 -11
  1742. package/src/astro/routes/api/auth/mode.ts +6 -14
  1743. package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +30 -9
  1744. package/src/astro/routes/api/auth/oauth/[provider].ts +24 -7
  1745. package/src/astro/routes/api/auth/passkey/options.ts +2 -21
  1746. package/src/astro/routes/api/auth/passkey/register/verify.ts +6 -1
  1747. package/src/astro/routes/api/auth/passkey/verify.ts +10 -5
  1748. package/src/astro/routes/api/auth/signup/complete.ts +10 -5
  1749. package/src/astro/routes/api/auth/signup/request.ts +2 -2
  1750. package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +4 -246
  1751. package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
  1752. package/src/astro/routes/api/content/[collection]/[id]/compare.ts +3 -4
  1753. package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +26 -6
  1754. package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +5 -6
  1755. package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
  1756. package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +3 -4
  1757. package/src/astro/routes/api/content/[collection]/[id]/plugin-extensions/[pluginId]/[kind]/[extensionId].ts +29 -0
  1758. package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +87 -15
  1759. package/src/astro/routes/api/content/[collection]/[id]/publish.ts +58 -8
  1760. package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +52 -0
  1761. package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/parents.ts +47 -0
  1762. package/src/astro/routes/api/content/[collection]/[id]/restore.ts +6 -4
  1763. package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +6 -6
  1764. package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +42 -9
  1765. package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +103 -38
  1766. package/src/astro/routes/api/content/[collection]/[id]/translations.ts +4 -5
  1767. package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +26 -6
  1768. package/src/astro/routes/api/content/[collection]/[id].ts +62 -18
  1769. package/src/astro/routes/api/content/[collection]/authors.ts +33 -0
  1770. package/src/astro/routes/api/content/[collection]/index.ts +10 -9
  1771. package/src/astro/routes/api/content/[collection]/trash.ts +2 -3
  1772. package/src/astro/routes/api/health.ts +18 -0
  1773. package/src/astro/routes/api/import/wordpress/execute.ts +428 -8
  1774. package/src/astro/routes/api/import/wordpress/media.ts +9 -3
  1775. package/src/astro/routes/api/import/wordpress/prepare.ts +10 -12
  1776. package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +225 -0
  1777. package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +132 -273
  1778. package/src/astro/routes/api/import/wordpress-plugin/execute.ts +798 -46
  1779. package/src/astro/routes/api/manifest.ts +85 -46
  1780. package/src/astro/routes/api/mcp.ts +6 -2
  1781. package/src/astro/routes/api/media/[id]/confirm.ts +169 -11
  1782. package/src/astro/routes/api/media/[id]/replace.ts +114 -0
  1783. package/src/astro/routes/api/media/[id]/upload.ts +262 -0
  1784. package/src/astro/routes/api/media/[id]/usage.ts +30 -0
  1785. package/src/astro/routes/api/media/[id].ts +32 -18
  1786. package/src/astro/routes/api/media/asset/[id]/[filename].ts +50 -0
  1787. package/src/astro/routes/api/media/file/[...key].ts +37 -1
  1788. package/src/astro/routes/api/media/folders/[id].ts +55 -0
  1789. package/src/astro/routes/api/media/folders/index.ts +37 -0
  1790. package/src/astro/routes/api/media/providers/[providerId]/index.ts +12 -3
  1791. package/src/astro/routes/api/media/upload-url.ts +44 -37
  1792. package/src/astro/routes/api/media.ts +115 -33
  1793. package/src/astro/routes/api/menus/[name]/items/[id].ts +74 -0
  1794. package/src/astro/routes/api/menus/[name]/items.ts +12 -60
  1795. package/src/astro/routes/api/menus/[name]/reorder.ts +12 -4
  1796. package/src/astro/routes/api/menus/[name]/translations.ts +85 -0
  1797. package/src/astro/routes/api/menus/[name].ts +25 -11
  1798. package/src/astro/routes/api/menus/index.ts +13 -7
  1799. package/src/astro/routes/api/oauth/authorize.ts +47 -15
  1800. package/src/astro/routes/api/oauth/device/authorize.ts +33 -4
  1801. package/src/astro/routes/api/oauth/register.ts +22 -2
  1802. package/src/astro/routes/api/openapi.json.ts +27 -10
  1803. package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +13 -59
  1804. package/src/astro/routes/api/redirects/404s/index.ts +7 -1
  1805. package/src/astro/routes/api/redirects/404s/summary.ts +3 -1
  1806. package/src/astro/routes/api/redirects/[id].ts +7 -4
  1807. package/src/astro/routes/api/redirects/index.ts +5 -3
  1808. package/src/astro/routes/api/relations/[id]/index.ts +84 -0
  1809. package/src/astro/routes/api/relations/index.ts +56 -0
  1810. package/src/astro/routes/api/revisions/[revisionId]/index.ts +1 -1
  1811. package/src/astro/routes/api/revisions/[revisionId]/restore.ts +17 -1
  1812. package/src/astro/routes/api/schema/block-types/[slug]/index.ts +29 -0
  1813. package/src/astro/routes/api/schema/block-types/[slug]/versions/[version]/activate.ts +31 -0
  1814. package/src/astro/routes/api/schema/block-types/index.ts +29 -0
  1815. package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +9 -13
  1816. package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +2 -8
  1817. package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +1 -2
  1818. package/src/astro/routes/api/schema/collections/[slug]/index.ts +5 -11
  1819. package/src/astro/routes/api/schema/collections/index.ts +4 -4
  1820. package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
  1821. package/src/astro/routes/api/schema/index.ts +19 -19
  1822. package/src/astro/routes/api/schema/orphans/[slug].ts +1 -1
  1823. package/src/astro/routes/api/schema/orphans/index.ts +1 -1
  1824. package/src/astro/routes/api/search/enable.ts +5 -1
  1825. package/src/astro/routes/api/search/index.ts +13 -2
  1826. package/src/astro/routes/api/search/rebuild.ts +6 -1
  1827. package/src/astro/routes/api/sections/[slug].ts +7 -1
  1828. package/src/astro/routes/api/sections/index.ts +5 -1
  1829. package/src/astro/routes/api/settings/backups/archives/[name].ts +78 -0
  1830. package/src/astro/routes/api/settings/backups/archives/index.ts +33 -0
  1831. package/src/astro/routes/api/settings/backups/export.ts +43 -0
  1832. package/src/astro/routes/api/settings/backups/index.ts +76 -0
  1833. package/src/astro/routes/api/settings/email.ts +1 -1
  1834. package/src/astro/routes/api/settings.ts +4 -1
  1835. package/src/astro/routes/api/setup/admin-verify.ts +20 -10
  1836. package/src/astro/routes/api/setup/admin.ts +11 -4
  1837. package/src/astro/routes/api/setup/dev-bypass.ts +26 -10
  1838. package/src/astro/routes/api/setup/index.ts +71 -36
  1839. package/src/astro/routes/api/snapshot.ts +48 -19
  1840. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +44 -0
  1841. package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +92 -0
  1842. package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +28 -23
  1843. package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +19 -15
  1844. package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
  1845. package/src/astro/routes/api/taxonomies/[name].ts +107 -0
  1846. package/src/astro/routes/api/taxonomies/bulk-tag.ts +29 -0
  1847. package/src/astro/routes/api/taxonomies/index.ts +13 -8
  1848. package/src/astro/routes/api/themes/preview.ts +11 -5
  1849. package/src/astro/routes/api/typegen.ts +4 -42
  1850. package/src/astro/routes/api/visual-editing/action-token.ts +36 -0
  1851. package/src/astro/routes/api/visual-editing/content/[collection]/[id]/publish.ts +32 -0
  1852. package/src/astro/routes/api/visual-editing/toolbar-labels.ts +16 -0
  1853. package/src/astro/routes/api/well-known/oauth-authorization-server.ts +4 -1
  1854. package/src/astro/routes/api/well-known/oauth-protected-resource.ts +5 -1
  1855. package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -1
  1856. package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
  1857. package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
  1858. package/src/astro/routes/api/widget-areas/[name].ts +3 -1
  1859. package/src/astro/routes/api/widget-areas/index.ts +3 -1
  1860. package/src/astro/routes/sitemap-[collection].xml.ts +133 -14
  1861. package/src/astro/session-user.ts +71 -0
  1862. package/src/astro/types.ts +304 -16
  1863. package/src/auth/allowed-origins.ts +168 -0
  1864. package/src/auth/api-tokens.ts +2 -0
  1865. package/src/auth/challenge-store.ts +3 -1
  1866. package/src/auth/oauth-state-store.ts +3 -0
  1867. package/src/auth/passkey-config.ts +35 -13
  1868. package/src/auth/providers/github-admin.tsx +5 -6
  1869. package/src/auth/providers/google-admin.tsx +5 -6
  1870. package/src/auth/rate-limit.ts +6 -5
  1871. package/src/auth/scopes.ts +14 -9
  1872. package/src/auth/trusted-proxy.ts +1 -1
  1873. package/src/aws-sdk.d.ts +1 -0
  1874. package/src/bylines/credits.ts +149 -0
  1875. package/src/bylines/field-defs-cache.ts +188 -0
  1876. package/src/bylines/index.ts +152 -152
  1877. package/src/cache/chrome-tags.ts +24 -0
  1878. package/src/cleanup.ts +72 -26
  1879. package/src/cli/client-factory.ts +6 -2
  1880. package/src/cli/commands/content.ts +48 -7
  1881. package/src/cli/commands/doctor.ts +219 -7
  1882. package/src/cli/commands/export-seed.ts +1021 -142
  1883. package/src/cli/commands/init.ts +4 -8
  1884. package/src/cli/commands/login.ts +8 -1
  1885. package/src/cli/commands/media.ts +127 -0
  1886. package/src/cli/commands/migrate.ts +641 -0
  1887. package/src/cli/commands/secrets.ts +183 -0
  1888. package/src/cli/commands/seed.ts +9 -3
  1889. package/src/cli/commands/site.ts +556 -0
  1890. package/src/cli/credentials.ts +2 -61
  1891. package/src/cli/index.ts +6 -28
  1892. package/src/cli/site/archive.ts +273 -0
  1893. package/src/cli/site/export.ts +311 -0
  1894. package/src/cli/site/import.ts +815 -0
  1895. package/src/cli/site/shared.ts +241 -0
  1896. package/src/cli/wxr/parser.ts +263 -0
  1897. package/src/client/index.ts +849 -31
  1898. package/src/client/portable-text.ts +41 -0
  1899. package/src/client/transport.ts +23 -9
  1900. package/src/comments/public-submission.ts +254 -0
  1901. package/src/comments/query.ts +78 -7
  1902. package/src/comments/ranking.ts +58 -0
  1903. package/src/comments/service.ts +60 -13
  1904. package/src/comments/turnstile.ts +64 -0
  1905. package/src/components/Block.astro +83 -0
  1906. package/src/components/BlockquoteGroup.astro +34 -0
  1907. package/src/components/Blocks.astro +46 -0
  1908. package/src/components/Break.astro +2 -2
  1909. package/src/components/Columns.astro +3 -1
  1910. package/src/components/CommentForm.astro +13 -6
  1911. package/src/components/Comments.astro +137 -2
  1912. package/src/components/Cover.astro +3 -1
  1913. package/src/components/EmDashBodyEnd.astro +4 -1
  1914. package/src/components/EmDashBodyStart.astro +4 -1
  1915. package/src/components/EmDashHead.astro +113 -25
  1916. package/src/components/EmDashImage.astro +210 -53
  1917. package/src/components/EmDashMedia.astro +3 -3
  1918. package/src/components/Embed.astro +1 -1
  1919. package/src/components/Gallery.astro +166 -29
  1920. package/src/components/Image.astro +158 -40
  1921. package/src/components/InlineEditor.astro +3 -1
  1922. package/src/components/InlinePortableTextEditor.tsx +854 -97
  1923. package/src/components/JsonLdScript.astro +9 -0
  1924. package/src/components/LiveSearch.astro +63 -4
  1925. package/src/components/OrderedList.astro +14 -0
  1926. package/src/components/PortableText.astro +34 -2
  1927. package/src/components/Table.astro +147 -62
  1928. package/src/components/WidgetArea.astro +3 -2
  1929. package/src/components/blocks.ts +44 -0
  1930. package/src/components/code-mark.ts +11 -0
  1931. package/src/components/index.ts +25 -8
  1932. package/src/components/inline-code-block.tsx +474 -0
  1933. package/src/components/live-search-routing.ts +30 -0
  1934. package/src/components/marks/Link.astro +5 -1
  1935. package/src/components/ordered-list.ts +549 -0
  1936. package/src/components/portable-text-blockquote-group.ts +68 -0
  1937. package/src/components/portable-text-text-align.ts +38 -0
  1938. package/src/components/widgets/Archives.astro +7 -41
  1939. package/src/components/widgets/Categories.astro +1 -1
  1940. package/src/components/widgets/Tags.astro +1 -1
  1941. package/src/config/errors.ts +13 -0
  1942. package/src/config/secrets.ts +562 -0
  1943. package/src/content/converters/gallery.ts +101 -0
  1944. package/src/content/converters/image-link.ts +27 -0
  1945. package/src/content/converters/index.ts +3 -0
  1946. package/src/content/converters/mark-safety.ts +121 -0
  1947. package/src/content/converters/numbered-list.ts +148 -0
  1948. package/src/content/converters/portable-text-identity.ts +139 -0
  1949. package/src/content/converters/portable-text-to-prosemirror.ts +400 -90
  1950. package/src/content/converters/prosemirror-to-portable-text.ts +234 -46
  1951. package/src/content/converters/types.ts +80 -0
  1952. package/src/content/known-fields.ts +44 -0
  1953. package/src/content/portable-text-lists.ts +205 -0
  1954. package/src/content-list-query.ts +29 -0
  1955. package/src/database/connection.ts +9 -41
  1956. package/src/database/content-datetime.ts +228 -0
  1957. package/src/database/datetime-storage.ts +452 -0
  1958. package/src/database/dialect-helpers.ts +352 -10
  1959. package/src/database/errors.ts +14 -0
  1960. package/src/database/index.ts +11 -3
  1961. package/src/database/instrumentation.ts +56 -9
  1962. package/src/database/json-recordset.ts +16 -0
  1963. package/src/database/migration-lock.ts +140 -0
  1964. package/src/database/migrations/006_taxonomy_defs.ts +1 -1
  1965. package/src/database/migrations/014_draft_revisions.ts +6 -6
  1966. package/src/database/migrations/016_api_tokens.ts +18 -3
  1967. package/src/database/migrations/017_authorization_codes.ts +14 -4
  1968. package/src/database/migrations/019_i18n.ts +3 -3
  1969. package/src/database/migrations/034_published_at_index.ts +1 -1
  1970. package/src/database/migrations/035_bounded_404_log.ts +37 -31
  1971. package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +655 -0
  1972. package/src/database/migrations/037_credential_algorithm.ts +18 -0
  1973. package/src/database/migrations/038_registry_plugin_state.ts +130 -0
  1974. package/src/database/migrations/039_fix_fts5_triggers.ts +264 -0
  1975. package/src/database/migrations/040_byline_i18n.ts +497 -0
  1976. package/src/database/migrations/041_content_locale_list_index.ts +47 -0
  1977. package/src/database/migrations/042_byline_fields.ts +157 -0
  1978. package/src/database/migrations/043_content_references.ts +121 -0
  1979. package/src/database/migrations/044_comment_reactions.ts +56 -0
  1980. package/src/database/migrations/045_taxonomy_parent_group.ts +68 -0
  1981. package/src/database/migrations/046_media_usage_index.ts +115 -0
  1982. package/src/database/migrations/047_restore_taxonomy_parent_index.ts +29 -0
  1983. package/src/database/migrations/048_restore_content_taxonomies_term_index.ts +32 -0
  1984. package/src/database/migrations/049_taxonomies_name_locale_index.ts +42 -0
  1985. package/src/database/migrations/050_media_usage_index_status.ts +142 -0
  1986. package/src/database/migrations/051_content_taxonomies_denorm.ts +120 -0
  1987. package/src/database/migrations/052_media_usage_read_index.ts +26 -0
  1988. package/src/database/migrations/053_plugin_mcp_tools.ts +21 -0
  1989. package/src/database/migrations/054_media_upload_attempts.ts +41 -0
  1990. package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
  1991. package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
  1992. package/src/database/migrations/057_collection_hidden.ts +24 -0
  1993. package/src/database/migrations/058_collection_sort_order.ts +20 -0
  1994. package/src/database/migrations/059_revision_prune_queue.ts +36 -0
  1995. package/src/database/migrations/060_collection_admin_config.ts +16 -0
  1996. package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
  1997. package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
  1998. package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
  1999. package/src/database/migrations/064_fts_plain_text.ts +253 -0
  2000. package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
  2001. package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
  2002. package/src/database/migrations/067_indexed_content_fields.ts +39 -0
  2003. package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
  2004. package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
  2005. package/src/database/migrations/070_collection_routable.ts +18 -0
  2006. package/src/database/migrations/071_restore_content_bylines_table.ts +43 -0
  2007. package/src/database/migrations/072_media_folders.ts +72 -0
  2008. package/src/database/migrations/073_media_focal_point.ts +57 -0
  2009. package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
  2010. package/src/database/migrations/075_entry_edit_locks.ts +44 -0
  2011. package/src/database/migrations/076_collection_nav_group.ts +22 -0
  2012. package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
  2013. package/src/database/migrations/078_menu_item_translation_groups.ts +15 -0
  2014. package/src/database/migrations/079_datetime_normalization.ts +13 -0
  2015. package/src/database/migrations/080_content_translation_locale_unique.ts +88 -0
  2016. package/src/database/migrations/081_redirect_write_guards.ts +260 -0
  2017. package/src/database/migrations/082_taxonomy_translation_locale_unique.ts +49 -0
  2018. package/src/database/migrations/083_block_types.ts +58 -0
  2019. package/src/database/migrations/084_site_transfer.ts +264 -0
  2020. package/src/database/migrations/085_taxonomy_def_groups.ts +155 -0
  2021. package/src/database/migrations/086_relations_structural.ts +197 -0
  2022. package/src/database/migrations/087_reference_field_relations.ts +407 -0
  2023. package/src/database/migrations/088_cron_oneshot_utc.ts +39 -0
  2024. package/src/database/migrations/089_auto_seed_completion.ts +13 -0
  2025. package/src/database/migrations/policy.ts +70 -0
  2026. package/src/database/migrations/runner.ts +416 -43
  2027. package/src/database/pg-migration-lock.ts +69 -0
  2028. package/src/database/reference-backfill.ts +141 -0
  2029. package/src/database/repositories/audit.ts +13 -3
  2030. package/src/database/repositories/byline.ts +1120 -87
  2031. package/src/database/repositories/comment-reaction.ts +132 -0
  2032. package/src/database/repositories/comment.ts +99 -3
  2033. package/src/database/repositories/content.ts +2210 -267
  2034. package/src/database/repositories/entry-locks.ts +257 -0
  2035. package/src/database/repositories/index.ts +21 -0
  2036. package/src/database/repositories/media-folders.ts +115 -0
  2037. package/src/database/repositories/media-usage-work.ts +1132 -0
  2038. package/src/database/repositories/media-usage.ts +4040 -0
  2039. package/src/database/repositories/media.ts +465 -55
  2040. package/src/database/repositories/menu.ts +657 -0
  2041. package/src/database/repositories/options.ts +128 -10
  2042. package/src/database/repositories/plugin-storage.ts +265 -44
  2043. package/src/database/repositories/redirect.ts +296 -79
  2044. package/src/database/repositories/relation.ts +1004 -0
  2045. package/src/database/repositories/revision.ts +225 -31
  2046. package/src/database/repositories/seo.ts +3 -0
  2047. package/src/database/repositories/taxonomy-def.ts +126 -0
  2048. package/src/database/repositories/taxonomy.ts +747 -97
  2049. package/src/database/repositories/types.ts +209 -0
  2050. package/src/database/repositories/user.ts +18 -0
  2051. package/src/database/transaction.ts +12 -0
  2052. package/src/database/types.ts +525 -7
  2053. package/src/database/validate.ts +39 -0
  2054. package/src/datetime-normalization.ts +311 -0
  2055. package/src/db/adapters.ts +105 -5
  2056. package/src/db/index.ts +6 -1
  2057. package/src/db/libsql-migrations.ts +72 -0
  2058. package/src/db/libsql.ts +1 -3
  2059. package/src/db/node-sqlite-compat.ts +105 -0
  2060. package/src/db/postgres-migrations.ts +59 -0
  2061. package/src/db/postgres.ts +28 -2
  2062. package/src/db/sqlite-migrations.ts +37 -0
  2063. package/src/db/sqlite.ts +4 -7
  2064. package/src/deferred-tasks.ts +71 -0
  2065. package/src/emdash-runtime.ts +4558 -909
  2066. package/src/fields/boolean.ts +1 -1
  2067. package/src/fields/datetime.ts +1 -1
  2068. package/src/fields/file.ts +15 -11
  2069. package/src/fields/image.ts +29 -13
  2070. package/src/fields/integer.ts +1 -1
  2071. package/src/fields/json.ts +1 -1
  2072. package/src/fields/multiselect.ts +1 -1
  2073. package/src/fields/number.ts +1 -1
  2074. package/src/fields/portable-text.ts +1 -1
  2075. package/src/fields/richtext.ts +1 -1
  2076. package/src/fields/select.ts +1 -1
  2077. package/src/fields/slug.ts +1 -1
  2078. package/src/fields/text.ts +1 -1
  2079. package/src/fields/textarea.ts +1 -1
  2080. package/src/fields/types.ts +29 -9
  2081. package/src/i18n/config.ts +57 -10
  2082. package/src/i18n/normalize.ts +31 -0
  2083. package/src/i18n/repair-locale-casing.ts +37 -0
  2084. package/src/i18n/resolve.ts +272 -0
  2085. package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
  2086. package/src/import/comments.ts +159 -0
  2087. package/src/import/index.ts +8 -1
  2088. package/src/import/settings.ts +65 -189
  2089. package/src/import/sources/wordpress-plugin.ts +347 -44
  2090. package/src/import/sources/wxr.ts +20 -3
  2091. package/src/import/ssrf.ts +20 -500
  2092. package/src/import/types.ts +12 -0
  2093. package/src/import/utils.ts +214 -0
  2094. package/src/import/wxr-taxonomies.ts +748 -0
  2095. package/src/index.ts +274 -20
  2096. package/src/loader.ts +1257 -152
  2097. package/src/mcp/server.ts +2065 -272
  2098. package/src/mcp/transfer.ts +569 -0
  2099. package/src/media/enrich.ts +78 -0
  2100. package/src/media/focal-point.ts +37 -0
  2101. package/src/media/image-endpoint.ts +206 -0
  2102. package/src/media/index.ts +1 -0
  2103. package/src/media/local-runtime.ts +49 -15
  2104. package/src/media/local.ts +1 -1
  2105. package/src/media/mime.ts +76 -0
  2106. package/src/media/normalize.ts +82 -9
  2107. package/src/media/placeholder.ts +29 -9
  2108. package/src/media/responsive.ts +148 -0
  2109. package/src/media/types.ts +24 -0
  2110. package/src/media/upload-attempts.ts +38 -0
  2111. package/src/media/url.ts +15 -0
  2112. package/src/media/usage/activation.ts +762 -0
  2113. package/src/media/usage/capture-triggers.ts +559 -0
  2114. package/src/media/usage/cleanup.ts +306 -0
  2115. package/src/media/usage/collection-deletion-processor.ts +360 -0
  2116. package/src/media/usage/collection-deletion.ts +846 -0
  2117. package/src/media/usage/content-fields.ts +220 -0
  2118. package/src/media/usage/content-refresh.ts +1000 -0
  2119. package/src/media/usage/content-repair.ts +802 -0
  2120. package/src/media/usage/content-snapshots.ts +516 -0
  2121. package/src/media/usage/extractor.ts +427 -0
  2122. package/src/media/usage/gc.ts +50 -0
  2123. package/src/media/usage/maintenance-engine.ts +166 -0
  2124. package/src/media/usage/projection-fingerprint.ts +143 -0
  2125. package/src/media/usage/reconciliation-processor.ts +449 -0
  2126. package/src/media/usage/reconciliation.ts +1200 -0
  2127. package/src/media/usage/schema-invalidation.ts +72 -0
  2128. package/src/media/usage/site-settings.ts +52 -0
  2129. package/src/media/usage/source-key.ts +26 -0
  2130. package/src/media/usage/types.ts +50 -0
  2131. package/src/media/usage/work-processor.ts +489 -0
  2132. package/src/menus/index.ts +408 -198
  2133. package/src/menus/types.ts +15 -1
  2134. package/src/migrations/config-loader.ts +210 -0
  2135. package/src/migrations/direct-executor.ts +179 -0
  2136. package/src/migrations/identity.ts +46 -0
  2137. package/src/migrations/index.ts +20 -0
  2138. package/src/migrations/integration-metadata.ts +67 -0
  2139. package/src/migrations/manifest-builder.ts +55 -0
  2140. package/src/migrations/manifest-writer.ts +63 -0
  2141. package/src/migrations/manifest.ts +197 -0
  2142. package/src/migrations/protocol.ts +69 -0
  2143. package/src/migrations/target.ts +35 -0
  2144. package/src/object-cache/codec.ts +73 -0
  2145. package/src/object-cache/index.ts +852 -0
  2146. package/src/object-cache/memory.ts +91 -0
  2147. package/src/object-cache/types.ts +125 -0
  2148. package/src/page/absolute-url.ts +146 -0
  2149. package/src/page/jsonld.ts +10 -2
  2150. package/src/page/metadata.ts +50 -3
  2151. package/src/page/seo-contributions.ts +94 -6
  2152. package/src/page/seo-panel.ts +47 -0
  2153. package/src/page/site-identity.ts +58 -0
  2154. package/src/plugin-test-runtime.ts +18 -0
  2155. package/src/plugin-types.ts +410 -0
  2156. package/src/plugin-utils.ts +31 -6
  2157. package/src/plugins/adapt-sandbox-entry.ts +249 -56
  2158. package/src/plugins/byline-access.ts +158 -0
  2159. package/src/plugins/conditional-storage.ts +30 -0
  2160. package/src/plugins/content-access.ts +170 -0
  2161. package/src/plugins/content-policy.ts +74 -0
  2162. package/src/plugins/context.ts +1160 -251
  2163. package/src/plugins/cron.ts +69 -19
  2164. package/src/plugins/define-plugin.ts +129 -86
  2165. package/src/plugins/editor-draft.ts +257 -0
  2166. package/src/plugins/email-console.ts +3 -1
  2167. package/src/plugins/email.ts +16 -0
  2168. package/src/plugins/hooks.ts +330 -57
  2169. package/src/plugins/host.ts +30 -0
  2170. package/src/plugins/http-route-dispatch.ts +389 -0
  2171. package/src/plugins/http-wire.ts +180 -0
  2172. package/src/plugins/index.ts +148 -12
  2173. package/src/plugins/install-finalization.ts +77 -0
  2174. package/src/plugins/lifecycle.ts +47 -0
  2175. package/src/plugins/manager.ts +40 -2
  2176. package/src/plugins/manifest-schema.ts +452 -49
  2177. package/src/plugins/marketplace.ts +110 -42
  2178. package/src/plugins/media.ts +166 -0
  2179. package/src/plugins/request-meta.ts +12 -2
  2180. package/src/plugins/route-error.ts +57 -0
  2181. package/src/plugins/route-wire.ts +304 -0
  2182. package/src/plugins/routes.ts +183 -62
  2183. package/src/plugins/sandbox/hook-result.ts +52 -0
  2184. package/src/plugins/sandbox/index.ts +25 -1
  2185. package/src/plugins/sandbox/noop.ts +13 -5
  2186. package/src/plugins/sandbox/proxy.ts +130 -0
  2187. package/src/plugins/sandbox/runner-options.ts +16 -0
  2188. package/src/plugins/sandbox/types.ts +218 -9
  2189. package/src/plugins/save-rejection.ts +20 -0
  2190. package/src/plugins/scheduler/node.ts +9 -2
  2191. package/src/plugins/secret-redactor.ts +65 -0
  2192. package/src/plugins/settings.ts +303 -0
  2193. package/src/plugins/state.ts +137 -39
  2194. package/src/plugins/storage-indexes.ts +50 -11
  2195. package/src/plugins/storage-query.ts +111 -32
  2196. package/src/plugins/storage-update.ts +96 -0
  2197. package/src/plugins/types.ts +1014 -152
  2198. package/src/preview/urls.ts +23 -3
  2199. package/src/query.ts +1188 -85
  2200. package/src/redirects/cache.ts +113 -23
  2201. package/src/redirects/destination.ts +20 -0
  2202. package/src/redirects/loops.ts +10 -6
  2203. package/src/redirects/patterns.ts +12 -30
  2204. package/src/redirects/status.ts +27 -0
  2205. package/src/references/field-map.ts +115 -0
  2206. package/src/references/resolve.ts +160 -0
  2207. package/src/references/staged.ts +157 -0
  2208. package/src/references/types.ts +16 -0
  2209. package/src/registry/artifact-checksum.ts +15 -0
  2210. package/src/registry/artifact-fetch.ts +317 -0
  2211. package/src/registry/artifact-verification.ts +85 -0
  2212. package/src/registry/authoritative-records.ts +206 -0
  2213. package/src/registry/config.ts +461 -0
  2214. package/src/registry/plugin-id.ts +116 -0
  2215. package/src/registry/publisher-handle.ts +273 -0
  2216. package/src/registry/record-labels.ts +28 -0
  2217. package/src/registry/testing.ts +145 -0
  2218. package/src/registry/types.ts +126 -0
  2219. package/src/request-cache.ts +31 -4
  2220. package/src/request-context.ts +62 -3
  2221. package/src/scheduled-publish.ts +225 -0
  2222. package/src/scheduler-health.ts +46 -0
  2223. package/src/schema/block-type-contract.ts +478 -0
  2224. package/src/schema/block-type-registry.ts +689 -0
  2225. package/src/schema/block-types.ts +110 -0
  2226. package/src/schema/block-values.ts +293 -0
  2227. package/src/schema/byline-registry.ts +671 -0
  2228. package/src/schema/collection-slugs-cache.ts +157 -0
  2229. package/src/schema/env-types.ts +37 -0
  2230. package/src/schema/index.ts +29 -0
  2231. package/src/schema/project-env-types.ts +41 -0
  2232. package/src/schema/query.ts +11 -4
  2233. package/src/schema/registry.ts +1837 -264
  2234. package/src/schema/types.ts +326 -5
  2235. package/src/schema/url-pattern.ts +43 -0
  2236. package/src/schema/zod-generator.ts +357 -34
  2237. package/src/search/fts-manager.ts +256 -39
  2238. package/src/search/index.ts +2 -0
  2239. package/src/search/match.ts +50 -0
  2240. package/src/search/query.ts +155 -18
  2241. package/src/search/types.ts +18 -0
  2242. package/src/security/ssrf.ts +549 -0
  2243. package/src/seed/apply.ts +1547 -274
  2244. package/src/seed/ownership.ts +15 -0
  2245. package/src/seed/types.ts +145 -11
  2246. package/src/seed/validate.ts +415 -26
  2247. package/src/seo/hreflang.ts +196 -0
  2248. package/src/seo/index.ts +28 -32
  2249. package/src/seo/media-url.ts +58 -0
  2250. package/src/settings/index.ts +206 -27
  2251. package/src/settings/types.ts +42 -1
  2252. package/src/storage/local.ts +2 -1
  2253. package/src/storage/s3.ts +6 -4
  2254. package/src/storage/types.ts +8 -0
  2255. package/src/taxonomies/index.ts +686 -302
  2256. package/src/taxonomies/term-counts.ts +175 -0
  2257. package/src/taxonomies/types.ts +10 -0
  2258. package/src/transfer/analyze/index.ts +45 -0
  2259. package/src/transfer/analyze/issues.ts +55 -0
  2260. package/src/transfer/analyze/plan.ts +327 -0
  2261. package/src/transfer/analyze/read.ts +134 -0
  2262. package/src/transfer/analyze/step.ts +551 -0
  2263. package/src/transfer/analyze/target.ts +269 -0
  2264. package/src/transfer/analyze/unique-keys.ts +219 -0
  2265. package/src/transfer/analyze/validate.ts +1550 -0
  2266. package/src/transfer/analyze/values.ts +341 -0
  2267. package/src/transfer/analyze/write-rules.ts +204 -0
  2268. package/src/transfer/audit.ts +38 -0
  2269. package/src/transfer/auth.ts +25 -0
  2270. package/src/transfer/container/tar.ts +242 -0
  2271. package/src/transfer/domain.ts +248 -0
  2272. package/src/transfer/errors.ts +134 -0
  2273. package/src/transfer/export/exporter.ts +1067 -0
  2274. package/src/transfer/export/fence.ts +84 -0
  2275. package/src/transfer/export/media.ts +165 -0
  2276. package/src/transfer/export/readers.ts +1168 -0
  2277. package/src/transfer/export/verify.ts +677 -0
  2278. package/src/transfer/fence.ts +193 -0
  2279. package/src/transfer/format/canonical.ts +151 -0
  2280. package/src/transfer/format/column-codec.ts +275 -0
  2281. package/src/transfer/format/columns.ts +727 -0
  2282. package/src/transfer/format/digest.ts +287 -0
  2283. package/src/transfer/format/features.ts +91 -0
  2284. package/src/transfer/format/issues.ts +39 -0
  2285. package/src/transfer/format/kinds.ts +952 -0
  2286. package/src/transfer/format/limits.ts +87 -0
  2287. package/src/transfer/format/manifest.ts +297 -0
  2288. package/src/transfer/format/media-refs.ts +716 -0
  2289. package/src/transfer/format/paths.ts +73 -0
  2290. package/src/transfer/format/plan.ts +162 -0
  2291. package/src/transfer/format/receipt.ts +43 -0
  2292. package/src/transfer/format/records.ts +127 -0
  2293. package/src/transfer/format/settings.ts +94 -0
  2294. package/src/transfer/format/transformations.ts +260 -0
  2295. package/src/transfer/format/version.ts +9 -0
  2296. package/src/transfer/gc.ts +103 -0
  2297. package/src/transfer/import/advance.ts +522 -0
  2298. package/src/transfer/import/context.ts +288 -0
  2299. package/src/transfer/import/entries.ts +186 -0
  2300. package/src/transfer/import/ids.ts +40 -0
  2301. package/src/transfer/import/index.ts +15 -0
  2302. package/src/transfer/import/media.ts +141 -0
  2303. package/src/transfer/import/rebuild.ts +300 -0
  2304. package/src/transfer/import/rows.ts +114 -0
  2305. package/src/transfer/import/scaffold.ts +221 -0
  2306. package/src/transfer/import/sql.ts +134 -0
  2307. package/src/transfer/import/stages.ts +329 -0
  2308. package/src/transfer/import/writers.ts +370 -0
  2309. package/src/transfer/index.ts +472 -0
  2310. package/src/transfer/ops/approvals.ts +359 -0
  2311. package/src/transfer/ops/budget.ts +82 -0
  2312. package/src/transfer/ops/collation.ts +21 -0
  2313. package/src/transfer/ops/identity-map.ts +142 -0
  2314. package/src/transfer/ops/media-blobs.ts +135 -0
  2315. package/src/transfer/ops/operations.ts +842 -0
  2316. package/src/transfer/ops/package-index.ts +159 -0
  2317. package/src/transfer/ops/staged-files.ts +231 -0
  2318. package/src/transfer/ops/states.ts +265 -0
  2319. package/src/transfer/ops/time.ts +54 -0
  2320. package/src/transfer/schema-importer.ts +34 -0
  2321. package/src/transfer/site-id.ts +30 -0
  2322. package/src/transfer/staging/assembler.ts +217 -0
  2323. package/src/transfer/staging/keys.ts +94 -0
  2324. package/src/transfer/staging/package.ts +229 -0
  2325. package/src/transfer/staging/stage.ts +231 -0
  2326. package/src/ui-comments.ts +19 -0
  2327. package/src/ui.ts +26 -3
  2328. package/src/utils/base64.ts +7 -2
  2329. package/src/utils/db-errors.ts +26 -0
  2330. package/src/utils/hash.ts +14 -3
  2331. package/src/utils/init-lock.ts +143 -0
  2332. package/src/utils/single-flight-cache.ts +194 -0
  2333. package/src/utils/slugify.ts +1 -29
  2334. package/src/utils/url.ts +58 -3
  2335. package/src/virtual-modules.d.ts +84 -0
  2336. package/src/visual-editing/action-token.ts +31 -0
  2337. package/src/visual-editing/editable.ts +41 -35
  2338. package/src/visual-editing/toolbar-bootstrap.ts +145 -0
  2339. package/src/visual-editing/toolbar.ts +273 -48
  2340. package/src/widgets/archives.ts +68 -0
  2341. package/src/widgets/index.ts +83 -54
  2342. package/dist/adapters-BKSf3T9R.d.mts +0 -121
  2343. package/dist/adapters-BKSf3T9R.d.mts.map +0 -1
  2344. package/dist/apply-x0eMK1lX.mjs +0 -1528
  2345. package/dist/apply-x0eMK1lX.mjs.map +0 -1
  2346. package/dist/base64-MBPo9ozB.mjs +0 -59
  2347. package/dist/base64-MBPo9ozB.mjs.map +0 -1
  2348. package/dist/byline-Chbr2GoP.mjs +0 -220
  2349. package/dist/byline-Chbr2GoP.mjs.map +0 -1
  2350. package/dist/bylines-CRNsVG88.mjs +0 -157
  2351. package/dist/bylines-CRNsVG88.mjs.map +0 -1
  2352. package/dist/cache-BkKBuIvS.mjs +0 -56
  2353. package/dist/cache-BkKBuIvS.mjs.map +0 -1
  2354. package/dist/chunk-ClPoSABd.mjs +0 -21
  2355. package/dist/chunks-HGz06Soa.mjs +0 -19
  2356. package/dist/chunks-HGz06Soa.mjs.map +0 -1
  2357. package/dist/config-BXwuX8Bx.mjs +0 -47
  2358. package/dist/config-BXwuX8Bx.mjs.map +0 -1
  2359. package/dist/connection-2igzM-AT.mjs +0 -57
  2360. package/dist/connection-2igzM-AT.mjs.map +0 -1
  2361. package/dist/content-BcQPYxdV.mjs +0 -878
  2362. package/dist/content-BcQPYxdV.mjs.map +0 -1
  2363. package/dist/db-errors-l1Qh2RPR.mjs +0 -41
  2364. package/dist/db-errors-l1Qh2RPR.mjs.map +0 -1
  2365. package/dist/default-DCVqE5ib.mjs +0 -81
  2366. package/dist/default-DCVqE5ib.mjs.map +0 -1
  2367. package/dist/dialect-helpers-DhTzaUxP.mjs +0 -93
  2368. package/dist/dialect-helpers-DhTzaUxP.mjs.map +0 -1
  2369. package/dist/error-zG5T1UGA.mjs +0 -27
  2370. package/dist/error-zG5T1UGA.mjs.map +0 -1
  2371. package/dist/index-DIb-CzNx.d.mts +0 -4955
  2372. package/dist/index-DIb-CzNx.d.mts.map +0 -1
  2373. package/dist/load-CyEoextb.mjs +0 -28
  2374. package/dist/load-CyEoextb.mjs.map +0 -1
  2375. package/dist/loader-CndGj8kM.mjs +0 -457
  2376. package/dist/loader-CndGj8kM.mjs.map +0 -1
  2377. package/dist/manifest-schema-DH9xhc6t.mjs +0 -199
  2378. package/dist/manifest-schema-DH9xhc6t.mjs.map +0 -1
  2379. package/dist/media-D8FbNsl0.mjs +0 -197
  2380. package/dist/media-D8FbNsl0.mjs.map +0 -1
  2381. package/dist/mode-BnAOqItE.mjs +0 -23
  2382. package/dist/mode-BnAOqItE.mjs.map +0 -1
  2383. package/dist/patterns-CrCYkMBb.mjs +0 -93
  2384. package/dist/patterns-CrCYkMBb.mjs.map +0 -1
  2385. package/dist/placeholder-C-fk5hYI.mjs +0 -268
  2386. package/dist/placeholder-C-fk5hYI.mjs.map +0 -1
  2387. package/dist/placeholder-D29tWZ7o.d.mts +0 -284
  2388. package/dist/placeholder-D29tWZ7o.d.mts.map +0 -1
  2389. package/dist/query-fqEdLFms.mjs +0 -558
  2390. package/dist/query-fqEdLFms.mjs.map +0 -1
  2391. package/dist/redirect-D_pshWdf.mjs +0 -302
  2392. package/dist/redirect-D_pshWdf.mjs.map +0 -1
  2393. package/dist/registry-C3Mr0ODu.mjs +0 -902
  2394. package/dist/registry-C3Mr0ODu.mjs.map +0 -1
  2395. package/dist/request-cache-Ci7f5pBb.mjs +0 -79
  2396. package/dist/request-cache-Ci7f5pBb.mjs.map +0 -1
  2397. package/dist/runner-OURCaApa.d.mts +0 -34
  2398. package/dist/runner-OURCaApa.d.mts.map +0 -1
  2399. package/dist/runner-tQ7BJ4T7.mjs +0 -1619
  2400. package/dist/runner-tQ7BJ4T7.mjs.map +0 -1
  2401. package/dist/search-BoZYFuUk.mjs +0 -9637
  2402. package/dist/search-BoZYFuUk.mjs.map +0 -1
  2403. package/dist/taxonomies-B4IAshV8.mjs +0 -308
  2404. package/dist/taxonomies-B4IAshV8.mjs.map +0 -1
  2405. package/dist/tokens-D9vnZqYS.mjs +0 -171
  2406. package/dist/tokens-D9vnZqYS.mjs.map +0 -1
  2407. package/dist/transaction-Cn2rjY78.mjs +0 -28
  2408. package/dist/transaction-Cn2rjY78.mjs.map +0 -1
  2409. package/dist/transport-C9ugt2Nr.mjs +0 -418
  2410. package/dist/transport-C9ugt2Nr.mjs.map +0 -1
  2411. package/dist/transport-CUnEL3Vs.d.mts +0 -42
  2412. package/dist/transport-CUnEL3Vs.d.mts.map +0 -1
  2413. package/dist/types-BIgulNsW.mjs +0 -68
  2414. package/dist/types-BIgulNsW.mjs.map +0 -1
  2415. package/dist/types-Bm1dn-q3.mjs +0 -83
  2416. package/dist/types-Bm1dn-q3.mjs.map +0 -1
  2417. package/dist/types-BmPPSUEx.d.mts +0 -243
  2418. package/dist/types-BmPPSUEx.d.mts.map +0 -1
  2419. package/dist/types-BrA0xf5I.d.mts +0 -126
  2420. package/dist/types-BrA0xf5I.d.mts.map +0 -1
  2421. package/dist/types-CS8FIX7L.d.mts +0 -435
  2422. package/dist/types-CS8FIX7L.d.mts.map +0 -1
  2423. package/dist/types-CgqmmMJB.mjs +0 -16
  2424. package/dist/types-CgqmmMJB.mjs.map +0 -1
  2425. package/dist/types-DIMwPFub.d.mts +0 -192
  2426. package/dist/types-DIMwPFub.d.mts.map +0 -1
  2427. package/dist/types-i36XcA_X.d.mts +0 -1252
  2428. package/dist/types-i36XcA_X.d.mts.map +0 -1
  2429. package/dist/validate-CxVsLehf.mjs +0 -328
  2430. package/dist/validate-CxVsLehf.mjs.map +0 -1
  2431. package/dist/validate-DHxmpFJt.d.mts +0 -331
  2432. package/dist/validate-DHxmpFJt.d.mts.map +0 -1
  2433. package/dist/validate-VPnKoIzW.mjs +0 -97
  2434. package/dist/validate-VPnKoIzW.mjs.map +0 -1
  2435. package/dist/validation-C-ZpN2GI.mjs +0 -144
  2436. package/dist/validation-C-ZpN2GI.mjs.map +0 -1
  2437. package/dist/version-DJrV1K0M.mjs +0 -7
  2438. package/dist/version-DJrV1K0M.mjs.map +0 -1
  2439. package/dist/zod-generator-CpwccCIv.mjs +0 -132
  2440. package/dist/zod-generator-CpwccCIv.mjs.map +0 -1
  2441. package/src/cli/commands/auth.ts +0 -46
  2442. package/src/cli/commands/bundle-utils.ts +0 -273
  2443. package/src/cli/commands/bundle.ts +0 -626
  2444. package/src/cli/commands/dev.ts +0 -191
  2445. package/src/cli/commands/plugin-init.ts +0 -291
  2446. package/src/cli/commands/plugin-validate.ts +0 -31
  2447. package/src/cli/commands/plugin.ts +0 -33
  2448. package/src/cli/commands/publish.ts +0 -697
  2449. package/src/plugins/scheduler/piggyback.ts +0 -71
@@ -1,4955 +0,0 @@
1
- import { _ as MediaValue, m as MediaProviderDescriptor } from "./placeholder-D29tWZ7o.mjs";
2
- import { t as Database } from "./types-CS8FIX7L.mjs";
3
- import { a as ContentSeoInput, c as FindManyOptions, d as UpdateContentInput, l as FindManyResult, o as CreateContentInput, r as ContentItem, t as BylineSummary } from "./types-BrA0xf5I.mjs";
4
- import { A as PageMetadataContribution, B as PluginDefinition, D as PageFragmentContribution, H as PluginManifest, J as RequestMeta, O as PageFragmentEvent, W as PluginStorageConfig, X as ResolvedPlugin, a as CommentAfterModerateEvent, g as EmailMessage, h as CronEvent, j as PageMetadataEvent, r as CommentAfterCreateEvent, s as CommentBeforeCreateEvent, tt as StandardPluginDefinition, w as MediaItem$1 } from "./types-i36XcA_X.mjs";
5
- import { a as Collection, b as UpdateFieldInput, c as CollectionWithFields, d as CreateFieldInput, i as SiteSettings, p as Field, r as SiteSettingKey, u as CreateCollectionInput, y as UpdateCollectionInput } from "./types-BmPPSUEx.mjs";
6
- import { d as Storage } from "./types-DIMwPFub.mjs";
7
- import { t as DatabaseDescriptor } from "./adapters-BKSf3T9R.mjs";
8
- import { Kysely } from "kysely";
9
- import { z } from "astro/zod";
10
- import { z as z$1 } from "zod";
11
- import { PortableTextBlock } from "@emdash-cms/gutenberg-to-portable-text";
12
- import { Readable } from "node:stream";
13
- import { LiveLoader } from "astro/loaders";
14
- import * as react from "react";
15
-
16
- //#region src/database/connection.d.ts
17
- interface DatabaseConfig {
18
- url: string;
19
- authToken?: string;
20
- }
21
- declare class EmDashDatabaseError extends Error {
22
- cause?: unknown | undefined;
23
- constructor(message: string, cause?: unknown | undefined);
24
- }
25
- //#endregion
26
- //#region src/database/repositories/content.d.ts
27
- /**
28
- * Repository for content CRUD operations
29
- *
30
- * Content is stored in per-collection tables (ec_posts, ec_pages, etc.)
31
- * Each field becomes a real column in the table.
32
- */
33
- declare class ContentRepository {
34
- private db;
35
- constructor(db: Kysely<Database>);
36
- /**
37
- * Create a new content item
38
- */
39
- create(input: CreateContentInput): Promise<ContentItem>;
40
- /**
41
- * Generate a unique slug for a content item within a collection.
42
- *
43
- * Checks the collection table for existing slugs that match `baseSlug`
44
- * (optionally scoped to a locale) and appends a numeric suffix (`-1`,
45
- * `-2`, etc.) on collision to guarantee uniqueness.
46
- *
47
- * Returns `null` if `baseSlug` is empty after slugification.
48
- */
49
- generateUniqueSlug(type: string, text: string, locale?: string): Promise<string | null>;
50
- /**
51
- * Duplicate a content item
52
- * Creates a new draft copy with "(Copy)" appended to the title.
53
- * A slug is auto-generated from the new title by the handler layer.
54
- */
55
- duplicate(type: string, id: string, authorId?: string): Promise<ContentItem>;
56
- /**
57
- * Find content by ID
58
- */
59
- findById(type: string, id: string): Promise<ContentItem | null>;
60
- /**
61
- * Find content by id, including trashed (soft-deleted) items.
62
- * Used by restore endpoint for ownership checks.
63
- */
64
- findByIdIncludingTrashed(type: string, id: string): Promise<ContentItem | null>;
65
- /**
66
- * Find content by ID or slug. Tries ID first if it looks like a ULID,
67
- * otherwise tries slug. Falls back to the other if the first lookup misses.
68
- */
69
- findByIdOrSlug(type: string, identifier: string, locale?: string): Promise<ContentItem | null>;
70
- /**
71
- * Find content by ID or slug, including trashed (soft-deleted) items.
72
- * Used by restore/permanent-delete endpoints.
73
- */
74
- findByIdOrSlugIncludingTrashed(type: string, identifier: string, locale?: string): Promise<ContentItem | null>;
75
- private _findByIdOrSlug;
76
- /**
77
- * Find content by slug
78
- */
79
- findBySlug(type: string, slug: string, locale?: string): Promise<ContentItem | null>;
80
- /**
81
- * Find content by slug, including trashed (soft-deleted) items.
82
- * Used by restore/permanent-delete endpoints.
83
- */
84
- findBySlugIncludingTrashed(type: string, slug: string, locale?: string): Promise<ContentItem | null>;
85
- /**
86
- * Find many content items with filtering and pagination
87
- */
88
- findMany(type: string, options?: FindManyOptions): Promise<FindManyResult<ContentItem>>;
89
- /**
90
- * Update content
91
- */
92
- update(type: string, id: string, input: UpdateContentInput): Promise<ContentItem>;
93
- /**
94
- * Delete content (soft delete - moves to trash)
95
- */
96
- delete(type: string, id: string): Promise<boolean>;
97
- /**
98
- * Restore content from trash
99
- */
100
- restore(type: string, id: string): Promise<boolean>;
101
- /**
102
- * Permanently delete content (cannot be undone)
103
- */
104
- permanentDelete(type: string, id: string): Promise<boolean>;
105
- /**
106
- * Find trashed content items
107
- */
108
- findTrashed(type: string, options?: Omit<FindManyOptions, "where">): Promise<FindManyResult<ContentItem & {
109
- deletedAt: string;
110
- }>>;
111
- /**
112
- * Count trashed content items
113
- */
114
- countTrashed(type: string): Promise<number>;
115
- /**
116
- * Count content items
117
- */
118
- count(type: string, where?: {
119
- status?: string;
120
- authorId?: string;
121
- locale?: string;
122
- }): Promise<number>;
123
- getStats(type: string): Promise<{
124
- total: number;
125
- published: number;
126
- draft: number;
127
- }>;
128
- /**
129
- * Schedule content for future publishing
130
- *
131
- * Sets status to 'scheduled' and stores the scheduled publish time.
132
- * The content will be auto-published when the scheduled time is reached.
133
- */
134
- schedule(type: string, id: string, scheduledAt: string): Promise<ContentItem>;
135
- /**
136
- * Unschedule content
137
- *
138
- * Clears the scheduled time. Published posts stay published;
139
- * draft/scheduled posts revert to 'draft'.
140
- */
141
- unschedule(type: string, id: string): Promise<ContentItem>;
142
- /**
143
- * Find content that is ready to be published
144
- *
145
- * Returns all content where scheduled_at <= now, regardless of status.
146
- * This covers both draft-scheduled posts (status='scheduled') and
147
- * published posts with scheduled draft changes (status='published').
148
- */
149
- findReadyToPublish(type: string): Promise<ContentItem[]>;
150
- /**
151
- * Find all translations in a translation group
152
- */
153
- findTranslations(type: string, translationGroup: string): Promise<ContentItem[]>;
154
- /**
155
- * Publish the current draft
156
- *
157
- * Promotes draft_revision_id to live_revision_id and clears draft pointer.
158
- * Syncs the draft revision's data into the content table columns so the
159
- * content table always reflects the published version.
160
- * If no draft revision exists, creates one from current data and publishes it.
161
- */
162
- publish(type: string, id: string): Promise<ContentItem>;
163
- /**
164
- * Unpublish content
165
- *
166
- * Removes live pointer but preserves draft. If no draft exists,
167
- * creates one from the live version so the content isn't lost.
168
- */
169
- unpublish(type: string, id: string): Promise<ContentItem>;
170
- /**
171
- * Set the draft revision pointer for a content item.
172
- *
173
- * Used by seed/import paths that stage a new revision's data before
174
- * promoting it to live via `publish()`.
175
- *
176
- * Validates that the content item exists and is not soft-deleted, that
177
- * the revision exists, and that the revision belongs to the same
178
- * collection and entry. Without these checks, a caller could leave the
179
- * content row pointing at a missing or unrelated revision.
180
- */
181
- setDraftRevision(type: string, id: string, revisionId: string): Promise<void>;
182
- /**
183
- * Discard pending draft changes
184
- *
185
- * Clears draft_revision_id. The content table columns already hold the
186
- * published version, so no data sync is needed.
187
- */
188
- discardDraft(type: string, id: string): Promise<ContentItem>;
189
- /**
190
- * Sync data columns in the content table from a data object.
191
- * Used to promote revision data into the content table on publish.
192
- * Keys starting with _ are revision metadata (e.g. _slug) and are skipped.
193
- */
194
- private syncDataColumns;
195
- /**
196
- * Count content items with a pending schedule.
197
- * Includes both draft-scheduled (status='scheduled') and published
198
- * posts with scheduled draft changes (status='published', scheduled_at set).
199
- */
200
- countScheduled(type: string): Promise<number>;
201
- /**
202
- * Map database row to ContentItem
203
- * Extracts system columns and puts content fields in data
204
- * Excludes null values from data to match input semantics
205
- */
206
- private mapRow;
207
- /**
208
- * Map order field names to database columns.
209
- * Only allows known fields to prevent column enumeration via crafted orderBy values.
210
- */
211
- private mapOrderField;
212
- }
213
- //#endregion
214
- //#region src/database/repositories/media.d.ts
215
- type MediaStatus = "pending" | "ready" | "failed";
216
- interface MediaItem {
217
- id: string;
218
- filename: string;
219
- mimeType: string;
220
- size: number | null;
221
- width: number | null;
222
- height: number | null;
223
- alt: string | null;
224
- caption: string | null;
225
- storageKey: string;
226
- status: MediaStatus;
227
- contentHash: string | null;
228
- blurhash: string | null;
229
- dominantColor: string | null;
230
- createdAt: string;
231
- authorId: string | null;
232
- }
233
- interface CreateMediaInput {
234
- filename: string;
235
- mimeType: string;
236
- size?: number;
237
- width?: number;
238
- height?: number;
239
- alt?: string;
240
- caption?: string;
241
- storageKey: string;
242
- contentHash?: string;
243
- blurhash?: string;
244
- dominantColor?: string;
245
- status?: MediaStatus;
246
- authorId?: string;
247
- }
248
- interface FindManyMediaOptions {
249
- limit?: number;
250
- cursor?: string;
251
- mimeType?: string;
252
- status?: MediaStatus | "all";
253
- }
254
- /**
255
- * Media repository for database operations
256
- */
257
- declare class MediaRepository {
258
- private db;
259
- constructor(db: Kysely<Database>);
260
- /**
261
- * Create a new media item
262
- */
263
- create(input: CreateMediaInput): Promise<MediaItem>;
264
- /**
265
- * Create a pending media item (for signed URL upload flow)
266
- */
267
- createPending(input: {
268
- filename: string;
269
- mimeType: string;
270
- size?: number;
271
- storageKey: string;
272
- contentHash?: string;
273
- authorId?: string;
274
- }): Promise<MediaItem>;
275
- /**
276
- * Confirm upload (mark as ready)
277
- */
278
- confirmUpload(id: string, metadata?: {
279
- width?: number;
280
- height?: number;
281
- size?: number;
282
- }): Promise<MediaItem | null>;
283
- /**
284
- * Mark upload as failed
285
- */
286
- markFailed(id: string): Promise<MediaItem | null>;
287
- /**
288
- * Find media by ID
289
- */
290
- findById(id: string): Promise<MediaItem | null>;
291
- /**
292
- * Find media by filename
293
- * Useful for idempotent imports
294
- */
295
- findByFilename(filename: string): Promise<MediaItem | null>;
296
- /**
297
- * Find media by content hash
298
- * Used for deduplication - same content = same hash
299
- */
300
- findByContentHash(contentHash: string): Promise<MediaItem | null>;
301
- /**
302
- * Find many media items with cursor pagination
303
- *
304
- * Uses keyset pagination (cursor-based) for consistent results.
305
- * The cursor encodes the created_at and id of the last item.
306
- */
307
- findMany(options?: FindManyMediaOptions): Promise<FindManyResult<MediaItem>>;
308
- /**
309
- * Update media metadata
310
- */
311
- update(id: string, input: Partial<Pick<CreateMediaInput, "alt" | "caption" | "width" | "height">>): Promise<MediaItem | null>;
312
- /**
313
- * Delete media item
314
- */
315
- delete(id: string): Promise<boolean>;
316
- /**
317
- * Count media items
318
- */
319
- count(mimeType?: string): Promise<number>;
320
- /**
321
- * Delete pending uploads older than the given age.
322
- * Pending uploads that were never confirmed indicate abandoned upload flows.
323
- *
324
- * Returns the storage keys of deleted rows so callers can remove the
325
- * corresponding files from object storage.
326
- */
327
- cleanupPendingUploads(maxAgeMs?: number): Promise<string[]>;
328
- /**
329
- * Convert database row to MediaItem
330
- */
331
- private rowToItem;
332
- }
333
- //#endregion
334
- //#region src/database/repositories/revision.d.ts
335
- interface Revision {
336
- id: string;
337
- collection: string;
338
- entryId: string;
339
- data: Record<string, unknown>;
340
- authorId: string | null;
341
- createdAt: string;
342
- }
343
- //#endregion
344
- //#region src/database/repositories/comment.d.ts
345
- /** Public-facing comment shape — no private fields */
346
- interface PublicComment {
347
- id: string;
348
- parentId: string | null;
349
- authorName: string;
350
- isRegisteredUser: boolean;
351
- body: string;
352
- createdAt: string;
353
- replies?: PublicComment[];
354
- }
355
- //#endregion
356
- //#region src/database/repositories/byline.d.ts
357
- interface ContentBylineInput {
358
- bylineId: string;
359
- roleLabel?: string | null;
360
- }
361
- //#endregion
362
- //#region src/fields/types.d.ts
363
- /**
364
- * SQLite column types that map from field types
365
- */
366
- type ColumnType = "TEXT" | "REAL" | "INTEGER" | "JSON";
367
- /**
368
- * Base field definition
369
- *
370
- * Note: schema uses z.ZodTypeAny to accommodate optional/default wrappers
371
- */
372
- interface FieldDefinition<_T = unknown> {
373
- type: string;
374
- /**
375
- * The SQLite column type to use when storing this field
376
- */
377
- columnType: ColumnType;
378
- schema: z.ZodTypeAny;
379
- options?: unknown;
380
- ui?: FieldUIHints;
381
- }
382
- /**
383
- * UI hints for admin rendering
384
- */
385
- interface FieldUIHints {
386
- widget?: string;
387
- placeholder?: string;
388
- helpText?: string;
389
- rows?: number;
390
- min?: number | string;
391
- max?: number | string;
392
- [key: string]: unknown;
393
- }
394
- /**
395
- * Portable Text block structure
396
- */
397
- interface PortableTextBlock$2 {
398
- _type: string;
399
- _key: string;
400
- [key: string]: unknown;
401
- }
402
- /**
403
- * @deprecated Use MediaValue instead. ImageValue is an alias for backwards compatibility.
404
- */
405
- type ImageValue = MediaValue;
406
- /**
407
- * File field value
408
- */
409
- interface FileValue {
410
- id: string;
411
- url: string;
412
- filename: string;
413
- mimeType: string;
414
- size: number;
415
- }
416
- //#endregion
417
- //#region src/fields/image.d.ts
418
- /**
419
- * Image field
420
- * References media items from the media library
421
- */
422
- declare function image(options?: {
423
- required?: boolean;
424
- maxSize?: number;
425
- allowedTypes?: string[];
426
- }): FieldDefinition<ImageValue | undefined>;
427
- //#endregion
428
- //#region src/fields/reference.d.ts
429
- /**
430
- * Reference field
431
- * References another content item by ID
432
- */
433
- declare function reference(collection: string, options?: {
434
- required?: boolean;
435
- }): FieldDefinition<string | undefined>;
436
- //#endregion
437
- //#region src/fields/portable-text.d.ts
438
- /**
439
- * Portable Text field
440
- * Stores structured content in Portable Text format
441
- */
442
- declare function portableText(options?: {
443
- required?: boolean;
444
- }): FieldDefinition<PortableTextBlock$2[] | undefined>;
445
- //#endregion
446
- //#region src/api/types.d.ts
447
- /**
448
- * List response with cursor pagination
449
- */
450
- interface ListResponse<T> {
451
- items: T[];
452
- nextCursor?: string;
453
- }
454
- /**
455
- * Content API responses
456
- */
457
- interface ContentListResponse extends ListResponse<ContentItem> {}
458
- interface ContentResponse {
459
- item: ContentItem;
460
- /** Opaque revision token for optimistic concurrency */
461
- _rev?: string;
462
- }
463
- /**
464
- * Manifest API response
465
- */
466
- interface ManifestResponse {
467
- version: string;
468
- hash: string;
469
- collections: Record<string, {
470
- label: string;
471
- labelSingular: string;
472
- supports: string[];
473
- fields: Record<string, FieldDescriptor>;
474
- }>;
475
- plugins: Record<string, {
476
- adminPages?: Array<{
477
- path: string;
478
- component: string;
479
- }>;
480
- widgets?: string[];
481
- }>;
482
- }
483
- interface FieldDescriptor {
484
- kind: string;
485
- label?: string;
486
- required?: boolean;
487
- options?: Array<{
488
- value: string;
489
- label: string;
490
- }>;
491
- }
492
- /**
493
- * Discriminated union for handler results.
494
- *
495
- * Handlers return `ApiResult<T>` -- either `{ success: true, data: T }` or
496
- * `{ success: false, error: { code, message } }`. The `success` literal
497
- * enables TypeScript narrowing on `.data`.
498
- *
499
- * The generic `E` parameter defaults to `ErrorCode` but can be narrowed to
500
- * `OAuthErrorCode` for OAuth token-endpoint handlers.
501
- *
502
- * Use `unwrapResult()` from `error.ts` to convert to an HTTP Response.
503
- */
504
- type ApiResult<T, E extends string = string> = {
505
- success: true;
506
- data: T;
507
- } | {
508
- success: false;
509
- error: {
510
- code: E;
511
- message: string;
512
- details?: Record<string, unknown>;
513
- };
514
- };
515
- /**
516
- * API request context
517
- */
518
- interface ApiContext {
519
- userId?: string;
520
- userRole?: string;
521
- }
522
- //#endregion
523
- //#region src/api/handlers/content.d.ts
524
- /**
525
- * Trashed content item with deletion timestamp
526
- */
527
- interface TrashedContentItem {
528
- id: string;
529
- type: string;
530
- slug: string | null;
531
- status: string;
532
- data: Record<string, unknown>;
533
- authorId: string | null;
534
- createdAt: string;
535
- updatedAt: string;
536
- publishedAt: string | null;
537
- deletedAt: string;
538
- }
539
- /**
540
- * Create content list handler
541
- */
542
- declare function handleContentList(db: Kysely<Database>, collection: string, params: {
543
- cursor?: string;
544
- limit?: number;
545
- status?: string;
546
- orderBy?: string;
547
- order?: "asc" | "desc";
548
- locale?: string;
549
- }): Promise<ApiResult<ContentListResponse>>;
550
- /**
551
- * Get single content item
552
- */
553
- declare function handleContentGet(db: Kysely<Database>, collection: string, id: string, locale?: string): Promise<ApiResult<ContentResponse>>;
554
- /**
555
- * Get a content item by id, including trashed items.
556
- * Used by restore endpoint for ownership checks on soft-deleted items.
557
- */
558
- declare function handleContentGetIncludingTrashed(db: Kysely<Database>, collection: string, id: string, locale?: string): Promise<ApiResult<ContentResponse>>;
559
- /**
560
- * Create content item.
561
- *
562
- * Content + SEO writes are wrapped in a transaction so either both succeed
563
- * or neither does. If `body.seo` is provided for a non-SEO collection, the
564
- * API returns a validation error rather than silently dropping it.
565
- */
566
- declare function handleContentCreate(db: Kysely<Database>, collection: string, body: {
567
- data: Record<string, unknown>;
568
- slug?: string;
569
- status?: string;
570
- authorId?: string;
571
- bylines?: ContentBylineInput[];
572
- locale?: string;
573
- translationOf?: string;
574
- seo?: ContentSeoInput;
575
- createdAt?: string | null;
576
- publishedAt?: string | null;
577
- }): Promise<ApiResult<ContentResponse>>;
578
- /**
579
- * Update content item.
580
- * If `_rev` is provided, validates it against the current version before writing.
581
- * No `_rev` = blind write (backwards-compatible for admin UI).
582
- *
583
- * Content + SEO writes are wrapped in a transaction for atomicity.
584
- */
585
- declare function handleContentUpdate(db: Kysely<Database>, collection: string, id: string, body: {
586
- data?: Record<string, unknown>;
587
- slug?: string;
588
- status?: string;
589
- authorId?: string | null;
590
- bylines?: ContentBylineInput[];
591
- _rev?: string;
592
- seo?: ContentSeoInput;
593
- publishedAt?: string | null;
594
- }): Promise<ApiResult<ContentResponse>>;
595
- /**
596
- * Duplicate content item.
597
- *
598
- * Only copies SEO data if the collection has SEO enabled.
599
- * Always returns consistent `seo` shape for SEO-enabled collections.
600
- */
601
- declare function handleContentDuplicate(db: Kysely<Database>, collection: string, id: string, authorId?: string): Promise<ApiResult<{
602
- item: ContentItem;
603
- }>>;
604
- /**
605
- * Delete content item (soft delete - moves to trash)
606
- */
607
- declare function handleContentDelete(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<{
608
- deleted: true;
609
- }>>;
610
- /**
611
- * Restore content item from trash
612
- */
613
- declare function handleContentRestore(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<{
614
- restored: true;
615
- }>>;
616
- /**
617
- * Permanently delete content item (cannot be undone).
618
- * Also cleans up associated SEO data.
619
- */
620
- declare function handleContentPermanentDelete(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<{
621
- deleted: true;
622
- }>>;
623
- /**
624
- * List trashed content items
625
- */
626
- declare function handleContentListTrashed(db: Kysely<Database>, collection: string, options?: {
627
- limit?: number;
628
- cursor?: string;
629
- }): Promise<ApiResult<{
630
- items: TrashedContentItem[];
631
- nextCursor?: string;
632
- }>>;
633
- /**
634
- * Count trashed content items
635
- */
636
- declare function handleContentCountTrashed(db: Kysely<Database>, collection: string): Promise<ApiResult<{
637
- count: number;
638
- }>>;
639
- /**
640
- * Schedule content for future publishing
641
- */
642
- declare function handleContentSchedule(db: Kysely<Database>, collection: string, id: string, scheduledAt: string): Promise<ApiResult<ContentResponse>>;
643
- /**
644
- * Unschedule content (revert to draft)
645
- */
646
- declare function handleContentUnschedule(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<ContentResponse>>;
647
- /**
648
- * Publish content immediately.
649
- *
650
- * Wrapped in a transaction because publish performs multiple writes
651
- * (syncDataColumns, slug sync, status/revision update) that must
652
- * be atomic to prevent FTS shadow table corruption on crash.
653
- */
654
- declare function handleContentPublish(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<ContentResponse>>;
655
- /**
656
- * Unpublish content (revert to draft).
657
- *
658
- * Wrapped in a transaction — unpublish may create a draft revision
659
- * from the live version then update the status, which is multi-step.
660
- */
661
- declare function handleContentUnpublish(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<ContentResponse>>;
662
- /**
663
- * Count scheduled content items
664
- */
665
- declare function handleContentCountScheduled(db: Kysely<Database>, collection: string): Promise<ApiResult<{
666
- count: number;
667
- }>>;
668
- /**
669
- * Discard draft changes (revert to live version)
670
- */
671
- declare function handleContentDiscardDraft(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<ContentResponse>>;
672
- /**
673
- * Compare live and draft revisions
674
- */
675
- declare function handleContentCompare(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<{
676
- hasChanges: boolean;
677
- live: Record<string, unknown> | null;
678
- draft: Record<string, unknown> | null;
679
- }>>;
680
- /**
681
- * Get all translations for a content item.
682
- * Returns the item's translation group members with locale and status info.
683
- */
684
- declare function handleContentTranslations(db: Kysely<Database>, collection: string, id: string): Promise<ApiResult<{
685
- translationGroup: string;
686
- translations: Array<{
687
- id: string;
688
- locale: string | null;
689
- slug: string | null;
690
- status: string;
691
- updatedAt: string;
692
- }>;
693
- }>>;
694
- //#endregion
695
- //#region src/api/handlers/manifest.d.ts
696
- interface CollectionDefinition {
697
- schema: {
698
- _def?: {
699
- shape?: () => Record<string, unknown>;
700
- };
701
- shape?: Record<string, unknown>;
702
- };
703
- admin: {
704
- label: string;
705
- labelSingular?: string;
706
- supports?: string[];
707
- };
708
- }
709
- type CollectionMap = Record<string, CollectionDefinition>;
710
- /**
711
- * Generate admin manifest from collections
712
- */
713
- declare function generateManifest(collections: CollectionMap, plugins?: Record<string, {
714
- adminPages?: Array<{
715
- path: string;
716
- component: string;
717
- }>;
718
- widgets?: string[];
719
- }>): Promise<ManifestResponse>;
720
- //#endregion
721
- //#region src/api/handlers/revision.d.ts
722
- interface RevisionListResponse {
723
- items: Revision[];
724
- total: number;
725
- }
726
- interface RevisionResponse {
727
- item: Revision;
728
- }
729
- /**
730
- * List revisions for a content entry
731
- */
732
- declare function handleRevisionList(db: Kysely<Database>, collection: string, entryId: string, params?: {
733
- limit?: number;
734
- }): Promise<ApiResult<RevisionListResponse>>;
735
- /**
736
- * Get a specific revision
737
- */
738
- declare function handleRevisionGet(db: Kysely<Database>, revisionId: string): Promise<ApiResult<RevisionResponse>>;
739
- /**
740
- * Restore a revision (updates content to this revision's data and creates new revision)
741
- */
742
- declare function handleRevisionRestore(db: Kysely<Database>, revisionId: string, callerUserId: string): Promise<ApiResult<ContentResponse>>;
743
- //#endregion
744
- //#region src/api/handlers/media.d.ts
745
- interface MediaListResponse {
746
- items: MediaItem[];
747
- nextCursor?: string;
748
- }
749
- interface MediaResponse {
750
- item: MediaItem;
751
- }
752
- /**
753
- * List media items
754
- */
755
- declare function handleMediaList(db: Kysely<Database>, params: {
756
- cursor?: string;
757
- limit?: number;
758
- mimeType?: string;
759
- }): Promise<ApiResult<MediaListResponse>>;
760
- /**
761
- * Get single media item
762
- */
763
- declare function handleMediaGet(db: Kysely<Database>, id: string): Promise<ApiResult<MediaResponse>>;
764
- /**
765
- * Create media item (after file upload)
766
- */
767
- declare function handleMediaCreate(db: Kysely<Database>, input: {
768
- filename: string;
769
- mimeType: string;
770
- size?: number;
771
- width?: number;
772
- height?: number;
773
- alt?: string;
774
- storageKey: string;
775
- contentHash?: string;
776
- blurhash?: string;
777
- dominantColor?: string;
778
- authorId?: string;
779
- }): Promise<ApiResult<MediaResponse>>;
780
- /**
781
- * Update media metadata
782
- */
783
- declare function handleMediaUpdate(db: Kysely<Database>, id: string, input: {
784
- alt?: string;
785
- caption?: string;
786
- width?: number;
787
- height?: number;
788
- }): Promise<ApiResult<MediaResponse>>;
789
- /**
790
- * Delete media item
791
- */
792
- declare function handleMediaDelete(db: Kysely<Database>, id: string): Promise<ApiResult<{
793
- deleted: true;
794
- }>>;
795
- //#endregion
796
- //#region src/schema/registry.d.ts
797
- /**
798
- * Error thrown when a schema operation fails
799
- */
800
- declare class SchemaError extends Error {
801
- code: string;
802
- details?: Record<string, unknown> | undefined;
803
- constructor(message: string, code: string, details?: Record<string, unknown> | undefined);
804
- }
805
- /**
806
- * Schema Registry
807
- *
808
- * Manages collection and field definitions stored in D1.
809
- * Handles runtime DDL operations (CREATE TABLE, ALTER TABLE).
810
- */
811
- declare class SchemaRegistry {
812
- private db;
813
- constructor(db: Kysely<Database>);
814
- /**
815
- * List all collections
816
- */
817
- listCollections(): Promise<Collection[]>;
818
- /**
819
- * Get a collection by slug
820
- */
821
- getCollection(slug: string): Promise<Collection | null>;
822
- /**
823
- * Get a collection with all its fields
824
- */
825
- getCollectionWithFields(slug: string): Promise<CollectionWithFields | null>;
826
- /**
827
- * Create a new collection
828
- */
829
- createCollection(input: CreateCollectionInput): Promise<Collection>;
830
- /**
831
- * Update a collection
832
- */
833
- updateCollection(slug: string, input: UpdateCollectionInput): Promise<Collection>;
834
- /**
835
- * Delete a collection
836
- */
837
- deleteCollection(slug: string, options?: {
838
- force?: boolean;
839
- }): Promise<void>;
840
- /**
841
- * List fields for a collection
842
- */
843
- listFields(collectionId: string): Promise<Field[]>;
844
- /**
845
- * Get a field by slug within a collection
846
- */
847
- getField(collectionSlug: string, fieldSlug: string): Promise<Field | null>;
848
- /**
849
- * Create a new field
850
- */
851
- createField(collectionSlug: string, input: CreateFieldInput): Promise<Field>;
852
- /**
853
- * Update a field
854
- */
855
- updateField(collectionSlug: string, fieldSlug: string, input: UpdateFieldInput): Promise<Field>;
856
- /**
857
- * Synchronize an existing FTS index with the collection's current state.
858
- *
859
- * Only rebuilds or disables — never first-time enables. First-time FTS
860
- * enablement is handled by the seed's explicit enableSearch call (which
861
- * is try-caught) or the admin UI toggle.
862
- *
863
- * - FTS active + still has search support and searchable fields → rebuild
864
- * - FTS active + lost search support or no searchable fields → disable
865
- * - FTS not active → no-op
866
- *
867
- * Pass `db` when calling from within a transaction so FTS operations
868
- * participate in the same transaction and are rolled back on failure.
869
- */
870
- private syncSearchState;
871
- /**
872
- * Delete a field
873
- */
874
- deleteField(collectionSlug: string, fieldSlug: string): Promise<void>;
875
- /**
876
- * Reorder fields
877
- */
878
- reorderFields(collectionSlug: string, fieldSlugs: string[]): Promise<void>;
879
- /**
880
- * Create a content table for a collection
881
- */
882
- private createContentTable;
883
- /**
884
- * Add a column to a content table
885
- */
886
- private addColumn;
887
- /**
888
- * Drop a column from a content table
889
- */
890
- private dropColumn;
891
- /**
892
- * Check if a collection has any content
893
- */
894
- private collectionHasContent;
895
- /**
896
- * Get table name for a collection
897
- */
898
- private getTableName;
899
- /**
900
- * Get column name for a field
901
- */
902
- private getColumnName;
903
- /**
904
- * Validate a slug
905
- */
906
- private validateSlug;
907
- /**
908
- * Format a default value for SQL.
909
- *
910
- * SQLite `ALTER TABLE ADD COLUMN ... DEFAULT` requires a literal constant
911
- * expression — parameterized values cannot be used here. We manually escape
912
- * single quotes and coerce types to ensure the output is safe.
913
- *
914
- * INTEGER/REAL values are coerced through `Number()` which can only produce
915
- * digits, `.`, `-`, `e`, `Infinity`, or `NaN` — all safe in SQL.
916
- * TEXT/JSON values have single quotes escaped via SQL standard doubling (`''`).
917
- */
918
- private formatDefaultValue;
919
- /**
920
- * Get empty default for a field type
921
- */
922
- private getEmptyDefault;
923
- /**
924
- * Map a collection row to a Collection object
925
- */
926
- private mapCollectionRow;
927
- /**
928
- * Map a field row to a Field object
929
- */
930
- private mapFieldRow;
931
- /**
932
- * Discover orphaned content tables
933
- *
934
- * Finds ec_* tables that exist in the database but don't have a
935
- * corresponding entry in _emdash_collections.
936
- */
937
- discoverOrphanedTables(): Promise<Array<{
938
- slug: string;
939
- tableName: string;
940
- rowCount: number;
941
- }>>;
942
- /**
943
- * Register an orphaned table as a collection
944
- *
945
- * Creates a _emdash_collections entry for an existing ec_* table.
946
- */
947
- registerOrphanedTable(slug: string, options?: {
948
- label?: string;
949
- labelSingular?: string;
950
- description?: string;
951
- }): Promise<Collection>;
952
- /**
953
- * Convert slug to human-readable label
954
- */
955
- private slugToLabel;
956
- }
957
- //#endregion
958
- //#region src/schema/query.d.ts
959
- /**
960
- * Get collection metadata by slug.
961
- *
962
- * @example
963
- * ```ts
964
- * import { getCollectionInfo } from "emdash";
965
- *
966
- * const info = await getCollectionInfo("posts");
967
- * if (info?.commentsEnabled) {
968
- * // render comment UI
969
- * }
970
- * ```
971
- */
972
- declare function getCollectionInfo(slug: string): Promise<Collection | null>;
973
- //#endregion
974
- //#region src/sections/types.d.ts
975
- /**
976
- * Section source types
977
- */
978
- type SectionSource = "theme" | "user" | "import";
979
- /**
980
- * Section as returned to templates/admin
981
- */
982
- interface Section {
983
- id: string;
984
- slug: string;
985
- title: string;
986
- description?: string;
987
- keywords: string[];
988
- content: PortableTextBlock$2[];
989
- previewUrl?: string;
990
- source: SectionSource;
991
- themeId?: string;
992
- createdAt: string;
993
- updatedAt: string;
994
- }
995
- /**
996
- * Input for creating a section
997
- */
998
- interface CreateSectionInput {
999
- slug: string;
1000
- title: string;
1001
- description?: string;
1002
- keywords?: string[];
1003
- content: PortableTextBlock$2[];
1004
- previewMediaId?: string;
1005
- source?: SectionSource;
1006
- themeId?: string;
1007
- }
1008
- /**
1009
- * Input for updating a section
1010
- */
1011
- interface UpdateSectionInput {
1012
- slug?: string;
1013
- title?: string;
1014
- description?: string;
1015
- keywords?: string[];
1016
- content?: PortableTextBlock$2[];
1017
- previewMediaId?: string | null;
1018
- }
1019
- /**
1020
- * Options for querying sections
1021
- */
1022
- interface GetSectionsOptions {
1023
- /** Filter by source */
1024
- source?: SectionSource;
1025
- /** Search title, description, keywords */
1026
- search?: string;
1027
- /** Limit results */
1028
- limit?: number;
1029
- /** Cursor for pagination */
1030
- cursor?: string;
1031
- }
1032
- //#endregion
1033
- //#region src/sections/index.d.ts
1034
- /**
1035
- * Get a section by slug
1036
- *
1037
- * @example
1038
- * ```ts
1039
- * import { getSection } from "emdash";
1040
- *
1041
- * const section = await getSection("hero-centered");
1042
- * if (section) {
1043
- * console.log(section.content); // Portable Text array
1044
- * }
1045
- * ```
1046
- */
1047
- declare function getSection(slug: string): Promise<Section | null>;
1048
- /**
1049
- * Get all sections with optional filtering
1050
- *
1051
- * @example
1052
- * ```ts
1053
- * import { getSections } from "emdash";
1054
- *
1055
- * // Get all theme-provided sections
1056
- * const themeSections = await getSections({ source: "theme" });
1057
- *
1058
- * // Search sections
1059
- * const results = await getSections({ search: "pricing" });
1060
- * ```
1061
- */
1062
- declare function getSections(options?: GetSectionsOptions): Promise<FindManyResult<Section>>;
1063
- //#endregion
1064
- //#region src/plugins/sandbox/types.d.ts
1065
- /**
1066
- * Resource limits for sandboxed plugins.
1067
- * Enforced by the sandbox runtime (e.g., Worker Loader).
1068
- */
1069
- interface ResourceLimits {
1070
- /** CPU time per invocation in milliseconds (default: 50ms) */
1071
- cpuMs?: number;
1072
- /** Memory limit in MB (default: 128MB) */
1073
- memoryMb?: number;
1074
- /** Maximum subrequests per invocation (default: 10) */
1075
- subrequests?: number;
1076
- /** Wall-clock time limit in milliseconds (default: 30000ms) */
1077
- wallTimeMs?: number;
1078
- }
1079
- /**
1080
- * Storage interface for loading plugin code.
1081
- * Could be R2, local filesystem, or any other storage backend.
1082
- */
1083
- interface PluginCodeStorage {
1084
- /** Get plugin bundle code by path */
1085
- get(path: string): Promise<string | null>;
1086
- /** Check if a bundle exists */
1087
- exists(path: string): Promise<boolean>;
1088
- }
1089
- /**
1090
- * Serialized email message for sandbox RPC transport.
1091
- * Matches the core EmailMessage type but uses only serializable fields.
1092
- */
1093
- interface SandboxEmailMessage {
1094
- to: string;
1095
- subject: string;
1096
- text: string;
1097
- html?: string;
1098
- }
1099
- /**
1100
- * Callback for sending email from a sandboxed plugin.
1101
- * The sandbox runner wires this up from the EmailPipeline.
1102
- *
1103
- * @param message - The email message to send
1104
- * @param pluginId - The sending plugin's ID (used as source)
1105
- */
1106
- type SandboxEmailSendCallback = (message: SandboxEmailMessage, pluginId: string) => Promise<void>;
1107
- /**
1108
- * Options for creating a sandbox runner
1109
- */
1110
- interface SandboxOptions {
1111
- /** Storage interface for loading plugin code */
1112
- storage?: PluginCodeStorage;
1113
- /** Database for bridge operations */
1114
- db: Kysely<Database>;
1115
- /** Default resource limits */
1116
- limits?: ResourceLimits;
1117
- /** Site info for plugin context (injected into wrapper at generation time) */
1118
- siteInfo?: {
1119
- name: string;
1120
- url: string;
1121
- locale: string;
1122
- };
1123
- /** Email send callback, wired from the EmailPipeline by the runtime */
1124
- emailSend?: SandboxEmailSendCallback;
1125
- }
1126
- /**
1127
- * A sandboxed plugin instance.
1128
- * Provides methods to invoke hooks and routes in the isolated environment.
1129
- */
1130
- interface SandboxedPlugin {
1131
- /** Unique identifier: `${manifest.id}:${manifest.version}` */
1132
- readonly id: string;
1133
- /**
1134
- * Invoke a hook in the sandboxed plugin.
1135
- *
1136
- * @param hookName - Name of the hook (e.g., "content:beforeSave")
1137
- * @param event - Event data to pass to the hook
1138
- * @returns Hook result (transformed content, void, etc.)
1139
- */
1140
- invokeHook(hookName: string, event: unknown): Promise<unknown>;
1141
- /**
1142
- * Invoke an API route in the sandboxed plugin.
1143
- *
1144
- * @param routeName - Name of the route
1145
- * @param input - Validated input data
1146
- * @param request - Serialized request info for context
1147
- * @returns Route response data
1148
- */
1149
- invokeRoute(routeName: string, input: unknown, request: SerializedRequest): Promise<unknown>;
1150
- /**
1151
- * Terminate the sandboxed plugin.
1152
- * Releases resources and prevents further invocations.
1153
- */
1154
- terminate(): Promise<void>;
1155
- }
1156
- /**
1157
- * Serialized request for RPC transport.
1158
- * Worker Loader can't pass Request objects directly.
1159
- */
1160
- interface SerializedRequest {
1161
- url: string;
1162
- method: string;
1163
- headers: Record<string, string>;
1164
- /** Normalized request metadata extracted before RPC serialization */
1165
- meta: RequestMeta;
1166
- }
1167
- /**
1168
- * Sandbox runner interface.
1169
- * Platform adapters implement this to provide plugin isolation.
1170
- */
1171
- interface SandboxRunner {
1172
- /**
1173
- * Check if sandboxing is available on this platform.
1174
- * Returns false for platforms that don't support isolation.
1175
- */
1176
- isAvailable(): boolean;
1177
- /**
1178
- * Load a sandboxed plugin from code.
1179
- *
1180
- * @param manifest - Plugin manifest with metadata and capabilities
1181
- * @param code - The bundled plugin JavaScript code
1182
- * @returns A sandboxed plugin instance
1183
- * @throws If sandboxing is not available or plugin can't be loaded
1184
- */
1185
- load(manifest: PluginManifest, code: string): Promise<SandboxedPlugin>;
1186
- /**
1187
- * Set the email send callback for sandboxed plugins.
1188
- * Called after the EmailPipeline is created, since the pipeline
1189
- * doesn't exist when the sandbox runner is constructed.
1190
- */
1191
- setEmailSend(callback: SandboxEmailSendCallback | null): void;
1192
- /**
1193
- * Terminate all loaded sandboxed plugins.
1194
- * Called during shutdown or when reconfiguring.
1195
- */
1196
- terminateAll(): Promise<void>;
1197
- }
1198
- /**
1199
- * Factory function type for creating sandbox runners.
1200
- * Exported by platform adapters (e.g., @emdash-cms/adapter-cloudflare/sandbox).
1201
- *
1202
- * @example
1203
- * ```typescript
1204
- * // In @emdash-cms/adapter-cloudflare/sandbox.ts
1205
- * export const createSandboxRunner: SandboxRunnerFactory = (options) => {
1206
- * return new CloudflareSandboxRunner(options);
1207
- * };
1208
- * ```
1209
- */
1210
- type SandboxRunnerFactory = (options: SandboxOptions) => SandboxRunner;
1211
- //#endregion
1212
- //#region src/content/converters/types.d.ts
1213
- /**
1214
- * Portable Text Types
1215
- *
1216
- * Defines the structure of Portable Text blocks used in EmDash.
1217
- */
1218
- /**
1219
- * Base span (inline text)
1220
- */
1221
- interface PortableTextSpan {
1222
- _type: "span";
1223
- _key: string;
1224
- text: string;
1225
- marks?: string[];
1226
- }
1227
- /**
1228
- * Mark definition (bold, italic, link, etc.)
1229
- */
1230
- interface PortableTextMarkDef {
1231
- _type: string;
1232
- _key: string;
1233
- [key: string]: unknown;
1234
- }
1235
- /**
1236
- * Link mark definition
1237
- */
1238
- interface PortableTextLinkMark extends PortableTextMarkDef {
1239
- _type: "link";
1240
- href: string;
1241
- blank?: boolean;
1242
- }
1243
- /**
1244
- * Text block (paragraph, heading, etc.)
1245
- */
1246
- interface PortableTextTextBlock {
1247
- _type: "block";
1248
- _key: string;
1249
- style?: "normal" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "blockquote";
1250
- listItem?: "bullet" | "number";
1251
- level?: number;
1252
- children: PortableTextSpan[];
1253
- markDefs?: PortableTextMarkDef[];
1254
- }
1255
- /**
1256
- * Image block
1257
- */
1258
- interface PortableTextImageBlock {
1259
- _type: "image";
1260
- _key: string;
1261
- asset: {
1262
- _ref: string;
1263
- url?: string; /** Provider ID for external media (e.g., "cloudflare-images") */
1264
- provider?: string;
1265
- };
1266
- alt?: string;
1267
- caption?: string;
1268
- /** Original image width */
1269
- width?: number;
1270
- /** Original image height */
1271
- height?: number;
1272
- /** Display width for this instance (overrides original) */
1273
- displayWidth?: number;
1274
- /** Display height for this instance (overrides original) */
1275
- displayHeight?: number;
1276
- }
1277
- /**
1278
- * Code block
1279
- */
1280
- interface PortableTextCodeBlock {
1281
- _type: "code";
1282
- _key: string;
1283
- code: string;
1284
- language?: string;
1285
- filename?: string;
1286
- }
1287
- /**
1288
- * Unknown/custom block (preserved for plugin compatibility)
1289
- */
1290
- interface PortableTextUnknownBlock {
1291
- _type: string;
1292
- _key: string;
1293
- [key: string]: unknown;
1294
- }
1295
- /**
1296
- * Any Portable Text block
1297
- */
1298
- type PortableTextBlock$1 = PortableTextTextBlock | PortableTextImageBlock | PortableTextCodeBlock | PortableTextUnknownBlock;
1299
- /**
1300
- * ProseMirror JSON types (simplified for TipTap)
1301
- */
1302
- interface ProseMirrorMark {
1303
- type: string;
1304
- attrs?: Record<string, unknown>;
1305
- }
1306
- interface ProseMirrorNode {
1307
- type: string;
1308
- attrs?: Record<string, unknown>;
1309
- content?: ProseMirrorNode[];
1310
- marks?: ProseMirrorMark[];
1311
- text?: string;
1312
- }
1313
- interface ProseMirrorDocument {
1314
- type: "doc";
1315
- content: ProseMirrorNode[];
1316
- }
1317
- //#endregion
1318
- //#region src/content/converters/prosemirror-to-portable-text.d.ts
1319
- /**
1320
- * Convert ProseMirror document to Portable Text
1321
- */
1322
- declare function prosemirrorToPortableText(doc: ProseMirrorDocument): PortableTextBlock$1[];
1323
- //#endregion
1324
- //#region src/content/converters/portable-text-to-prosemirror.d.ts
1325
- /**
1326
- * Convert Portable Text to ProseMirror document
1327
- */
1328
- declare function portableTextToProsemirror(blocks: PortableTextBlock$1[]): ProseMirrorDocument;
1329
- //#endregion
1330
- //#region src/utils/hash.d.ts
1331
- /**
1332
- * SHA-256 hash of a string, truncated to 16 hex chars (64 bits).
1333
- * For cache invalidation / ETags — not for security.
1334
- */
1335
- declare function hashString(content: string): Promise<string>;
1336
- /**
1337
- * Compute content hash using Web Crypto API
1338
- *
1339
- * Uses SHA-1 which is the fastest option in SubtleCrypto.
1340
- * SHA-1 is cryptographically weak but fine for content deduplication
1341
- * where we only need to detect identical files, not resist attacks.
1342
- *
1343
- * Returns hex string prefixed with "sha1:" for future-proofing
1344
- */
1345
- declare function computeContentHash(content: Uint8Array | ArrayBuffer): Promise<string>;
1346
- //#endregion
1347
- //#region src/utils/url.d.ts
1348
- /**
1349
- * URL scheme validation utilities
1350
- *
1351
- * Prevents XSS via dangerous URL schemes (javascript:, data:, vbscript:, etc.)
1352
- * by allowlisting known-safe schemes before rendering into href attributes.
1353
- */
1354
- /**
1355
- * Returns the URL unchanged if it uses a safe scheme, otherwise returns "#".
1356
- *
1357
- * Use this at the render layer as the primary defense against XSS via
1358
- * dangerous URL schemes like `javascript:`, `data:`, or `vbscript:`.
1359
- *
1360
- * @example
1361
- * ```ts
1362
- * sanitizeHref("https://example.com") // "https://example.com"
1363
- * sanitizeHref("/about") // "/about"
1364
- * sanitizeHref("#section") // "#section"
1365
- * sanitizeHref("mailto:a@b.com") // "mailto:a@b.com"
1366
- * sanitizeHref("javascript:alert(1)") // "#"
1367
- * sanitizeHref("data:text/html,<script>") // "#"
1368
- * sanitizeHref("") // "#"
1369
- * ```
1370
- */
1371
- declare function sanitizeHref(url: string | undefined | null): string;
1372
- /**
1373
- * Returns true if the URL uses a safe scheme for rendering in href attributes.
1374
- */
1375
- declare function isSafeHref(url: string): boolean;
1376
- //#endregion
1377
- //#region src/utils/slugify.d.ts
1378
- /**
1379
- * Convert a string to a URL-friendly slug.
1380
- *
1381
- * Handles unicode by normalizing to NFD and stripping diacritics,
1382
- * so "café" becomes "cafe", "naïve" becomes "naive", etc.
1383
- */
1384
- /**
1385
- * Decode a URI-encoded slug parameter.
1386
- *
1387
- * Browsers percent-encode non-ASCII characters in URLs, so a slug like
1388
- * "మేష-రాసి" arrives as "%e0%b0%ae%e0%b1%87%e0%b0%b7-%e0%b0%b0%e0%b0%be%e0%b0%b8%e0%b0%bf".
1389
- * Call this on `Astro.params.slug` before using it in database lookups.
1390
- */
1391
- declare function decodeSlug(raw: string | undefined): string | undefined;
1392
- //#endregion
1393
- //#region src/visual-editing/editable.d.ts
1394
- /**
1395
- * Visual editing annotation system
1396
- *
1397
- * Creates Proxy objects that emit data-emdash-ref attributes when spread onto elements.
1398
- */
1399
- interface CMSAnnotation {
1400
- collection: string;
1401
- id: string;
1402
- field?: string;
1403
- /** Entry status — only present on entry-level annotations (not field-level) */
1404
- status?: string;
1405
- /** Whether the entry has unpublished draft changes */
1406
- hasDraft?: boolean;
1407
- }
1408
- /** The shape returned when spreading an edit annotation onto an element */
1409
- interface FieldAnnotation {
1410
- "data-emdash-ref": string;
1411
- }
1412
- interface EditableOptions {
1413
- /** Entry status: "draft", "published", "scheduled" */
1414
- status?: string;
1415
- /** true when draftRevisionId exists and differs from liveRevisionId */
1416
- hasDraft?: boolean;
1417
- }
1418
- /**
1419
- * Create an editable proxy for an entry.
1420
- *
1421
- * Usage:
1422
- * - `{...entry.edit}` - entry-level annotation (includes status/hasDraft)
1423
- * - `{...entry.edit.title}` - field-level annotation
1424
- * - `{...entry.edit['nested.field']}` - nested field (bracket notation)
1425
- */
1426
- declare function createEditable(collection: string, id: string, options?: EditableOptions): EditProxy;
1427
- /**
1428
- * Create a noop proxy for production mode.
1429
- * Spreading this produces no attributes.
1430
- */
1431
- declare function createNoop(): EditProxy;
1432
- /**
1433
- * Visual editing proxy type.
1434
- *
1435
- * Spread directly onto elements for entry-level annotations: `{...entry.edit}`
1436
- * Access a field for field-level annotations: `{...entry.edit.title}`
1437
- *
1438
- * In production, spreading produces no attributes (noop).
1439
- */
1440
- type EditProxy = {
1441
- readonly [field: string]: Partial<FieldAnnotation>;
1442
- };
1443
- //#endregion
1444
- //#region src/query.d.ts
1445
- /**
1446
- * Collection type registry for type-safe queries.
1447
- *
1448
- * This interface is extended by the generated emdash-env.d.ts file
1449
- * to provide type inference for collection names and their data shapes.
1450
- *
1451
- * @example
1452
- * ```ts
1453
- * // In emdash-env.d.ts (generated):
1454
- * declare module "emdash" {
1455
- * interface EmDashCollections {
1456
- * posts: { title: string; content: PortableTextBlock[]; };
1457
- * pages: { title: string; body: PortableTextBlock[]; };
1458
- * }
1459
- * }
1460
- *
1461
- * // Then in your code:
1462
- * const { entries } = await getEmDashCollection("posts");
1463
- * // entries[0].data.title is typed as string
1464
- * ```
1465
- */
1466
- interface EmDashCollections {}
1467
- /**
1468
- * Helper type to infer the data type for a collection.
1469
- * Returns the registered type if known, otherwise falls back to Record<string, unknown>.
1470
- */
1471
- type InferCollectionData<T extends string> = T extends keyof EmDashCollections ? EmDashCollections[T] : Record<string, unknown>;
1472
- /**
1473
- * Sort direction
1474
- */
1475
- type SortDirection$1 = "asc" | "desc";
1476
- /**
1477
- * Order by specification - field name to direction
1478
- * @example { created_at: "desc" } - Sort by created_at descending
1479
- * @example { title: "asc" } - Sort by title ascending
1480
- * @example { published_at: "desc", title: "asc" } - Multi-field sort
1481
- */
1482
- type OrderBySpec$1 = Record<string, SortDirection$1>;
1483
- interface CollectionFilter$1 {
1484
- status?: "draft" | "published" | "archived";
1485
- limit?: number;
1486
- /**
1487
- * Opaque cursor for keyset pagination.
1488
- * Pass the `nextCursor` value from a previous result to fetch the next page.
1489
- * @example
1490
- * ```ts
1491
- * const cursor = Astro.url.searchParams.get("cursor") ?? undefined;
1492
- * const { entries, nextCursor } = await getEmDashCollection("posts", {
1493
- * limit: 10,
1494
- * cursor,
1495
- * });
1496
- * ```
1497
- */
1498
- cursor?: string;
1499
- /**
1500
- * Filter by field values or taxonomy terms
1501
- * @example { category: 'news' } - Filter by taxonomy term
1502
- * @example { category: ['news', 'featured'] } - Filter by multiple terms (OR)
1503
- */
1504
- where?: Record<string, string | string[]>;
1505
- /**
1506
- * Order results by field(s)
1507
- * @default { created_at: "desc" }
1508
- * @example { created_at: "desc" } - Sort by created_at descending (default)
1509
- * @example { title: "asc" } - Sort by title ascending
1510
- * @example { published_at: "desc", title: "asc" } - Multi-field sort
1511
- */
1512
- orderBy?: OrderBySpec$1;
1513
- /**
1514
- * Filter by locale. When set, only returns entries in this locale.
1515
- * Only relevant when i18n is configured.
1516
- * @example "en" — English entries only
1517
- * @example "fr" — French entries only
1518
- */
1519
- locale?: string;
1520
- }
1521
- interface ContentEntry<T = Record<string, unknown>> {
1522
- id: string;
1523
- data: T;
1524
- /** Visual editing annotations. Spread onto elements: {...entry.edit.title} */
1525
- edit: EditProxy;
1526
- }
1527
- /** Cache hint returned by the content loader for route caching */
1528
- interface CacheHint {
1529
- tags?: string[];
1530
- lastModified?: Date;
1531
- }
1532
- /**
1533
- * Result from getEmDashCollection
1534
- */
1535
- interface CollectionResult<T> {
1536
- /** The entries (empty array if error or none found) */
1537
- entries: ContentEntry<T>[];
1538
- /** Error if the query failed */
1539
- error?: Error;
1540
- /** Cache hint for route caching (pass to Astro.cache.set()) */
1541
- cacheHint: CacheHint;
1542
- /**
1543
- * Opaque cursor for the next page.
1544
- * Undefined when there are no more results.
1545
- * Pass this as `cursor` in the next query to get the next page.
1546
- */
1547
- nextCursor?: string;
1548
- }
1549
- /**
1550
- * Result from getEmDashEntry
1551
- */
1552
- interface EntryResult<T> {
1553
- /** The entry, or null if not found */
1554
- entry: ContentEntry<T> | null;
1555
- /** Error if the query failed (not set for "not found", only for actual errors) */
1556
- error?: Error;
1557
- /** Whether we're in preview mode (valid token was provided) */
1558
- isPreview: boolean;
1559
- /** Set when a fallback locale was used instead of the requested locale */
1560
- fallbackLocale?: string;
1561
- /** Cache hint for route caching (pass to Astro.cache.set()) */
1562
- cacheHint: CacheHint;
1563
- }
1564
- /** Edit metadata attached to PT arrays in edit mode */
1565
- interface EditFieldMeta {
1566
- collection: string;
1567
- id: string;
1568
- field: string;
1569
- }
1570
- /**
1571
- * Read edit metadata from a value (returns undefined if not tagged).
1572
- * Uses Object.getOwnPropertyDescriptor to access Symbol-keyed property
1573
- * without an unsafe type assertion.
1574
- */
1575
- declare function getEditMeta(value: unknown): EditFieldMeta | undefined;
1576
- /**
1577
- * Get all entries of a content type
1578
- *
1579
- * Returns { entries, error } for graceful error handling.
1580
- *
1581
- * When emdash-env.d.ts is generated, the collection name will be
1582
- * type-checked and the return type will be inferred automatically.
1583
- *
1584
- * @example
1585
- * ```ts
1586
- * import { getEmDashCollection } from "emdash";
1587
- *
1588
- * const { entries: posts, error } = await getEmDashCollection("posts");
1589
- * if (error) {
1590
- * console.error("Failed to load posts:", error);
1591
- * return;
1592
- * }
1593
- * // posts[0].data.title is typed (if emdash-env.d.ts exists)
1594
- *
1595
- * // With filters
1596
- * const { entries: drafts } = await getEmDashCollection("posts", { status: "draft" });
1597
- * ```
1598
- */
1599
- declare function getEmDashCollection<T extends string, D = InferCollectionData<T>>(type: T, filter?: CollectionFilter$1): Promise<CollectionResult<D>>;
1600
- /**
1601
- * Get a single entry by type and ID/slug
1602
- *
1603
- * Returns { entry, error, isPreview } for graceful error handling.
1604
- * - entry is null if not found (not an error)
1605
- * - error is set only for actual errors (db issues, etc.)
1606
- *
1607
- * Preview mode is detected automatically from request context (ALS).
1608
- * When the URL has a valid `_preview` token, the middleware sets preview
1609
- * context and this function serves draft revision data if available.
1610
- *
1611
- * @example
1612
- * ```ts
1613
- * import { getEmDashEntry } from "emdash";
1614
- *
1615
- * // Simple usage — preview just works via middleware
1616
- * const { entry: post, isPreview, error } = await getEmDashEntry("posts", "my-slug");
1617
- * if (!post) return Astro.redirect("/404");
1618
- * ```
1619
- */
1620
- declare function getEmDashEntry<T extends string, D = InferCollectionData<T>>(type: T, id: string, options?: {
1621
- locale?: string;
1622
- }): Promise<EntryResult<D>>;
1623
- /**
1624
- * Translation summary for a single locale variant
1625
- */
1626
- interface TranslationSummary {
1627
- /** Content item ID */
1628
- id: string;
1629
- /** Locale code (e.g. "en", "fr") */
1630
- locale: string;
1631
- /** URL slug */
1632
- slug: string | null;
1633
- /** Current status */
1634
- status: string;
1635
- }
1636
- /**
1637
- * Result from getTranslations
1638
- */
1639
- interface TranslationsResult {
1640
- /** The translation group ID (shared across locales) */
1641
- translationGroup: string;
1642
- /** All locale variants in this group */
1643
- translations: TranslationSummary[];
1644
- /** Error if the query failed */
1645
- error?: Error;
1646
- }
1647
- /**
1648
- * Get all translations of a content item.
1649
- *
1650
- * Given a content entry, returns all locale variants that share the same
1651
- * translation group. This is useful for building language switcher UI.
1652
- *
1653
- * @example
1654
- * ```ts
1655
- * import { getEmDashEntry, getTranslations } from "emdash";
1656
- *
1657
- * const { entry: post } = await getEmDashEntry("posts", "hello-world", { locale: "en" });
1658
- * const { translations } = await getTranslations("posts", post.data.id);
1659
- * // translations = [{ id: "...", locale: "en", slug: "hello-world", status: "published" }, ...]
1660
- * ```
1661
- */
1662
- declare function getTranslations(type: string, id: string): Promise<TranslationsResult>;
1663
- /**
1664
- * Result from resolveEmDashPath
1665
- */
1666
- interface ResolvePathResult<T = Record<string, unknown>> {
1667
- /** The matched entry */
1668
- entry: ContentEntry<T>;
1669
- /** The collection slug that matched */
1670
- collection: string;
1671
- /** Extracted parameters from the URL pattern (e.g. { slug: "my-post" }) */
1672
- params: Record<string, string>;
1673
- }
1674
- /**
1675
- * Resolve a URL path to a content entry by matching against collection URL patterns.
1676
- *
1677
- * Loads all collections with a `urlPattern` set, converts each pattern to a regex,
1678
- * and tests the given path. On match, extracts the slug and fetches the entry.
1679
- *
1680
- * @example
1681
- * ```ts
1682
- * import { resolveEmDashPath } from "emdash";
1683
- *
1684
- * // Given pages with urlPattern "/{slug}" and posts with "/blog/{slug}":
1685
- * const result = await resolveEmDashPath("/blog/hello-world");
1686
- * if (result) {
1687
- * console.log(result.collection); // "posts"
1688
- * console.log(result.params.slug); // "hello-world"
1689
- * console.log(result.entry.data); // post data
1690
- * }
1691
- * ```
1692
- */
1693
- declare function resolveEmDashPath<T = Record<string, unknown>>(path: string): Promise<ResolvePathResult<T> | null>;
1694
- //#endregion
1695
- //#region src/after.d.ts
1696
- /**
1697
- * Defer work past the HTTP response.
1698
- *
1699
- * Use for bookkeeping that doesn't need to complete before the client
1700
- * gets bytes — writes that record state, maintenance queries, cache
1701
- * refreshes. `after()` hands the promise to the host's lifetime
1702
- * extender when one is available (Cloudflare's `waitUntil` under
1703
- * workerd), or fires-and-forgets on Node (the process lives for the
1704
- * next request anyway).
1705
- *
1706
- * Host binding is resolved lazily via a dynamic import of the
1707
- * `virtual:emdash/wait-until` virtual module. Lazy — rather than a
1708
- * static top-level import — so tools that walk the dist in a plain
1709
- * Node loader (`astro check`, Vitest, etc.) don't trip over the
1710
- * `virtual:` scheme: they'd only fail if they actually called
1711
- * `after()`, which they don't during type-checking.
1712
- */
1713
- type WaitUntilFn = (promise: Promise<unknown>) => void;
1714
- /**
1715
- * Schedule `fn` to run without blocking the response.
1716
- *
1717
- * Errors are caught and logged — a deferred task should never surface
1718
- * as an unhandled rejection because the response is long gone. Callers
1719
- * that care about errors should handle them inside `fn`.
1720
- */
1721
- declare function after(fn: () => void | Promise<void>): void;
1722
- //#endregion
1723
- //#region src/i18n/config.d.ts
1724
- /**
1725
- * EmDash i18n Configuration
1726
- *
1727
- * Reads locale configuration from the virtual module (sourced from Astro config).
1728
- * Initialized during runtime startup, then available via getI18nConfig().
1729
- */
1730
- interface I18nConfig {
1731
- defaultLocale: string;
1732
- locales: string[];
1733
- fallback?: Record<string, string>;
1734
- prefixDefaultLocale?: boolean;
1735
- }
1736
- /**
1737
- * Get the current i18n config.
1738
- * Returns null if i18n is not configured.
1739
- */
1740
- declare function getI18nConfig(): I18nConfig | null;
1741
- /**
1742
- * Check if i18n is enabled.
1743
- * Returns true when multiple locales are configured.
1744
- */
1745
- declare function isI18nEnabled(): boolean;
1746
- /**
1747
- * Resolve fallback locale chain for a given locale.
1748
- * Returns array of locales to try, from most preferred to least.
1749
- * Always ends with defaultLocale.
1750
- */
1751
- declare function getFallbackChain(locale: string): string[];
1752
- //#endregion
1753
- //#region src/loader.d.ts
1754
- /**
1755
- * Entry data type - generic object
1756
- */
1757
- type EntryData = Record<string, unknown>;
1758
- /**
1759
- * Sort direction
1760
- */
1761
- type SortDirection = "asc" | "desc";
1762
- /**
1763
- * Order by specification - field name to direction
1764
- * @example { created_at: "desc" } - Sort by created_at descending
1765
- * @example { title: "asc" } - Sort by title ascending
1766
- */
1767
- type OrderBySpec = Record<string, SortDirection>;
1768
- /**
1769
- * Filter for loadCollection - type is required
1770
- */
1771
- interface CollectionFilter {
1772
- type: string;
1773
- status?: "draft" | "published" | "archived";
1774
- limit?: number;
1775
- /**
1776
- * Opaque cursor for keyset pagination.
1777
- * Pass the `nextCursor` value from a previous result to fetch the next page.
1778
- */
1779
- cursor?: string;
1780
- /**
1781
- * Filter by field values or taxonomy terms
1782
- */
1783
- where?: Record<string, string | string[]>;
1784
- /**
1785
- * Order results by field(s)
1786
- * @default { created_at: "desc" }
1787
- */
1788
- orderBy?: OrderBySpec;
1789
- /**
1790
- * Filter by locale (e.g. 'en', 'fr').
1791
- * When set, only returns content in this locale.
1792
- */
1793
- locale?: string;
1794
- }
1795
- /**
1796
- * Filter for loadEntry - type and id are required
1797
- */
1798
- interface EntryFilter {
1799
- type: string;
1800
- id: string;
1801
- /**
1802
- * When set, fetch content data from this revision instead of the content table.
1803
- * Used by preview mode to serve draft revision data.
1804
- */
1805
- revisionId?: string;
1806
- /**
1807
- * Locale to scope slug lookup. Only affects slug resolution;
1808
- * IDs are globally unique and always resolve regardless of locale.
1809
- */
1810
- locale?: string;
1811
- }
1812
- /**
1813
- * Get the database instance. Used by query wrapper functions and middleware.
1814
- *
1815
- * Checks the ALS request context first — if a per-request DB override is set
1816
- * (e.g. by DO preview middleware), it takes precedence over the module-level
1817
- * cached instance. This allows preview mode to route queries to an isolated
1818
- * Durable Object database without modifying any calling code.
1819
- *
1820
- * Initializes the default database on first call using config from virtual module.
1821
- */
1822
- declare function getDb(): Promise<Kysely<Database>>;
1823
- /**
1824
- * Create an EmDash Live Collections loader
1825
- *
1826
- * This loader handles ALL content types in a single Astro collection.
1827
- * Use `getEmDashCollection()` and `getEmDashEntry()` to query
1828
- * specific content types.
1829
- *
1830
- * Database is configured in astro.config.mjs via the emdash() integration.
1831
- *
1832
- * @example
1833
- * ```ts
1834
- * // src/live.config.ts
1835
- * import { defineLiveCollection } from "astro:content";
1836
- * import { emdashLoader } from "emdash";
1837
- *
1838
- * export const collections = {
1839
- * emdash: defineLiveCollection({
1840
- * loader: emdashLoader(),
1841
- * }),
1842
- * };
1843
- * ```
1844
- */
1845
- declare function emdashLoader(): LiveLoader<EntryData, EntryFilter, CollectionFilter>;
1846
- //#endregion
1847
- //#region src/cli/wxr/parser.d.ts
1848
- /**
1849
- * Parsed WordPress export data
1850
- */
1851
- interface WxrData {
1852
- /** Site metadata */
1853
- site: WxrSite;
1854
- /** Posts (including custom post types) */
1855
- posts: WxrPost[];
1856
- /** Media attachments */
1857
- attachments: WxrAttachment[];
1858
- /** Categories */
1859
- categories: WxrCategory[];
1860
- /** Tags */
1861
- tags: WxrTag[];
1862
- /** Authors */
1863
- authors: WxrAuthor[];
1864
- /** All taxonomy terms (including custom taxonomies and nav_menu) */
1865
- terms: WxrTerm[];
1866
- /** Parsed navigation menus */
1867
- navMenus: WxrNavMenu[];
1868
- }
1869
- interface WxrSite {
1870
- title?: string;
1871
- link?: string;
1872
- description?: string;
1873
- language?: string;
1874
- baseSiteUrl?: string;
1875
- baseBlogUrl?: string;
1876
- }
1877
- interface WxrPost {
1878
- id?: number;
1879
- title?: string;
1880
- link?: string;
1881
- pubDate?: string;
1882
- creator?: string;
1883
- guid?: string;
1884
- description?: string;
1885
- content?: string;
1886
- excerpt?: string;
1887
- postDate?: string;
1888
- postDateGmt?: string;
1889
- postModified?: string;
1890
- postModifiedGmt?: string;
1891
- commentStatus?: string;
1892
- pingStatus?: string;
1893
- status?: string;
1894
- postType?: string;
1895
- postName?: string;
1896
- postPassword?: string;
1897
- isSticky?: boolean;
1898
- /** Parent post ID for hierarchical content (pages) */
1899
- postParent?: number;
1900
- /** Menu order for sorting */
1901
- menuOrder?: number;
1902
- categories: string[];
1903
- tags: string[];
1904
- /** Custom taxonomy assignments beyond categories/tags */
1905
- customTaxonomies?: Map<string, string[]>;
1906
- meta: Map<string, string>;
1907
- }
1908
- interface WxrAttachment {
1909
- id?: number;
1910
- title?: string;
1911
- url?: string;
1912
- postDate?: string;
1913
- meta: Map<string, string>;
1914
- }
1915
- interface WxrCategory {
1916
- id?: number;
1917
- nicename?: string;
1918
- name?: string;
1919
- parent?: string;
1920
- description?: string;
1921
- }
1922
- interface WxrTag {
1923
- id?: number;
1924
- slug?: string;
1925
- name?: string;
1926
- description?: string;
1927
- }
1928
- /**
1929
- * Generic taxonomy term (categories, tags, nav_menu, custom taxonomies)
1930
- */
1931
- interface WxrTerm {
1932
- id: number;
1933
- taxonomy: string;
1934
- slug: string;
1935
- name: string;
1936
- parent?: string;
1937
- description?: string;
1938
- }
1939
- /**
1940
- * Navigation menu structure
1941
- */
1942
- interface WxrNavMenu {
1943
- id: number;
1944
- name: string;
1945
- label: string;
1946
- items: WxrNavMenuItem[];
1947
- }
1948
- /**
1949
- * Navigation menu item
1950
- */
1951
- interface WxrNavMenuItem {
1952
- id: number;
1953
- menuId: number;
1954
- parentId?: number;
1955
- sortOrder: number;
1956
- type: "custom" | "post_type" | "taxonomy";
1957
- objectType?: string;
1958
- objectId?: number;
1959
- url?: string;
1960
- title: string;
1961
- target?: string;
1962
- classes?: string;
1963
- }
1964
- interface WxrAuthor {
1965
- id?: number;
1966
- login?: string;
1967
- email?: string;
1968
- displayName?: string;
1969
- firstName?: string;
1970
- lastName?: string;
1971
- }
1972
- /**
1973
- * Parse a WordPress WXR export file
1974
- */
1975
- declare function parseWxr(stream: Readable): Promise<WxrData>;
1976
- /**
1977
- * Parse a WordPress WXR export from a string
1978
- *
1979
- * Uses the non-streaming SAX parser API for compatibility with
1980
- * environments that don't have Node.js streams (e.g., Cloudflare Workers).
1981
- */
1982
- declare function parseWxrString(xml: string): Promise<WxrData>;
1983
- //#endregion
1984
- //#region src/plugins/define-plugin.d.ts
1985
- /**
1986
- * Define an EmDash plugin.
1987
- *
1988
- * **Standard format** -- the canonical format for plugins that work in both
1989
- * trusted and sandboxed modes. No id/version -- those come from the descriptor.
1990
- *
1991
- * @example
1992
- * ```typescript
1993
- * import { definePlugin } from "emdash";
1994
- *
1995
- * export default definePlugin({
1996
- * hooks: {
1997
- * "content:afterSave": {
1998
- * handler: async (event, ctx) => {
1999
- * await ctx.kv.set("lastSave", Date.now());
2000
- * },
2001
- * },
2002
- * },
2003
- * routes: {
2004
- * status: {
2005
- * handler: async (routeCtx, ctx) => ({ ok: true }),
2006
- * },
2007
- * },
2008
- * });
2009
- * ```
2010
- *
2011
- * **Native format** -- for plugins that need React admin, direct DB access,
2012
- * or other capabilities not available in the sandbox.
2013
- *
2014
- * @example
2015
- * ```typescript
2016
- * import { definePlugin } from "emdash";
2017
- *
2018
- * export default definePlugin({
2019
- * id: "my-plugin",
2020
- * version: "1.0.0",
2021
- * capabilities: ["read:content"],
2022
- * hooks: {
2023
- * "content:beforeSave": async (event, ctx) => {
2024
- * ctx.log.info("Saving content", { collection: event.collection });
2025
- * return event.content;
2026
- * }
2027
- * },
2028
- * routes: {
2029
- * "sync": {
2030
- * handler: async (ctx) => {
2031
- * return { status: "ok" };
2032
- * }
2033
- * }
2034
- * }
2035
- * });
2036
- * ```
2037
- */
2038
- declare function definePlugin<TStorage extends PluginStorageConfig>(definition: PluginDefinition<TStorage>): ResolvedPlugin<TStorage>;
2039
- declare function definePlugin(definition: StandardPluginDefinition): StandardPluginDefinition;
2040
- //#endregion
2041
- //#region src/auth/types.d.ts
2042
- /**
2043
- * Auth Provider Types
2044
- *
2045
- * Defines the interfaces for pluggable authentication providers.
2046
- *
2047
- * Two systems coexist:
2048
- * - `AuthDescriptor` — transparent auth (Cloudflare Access) that authenticates
2049
- * every request via headers/cookies. No login UI needed.
2050
- * - `AuthProviderDescriptor` — pluggable login methods (GitHub, Google,
2051
- * AT Protocol, etc.) that appear as options on the login page and setup
2052
- * wizard. Passkey is built-in; providers are additive.
2053
- */
2054
- /**
2055
- * Result of authenticating a request via an external auth provider
2056
- */
2057
- interface AuthResult {
2058
- /** User's email address */
2059
- email: string;
2060
- /** User's display name */
2061
- name: string;
2062
- /** Resolved role level (e.g., 50 for Admin, 30 for Editor) */
2063
- role: number;
2064
- /** Provider-specific subject ID */
2065
- subject?: string;
2066
- /** Additional provider-specific data */
2067
- metadata?: Record<string, unknown>;
2068
- }
2069
- /**
2070
- * Auth descriptor — transparent auth providers (e.g., Cloudflare Access).
2071
- *
2072
- * These authenticate every request via headers/cookies. No login UI needed.
2073
- * The module's `authenticate()` function is called by middleware on each request.
2074
- */
2075
- interface AuthDescriptor {
2076
- /**
2077
- * Auth provider type identifier
2078
- * @example "cloudflare-access", "okta", "auth0"
2079
- */
2080
- type: string;
2081
- /**
2082
- * Module specifier to import at runtime
2083
- * The module must export an `authenticate` function.
2084
- * @example "@emdash-cms/cloudflare/auth"
2085
- */
2086
- entrypoint: string;
2087
- /**
2088
- * Provider-specific configuration (JSON-serializable)
2089
- */
2090
- config: unknown;
2091
- }
2092
- /**
2093
- * Auth provider module interface
2094
- *
2095
- * Modules specified by AuthDescriptor.entrypoint must export
2096
- * an `authenticate` function matching this signature.
2097
- */
2098
- interface AuthProviderModule {
2099
- /**
2100
- * Authenticate a request using the provider
2101
- *
2102
- * @param request - The incoming HTTP request
2103
- * @param config - Provider-specific configuration from AuthDescriptor
2104
- * @returns Authentication result if valid, throws if invalid
2105
- */
2106
- authenticate(request: Request, config: unknown): Promise<AuthResult>;
2107
- }
2108
- /**
2109
- * Descriptor for a pluggable auth provider.
2110
- *
2111
- * Auth providers appear as login options on the login page and setup wizard.
2112
- * They coexist with passkey (which is built-in) and with each other.
2113
- * Any provider can be used to create the initial admin account.
2114
- *
2115
- * @example
2116
- * ```ts
2117
- * // astro.config.ts
2118
- * import { atproto } from "@emdash-cms/auth-atproto";
2119
- *
2120
- * emdash({
2121
- * authProviders: [atproto(), github(), google()],
2122
- * })
2123
- * ```
2124
- */
2125
- interface AuthProviderDescriptor {
2126
- /** Unique provider ID (e.g., "github", "atproto") */
2127
- id: string;
2128
- /** Human-readable label for UI (e.g., "GitHub", "AT Protocol") */
2129
- label: string;
2130
- /** Provider-specific config (JSON-serializable) */
2131
- config?: unknown;
2132
- /**
2133
- * Module exporting React components for the admin UI.
2134
- * Statically imported at build time via virtual module.
2135
- *
2136
- * The module should export components matching `AuthProviderAdminExports`.
2137
- */
2138
- adminEntry?: string;
2139
- /**
2140
- * Astro route handlers this provider needs injected at build time.
2141
- * Used for login initiation, OAuth callbacks, well-known endpoints, etc.
2142
- */
2143
- routes?: AuthRouteDescriptor[];
2144
- /**
2145
- * URL prefixes/paths that should bypass auth middleware.
2146
- * Added to the public routes set so login/callback endpoints work
2147
- * for unauthenticated users.
2148
- */
2149
- publicRoutes?: string[];
2150
- /**
2151
- * Storage collections for persistent auth state (e.g., OAuth sessions).
2152
- * Same format as plugin storage — collections are stored in the shared
2153
- * `_plugin_storage` table namespaced under `auth:<providerId>`.
2154
- *
2155
- * Access via `getAuthProviderStorage()` from `emdash/api/route-utils`.
2156
- */
2157
- storage?: Record<string, {
2158
- indexes?: Array<string | string[]>;
2159
- uniqueIndexes?: Array<string | string[]>;
2160
- }>;
2161
- }
2162
- /**
2163
- * A route that an auth provider needs injected into the Astro app.
2164
- */
2165
- interface AuthRouteDescriptor {
2166
- /** URL pattern (e.g., "/_emdash/api/auth/atproto/login") */
2167
- pattern: string;
2168
- /** Module specifier for the Astro route handler */
2169
- entrypoint: string;
2170
- }
2171
- /**
2172
- * Expected exports from an auth provider's `adminEntry` module.
2173
- *
2174
- * All exports are optional. Providers export whichever components
2175
- * make sense for their auth flow.
2176
- */
2177
- interface AuthProviderAdminExports {
2178
- /**
2179
- * Compact button for the login page (icon + label).
2180
- * Used for providers with a simple redirect flow (GitHub, Google).
2181
- * Rendered in the "Or continue with" section.
2182
- */
2183
- LoginButton?: react.ComponentType;
2184
- /**
2185
- * Full login form for providers that need custom input.
2186
- * Used for providers like AT Protocol that need a handle field.
2187
- * Rendered as an expandable section on the login page.
2188
- */
2189
- LoginForm?: react.ComponentType;
2190
- /**
2191
- * Setup wizard step for creating the admin account via this provider.
2192
- * When present, this provider appears as an option in the setup wizard's
2193
- * "Create admin account" step.
2194
- */
2195
- SetupStep?: react.ComponentType<{
2196
- onComplete: () => void;
2197
- }>;
2198
- }
2199
- /**
2200
- * Configuration options common to external auth providers
2201
- */
2202
- interface ExternalAuthConfig {
2203
- /**
2204
- * Automatically create EmDash users on first login
2205
- * @default true
2206
- */
2207
- autoProvision?: boolean;
2208
- /**
2209
- * Role level for users not matching any group in roleMapping
2210
- * @default 30 (Editor)
2211
- */
2212
- defaultRole?: number;
2213
- /**
2214
- * Update user's role on each login based on current IdP groups
2215
- * When false, role is only set on first provisioning
2216
- * @default false
2217
- */
2218
- syncRoles?: boolean;
2219
- /**
2220
- * Map IdP group names to EmDash role levels
2221
- * First match wins if user is in multiple groups
2222
- *
2223
- * @example
2224
- * ```ts
2225
- * roleMapping: {
2226
- * "Admins": 50, // Admin
2227
- * "Developers": 40, // Developer
2228
- * "Content Team": 30, // Editor
2229
- * }
2230
- * ```
2231
- */
2232
- roleMapping?: Record<string, number>;
2233
- }
2234
- //#endregion
2235
- //#region src/astro/storage/types.d.ts
2236
- /**
2237
- * Serializable storage configuration descriptor
2238
- */
2239
- interface StorageDescriptor {
2240
- /** Module path exporting createStorage function */
2241
- entrypoint: string;
2242
- /** Serializable config passed to createStorage at runtime */
2243
- config: unknown;
2244
- }
2245
- /**
2246
- * S3-compatible storage configuration
2247
- */
2248
- interface S3StorageConfig {
2249
- /** S3 endpoint URL */
2250
- endpoint: string;
2251
- /** Bucket name */
2252
- bucket: string;
2253
- /**
2254
- * Access key ID.
2255
- * May be resolved from the `S3_ACCESS_KEY_ID` env var at runtime on Node.
2256
- * Must be provided together with `secretAccessKey`, or both omitted.
2257
- */
2258
- accessKeyId?: string;
2259
- /**
2260
- * Secret access key.
2261
- * May be resolved from the `S3_SECRET_ACCESS_KEY` env var at runtime on Node.
2262
- * Must be provided together with `accessKeyId`, or both omitted.
2263
- */
2264
- secretAccessKey?: string;
2265
- /** Optional region (defaults to "auto") */
2266
- region?: string;
2267
- /** Optional public URL prefix for CDN */
2268
- publicUrl?: string;
2269
- }
2270
- /**
2271
- * Local filesystem storage configuration
2272
- */
2273
- interface LocalStorageConfig {
2274
- /** Directory path for storing files */
2275
- directory: string;
2276
- /** Base URL for serving files */
2277
- baseUrl: string;
2278
- }
2279
- //#endregion
2280
- //#region src/astro/integration/runtime.d.ts
2281
- /**
2282
- * Admin page definition (copied from plugins/types to avoid circular deps)
2283
- */
2284
- interface PluginAdminPage {
2285
- path: string;
2286
- label: string;
2287
- icon?: string;
2288
- }
2289
- /**
2290
- * Dashboard widget definition (copied from plugins/types to avoid circular deps)
2291
- */
2292
- interface PluginDashboardWidget {
2293
- id: string;
2294
- size?: "full" | "half" | "third";
2295
- title?: string;
2296
- }
2297
- /**
2298
- * Plugin descriptor - returned by plugin factory functions
2299
- *
2300
- * Contains all static metadata needed for manifest and admin UI,
2301
- * plus the entrypoint for runtime instantiation.
2302
- *
2303
- * @example
2304
- * ```ts
2305
- * export function myPlugin(options?: MyPluginOptions): PluginDescriptor {
2306
- * return {
2307
- * id: "my-plugin",
2308
- * version: "1.0.0",
2309
- * entrypoint: "@my-org/emdash-plugin-foo",
2310
- * options: options ?? {},
2311
- * adminEntry: "@my-org/emdash-plugin-foo/admin",
2312
- * adminPages: [{ path: "/settings", label: "Settings" }],
2313
- * };
2314
- * }
2315
- * ```
2316
- */
2317
- /**
2318
- * Storage collection declaration for sandboxed plugins
2319
- */
2320
- interface StorageCollectionDeclaration {
2321
- indexes?: string[];
2322
- uniqueIndexes?: string[];
2323
- }
2324
- interface PluginDescriptor<TOptions = Record<string, unknown>> {
2325
- /** Unique plugin identifier */
2326
- id: string;
2327
- /** Plugin version (semver) */
2328
- version: string;
2329
- /** Module specifier to import (e.g., "@emdash-cms/plugin-api-test") */
2330
- entrypoint: string;
2331
- /**
2332
- * Options to pass to createPlugin(). Native format only.
2333
- * Standard-format plugins configure themselves via KV settings
2334
- * and Block Kit admin pages -- not constructor options.
2335
- */
2336
- options?: TOptions;
2337
- /**
2338
- * Plugin format. Determines how the entrypoint is loaded:
2339
- * - `"standard"` -- exports `definePlugin({ hooks, routes })` as default.
2340
- * Wrapped with `adaptSandboxEntry` for in-process execution. Can run in both
2341
- * `plugins: []` (in-process) and `sandboxed: []` (isolate).
2342
- * - `"native"` -- exports `createPlugin(options)` returning a `ResolvedPlugin`.
2343
- * Can only run in `plugins: []`. Cannot be sandboxed or published to marketplace.
2344
- *
2345
- * Defaults to `"native"` when unset.
2346
- *
2347
- */
2348
- format?: "standard" | "native";
2349
- /** Admin UI module specifier (e.g., "@emdash-cms/plugin-audit-log/admin") */
2350
- adminEntry?: string;
2351
- /** Module specifier for site-side Astro rendering components (must export `blockComponents`) */
2352
- componentsEntry?: string;
2353
- /** Admin pages for navigation */
2354
- adminPages?: PluginAdminPage[];
2355
- /** Dashboard widgets */
2356
- adminWidgets?: PluginDashboardWidget[];
2357
- /**
2358
- * Capabilities the plugin requests.
2359
- * For standard-format plugins, capabilities are enforced in both trusted and
2360
- * sandboxed modes via the PluginContextFactory.
2361
- */
2362
- capabilities?: string[];
2363
- /**
2364
- * Allowed hosts for network:fetch capability
2365
- * Supports wildcards like "*.example.com"
2366
- */
2367
- allowedHosts?: string[];
2368
- /**
2369
- * Storage collections the plugin declares
2370
- * Sandboxed plugins can only access declared collections.
2371
- */
2372
- storage?: Record<string, StorageCollectionDeclaration>;
2373
- }
2374
- /**
2375
- * Sandboxed plugin descriptor - same format as PluginDescriptor
2376
- *
2377
- * These run in isolated V8 isolates via Worker Loader on Cloudflare.
2378
- * The `entrypoint` is resolved to a file and bundled at build time.
2379
- */
2380
- type SandboxedPluginDescriptor<TOptions = Record<string, unknown>> = PluginDescriptor<TOptions>;
2381
- interface EmDashConfig {
2382
- /**
2383
- * Database configuration
2384
- *
2385
- * Use one of the adapter functions:
2386
- * - `sqlite({ url: "file:./data.db" })` - Local SQLite
2387
- * - `libsql({ url: "...", authToken: "..." })` - Turso/libSQL
2388
- * - `d1({ binding: "DB" })` - Cloudflare D1
2389
- *
2390
- * @example
2391
- * ```ts
2392
- * import { sqlite } from "emdash/db";
2393
- *
2394
- * emdash({
2395
- * database: sqlite({ url: "file:./data.db" }),
2396
- * })
2397
- * ```
2398
- */
2399
- database?: DatabaseDescriptor;
2400
- /**
2401
- * Storage configuration (for media)
2402
- */
2403
- storage?: StorageDescriptor;
2404
- /**
2405
- * Trusted plugins to load (run in main isolate)
2406
- *
2407
- * @example
2408
- * ```ts
2409
- * import { auditLogPlugin } from "@emdash-cms/plugin-audit-log";
2410
- * import { webhookNotifierPlugin } from "@emdash-cms/plugin-webhook-notifier";
2411
- *
2412
- * emdash({
2413
- * plugins: [
2414
- * auditLogPlugin(),
2415
- * webhookNotifierPlugin({ url: "https://example.com/webhook" }),
2416
- * ],
2417
- * })
2418
- * ```
2419
- */
2420
- plugins?: PluginDescriptor[];
2421
- /**
2422
- * Sandboxed plugins to load (run in isolated V8 isolates)
2423
- *
2424
- * Only works on Cloudflare with Worker Loader enabled.
2425
- * Uses the same format as `plugins` - the difference is where they run.
2426
- *
2427
- * @example
2428
- * ```ts
2429
- * import { untrustedPlugin } from "some-third-party-plugin";
2430
- *
2431
- * emdash({
2432
- * plugins: [trustedPlugin()], // runs in host
2433
- * sandboxed: [untrustedPlugin()], // runs in isolate
2434
- * sandboxRunner: "@emdash-cms/sandbox-cloudflare",
2435
- * })
2436
- * ```
2437
- */
2438
- sandboxed?: SandboxedPluginDescriptor[];
2439
- /**
2440
- * Module that exports the sandbox runner factory.
2441
- * Required if using sandboxed plugins.
2442
- *
2443
- * @example
2444
- * ```ts
2445
- * emdash({
2446
- * sandboxRunner: "@emdash-cms/sandbox-cloudflare",
2447
- * })
2448
- * ```
2449
- */
2450
- sandboxRunner?: string;
2451
- /**
2452
- * Authentication configuration
2453
- *
2454
- * Use an auth adapter function from a platform package:
2455
- * - `access({ teamDomain: "..." })` from `@emdash-cms/cloudflare`
2456
- *
2457
- * When an external auth provider is configured, passkey auth is disabled.
2458
- *
2459
- * @example
2460
- * ```ts
2461
- * import { access } from "@emdash-cms/cloudflare";
2462
- *
2463
- * emdash({
2464
- * auth: access({
2465
- * teamDomain: "myteam.cloudflareaccess.com",
2466
- * audience: "abc123...",
2467
- * roleMapping: {
2468
- * "Admins": 50,
2469
- * "Editors": 30,
2470
- * },
2471
- * }),
2472
- * })
2473
- * ```
2474
- */
2475
- auth?: AuthDescriptor;
2476
- /**
2477
- * Pluggable auth providers (login methods on the login page).
2478
- *
2479
- * Auth providers appear as options alongside passkey on the login page
2480
- * and setup wizard. Any provider can be used to create the initial
2481
- * admin account. Passkey is built-in; providers listed here are additive.
2482
- *
2483
- * @example
2484
- * ```ts
2485
- * import { atproto } from "@emdash-cms/auth-atproto";
2486
- *
2487
- * emdash({
2488
- * authProviders: [atproto()],
2489
- * })
2490
- * ```
2491
- */
2492
- authProviders?: AuthProviderDescriptor[];
2493
- /**
2494
- * MCP (Model Context Protocol) server endpoint.
2495
- *
2496
- * Exposes an MCP Streamable HTTP server at `/_emdash/api/mcp`
2497
- * that allows AI agents and tools to interact with the CMS using
2498
- * the standardized MCP protocol.
2499
- *
2500
- * Enabled by default. The endpoint requires bearer token auth, so
2501
- * it has no effect unless the user creates an API token and
2502
- * configures a client. Set to `false` to disable.
2503
- *
2504
- * @default true
2505
- */
2506
- mcp?: boolean;
2507
- /**
2508
- * Plugin marketplace URL
2509
- *
2510
- * When set, enables the marketplace features: browse, install, update,
2511
- * and uninstall plugins from a remote marketplace.
2512
- *
2513
- * Must be an HTTPS URL in production, or localhost/127.0.0.1 in dev.
2514
- * Requires `sandboxRunner` to be configured (marketplace plugins run sandboxed).
2515
- *
2516
- * @example
2517
- * ```ts
2518
- * emdash({
2519
- * marketplace: "https://marketplace.emdashcms.com",
2520
- * sandboxRunner: "@emdash-cms/sandbox-cloudflare",
2521
- * })
2522
- * ```
2523
- */
2524
- marketplace?: string;
2525
- /**
2526
- * Maximum allowed media file upload size in bytes.
2527
- *
2528
- * Applies to both direct multipart uploads and signed-URL uploads.
2529
- * When unset, defaults to 52_428_800 (50 MB).
2530
- *
2531
- * @example
2532
- * ```ts
2533
- * emdash({ maxUploadSize: 100 * 1024 * 1024 }) // 100 MB
2534
- * ```
2535
- */
2536
- maxUploadSize?: number;
2537
- /**
2538
- * Public browser-facing origin for the site.
2539
- *
2540
- * Use when `Astro.url` / `request.url` do not match what users open — common with a
2541
- * **TLS-terminating reverse proxy**: the app often sees `http://` on the internal hop
2542
- * while the browser uses `https://`, which breaks WebAuthn, CSRF, OAuth, and redirect URLs.
2543
- *
2544
- * Set to the full origin users type in the address bar (no path), e.g.
2545
- * `https://mysite.example.com`. When not set, falls back to environment variables
2546
- * `EMDASH_SITE_URL` > `SITE_URL`, then to the request URL's origin.
2547
- *
2548
- * Replaces `passkeyPublicOrigin` (which only fixed passkeys).
2549
- */
2550
- siteUrl?: string;
2551
- /**
2552
- * Headers to trust for client IP resolution when running behind a reverse
2553
- * proxy. The first header in this list that is present on the request
2554
- * wins. Applies to rate limiting for auth endpoints and comment
2555
- * submission.
2556
- *
2557
- * Common values:
2558
- * - `x-real-ip` — nginx, Caddy, Traefik
2559
- * - `fly-client-ip` — Fly.io
2560
- * - `x-forwarded-for` — generic (first entry is used)
2561
- *
2562
- * Only set this when you **control the reverse proxy**. Untrusted
2563
- * clients can set any header they like; trusting headers from an open
2564
- * network is an IP-spoofing vulnerability that defeats rate limiting.
2565
- *
2566
- * On Cloudflare the `cf` object on the request is used automatically —
2567
- * you normally don't need to set this. Leave unset (or empty) to
2568
- * preserve the default: IP is resolved only when the request came
2569
- * through Cloudflare's edge.
2570
- *
2571
- * Falls back to `EMDASH_TRUSTED_PROXY_HEADERS` env var (comma-separated)
2572
- * when this option is not set, so operators can configure at deploy
2573
- * time without touching the Astro config.
2574
- */
2575
- trustedProxyHeaders?: string[];
2576
- /**
2577
- * Enable playground mode for ephemeral "try EmDash" sites.
2578
- *
2579
- * When set, the integration injects a playground middleware (order: "pre")
2580
- * that runs BEFORE the normal EmDash middleware chain. It creates an
2581
- * isolated Durable Object database per session, runs migrations, applies
2582
- * the seed, creates an anonymous admin user, and sets the DB in ALS.
2583
- * By the time the runtime middleware runs, the database is fully ready.
2584
- *
2585
- * Setup and auth middleware are skipped (the playground handles both).
2586
- *
2587
- * Requires `@emdash-cms/cloudflare` as a dependency and a DO binding
2588
- * in wrangler.jsonc.
2589
- *
2590
- * @example
2591
- * ```ts
2592
- * emdash({
2593
- * database: playgroundDatabase({ binding: "PLAYGROUND_DB" }),
2594
- * playground: {
2595
- * middlewareEntrypoint: "@emdash-cms/cloudflare/db/playground-middleware",
2596
- * },
2597
- * })
2598
- * ```
2599
- */
2600
- playground?: {
2601
- /** Module path for the playground middleware. */middlewareEntrypoint: string;
2602
- };
2603
- /**
2604
- * Media providers for browsing and uploading media
2605
- *
2606
- * The local media provider (using storage adapter) is available by default.
2607
- * Additional providers can be added for external services like Unsplash,
2608
- * Cloudinary, Mux, Cloudflare Images, etc.
2609
- *
2610
- * @example
2611
- * ```ts
2612
- * import { cloudflareImages, cloudflareStream } from "@emdash-cms/cloudflare";
2613
- * import { unsplash } from "@emdash-cms/provider-unsplash";
2614
- *
2615
- * emdash({
2616
- * mediaProviders: [
2617
- * cloudflareImages({ accountId: "..." }),
2618
- * cloudflareStream({ accountId: "..." }),
2619
- * unsplash({ accessKey: "..." }),
2620
- * ],
2621
- * })
2622
- * ```
2623
- */
2624
- mediaProviders?: MediaProviderDescriptor[];
2625
- /**
2626
- * Admin UI font configuration.
2627
- *
2628
- * By default, EmDash loads Noto Sans via the Astro Font API, covering
2629
- * Latin, Latin Extended, Cyrillic, Cyrillic Extended, Greek, Greek
2630
- * Extended, Devanagari, and Vietnamese. Fonts are downloaded from
2631
- * Google at build time and self-hosted, so there are no runtime CDN
2632
- * requests.
2633
- *
2634
- * To add support for additional writing systems (Arabic, CJK, etc.),
2635
- * pass script names. EmDash resolves the matching Noto Sans variant
2636
- * from Google Fonts and merges all script faces under a single
2637
- * font-family, so the browser downloads only the glyphs it needs
2638
- * via unicode-range.
2639
- *
2640
- * Set to `false` to disable font injection entirely and use system fonts.
2641
- *
2642
- * @example
2643
- * ```ts
2644
- * // Add Arabic and Japanese support
2645
- * emdash({
2646
- * fonts: {
2647
- * scripts: ["arabic", "japanese"],
2648
- * },
2649
- * })
2650
- * ```
2651
- *
2652
- * @example
2653
- * ```ts
2654
- * // Disable web fonts entirely (use system fonts)
2655
- * emdash({
2656
- * fonts: false,
2657
- * })
2658
- * ```
2659
- */
2660
- fonts?: false | {
2661
- /**
2662
- * Additional Noto Sans script families to include.
2663
- *
2664
- * Available scripts: arabic, armenian, bengali, chinese-simplified,
2665
- * chinese-traditional, chinese-hongkong, devanagari, ethiopic, farsi,
2666
- * georgian, gujarati, gurmukhi, hebrew, japanese, kannada, khmer,
2667
- * korean, lao, malayalam, myanmar, oriya, sinhala, tamil, telugu,
2668
- * thai, tibetan.
2669
- */
2670
- scripts?: string[];
2671
- };
2672
- /**
2673
- * Admin UI branding (white-labeling).
2674
- *
2675
- * Overrides the default EmDash logo and name in the admin panel.
2676
- * Use this to white-label the CMS for agency or enterprise deployments.
2677
- * These settings are separate from the public site settings (title, logo,
2678
- * favicon) which remain available for SEO and front-end use.
2679
- *
2680
- * @example
2681
- * ```ts
2682
- * emdash({
2683
- * admin: {
2684
- * logo: "/images/agency-logo.webp",
2685
- * siteName: "AgencyX CMS",
2686
- * favicon: "/favicon.ico",
2687
- * },
2688
- * })
2689
- * ```
2690
- */
2691
- admin?: {
2692
- /** URL or path to a custom logo image for the admin UI (login page, sidebar). */logo?: string; /** Custom name displayed in the admin sidebar and browser tab. */
2693
- siteName?: string; /** URL or path to a custom favicon for the admin panel. */
2694
- favicon?: string;
2695
- };
2696
- }
2697
- /**
2698
- * Get stored config from global
2699
- * This is set by the virtual module at build time
2700
- */
2701
- declare function getStoredConfig(): EmDashConfig | null;
2702
- declare global {
2703
- var __emdashConfig: EmDashConfig | undefined;
2704
- } //# sourceMappingURL=runtime.d.ts.map
2705
- //#endregion
2706
- //#region src/plugins/manifest-schema.d.ts
2707
- /**
2708
- * Zod schema matching the PluginManifest interface from types.ts.
2709
- *
2710
- * Every JSON.parse of a manifest.json should validate through this.
2711
- */
2712
- declare const pluginManifestSchema: z$1.ZodObject<{
2713
- id: z$1.ZodString;
2714
- version: z$1.ZodString;
2715
- capabilities: z$1.ZodArray<z$1.ZodEnum<{
2716
- "network:fetch": "network:fetch";
2717
- "network:fetch:any": "network:fetch:any";
2718
- "read:content": "read:content";
2719
- "write:content": "write:content";
2720
- "read:media": "read:media";
2721
- "write:media": "write:media";
2722
- "read:users": "read:users";
2723
- "email:send": "email:send";
2724
- "email:provide": "email:provide";
2725
- "email:intercept": "email:intercept";
2726
- "page:inject": "page:inject";
2727
- }>>;
2728
- allowedHosts: z$1.ZodArray<z$1.ZodString>;
2729
- storage: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
2730
- indexes: z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
2731
- uniqueIndexes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>>;
2732
- }, z$1.core.$strip>>;
2733
- hooks: z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodEnum<{
2734
- "plugin:install": "plugin:install";
2735
- "plugin:activate": "plugin:activate";
2736
- "plugin:deactivate": "plugin:deactivate";
2737
- "plugin:uninstall": "plugin:uninstall";
2738
- "content:beforeSave": "content:beforeSave";
2739
- "content:afterSave": "content:afterSave";
2740
- "content:beforeDelete": "content:beforeDelete";
2741
- "content:afterDelete": "content:afterDelete";
2742
- "content:afterPublish": "content:afterPublish";
2743
- "content:afterUnpublish": "content:afterUnpublish";
2744
- "media:beforeUpload": "media:beforeUpload";
2745
- "media:afterUpload": "media:afterUpload";
2746
- cron: "cron";
2747
- "email:beforeSend": "email:beforeSend";
2748
- "email:deliver": "email:deliver";
2749
- "email:afterSend": "email:afterSend";
2750
- "comment:beforeCreate": "comment:beforeCreate";
2751
- "comment:moderate": "comment:moderate";
2752
- "comment:afterCreate": "comment:afterCreate";
2753
- "comment:afterModerate": "comment:afterModerate";
2754
- "page:metadata": "page:metadata";
2755
- "page:fragments": "page:fragments";
2756
- }>, z$1.ZodObject<{
2757
- name: z$1.ZodEnum<{
2758
- "plugin:install": "plugin:install";
2759
- "plugin:activate": "plugin:activate";
2760
- "plugin:deactivate": "plugin:deactivate";
2761
- "plugin:uninstall": "plugin:uninstall";
2762
- "content:beforeSave": "content:beforeSave";
2763
- "content:afterSave": "content:afterSave";
2764
- "content:beforeDelete": "content:beforeDelete";
2765
- "content:afterDelete": "content:afterDelete";
2766
- "content:afterPublish": "content:afterPublish";
2767
- "content:afterUnpublish": "content:afterUnpublish";
2768
- "media:beforeUpload": "media:beforeUpload";
2769
- "media:afterUpload": "media:afterUpload";
2770
- cron: "cron";
2771
- "email:beforeSend": "email:beforeSend";
2772
- "email:deliver": "email:deliver";
2773
- "email:afterSend": "email:afterSend";
2774
- "comment:beforeCreate": "comment:beforeCreate";
2775
- "comment:moderate": "comment:moderate";
2776
- "comment:afterCreate": "comment:afterCreate";
2777
- "comment:afterModerate": "comment:afterModerate";
2778
- "page:metadata": "page:metadata";
2779
- "page:fragments": "page:fragments";
2780
- }>;
2781
- exclusive: z$1.ZodOptional<z$1.ZodBoolean>;
2782
- priority: z$1.ZodOptional<z$1.ZodNumber>;
2783
- timeout: z$1.ZodOptional<z$1.ZodNumber>;
2784
- }, z$1.core.$strip>]>>;
2785
- routes: z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
2786
- name: z$1.ZodString;
2787
- public: z$1.ZodOptional<z$1.ZodBoolean>;
2788
- }, z$1.core.$strip>]>>;
2789
- admin: z$1.ZodObject<{
2790
- entry: z$1.ZodOptional<z$1.ZodString>;
2791
- settingsSchema: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2792
- type: z$1.ZodLiteral<"string">;
2793
- default: z$1.ZodOptional<z$1.ZodString>;
2794
- multiline: z$1.ZodOptional<z$1.ZodBoolean>;
2795
- label: z$1.ZodString;
2796
- description: z$1.ZodOptional<z$1.ZodString>;
2797
- }, z$1.core.$strip>, z$1.ZodObject<{
2798
- type: z$1.ZodLiteral<"number">;
2799
- default: z$1.ZodOptional<z$1.ZodNumber>;
2800
- min: z$1.ZodOptional<z$1.ZodNumber>;
2801
- max: z$1.ZodOptional<z$1.ZodNumber>;
2802
- label: z$1.ZodString;
2803
- description: z$1.ZodOptional<z$1.ZodString>;
2804
- }, z$1.core.$strip>, z$1.ZodObject<{
2805
- type: z$1.ZodLiteral<"boolean">;
2806
- default: z$1.ZodOptional<z$1.ZodBoolean>;
2807
- label: z$1.ZodString;
2808
- description: z$1.ZodOptional<z$1.ZodString>;
2809
- }, z$1.core.$strip>, z$1.ZodObject<{
2810
- type: z$1.ZodLiteral<"select">;
2811
- options: z$1.ZodArray<z$1.ZodObject<{
2812
- value: z$1.ZodString;
2813
- label: z$1.ZodString;
2814
- }, z$1.core.$strip>>;
2815
- default: z$1.ZodOptional<z$1.ZodString>;
2816
- label: z$1.ZodString;
2817
- description: z$1.ZodOptional<z$1.ZodString>;
2818
- }, z$1.core.$strip>, z$1.ZodObject<{
2819
- type: z$1.ZodLiteral<"secret">;
2820
- label: z$1.ZodString;
2821
- description: z$1.ZodOptional<z$1.ZodString>;
2822
- }, z$1.core.$strip>, z$1.ZodObject<{
2823
- type: z$1.ZodLiteral<"url">;
2824
- default: z$1.ZodOptional<z$1.ZodString>;
2825
- placeholder: z$1.ZodOptional<z$1.ZodString>;
2826
- label: z$1.ZodString;
2827
- description: z$1.ZodOptional<z$1.ZodString>;
2828
- }, z$1.core.$strip>, z$1.ZodObject<{
2829
- type: z$1.ZodLiteral<"email">;
2830
- default: z$1.ZodOptional<z$1.ZodString>;
2831
- placeholder: z$1.ZodOptional<z$1.ZodString>;
2832
- label: z$1.ZodString;
2833
- description: z$1.ZodOptional<z$1.ZodString>;
2834
- }, z$1.core.$strip>], "type">>>;
2835
- pages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2836
- path: z$1.ZodString;
2837
- label: z$1.ZodString;
2838
- icon: z$1.ZodOptional<z$1.ZodString>;
2839
- }, z$1.core.$strip>>>;
2840
- widgets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2841
- id: z$1.ZodString;
2842
- size: z$1.ZodOptional<z$1.ZodEnum<{
2843
- full: "full";
2844
- half: "half";
2845
- third: "third";
2846
- }>>;
2847
- title: z$1.ZodOptional<z$1.ZodString>;
2848
- }, z$1.core.$strip>>>;
2849
- fieldWidgets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2850
- name: z$1.ZodString;
2851
- label: z$1.ZodString;
2852
- fieldTypes: z$1.ZodArray<z$1.ZodEnum<{
2853
- string: "string";
2854
- number: "number";
2855
- boolean: "boolean";
2856
- text: "text";
2857
- integer: "integer";
2858
- datetime: "datetime";
2859
- select: "select";
2860
- multiSelect: "multiSelect";
2861
- portableText: "portableText";
2862
- image: "image";
2863
- file: "file";
2864
- reference: "reference";
2865
- json: "json";
2866
- slug: "slug";
2867
- repeater: "repeater";
2868
- }>>;
2869
- elements: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2870
- type: z$1.ZodString;
2871
- action_id: z$1.ZodString;
2872
- label: z$1.ZodOptional<z$1.ZodString>;
2873
- }, z$1.core.$loose>>>;
2874
- }, z$1.core.$strip>>>;
2875
- }, z$1.core.$strip>;
2876
- }, z$1.core.$strip>;
2877
- type ValidatedPluginManifest = z$1.infer<typeof pluginManifestSchema>;
2878
- //#endregion
2879
- //#region src/plugins/hooks.d.ts
2880
- type HookNameV2 = "plugin:install" | "plugin:activate" | "plugin:deactivate" | "plugin:uninstall" | "content:beforeSave" | "content:afterSave" | "content:beforeDelete" | "content:afterDelete" | "content:afterPublish" | "content:afterUnpublish" | "media:beforeUpload" | "media:afterUpload" | "cron" | "email:beforeSend" | "email:deliver" | "email:afterSend" | "comment:beforeCreate" | "comment:moderate" | "comment:afterCreate" | "comment:afterModerate" | "page:metadata" | "page:fragments";
2881
- /**
2882
- * Hook execution result
2883
- */
2884
- interface HookResult<T> {
2885
- success: boolean;
2886
- value?: T;
2887
- error?: Error;
2888
- pluginId: string;
2889
- duration: number;
2890
- }
2891
- /**
2892
- * Hook pipeline for executing hooks in order
2893
- */
2894
- declare class HookPipeline {
2895
- private hooks;
2896
- private pluginMap;
2897
- private contextFactory;
2898
- /** Stored so setContextFactory can merge incrementally. */
2899
- private contextFactoryOptions;
2900
- /** Hook names where at least one handler declared exclusive: true */
2901
- private exclusiveHookNames;
2902
- /**
2903
- * Selected provider plugin ID for each exclusive hook.
2904
- * Set by the PluginManager after resolution.
2905
- */
2906
- private exclusiveSelections;
2907
- constructor(plugins: ResolvedPlugin[], factoryOptions?: PluginContextFactoryOptions);
2908
- /**
2909
- * Set or update the context factory options.
2910
- *
2911
- * When called on a pipeline that already has a factory, the new options
2912
- * are merged on top of the existing ones so that callers don't need to
2913
- * repeat every field (e.g. adding `cronReschedule` without losing
2914
- * `storage` / `getUploadUrl`).
2915
- */
2916
- setContextFactory(options: Partial<PluginContextFactoryOptions>): void;
2917
- /**
2918
- * Get context for a plugin
2919
- */
2920
- private getContext;
2921
- /**
2922
- * Get typed hooks for a specific hook name.
2923
- * The internal map stores ResolvedHook<unknown>, but we know each name
2924
- * maps to a specific handler type via HookHandlerMap.
2925
- *
2926
- * Exclusive hooks that have a selected provider are filtered out — they
2927
- * should only run via invokeExclusiveHook(), not in the regular pipeline.
2928
- */
2929
- private getTypedHooks;
2930
- /**
2931
- * Register all hooks from plugins.
2932
- *
2933
- * Registers each hook name individually to preserve type safety. The
2934
- * internal map stores ResolvedHook<unknown> since it's keyed by string,
2935
- * but getTypedHooks() restores the correct handler type on retrieval.
2936
- */
2937
- private registerPlugins;
2938
- /**
2939
- * Maps hook names to the capability required to register them.
2940
- *
2941
- * Hooks not listed here have no capability requirement (e.g. lifecycle
2942
- * hooks, cron). Any plugin declaring a listed hook without the required
2943
- * capability will have that hook silently skipped at registration time.
2944
- */
2945
- private static readonly HOOK_REQUIRED_CAPABILITY;
2946
- /**
2947
- * Register a single plugin's hook by name
2948
- */
2949
- private registerPluginHook;
2950
- /**
2951
- * Register a single hook
2952
- */
2953
- private registerHook;
2954
- /**
2955
- * Sort hooks by priority and dependencies
2956
- */
2957
- private sortHooks;
2958
- /**
2959
- * Execute a hook with timeout
2960
- */
2961
- private executeWithTimeout;
2962
- /**
2963
- * Run plugin:install hooks
2964
- */
2965
- runPluginInstall(pluginId: string): Promise<HookResult<void>[]>;
2966
- /**
2967
- * Run plugin:activate hooks
2968
- */
2969
- runPluginActivate(pluginId: string): Promise<HookResult<void>[]>;
2970
- /**
2971
- * Run plugin:deactivate hooks
2972
- */
2973
- runPluginDeactivate(pluginId: string): Promise<HookResult<void>[]>;
2974
- /**
2975
- * Run plugin:uninstall hooks
2976
- */
2977
- runPluginUninstall(pluginId: string, deleteData: boolean): Promise<HookResult<void>[]>;
2978
- private runLifecycleHook;
2979
- /**
2980
- * Run content:beforeSave hooks
2981
- * Returns modified content from the pipeline
2982
- */
2983
- runContentBeforeSave(content: Record<string, unknown>, collection: string, isNew: boolean): Promise<{
2984
- content: Record<string, unknown>;
2985
- results: HookResult<Record<string, unknown>>[];
2986
- }>;
2987
- /**
2988
- * Run content:afterSave hooks
2989
- */
2990
- runContentAfterSave(content: Record<string, unknown>, collection: string, isNew: boolean): Promise<HookResult<void>[]>;
2991
- /**
2992
- * Run content:beforeDelete hooks
2993
- * Returns whether deletion is allowed
2994
- */
2995
- runContentBeforeDelete(id: string, collection: string): Promise<{
2996
- allowed: boolean;
2997
- results: HookResult<boolean>[];
2998
- }>;
2999
- /**
3000
- * Run content:afterDelete hooks
3001
- */
3002
- runContentAfterDelete(id: string, collection: string, permanent: boolean): Promise<HookResult<void>[]>;
3003
- /**
3004
- * Run content:afterPublish hooks (fire-and-forget).
3005
- */
3006
- runContentAfterPublish(content: Record<string, unknown>, collection: string): Promise<HookResult<void>[]>;
3007
- /**
3008
- * Run content:afterUnpublish hooks (fire-and-forget).
3009
- */
3010
- runContentAfterUnpublish(content: Record<string, unknown>, collection: string): Promise<HookResult<void>[]>;
3011
- /**
3012
- * Run media:beforeUpload hooks
3013
- */
3014
- runMediaBeforeUpload(file: {
3015
- name: string;
3016
- type: string;
3017
- size: number;
3018
- }): Promise<{
3019
- file: {
3020
- name: string;
3021
- type: string;
3022
- size: number;
3023
- };
3024
- results: HookResult<{
3025
- name: string;
3026
- type: string;
3027
- size: number;
3028
- }>[];
3029
- }>;
3030
- /**
3031
- * Run media:afterUpload hooks
3032
- */
3033
- runMediaAfterUpload(media: {
3034
- id: string;
3035
- filename: string;
3036
- mimeType: string;
3037
- size: number | null;
3038
- url: string;
3039
- createdAt: string;
3040
- }): Promise<HookResult<void>[]>;
3041
- /**
3042
- * Invoke the cron hook for a specific plugin.
3043
- *
3044
- * Unlike other hooks which broadcast to all plugins, the cron hook is
3045
- * dispatched only to the target plugin — the one that owns the task.
3046
- */
3047
- invokeCronHook(pluginId: string, event: CronEvent): Promise<HookResult<void>>;
3048
- /**
3049
- * Run email:beforeSend hooks (middleware pipeline).
3050
- *
3051
- * Each handler receives the message and returns a modified message or
3052
- * `false` to cancel delivery. The pipeline chains message transformations —
3053
- * each handler receives the output of the previous one.
3054
- */
3055
- runEmailBeforeSend(message: EmailMessage, source: string): Promise<{
3056
- message: EmailMessage | false;
3057
- results: HookResult<EmailMessage | false>[];
3058
- }>;
3059
- /**
3060
- * Run email:afterSend hooks (fire-and-forget).
3061
- *
3062
- * Errors are logged but don't propagate — they don't affect the caller.
3063
- */
3064
- runEmailAfterSend(message: EmailMessage, source: string): Promise<HookResult<void>[]>;
3065
- /**
3066
- * Run comment:beforeCreate hooks (middleware pipeline).
3067
- *
3068
- * Each handler receives the event and returns a modified event or
3069
- * `false` to reject the comment. The pipeline chains transformations —
3070
- * each handler receives the output of the previous one.
3071
- */
3072
- runCommentBeforeCreate(event: CommentBeforeCreateEvent): Promise<CommentBeforeCreateEvent | false>;
3073
- /**
3074
- * Run comment:afterCreate hooks (fire-and-forget).
3075
- *
3076
- * Errors are logged but don't propagate — they don't affect the caller.
3077
- */
3078
- runCommentAfterCreate(event: CommentAfterCreateEvent): Promise<void>;
3079
- /**
3080
- * Run comment:afterModerate hooks (fire-and-forget).
3081
- *
3082
- * Errors are logged but don't propagate — they don't affect the caller.
3083
- */
3084
- runCommentAfterModerate(event: CommentAfterModerateEvent): Promise<void>;
3085
- /**
3086
- * Run page:metadata hooks. Each handler returns contributions that are
3087
- * merged by the metadata collector. Errors are logged but don't propagate.
3088
- */
3089
- runPageMetadata(event: PageMetadataEvent): Promise<Array<{
3090
- pluginId: string;
3091
- contributions: PageMetadataContribution[];
3092
- }>>;
3093
- /**
3094
- * Run page:fragments hooks. Only trusted plugins should be registered
3095
- * for this hook. Errors are logged but don't propagate.
3096
- */
3097
- runPageFragments(event: PageFragmentEvent): Promise<Array<{
3098
- pluginId: string;
3099
- contributions: PageFragmentContribution[];
3100
- }>>;
3101
- /**
3102
- * Check if any hooks are registered for a given name
3103
- */
3104
- hasHooks(name: HookNameV2): boolean;
3105
- /**
3106
- * Get hook count for debugging
3107
- */
3108
- getHookCount(name: HookNameV2): number;
3109
- /**
3110
- * Get all registered hook names
3111
- */
3112
- getRegisteredHooks(): HookNameV2[];
3113
- /**
3114
- * Returns hook names where at least one handler declared exclusive: true
3115
- */
3116
- getRegisteredExclusiveHooks(): string[];
3117
- /**
3118
- * Check if a hook is exclusive
3119
- */
3120
- isExclusiveHook(name: string): boolean;
3121
- /**
3122
- * Set the selected provider for an exclusive hook.
3123
- * Called by PluginManager after resolution.
3124
- */
3125
- setExclusiveSelection(hookName: string, pluginId: string): void;
3126
- /**
3127
- * Clear the selected provider for an exclusive hook.
3128
- */
3129
- clearExclusiveSelection(hookName: string): void;
3130
- /**
3131
- * Get the selected provider for an exclusive hook (if any).
3132
- */
3133
- getExclusiveSelection(hookName: string): string | undefined;
3134
- /**
3135
- * Get all plugins that registered a handler for a given exclusive hook.
3136
- */
3137
- getExclusiveHookProviders(hookName: string): Array<{
3138
- pluginId: string;
3139
- }>;
3140
- /**
3141
- * Get all plugins that registered a non-exclusive handler for a given
3142
- * hook (e.g. `email:beforeSend`, `email:afterSend`), preserving priority
3143
- * order. Partitions with `getExclusiveHookProviders()`, which returns
3144
- * plugins whose registration is marked `exclusive: true`.
3145
- */
3146
- getHookProviders(hookName: string): Array<{
3147
- pluginId: string;
3148
- }>;
3149
- /**
3150
- * Invoke an exclusive hook — dispatch only to the selected provider.
3151
- * Returns null if no provider is selected or if the selected hook
3152
- * is not found in the pipeline.
3153
- *
3154
- * This is a generic dispatch used by the email pipeline and other
3155
- * exclusive hook consumers. The handler type is unknown — callers
3156
- * must know the expected signature.
3157
- *
3158
- * Errors are isolated: a failing handler returns an error result
3159
- * instead of propagating the exception to the caller.
3160
- */
3161
- invokeExclusiveHook(hookName: string, event: unknown): Promise<{
3162
- result: unknown;
3163
- pluginId: string;
3164
- error?: Error;
3165
- duration: number;
3166
- } | null>;
3167
- }
3168
- /**
3169
- * Create a hook pipeline from plugins
3170
- */
3171
- declare function createHookPipeline(plugins: ResolvedPlugin[], factoryOptions?: PluginContextFactoryOptions): HookPipeline;
3172
- //#endregion
3173
- //#region src/plugins/email.d.ts
3174
- /**
3175
- * EmailPipeline orchestrates email delivery through the plugin hook system.
3176
- *
3177
- * The pipeline runs in three stages:
3178
- * 1. email:beforeSend — middleware hooks that can transform or cancel messages
3179
- * 2. email:deliver — exclusive hook dispatching to the selected provider
3180
- * 3. email:afterSend — fire-and-forget hooks for logging/analytics
3181
- */
3182
- declare class EmailPipeline {
3183
- private pipeline;
3184
- constructor(pipeline: HookPipeline);
3185
- /**
3186
- * Replace the underlying hook pipeline.
3187
- *
3188
- * Called by the runtime when rebuilding the hook pipeline after a
3189
- * plugin is enabled or disabled, so the email pipeline dispatches
3190
- * to the current set of active hooks.
3191
- */
3192
- setPipeline(pipeline: HookPipeline): void;
3193
- /**
3194
- * Send an email through the full pipeline.
3195
- *
3196
- * @param message - The email to send
3197
- * @param source - Where the email originated ("system" for auth, plugin ID for plugins)
3198
- * @throws EmailNotConfiguredError if no provider is selected
3199
- * @throws EmailRecursionError if called re-entrantly from within a hook
3200
- * @throws Error if the provider handler throws
3201
- */
3202
- send(message: EmailMessage, source: string): Promise<void>;
3203
- /**
3204
- * Inner send implementation, separated from the recursion guard.
3205
- */
3206
- private sendInner;
3207
- /**
3208
- * Check if an email provider is configured and available.
3209
- *
3210
- * Returns true if an email:deliver provider is selected in the exclusive
3211
- * hook system. Plugins and auth code use this to decide whether to show
3212
- * "send invite" vs "copy invite link" UI.
3213
- */
3214
- isAvailable(): boolean;
3215
- }
3216
- //#endregion
3217
- //#region src/plugins/context.d.ts
3218
- /**
3219
- * Options for creating site info
3220
- */
3221
- interface SiteInfoOptions {
3222
- /** Site name from options table */
3223
- siteName?: string;
3224
- /** Site URL from options table or Astro config */
3225
- siteUrl?: string;
3226
- /** Site locale from options table */
3227
- locale?: string;
3228
- }
3229
- interface PluginContextFactoryOptions {
3230
- db: Kysely<Database>;
3231
- /**
3232
- * Storage backend for direct media uploads.
3233
- * If not provided, upload() will throw.
3234
- */
3235
- storage?: Storage;
3236
- /**
3237
- * Function to generate upload URLs for media.
3238
- * If not provided, media write operations will throw.
3239
- */
3240
- getUploadUrl?: (filename: string, contentType: string) => Promise<{
3241
- uploadUrl: string;
3242
- mediaId: string;
3243
- }>;
3244
- /**
3245
- * Site information for ctx.site and ctx.url().
3246
- * If not provided, site info will have empty defaults.
3247
- */
3248
- siteInfo?: SiteInfoOptions;
3249
- /**
3250
- * Callback to notify the cron scheduler that the next due time may have changed.
3251
- * If not provided, ctx.cron will not be available.
3252
- */
3253
- cronReschedule?: () => void;
3254
- /**
3255
- * Email pipeline instance for ctx.email.
3256
- * If not provided (or no provider configured), ctx.email will be undefined.
3257
- */
3258
- emailPipeline?: EmailPipeline;
3259
- /**
3260
- * Pre-resolved list of trusted proxy header names (from the runtime
3261
- * `EmDashConfig.trustedProxyHeaders` or the env var). Plugin route
3262
- * handlers pass this to `extractRequestMeta` so plugins see the same
3263
- * client IP the core auth path does.
3264
- */
3265
- trustedProxyHeaders?: string[];
3266
- }
3267
- //#endregion
3268
- //#region src/plugins/routes.d.ts
3269
- /**
3270
- * Result from a route invocation
3271
- */
3272
- interface RouteResult<T = unknown> {
3273
- success: boolean;
3274
- data?: T;
3275
- error?: {
3276
- code: string;
3277
- message: string;
3278
- details?: unknown;
3279
- };
3280
- status: number;
3281
- }
3282
- /**
3283
- * Route invocation options
3284
- */
3285
- interface InvokeRouteOptions {
3286
- /** The original request */
3287
- request: Request;
3288
- /** Request body (already parsed) */
3289
- body?: unknown;
3290
- }
3291
- /**
3292
- * Error class for plugin routes
3293
- * Allows plugins to return structured errors with specific HTTP status codes
3294
- */
3295
- declare class PluginRouteError extends Error {
3296
- code: string;
3297
- status: number;
3298
- details?: unknown | undefined;
3299
- constructor(code: string, message: string, status?: number, details?: unknown | undefined);
3300
- /**
3301
- * Create a bad request error (400)
3302
- */
3303
- static badRequest(message: string, details?: unknown): PluginRouteError;
3304
- /**
3305
- * Create an unauthorized error (401)
3306
- */
3307
- static unauthorized(message?: string): PluginRouteError;
3308
- /**
3309
- * Create a forbidden error (403)
3310
- */
3311
- static forbidden(message?: string): PluginRouteError;
3312
- /**
3313
- * Create a not found error (404)
3314
- */
3315
- static notFound(message?: string): PluginRouteError;
3316
- /**
3317
- * Create a conflict error (409)
3318
- */
3319
- static conflict(message: string, details?: unknown): PluginRouteError;
3320
- /**
3321
- * Create an internal error (500)
3322
- */
3323
- static internal(message?: string): PluginRouteError;
3324
- }
3325
- //#endregion
3326
- //#region src/plugins/manager.d.ts
3327
- /**
3328
- * Plugin state in the manager
3329
- */
3330
- type PluginState = "registered" | "installed" | "active" | "inactive";
3331
- /**
3332
- * Plugin manager options
3333
- */
3334
- interface PluginManagerOptions {
3335
- /** Database instance */
3336
- db: Kysely<Database>;
3337
- /** Storage backend for direct media uploads */
3338
- storage?: Storage;
3339
- /** Function to generate upload URLs for media */
3340
- getUploadUrl?: (filename: string, contentType: string) => Promise<{
3341
- uploadUrl: string;
3342
- mediaId: string;
3343
- }>;
3344
- /**
3345
- * Pre-resolved list of trusted proxy header names for client-IP
3346
- * resolution in plugin route handlers. Thread through from the runtime.
3347
- */
3348
- trustedProxyHeaders?: string[];
3349
- }
3350
- /**
3351
- * Plugin Manager v2
3352
- *
3353
- * Manages the full lifecycle of plugins and coordinates hooks/routes.
3354
- */
3355
- declare class PluginManager {
3356
- private options;
3357
- private plugins;
3358
- private hookPipeline;
3359
- private routeRegistry;
3360
- private factoryOptions;
3361
- private initialized;
3362
- constructor(options: PluginManagerOptions);
3363
- /**
3364
- * Set the email pipeline used when creating plugin contexts.
3365
- * Reinitializes routes/hooks if already initialized so ctx.email is available immediately.
3366
- */
3367
- setEmailPipeline(pipeline: EmailPipeline): void;
3368
- /**
3369
- * Register a plugin definition
3370
- * This resolves the definition and adds it to the manager, but doesn't install it
3371
- */
3372
- register<TStorage extends PluginStorageConfig>(definition: PluginDefinition<TStorage>): ResolvedPlugin<TStorage>;
3373
- /**
3374
- * Register multiple plugins
3375
- */
3376
- registerAll(definitions: PluginDefinition[]): void;
3377
- /**
3378
- * Unregister a plugin
3379
- * Plugin must be inactive or just registered
3380
- */
3381
- unregister(pluginId: string): boolean;
3382
- /**
3383
- * Install a plugin (run install hooks, set up storage)
3384
- */
3385
- install(pluginId: string): Promise<HookResult<void>[]>;
3386
- /**
3387
- * Activate a plugin (run activate hooks, enable hooks/routes)
3388
- */
3389
- activate(pluginId: string): Promise<HookResult<void>[]>;
3390
- /**
3391
- * Deactivate a plugin (run deactivate hooks, disable hooks/routes)
3392
- */
3393
- deactivate(pluginId: string): Promise<HookResult<void>[]>;
3394
- /**
3395
- * Uninstall a plugin (run uninstall hooks, optionally delete data)
3396
- */
3397
- uninstall(pluginId: string, deleteData?: boolean): Promise<HookResult<void>[]>;
3398
- /**
3399
- * Run content:beforeSave hooks across all active plugins
3400
- */
3401
- runContentBeforeSave(content: Record<string, unknown>, collection: string, isNew: boolean): Promise<{
3402
- content: Record<string, unknown>;
3403
- results: HookResult<Record<string, unknown>>[];
3404
- }>;
3405
- /**
3406
- * Run content:afterSave hooks across all active plugins
3407
- */
3408
- runContentAfterSave(content: Record<string, unknown>, collection: string, isNew: boolean): Promise<HookResult<void>[]>;
3409
- /**
3410
- * Run content:beforeDelete hooks across all active plugins
3411
- */
3412
- runContentBeforeDelete(id: string, collection: string): Promise<{
3413
- allowed: boolean;
3414
- results: HookResult<boolean>[];
3415
- }>;
3416
- /**
3417
- * Run content:afterDelete hooks across all active plugins
3418
- */
3419
- runContentAfterDelete(id: string, collection: string, permanent: boolean): Promise<HookResult<void>[]>;
3420
- /**
3421
- * Run content:afterPublish hooks across all active plugins
3422
- */
3423
- runContentAfterPublish(content: Record<string, unknown>, collection: string): Promise<HookResult<void>[]>;
3424
- /**
3425
- * Run content:afterUnpublish hooks across all active plugins
3426
- */
3427
- runContentAfterUnpublish(content: Record<string, unknown>, collection: string): Promise<HookResult<void>[]>;
3428
- /**
3429
- * Run media:beforeUpload hooks across all active plugins
3430
- */
3431
- runMediaBeforeUpload(file: {
3432
- name: string;
3433
- type: string;
3434
- size: number;
3435
- }): Promise<{
3436
- file: {
3437
- name: string;
3438
- type: string;
3439
- size: number;
3440
- };
3441
- results: HookResult<{
3442
- name: string;
3443
- type: string;
3444
- size: number;
3445
- }>[];
3446
- }>;
3447
- /**
3448
- * Run media:afterUpload hooks across all active plugins
3449
- */
3450
- runMediaAfterUpload(media: MediaItem$1): Promise<HookResult<void>[]>;
3451
- /**
3452
- * Invoke the cron hook for a specific plugin (per-plugin dispatch).
3453
- * Used as the InvokeCronHookFn callback for CronExecutor.
3454
- */
3455
- invokeCronHook(pluginId: string, event: CronEvent): Promise<void>;
3456
- /**
3457
- * Invoke a plugin route
3458
- */
3459
- invokeRoute(pluginId: string, routeName: string, options: InvokeRouteOptions): Promise<RouteResult>;
3460
- /**
3461
- * Get all routes for a plugin
3462
- */
3463
- getPluginRoutes(pluginId: string): string[];
3464
- /**
3465
- * Get a plugin by ID
3466
- */
3467
- getPlugin(pluginId: string): ResolvedPlugin | undefined;
3468
- /**
3469
- * Get plugin state
3470
- */
3471
- getPluginState(pluginId: string): PluginState | undefined;
3472
- /**
3473
- * Get all registered plugins
3474
- */
3475
- getAllPlugins(): Array<{
3476
- plugin: ResolvedPlugin;
3477
- state: PluginState;
3478
- }>;
3479
- /**
3480
- * Get all active plugins
3481
- */
3482
- getActivePlugins(): ResolvedPlugin[];
3483
- /**
3484
- * Check if a plugin exists
3485
- */
3486
- hasPlugin(pluginId: string): boolean;
3487
- /**
3488
- * Check if a plugin is active
3489
- */
3490
- isActive(pluginId: string): boolean;
3491
- /**
3492
- * Get all plugins that registered a handler for an exclusive hook.
3493
- */
3494
- getExclusiveHookProviders(hookName: string): Array<{
3495
- pluginId: string;
3496
- pluginName: string;
3497
- }>;
3498
- /**
3499
- * Read the selected provider for an exclusive hook from the options table.
3500
- */
3501
- getExclusiveHookSelection(hookName: string): Promise<string | null>;
3502
- /**
3503
- * Set the selected provider for an exclusive hook in the options table.
3504
- * Pass null to clear the selection.
3505
- */
3506
- setExclusiveHookSelection(hookName: string, pluginId: string | null): Promise<void>;
3507
- /**
3508
- * Resolution algorithm for exclusive hooks.
3509
- *
3510
- * Delegates to the shared resolveExclusiveHooks() function.
3511
- * See hooks.ts for the full algorithm description.
3512
- */
3513
- resolveExclusiveHooks(preferredHints?: Map<string, string[]>): Promise<void>;
3514
- /**
3515
- * Get all exclusive hooks with their providers and current selections.
3516
- * Used by the admin API.
3517
- */
3518
- getExclusiveHooksInfo(): Promise<Array<{
3519
- hookName: string;
3520
- providers: Array<{
3521
- pluginId: string;
3522
- }>;
3523
- selectedPluginId: string | null;
3524
- }>>;
3525
- /**
3526
- * Initialize or reinitialize the hook pipeline and route registry
3527
- */
3528
- private ensureInitialized;
3529
- /**
3530
- * Force reinitialization (useful after plugin state changes)
3531
- */
3532
- reinitialize(): void;
3533
- /**
3534
- * Delete all cron tasks for a plugin.
3535
- * Used during uninstall.
3536
- */
3537
- private deleteCronTasks;
3538
- }
3539
- /**
3540
- * Create a plugin manager
3541
- */
3542
- declare function createPluginManager(options: PluginManagerOptions): PluginManager;
3543
- //#endregion
3544
- //#region src/plugins/sandbox/noop.d.ts
3545
- /**
3546
- * Error thrown when attempting to use sandboxing on an unsupported platform.
3547
- */
3548
- declare class SandboxNotAvailableError extends Error {
3549
- constructor();
3550
- }
3551
- /**
3552
- * No-op sandbox runner for platforms without isolation support.
3553
- *
3554
- * - `isAvailable()` returns false
3555
- * - `load()` throws SandboxNotAvailableError
3556
- * - `terminateAll()` is a no-op
3557
- *
3558
- * This is the default runner when no platform adapter is configured.
3559
- */
3560
- declare class NoopSandboxRunner implements SandboxRunner {
3561
- /**
3562
- * Always returns false - sandboxing is not available.
3563
- */
3564
- isAvailable(): boolean;
3565
- /**
3566
- * Always throws - can't load sandboxed plugins without isolation.
3567
- */
3568
- load(_manifest: PluginManifest, _code: string): Promise<SandboxedPlugin>;
3569
- /**
3570
- * No-op - sandboxing not available, email callback is irrelevant.
3571
- */
3572
- setEmailSend(): void;
3573
- /**
3574
- * No-op - nothing to terminate.
3575
- */
3576
- terminateAll(): Promise<void>;
3577
- }
3578
- /**
3579
- * Create a no-op sandbox runner.
3580
- * This is used as the default when no platform adapter is configured.
3581
- */
3582
- declare function createNoopSandboxRunner(_options?: SandboxOptions): SandboxRunner;
3583
- //#endregion
3584
- //#region src/import/types.d.ts
3585
- /** Author info from WordPress */
3586
- interface WpAuthorInfo {
3587
- id?: number;
3588
- login?: string;
3589
- email?: string;
3590
- displayName?: string;
3591
- postCount: number;
3592
- }
3593
- /** File-based input (WXR upload) */
3594
- interface FileInput {
3595
- type: "file";
3596
- file: File;
3597
- }
3598
- /** URL-based input (REST API probe) */
3599
- interface UrlInput {
3600
- type: "url";
3601
- url: string;
3602
- /** Optional auth token for authenticated requests */
3603
- token?: string;
3604
- }
3605
- /** OAuth-based input (WordPress.com) */
3606
- interface OAuthInput {
3607
- type: "oauth";
3608
- url: string;
3609
- accessToken: string;
3610
- /** Site ID for WordPress.com */
3611
- siteId?: string;
3612
- }
3613
- type SourceInput = FileInput | UrlInput | OAuthInput;
3614
- /** Auth requirements for an import source */
3615
- interface SourceAuth {
3616
- type: "oauth" | "token" | "password" | "none";
3617
- /** OAuth provider identifier */
3618
- provider?: string;
3619
- /** OAuth authorization URL */
3620
- oauthUrl?: string;
3621
- /** Human-readable instructions */
3622
- instructions?: string;
3623
- }
3624
- /** What the source can provide */
3625
- interface SourceCapabilities {
3626
- /** Can fetch published content without auth */
3627
- publicContent: boolean;
3628
- /** Can fetch drafts/private (may need auth) */
3629
- privateContent: boolean;
3630
- /** Can fetch all custom post types */
3631
- customPostTypes: boolean;
3632
- /** Can fetch all meta fields */
3633
- allMeta: boolean;
3634
- /** Can stream media directly */
3635
- mediaStream: boolean;
3636
- }
3637
- /** Suggested next action after probe */
3638
- type SuggestedAction = {
3639
- type: "proceed";
3640
- } | {
3641
- type: "oauth";
3642
- url: string;
3643
- provider: string;
3644
- } | {
3645
- type: "upload";
3646
- instructions: string;
3647
- } | {
3648
- type: "install-plugin";
3649
- instructions: string;
3650
- };
3651
- /** Detected i18n/multilingual plugin info */
3652
- interface I18nDetection {
3653
- /** Multilingual plugin name (e.g. "wpml", "polylang") */
3654
- plugin: string;
3655
- /** BCP 47 default locale */
3656
- defaultLocale: string;
3657
- /** All configured locales */
3658
- locales: string[];
3659
- }
3660
- /** Result of probing a URL for a specific source */
3661
- interface SourceProbeResult {
3662
- /** Which source can handle this */
3663
- sourceId: string;
3664
- /** Confidence level */
3665
- confidence: "definite" | "likely" | "possible";
3666
- /** What we detected */
3667
- detected: {
3668
- platform: string;
3669
- version?: string;
3670
- siteTitle?: string;
3671
- siteUrl?: string;
3672
- };
3673
- /** What capabilities are available */
3674
- capabilities: SourceCapabilities;
3675
- /** What auth is needed, if any */
3676
- auth?: SourceAuth;
3677
- /** Suggested next step */
3678
- suggestedAction: SuggestedAction;
3679
- /** Preview data if available (e.g., post counts from REST API) */
3680
- preview?: {
3681
- posts?: number;
3682
- pages?: number;
3683
- media?: number;
3684
- };
3685
- /** Detected multilingual plugin. Absent when none detected. */
3686
- i18n?: I18nDetection;
3687
- }
3688
- /** Combined probe result from all sources */
3689
- interface ProbeResult {
3690
- url: string;
3691
- isWordPress: boolean;
3692
- /** Best matching source (highest confidence) */
3693
- bestMatch: SourceProbeResult | null;
3694
- /** All matching sources */
3695
- allMatches: SourceProbeResult[];
3696
- }
3697
- /** Field definition for import */
3698
- interface ImportFieldDef {
3699
- slug: string;
3700
- label: string;
3701
- type: string;
3702
- required: boolean;
3703
- searchable?: boolean;
3704
- }
3705
- /** Field compatibility with existing schema */
3706
- type FieldCompatibility = "compatible" | "type_mismatch" | "missing";
3707
- /** Schema status for a collection */
3708
- interface CollectionSchemaStatus {
3709
- exists: boolean;
3710
- fieldStatus: Record<string, {
3711
- status: FieldCompatibility;
3712
- existingType?: string;
3713
- requiredType: string;
3714
- }>;
3715
- canImport: boolean;
3716
- reason?: string;
3717
- }
3718
- /** Analysis of a single post type */
3719
- interface PostTypeAnalysis {
3720
- name: string;
3721
- count: number;
3722
- suggestedCollection: string;
3723
- requiredFields: ImportFieldDef[];
3724
- schemaStatus: CollectionSchemaStatus;
3725
- }
3726
- /** Attachment/media info */
3727
- interface AttachmentInfo {
3728
- id?: number;
3729
- title?: string;
3730
- url?: string;
3731
- filename?: string;
3732
- mimeType?: string;
3733
- alt?: string;
3734
- caption?: string;
3735
- width?: number;
3736
- height?: number;
3737
- }
3738
- /** Navigation menu analysis */
3739
- interface NavMenuAnalysis {
3740
- /** Menu name/slug */
3741
- name: string;
3742
- /** Menu display label */
3743
- label: string;
3744
- /** Number of items in this menu */
3745
- itemCount: number;
3746
- }
3747
- /** Custom taxonomy analysis */
3748
- interface TaxonomyAnalysis {
3749
- /** Taxonomy slug (e.g., 'genre', 'portfolio_category') */
3750
- slug: string;
3751
- /** Number of terms in this taxonomy */
3752
- termCount: number;
3753
- /** Sample term names */
3754
- sampleTerms: string[];
3755
- }
3756
- /** Reusable block analysis (wp_block post type) */
3757
- interface ReusableBlockAnalysis {
3758
- /** Original WP ID */
3759
- id: number;
3760
- /** Block title */
3761
- title: string;
3762
- /** Block slug */
3763
- slug: string;
3764
- }
3765
- /** Normalized analysis result - same format for all sources */
3766
- interface ImportAnalysis {
3767
- /** Source that produced this analysis */
3768
- sourceId: string;
3769
- site: {
3770
- title: string;
3771
- url: string;
3772
- };
3773
- postTypes: PostTypeAnalysis[];
3774
- attachments: {
3775
- count: number;
3776
- items: AttachmentInfo[];
3777
- };
3778
- categories: number;
3779
- tags: number;
3780
- authors: WpAuthorInfo[];
3781
- /** Navigation menus found in the export */
3782
- navMenus?: NavMenuAnalysis[];
3783
- /** Custom taxonomies (beyond categories/tags) */
3784
- customTaxonomies?: TaxonomyAnalysis[];
3785
- /** Reusable blocks (wp_block post type) - will be imported as sections */
3786
- reusableBlocks?: ReusableBlockAnalysis[];
3787
- /** Source-specific custom fields analysis */
3788
- customFields?: Array<{
3789
- key: string;
3790
- count: number;
3791
- samples: string[];
3792
- suggestedField: string;
3793
- suggestedType: "string" | "number" | "boolean" | "date" | "json";
3794
- isInternal: boolean;
3795
- }>;
3796
- /** Detected multilingual plugin. Absent when none detected. */
3797
- i18n?: I18nDetection;
3798
- }
3799
- /** Normalized content item - produced by all sources */
3800
- interface NormalizedItem {
3801
- /** Original ID from source */
3802
- sourceId: string | number;
3803
- /** WordPress post type */
3804
- postType: string;
3805
- /** Content status */
3806
- status: "publish" | "draft" | "pending" | "private" | "future";
3807
- /** URL slug */
3808
- slug: string;
3809
- /** Title */
3810
- title: string;
3811
- /** Content as Portable Text (already converted) */
3812
- content: PortableTextBlock[];
3813
- /** Excerpt/summary */
3814
- excerpt?: string;
3815
- /** Publication date */
3816
- date: Date;
3817
- /** Last modified date */
3818
- modified?: Date;
3819
- /** Author identifier */
3820
- author?: string;
3821
- /** Category slugs */
3822
- categories?: string[];
3823
- /** Tag slugs */
3824
- tags?: string[];
3825
- /** Custom meta fields */
3826
- meta?: Record<string, unknown>;
3827
- /** Featured image URL */
3828
- featuredImage?: string;
3829
- /** Parent post ID (for hierarchical content like pages) */
3830
- parentId?: string | number;
3831
- /** Menu order for sorting */
3832
- menuOrder?: number;
3833
- /** Custom taxonomy assignments beyond categories/tags */
3834
- customTaxonomies?: Record<string, string[]>;
3835
- /** BCP 47 locale code. When omitted, defaults to defaultLocale. */
3836
- locale?: string;
3837
- /**
3838
- * Source-side translation group ID (opaque string from the origin system).
3839
- * Items sharing the same translationGroup are linked as translations.
3840
- * Resolved to an EmDash translation_group ULID during execute.
3841
- */
3842
- translationGroup?: string;
3843
- }
3844
- /** Post type mapping configuration */
3845
- interface PostTypeMapping {
3846
- enabled: boolean;
3847
- collection: string;
3848
- }
3849
- /** Import configuration */
3850
- interface ImportConfig {
3851
- postTypeMappings: Record<string, PostTypeMapping>;
3852
- skipExisting?: boolean;
3853
- }
3854
- /** Options for fetching content */
3855
- interface FetchOptions {
3856
- /** Post types to fetch */
3857
- postTypes: string[];
3858
- /** Whether to include drafts */
3859
- includeDrafts?: boolean;
3860
- /** Limit number of items (for testing) */
3861
- limit?: number;
3862
- }
3863
- /** Import result */
3864
- interface ImportResult {
3865
- success: boolean;
3866
- imported: number;
3867
- skipped: number;
3868
- errors: Array<{
3869
- title: string;
3870
- error: string;
3871
- }>;
3872
- byCollection: Record<string, number>;
3873
- }
3874
- /**
3875
- * An import source provides content from an external system.
3876
- * All sources produce the same normalized analysis and content format.
3877
- */
3878
- interface ImportSource {
3879
- /** Unique identifier */
3880
- id: string;
3881
- /** Display name */
3882
- name: string;
3883
- /** Description for UI */
3884
- description: string;
3885
- /** Icon identifier */
3886
- icon: "upload" | "globe" | "wordpress" | "plug";
3887
- /** Whether this source requires a file upload */
3888
- requiresFile?: boolean;
3889
- /** Whether this source can probe URLs */
3890
- canProbe?: boolean;
3891
- /**
3892
- * Probe a URL to see if this source can handle it.
3893
- * Returns null if not applicable.
3894
- */
3895
- probe?(url: string): Promise<SourceProbeResult | null>;
3896
- /**
3897
- * Analyze content from this source.
3898
- * Returns normalized ImportAnalysis.
3899
- */
3900
- analyze(input: SourceInput, context: ImportContext): Promise<ImportAnalysis>;
3901
- /**
3902
- * Stream content items for import.
3903
- * Yields normalized content items.
3904
- */
3905
- fetchContent(input: SourceInput, options: FetchOptions): AsyncGenerator<NormalizedItem>;
3906
- /**
3907
- * Fetch a media item's data.
3908
- * Used for media import.
3909
- */
3910
- fetchMedia?(url: string, input: SourceInput): Promise<Blob>;
3911
- }
3912
- /** Context passed to import sources */
3913
- interface ImportContext {
3914
- /** Database connection for schema checks */
3915
- db?: unknown;
3916
- /** Function to check existing collections */
3917
- getExistingCollections?: () => Promise<Map<string, {
3918
- slug: string;
3919
- fields: Map<string, {
3920
- type: string;
3921
- }>;
3922
- }>>;
3923
- }
3924
- //#endregion
3925
- //#region src/import/sections.d.ts
3926
- /**
3927
- * Result of sections import operation
3928
- */
3929
- interface SectionsImportResult {
3930
- /** Number of sections created */
3931
- sectionsCreated: number;
3932
- /** Number of sections skipped (already exist) */
3933
- sectionsSkipped: number;
3934
- /** Errors encountered during import */
3935
- errors: Array<{
3936
- title: string;
3937
- error: string;
3938
- }>;
3939
- }
3940
- /**
3941
- * Import reusable blocks (wp_block post type) from WXR as sections
3942
- *
3943
- * @param posts - All posts from WXR (will filter to wp_block)
3944
- * @param db - Database connection
3945
- * @returns Import result with counts
3946
- */
3947
- declare function importReusableBlocksAsSections(posts: WxrPost[], db: Kysely<Database>): Promise<SectionsImportResult>;
3948
- //#endregion
3949
- //#region src/import/registry.d.ts
3950
- /**
3951
- * Register an import source
3952
- */
3953
- declare function registerSource(source: ImportSource): void;
3954
- /**
3955
- * Get a source by ID
3956
- */
3957
- declare function getSource(id: string): ImportSource | undefined;
3958
- /**
3959
- * Get all registered sources
3960
- */
3961
- declare function getAllSources(): ImportSource[];
3962
- /**
3963
- * Get sources that can handle file uploads
3964
- */
3965
- declare function getFileSources(): ImportSource[];
3966
- /**
3967
- * Get sources that can probe URLs
3968
- */
3969
- declare function getUrlSources(): ImportSource[];
3970
- /**
3971
- * Probe a URL against all registered sources
3972
- *
3973
- * Returns probe results sorted by confidence (definite > likely > possible)
3974
- */
3975
- declare function probeUrl(url: string): Promise<ProbeResult>;
3976
- /**
3977
- * Clear all registered sources (useful for testing)
3978
- */
3979
- declare function clearSources(): void;
3980
- //#endregion
3981
- //#region src/import/sources/wxr.d.ts
3982
- declare const wxrSource: ImportSource;
3983
- /**
3984
- * Parse a WXR date with the correct fallback chain:
3985
- * 1. GMT date (always UTC, most reliable)
3986
- * 2. pubDate (RFC 2822, includes timezone offset)
3987
- * 3. Site-local date (MySQL datetime without timezone, imprecise but best available)
3988
- *
3989
- * Returns undefined when none of the inputs yield a valid date.
3990
- * Callers that need a guaranteed Date should use `?? new Date()`.
3991
- */
3992
- declare function parseWxrDate(gmtDate: string | undefined, pubDate: string | undefined, localDate: string | undefined): Date | undefined;
3993
- //#endregion
3994
- //#region src/import/sources/wordpress-rest.d.ts
3995
- declare const wordpressRestSource: ImportSource;
3996
- //#endregion
3997
- //#region src/preview/tokens.d.ts
3998
- /**
3999
- * Preview token generation and verification
4000
- *
4001
- * Tokens are compact, URL-safe, and HMAC-signed.
4002
- * Format: base64url(JSON payload).base64url(HMAC signature)
4003
- *
4004
- * Payload: { cid: contentId, exp: expiryTimestamp, iat: issuedAt }
4005
- */
4006
- /**
4007
- * Preview token payload
4008
- */
4009
- interface PreviewTokenPayload {
4010
- /** Content ID in format "collection:id" (e.g., "posts:abc123") */
4011
- cid: string;
4012
- /** Expiry timestamp (seconds since epoch) */
4013
- exp: number;
4014
- /** Issued at timestamp (seconds since epoch) */
4015
- iat: number;
4016
- }
4017
- /**
4018
- * Options for generating a preview token
4019
- */
4020
- interface GeneratePreviewTokenOptions {
4021
- /** Content ID in format "collection:id" */
4022
- contentId: string;
4023
- /** How long the token is valid. Accepts "1h", "30m", "1d", or seconds as number. Default: "1h" */
4024
- expiresIn?: string | number;
4025
- /** Secret key for signing. Should be from environment variable. */
4026
- secret: string;
4027
- }
4028
- /**
4029
- * Generate a preview token for content
4030
- *
4031
- * @example
4032
- * ```ts
4033
- * const token = await generatePreviewToken({
4034
- * contentId: "posts:abc123",
4035
- * expiresIn: "1h",
4036
- * secret: process.env.PREVIEW_SECRET!,
4037
- * });
4038
- * ```
4039
- */
4040
- declare function generatePreviewToken(options: GeneratePreviewTokenOptions): Promise<string>;
4041
- /**
4042
- * Result of verifying a preview token
4043
- */
4044
- type VerifyPreviewTokenResult = {
4045
- valid: true;
4046
- payload: PreviewTokenPayload;
4047
- } | {
4048
- valid: false;
4049
- error: "invalid" | "expired" | "malformed" | "none";
4050
- };
4051
- /**
4052
- * Options for verifyPreviewToken
4053
- */
4054
- type VerifyPreviewTokenOptions = {
4055
- /** Secret key for verifying tokens */secret: string;
4056
- } & ({
4057
- url: URL;
4058
- } | {
4059
- /** Preview token string (can be null) */token: string | null | undefined;
4060
- });
4061
- /**
4062
- * Verify a preview token and return the payload
4063
- *
4064
- * @example
4065
- * ```ts
4066
- * // With URL (extracts _preview query param)
4067
- * const result = await verifyPreviewToken({
4068
- * url: Astro.url,
4069
- * secret: import.meta.env.PREVIEW_SECRET,
4070
- * });
4071
- *
4072
- * // With token directly
4073
- * const result = await verifyPreviewToken({
4074
- * token: someToken,
4075
- * secret: import.meta.env.PREVIEW_SECRET,
4076
- * });
4077
- *
4078
- * if (result.valid) {
4079
- * console.log(result.payload.cid); // "posts:abc123"
4080
- * }
4081
- * ```
4082
- */
4083
- declare function verifyPreviewToken(options: VerifyPreviewTokenOptions): Promise<VerifyPreviewTokenResult>;
4084
- /**
4085
- * Parse a content ID into collection and id
4086
- */
4087
- declare function parseContentId(contentId: string): {
4088
- collection: string;
4089
- id: string;
4090
- };
4091
- //#endregion
4092
- //#region src/preview/urls.d.ts
4093
- /**
4094
- * Preview URL generation
4095
- *
4096
- * Creates preview URLs that include a signed token for accessing draft content.
4097
- */
4098
- /**
4099
- * Options for generating a preview URL
4100
- */
4101
- interface GetPreviewUrlOptions {
4102
- /** Collection slug (e.g., "posts") */
4103
- collection: string;
4104
- /** Content ID or slug */
4105
- id: string;
4106
- /** Secret key for signing the token */
4107
- secret: string;
4108
- /** How long the preview URL is valid. Default: "1h" */
4109
- expiresIn?: string | number;
4110
- /** Base URL of the site. If not provided, returns a relative URL. */
4111
- baseUrl?: string;
4112
- /** Custom path pattern. Use {collection} and {id} as placeholders. Default: "/{collection}/{id}" */
4113
- pathPattern?: string;
4114
- }
4115
- /**
4116
- * Generate a preview URL for content
4117
- *
4118
- * The URL includes a `_preview` query parameter with a signed token.
4119
- *
4120
- * @example
4121
- * ```ts
4122
- * const url = await getPreviewUrl({
4123
- * collection: "posts",
4124
- * id: "hello-world",
4125
- * secret: process.env.PREVIEW_SECRET!,
4126
- * });
4127
- * // Returns: /posts/hello-world?_preview=eyJj...
4128
- *
4129
- * // With base URL:
4130
- * const fullUrl = await getPreviewUrl({
4131
- * collection: "posts",
4132
- * id: "hello-world",
4133
- * secret: process.env.PREVIEW_SECRET!,
4134
- * baseUrl: "https://example.com",
4135
- * });
4136
- * // Returns: https://example.com/posts/hello-world?_preview=eyJj...
4137
- *
4138
- * // Custom path pattern:
4139
- * const customUrl = await getPreviewUrl({
4140
- * collection: "posts",
4141
- * id: "hello-world",
4142
- * secret: process.env.PREVIEW_SECRET!,
4143
- * pathPattern: "/blog/{id}",
4144
- * });
4145
- * // Returns: /blog/hello-world?_preview=eyJj...
4146
- * ```
4147
- */
4148
- declare function getPreviewUrl(options: GetPreviewUrlOptions): Promise<string>;
4149
- /**
4150
- * Build a preview URL from a token (when you already have the token)
4151
- *
4152
- * @example
4153
- * ```ts
4154
- * const url = buildPreviewUrl({
4155
- * path: "/posts/hello-world",
4156
- * token: existingToken,
4157
- * });
4158
- * ```
4159
- */
4160
- declare function buildPreviewUrl(options: {
4161
- path: string;
4162
- token: string;
4163
- baseUrl?: string;
4164
- }): string;
4165
- //#endregion
4166
- //#region src/preview/helpers.d.ts
4167
- /**
4168
- * Preview helpers for Astro pages
4169
- */
4170
- /**
4171
- * Check if a request is a preview request
4172
- *
4173
- * @example
4174
- * ```ts
4175
- * const isPreview = isPreviewRequest(Astro.url);
4176
- * ```
4177
- */
4178
- declare function isPreviewRequest(url: URL): boolean;
4179
- /**
4180
- * Get the preview token from a URL
4181
- *
4182
- * @example
4183
- * ```ts
4184
- * const token = getPreviewToken(Astro.url);
4185
- * ```
4186
- */
4187
- declare function getPreviewToken(url: URL): string | null;
4188
- //#endregion
4189
- //#region src/settings/index.d.ts
4190
- /**
4191
- * Get a single site setting by key
4192
- *
4193
- * Returns `undefined` if the setting has not been configured.
4194
- * For media settings (logo, favicon), the URL is resolved automatically.
4195
- *
4196
- * @param key - The setting key (e.g., "title", "logo", "social")
4197
- * @returns The setting value, or undefined if not set
4198
- *
4199
- * @example
4200
- * ```ts
4201
- * import { getSiteSetting } from "emdash";
4202
- *
4203
- * const title = await getSiteSetting("title");
4204
- * const logo = await getSiteSetting("logo");
4205
- * console.log(logo?.url); // Resolved URL
4206
- * ```
4207
- */
4208
- declare function getSiteSetting<K extends SiteSettingKey>(key: K): Promise<SiteSettings[K] | undefined>;
4209
- /**
4210
- * Get all site settings
4211
- *
4212
- * Returns all configured settings. Unset values are undefined.
4213
- * Media references (logo/favicon) are resolved to include URLs.
4214
- *
4215
- * @example
4216
- * ```ts
4217
- * import { getSiteSettings } from "emdash";
4218
- *
4219
- * const settings = await getSiteSettings();
4220
- * console.log(settings.title); // "My Site"
4221
- * console.log(settings.logo?.url); // "/_emdash/api/media/file/abc123"
4222
- * ```
4223
- */
4224
- declare function getSiteSettings(): Promise<Partial<SiteSettings>>;
4225
- /**
4226
- * Set site settings (internal function used by admin API)
4227
- *
4228
- * Merges provided settings with existing ones. Only provided fields are updated.
4229
- * Media references should include just the mediaId; URLs are resolved on read.
4230
- *
4231
- * @param settings - Partial settings object with values to update
4232
- * @param db - Kysely database instance
4233
- * @returns Promise that resolves when settings are saved
4234
- *
4235
- * @internal
4236
- *
4237
- * @example
4238
- * ```ts
4239
- * // Update multiple settings at once
4240
- * await setSiteSettings({
4241
- * title: "My Site",
4242
- * tagline: "Welcome",
4243
- * logo: { mediaId: "med_123", alt: "Logo" }
4244
- * }, db);
4245
- * ```
4246
- */
4247
- declare function setSiteSettings(settings: Partial<SiteSettings>, db: Kysely<Database>): Promise<void>;
4248
- /**
4249
- * Get a single plugin setting by key.
4250
- *
4251
- * Plugin settings are stored in the options table under
4252
- * `plugin:<pluginId>:settings:<key>`.
4253
- */
4254
- declare function getPluginSetting<T = unknown>(pluginId: string, key: string): Promise<T | undefined>;
4255
- /**
4256
- * Get all persisted plugin settings for a plugin.
4257
- *
4258
- * Defaults declared in `admin.settingsSchema` are not materialized
4259
- * automatically; callers should apply their own fallback defaults.
4260
- */
4261
- declare function getPluginSettings(pluginId: string): Promise<Record<string, unknown>>;
4262
- //#endregion
4263
- //#region src/comments/query.d.ts
4264
- interface GetCommentsOptions {
4265
- collection: string;
4266
- contentId: string;
4267
- threaded?: boolean;
4268
- }
4269
- interface GetCommentsResult {
4270
- items: PublicComment[];
4271
- total: number;
4272
- }
4273
- /**
4274
- * Get approved comments for a content item.
4275
- *
4276
- * @example
4277
- * ```ts
4278
- * import { getComments } from "emdash";
4279
- *
4280
- * const { items, total } = await getComments({
4281
- * collection: "posts",
4282
- * contentId: post.id,
4283
- * threaded: true,
4284
- * });
4285
- * ```
4286
- */
4287
- declare function getComments(options: GetCommentsOptions): Promise<GetCommentsResult>;
4288
- /**
4289
- * Get the count of approved comments for a content item.
4290
- *
4291
- * @example
4292
- * ```ts
4293
- * import { getCommentCount } from "emdash";
4294
- *
4295
- * const count = await getCommentCount("posts", post.id);
4296
- * ```
4297
- */
4298
- declare function getCommentCount(collection: string, contentId: string): Promise<number>;
4299
- //#endregion
4300
- //#region src/menus/types.d.ts
4301
- /**
4302
- * Menu item types
4303
- */
4304
- type MenuItemType = string;
4305
- /**
4306
- * Menu item as returned to templates (with resolved URL)
4307
- */
4308
- interface MenuItem {
4309
- id: string;
4310
- label: string;
4311
- url: string;
4312
- target?: string;
4313
- titleAttr?: string;
4314
- cssClasses?: string;
4315
- children: MenuItem[];
4316
- }
4317
- /**
4318
- * Menu as returned to templates
4319
- */
4320
- interface Menu {
4321
- id: string;
4322
- name: string;
4323
- label: string;
4324
- items: MenuItem[];
4325
- }
4326
- /**
4327
- * Input for creating a menu item
4328
- */
4329
- interface CreateMenuItemInput {
4330
- type: MenuItemType;
4331
- label: string;
4332
- referenceCollection?: string;
4333
- referenceId?: string;
4334
- customUrl?: string;
4335
- target?: string;
4336
- titleAttr?: string;
4337
- cssClasses?: string;
4338
- parentId?: string;
4339
- sortOrder?: number;
4340
- }
4341
- /**
4342
- * Input for updating a menu item
4343
- */
4344
- interface UpdateMenuItemInput {
4345
- label?: string;
4346
- customUrl?: string;
4347
- target?: string;
4348
- titleAttr?: string;
4349
- cssClasses?: string;
4350
- parentId?: string | null;
4351
- sortOrder?: number;
4352
- }
4353
- /**
4354
- * Input for creating a menu
4355
- */
4356
- interface CreateMenuInput {
4357
- name: string;
4358
- label: string;
4359
- }
4360
- /**
4361
- * Input for updating a menu
4362
- */
4363
- interface UpdateMenuInput {
4364
- label?: string;
4365
- }
4366
- /**
4367
- * Input for reordering menu items
4368
- */
4369
- interface ReorderMenuItemsInput {
4370
- items: Array<{
4371
- id: string;
4372
- parentId: string | null;
4373
- sortOrder: number;
4374
- }>;
4375
- }
4376
- //#endregion
4377
- //#region src/menus/index.d.ts
4378
- /**
4379
- * Get menu by name with resolved URLs
4380
- *
4381
- * @example
4382
- * ```ts
4383
- * import { getMenu } from "emdash";
4384
- *
4385
- * const menu = await getMenu("primary");
4386
- * if (menu) {
4387
- * console.log(menu.items); // Array of MenuItem with resolved URLs
4388
- * }
4389
- * ```
4390
- */
4391
- declare function getMenu(name: string): Promise<Menu | null>;
4392
- /**
4393
- * Get all menus (without items - for admin list)
4394
- *
4395
- * @example
4396
- * ```ts
4397
- * import { getMenus } from "emdash";
4398
- *
4399
- * const menus = await getMenus();
4400
- * console.log(menus); // [{ id, name, label }]
4401
- * ```
4402
- */
4403
- declare function getMenus(): Promise<Array<{
4404
- id: string;
4405
- name: string;
4406
- label: string;
4407
- }>>;
4408
- //#endregion
4409
- //#region src/bylines/index.d.ts
4410
- /**
4411
- * Get a byline by ID.
4412
- *
4413
- * @example
4414
- * ```ts
4415
- * import { getByline } from "emdash";
4416
- *
4417
- * const byline = await getByline("01HXYZ...");
4418
- * if (byline) {
4419
- * console.log(byline.displayName);
4420
- * }
4421
- * ```
4422
- */
4423
- declare function getByline(id: string): Promise<BylineSummary | null>;
4424
- /**
4425
- * Get a byline by slug.
4426
- *
4427
- * @example
4428
- * ```ts
4429
- * import { getBylineBySlug } from "emdash";
4430
- *
4431
- * const byline = await getBylineBySlug("jane-doe");
4432
- * if (byline) {
4433
- * console.log(byline.displayName); // "Jane Doe"
4434
- * }
4435
- * ```
4436
- */
4437
- declare function getBylineBySlug(slug: string): Promise<BylineSummary | null>;
4438
- //#endregion
4439
- //#region src/taxonomies/types.d.ts
4440
- /**
4441
- * Taxonomy types for EmDash CMS
4442
- */
4443
- /**
4444
- * Taxonomy definition - describes a taxonomy like "category" or "tag"
4445
- */
4446
- interface TaxonomyDef {
4447
- id: string;
4448
- name: string;
4449
- label: string;
4450
- labelSingular?: string;
4451
- hierarchical: boolean;
4452
- collections: string[];
4453
- }
4454
- /**
4455
- * Taxonomy term - a specific term within a taxonomy (e.g., "News" in "category")
4456
- */
4457
- interface TaxonomyTerm {
4458
- id: string;
4459
- name: string;
4460
- slug: string;
4461
- label: string;
4462
- parentId?: string;
4463
- description?: string;
4464
- children: TaxonomyTerm[];
4465
- count?: number;
4466
- }
4467
- /**
4468
- * Flat version for DB row
4469
- */
4470
- interface TaxonomyTermRow {
4471
- id: string;
4472
- name: string;
4473
- slug: string;
4474
- label: string;
4475
- parent_id: string | null;
4476
- data: string | null;
4477
- }
4478
- /**
4479
- * Input for creating a term
4480
- */
4481
- interface CreateTermInput {
4482
- slug: string;
4483
- label: string;
4484
- parentId?: string;
4485
- description?: string;
4486
- }
4487
- /**
4488
- * Input for updating a term
4489
- */
4490
- interface UpdateTermInput {
4491
- slug?: string;
4492
- label?: string;
4493
- parentId?: string | null;
4494
- description?: string;
4495
- }
4496
- //#endregion
4497
- //#region src/taxonomies/index.d.ts
4498
- /**
4499
- * No-op — kept for API compatibility.
4500
- *
4501
- * Used to invalidate a worker-lifetime "has any term assignments?" probe.
4502
- * That probe added a query on every cold isolate to save one query on
4503
- * sites with zero term assignments (i.e. the wrong tradeoff), so we
4504
- * dropped it. The batch term join below returns an empty map for empty
4505
- * sites at the same cost as the probe, without the pre-check.
4506
- */
4507
- declare function invalidateTermCache(): void;
4508
- /**
4509
- * Get all taxonomy definitions
4510
- */
4511
- declare function getTaxonomyDefs(): Promise<TaxonomyDef[]>;
4512
- /**
4513
- * Get a single taxonomy definition by name
4514
- */
4515
- declare function getTaxonomyDef(name: string): Promise<TaxonomyDef | null>;
4516
- /**
4517
- * Get all terms for a taxonomy (as tree for hierarchical, flat for tags)
4518
- */
4519
- declare function getTaxonomyTerms(taxonomyName: string): Promise<TaxonomyTerm[]>;
4520
- /**
4521
- * Get a single term by taxonomy and slug
4522
- */
4523
- declare function getTerm(taxonomyName: string, slug: string): Promise<TaxonomyTerm | null>;
4524
- /**
4525
- * Get terms assigned to an entry
4526
- */
4527
- declare function getEntryTerms(collection: string, entryId: string, taxonomyName?: string): Promise<TaxonomyTerm[]>;
4528
- /**
4529
- * Get terms for multiple entries in a single query (batched API)
4530
- *
4531
- * This is more efficient than calling getEntryTerms for each entry
4532
- * when you need terms for a list of entries.
4533
- *
4534
- * @param collection - The collection type (e.g., "posts")
4535
- * @param entryIds - Array of entry IDs
4536
- * @param taxonomyName - The taxonomy name (e.g., "categories")
4537
- * @returns Map from entry ID to array of terms
4538
- */
4539
- declare function getTermsForEntries(collection: string, entryIds: string[], taxonomyName: string): Promise<Map<string, TaxonomyTerm[]>>;
4540
- /**
4541
- * Batch-fetch terms for multiple entries across ALL taxonomies in a single query.
4542
- *
4543
- * Returns a Map keyed by entry ID, where each value is a Record keyed by
4544
- * taxonomy name with the matching terms as an array. Used by
4545
- * getEmDashCollection to eagerly hydrate `entry.data.terms` and avoid
4546
- * the N+1 pattern that callers hit when they loop and call getEntryTerms.
4547
- *
4548
- * Pre-migration databases (content_taxonomies missing) return an empty
4549
- * Map — the join falls through to the `isMissingTableError` branch.
4550
- */
4551
- declare function getAllTermsForEntries(collection: string, entryIds: string[]): Promise<Map<string, Record<string, TaxonomyTerm[]>>>;
4552
- /**
4553
- * Get entries by term (wraps getEmDashCollection)
4554
- */
4555
- declare function getEntriesByTerm(collection: string, taxonomyName: string, termSlug: string): Promise<Array<{
4556
- id: string;
4557
- data: Record<string, unknown>;
4558
- }>>;
4559
- //#endregion
4560
- //#region src/widgets/types.d.ts
4561
- type WidgetType = "content" | "menu" | "component";
4562
- interface Widget {
4563
- id: string;
4564
- type: WidgetType;
4565
- title?: string;
4566
- content?: PortableTextBlock$2[];
4567
- menuName?: string;
4568
- componentId?: string;
4569
- componentProps?: Record<string, unknown>;
4570
- }
4571
- interface WidgetArea {
4572
- id: string;
4573
- name: string;
4574
- label: string;
4575
- description?: string;
4576
- widgets: Widget[];
4577
- }
4578
- interface WidgetComponentDef {
4579
- id: string;
4580
- label: string;
4581
- description?: string;
4582
- props: Record<string, PropDef>;
4583
- }
4584
- interface PropDef {
4585
- type: "string" | "number" | "boolean" | "select";
4586
- label: string;
4587
- default?: unknown;
4588
- options?: Array<{
4589
- value: string;
4590
- label: string;
4591
- }>;
4592
- }
4593
- interface CreateWidgetAreaInput {
4594
- name: string;
4595
- label: string;
4596
- description?: string;
4597
- }
4598
- interface CreateWidgetInput {
4599
- type: WidgetType;
4600
- title?: string;
4601
- content?: PortableTextBlock$2[];
4602
- menuName?: string;
4603
- componentId?: string;
4604
- componentProps?: Record<string, unknown>;
4605
- }
4606
- interface UpdateWidgetInput extends Partial<CreateWidgetInput> {}
4607
- interface ReorderWidgetsInput {
4608
- widgetIds: string[];
4609
- }
4610
- //#endregion
4611
- //#region src/widgets/index.d.ts
4612
- /**
4613
- * Get a widget area by name, with all its widgets.
4614
- *
4615
- * Single query with a left join rather than area-then-widgets so the
4616
- * common case costs one round-trip. An area with no widgets yields one
4617
- * row with null widget columns, which we skip when mapping.
4618
- */
4619
- declare function getWidgetArea(name: string): Promise<WidgetArea | null>;
4620
- /**
4621
- * Get all widget areas with their widgets
4622
- */
4623
- declare function getWidgetAreas(): Promise<WidgetArea[]>;
4624
- /**
4625
- * Get available widget components (for admin UI)
4626
- */
4627
- declare function getWidgetComponents(): WidgetComponentDef[];
4628
- //#endregion
4629
- //#region src/search/types.d.ts
4630
- /**
4631
- * Search Types
4632
- *
4633
- * Type definitions for the EmDash search system.
4634
- */
4635
- /**
4636
- * Search configuration for a collection
4637
- */
4638
- interface SearchConfig {
4639
- /** Whether search is enabled for this collection */
4640
- enabled: boolean;
4641
- /** Field weights for ranking (higher = more important) */
4642
- weights?: Record<string, number>;
4643
- }
4644
- /**
4645
- * Options for search queries
4646
- */
4647
- interface SearchOptions {
4648
- /** Collections to search (defaults to all searchable collections) */
4649
- collections?: string[];
4650
- /** Filter by content status (defaults to 'published') */
4651
- status?: string;
4652
- /** Filter by locale (omit to search all locales) */
4653
- locale?: string;
4654
- /** Maximum results to return (defaults to 20) */
4655
- limit?: number;
4656
- /** Pagination cursor */
4657
- cursor?: string;
4658
- }
4659
- /**
4660
- * Options for collection-specific search
4661
- */
4662
- interface CollectionSearchOptions {
4663
- /** Filter by content status (defaults to 'published') */
4664
- status?: string;
4665
- /** Filter by locale (omit to search all locales) */
4666
- locale?: string;
4667
- /** Maximum results to return (defaults to 20) */
4668
- limit?: number;
4669
- /** Pagination cursor */
4670
- cursor?: string;
4671
- }
4672
- /**
4673
- * A single search result
4674
- */
4675
- interface SearchResult {
4676
- /** Collection the result belongs to */
4677
- collection: string;
4678
- /** Entry ID */
4679
- id: string;
4680
- /** Entry slug */
4681
- slug: string | null;
4682
- /** Content locale */
4683
- locale: string;
4684
- /** Entry title (if available) */
4685
- title?: string;
4686
- /**
4687
- * Highlighted snippet showing match context.
4688
- *
4689
- * Sanitized server-side to be safe for `set:html` / `innerHTML`:
4690
- * all HTML metacharacters in the source text are escaped, and
4691
- * matched terms are wrapped in literal `<mark>...</mark>` tags
4692
- * (the only HTML the snippet is allowed to contain).
4693
- */
4694
- snippet?: string;
4695
- /** Relevance score (higher = more relevant) */
4696
- score: number;
4697
- }
4698
- /**
4699
- * Response from a search query
4700
- */
4701
- interface SearchResponse {
4702
- /** Search results */
4703
- items: SearchResult[];
4704
- /** Cursor for next page of results */
4705
- nextCursor?: string;
4706
- }
4707
- /**
4708
- * Options for suggestion/autocomplete queries
4709
- */
4710
- interface SuggestOptions {
4711
- /** Collections to search (defaults to all searchable collections) */
4712
- collections?: string[];
4713
- /** Filter by locale (omit to search all locales) */
4714
- locale?: string;
4715
- /** Maximum suggestions to return (defaults to 5) */
4716
- limit?: number;
4717
- }
4718
- /**
4719
- * A single suggestion result
4720
- */
4721
- interface Suggestion {
4722
- /** Collection the suggestion belongs to */
4723
- collection: string;
4724
- /** Entry ID */
4725
- id: string;
4726
- /** Entry title */
4727
- title: string;
4728
- }
4729
- /**
4730
- * Search index statistics
4731
- */
4732
- interface SearchStats {
4733
- collections: Record<string, {
4734
- /** Number of indexed entries */indexed: number; /** When the index was last rebuilt */
4735
- lastRebuilt?: string;
4736
- }>;
4737
- }
4738
- //#endregion
4739
- //#region src/search/fts-manager.d.ts
4740
- /**
4741
- * FTS5 Manager
4742
- *
4743
- * Handles creation, deletion, and management of FTS5 virtual tables
4744
- * for full-text search on content collections.
4745
- */
4746
- declare class FTSManager {
4747
- private db;
4748
- constructor(db: Kysely<Database>);
4749
- /**
4750
- * Validate a collection slug and its searchable field names.
4751
- * Must be called before any raw SQL interpolation.
4752
- */
4753
- private validateInputs;
4754
- /**
4755
- * Get the FTS table name for a collection
4756
- * Uses _emdash_ prefix to clearly mark as internal/system table
4757
- */
4758
- getFtsTableName(collectionSlug: string): string;
4759
- /**
4760
- * Get the content table name for a collection
4761
- */
4762
- getContentTableName(collectionSlug: string): string;
4763
- /**
4764
- * Check if an FTS table exists for a collection
4765
- */
4766
- ftsTableExists(collectionSlug: string): Promise<boolean>;
4767
- /**
4768
- * Create an FTS5 virtual table for a collection.
4769
- * FTS5 is SQLite-only; on other dialects this is a no-op.
4770
- *
4771
- * @param collectionSlug - The collection slug
4772
- * @param searchableFields - Array of field names to index
4773
- * @param weights - Optional field weights for ranking
4774
- */
4775
- createFtsTable(collectionSlug: string, searchableFields: string[], _weights?: Record<string, number>): Promise<void>;
4776
- /**
4777
- * Create triggers to keep FTS table in sync with content table.
4778
- *
4779
- * The insert and update triggers only add rows to the FTS index when
4780
- * `deleted_at IS NULL`. This keeps soft-deleted content out of the
4781
- * search index and ensures the FTS row count matches the non-deleted
4782
- * content count (which `verifyAndRepairIndex` relies on).
4783
- */
4784
- private createTriggers;
4785
- /**
4786
- * Drop triggers for a collection
4787
- */
4788
- private dropTriggers;
4789
- /**
4790
- * Drop the FTS table and triggers for a collection
4791
- */
4792
- dropFtsTable(collectionSlug: string): Promise<void>;
4793
- /**
4794
- * Rebuild the FTS index for a collection
4795
- *
4796
- * This is useful after bulk imports or if the index gets out of sync.
4797
- */
4798
- rebuildIndex(collectionSlug: string, searchableFields: string[], weights?: Record<string, number>): Promise<void>;
4799
- /**
4800
- * Populate the FTS table from existing content
4801
- */
4802
- populateFromContent(collectionSlug: string, searchableFields: string[]): Promise<void>;
4803
- /**
4804
- * Get the search configuration for a collection
4805
- */
4806
- getSearchConfig(collectionSlug: string): Promise<SearchConfig | null>;
4807
- /**
4808
- * Update the search configuration for a collection
4809
- */
4810
- setSearchConfig(collectionSlug: string, config: SearchConfig): Promise<void>;
4811
- /**
4812
- * Get searchable fields for a collection
4813
- */
4814
- getSearchableFields(collectionSlug: string): Promise<string[]>;
4815
- /**
4816
- * Enable search for a collection.
4817
- *
4818
- * Uses rebuildIndex to ensure a clean state -- drop any existing FTS
4819
- * table/triggers, recreate them, and populate from content. This avoids
4820
- * duplicate rows when triggers have already populated the index (e.g.
4821
- * during seeding where content is inserted before search is enabled).
4822
- */
4823
- enableSearch(collectionSlug: string, options?: {
4824
- weights?: Record<string, number>;
4825
- }): Promise<void>;
4826
- /**
4827
- * Disable search for a collection
4828
- *
4829
- * Drops the FTS table and triggers.
4830
- */
4831
- disableSearch(collectionSlug: string): Promise<void>;
4832
- /**
4833
- * Get index statistics for a collection
4834
- */
4835
- getIndexStats(collectionSlug: string): Promise<{
4836
- indexed: number;
4837
- lastRebuilt?: string;
4838
- } | null>;
4839
- /**
4840
- * Verify FTS index integrity and rebuild if corrupted.
4841
- *
4842
- * Checks for row count mismatch between content table and FTS table.
4843
- *
4844
- * Returns true if the index was rebuilt, false if it was healthy.
4845
- */
4846
- verifyAndRepairIndex(collectionSlug: string): Promise<boolean>;
4847
- /**
4848
- * Verify and repair FTS indexes for all search-enabled collections.
4849
- *
4850
- * Intended to run at startup to auto-heal any corruption from
4851
- * previous process crashes.
4852
- */
4853
- verifyAndRepairAll(): Promise<number>;
4854
- }
4855
- //#endregion
4856
- //#region src/search/query.d.ts
4857
- /**
4858
- * Search across multiple collections
4859
- *
4860
- * Public API that auto-injects the database.
4861
- *
4862
- * @param query - Search query (FTS5 syntax supported)
4863
- * @param options - Search options
4864
- * @returns Search results with pagination
4865
- *
4866
- * @example
4867
- * ```typescript
4868
- * import { search } from "emdash";
4869
- *
4870
- * const results = await search("hello world", {
4871
- * collections: ["posts", "pages"],
4872
- * limit: 20
4873
- * });
4874
- * ```
4875
- */
4876
- declare function search(query: string, options?: SearchOptions): Promise<SearchResponse>;
4877
- /**
4878
- * Search across multiple collections (with explicit db)
4879
- *
4880
- * @internal Use `search()` in templates. This variant is for admin routes
4881
- * that already have a database handle.
4882
- *
4883
- * @param db - Kysely database instance
4884
- * @param query - Search query (FTS5 syntax supported)
4885
- * @param options - Search options
4886
- * @returns Search results with pagination
4887
- */
4888
- declare function searchWithDb(db: Kysely<Database>, query: string, options?: SearchOptions): Promise<SearchResponse>;
4889
- /**
4890
- * Search within a single collection
4891
- *
4892
- * @param db - Kysely database instance
4893
- * @param collection - Collection slug
4894
- * @param query - Search query (FTS5 syntax supported)
4895
- * @param options - Search options
4896
- * @returns Search results with pagination
4897
- *
4898
- * @example
4899
- * ```typescript
4900
- * const results = await searchCollection(db, "posts", "hello world", {
4901
- * limit: 10
4902
- * });
4903
- * ```
4904
- */
4905
- declare function searchCollection(db: Kysely<Database>, collection: string, query: string, options?: CollectionSearchOptions): Promise<SearchResponse>;
4906
- /**
4907
- * Get search suggestions for autocomplete
4908
- *
4909
- * @param db - Kysely database instance
4910
- * @param query - Partial search query
4911
- * @param options - Suggestion options
4912
- * @returns Array of suggestions
4913
- */
4914
- declare function getSuggestions(db: Kysely<Database>, query: string, options?: SuggestOptions): Promise<Suggestion[]>;
4915
- /**
4916
- * Get search statistics for all collections
4917
- */
4918
- declare function getSearchStats(db: Kysely<Database>): Promise<SearchStats>;
4919
- //#endregion
4920
- //#region src/search/text-extraction.d.ts
4921
- /**
4922
- * Extract plain text from Portable Text blocks
4923
- *
4924
- * Uses @portabletext/toolkit's toPlainText for standard blocks,
4925
- * plus extracts text from custom block types (code, images with alt/caption).
4926
- *
4927
- * @param blocks - Array of Portable Text blocks (or a JSON string)
4928
- * @returns Plain text content
4929
- *
4930
- * @example
4931
- * ```typescript
4932
- * const text = extractPlainText([
4933
- * {
4934
- * _type: "block",
4935
- * _key: "abc",
4936
- * children: [{ _type: "span", _key: "s1", text: "Hello World" }]
4937
- * }
4938
- * ]);
4939
- * // Returns: "Hello World"
4940
- * ```
4941
- */
4942
- declare function extractPlainText(blocks: PortableTextBlock$1[] | string | null | undefined): string;
4943
- /**
4944
- * Extract searchable text from a content entry
4945
- *
4946
- * Extracts text from specified fields, handling both plain text and Portable Text.
4947
- *
4948
- * @param entry - Content entry data
4949
- * @param fields - Field names to extract text from
4950
- * @returns Object mapping field names to extracted text
4951
- */
4952
- declare function extractSearchableFields(entry: Record<string, unknown>, fields: string[]): Record<string, string>;
4953
- //#endregion
4954
- export { UpdateMenuInput as $, EntryResult as $n, handleMediaList as $r, SuggestedAction as $t, getEntriesByTerm as A, ListResponse as Ai, WxrData as An, ProseMirrorNode as Ar, probeUrl as At, TaxonomyTerm as B, CreateMediaInput as Bi, getDb as Bn, CreateSectionInput as Br, ImportContext as Bt, ReorderWidgetsInput as C, handleContentUnpublish as Ci, AuthResult as Cn, PortableTextLinkMark as Cr, parseWxrDate as Ct, WidgetComponentDef as D, ContentListResponse as Di, WxrAttachment as Dn, PortableTextUnknownBlock as Dr, getFileSources as Dt, WidgetArea as E, ApiContext as Ei, definePlugin as En, PortableTextTextBlock as Er, getAllSources as Et, getTerm as F, FieldDefinition as Fi, parseWxrString as Fn, SandboxRunnerFactory as Fr, FetchOptions as Ft, getMenu as G, EmDashDatabaseError as Gi, WaitUntilFn as Gn, getCollectionInfo as Gr, OAuthInput as Gt, UpdateTermInput as H, MediaRepository as Hi, getFallbackChain as Hn, Section as Hr, ImportResult as Ht, getTermsForEntries as I, FieldUIHints as Ii, CollectionFilter as In, SandboxedPlugin as Ir, FieldCompatibility as It, CreateMenuItemInput as J, CollectionFilter$1 as Jn, MediaListResponse as Jr, ProbeResult as Jt, getMenus as K, after as Kn, SchemaError as Kr, PostTypeAnalysis as Kt, invalidateTermCache as L, FileValue as Li, EntryData as Ln, SerializedRequest as Lr, FileInput as Lt, getTaxonomyDef as M, portableText as Mi, WxrSite as Mn, SandboxEmailSendCallback as Mr, importReusableBlocksAsSections as Mt, getTaxonomyDefs as N, reference as Ni, WxrTag as Nn, SandboxOptions as Nr, AttachmentInfo as Nt, WidgetType as O, ContentResponse as Oi, WxrAuthor as On, ProseMirrorDocument as Or, getSource as Ot, getTaxonomyTerms as P, image as Pi, parseWxr as Pn, SandboxRunner as Pr, CollectionSchemaStatus as Pt, ReorderMenuItemsInput as Q, EmDashCollections as Qn, handleMediaGet as Qr, SourceProbeResult as Qt, CreateTermInput as R, ImageValue as Ri, EntryFilter as Rn, getSection as Rr, ImportAnalysis as Rt, PropDef as S, handleContentTranslations as Si, AuthProviderModule as Sn, PortableTextImageBlock as Sr, wordpressRestSource as St, Widget as T, handleContentUpdate as Ti, ExternalAuthConfig as Tn, PortableTextSpan as Tr, clearSources as Tt, getByline as U, ContentRepository as Ui, getI18nConfig as Un, SectionSource as Ur, ImportSource as Ut, TaxonomyTermRow as V, MediaItem as Vi, I18nConfig as Vn, GetSectionsOptions as Vr, ImportFieldDef as Vt, getBylineBySlug as W, DatabaseConfig as Wi, isI18nEnabled as Wn, UpdateSectionInput as Wr, NormalizedItem as Wt, MenuItem as X, ContentEntry as Xn, handleMediaCreate as Xr, SourceCapabilities as Xt, Menu as Y, CollectionResult as Yn, MediaResponse as Yr, SourceAuth as Yt, MenuItemType as Z, EditFieldMeta as Zn, handleMediaDelete as Zr, SourceInput as Zt, getWidgetArea as _, handleContentListTrashed as _i, S3StorageConfig as _n, computeContentHash as _r, VerifyPreviewTokenOptions as _t, search as a, handleRevisionRestore as ai, createPluginManager as an, getEmDashCollection as ar, getPluginSetting as at, CreateWidgetAreaInput as b, handleContentRestore as bi, AuthProviderAdminExports as bn, prosemirrorToPortableText as br, parseContentId as bt, FTSManager as c, handleContentCountScheduled as ci, HookPipeline as cn, resolveEmDashPath as cr, getSiteSettings as ct, SearchOptions as d, handleContentDelete as di, ValidatedPluginManifest as dn, FieldAnnotation as dr, isPreviewRequest as dt, handleMediaUpdate as ei, UrlInput as en, InferCollectionData as er, UpdateMenuItemInput as et, SearchResponse as f, handleContentDiscardDraft as fi, pluginManifestSchema as fn, createEditable as fr, GetPreviewUrlOptions as ft, Suggestion as g, handleContentList as gi, LocalStorageConfig as gn, sanitizeHref as gr, PreviewTokenPayload as gt, SuggestOptions as h, handleContentGetIncludingTrashed as hi, getStoredConfig as hn, isSafeHref as hr, GeneratePreviewTokenOptions as ht, getSuggestions as i, handleRevisionList as ii, PluginManager as in, getEditMeta as ir, getComments as it, getEntryTerms as j, ManifestResponse as ji, WxrPost as jn, SandboxEmailMessage as jr, registerSource as jt, getAllTermsForEntries as k, FieldDescriptor as ki, WxrCategory as kn, ProseMirrorMark as kr, getUrlSources as kt, CollectionSearchOptions as l, handleContentCountTrashed as li, HookResult as ln, CMSAnnotation as lr, setSiteSettings as lt, SearchStats as m, handleContentGet as mi, PluginDescriptor as mn, decodeSlug as mr, getPreviewUrl as mt, extractSearchableFields as n, RevisionResponse as ni, SandboxNotAvailableError as nn, TranslationSummary as nr, GetCommentsResult as nt, searchCollection as o, generateManifest as oi, PluginRouteError as on, getEmDashEntry as or, getPluginSettings as ot, SearchResult as p, handleContentDuplicate as pi, EmDashConfig as pn, createNoop as pr, buildPreviewUrl as pt, CreateMenuInput as q, CacheHint as qn, SchemaRegistry as qr, PostTypeMapping as qt, getSearchStats as r, handleRevisionGet as ri, createNoopSandboxRunner as rn, TranslationsResult as rr, getCommentCount as rt, searchWithDb as s, handleContentCompare as si, EmailPipeline as sn, getTranslations as sr, getSiteSetting as st, extractPlainText as t, RevisionListResponse as ti, NoopSandboxRunner as tn, ResolvePathResult as tr, GetCommentsOptions as tt, SearchConfig as u, handleContentCreate as ui, createHookPipeline as un, EditProxy as ur, getPreviewToken as ut, getWidgetAreas as v, handleContentPermanentDelete as vi, StorageDescriptor as vn, hashString as vr, VerifyPreviewTokenResult as vt, UpdateWidgetInput as w, handleContentUnschedule as wi, AuthRouteDescriptor as wn, PortableTextMarkDef as wr, wxrSource as wt, CreateWidgetInput as x, handleContentSchedule as xi, AuthProviderDescriptor as xn, PortableTextCodeBlock as xr, verifyPreviewToken as xt, getWidgetComponents as y, handleContentPublish as yi, AuthDescriptor as yn, portableTextToProsemirror as yr, generatePreviewToken as yt, TaxonomyDef as z, PortableTextBlock$2 as zi, emdashLoader as zn, getSections as zr, ImportConfig as zt };
4955
- //# sourceMappingURL=index-DIb-CzNx.d.mts.map