emdash 1.3.1 → 1.5.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 (1941) hide show
  1. package/dist/action-token-CKphU6ur.mjs +26 -0
  2. package/dist/action-token-CKphU6ur.mjs.map +1 -0
  3. package/dist/activation-X5iMalte.mjs +387 -0
  4. package/dist/activation-X5iMalte.mjs.map +1 -0
  5. package/dist/adapters-DFsc9XjW.d.mts +173 -0
  6. package/dist/adapters-DFsc9XjW.d.mts.map +1 -0
  7. package/dist/after-B3AvMfBQ.mjs +50 -0
  8. package/dist/after-B3AvMfBQ.mjs.map +1 -0
  9. package/dist/allowed-origins-BFDNF-05.mjs +116 -0
  10. package/dist/allowed-origins-BFDNF-05.mjs.map +1 -0
  11. package/dist/api/route-utils.d.mts +4 -4
  12. package/dist/api/route-utils.d.mts.map +1 -1
  13. package/dist/api/route-utils.mjs +7 -65
  14. package/dist/api/route-utils.mjs.map +1 -1
  15. package/dist/api/schemas/index.d.mts +2 -2
  16. package/dist/api/schemas/index.mjs +7 -12
  17. package/dist/api-tokens-B-p5eI6J.mjs +9 -0
  18. package/dist/api-tokens-B-p5eI6J.mjs.map +1 -0
  19. package/dist/api-tokens-D27OQ0oQ.mjs +173 -0
  20. package/dist/api-tokens-D27OQ0oQ.mjs.map +1 -0
  21. package/dist/apply-Culv7QJl.mjs +1774 -0
  22. package/dist/apply-Culv7QJl.mjs.map +1 -0
  23. package/dist/approvals-oLE5G5jw.mjs +460 -0
  24. package/dist/approvals-oLE5G5jw.mjs.map +1 -0
  25. package/dist/artifact-fetch-ByK_1pck.mjs +659 -0
  26. package/dist/artifact-fetch-ByK_1pck.mjs.map +1 -0
  27. package/dist/artifacts-BXKMIV2F.mjs +323 -0
  28. package/dist/artifacts-BXKMIV2F.mjs.map +1 -0
  29. package/dist/astro/index.d.mts +17 -14
  30. package/dist/astro/index.d.mts.map +1 -1
  31. package/dist/astro/index.mjs +257 -24
  32. package/dist/astro/index.mjs.map +1 -1
  33. package/dist/astro/middleware/auth.d.mts +15 -12
  34. package/dist/astro/middleware/auth.d.mts.map +1 -1
  35. package/dist/astro/middleware/auth.mjs +62 -25
  36. package/dist/astro/middleware/auth.mjs.map +1 -1
  37. package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -1
  38. package/dist/astro/middleware/media-usage-write-fence.mjs +5 -7
  39. package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -1
  40. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  41. package/dist/astro/middleware/redirect.mjs +18 -26
  42. package/dist/astro/middleware/redirect.mjs.map +1 -1
  43. package/dist/astro/middleware/request-context.d.mts.map +1 -1
  44. package/dist/astro/middleware/request-context.mjs +128 -80
  45. package/dist/astro/middleware/request-context.mjs.map +1 -1
  46. package/dist/astro/middleware/setup.mjs +1 -1
  47. package/dist/astro/middleware.d.mts +15 -12
  48. package/dist/astro/middleware.d.mts.map +1 -1
  49. package/dist/astro/middleware.mjs +62 -158
  50. package/dist/astro/middleware.mjs.map +1 -1
  51. package/dist/astro/routes/PluginRegistry.d.mts +1 -5
  52. package/dist/astro/routes/PluginRegistry.d.mts.map +1 -1
  53. package/dist/astro/routes/PluginRegistry.mjs +11 -10
  54. package/dist/astro/routes/PluginRegistry.mjs.map +1 -1
  55. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +3 -18
  56. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
  57. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +3 -18
  58. package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
  59. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -8
  60. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -1
  61. package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -9
  62. package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
  63. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +3 -8
  64. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -1
  65. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +5 -21
  66. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
  67. package/dist/astro/routes/api/admin/byline-fields/index.mjs +5 -21
  68. package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
  69. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +5 -21
  70. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
  71. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +8 -33
  72. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
  73. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +8 -33
  74. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  75. package/dist/astro/routes/api/admin/bylines/index.mjs +8 -32
  76. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
  77. package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -1
  78. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +9 -25
  79. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  80. package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -1
  81. package/dist/astro/routes/api/admin/comments/_id_.mjs +12 -12
  82. package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
  83. package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -1
  84. package/dist/astro/routes/api/admin/comments/bulk.mjs +16 -25
  85. package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/comments/counts.mjs +3 -10
  87. package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/comments/index.mjs +5 -23
  89. package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/core-update.mjs +160 -10
  91. package/dist/astro/routes/api/admin/core-update.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -8
  93. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -1
  94. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -6
  95. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -1
  96. package/dist/astro/routes/api/admin/media-usage/activation.mjs +6 -25
  97. package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
  98. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +6 -26
  99. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
  100. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +6 -26
  101. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
  102. package/dist/astro/routes/api/admin/media-usage/progress.mjs +4 -29
  103. package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -1
  104. package/dist/astro/routes/api/admin/media-usage/repair.mjs +5 -36
  105. package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
  106. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +6 -26
  107. package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
  108. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +6 -26
  109. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
  110. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -7
  111. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
  112. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -7
  113. package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
  114. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +4 -10
  115. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  116. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +4 -10
  117. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  118. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +3 -87
  119. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  120. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -8
  121. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -1
  122. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +4 -86
  123. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  124. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +5 -86
  125. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  126. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +9 -97
  127. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  128. package/dist/astro/routes/api/admin/plugins/index.mjs +3 -87
  129. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  130. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -8
  131. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -1
  132. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +3 -86
  133. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  134. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +9 -97
  135. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  136. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +3 -86
  137. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  138. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +7 -86
  139. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  140. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +14 -98
  141. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  142. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +6 -10
  143. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  144. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +11 -89
  145. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  146. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +4 -8
  147. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -1
  148. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +8 -87
  149. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
  150. package/dist/astro/routes/api/admin/plugins/updates.mjs +7 -86
  151. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  152. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +4 -8
  153. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -1
  154. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +3 -86
  155. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  156. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -8
  157. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -1
  158. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +3 -86
  159. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  160. package/dist/astro/routes/api/admin/transfer/_...path_.mjs +1 -5
  161. package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -1
  162. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +6 -50
  163. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -1
  164. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +6 -50
  165. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -1
  166. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +8 -52
  167. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -1
  168. package/dist/astro/routes/api/admin/transfer/capabilities.mjs +8 -51
  169. package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -1
  170. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +7 -52
  171. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -1
  172. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +8 -53
  173. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -1
  174. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +8 -53
  175. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -1
  176. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +7 -52
  177. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -1
  178. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +8 -53
  179. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -1
  180. package/dist/astro/routes/api/admin/transfer/exports/index.mjs +9 -54
  181. package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -1
  182. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +7 -52
  183. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -1
  184. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +7 -52
  185. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -1
  186. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +9 -53
  187. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -1
  188. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +7 -52
  189. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -1
  190. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +10 -54
  191. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -1
  192. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +8 -52
  193. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -1
  194. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +7 -52
  195. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -1
  196. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +9 -54
  197. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -1
  198. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +7 -52
  199. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -1
  200. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +7 -52
  201. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -1
  202. package/dist/astro/routes/api/admin/transfer/imports/index.mjs +11 -54
  203. package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -1
  204. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -6
  205. package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -1
  206. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -5
  207. package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -1
  208. package/dist/astro/routes/api/admin/users/_id_/index.mjs +4 -19
  209. package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
  210. package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -1
  211. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +11 -10
  212. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
  213. package/dist/astro/routes/api/admin/users/index.mjs +3 -18
  214. package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
  215. package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
  216. package/dist/astro/routes/api/auth/dev-bypass.mjs +10 -7
  217. package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
  218. package/dist/astro/routes/api/auth/handover.mjs +3 -9
  219. package/dist/astro/routes/api/auth/handover.mjs.map +1 -1
  220. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -5
  221. package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -1
  222. package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -1
  223. package/dist/astro/routes/api/auth/invite/complete.mjs +11 -26
  224. package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
  225. package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -1
  226. package/dist/astro/routes/api/auth/invite/index.mjs +13 -23
  227. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
  228. package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -1
  229. package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -23
  230. package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
  231. package/dist/astro/routes/api/auth/logout.mjs +2 -6
  232. package/dist/astro/routes/api/auth/logout.mjs.map +1 -1
  233. package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -1
  234. package/dist/astro/routes/api/auth/magic-link/send.mjs +15 -26
  235. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
  236. package/dist/astro/routes/api/auth/magic-link/verify.mjs +5 -20
  237. package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -1
  238. package/dist/astro/routes/api/auth/me.d.mts +3 -1
  239. package/dist/astro/routes/api/auth/me.d.mts.map +1 -1
  240. package/dist/astro/routes/api/auth/me.mjs +30 -30
  241. package/dist/astro/routes/api/auth/me.mjs.map +1 -1
  242. package/dist/astro/routes/api/auth/mode.mjs +2 -6
  243. package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
  244. package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
  245. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +6 -14
  246. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
  247. package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
  248. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +3 -4
  249. package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
  250. package/dist/astro/routes/api/auth/passkey/_id_.mjs +3 -18
  251. package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
  252. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -5
  253. package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -1
  254. package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -1
  255. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -26
  256. package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
  257. package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -1
  258. package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -23
  259. package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
  260. package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -1
  261. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -24
  262. package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
  263. package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -1
  264. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -26
  265. package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
  266. package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -1
  267. package/dist/astro/routes/api/auth/signup/complete.mjs +11 -26
  268. package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
  269. package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -1
  270. package/dist/astro/routes/api/auth/signup/request.mjs +9 -24
  271. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
  272. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -5
  273. package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -1
  274. package/dist/astro/routes/api/calendar.mjs +5 -19
  275. package/dist/astro/routes/api/calendar.mjs.map +1 -1
  276. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +5 -19
  277. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  278. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +8 -26
  279. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
  280. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -6
  281. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
  282. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +14 -24
  283. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
  284. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -6
  285. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
  286. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -1
  287. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +9 -24
  288. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -1
  289. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -7
  290. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
  291. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +2 -13
  292. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -1
  293. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -43
  294. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
  295. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -23
  296. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  297. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +5 -45
  298. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
  299. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +5 -45
  300. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
  301. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -7
  302. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
  303. package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.d.mts +8 -0
  304. package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.d.mts.map +1 -0
  305. package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs +16 -0
  306. package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs.map +1 -0
  307. package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +2 -1
  308. package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -1
  309. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +28 -7
  310. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
  311. package/dist/astro/routes/api/content/_collection_/_id_/room.d.mts +8 -0
  312. package/dist/astro/routes/api/content/_collection_/_id_/room.d.mts.map +1 -0
  313. package/dist/astro/routes/api/content/_collection_/_id_/room.mjs +29 -0
  314. package/dist/astro/routes/api/content/_collection_/_id_/room.mjs.map +1 -0
  315. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -24
  316. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
  317. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
  318. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +32 -38
  319. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  320. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -6
  321. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
  322. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +7 -23
  323. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
  324. package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
  325. package/dist/astro/routes/api/content/_collection_/_id_.mjs +28 -52
  326. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  327. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -6
  328. package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
  329. package/dist/astro/routes/api/content/_collection_/index.mjs +5 -19
  330. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
  331. package/dist/astro/routes/api/content/_collection_/trash.mjs +4 -19
  332. package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
  333. package/dist/astro/routes/api/dashboard.mjs +141 -21
  334. package/dist/astro/routes/api/dashboard.mjs.map +1 -1
  335. package/dist/astro/routes/api/dev/emails.mjs +2 -6
  336. package/dist/astro/routes/api/dev/emails.mjs.map +1 -1
  337. package/dist/astro/routes/api/dev/scheduled-tasks.mjs +4 -125
  338. package/dist/astro/routes/api/dev/scheduled-tasks.mjs.map +1 -1
  339. package/dist/astro/routes/api/health.mjs +3 -7
  340. package/dist/astro/routes/api/health.mjs.map +1 -1
  341. package/dist/astro/routes/api/import/probe.d.mts +4 -3
  342. package/dist/astro/routes/api/import/probe.d.mts.map +1 -1
  343. package/dist/astro/routes/api/import/probe.mjs +6 -37
  344. package/dist/astro/routes/api/import/probe.mjs.map +1 -1
  345. package/dist/astro/routes/api/import/wordpress/analyze.d.mts +6 -3
  346. package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -1
  347. package/dist/astro/routes/api/import/wordpress/analyze.mjs +10 -32
  348. package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
  349. package/dist/astro/routes/api/import/wordpress/execute.d.mts +32 -14
  350. package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
  351. package/dist/astro/routes/api/import/wordpress/execute.mjs +147 -47
  352. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  353. package/dist/astro/routes/api/import/wordpress/media.d.mts +16 -13
  354. package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
  355. package/dist/astro/routes/api/import/wordpress/media.mjs +11 -27
  356. package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
  357. package/dist/astro/routes/api/import/wordpress/prepare.mjs +10 -26
  358. package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
  359. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +16 -13
  360. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
  361. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -39
  362. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
  363. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  364. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +6 -37
  365. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
  366. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  367. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +16 -13
  368. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
  369. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +189 -61
  370. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  371. package/dist/astro/routes/api/manifest.d.mts.map +1 -1
  372. package/dist/astro/routes/api/manifest.mjs +32 -13
  373. package/dist/astro/routes/api/manifest.mjs.map +1 -1
  374. package/dist/astro/routes/api/mcp.mjs +130 -126
  375. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  376. package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -1
  377. package/dist/astro/routes/api/media/_id_/confirm.mjs +50 -30
  378. package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
  379. package/dist/astro/routes/api/media/_id_/replace.mjs +5 -20
  380. package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
  381. package/dist/astro/routes/api/media/_id_/upload.mjs +6 -10
  382. package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -1
  383. package/dist/astro/routes/api/media/_id_/usage.mjs +6 -38
  384. package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
  385. package/dist/astro/routes/api/media/_id_.mjs +5 -36
  386. package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
  387. package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -1
  388. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +4 -7
  389. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -1
  390. package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
  391. package/dist/astro/routes/api/media/file/_...key_.mjs +52 -13
  392. package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
  393. package/dist/astro/routes/api/media/folders/_id_.mjs +5 -20
  394. package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
  395. package/dist/astro/routes/api/media/folders/index.mjs +5 -20
  396. package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
  397. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -6
  398. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -1
  399. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -6
  400. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -1
  401. package/dist/astro/routes/api/media/providers/index.mjs +2 -6
  402. package/dist/astro/routes/api/media/providers/index.mjs.map +1 -1
  403. package/dist/astro/routes/api/media/upload-url.mjs +8 -23
  404. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  405. package/dist/astro/routes/api/media.mjs +20 -43
  406. package/dist/astro/routes/api/media.mjs.map +1 -1
  407. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -25
  408. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  409. package/dist/astro/routes/api/menus/_name_/items.mjs +8 -25
  410. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  411. package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -25
  412. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  413. package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -25
  414. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  415. package/dist/astro/routes/api/menus/_name_.mjs +8 -25
  416. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  417. package/dist/astro/routes/api/menus/index.mjs +8 -25
  418. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  419. package/dist/astro/routes/api/oauth/authorize.mjs +5 -6
  420. package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
  421. package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -1
  422. package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -9
  423. package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -1
  424. package/dist/astro/routes/api/oauth/device/code.mjs +6 -13
  425. package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -1
  426. package/dist/astro/routes/api/oauth/device/token.mjs +5 -12
  427. package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -1
  428. package/dist/astro/routes/api/oauth/register.mjs +4 -9
  429. package/dist/astro/routes/api/oauth/register.mjs.map +1 -1
  430. package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -9
  431. package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -1
  432. package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -9
  433. package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -1
  434. package/dist/astro/routes/api/oauth/token.d.mts.map +1 -1
  435. package/dist/astro/routes/api/oauth/token.mjs +5 -10
  436. package/dist/astro/routes/api/oauth/token.mjs.map +1 -1
  437. package/dist/astro/routes/api/openapi.json.mjs +15 -31
  438. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  439. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +2 -13
  440. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
  441. package/dist/astro/routes/api/redirects/404s/index.mjs +5 -28
  442. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  443. package/dist/astro/routes/api/redirects/404s/summary.mjs +5 -28
  444. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  445. package/dist/astro/routes/api/redirects/_id_.mjs +6 -29
  446. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  447. package/dist/astro/routes/api/redirects/index.mjs +6 -29
  448. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  449. package/dist/astro/routes/api/relations/_id_/index.mjs +5 -45
  450. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
  451. package/dist/astro/routes/api/relations/index.mjs +5 -45
  452. package/dist/astro/routes/api/relations/index.mjs.map +1 -1
  453. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -6
  454. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -1
  455. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +7 -23
  456. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
  457. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +5 -87
  458. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
  459. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +5 -87
  460. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
  461. package/dist/astro/routes/api/schema/block-types/index.mjs +5 -87
  462. package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
  463. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +5 -87
  464. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  465. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +5 -87
  466. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  467. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +5 -87
  468. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  469. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +5 -87
  470. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  471. package/dist/astro/routes/api/schema/collections/index.mjs +5 -87
  472. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  473. package/dist/astro/routes/api/schema/collections/reorder.mjs +5 -87
  474. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  475. package/dist/astro/routes/api/schema/index.mjs +4 -22
  476. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  477. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +5 -87
  478. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  479. package/dist/astro/routes/api/schema/orphans/index.mjs +3 -86
  480. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  481. package/dist/astro/routes/api/search/enable.mjs +5 -26
  482. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  483. package/dist/astro/routes/api/search/index.mjs +4 -25
  484. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  485. package/dist/astro/routes/api/search/rebuild.mjs +5 -26
  486. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  487. package/dist/astro/routes/api/search/stats.mjs +3 -14
  488. package/dist/astro/routes/api/search/stats.mjs.map +1 -1
  489. package/dist/astro/routes/api/search/suggest.mjs +4 -25
  490. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  491. package/dist/astro/routes/api/sections/_slug_.mjs +5 -25
  492. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  493. package/dist/astro/routes/api/sections/index.mjs +5 -25
  494. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  495. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +4 -10
  496. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
  497. package/dist/astro/routes/api/settings/backups/archives/index.mjs +3 -10
  498. package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
  499. package/dist/astro/routes/api/settings/backups/export.mjs +4 -10
  500. package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
  501. package/dist/astro/routes/api/settings/backups/index.mjs +5 -11
  502. package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
  503. package/dist/astro/routes/api/settings/domain-notify.d.mts.map +1 -1
  504. package/dist/astro/routes/api/settings/domain-notify.mjs +14 -14
  505. package/dist/astro/routes/api/settings/domain-notify.mjs.map +1 -1
  506. package/dist/astro/routes/api/settings/domain.mjs +8 -27
  507. package/dist/astro/routes/api/settings/domain.mjs.map +1 -1
  508. package/dist/astro/routes/api/settings/email.d.mts +2 -1
  509. package/dist/astro/routes/api/settings/email.d.mts.map +1 -1
  510. package/dist/astro/routes/api/settings/email.mjs +124 -16
  511. package/dist/astro/routes/api/settings/email.mjs.map +1 -1
  512. package/dist/astro/routes/api/settings.mjs +7 -35
  513. package/dist/astro/routes/api/settings.mjs.map +1 -1
  514. package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -1
  515. package/dist/astro/routes/api/setup/admin-verify.mjs +13 -29
  516. package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
  517. package/dist/astro/routes/api/setup/admin.d.mts.map +1 -1
  518. package/dist/astro/routes/api/setup/admin.mjs +10 -24
  519. package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
  520. package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
  521. package/dist/astro/routes/api/setup/dev-bypass.mjs +13 -58
  522. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  523. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -6
  524. package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -1
  525. package/dist/astro/routes/api/setup/index.mjs +14 -65
  526. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  527. package/dist/astro/routes/api/setup/status.mjs +3 -7
  528. package/dist/astro/routes/api/setup/status.mjs.map +1 -1
  529. package/dist/astro/routes/api/site/domain-proof.mjs +2 -21
  530. package/dist/astro/routes/api/site/domain-proof.mjs.map +1 -1
  531. package/dist/astro/routes/api/snapshot.mjs +6 -13
  532. package/dist/astro/routes/api/snapshot.mjs.map +1 -1
  533. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +7 -34
  534. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
  535. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +7 -34
  536. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  537. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +8 -34
  538. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  539. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +7 -34
  540. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  541. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +5 -32
  542. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
  543. package/dist/astro/routes/api/taxonomies/_name_.mjs +8 -34
  544. package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
  545. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +13 -46
  546. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -1
  547. package/dist/astro/routes/api/taxonomies/index.mjs +8 -34
  548. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  549. package/dist/astro/routes/api/themes/preview.mjs +4 -10
  550. package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
  551. package/dist/astro/routes/api/typegen.mjs +3 -7
  552. package/dist/astro/routes/api/typegen.mjs.map +1 -1
  553. package/dist/astro/routes/api/visual-editing/action-token.mjs +3 -10
  554. package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -1
  555. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +3 -26
  556. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -1
  557. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +1 -5
  558. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -1
  559. package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -1
  560. package/dist/astro/routes/api/well-known/auth.mjs +4 -3
  561. package/dist/astro/routes/api/well-known/auth.mjs.map +1 -1
  562. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  563. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  564. package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -1
  565. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +11 -22
  566. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  567. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
  568. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -27
  569. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  570. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -27
  571. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  572. package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -15
  573. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  574. package/dist/astro/routes/api/widget-areas/index.mjs +9 -27
  575. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  576. package/dist/astro/routes/api/widget-components.mjs +2 -6
  577. package/dist/astro/routes/api/widget-components.mjs.map +1 -1
  578. package/dist/astro/routes/robots.txt.d.mts.map +1 -1
  579. package/dist/astro/routes/robots.txt.mjs +6 -24
  580. package/dist/astro/routes/robots.txt.mjs.map +1 -1
  581. package/dist/astro/routes/sitemap-_collection_.xml.mjs +11 -25
  582. package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
  583. package/dist/astro/routes/sitemap.xml.d.mts.map +1 -1
  584. package/dist/astro/routes/sitemap.xml.mjs +5 -23
  585. package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
  586. package/dist/astro/types.d.mts +49 -23
  587. package/dist/astro/types.d.mts.map +1 -1
  588. package/dist/audit-T3NRtoQ5.mjs +127 -0
  589. package/dist/audit-T3NRtoQ5.mjs.map +1 -0
  590. package/dist/auth/providers/github.d.mts +1 -1
  591. package/dist/auth/providers/google.d.mts +1 -1
  592. package/dist/auth/providers/microsoft.d.mts +1 -1
  593. package/dist/authoritative-records-Cd5BVXRs.mjs +5183 -0
  594. package/dist/authoritative-records-Cd5BVXRs.mjs.map +1 -0
  595. package/dist/authorize-B-4ogCQG.mjs +74 -0
  596. package/dist/authorize-B-4ogCQG.mjs.map +1 -0
  597. package/dist/backup-BQhg3MEK.mjs +246 -0
  598. package/dist/backup-BQhg3MEK.mjs.map +1 -0
  599. package/dist/base64-GXviT28w.mjs +63 -0
  600. package/dist/base64-GXviT28w.mjs.map +1 -0
  601. package/dist/block-types-BTzqdEZV.mjs +132 -0
  602. package/dist/block-types-BTzqdEZV.mjs.map +1 -0
  603. package/dist/block-values-DzZIh7WN.mjs +215 -0
  604. package/dist/block-values-DzZIh7WN.mjs.map +1 -0
  605. package/dist/byline--sweE_MZ.mjs +930 -0
  606. package/dist/byline--sweE_MZ.mjs.map +1 -0
  607. package/dist/byline-fields-Czdq4Yad.mjs +123 -0
  608. package/dist/byline-fields-Czdq4Yad.mjs.map +1 -0
  609. package/dist/byline-registry-Cr7kjrxM.mjs +406 -0
  610. package/dist/byline-registry-Cr7kjrxM.mjs.map +1 -0
  611. package/dist/bylines-DnuH3H8z.mjs +234 -0
  612. package/dist/bylines-DnuH3H8z.mjs.map +1 -0
  613. package/dist/bylines-txlwgzIK.mjs +150 -0
  614. package/dist/bylines-txlwgzIK.mjs.map +1 -0
  615. package/dist/cache-BjnpmIpb.mjs +151 -0
  616. package/dist/cache-BjnpmIpb.mjs.map +1 -0
  617. package/dist/canonical-Cb-rJGRU.mjs +174 -0
  618. package/dist/canonical-Cb-rJGRU.mjs.map +1 -0
  619. package/dist/capture-triggers-BZmIEdX2.mjs +362 -0
  620. package/dist/capture-triggers-BZmIEdX2.mjs.map +1 -0
  621. package/dist/challenge-store-B0PoBBqW.mjs +51 -0
  622. package/dist/challenge-store-B0PoBBqW.mjs.map +1 -0
  623. package/dist/checksum-CH9TyM-N.mjs +162 -0
  624. package/dist/checksum-CH9TyM-N.mjs.map +1 -0
  625. package/dist/chrome-tags-BocDVqqx.mjs +24 -0
  626. package/dist/chrome-tags-BocDVqqx.mjs.map +1 -0
  627. package/dist/chunks-DRnEstVb.mjs +25 -0
  628. package/dist/chunks-DRnEstVb.mjs.map +1 -0
  629. package/dist/cli/index.mjs +892 -94
  630. package/dist/cli/index.mjs.map +1 -1
  631. package/dist/client/cf-access.d.mts +1 -1
  632. package/dist/client/index.d.mts +97 -97
  633. package/dist/client/index.d.mts.map +1 -1
  634. package/dist/client/index.mjs +15 -6
  635. package/dist/client/index.mjs.map +1 -1
  636. package/dist/collection-slugs-cache-CYMrqHZ6.mjs +91 -0
  637. package/dist/collection-slugs-cache-CYMrqHZ6.mjs.map +1 -0
  638. package/dist/comment-BGeXmJ8F.mjs +335 -0
  639. package/dist/comment-BGeXmJ8F.mjs.map +1 -0
  640. package/dist/comment-reaction-ty-JEDYR.mjs +85 -0
  641. package/dist/comment-reaction-ty-JEDYR.mjs.map +1 -0
  642. package/dist/comments-ByrrLvZL.mjs +99 -0
  643. package/dist/comments-ByrrLvZL.mjs.map +1 -0
  644. package/dist/comments-DqhARoef.mjs +195 -0
  645. package/dist/comments-DqhARoef.mjs.map +1 -0
  646. package/dist/components-u2HE5Mu9.mjs +112 -0
  647. package/dist/components-u2HE5Mu9.mjs.map +1 -0
  648. package/dist/config-B4F2ttAZ.d.mts +7230 -0
  649. package/dist/config-B4F2ttAZ.d.mts.map +1 -0
  650. package/dist/config-BnrtMvHW.mjs +228 -0
  651. package/dist/config-BnrtMvHW.mjs.map +1 -0
  652. package/dist/config-DEse9gaE.d.mts +41 -0
  653. package/dist/config-DEse9gaE.d.mts.map +1 -0
  654. package/dist/connection-BaIVuaDX.mjs +36 -0
  655. package/dist/connection-BaIVuaDX.mjs.map +1 -0
  656. package/dist/content-Dxztag5t.mjs +2270 -0
  657. package/dist/content-Dxztag5t.mjs.map +1 -0
  658. package/dist/content-list-query-yYbBU-dB.d.mts +26 -0
  659. package/dist/content-list-query-yYbBU-dB.d.mts.map +1 -0
  660. package/dist/content-policy-Drm9sqdA.mjs +68 -0
  661. package/dist/content-policy-Drm9sqdA.mjs.map +1 -0
  662. package/dist/content-repair-2PdahlgZ.mjs +443 -0
  663. package/dist/content-repair-2PdahlgZ.mjs.map +1 -0
  664. package/dist/content-save-KMll0S7E.mjs +202 -0
  665. package/dist/content-save-KMll0S7E.mjs.map +1 -0
  666. package/dist/context-C3OZjexd.mjs +2225 -0
  667. package/dist/context-C3OZjexd.mjs.map +1 -0
  668. package/dist/credits-C8uXoWfN.mjs +110 -0
  669. package/dist/credits-C8uXoWfN.mjs.map +1 -0
  670. package/dist/cron-CrjBjDuy.mjs +310 -0
  671. package/dist/cron-CrjBjDuy.mjs.map +1 -0
  672. package/dist/db/index.d.mts +3 -3
  673. package/dist/db/index.mjs +1 -4
  674. package/dist/db/index.mjs.map +1 -1
  675. package/dist/db/libsql-migrations.d.mts +1 -1
  676. package/dist/db/libsql-migrations.mjs +2 -7
  677. package/dist/db/libsql-migrations.mjs.map +1 -1
  678. package/dist/db/libsql.d.mts +1 -1
  679. package/dist/db/postgres-migrations.d.mts +1 -1
  680. package/dist/db/postgres-migrations.mjs +2 -7
  681. package/dist/db/postgres-migrations.mjs.map +1 -1
  682. package/dist/db/postgres.d.mts +1 -1
  683. package/dist/db/sqlite-migrations.d.mts +1 -1
  684. package/dist/db/sqlite-migrations.mjs +2 -7
  685. package/dist/db/sqlite-migrations.mjs.map +1 -1
  686. package/dist/db/sqlite.d.mts +1 -1
  687. package/dist/db/sqlite.mjs +1 -1
  688. package/dist/default-DPoN3H5H.mjs +81 -0
  689. package/dist/default-DPoN3H5H.mjs.map +1 -0
  690. package/dist/deferred-tasks-uSx5qCFn.d.mts +10 -0
  691. package/dist/deferred-tasks-uSx5qCFn.d.mts.map +1 -0
  692. package/dist/deferred-tasks-yv85msJv.mjs +52 -0
  693. package/dist/deferred-tasks-yv85msJv.mjs.map +1 -0
  694. package/dist/destination-BNL1K7Mz.mjs +18 -0
  695. package/dist/destination-BNL1K7Mz.mjs.map +1 -0
  696. package/dist/dev-typegen-BVQAguf4.mjs +29 -0
  697. package/dist/dev-typegen-BVQAguf4.mjs.map +1 -0
  698. package/dist/device-flow-hT8lKWXq.mjs +519 -0
  699. package/dist/device-flow-hT8lKWXq.mjs.map +1 -0
  700. package/dist/dialect-helpers-DqUMP9fJ.mjs +350 -0
  701. package/dist/dialect-helpers-DqUMP9fJ.mjs.map +1 -0
  702. package/dist/digest-xYRiuW_E.mjs +194 -0
  703. package/dist/digest-xYRiuW_E.mjs.map +1 -0
  704. package/dist/direct-executor-CZ2SH1bq.mjs +117 -0
  705. package/dist/direct-executor-CZ2SH1bq.mjs.map +1 -0
  706. package/dist/dist-kxThYgdL.mjs +810 -0
  707. package/dist/dist-kxThYgdL.mjs.map +1 -0
  708. package/dist/email-console-CochjAlh.mjs +50 -0
  709. package/dist/email-console-CochjAlh.mjs.map +1 -0
  710. package/dist/email-locale-BoxaIPG8.mjs +25 -0
  711. package/dist/email-locale-BoxaIPG8.mjs.map +1 -0
  712. package/dist/email-smtp-BnHR_Ccx.mjs +643 -0
  713. package/dist/email-smtp-BnHR_Ccx.mjs.map +1 -0
  714. package/dist/emdash-runtime-CXsdCQnM.mjs +5262 -0
  715. package/dist/emdash-runtime-CXsdCQnM.mjs.map +1 -0
  716. package/dist/enrich-BReo_COC.mjs +203 -0
  717. package/dist/enrich-BReo_COC.mjs.map +1 -0
  718. package/dist/entry-lock-BfnhlRhC.mjs +207 -0
  719. package/dist/entry-lock-BfnhlRhC.mjs.map +1 -0
  720. package/dist/entry-lock-DsVhZcJN.mjs +1228 -0
  721. package/dist/entry-lock-DsVhZcJN.mjs.map +1 -0
  722. package/dist/entry-locks-D_kjygT1.mjs +173 -0
  723. package/dist/entry-locks-D_kjygT1.mjs.map +1 -0
  724. package/dist/env-types-CXI9uaMU.mjs +38 -0
  725. package/dist/env-types-CXI9uaMU.mjs.map +1 -0
  726. package/dist/error-DcDNU7hZ.mjs +92 -0
  727. package/dist/error-DcDNU7hZ.mjs.map +1 -0
  728. package/dist/errors-BYdjOimY.mjs +18 -0
  729. package/dist/errors-BYdjOimY.mjs.map +1 -0
  730. package/dist/errors-CJ6711al.mjs +120 -0
  731. package/dist/errors-CJ6711al.mjs.map +1 -0
  732. package/dist/errors-CwYHYcWF.mjs +502 -0
  733. package/dist/errors-CwYHYcWF.mjs.map +1 -0
  734. package/dist/escape-YSAGQRHa.mjs +9 -0
  735. package/dist/escape-YSAGQRHa.mjs.map +1 -0
  736. package/dist/fence-C3MLClBo.mjs +162 -0
  737. package/dist/fence-C3MLClBo.mjs.map +1 -0
  738. package/dist/field-defs-cache-Cpk0eFsQ.mjs +79 -0
  739. package/dist/field-defs-cache-Cpk0eFsQ.mjs.map +1 -0
  740. package/dist/field-map-6o9hPcRl.mjs +84 -0
  741. package/dist/field-map-6o9hPcRl.mjs.map +1 -0
  742. package/dist/focal-point-Cup37tLI.mjs +23 -0
  743. package/dist/focal-point-Cup37tLI.mjs.map +1 -0
  744. package/dist/fts-manager-B3iLXCGz.mjs +500 -0
  745. package/dist/fts-manager-B3iLXCGz.mjs.map +1 -0
  746. package/dist/gc-D24C-KP7.mjs +62 -0
  747. package/dist/gc-D24C-KP7.mjs.map +1 -0
  748. package/dist/hash-SY9Nq5FH.mjs +37 -0
  749. package/dist/hash-SY9Nq5FH.mjs.map +1 -0
  750. package/dist/hook-result-BU5rI-6M.d.mts +31 -0
  751. package/dist/hook-result-BU5rI-6M.d.mts.map +1 -0
  752. package/dist/hook-result-CO4E3zDv.mjs +3854 -0
  753. package/dist/hook-result-CO4E3zDv.mjs.map +1 -0
  754. package/dist/hreflang-Bzvlo9Ci.mjs +105 -0
  755. package/dist/hreflang-Bzvlo9Ci.mjs.map +1 -0
  756. package/dist/hreflang-Ds0WbBOu.d.mts +51 -0
  757. package/dist/hreflang-Ds0WbBOu.d.mts.map +1 -0
  758. package/dist/http-route-dispatch-BsjkWBZF.mjs +348 -0
  759. package/dist/http-route-dispatch-BsjkWBZF.mjs.map +1 -0
  760. package/dist/identity-CahxkBZC.mjs +35 -0
  761. package/dist/identity-CahxkBZC.mjs.map +1 -0
  762. package/dist/index-BauU0yTw.d.mts +261 -0
  763. package/dist/index-BauU0yTw.d.mts.map +1 -0
  764. package/dist/index.d.mts +26 -24
  765. package/dist/index.mjs +2111 -121
  766. package/dist/index.mjs.map +1 -0
  767. package/dist/init-lock-Dn7efXfy.mjs +56 -0
  768. package/dist/init-lock-Dn7efXfy.mjs.map +1 -0
  769. package/dist/install-finalization-CIl610wT.mjs +58 -0
  770. package/dist/install-finalization-CIl610wT.mjs.map +1 -0
  771. package/dist/json-recordset-CrS6ZqMk.mjs +12 -0
  772. package/dist/json-recordset-CrS6ZqMk.mjs.map +1 -0
  773. package/dist/json-schema-CBcJlGcY.mjs +15 -0
  774. package/dist/json-schema-CBcJlGcY.mjs.map +1 -0
  775. package/dist/keys-DJ62Wt5b.mjs +61 -0
  776. package/dist/keys-DJ62Wt5b.mjs.map +1 -0
  777. package/dist/kinds-D7_f3Qu3.mjs +974 -0
  778. package/dist/kinds-D7_f3Qu3.mjs.map +1 -0
  779. package/dist/lifecycle-DPCkpFHV.mjs +49 -0
  780. package/dist/lifecycle-DPCkpFHV.mjs.map +1 -0
  781. package/dist/limits-Bv6mXNM-.mjs +44 -0
  782. package/dist/limits-Bv6mXNM-.mjs.map +1 -0
  783. package/dist/load-r9P0fsRH.mjs +36 -0
  784. package/dist/load-r9P0fsRH.mjs.map +1 -0
  785. package/dist/loader-CSEfTKzr.mjs +1537 -0
  786. package/dist/loader-CSEfTKzr.mjs.map +1 -0
  787. package/dist/loops-BxzrcxPO.mjs +217 -0
  788. package/dist/loops-BxzrcxPO.mjs.map +1 -0
  789. package/dist/manifest-builder-BLWqITXR.mjs +196 -0
  790. package/dist/manifest-builder-BLWqITXR.mjs.map +1 -0
  791. package/dist/manifest-schema-BRpk5V7x.mjs +497 -0
  792. package/dist/manifest-schema-BRpk5V7x.mjs.map +1 -0
  793. package/dist/marketplace-5YFgYPVr.mjs +257 -0
  794. package/dist/marketplace-5YFgYPVr.mjs.map +1 -0
  795. package/dist/marketplace-zPVE4UY5.mjs +965 -0
  796. package/dist/marketplace-zPVE4UY5.mjs.map +1 -0
  797. package/dist/media/image-endpoint.d.mts.map +1 -1
  798. package/dist/media/image-endpoint.mjs +2 -1
  799. package/dist/media/image-endpoint.mjs.map +1 -1
  800. package/dist/media/index.d.mts +10 -5
  801. package/dist/media/index.d.mts.map +1 -1
  802. package/dist/media/index.mjs +4 -4
  803. package/dist/media/index.mjs.map +1 -1
  804. package/dist/media/local-runtime.d.mts +17 -14
  805. package/dist/media/local-runtime.d.mts.map +1 -1
  806. package/dist/media/local-runtime.mjs +3 -20
  807. package/dist/media/local-runtime.mjs.map +1 -1
  808. package/dist/media-C5fg1Xte.d.mts +203 -0
  809. package/dist/media-C5fg1Xte.d.mts.map +1 -0
  810. package/dist/media-CPETKjop.mjs +424 -0
  811. package/dist/media-CPETKjop.mjs.map +1 -0
  812. package/dist/media-Cid3xIHk.mjs +294 -0
  813. package/dist/media-Cid3xIHk.mjs.map +1 -0
  814. package/dist/media-DJaAAYI2.mjs +2805 -0
  815. package/dist/media-DJaAAYI2.mjs.map +1 -0
  816. package/dist/media-allowlist-B7JwNf-U.mjs +75 -0
  817. package/dist/media-allowlist-B7JwNf-U.mjs.map +1 -0
  818. package/dist/media-folders-BI7B7XUM.mjs +210 -0
  819. package/dist/media-folders-BI7B7XUM.mjs.map +1 -0
  820. package/dist/media-url-xWuPVfqO.mjs +43 -0
  821. package/dist/media-url-xWuPVfqO.mjs.map +1 -0
  822. package/dist/media-usage-SwtWPxy4.mjs +282 -0
  823. package/dist/media-usage-SwtWPxy4.mjs.map +1 -0
  824. package/dist/media-usage-activation-BTa1H4wE.mjs +78 -0
  825. package/dist/media-usage-activation-BTa1H4wE.mjs.map +1 -0
  826. package/dist/media-usage-work-BxHWfbKq.mjs +1036 -0
  827. package/dist/media-usage-work-BxHWfbKq.mjs.map +1 -0
  828. package/dist/media-usage-work-DYenZS8y.mjs +151 -0
  829. package/dist/media-usage-work-DYenZS8y.mjs.map +1 -0
  830. package/dist/menu-FtSf33fF.mjs +420 -0
  831. package/dist/menu-FtSf33fF.mjs.map +1 -0
  832. package/dist/menus--MSfZ5Eu.mjs +433 -0
  833. package/dist/menus--MSfZ5Eu.mjs.map +1 -0
  834. package/dist/menus-C8h6Jtpu.mjs +92 -0
  835. package/dist/menus-C8h6Jtpu.mjs.map +1 -0
  836. package/dist/menus-CpFAi_LK.mjs +434 -0
  837. package/dist/menus-CpFAi_LK.mjs.map +1 -0
  838. package/dist/migrations/index.d.mts +1 -1
  839. package/dist/migrations/index.mjs +2 -6
  840. package/dist/mime-Dx6aHTsR.mjs +82 -0
  841. package/dist/mime-Dx6aHTsR.mjs.map +1 -0
  842. package/dist/mode-D6Qg_-2J.mjs +23 -0
  843. package/dist/mode-D6Qg_-2J.mjs.map +1 -0
  844. package/dist/node-sqlite-compat-DvYkqx7Q.mjs +63 -0
  845. package/dist/node-sqlite-compat-DvYkqx7Q.mjs.map +1 -0
  846. package/dist/normalize-qcU0SKGf.mjs +220 -0
  847. package/dist/normalize-qcU0SKGf.mjs.map +1 -0
  848. package/dist/oauth-authorization-CBxtOboy.mjs +287 -0
  849. package/dist/oauth-authorization-CBxtOboy.mjs.map +1 -0
  850. package/dist/oauth-clients-HLGHmHqI.mjs +266 -0
  851. package/dist/oauth-clients-HLGHmHqI.mjs.map +1 -0
  852. package/dist/oauth-state-store-B4YAveSb.mjs +80 -0
  853. package/dist/oauth-state-store-B4YAveSb.mjs.map +1 -0
  854. package/dist/oauth-user-lookup-CTYMaKlq.mjs +26 -0
  855. package/dist/oauth-user-lookup-CTYMaKlq.mjs.map +1 -0
  856. package/dist/object-cache/memory.d.mts +1 -1
  857. package/dist/object-cache-DeATK4vw.mjs +805 -0
  858. package/dist/object-cache-DeATK4vw.mjs.map +1 -0
  859. package/dist/options-BJZMHnpx.d.mts +81 -0
  860. package/dist/options-BJZMHnpx.d.mts.map +1 -0
  861. package/dist/options-CMocxAku.mjs +208 -0
  862. package/dist/options-CMocxAku.mjs.map +1 -0
  863. package/dist/ownership-46c5NS0I.mjs +12 -0
  864. package/dist/ownership-46c5NS0I.mjs.map +1 -0
  865. package/dist/page/index.d.mts +2 -2
  866. package/dist/page/index.d.mts.map +1 -1
  867. package/dist/page/index.mjs +23 -27
  868. package/dist/page/index.mjs.map +1 -1
  869. package/dist/parse-B1E5cdyD.mjs +82 -0
  870. package/dist/parse-B1E5cdyD.mjs.map +1 -0
  871. package/dist/parse-Clt6wmpy.d.mts +178 -0
  872. package/dist/parse-Clt6wmpy.d.mts.map +1 -0
  873. package/dist/parts-CMwESQ6e.mjs +68 -0
  874. package/dist/parts-CMwESQ6e.mjs.map +1 -0
  875. package/dist/passkey-config-DiVZI-cx.mjs +46 -0
  876. package/dist/passkey-config-DiVZI-cx.mjs.map +1 -0
  877. package/dist/paths-NrYImb_h.mjs +77 -0
  878. package/dist/paths-NrYImb_h.mjs.map +1 -0
  879. package/dist/patterns-BxMSQThP.mjs +174 -0
  880. package/dist/patterns-BxMSQThP.mjs.map +1 -0
  881. package/dist/placeholder-B0vI-EQ9.d.mts +316 -0
  882. package/dist/placeholder-B0vI-EQ9.d.mts.map +1 -0
  883. package/dist/plan-CSb3BdFS.mjs +135 -0
  884. package/dist/plan-CSb3BdFS.mjs.map +1 -0
  885. package/dist/plugin-settings-HdYYRFi3.mjs +162 -0
  886. package/dist/plugin-settings-HdYYRFi3.mjs.map +1 -0
  887. package/dist/plugin-test-runtime.d.mts +24 -15
  888. package/dist/plugin-test-runtime.d.mts.map +1 -1
  889. package/dist/plugin-test-runtime.mjs +11 -127
  890. package/dist/plugin-tool-name-CCXxYq3K.mjs +27 -0
  891. package/dist/plugin-tool-name-CCXxYq3K.mjs.map +1 -0
  892. package/dist/plugin-types.d.mts +2 -2
  893. package/dist/plugin-utils.d.mts +15 -12
  894. package/dist/plugin-utils.d.mts.map +1 -1
  895. package/dist/plugins/adapt-sandbox-entry.d.mts +15 -12
  896. package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
  897. package/dist/plugins/adapt-sandbox-entry.mjs +6 -4
  898. package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
  899. package/dist/plugins/host.d.mts +13 -6
  900. package/dist/plugins/host.d.mts.map +1 -0
  901. package/dist/plugins/host.mjs +10 -63
  902. package/dist/plugins-Bc70Xs37.mjs +261 -0
  903. package/dist/plugins-Bc70Xs37.mjs.map +1 -0
  904. package/dist/policy-C-ngDrxa.mjs +56 -0
  905. package/dist/policy-C-ngDrxa.mjs.map +1 -0
  906. package/dist/portable-text-T17rOqF7.mjs +454 -0
  907. package/dist/portable-text-T17rOqF7.mjs.map +1 -0
  908. package/dist/protocol-CmSX4cXv.d.mts +65 -0
  909. package/dist/protocol-CmSX4cXv.d.mts.map +1 -0
  910. package/dist/public-plugin-api-routes-_xsWTlwE.mjs +316 -0
  911. package/dist/public-plugin-api-routes-_xsWTlwE.mjs.map +1 -0
  912. package/dist/public-submission-ui3pFYtq.mjs +253 -0
  913. package/dist/public-submission-ui3pFYtq.mjs.map +1 -0
  914. package/dist/public-url-DMRZPAiW.mjs +123 -0
  915. package/dist/public-url-DMRZPAiW.mjs.map +1 -0
  916. package/dist/query-C1K9PzUc.mjs +41 -0
  917. package/dist/query-C1K9PzUc.mjs.map +1 -0
  918. package/dist/query-DdmHrvie.mjs +1201 -0
  919. package/dist/query-DdmHrvie.mjs.map +1 -0
  920. package/dist/query-EVjg8-Bq.mjs +37 -0
  921. package/dist/query-EVjg8-Bq.mjs.map +1 -0
  922. package/dist/range-BaF0521t.mjs +51 -0
  923. package/dist/range-BaF0521t.mjs.map +1 -0
  924. package/dist/rate-limit-6MngP0_m.mjs +127 -0
  925. package/dist/rate-limit-6MngP0_m.mjs.map +1 -0
  926. package/dist/receipt-BFm5eaN7.mjs +43 -0
  927. package/dist/receipt-BFm5eaN7.mjs.map +1 -0
  928. package/dist/redirect-ChcHI1KC.mjs +466 -0
  929. package/dist/redirect-ChcHI1KC.mjs.map +1 -0
  930. package/dist/redirect-EpidEf_5.mjs +19 -0
  931. package/dist/redirect-EpidEf_5.mjs.map +1 -0
  932. package/dist/redirect-paths-B9cXh9Wv.mjs +36 -0
  933. package/dist/redirect-paths-B9cXh9Wv.mjs.map +1 -0
  934. package/dist/redirects-D3zHoxhn.mjs +446 -0
  935. package/dist/redirects-D3zHoxhn.mjs.map +1 -0
  936. package/dist/redirects-dFPJ0HrD.mjs +148 -0
  937. package/dist/redirects-dFPJ0HrD.mjs.map +1 -0
  938. package/dist/registry/testing.mjs +2 -3
  939. package/dist/registry/testing.mjs.map +1 -1
  940. package/dist/registry-CDzYrAFY.mjs +6074 -0
  941. package/dist/registry-CDzYrAFY.mjs.map +1 -0
  942. package/dist/registry-Cf9vkVxW.mjs +1449 -0
  943. package/dist/registry-Cf9vkVxW.mjs.map +1 -0
  944. package/dist/registry-mZi_lxtT.mjs +755 -0
  945. package/dist/registry-mZi_lxtT.mjs.map +1 -0
  946. package/dist/relations-Eyop_U4o.mjs +798 -0
  947. package/dist/relations-Eyop_U4o.mjs.map +1 -0
  948. package/dist/request-cache-BYMs-BGX.mjs +104 -0
  949. package/dist/request-cache-BYMs-BGX.mjs.map +1 -0
  950. package/dist/request-context.d.mts +16 -3
  951. package/dist/request-context.d.mts.map +1 -1
  952. package/dist/request-context.mjs +22 -1
  953. package/dist/request-context.mjs.map +1 -1
  954. package/dist/request-meta-DsSkOdO0.mjs +141 -0
  955. package/dist/request-meta-DsSkOdO0.mjs.map +1 -0
  956. package/dist/resolve-Z5YK_6ew.mjs +199 -0
  957. package/dist/resolve-Z5YK_6ew.mjs.map +1 -0
  958. package/dist/resolve-s7ANHtFx.mjs +92 -0
  959. package/dist/resolve-s7ANHtFx.mjs.map +1 -0
  960. package/dist/rev-B6HS7337.mjs +50 -0
  961. package/dist/rev-B6HS7337.mjs.map +1 -0
  962. package/dist/revision-D7EedSdU.mjs +503 -0
  963. package/dist/revision-D7EedSdU.mjs.map +1 -0
  964. package/dist/rooms/index.d.mts +48 -0
  965. package/dist/rooms/index.d.mts.map +1 -0
  966. package/dist/rooms/index.mjs +6 -0
  967. package/dist/rooms/node/index.d.mts +25 -0
  968. package/dist/rooms/node/index.d.mts.map +1 -0
  969. package/dist/rooms/node/index.mjs +583 -0
  970. package/dist/rooms/node/index.mjs.map +1 -0
  971. package/dist/rooms/notifications.d.mts +47 -0
  972. package/dist/rooms/notifications.d.mts.map +1 -0
  973. package/dist/rooms/notifications.mjs +125 -0
  974. package/dist/rooms/notifications.mjs.map +1 -0
  975. package/dist/rooms/room.d.mts +76 -0
  976. package/dist/rooms/room.d.mts.map +1 -0
  977. package/dist/rooms/room.mjs +1257 -0
  978. package/dist/rooms/room.mjs.map +1 -0
  979. package/dist/rooms/site.d.mts +23 -0
  980. package/dist/rooms/site.d.mts.map +1 -0
  981. package/dist/rooms/site.mjs +146 -0
  982. package/dist/rooms/site.mjs.map +1 -0
  983. package/dist/rooms-CSNLTJsG.mjs +331 -0
  984. package/dist/rooms-CSNLTJsG.mjs.map +1 -0
  985. package/dist/rooms-CVsLla78.mjs +169 -0
  986. package/dist/rooms-CVsLla78.mjs.map +1 -0
  987. package/dist/rooms-CyXG83RZ.d.mts +4653 -0
  988. package/dist/rooms-CyXG83RZ.d.mts.map +1 -0
  989. package/dist/route-cache-CBpXPq-N.mjs +30 -0
  990. package/dist/route-cache-CBpXPq-N.mjs.map +1 -0
  991. package/dist/route-cache-DkhMwAIC.mjs +20 -0
  992. package/dist/route-cache-DkhMwAIC.mjs.map +1 -0
  993. package/dist/route-wire-DKSTaEz_.mjs +197 -0
  994. package/dist/route-wire-DKSTaEz_.mjs.map +1 -0
  995. package/dist/routes-QcHRiebw.mjs +272 -0
  996. package/dist/routes-QcHRiebw.mjs.map +1 -0
  997. package/dist/runner-4BfB04Rg.mjs +6950 -0
  998. package/dist/runner-4BfB04Rg.mjs.map +1 -0
  999. package/dist/runner-CAHS_KER.d.mts +79 -0
  1000. package/dist/runner-CAHS_KER.d.mts.map +1 -0
  1001. package/dist/runtime-holder-0g6pqbzx.mjs +36 -0
  1002. package/dist/runtime-holder-0g6pqbzx.mjs.map +1 -0
  1003. package/dist/runtime.d.mts +16 -13
  1004. package/dist/runtime.d.mts.map +1 -1
  1005. package/dist/runtime.mjs +1 -8
  1006. package/dist/runtime.mjs.map +1 -1
  1007. package/dist/scheduler-health-C5HEg2Yl.mjs +31 -0
  1008. package/dist/scheduler-health-C5HEg2Yl.mjs.map +1 -0
  1009. package/dist/schema/project-env-types.mjs +7 -55
  1010. package/dist/schema/project-env-types.mjs.map +1 -1
  1011. package/dist/schema-DS7ooMmp.mjs +13 -0
  1012. package/dist/schema-DS7ooMmp.mjs.map +1 -0
  1013. package/dist/schema-Mjtj7n1t.mjs +815 -0
  1014. package/dist/schema-Mjtj7n1t.mjs.map +1 -0
  1015. package/dist/scopes-BaR6WUyq.mjs +34 -0
  1016. package/dist/scopes-BaR6WUyq.mjs.map +1 -0
  1017. package/dist/search-B9RFgr0N.mjs +450 -0
  1018. package/dist/search-B9RFgr0N.mjs.map +1 -0
  1019. package/dist/secrets-C4UrjPiG.mjs +369 -0
  1020. package/dist/secrets-C4UrjPiG.mjs.map +1 -0
  1021. package/dist/sections-Bfa0oF8Q.mjs +129 -0
  1022. package/dist/sections-Bfa0oF8Q.mjs.map +1 -0
  1023. package/dist/sections-Bn2C6we7.mjs +222 -0
  1024. package/dist/sections-Bn2C6we7.mjs.map +1 -0
  1025. package/dist/seed/index.d.mts +3 -3
  1026. package/dist/seed/index.mjs +6 -54
  1027. package/dist/seo/index.d.mts +8 -6
  1028. package/dist/seo/index.d.mts.map +1 -1
  1029. package/dist/seo/index.mjs +10 -41
  1030. package/dist/seo/index.mjs.map +1 -1
  1031. package/dist/seo-DPW6k5_-.mjs +188 -0
  1032. package/dist/seo-DPW6k5_-.mjs.map +1 -0
  1033. package/dist/service-B4mHMku9.mjs +150 -0
  1034. package/dist/service-B4mHMku9.mjs.map +1 -0
  1035. package/dist/session-user-CF2jNfj7.mjs +61 -0
  1036. package/dist/session-user-CF2jNfj7.mjs.map +1 -0
  1037. package/dist/settings-4r88LLIM.mjs +66 -0
  1038. package/dist/settings-4r88LLIM.mjs.map +1 -0
  1039. package/dist/settings-BB2xxz3Y.mjs +74 -0
  1040. package/dist/settings-BB2xxz3Y.mjs.map +1 -0
  1041. package/dist/settings-BTkGl-bX.mjs +413 -0
  1042. package/dist/settings-BTkGl-bX.mjs.map +1 -0
  1043. package/dist/settings-y8Jx8b7g.mjs +157 -0
  1044. package/dist/settings-y8Jx8b7g.mjs.map +1 -0
  1045. package/dist/setup-complete-BGRiC59t.mjs +65 -0
  1046. package/dist/setup-complete-BGRiC59t.mjs.map +1 -0
  1047. package/dist/setup-nonce-D43FsOgZ.mjs +25 -0
  1048. package/dist/setup-nonce-D43FsOgZ.mjs.map +1 -0
  1049. package/dist/single-flight-cache-BCP1Tvcm.mjs +104 -0
  1050. package/dist/single-flight-cache-BCP1Tvcm.mjs.map +1 -0
  1051. package/dist/site-domain-CFX7g6ik.mjs +131 -0
  1052. package/dist/site-domain-CFX7g6ik.mjs.map +1 -0
  1053. package/dist/site-settings-C0D9fv7e.mjs +50 -0
  1054. package/dist/site-settings-C0D9fv7e.mjs.map +1 -0
  1055. package/dist/site-title-C0JVN6en.mjs +14 -0
  1056. package/dist/site-title-C0JVN6en.mjs.map +1 -0
  1057. package/dist/site-url-DzVnHJ8j.mjs +45 -0
  1058. package/dist/site-url-DzVnHJ8j.mjs.map +1 -0
  1059. package/dist/sitemap-name-Ja_Cvwx9.mjs +26 -0
  1060. package/dist/sitemap-name-Ja_Cvwx9.mjs.map +1 -0
  1061. package/dist/slug-CO2jtUda.mjs +16 -0
  1062. package/dist/slug-CO2jtUda.mjs.map +1 -0
  1063. package/dist/slugify-sxuydlHd.mjs +22 -0
  1064. package/dist/slugify-sxuydlHd.mjs.map +1 -0
  1065. package/dist/snapshot-C9OWUtFr.mjs +466 -0
  1066. package/dist/snapshot-C9OWUtFr.mjs.map +1 -0
  1067. package/dist/snapshot-CR5tan8p.mjs +184 -0
  1068. package/dist/snapshot-CR5tan8p.mjs.map +1 -0
  1069. package/dist/ssrf-Lj1KZxYt.mjs +406 -0
  1070. package/dist/ssrf-Lj1KZxYt.mjs.map +1 -0
  1071. package/dist/stage-ChbGIslu.mjs +662 -0
  1072. package/dist/stage-ChbGIslu.mjs.map +1 -0
  1073. package/dist/staged-BN8pRZwX.mjs +686 -0
  1074. package/dist/staged-BN8pRZwX.mjs.map +1 -0
  1075. package/dist/state-DtcE0eN3.mjs +178 -0
  1076. package/dist/state-DtcE0eN3.mjs.map +1 -0
  1077. package/dist/status-vvme29qV.mjs +30 -0
  1078. package/dist/status-vvme29qV.mjs.map +1 -0
  1079. package/dist/storage/local.d.mts +1 -1
  1080. package/dist/storage/local.mjs +2 -2
  1081. package/dist/storage/s3.d.mts +1 -1
  1082. package/dist/storage/s3.mjs +1 -1
  1083. package/dist/storage-query-BDUX3Cef.d.mts +1608 -0
  1084. package/dist/storage-query-BDUX3Cef.d.mts.map +1 -0
  1085. package/dist/tar-CAvEHFbE.mjs +449 -0
  1086. package/dist/tar-CAvEHFbE.mjs.map +1 -0
  1087. package/dist/target-BM_6fT9m.mjs +27 -0
  1088. package/dist/target-BM_6fT9m.mjs.map +1 -0
  1089. package/dist/taxonomies-BMuFLd53.mjs +722 -0
  1090. package/dist/taxonomies-BMuFLd53.mjs.map +1 -0
  1091. package/dist/taxonomies-ClkYcmcH.mjs +937 -0
  1092. package/dist/taxonomies-ClkYcmcH.mjs.map +1 -0
  1093. package/dist/taxonomy-s1GcBCRo.mjs +593 -0
  1094. package/dist/taxonomy-s1GcBCRo.mjs.map +1 -0
  1095. package/dist/tokens-Cpm6FIKJ.mjs +171 -0
  1096. package/dist/tokens-Cpm6FIKJ.mjs.map +1 -0
  1097. package/dist/transaction-SKrr6u84.mjs +44 -0
  1098. package/dist/transaction-SKrr6u84.mjs.map +1 -0
  1099. package/dist/transfer-B3CsI5MG.mjs +8963 -0
  1100. package/dist/transfer-B3CsI5MG.mjs.map +1 -0
  1101. package/dist/transfer-DqUiK3ca.mjs +166 -0
  1102. package/dist/transfer-DqUiK3ca.mjs.map +1 -0
  1103. package/dist/transfer-download-CWPfhL91.mjs +33 -0
  1104. package/dist/transfer-download-CWPfhL91.mjs.map +1 -0
  1105. package/dist/transformations-ClH4dJeM.mjs +196 -0
  1106. package/dist/transformations-ClH4dJeM.mjs.map +1 -0
  1107. package/dist/transport-C6Ps8ejN.mjs +144 -0
  1108. package/dist/transport-C6Ps8ejN.mjs.map +1 -0
  1109. package/dist/transport-D4hWYmO_.d.mts +42 -0
  1110. package/dist/transport-D4hWYmO_.d.mts.map +1 -0
  1111. package/dist/trusted-proxy-CWX1sqgb.mjs +51 -0
  1112. package/dist/trusted-proxy-CWX1sqgb.mjs.map +1 -0
  1113. package/dist/turnstile-B6zM50Mh.mjs +58 -0
  1114. package/dist/turnstile-B6zM50Mh.mjs.map +1 -0
  1115. package/dist/types-BBH-w_KS.mjs +133 -0
  1116. package/dist/types-BBH-w_KS.mjs.map +1 -0
  1117. package/dist/types-Ba3bWb9D.mjs +37 -0
  1118. package/dist/types-Ba3bWb9D.mjs.map +1 -0
  1119. package/dist/types-BmBK2cqf.mjs +201 -0
  1120. package/dist/types-BmBK2cqf.mjs.map +1 -0
  1121. package/dist/types-C0M6z2A4.mjs +16 -0
  1122. package/dist/types-C0M6z2A4.mjs.map +1 -0
  1123. package/dist/types-CG1dR_Cm.d.mts +934 -0
  1124. package/dist/types-CG1dR_Cm.d.mts.map +1 -0
  1125. package/dist/types-CImd8MBY.d.mts +1756 -0
  1126. package/dist/types-CImd8MBY.d.mts.map +1 -0
  1127. package/dist/types-CML-oGr6.d.mts +293 -0
  1128. package/dist/types-CML-oGr6.d.mts.map +1 -0
  1129. package/dist/types-CZO9f_vJ.d.mts +381 -0
  1130. package/dist/types-CZO9f_vJ.d.mts.map +1 -0
  1131. package/dist/types-CpFfDrGH.mjs +18 -0
  1132. package/dist/types-CpFfDrGH.mjs.map +1 -0
  1133. package/dist/types-D2zSjG0c.mjs +63 -0
  1134. package/dist/types-D2zSjG0c.mjs.map +1 -0
  1135. package/dist/types-DLKviL1s.d.mts +93 -0
  1136. package/dist/types-DLKviL1s.d.mts.map +1 -0
  1137. package/dist/types-Df0R58Wu.mjs +77 -0
  1138. package/dist/types-Df0R58Wu.mjs.map +1 -0
  1139. package/dist/types-DwNwhyWP.d.mts +227 -0
  1140. package/dist/types-DwNwhyWP.d.mts.map +1 -0
  1141. package/dist/types-DwZgl0Zn.d.mts +366 -0
  1142. package/dist/types-DwZgl0Zn.d.mts.map +1 -0
  1143. package/dist/types-Dyb_OuSw.d.mts +125 -0
  1144. package/dist/types-Dyb_OuSw.d.mts.map +1 -0
  1145. package/dist/types-iOnPkHRk.d.mts +209 -0
  1146. package/dist/types-iOnPkHRk.d.mts.map +1 -0
  1147. package/dist/ui-comments.d.mts +66 -0
  1148. package/dist/ui-search.d.mts +75 -0
  1149. package/dist/ui-webmcp-search.d.mts +29 -0
  1150. package/dist/ui.d.mts +576 -0
  1151. package/dist/upload-attempts-5Ot7-vsw.mjs +32 -0
  1152. package/dist/upload-attempts-5Ot7-vsw.mjs.map +1 -0
  1153. package/dist/url-BVdd-tah.mjs +104 -0
  1154. package/dist/url-BVdd-tah.mjs.map +1 -0
  1155. package/dist/url-ZCjpMO-q.mjs +74 -0
  1156. package/dist/url-ZCjpMO-q.mjs.map +1 -0
  1157. package/dist/url-pattern-BQT-sGmD.mjs +41 -0
  1158. package/dist/url-pattern-BQT-sGmD.mjs.map +1 -0
  1159. package/dist/urls-Cq_hUk4P.mjs +79 -0
  1160. package/dist/urls-Cq_hUk4P.mjs.map +1 -0
  1161. package/dist/user-C4km6fox.mjs +184 -0
  1162. package/dist/user-C4km6fox.mjs.map +1 -0
  1163. package/dist/utils-Cpo0_V09.d.mts +374 -0
  1164. package/dist/utils-Cpo0_V09.d.mts.map +1 -0
  1165. package/dist/utils-DMDmdhU3.mjs +450 -0
  1166. package/dist/utils-DMDmdhU3.mjs.map +1 -0
  1167. package/dist/validate-BNupiQtz.mjs +524 -0
  1168. package/dist/validate-BNupiQtz.mjs.map +1 -0
  1169. package/dist/validate-DBfkJa3O.d.mts +472 -0
  1170. package/dist/validate-DBfkJa3O.d.mts.map +1 -0
  1171. package/dist/validation-W_efZFgP.mjs +204 -0
  1172. package/dist/validation-W_efZFgP.mjs.map +1 -0
  1173. package/dist/version-C61rw8-y.mjs +9 -0
  1174. package/dist/version-C61rw8-y.mjs.map +1 -0
  1175. package/dist/version-DhGLeLRo.mjs +7 -0
  1176. package/dist/version-DhGLeLRo.mjs.map +1 -0
  1177. package/dist/version-eqLBDtcz.mjs +49 -0
  1178. package/dist/version-eqLBDtcz.mjs.map +1 -0
  1179. package/dist/video-My3h7vwE.mjs +18 -0
  1180. package/dist/video-My3h7vwE.mjs.map +1 -0
  1181. package/dist/virtual-modules-BZKqvjRC.mjs +568 -0
  1182. package/dist/virtual-modules-BZKqvjRC.mjs.map +1 -0
  1183. package/dist/widgets-DAdni19y.mjs +134 -0
  1184. package/dist/widgets-DAdni19y.mjs.map +1 -0
  1185. package/dist/wxr-DDPJOgkM.mjs +1054 -0
  1186. package/dist/wxr-DDPJOgkM.mjs.map +1 -0
  1187. package/dist/wxr-taxonomies-B0U2fJgs.mjs +735 -0
  1188. package/dist/wxr-taxonomies-B0U2fJgs.mjs.map +1 -0
  1189. package/dist/wxr-taxonomies-CyP2k4-Q.d.mts +34 -0
  1190. package/dist/wxr-taxonomies-CyP2k4-Q.d.mts.map +1 -0
  1191. package/dist/zod-generator-ChRSYUix.mjs +425 -0
  1192. package/dist/zod-generator-ChRSYUix.mjs.map +1 -0
  1193. package/package.json +81 -33
  1194. package/src/api/content-save.ts +281 -0
  1195. package/src/api/error.ts +6 -2
  1196. package/src/api/errors.ts +11 -0
  1197. package/src/api/handlers/content.ts +92 -26
  1198. package/src/api/handlers/device-flow.ts +1 -3
  1199. package/src/api/handlers/entry-lock.ts +69 -14
  1200. package/src/api/handlers/marketplace.ts +8 -2
  1201. package/src/api/handlers/media-allowlist.ts +56 -0
  1202. package/src/api/handlers/media-upload.ts +9 -1
  1203. package/src/api/handlers/menus.ts +3 -3
  1204. package/src/api/handlers/oauth-authorization.ts +1 -3
  1205. package/src/api/handlers/plugins.ts +4 -4
  1206. package/src/api/handlers/registry.ts +33 -21
  1207. package/src/api/handlers/relations.ts +20 -4
  1208. package/src/api/handlers/revision.ts +29 -0
  1209. package/src/api/handlers/rooms.ts +233 -0
  1210. package/src/api/handlers/site-domain.ts +1 -1
  1211. package/src/api/handlers/snapshot.ts +90 -30
  1212. package/src/api/handlers/staged-references.ts +14 -0
  1213. package/src/api/list-preconditions.ts +101 -0
  1214. package/src/api/openapi/document.ts +5 -5
  1215. package/src/api/parse.ts +3 -2
  1216. package/src/api/public-url.ts +21 -0
  1217. package/src/api/schemas/auth.ts +57 -1
  1218. package/src/api/schemas/content.ts +14 -0
  1219. package/src/api/schemas/entry-lock.ts +6 -1
  1220. package/src/api/schemas/import.ts +6 -0
  1221. package/src/api/schemas/index.ts +1 -0
  1222. package/src/api/schemas/media.ts +20 -0
  1223. package/src/api/schemas/rooms.ts +27 -0
  1224. package/src/api/schemas/schema.ts +9 -1
  1225. package/src/api/schemas/settings.ts +2 -0
  1226. package/src/api/site-title.ts +13 -0
  1227. package/src/api/types.ts +3 -0
  1228. package/src/astro/integration/admin-nav.ts +52 -0
  1229. package/src/astro/integration/index.ts +26 -5
  1230. package/src/astro/integration/routes.ts +15 -5
  1231. package/src/astro/integration/runtime.ts +46 -0
  1232. package/src/astro/integration/shims/use-sync-external-store-with-selector.js +2 -0
  1233. package/src/astro/integration/shims/use-sync-external-store.js +4 -1
  1234. package/src/astro/integration/virtual-modules.ts +80 -17
  1235. package/src/astro/integration/vite-config.ts +136 -0
  1236. package/src/astro/middleware/auth.ts +53 -18
  1237. package/src/astro/middleware/media-usage-write-fence.ts +4 -0
  1238. package/src/astro/middleware/redirect.ts +11 -1
  1239. package/src/astro/middleware/request-context.ts +57 -27
  1240. package/src/astro/middleware.ts +44 -29
  1241. package/src/astro/routes/PluginRegistry.tsx +21 -17
  1242. package/src/astro/routes/api/admin/comments/[id]/status.ts +9 -1
  1243. package/src/astro/routes/api/admin/comments/[id].ts +10 -3
  1244. package/src/astro/routes/api/admin/comments/bulk.ts +18 -4
  1245. package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +1 -1
  1246. package/src/astro/routes/api/admin/plugins/registry/install.ts +1 -1
  1247. package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +9 -2
  1248. package/src/astro/routes/api/auth/dev-bypass.ts +20 -1
  1249. package/src/astro/routes/api/auth/invite/complete.ts +2 -1
  1250. package/src/astro/routes/api/auth/invite/index.ts +9 -2
  1251. package/src/astro/routes/api/auth/invite/register-options.ts +2 -1
  1252. package/src/astro/routes/api/auth/magic-link/send.ts +9 -2
  1253. package/src/astro/routes/api/auth/me.ts +38 -17
  1254. package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +6 -11
  1255. package/src/astro/routes/api/auth/oauth/[provider].ts +6 -11
  1256. package/src/astro/routes/api/auth/passkey/options.ts +2 -1
  1257. package/src/astro/routes/api/auth/passkey/register/options.ts +2 -1
  1258. package/src/astro/routes/api/auth/passkey/register/verify.ts +2 -1
  1259. package/src/astro/routes/api/auth/passkey/verify.ts +2 -1
  1260. package/src/astro/routes/api/auth/signup/complete.ts +2 -1
  1261. package/src/astro/routes/api/auth/signup/request.ts +2 -1
  1262. package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +2 -2
  1263. package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +1 -0
  1264. package/src/astro/routes/api/content/[collection]/[id]/lock.ts +6 -3
  1265. package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +6 -2
  1266. package/src/astro/routes/api/content/[collection]/[id]/revisions/editors.ts +30 -0
  1267. package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +37 -1
  1268. package/src/astro/routes/api/content/[collection]/[id]/room.ts +43 -0
  1269. package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +3 -1
  1270. package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +54 -2
  1271. package/src/astro/routes/api/content/[collection]/[id].ts +22 -73
  1272. package/src/astro/routes/api/import/wordpress/analyze.ts +16 -29
  1273. package/src/astro/routes/api/import/wordpress/execute.ts +193 -15
  1274. package/src/astro/routes/api/import/wordpress/media.ts +6 -1
  1275. package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +9 -5
  1276. package/src/astro/routes/api/import/wordpress-plugin/execute.ts +25 -19
  1277. package/src/astro/routes/api/manifest.ts +40 -5
  1278. package/src/astro/routes/api/media/[id]/confirm.ts +42 -14
  1279. package/src/astro/routes/api/media/asset/[id]/[filename].ts +1 -0
  1280. package/src/astro/routes/api/media/file/[...key].ts +19 -4
  1281. package/src/astro/routes/api/media/upload-url.ts +1 -1
  1282. package/src/astro/routes/api/media.ts +14 -4
  1283. package/src/astro/routes/api/oauth/device/authorize.ts +0 -2
  1284. package/src/astro/routes/api/oauth/token.ts +5 -1
  1285. package/src/astro/routes/api/revisions/[revisionId]/restore.ts +1 -1
  1286. package/src/astro/routes/api/settings/domain-notify.ts +9 -2
  1287. package/src/astro/routes/api/settings/email.ts +197 -8
  1288. package/src/astro/routes/api/setup/admin-verify.ts +2 -1
  1289. package/src/astro/routes/api/setup/admin.ts +2 -1
  1290. package/src/astro/routes/api/setup/dev-bypass.ts +3 -1
  1291. package/src/astro/routes/api/setup/index.ts +5 -2
  1292. package/src/astro/routes/api/well-known/auth.ts +2 -1
  1293. package/src/astro/routes/api/widget-areas/[name]/reorder.ts +7 -1
  1294. package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +3 -1
  1295. package/src/astro/routes/api/widget-areas/[name]/widgets.ts +2 -1
  1296. package/src/astro/routes/api/widget-areas/[name].ts +2 -1
  1297. package/src/astro/routes/api/widget-areas/index.ts +2 -1
  1298. package/src/astro/routes/robots.txt.ts +9 -10
  1299. package/src/astro/routes/sitemap-[collection].xml.ts +5 -6
  1300. package/src/astro/routes/sitemap.xml.ts +2 -6
  1301. package/src/astro/runtime-holder.ts +41 -0
  1302. package/src/astro/types.ts +46 -8
  1303. package/src/auth/api-tokens.ts +3 -0
  1304. package/src/auth/oauth-env.ts +35 -0
  1305. package/src/bylines/field-defs-cache.ts +9 -4
  1306. package/src/cleanup.ts +44 -0
  1307. package/src/cli/commands/export-seed.ts +4 -3
  1308. package/src/cli/commands/import/wordpress.ts +158 -56
  1309. package/src/cli/commands/import.ts +139 -0
  1310. package/src/cli/commands/login.ts +26 -1
  1311. package/src/cli/commands/schema.ts +2 -2
  1312. package/src/cli/commands/seed.ts +3 -3
  1313. package/src/cli/credentials.ts +58 -17
  1314. package/src/cli/index.ts +4 -1
  1315. package/src/cli/wxr/parser.ts +15 -13
  1316. package/src/client/index.ts +38 -24
  1317. package/src/client/portable-text.ts +390 -192
  1318. package/src/client/transport.ts +14 -4
  1319. package/src/comments/public-submission.ts +7 -0
  1320. package/src/comments/route-cache.ts +39 -0
  1321. package/src/components/Columns.astro +2 -4
  1322. package/src/components/CommentForm.astro +6 -0
  1323. package/src/components/Comments.astro +5 -1
  1324. package/src/components/Cover.astro +2 -4
  1325. package/src/components/EmDashHead.astro +9 -7
  1326. package/src/components/EmDashImage.astro +161 -34
  1327. package/src/components/EmDashMedia.astro +36 -31
  1328. package/src/components/Embed.astro +49 -17
  1329. package/src/components/Gallery.astro +6 -2
  1330. package/src/components/Image.astro +15 -3
  1331. package/src/components/InlinePortableTextEditor.tsx +1 -0
  1332. package/src/components/LiveSearch.astro +23 -1
  1333. package/src/components/PortableText.astro +5 -8
  1334. package/src/components/inline-bubble-menu.tsx +109 -95
  1335. package/src/components/inline-image.tsx +54 -48
  1336. package/src/components/marks/Link.astro +7 -0
  1337. package/src/components/widgets/Archives.astro +6 -2
  1338. package/src/components/widgets/Categories.astro +7 -2
  1339. package/src/components/widgets/RecentPosts.astro +23 -13
  1340. package/src/components/widgets/Search.astro +3 -1
  1341. package/src/components/widgets/Tags.astro +7 -2
  1342. package/src/config/options-schema.ts +124 -0
  1343. package/src/content/converters/video.ts +6 -65
  1344. package/src/database/dialect-helpers.ts +67 -3
  1345. package/src/database/migrations/092_plugin_kv_options.ts +93 -0
  1346. package/src/database/migrations/093_menu_item_orphans.ts +21 -0
  1347. package/src/database/migrations/094_media_usage_file_url_reindex.ts +57 -0
  1348. package/src/database/migrations/095_plugin_storage_unique_scope.ts +134 -0
  1349. package/src/database/migrations/096_revision_kind_and_editors.ts +29 -0
  1350. package/src/database/migrations/097_room_storage.ts +43 -0
  1351. package/src/database/migrations/content-sized.ts +16 -0
  1352. package/src/database/migrations/policy.ts +6 -1
  1353. package/src/database/migrations/runner.ts +37 -8
  1354. package/src/database/plugin-storage-index-name.ts +29 -0
  1355. package/src/database/repositories/byline.ts +99 -86
  1356. package/src/database/repositories/content.ts +179 -17
  1357. package/src/database/repositories/entry-locks.ts +35 -29
  1358. package/src/database/repositories/media-usage.ts +1 -1
  1359. package/src/database/repositories/media.ts +40 -0
  1360. package/src/database/repositories/menu.ts +193 -135
  1361. package/src/database/repositories/redirect.ts +116 -46
  1362. package/src/database/repositories/revision.ts +216 -20
  1363. package/src/database/repositories/seo.ts +2 -0
  1364. package/src/database/repositories/taxonomy.ts +91 -27
  1365. package/src/database/repositories/types.ts +3 -3
  1366. package/src/database/repositories/user.ts +34 -0
  1367. package/src/database/transaction.ts +23 -2
  1368. package/src/database/types.ts +24 -2
  1369. package/src/emdash-runtime.ts +1071 -247
  1370. package/src/i18n/resolve.ts +10 -0
  1371. package/src/import/index.ts +0 -12
  1372. package/src/import/menus.ts +202 -151
  1373. package/src/import/registry.ts +30 -1
  1374. package/src/import/utils.ts +15 -2
  1375. package/src/index.ts +11 -0
  1376. package/src/loader.ts +209 -115
  1377. package/src/mcp/server.ts +103 -29
  1378. package/src/media/content-disposition.ts +56 -0
  1379. package/src/media/enrich.ts +20 -4
  1380. package/src/media/image-endpoint.ts +1 -0
  1381. package/src/media/mime.ts +1 -0
  1382. package/src/media/normalize.ts +2 -0
  1383. package/src/media/placeholder.ts +4 -0
  1384. package/src/media/portable-text-file-refs.ts +98 -0
  1385. package/src/media/responsive.ts +29 -1
  1386. package/src/media/types.ts +2 -0
  1387. package/src/media/url.ts +15 -0
  1388. package/src/media/usage/content-fields.ts +2 -1
  1389. package/src/media/usage/content-snapshots.ts +111 -34
  1390. package/src/media/usage/extractor.ts +42 -8
  1391. package/src/media/usage/types.ts +5 -0
  1392. package/src/menus/index.ts +137 -25
  1393. package/src/object-cache/index.ts +402 -17
  1394. package/src/page/jsonld.ts +26 -11
  1395. package/src/plugin-test-runtime.ts +1 -0
  1396. package/src/plugins/adapt-sandbox-entry.ts +2 -0
  1397. package/src/plugins/content-policy.ts +36 -2
  1398. package/src/plugins/context.ts +17 -7
  1399. package/src/plugins/cron.ts +6 -3
  1400. package/src/plugins/define-plugin.ts +5 -1
  1401. package/src/plugins/editor-draft.ts +9 -3
  1402. package/src/plugins/email-smtp.ts +936 -0
  1403. package/src/plugins/hooks.ts +34 -8
  1404. package/src/plugins/host.ts +2 -0
  1405. package/src/plugins/http-route-dispatch.ts +3 -1
  1406. package/src/plugins/lifecycle.ts +25 -1
  1407. package/src/plugins/manager.ts +3 -0
  1408. package/src/plugins/sandbox/types.ts +10 -1
  1409. package/src/plugins/storage-indexes.ts +64 -55
  1410. package/src/plugins/types.ts +16 -1
  1411. package/src/query.ts +116 -47
  1412. package/src/redirects/cache.ts +3 -2
  1413. package/src/redirects/loops.ts +20 -4
  1414. package/src/redirects/patterns.ts +16 -0
  1415. package/src/request-context.ts +29 -1
  1416. package/src/rooms/document.ts +99 -0
  1417. package/src/rooms/hash.ts +19 -0
  1418. package/src/rooms/index.ts +28 -0
  1419. package/src/rooms/kysely-store.ts +279 -0
  1420. package/src/rooms/limits.ts +41 -0
  1421. package/src/rooms/merge.ts +115 -0
  1422. package/src/rooms/node/index.ts +30 -0
  1423. package/src/rooms/node/registry.ts +232 -0
  1424. package/src/rooms/node/signals.ts +89 -0
  1425. package/src/rooms/node/upgrades.ts +210 -0
  1426. package/src/rooms/notifications.ts +157 -0
  1427. package/src/rooms/parts.ts +74 -0
  1428. package/src/rooms/room.ts +1559 -0
  1429. package/src/rooms/site.ts +185 -0
  1430. package/src/rooms/snapshot.ts +11 -0
  1431. package/src/rooms/types.ts +298 -0
  1432. package/src/scheduled-publish.ts +18 -5
  1433. package/src/schema/registry.ts +14 -3
  1434. package/src/schema/types.ts +17 -8
  1435. package/src/search/errors.ts +22 -0
  1436. package/src/search/fts-manager.ts +26 -9
  1437. package/src/search/index.ts +2 -0
  1438. package/src/seed/apply.ts +161 -92
  1439. package/src/seed/index.ts +1 -1
  1440. package/src/seed/load.ts +9 -0
  1441. package/src/seed/types.ts +23 -14
  1442. package/src/seo/hreflang.ts +5 -4
  1443. package/src/seo/index.ts +10 -4
  1444. package/src/seo/title-field.ts +19 -0
  1445. package/src/settings/index.ts +36 -3
  1446. package/src/settings/types.ts +7 -0
  1447. package/src/taxonomies/index.ts +77 -76
  1448. package/src/transfer/analyze/target.ts +5 -0
  1449. package/src/transfer/domain.ts +23 -0
  1450. package/src/transfer/export/readers.ts +6 -2
  1451. package/src/transfer/format/columns.ts +4 -0
  1452. package/src/transfer/format/settings.ts +1 -0
  1453. package/src/transfer/import/advance.ts +12 -1
  1454. package/src/transfer/import/scaffold.ts +73 -9
  1455. package/src/transfer/import/stages.ts +53 -2
  1456. package/src/ui.ts +18 -19
  1457. package/src/utils/revalidating-cache.ts +85 -0
  1458. package/src/virtual-modules.d.ts +20 -3
  1459. package/src/visual-editing/toolbar.ts +79 -52
  1460. package/src/widgets/index.ts +27 -13
  1461. package/src/widgets/recent-posts.ts +13 -0
  1462. package/dist/action-token-B1ds4laA.mjs +0 -26
  1463. package/dist/action-token-B1ds4laA.mjs.map +0 -1
  1464. package/dist/activation-sGF9br3X.mjs +0 -387
  1465. package/dist/activation-sGF9br3X.mjs.map +0 -1
  1466. package/dist/adapters-BOMSX9PU.d.mts +0 -173
  1467. package/dist/adapters-BOMSX9PU.d.mts.map +0 -1
  1468. package/dist/after-PcEvMY_6.mjs +0 -96
  1469. package/dist/after-PcEvMY_6.mjs.map +0 -1
  1470. package/dist/allowed-origins-CovsTkm3.mjs +0 -116
  1471. package/dist/allowed-origins-CovsTkm3.mjs.map +0 -1
  1472. package/dist/api-C_LxFnOm.mjs +0 -5077
  1473. package/dist/api-C_LxFnOm.mjs.map +0 -1
  1474. package/dist/api-tokens-C7l0GUAF.mjs +0 -3
  1475. package/dist/api-tokens-DQ9Ee-vP.mjs +0 -173
  1476. package/dist/api-tokens-DQ9Ee-vP.mjs.map +0 -1
  1477. package/dist/apply-CLjfxvyH.mjs +0 -1758
  1478. package/dist/apply-CLjfxvyH.mjs.map +0 -1
  1479. package/dist/approvals-ocK89i4H.mjs +0 -460
  1480. package/dist/approvals-ocK89i4H.mjs.map +0 -1
  1481. package/dist/artifact-fetch-CgvvpoWQ.mjs +0 -659
  1482. package/dist/artifact-fetch-CgvvpoWQ.mjs.map +0 -1
  1483. package/dist/artifacts-DwOYYBQm.mjs +0 -323
  1484. package/dist/artifacts-DwOYYBQm.mjs.map +0 -1
  1485. package/dist/audit-B8XE-0UV.mjs +0 -127
  1486. package/dist/audit-B8XE-0UV.mjs.map +0 -1
  1487. package/dist/authoritative-records-LPtrIGOY.mjs +0 -5183
  1488. package/dist/authoritative-records-LPtrIGOY.mjs.map +0 -1
  1489. package/dist/authorize-CoDsRRp5.mjs +0 -74
  1490. package/dist/authorize-CoDsRRp5.mjs.map +0 -1
  1491. package/dist/backup-2Wj-hTCN.mjs +0 -246
  1492. package/dist/backup-2Wj-hTCN.mjs.map +0 -1
  1493. package/dist/base64-BQBZwXCx.mjs +0 -63
  1494. package/dist/base64-BQBZwXCx.mjs.map +0 -1
  1495. package/dist/block-types-C3gJEe7l.mjs +0 -132
  1496. package/dist/block-types-C3gJEe7l.mjs.map +0 -1
  1497. package/dist/block-values-CgbMtSGU.mjs +0 -215
  1498. package/dist/block-values-CgbMtSGU.mjs.map +0 -1
  1499. package/dist/byline-CzGZC2Zs.mjs +0 -922
  1500. package/dist/byline-CzGZC2Zs.mjs.map +0 -1
  1501. package/dist/byline-fields-B1qHvRps.mjs +0 -280
  1502. package/dist/byline-fields-B1qHvRps.mjs.map +0 -1
  1503. package/dist/byline-fields-vYd_4Q1e.mjs +0 -123
  1504. package/dist/byline-fields-vYd_4Q1e.mjs.map +0 -1
  1505. package/dist/byline-registry-BhzpO41z.mjs +0 -406
  1506. package/dist/byline-registry-BhzpO41z.mjs.map +0 -1
  1507. package/dist/bylines-BF555iIz.mjs +0 -150
  1508. package/dist/bylines-BF555iIz.mjs.map +0 -1
  1509. package/dist/bylines-DJx6IWWi.mjs +0 -234
  1510. package/dist/bylines-DJx6IWWi.mjs.map +0 -1
  1511. package/dist/cache-BWzswWB-.mjs +0 -151
  1512. package/dist/cache-BWzswWB-.mjs.map +0 -1
  1513. package/dist/canonical-DjF_z6GI.mjs +0 -174
  1514. package/dist/canonical-DjF_z6GI.mjs.map +0 -1
  1515. package/dist/capture-triggers-D7g3fOZj.mjs +0 -362
  1516. package/dist/capture-triggers-D7g3fOZj.mjs.map +0 -1
  1517. package/dist/challenge-store-Cfjdvw86.mjs +0 -51
  1518. package/dist/challenge-store-Cfjdvw86.mjs.map +0 -1
  1519. package/dist/checksum-BF4acJwn.mjs +0 -162
  1520. package/dist/checksum-BF4acJwn.mjs.map +0 -1
  1521. package/dist/chrome-tags-BDs29G3g.mjs +0 -24
  1522. package/dist/chrome-tags-BDs29G3g.mjs.map +0 -1
  1523. package/dist/chunks-CYBOL-zn.mjs +0 -25
  1524. package/dist/chunks-CYBOL-zn.mjs.map +0 -1
  1525. package/dist/collection-slugs-cache-B2J5aESO.mjs +0 -91
  1526. package/dist/collection-slugs-cache-B2J5aESO.mjs.map +0 -1
  1527. package/dist/comment-DV7dybcs.mjs +0 -335
  1528. package/dist/comment-DV7dybcs.mjs.map +0 -1
  1529. package/dist/comment-reaction-CWwqiT6x.mjs +0 -85
  1530. package/dist/comment-reaction-CWwqiT6x.mjs.map +0 -1
  1531. package/dist/comments-DVjWJm8X.mjs +0 -99
  1532. package/dist/comments-DVjWJm8X.mjs.map +0 -1
  1533. package/dist/comments-Q-ILHCEI.mjs +0 -195
  1534. package/dist/comments-Q-ILHCEI.mjs.map +0 -1
  1535. package/dist/components-DnOmvvgg.mjs +0 -112
  1536. package/dist/components-DnOmvvgg.mjs.map +0 -1
  1537. package/dist/config-9IzA83_U.d.mts +0 -6811
  1538. package/dist/config-9IzA83_U.d.mts.map +0 -1
  1539. package/dist/config-BdQzFtmR.mjs +0 -228
  1540. package/dist/config-BdQzFtmR.mjs.map +0 -1
  1541. package/dist/config-Cs2RBkJ6.d.mts +0 -41
  1542. package/dist/config-Cs2RBkJ6.d.mts.map +0 -1
  1543. package/dist/connection-CiXgZyCY.mjs +0 -36
  1544. package/dist/connection-CiXgZyCY.mjs.map +0 -1
  1545. package/dist/content-Dt0Os_WQ.mjs +0 -2109
  1546. package/dist/content-Dt0Os_WQ.mjs.map +0 -1
  1547. package/dist/content-list-query-BK26u9Ly.d.mts +0 -26
  1548. package/dist/content-list-query-BK26u9Ly.d.mts.map +0 -1
  1549. package/dist/content-policy-BLDbNJOb.mjs +0 -46
  1550. package/dist/content-policy-BLDbNJOb.mjs.map +0 -1
  1551. package/dist/content-repair-CjwbLy4m.mjs +0 -442
  1552. package/dist/content-repair-CjwbLy4m.mjs.map +0 -1
  1553. package/dist/context-ErV7UdQY.mjs +0 -2089
  1554. package/dist/context-ErV7UdQY.mjs.map +0 -1
  1555. package/dist/credits-BRyjafiF.mjs +0 -110
  1556. package/dist/credits-BRyjafiF.mjs.map +0 -1
  1557. package/dist/cron-Bm5xa7tv.mjs +0 -306
  1558. package/dist/cron-Bm5xa7tv.mjs.map +0 -1
  1559. package/dist/dashboard-DVxQ5XiI.mjs +0 -168
  1560. package/dist/dashboard-DVxQ5XiI.mjs.map +0 -1
  1561. package/dist/default-B9Tf2n94.mjs +0 -81
  1562. package/dist/default-B9Tf2n94.mjs.map +0 -1
  1563. package/dist/deferred-tasks-CpPEqsga.d.mts +0 -9
  1564. package/dist/deferred-tasks-CpPEqsga.d.mts.map +0 -1
  1565. package/dist/destination-DR3IHjmy.mjs +0 -18
  1566. package/dist/destination-DR3IHjmy.mjs.map +0 -1
  1567. package/dist/dev-typegen-ZeWYV8Jp.mjs +0 -29
  1568. package/dist/dev-typegen-ZeWYV8Jp.mjs.map +0 -1
  1569. package/dist/device-flow-BbYNZ9Xi.mjs +0 -521
  1570. package/dist/device-flow-BbYNZ9Xi.mjs.map +0 -1
  1571. package/dist/dialect-helpers-7_IqPdh9.mjs +0 -307
  1572. package/dist/dialect-helpers-7_IqPdh9.mjs.map +0 -1
  1573. package/dist/digest-DlBa7kJl.mjs +0 -194
  1574. package/dist/digest-DlBa7kJl.mjs.map +0 -1
  1575. package/dist/direct-executor-5T8gkhvA.mjs +0 -117
  1576. package/dist/direct-executor-5T8gkhvA.mjs.map +0 -1
  1577. package/dist/dist-DY0aOmAP.mjs +0 -810
  1578. package/dist/dist-DY0aOmAP.mjs.map +0 -1
  1579. package/dist/email-console-v3OM8It-.mjs +0 -50
  1580. package/dist/email-console-v3OM8It-.mjs.map +0 -1
  1581. package/dist/email-locale-CoZo-oZx.mjs +0 -25
  1582. package/dist/email-locale-CoZo-oZx.mjs.map +0 -1
  1583. package/dist/emdash-runtime-DwezbIqQ.mjs +0 -4392
  1584. package/dist/emdash-runtime-DwezbIqQ.mjs.map +0 -1
  1585. package/dist/enrich-C3XIJi0O.mjs +0 -194
  1586. package/dist/enrich-C3XIJi0O.mjs.map +0 -1
  1587. package/dist/entry-lock-CY7XpdSw.d.mts +0 -4568
  1588. package/dist/entry-lock-CY7XpdSw.d.mts.map +0 -1
  1589. package/dist/entry-lock-DDuWaAiP.mjs +0 -1211
  1590. package/dist/entry-lock-DDuWaAiP.mjs.map +0 -1
  1591. package/dist/entry-lock-D_Og9Gy3.mjs +0 -163
  1592. package/dist/entry-lock-D_Og9Gy3.mjs.map +0 -1
  1593. package/dist/entry-locks-Cp8_BcQQ.mjs +0 -167
  1594. package/dist/entry-locks-Cp8_BcQQ.mjs.map +0 -1
  1595. package/dist/env-types-Br8uywYA.mjs +0 -38
  1596. package/dist/env-types-Br8uywYA.mjs.map +0 -1
  1597. package/dist/error-CT2SsX5S.mjs +0 -90
  1598. package/dist/error-CT2SsX5S.mjs.map +0 -1
  1599. package/dist/errors-BMaCpLeS.mjs +0 -479
  1600. package/dist/errors-BMaCpLeS.mjs.map +0 -1
  1601. package/dist/errors-DlJwot7q.mjs +0 -120
  1602. package/dist/errors-DlJwot7q.mjs.map +0 -1
  1603. package/dist/escape-BfbDyuQ-.mjs +0 -9
  1604. package/dist/escape-BfbDyuQ-.mjs.map +0 -1
  1605. package/dist/fence-BOD3SxZG.mjs +0 -162
  1606. package/dist/fence-BOD3SxZG.mjs.map +0 -1
  1607. package/dist/field-defs-cache-C7sR7ZeU.mjs +0 -77
  1608. package/dist/field-defs-cache-C7sR7ZeU.mjs.map +0 -1
  1609. package/dist/field-map-C_rDXfdJ.mjs +0 -84
  1610. package/dist/field-map-C_rDXfdJ.mjs.map +0 -1
  1611. package/dist/focal-point-CgCcr1Ca.mjs +0 -23
  1612. package/dist/focal-point-CgCcr1Ca.mjs.map +0 -1
  1613. package/dist/fts-manager-BzFo0xx6.mjs +0 -483
  1614. package/dist/fts-manager-BzFo0xx6.mjs.map +0 -1
  1615. package/dist/gc-B_c3DPpi.mjs +0 -75
  1616. package/dist/gc-B_c3DPpi.mjs.map +0 -1
  1617. package/dist/hash-A-o2ZX8O.mjs +0 -37
  1618. package/dist/hash-A-o2ZX8O.mjs.map +0 -1
  1619. package/dist/hook-result-f8t7hIuu.d.mts +0 -31
  1620. package/dist/hook-result-f8t7hIuu.d.mts.map +0 -1
  1621. package/dist/hreflang-BpUK9Lcu.mjs +0 -105
  1622. package/dist/hreflang-BpUK9Lcu.mjs.map +0 -1
  1623. package/dist/hreflang-D07R-RbI.d.mts +0 -50
  1624. package/dist/hreflang-D07R-RbI.d.mts.map +0 -1
  1625. package/dist/http-route-dispatch-C2Ep2Uf6.mjs +0 -342
  1626. package/dist/http-route-dispatch-C2Ep2Uf6.mjs.map +0 -1
  1627. package/dist/identity-BivQ8wkV.mjs +0 -35
  1628. package/dist/identity-BivQ8wkV.mjs.map +0 -1
  1629. package/dist/import-B4UvHNJz.mjs +0 -2126
  1630. package/dist/import-B4UvHNJz.mjs.map +0 -1
  1631. package/dist/index-C37Ty40w.d.mts +0 -623
  1632. package/dist/index-C37Ty40w.d.mts.map +0 -1
  1633. package/dist/init-lock-BGmew3r1.mjs +0 -56
  1634. package/dist/init-lock-BGmew3r1.mjs.map +0 -1
  1635. package/dist/install-finalization-BbYaB4wj.mjs +0 -58
  1636. package/dist/install-finalization-BbYaB4wj.mjs.map +0 -1
  1637. package/dist/json-recordset-BjYIWFkV.mjs +0 -12
  1638. package/dist/json-recordset-BjYIWFkV.mjs.map +0 -1
  1639. package/dist/json-schema-Cde7le0s.mjs +0 -15
  1640. package/dist/json-schema-Cde7le0s.mjs.map +0 -1
  1641. package/dist/keys-CusTXpw-.mjs +0 -61
  1642. package/dist/keys-CusTXpw-.mjs.map +0 -1
  1643. package/dist/kinds-DogmNB6n.mjs +0 -974
  1644. package/dist/kinds-DogmNB6n.mjs.map +0 -1
  1645. package/dist/lifecycle-BLCoCz4T.mjs +0 -25
  1646. package/dist/lifecycle-BLCoCz4T.mjs.map +0 -1
  1647. package/dist/load-Dds3KhXr.mjs +0 -28
  1648. package/dist/load-Dds3KhXr.mjs.map +0 -1
  1649. package/dist/loader-D4w4XE7q.mjs +0 -1420
  1650. package/dist/loader-D4w4XE7q.mjs.map +0 -1
  1651. package/dist/loops-IYgzQdQu.mjs +0 -205
  1652. package/dist/loops-IYgzQdQu.mjs.map +0 -1
  1653. package/dist/manifest-builder-CGF5kujD.mjs +0 -196
  1654. package/dist/manifest-builder-CGF5kujD.mjs.map +0 -1
  1655. package/dist/manifest-schema-B0BxPSjB.mjs +0 -497
  1656. package/dist/manifest-schema-B0BxPSjB.mjs.map +0 -1
  1657. package/dist/marketplace-DNvEGLqU.mjs +0 -257
  1658. package/dist/marketplace-DNvEGLqU.mjs.map +0 -1
  1659. package/dist/media-BL9MRrSG.mjs +0 -294
  1660. package/dist/media-BL9MRrSG.mjs.map +0 -1
  1661. package/dist/media-B_x5B9EA.mjs +0 -373
  1662. package/dist/media-B_x5B9EA.mjs.map +0 -1
  1663. package/dist/media-allowlist-CpmqBbIQ.mjs +0 -45
  1664. package/dist/media-allowlist-CpmqBbIQ.mjs.map +0 -1
  1665. package/dist/media-folders-CNs_A_B-.mjs +0 -210
  1666. package/dist/media-folders-CNs_A_B-.mjs.map +0 -1
  1667. package/dist/media-qTTHVkls.mjs +0 -416
  1668. package/dist/media-qTTHVkls.mjs.map +0 -1
  1669. package/dist/media-url-GJboA1fl.mjs +0 -43
  1670. package/dist/media-url-GJboA1fl.mjs.map +0 -1
  1671. package/dist/media-usage-ClWgrX0d.mjs +0 -282
  1672. package/dist/media-usage-ClWgrX0d.mjs.map +0 -1
  1673. package/dist/media-usage-activation-B8Fjtq0h.mjs +0 -78
  1674. package/dist/media-usage-activation-B8Fjtq0h.mjs.map +0 -1
  1675. package/dist/media-usage-work-L8-Au4j-.mjs +0 -1036
  1676. package/dist/media-usage-work-L8-Au4j-.mjs.map +0 -1
  1677. package/dist/media-usage-work-LXgze5j9.mjs +0 -151
  1678. package/dist/media-usage-work-LXgze5j9.mjs.map +0 -1
  1679. package/dist/menus-BAxcbsbv.mjs +0 -818
  1680. package/dist/menus-BAxcbsbv.mjs.map +0 -1
  1681. package/dist/menus-BI6oBXco.mjs +0 -92
  1682. package/dist/menus-BI6oBXco.mjs.map +0 -1
  1683. package/dist/menus-fvGFd4m6.mjs +0 -3725
  1684. package/dist/menus-fvGFd4m6.mjs.map +0 -1
  1685. package/dist/mime-DwhtRyUt.mjs +0 -81
  1686. package/dist/mime-DwhtRyUt.mjs.map +0 -1
  1687. package/dist/mode-DIDSUwuN.mjs +0 -23
  1688. package/dist/mode-DIDSUwuN.mjs.map +0 -1
  1689. package/dist/node-sqlite-compat-Ddr_mlR9.mjs +0 -63
  1690. package/dist/node-sqlite-compat-Ddr_mlR9.mjs.map +0 -1
  1691. package/dist/normalize-Ip_hFAm8.mjs +0 -216
  1692. package/dist/normalize-Ip_hFAm8.mjs.map +0 -1
  1693. package/dist/oauth-authorization-CcMgeT8R.mjs +0 -274
  1694. package/dist/oauth-authorization-CcMgeT8R.mjs.map +0 -1
  1695. package/dist/oauth-clients-C_osi0PU.mjs +0 -266
  1696. package/dist/oauth-clients-C_osi0PU.mjs.map +0 -1
  1697. package/dist/oauth-state-store-DGLP-6CK.mjs +0 -50
  1698. package/dist/oauth-state-store-DGLP-6CK.mjs.map +0 -1
  1699. package/dist/oauth-user-lookup-z77Ee0Hm.mjs +0 -26
  1700. package/dist/oauth-user-lookup-z77Ee0Hm.mjs.map +0 -1
  1701. package/dist/object-cache-EjasjtoQ.mjs +0 -586
  1702. package/dist/object-cache-EjasjtoQ.mjs.map +0 -1
  1703. package/dist/options-CmUpkyKW.d.mts +0 -81
  1704. package/dist/options-CmUpkyKW.d.mts.map +0 -1
  1705. package/dist/options-DhrI7eMv.mjs +0 -208
  1706. package/dist/options-DhrI7eMv.mjs.map +0 -1
  1707. package/dist/ownership-DCk5NutQ.mjs +0 -12
  1708. package/dist/ownership-DCk5NutQ.mjs.map +0 -1
  1709. package/dist/parse-2W-E2f7w.mjs +0 -81
  1710. package/dist/parse-2W-E2f7w.mjs.map +0 -1
  1711. package/dist/parse-6pN8Xqg5.d.mts +0 -176
  1712. package/dist/parse-6pN8Xqg5.d.mts.map +0 -1
  1713. package/dist/passkey-config-DTTZB6EI.mjs +0 -46
  1714. package/dist/passkey-config-DTTZB6EI.mjs.map +0 -1
  1715. package/dist/paths-CQA62503.mjs +0 -77
  1716. package/dist/paths-CQA62503.mjs.map +0 -1
  1717. package/dist/patterns-CryGz_EV.mjs +0 -159
  1718. package/dist/patterns-CryGz_EV.mjs.map +0 -1
  1719. package/dist/placeholder-BlfXkucE.d.mts +0 -313
  1720. package/dist/placeholder-BlfXkucE.d.mts.map +0 -1
  1721. package/dist/plan-B95eiwnF.mjs +0 -135
  1722. package/dist/plan-B95eiwnF.mjs.map +0 -1
  1723. package/dist/plugin-tool-name-BDA7m4Xa.mjs +0 -27
  1724. package/dist/plugin-tool-name-BDA7m4Xa.mjs.map +0 -1
  1725. package/dist/plugins-BhxLJ008.mjs +0 -261
  1726. package/dist/plugins-BhxLJ008.mjs.map +0 -1
  1727. package/dist/policy-DOJ2sPqB.mjs +0 -53
  1728. package/dist/policy-DOJ2sPqB.mjs.map +0 -1
  1729. package/dist/portable-text-RCMpCj47.mjs +0 -311
  1730. package/dist/portable-text-RCMpCj47.mjs.map +0 -1
  1731. package/dist/preview-DFwL5APO.mjs +0 -107
  1732. package/dist/preview-DFwL5APO.mjs.map +0 -1
  1733. package/dist/protocol-B-ztxp_y.d.mts +0 -65
  1734. package/dist/protocol-B-ztxp_y.d.mts.map +0 -1
  1735. package/dist/public-plugin-api-routes-ik4fPZMv.mjs +0 -316
  1736. package/dist/public-plugin-api-routes-ik4fPZMv.mjs.map +0 -1
  1737. package/dist/public-submission-C5JZIykp.mjs +0 -251
  1738. package/dist/public-submission-C5JZIykp.mjs.map +0 -1
  1739. package/dist/public-url-CQwzRljH.mjs +0 -101
  1740. package/dist/public-url-CQwzRljH.mjs.map +0 -1
  1741. package/dist/query-BFHjCzSh.mjs +0 -37
  1742. package/dist/query-BFHjCzSh.mjs.map +0 -1
  1743. package/dist/query-DuwyFr5Z.mjs +0 -41
  1744. package/dist/query-DuwyFr5Z.mjs.map +0 -1
  1745. package/dist/query-eR_Nz70M.mjs +0 -1157
  1746. package/dist/query-eR_Nz70M.mjs.map +0 -1
  1747. package/dist/range-BQWPjWgQ.mjs +0 -51
  1748. package/dist/range-BQWPjWgQ.mjs.map +0 -1
  1749. package/dist/rate-limit-mPKeQ3sm.mjs +0 -127
  1750. package/dist/rate-limit-mPKeQ3sm.mjs.map +0 -1
  1751. package/dist/receipt-CmUpyuW5.mjs +0 -43
  1752. package/dist/receipt-CmUpyuW5.mjs.map +0 -1
  1753. package/dist/redirect-BtiMkehU.mjs +0 -19
  1754. package/dist/redirect-BtiMkehU.mjs.map +0 -1
  1755. package/dist/redirect-DcmNMvOs.mjs +0 -423
  1756. package/dist/redirect-DcmNMvOs.mjs.map +0 -1
  1757. package/dist/redirect-paths-K5i3xYfR.mjs +0 -36
  1758. package/dist/redirect-paths-K5i3xYfR.mjs.map +0 -1
  1759. package/dist/redirects-BA_TvtuH.mjs +0 -148
  1760. package/dist/redirects-BA_TvtuH.mjs.map +0 -1
  1761. package/dist/redirects-BIrRvgn4.mjs +0 -446
  1762. package/dist/redirects-BIrRvgn4.mjs.map +0 -1
  1763. package/dist/registry-DymfZkAN.mjs +0 -8374
  1764. package/dist/registry-DymfZkAN.mjs.map +0 -1
  1765. package/dist/relations-DrEs3Sc1.mjs +0 -789
  1766. package/dist/relations-DrEs3Sc1.mjs.map +0 -1
  1767. package/dist/request-cache-5z2WzWmh.mjs +0 -104
  1768. package/dist/request-cache-5z2WzWmh.mjs.map +0 -1
  1769. package/dist/request-meta-o8RIf9pa.mjs +0 -141
  1770. package/dist/request-meta-o8RIf9pa.mjs.map +0 -1
  1771. package/dist/resolve-CVy9xgy_.mjs +0 -102
  1772. package/dist/resolve-CVy9xgy_.mjs.map +0 -1
  1773. package/dist/resolve-DdNXBJSr.mjs +0 -199
  1774. package/dist/resolve-DdNXBJSr.mjs.map +0 -1
  1775. package/dist/revision-Dx7Uth1X.mjs +0 -374
  1776. package/dist/revision-Dx7Uth1X.mjs.map +0 -1
  1777. package/dist/route-cache-DAG5dPhh.mjs +0 -20
  1778. package/dist/route-cache-DAG5dPhh.mjs.map +0 -1
  1779. package/dist/route-wire-Xbsu8Vih.mjs +0 -197
  1780. package/dist/route-wire-Xbsu8Vih.mjs.map +0 -1
  1781. package/dist/routes-YQkSOsws.mjs +0 -272
  1782. package/dist/routes-YQkSOsws.mjs.map +0 -1
  1783. package/dist/runner-CLorw5vo.mjs +0 -6669
  1784. package/dist/runner-CLorw5vo.mjs.map +0 -1
  1785. package/dist/runner-g1A9P-wD.d.mts +0 -73
  1786. package/dist/runner-g1A9P-wD.d.mts.map +0 -1
  1787. package/dist/schema-Bss8qImF.mjs +0 -13
  1788. package/dist/schema-Bss8qImF.mjs.map +0 -1
  1789. package/dist/schema-C036pqEw.mjs +0 -815
  1790. package/dist/schema-C036pqEw.mjs.map +0 -1
  1791. package/dist/scopes-C_SoYl9x.mjs +0 -34
  1792. package/dist/scopes-C_SoYl9x.mjs.map +0 -1
  1793. package/dist/search-uNqCgePJ.mjs +0 -450
  1794. package/dist/search-uNqCgePJ.mjs.map +0 -1
  1795. package/dist/secrets-Cc_O3Kp-.mjs +0 -369
  1796. package/dist/secrets-Cc_O3Kp-.mjs.map +0 -1
  1797. package/dist/sections-BLusMa96.mjs +0 -346
  1798. package/dist/sections-BLusMa96.mjs.map +0 -1
  1799. package/dist/seo-BodxIpws.mjs +0 -188
  1800. package/dist/seo-BodxIpws.mjs.map +0 -1
  1801. package/dist/seo-DaMYIQY8.mjs +0 -133
  1802. package/dist/seo-DaMYIQY8.mjs.map +0 -1
  1803. package/dist/service-BuM1BRsA.mjs +0 -150
  1804. package/dist/service-BuM1BRsA.mjs.map +0 -1
  1805. package/dist/session-user-2DpQDMKw.mjs +0 -61
  1806. package/dist/session-user-2DpQDMKw.mjs.map +0 -1
  1807. package/dist/settings-B3ZmPF_8.mjs +0 -73
  1808. package/dist/settings-B3ZmPF_8.mjs.map +0 -1
  1809. package/dist/settings-P5hwPX6_.mjs +0 -66
  1810. package/dist/settings-P5hwPX6_.mjs.map +0 -1
  1811. package/dist/settings-yIqoN-Ok.mjs +0 -519
  1812. package/dist/settings-yIqoN-Ok.mjs.map +0 -1
  1813. package/dist/setup-complete-eu6MUQnt.mjs +0 -65
  1814. package/dist/setup-complete-eu6MUQnt.mjs.map +0 -1
  1815. package/dist/setup-nonce-CyPOapqY.mjs +0 -25
  1816. package/dist/setup-nonce-CyPOapqY.mjs.map +0 -1
  1817. package/dist/single-flight-cache-D0EaGbN1.mjs +0 -104
  1818. package/dist/single-flight-cache-D0EaGbN1.mjs.map +0 -1
  1819. package/dist/site-domain-8lEJl_0U.mjs +0 -131
  1820. package/dist/site-domain-8lEJl_0U.mjs.map +0 -1
  1821. package/dist/site-settings-uPkW0e6o.mjs +0 -50
  1822. package/dist/site-settings-uPkW0e6o.mjs.map +0 -1
  1823. package/dist/site-url-25SGVXwL.mjs +0 -45
  1824. package/dist/site-url-25SGVXwL.mjs.map +0 -1
  1825. package/dist/sitemap-name-DTK7CYnY.mjs +0 -26
  1826. package/dist/sitemap-name-DTK7CYnY.mjs.map +0 -1
  1827. package/dist/slug-BEDl2IJY.mjs +0 -16
  1828. package/dist/slug-BEDl2IJY.mjs.map +0 -1
  1829. package/dist/slugify-BDEG9pLk.mjs +0 -22
  1830. package/dist/slugify-BDEG9pLk.mjs.map +0 -1
  1831. package/dist/snapshot-CvkIBRLY.mjs +0 -414
  1832. package/dist/snapshot-CvkIBRLY.mjs.map +0 -1
  1833. package/dist/ssrf-BBXcxG-f.mjs +0 -1
  1834. package/dist/ssrf-mcCKMH6B.mjs +0 -406
  1835. package/dist/ssrf-mcCKMH6B.mjs.map +0 -1
  1836. package/dist/stage-BQfGzGOy.mjs +0 -662
  1837. package/dist/stage-BQfGzGOy.mjs.map +0 -1
  1838. package/dist/staged-B5vQGeSf.mjs +0 -686
  1839. package/dist/staged-B5vQGeSf.mjs.map +0 -1
  1840. package/dist/state-dO6t6OxV.mjs +0 -178
  1841. package/dist/state-dO6t6OxV.mjs.map +0 -1
  1842. package/dist/status-DSURZwKS.mjs +0 -30
  1843. package/dist/status-DSURZwKS.mjs.map +0 -1
  1844. package/dist/storage-query-Cy0SZ8iG.d.mts +0 -1619
  1845. package/dist/storage-query-Cy0SZ8iG.d.mts.map +0 -1
  1846. package/dist/tar-DWzcUZ_Q.mjs +0 -449
  1847. package/dist/tar-DWzcUZ_Q.mjs.map +0 -1
  1848. package/dist/target-C9htUbrT.mjs +0 -27
  1849. package/dist/target-C9htUbrT.mjs.map +0 -1
  1850. package/dist/taxonomies-By2aGvq2.mjs +0 -729
  1851. package/dist/taxonomies-By2aGvq2.mjs.map +0 -1
  1852. package/dist/taxonomies-CVRd_jz0.mjs +0 -937
  1853. package/dist/taxonomies-CVRd_jz0.mjs.map +0 -1
  1854. package/dist/taxonomy-BG_xu2Qf.mjs +0 -563
  1855. package/dist/taxonomy-BG_xu2Qf.mjs.map +0 -1
  1856. package/dist/tokens-U5vzgSrM.mjs +0 -171
  1857. package/dist/tokens-U5vzgSrM.mjs.map +0 -1
  1858. package/dist/transaction-CkoQ5wqQ.mjs +0 -29
  1859. package/dist/transaction-CkoQ5wqQ.mjs.map +0 -1
  1860. package/dist/transfer-DA0OSfaT.mjs +0 -8873
  1861. package/dist/transfer-DA0OSfaT.mjs.map +0 -1
  1862. package/dist/transfer-Pyf3d7ka.mjs +0 -166
  1863. package/dist/transfer-Pyf3d7ka.mjs.map +0 -1
  1864. package/dist/transfer-download-cX7SuWEy.mjs +0 -33
  1865. package/dist/transfer-download-cX7SuWEy.mjs.map +0 -1
  1866. package/dist/transformations-DczubD4j.mjs +0 -196
  1867. package/dist/transformations-DczubD4j.mjs.map +0 -1
  1868. package/dist/transport-Dm5QzpT_.d.mts +0 -42
  1869. package/dist/transport-Dm5QzpT_.d.mts.map +0 -1
  1870. package/dist/transport-DtIrjEFO.mjs +0 -137
  1871. package/dist/transport-DtIrjEFO.mjs.map +0 -1
  1872. package/dist/trusted-proxy-CDRd5Kmw.mjs +0 -51
  1873. package/dist/trusted-proxy-CDRd5Kmw.mjs.map +0 -1
  1874. package/dist/turnstile-Ct5YuFNY.mjs +0 -58
  1875. package/dist/turnstile-Ct5YuFNY.mjs.map +0 -1
  1876. package/dist/types-Bgujop4S.d.mts +0 -374
  1877. package/dist/types-Bgujop4S.d.mts.map +0 -1
  1878. package/dist/types-BirHUEXt.mjs +0 -18
  1879. package/dist/types-BirHUEXt.mjs.map +0 -1
  1880. package/dist/types-BqJgTL_y.d.mts +0 -293
  1881. package/dist/types-BqJgTL_y.d.mts.map +0 -1
  1882. package/dist/types-C-lrOt9T.d.mts +0 -87
  1883. package/dist/types-C-lrOt9T.d.mts.map +0 -1
  1884. package/dist/types-CCEHAhOv.d.mts +0 -916
  1885. package/dist/types-CCEHAhOv.d.mts.map +0 -1
  1886. package/dist/types-CLVwYRBr.d.mts +0 -227
  1887. package/dist/types-CLVwYRBr.d.mts.map +0 -1
  1888. package/dist/types-C_asjp1J.mjs +0 -201
  1889. package/dist/types-C_asjp1J.mjs.map +0 -1
  1890. package/dist/types-CadaL_k8.d.mts +0 -366
  1891. package/dist/types-CadaL_k8.d.mts.map +0 -1
  1892. package/dist/types-DVbTb4Hk.mjs +0 -77
  1893. package/dist/types-DVbTb4Hk.mjs.map +0 -1
  1894. package/dist/types-Ddku19Zw.d.mts +0 -209
  1895. package/dist/types-Ddku19Zw.d.mts.map +0 -1
  1896. package/dist/types-DwhEvIVb.mjs +0 -133
  1897. package/dist/types-DwhEvIVb.mjs.map +0 -1
  1898. package/dist/types-FIiGQ3PE.mjs +0 -16
  1899. package/dist/types-FIiGQ3PE.mjs.map +0 -1
  1900. package/dist/types-OauzCOY0.mjs +0 -37
  1901. package/dist/types-OauzCOY0.mjs.map +0 -1
  1902. package/dist/types-mQGTpP-4.d.mts +0 -1741
  1903. package/dist/types-mQGTpP-4.d.mts.map +0 -1
  1904. package/dist/types-nbjz3Mgm.d.mts +0 -125
  1905. package/dist/types-nbjz3Mgm.d.mts.map +0 -1
  1906. package/dist/update-check-hW32-0pf.mjs +0 -161
  1907. package/dist/update-check-hW32-0pf.mjs.map +0 -1
  1908. package/dist/upload-attempts-Bpik1TLF.mjs +0 -32
  1909. package/dist/upload-attempts-Bpik1TLF.mjs.map +0 -1
  1910. package/dist/url-DTfGDJhI.mjs +0 -104
  1911. package/dist/url-DTfGDJhI.mjs.map +0 -1
  1912. package/dist/url-pattern-CJeCyNij.mjs +0 -41
  1913. package/dist/url-pattern-CJeCyNij.mjs.map +0 -1
  1914. package/dist/user-nQInBZbE.mjs +0 -171
  1915. package/dist/user-nQInBZbE.mjs.map +0 -1
  1916. package/dist/utils-govudc_U.mjs +0 -442
  1917. package/dist/utils-govudc_U.mjs.map +0 -1
  1918. package/dist/validate-BxLvcDYh.mjs +0 -524
  1919. package/dist/validate-BxLvcDYh.mjs.map +0 -1
  1920. package/dist/validate-mnoVfASU.d.mts +0 -468
  1921. package/dist/validate-mnoVfASU.d.mts.map +0 -1
  1922. package/dist/validation-DQDEvh87.mjs +0 -221
  1923. package/dist/validation-DQDEvh87.mjs.map +0 -1
  1924. package/dist/version-BOFfLiVT.mjs +0 -49
  1925. package/dist/version-BOFfLiVT.mjs.map +0 -1
  1926. package/dist/version-Dcvx_C9g.mjs +0 -7
  1927. package/dist/version-Dcvx_C9g.mjs.map +0 -1
  1928. package/dist/version-DzTJ3gD7.mjs +0 -9
  1929. package/dist/version-DzTJ3gD7.mjs.map +0 -1
  1930. package/dist/video-BX7AI5nJ.mjs +0 -54
  1931. package/dist/video-BX7AI5nJ.mjs.map +0 -1
  1932. package/dist/virtual-modules-CU29aip9.mjs +0 -515
  1933. package/dist/virtual-modules-CU29aip9.mjs.map +0 -1
  1934. package/dist/widgets-HIeFmZxt.mjs +0 -121
  1935. package/dist/widgets-HIeFmZxt.mjs.map +0 -1
  1936. package/dist/wxr-taxonomies-Dy2i2ON3.d.mts +0 -34
  1937. package/dist/wxr-taxonomies-Dy2i2ON3.d.mts.map +0 -1
  1938. package/dist/wxr-taxonomies-DyOGhl8W.mjs +0 -454
  1939. package/dist/wxr-taxonomies-DyOGhl8W.mjs.map +0 -1
  1940. package/dist/zod-generator-VxCPVDpo.mjs +0 -425
  1941. package/dist/zod-generator-VxCPVDpo.mjs.map +0 -1
@@ -0,0 +1,2225 @@
1
+ import { n as validateJsonFieldName, t as validateIdentifier } from "./validate-DANX1-Qi.mjs";
2
+ import { _ as pluginDataExtractExpr, b as pluginDataWriteExpr, u as isPostgres, v as pluginDataOrderExpr, y as pluginDataUpdateGuard } from "./dialect-helpers-DqUMP9fJ.mjs";
3
+ import { r as getI18nConfig, u as resolveContentCreateLocale } from "./config-Cs_AwWXI.mjs";
4
+ import { i as serializeConditionalValue, n as assertStorageKey, r as assertStorageRevision, t as OptionsRepository } from "./options-CMocxAku.mjs";
5
+ import { t as ContentRepository } from "./content-Dxztag5t.mjs";
6
+ import { n as localeMatches } from "./query-EVjg8-Bq.mjs";
7
+ import { d as invalidateCollectionCache } from "./object-cache-DeATK4vw.mjs";
8
+ import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DRnEstVb.mjs";
9
+ import { notifyRoom } from "./rooms/notifications.mjs";
10
+ import { a as InvalidCursorError, l as decodeCursor, o as MAX_CURSOR_LENGTH, u as encodeCursor } from "./types-BBH-w_KS.mjs";
11
+ import { r as normalizeRevisionLimit, t as RevisionRepository } from "./revision-D7EedSdU.mjs";
12
+ import { t as withTransaction } from "./transaction-SKrr6u84.mjs";
13
+ import { t as isValidFocalPointUpdate } from "./focal-point-Cup37tLI.mjs";
14
+ import { t as MediaRepository } from "./media-DJaAAYI2.mjs";
15
+ import { t as UserRepository } from "./user-C4km6fox.mjs";
16
+ import { t as TaxonomyRepository } from "./taxonomy-s1GcBCRo.mjs";
17
+ import { t as CommentRepository } from "./comment-BGeXmJ8F.mjs";
18
+ import { a as resolveLocalizedContentRoutePath } from "./resolve-Z5YK_6ew.mjs";
19
+ import { t as RedirectRepository } from "./redirect-ChcHI1KC.mjs";
20
+ import { n as normalizeMime, t as matchesMimeAllowlist } from "./mime-Dx6aHTsR.mjs";
21
+ import { t as enrichImageMetadata } from "./enrich-BReo_COC.mjs";
22
+ import { t as EntryLockRepository } from "./entry-locks-D_kjygT1.mjs";
23
+ import { w as selectTaxonomyDefs, x as findTaxonomyStructure } from "./loader-CSEfTKzr.mjs";
24
+ import { W as markContentMediaUsageCollectionStaleSafely, n as SchemaRegistry } from "./registry-CDzYrAFY.mjs";
25
+ import { n as handleMediaDelete } from "./media-Cid3xIHk.mjs";
26
+ import { createPluginSecretRedactor } from "./plugins/secret-redactor.mjs";
27
+ import { n as createSettingsAccess } from "./settings-y8Jx8b7g.mjs";
28
+ import { c as invalidateSiteSettingsCache } from "./settings-BTkGl-bX.mjs";
29
+ import { s as handleTermCreate } from "./taxonomies-ClkYcmcH.mjs";
30
+ import { o as stripCredentialHeaders, r as resolveAndValidateExternalUrl, t as SsrfError } from "./ssrf-Lj1KZxYt.mjs";
31
+ import { f as updateRedirectBody, t as createRedirectBody } from "./redirects-dFPJ0HrD.mjs";
32
+ import { t as CONTENT_TYPE_RE } from "./media-CPETKjop.mjs";
33
+ import { t as GLOBAL_UPLOAD_ALLOWLIST } from "./media-allowlist-B7JwNf-U.mjs";
34
+ import { a as handleRedirectCreate, c as handleRedirectList, l as handleRedirectUpdate, o as handleRedirectDelete } from "./redirects-D3zHoxhn.mjs";
35
+ import { t as resolveBylineCredits } from "./credits-C8uXoWfN.mjs";
36
+ import { t as CronAccessImpl } from "./cron-CrjBjDuy.mjs";
37
+ import { bufferPluginHttpRequest, pluginHttpRedirectAction, pluginHttpResponseFromWire, pluginHttpResponseToWire, rewritePluginHttpRedirect } from "./plugins/http-wire.mjs";
38
+ import { sql } from "kysely";
39
+ import { ulid } from "ulidx";
40
+ import mime from "mime/lite";
41
+
42
+ //#region src/plugins/storage-query.ts
43
+ /**
44
+ * Error thrown when querying non-indexed fields
45
+ */
46
+ var StorageQueryError = class extends Error {
47
+ constructor(message, field, suggestion) {
48
+ super(message);
49
+ this.field = field;
50
+ this.suggestion = suggestion;
51
+ this.name = "StorageQueryError";
52
+ }
53
+ };
54
+ /**
55
+ * Error thrown when a guarded `updateIf` loses a concurrent race by aborting
56
+ * rather than resolving to `{ applied: false }`.
57
+ *
58
+ * `updateIf`'s `{ applied: false }` contract (row absent OR guard failed)
59
+ * assumes READ COMMITTED — the default. There, a losing concurrent writer
60
+ * re-evaluates the guard against the winner's freshly committed row and
61
+ * cleanly resolves to `{ applied: false }`. Two aborts escape that contract:
62
+ *
63
+ * - `40001` (serialization_failure), only above READ COMMITTED, where the
64
+ * loser cannot re-read against a newer snapshot.
65
+ * - `40P01` (deadlock_detected), at any isolation level, when transactions
66
+ * take row locks in opposite order.
67
+ *
68
+ * This error surfaces either abort so the caller can retry the write.
69
+ *
70
+ * The no-oversell SAFETY invariant holds either way: a losing writer NEVER
71
+ * applies its update — it either sees `{ applied: false }` or throws here.
72
+ */
73
+ var StorageSerializationError = class extends Error {
74
+ code = "STORAGE_SERIALIZATION_FAILURE";
75
+ retryable = true;
76
+ /** The Postgres SQLSTATE that triggered this error (`40001` / `40P01`). */
77
+ sqlState;
78
+ constructor(message, options) {
79
+ super(message, { cause: options?.cause });
80
+ this.name = "StorageSerializationError";
81
+ this.sqlState = options?.sqlState;
82
+ }
83
+ };
84
+ /**
85
+ * Check if a value is a range filter
86
+ */
87
+ function isRangeFilter(value) {
88
+ if (typeof value !== "object" || value === null) return false;
89
+ return "gt" in value || "gte" in value || "lt" in value || "lte" in value;
90
+ }
91
+ /**
92
+ * Check if a value is an IN filter
93
+ */
94
+ function isInFilter(value) {
95
+ if (typeof value !== "object" || value === null) return false;
96
+ return "in" in value && Array.isArray(value.in);
97
+ }
98
+ /**
99
+ * Check if a value is a startsWith filter
100
+ */
101
+ function isStartsWithFilter(value) {
102
+ if (typeof value !== "object" || value === null) return false;
103
+ return "startsWith" in value && typeof value.startsWith === "string";
104
+ }
105
+ /**
106
+ * Escape LIKE pattern metacharacters so a startsWith prefix matches
107
+ * literally. Without this, `%` and `_` in the prefix act as wildcards
108
+ * (e.g. `{ startsWith: "50%" }` would match "50x off").
109
+ */
110
+ function escapeLikePattern(value) {
111
+ return value.replaceAll("\\", "\\\\").replaceAll("%", "\\%").replaceAll("_", "\\_");
112
+ }
113
+ /**
114
+ * Get the set of indexed fields from index declarations
115
+ */
116
+ function getIndexedFields(indexes) {
117
+ const fields = /* @__PURE__ */ new Set();
118
+ for (const index of indexes) if (Array.isArray(index)) for (const field of index) fields.add(field);
119
+ else fields.add(index);
120
+ return fields;
121
+ }
122
+ /**
123
+ * Validate that all fields in a where clause are indexed
124
+ */
125
+ function validateWhereClause(where, indexedFields, pluginId, collection) {
126
+ for (const field of Object.keys(where)) if (!indexedFields.has(field)) throw new StorageQueryError(`Cannot query on non-indexed field '${field}'.`, field, `Add '${field}' to storage.${collection}.indexes in plugin '${pluginId}' to enable this query.`);
127
+ }
128
+ /**
129
+ * Validate orderBy fields are indexed
130
+ */
131
+ function validateOrderByClause(orderBy, indexedFields, pluginId, collection) {
132
+ for (const field of Object.keys(orderBy)) if (!indexedFields.has(field)) throw new StorageQueryError(`Cannot order by non-indexed field '${field}'.`, field, `Add '${field}' to storage.${collection}.indexes in plugin '${pluginId}' to enable ordering by this field.`);
133
+ }
134
+ /**
135
+ * SQL expression for extracting a queryable field from the `_plugin_storage.data`
136
+ * column.
137
+ *
138
+ * Delegates to `pluginDataExtractExpr`, which validates the field name before
139
+ * interpolation and applies the dialect-correct extraction: a `::jsonb` cast on
140
+ * Postgres (the `data` column is `text`) plus an optional type-guarded
141
+ * `::numeric` cast so numeric comparisons don't fall back to lexical text
142
+ * ordering.
143
+ */
144
+ function jsonExtract(db, field, options) {
145
+ return pluginDataExtractExpr(db, field, options);
146
+ }
147
+ /**
148
+ * SQL expression for ordering by a `_plugin_storage.data` field.
149
+ *
150
+ * Delegates to `pluginDataOrderExpr`, which orders over the jsonb-native value
151
+ * on Postgres so numeric fields sort numerically (not lexically) while staying
152
+ * total across heterogeneous data. SQLite keeps `json_extract` (already numeric).
153
+ */
154
+ function jsonOrderExtract(db, field) {
155
+ return pluginDataOrderExpr(db, field);
156
+ }
157
+ /**
158
+ * Build a WHERE clause condition for a single field
159
+ */
160
+ function buildCondition(db, field, value) {
161
+ const extractFor = (numeric) => jsonExtract(db, field, { numeric });
162
+ if (value === null) return {
163
+ sql: `${extractFor(false)} IS NULL`,
164
+ params: []
165
+ };
166
+ if (typeof value === "number") return {
167
+ sql: `${extractFor(true)} = ?`,
168
+ params: [value]
169
+ };
170
+ if (typeof value === "string") return {
171
+ sql: `${extractFor(false)} = ?`,
172
+ params: [value]
173
+ };
174
+ if (typeof value === "boolean") return {
175
+ sql: `${extractFor(false)} = ?`,
176
+ params: [value]
177
+ };
178
+ if (isInFilter(value)) {
179
+ const numeric = value.in.length > 0 && value.in.every((v) => typeof v === "number");
180
+ const placeholders = value.in.map(() => "?").join(", ");
181
+ return {
182
+ sql: `${extractFor(numeric)} IN (${placeholders})`,
183
+ params: value.in
184
+ };
185
+ }
186
+ if (isStartsWithFilter(value)) return {
187
+ sql: `${extractFor(false)} LIKE ? ESCAPE '\\'`,
188
+ params: [`${escapeLikePattern(value.startsWith)}%`]
189
+ };
190
+ if (isRangeFilter(value)) {
191
+ const conditions = [];
192
+ const params = [];
193
+ const pushBound = (op, bound) => {
194
+ conditions.push(`${extractFor(typeof bound === "number")} ${op} ?`);
195
+ params.push(bound);
196
+ };
197
+ if (value.gt !== void 0) pushBound(">", value.gt);
198
+ if (value.gte !== void 0) pushBound(">=", value.gte);
199
+ if (value.lt !== void 0) pushBound("<", value.lt);
200
+ if (value.lte !== void 0) pushBound("<=", value.lte);
201
+ if (conditions.length === 0) throw new StorageQueryError(`Range filter for field '${field}' has no defined bound`, field, "Provide at least one of gt, gte, lt, or lte, or omit the field.");
202
+ return {
203
+ sql: conditions.join(" AND "),
204
+ params
205
+ };
206
+ }
207
+ throw new StorageQueryError(`Unknown filter type for field '${field}'`);
208
+ }
209
+ /**
210
+ * Build a complete WHERE clause from a WhereClause object
211
+ */
212
+ function buildWhereClause(db, where) {
213
+ const conditions = [];
214
+ const params = [];
215
+ for (const [field, value] of Object.entries(where)) {
216
+ const condition = buildCondition(db, field, value);
217
+ if (!condition.sql) continue;
218
+ conditions.push(condition.sql);
219
+ params.push(...condition.params);
220
+ }
221
+ if (conditions.length === 0) return {
222
+ sql: "",
223
+ params: []
224
+ };
225
+ return {
226
+ sql: conditions.join(" AND "),
227
+ params
228
+ };
229
+ }
230
+
231
+ //#endregion
232
+ //#region src/plugins/storage-update.ts
233
+ function isRecord$1(value) {
234
+ return typeof value === "object" && value !== null && !Array.isArray(value);
235
+ }
236
+ function requireRecord(value, label) {
237
+ if (!isRecord$1(value)) throw new TypeError(`${label} must be an object`);
238
+ const prototype = Object.getPrototypeOf(value);
239
+ if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must be a plain object`);
240
+ return value;
241
+ }
242
+ function operand(value) {
243
+ if (typeof value === "string" || typeof value === "number" && Number.isFinite(value)) return value;
244
+ throw new TypeError("Storage guard operands must be strings or finite numbers");
245
+ }
246
+ function normalizeFilter(value) {
247
+ if (value === null || typeof value === "boolean") return value;
248
+ if (typeof value === "string" || typeof value === "number") return operand(value);
249
+ const filter = requireRecord(value, "Storage guard filter");
250
+ const values = filter.in;
251
+ if (Array.isArray(values)) return { in: Array.from(values, operand) };
252
+ const prefix = filter.startsWith;
253
+ if (typeof prefix === "string") return { startsWith: prefix };
254
+ const range = {};
255
+ for (const key of [
256
+ "gt",
257
+ "gte",
258
+ "lt",
259
+ "lte"
260
+ ]) if (key in filter) {
261
+ const bound = filter[key];
262
+ range[key] = bound === void 0 ? void 0 : operand(bound);
263
+ }
264
+ return range;
265
+ }
266
+ function parseStorageUpdate(value) {
267
+ const args = requireRecord(value, "Storage update arguments");
268
+ if (Object.keys(args).some((key) => key !== "where" && key !== "set" && key !== "delta")) throw new TypeError("Unknown storage update argument");
269
+ const where = {};
270
+ for (const [field, filter] of Object.entries(requireRecord(args.where, "Storage where guard"))) {
271
+ validateJsonFieldName(field);
272
+ where[field] = normalizeFilter(filter);
273
+ }
274
+ const set = args.set === void 0 ? {} : requireRecord(args.set, "Storage set");
275
+ const delta = args.delta === void 0 ? {} : requireRecord(args.delta, "Storage delta");
276
+ const setEntries = [];
277
+ for (const [field, entry] of Object.entries(set)) {
278
+ if (entry === void 0) continue;
279
+ validateJsonFieldName(field);
280
+ const serialized = JSON.stringify(entry);
281
+ if (serialized === void 0) throw new TypeError("Storage set values must be JSON serializable");
282
+ const normalized = JSON.parse(serialized);
283
+ setEntries.push([field, normalized]);
284
+ }
285
+ const setFields = new Set(setEntries.map(([field]) => field));
286
+ const deltaEntries = [];
287
+ for (const [field, entry] of Object.entries(delta)) {
288
+ if (entry === void 0) continue;
289
+ validateJsonFieldName(field);
290
+ if (setFields.has(field)) throw new TypeError("Storage field appears in both set and delta");
291
+ const spec = requireRecord(entry, "Storage numeric delta");
292
+ const keys = Object.keys(spec);
293
+ const key = keys[0];
294
+ if (keys.length !== 1 || key !== "inc" && key !== "dec") throw new TypeError("Storage delta must contain exactly one of inc or dec");
295
+ const amount = spec[key];
296
+ if (typeof amount !== "number" || !Number.isSafeInteger(amount)) throw new TypeError("Storage delta must be a safe integer");
297
+ deltaEntries.push([field, key === "dec" ? -amount : amount]);
298
+ }
299
+ if (setEntries.length + deltaEntries.length === 0) throw new TypeError("Storage update requires at least one of set or delta");
300
+ return {
301
+ where,
302
+ setEntries,
303
+ deltaEntries
304
+ };
305
+ }
306
+
307
+ //#endregion
308
+ //#region src/database/repositories/plugin-storage.ts
309
+ /**
310
+ * SQLSTATEs a losing concurrent `updateIf` writer can abort with.
311
+ *
312
+ * `40001` (serialization_failure) is raised only above READ COMMITTED, where
313
+ * the loser cannot re-evaluate its guard against a newer snapshot. `40P01`
314
+ * (deadlock_detected) is not tied to isolation level: it needs only two
315
+ * transactions taking row locks in opposite order, which a caller reaches at
316
+ * READ COMMITTED by wrapping several `updateIf` calls in one transaction.
317
+ */
318
+ const SERIALIZATION_SQLSTATES = new Set(["40001", "40P01"]);
319
+ function errSqlState(err) {
320
+ if (typeof err !== "object" || err === null) return void 0;
321
+ const code = err.code;
322
+ if (typeof code === "string") return code;
323
+ const cause = err.cause;
324
+ if (typeof cause === "object" && cause !== null) {
325
+ const causeCode = cause.code;
326
+ if (typeof causeCode === "string") return causeCode;
327
+ }
328
+ }
329
+ function mapSerializationFailure(err) {
330
+ const sqlState = errSqlState(err);
331
+ if (sqlState !== void 0 && SERIALIZATION_SQLSTATES.has(sqlState)) return new StorageSerializationError("Storage write must be retried. Restart the transaction before retrying when using an explicit transaction.", {
332
+ cause: err,
333
+ sqlState
334
+ });
335
+ return err;
336
+ }
337
+ /**
338
+ * Interleave a `?`-placeholder SQL string with its params into a single
339
+ * boolean raw expression. Used as a WHERE predicate directly — wrapping it
340
+ * in `(...) = 1` breaks on Postgres, which has a strict boolean type (#920).
341
+ */
342
+ function rawWhereExpr(sqlText, params) {
343
+ const parts = [];
344
+ let paramIndex = 0;
345
+ const sqlParts = sqlText.split("?");
346
+ for (let i = 0; i < sqlParts.length; i++) {
347
+ if (i > 0) parts.push(sql`${params[paramIndex++]}`);
348
+ if (sqlParts[i]) parts.push(sql.raw(sqlParts[i]));
349
+ }
350
+ return sql`(${sql.join(parts, sql.raw(""))})`;
351
+ }
352
+ /**
353
+ * Plugin Storage Repository
354
+ *
355
+ * Implements the StorageCollection interface for a specific plugin and collection.
356
+ */
357
+ /**
358
+ * Rank a sort expression so NULLs get a deterministic position.
359
+ *
360
+ * A missing key in a schemaless document extracts as NULL, which sorts
361
+ * differently per dialect (SQLite first, Postgres last) and makes every
362
+ * comparison against it UNKNOWN. Sorting on this rank ahead of the value puts
363
+ * NULLs in the same place on both dialects and keeps the seek operands
364
+ * non-NULL.
365
+ */
366
+ function nullRank(expr) {
367
+ return sql`(case when ${expr} is null then 1 else 0 end)`;
368
+ }
369
+ /**
370
+ * Comparison value for an orderBy cursor, matching the type of the ordered
371
+ * JSON expression.
372
+ *
373
+ * On Postgres the order expression is jsonb, so non-missing cursor values are
374
+ * cast to jsonb. This is important for explicit JSON `null`: the bound value
375
+ * must be the jsonb `null` scalar, not SQL NULL, because Postgres
376
+ * `data::jsonb->'field'` returns jsonb `null` for an explicit null and SQL NULL
377
+ * for a missing key. SQLite extracts SQL NULL for both cases, so a missing
378
+ * boundary and an explicit null both bind SQL NULL.
379
+ */
380
+ function cursorFieldValue(db, boundary) {
381
+ if (boundary.missing) return sql`null`;
382
+ if (isPostgres(db)) return sql`${sql.val(JSON.stringify(boundary.value))}::jsonb`;
383
+ return sql.val(boundary.value);
384
+ }
385
+ function isRecord(value) {
386
+ return typeof value === "object" && value !== null && !Array.isArray(value);
387
+ }
388
+ function sortBoundaries(data, orderFields) {
389
+ const record = isRecord(data) ? data : void 0;
390
+ return orderFields.map((field) => {
391
+ if (record !== void 0 && Object.hasOwn(record, field)) return {
392
+ value: record[field],
393
+ missing: false
394
+ };
395
+ return { missing: true };
396
+ });
397
+ }
398
+ function isScalarSortBoundary(boundary) {
399
+ if (boundary.missing) return true;
400
+ const value = boundary.value;
401
+ return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
402
+ }
403
+ var PluginStorageRepository = class {
404
+ indexedFields;
405
+ constructor(db, pluginId, collection, indexes) {
406
+ this.db = db;
407
+ this.pluginId = pluginId;
408
+ this.collection = collection;
409
+ this.indexedFields = getIndexedFields(indexes);
410
+ }
411
+ /**
412
+ * Get a document by ID
413
+ */
414
+ async get(id) {
415
+ const row = await this.db.selectFrom("_plugin_storage").select("data").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst();
416
+ if (!row) return null;
417
+ return JSON.parse(row.data);
418
+ }
419
+ /**
420
+ * Store a document
421
+ */
422
+ async put(id, data) {
423
+ const now = (/* @__PURE__ */ new Date()).toISOString();
424
+ const jsonData = JSON.stringify(data);
425
+ const revision = crypto.randomUUID();
426
+ await this.db.insertInto("_plugin_storage").values({
427
+ plugin_id: this.pluginId,
428
+ collection: this.collection,
429
+ id,
430
+ data: jsonData,
431
+ revision,
432
+ created_at: now,
433
+ updated_at: now
434
+ }).onConflict((oc) => oc.columns([
435
+ "plugin_id",
436
+ "collection",
437
+ "id"
438
+ ]).doUpdateSet({
439
+ data: jsonData,
440
+ revision,
441
+ updated_at: now
442
+ })).execute();
443
+ }
444
+ async getVersioned(id) {
445
+ assertStorageKey(id);
446
+ const row = await this.db.selectFrom("_plugin_storage").select(["data", "revision"]).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst();
447
+ if (!row) return null;
448
+ return {
449
+ value: JSON.parse(row.data),
450
+ revision: row.revision
451
+ };
452
+ }
453
+ async compareAndSet(id, expectedRevision, data) {
454
+ assertStorageKey(id);
455
+ if (expectedRevision !== null) assertStorageRevision(expectedRevision);
456
+ const jsonData = serializeConditionalValue(data);
457
+ const revision = crypto.randomUUID();
458
+ const now = (/* @__PURE__ */ new Date()).toISOString();
459
+ const row = expectedRevision === null ? await this.db.insertInto("_plugin_storage").values({
460
+ plugin_id: this.pluginId,
461
+ collection: this.collection,
462
+ id,
463
+ data: jsonData,
464
+ revision,
465
+ created_at: now,
466
+ updated_at: now
467
+ }).onConflict((oc) => oc.columns([
468
+ "plugin_id",
469
+ "collection",
470
+ "id"
471
+ ]).doNothing()).returning("revision").executeTakeFirst() : await this.db.updateTable("_plugin_storage").set({
472
+ data: jsonData,
473
+ revision,
474
+ updated_at: now
475
+ }).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).where("revision", "=", expectedRevision).returning("revision").executeTakeFirst();
476
+ return row ? {
477
+ applied: true,
478
+ revision: row.revision
479
+ } : { applied: false };
480
+ }
481
+ async compareAndDelete(id, expectedRevision) {
482
+ assertStorageKey(id);
483
+ assertStorageRevision(expectedRevision);
484
+ return { applied: await this.db.deleteFrom("_plugin_storage").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).where("revision", "=", expectedRevision).returning("id").executeTakeFirst() !== void 0 };
485
+ }
486
+ /**
487
+ * Delete a document
488
+ */
489
+ async delete(id) {
490
+ return ((await this.db.deleteFrom("_plugin_storage").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst()).numDeletedRows ?? 0) > 0;
491
+ }
492
+ /**
493
+ * Check if a document exists
494
+ */
495
+ async exists(id) {
496
+ return !!await this.db.selectFrom("_plugin_storage").select("id").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst();
497
+ }
498
+ /**
499
+ * Get multiple documents by ID
500
+ */
501
+ async getMany(ids) {
502
+ if (ids.length === 0) return /* @__PURE__ */ new Map();
503
+ const result = /* @__PURE__ */ new Map();
504
+ for (const batch of chunks(ids, SQL_BATCH_SIZE)) {
505
+ const rows = await this.db.selectFrom("_plugin_storage").select(["id", "data"]).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "in", batch).execute();
506
+ for (const row of rows) result.set(row.id, JSON.parse(row.data));
507
+ }
508
+ return result;
509
+ }
510
+ /**
511
+ * Store multiple documents
512
+ */
513
+ async putMany(items) {
514
+ if (items.length === 0) return;
515
+ const now = (/* @__PURE__ */ new Date()).toISOString();
516
+ await withTransaction(this.db, async (trx) => {
517
+ for (const item of items) {
518
+ const jsonData = JSON.stringify(item.data);
519
+ const revision = crypto.randomUUID();
520
+ await trx.insertInto("_plugin_storage").values({
521
+ plugin_id: this.pluginId,
522
+ collection: this.collection,
523
+ id: item.id,
524
+ data: jsonData,
525
+ revision,
526
+ created_at: now,
527
+ updated_at: now
528
+ }).onConflict((oc) => oc.columns([
529
+ "plugin_id",
530
+ "collection",
531
+ "id"
532
+ ]).doUpdateSet({
533
+ data: jsonData,
534
+ revision,
535
+ updated_at: now
536
+ })).execute();
537
+ }
538
+ });
539
+ }
540
+ /**
541
+ * Delete multiple documents
542
+ */
543
+ async deleteMany(ids) {
544
+ if (ids.length === 0) return 0;
545
+ return withTransaction(this.db, async (trx) => {
546
+ let deleted = 0;
547
+ for (const batch of chunks(ids, SQL_BATCH_SIZE)) {
548
+ const result = await trx.deleteFrom("_plugin_storage").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "in", batch).executeTakeFirst();
549
+ deleted += Number(result.numDeletedRows ?? 0);
550
+ }
551
+ return deleted;
552
+ });
553
+ }
554
+ /**
555
+ * Query documents with filters
556
+ */
557
+ async query(options = {}) {
558
+ const { where = {}, orderBy = {}, cursor } = options;
559
+ const limit = Math.max(1, Math.min(options.limit ?? 50, 100));
560
+ validateWhereClause(where, this.indexedFields, this.pluginId, this.collection);
561
+ if (Object.keys(orderBy).length > 0) validateOrderByClause(orderBy, this.indexedFields, this.pluginId, this.collection);
562
+ let query = this.db.selectFrom("_plugin_storage").select([
563
+ "id",
564
+ "data",
565
+ "created_at"
566
+ ]).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection);
567
+ const whereResult = buildWhereClause(this.db, where);
568
+ if (whereResult.sql) query = query.where(rawWhereExpr(whereResult.sql, whereResult.params));
569
+ const orderEntries = Object.entries(orderBy);
570
+ const orderDirections = new Set(orderEntries.map(([, direction]) => direction));
571
+ const descending = orderEntries.length > 0 && orderEntries[0][1] === "desc";
572
+ const sortExpr = (field) => sql`${sql.raw(jsonOrderExtract(this.db, field))}`;
573
+ if (cursor) {
574
+ const decoded = decodeCursor(cursor);
575
+ if (orderEntries.length === 0) query = query.where(({ eb }) => eb(sql`(created_at, id)`, ">", sql`(${decoded.orderValue}, ${decoded.id})`));
576
+ else {
577
+ if (orderDirections.size > 1) throw new StorageQueryError("Cursor pagination requires every orderBy field to share one direction.", Object.keys(orderBy).join(", "), "Sort every field the same way, or page without a cursor.");
578
+ const op = descending ? sql`<` : sql`>`;
579
+ const cursorSortValues = decoded.sortValues;
580
+ const useCursorValues = cursorSortValues !== void 0 && cursorSortValues.length === orderEntries.length && (isPostgres(this.db) || cursorSortValues.every(isScalarSortBoundary));
581
+ const cursorExpr = (field) => sql`(select ${sql.raw(jsonOrderExtract(this.db, field))} from _plugin_storage where plugin_id = ${this.pluginId} and collection = ${this.collection} and id = ${decoded.id})`;
582
+ if (!useCursorValues) {
583
+ if (!await this.db.selectFrom("_plugin_storage").select(sql`1`.as("one")).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", decoded.id).executeTakeFirst()) throw new InvalidCursorError(cursor);
584
+ }
585
+ const fields = orderEntries.map(([field], index) => {
586
+ const own = sortExpr(field);
587
+ const theirs = useCursorValues ? cursorFieldValue(this.db, cursorSortValues[index]) : cursorExpr(field);
588
+ return {
589
+ equal: sql`(${nullRank(own)} = ${nullRank(theirs)} and (${nullRank(own)} = 1 or ${own} = ${theirs}))`,
590
+ after: sql`(${nullRank(own)} ${op} ${nullRank(theirs)} or (${nullRank(own)} = ${nullRank(theirs)} and ${nullRank(own)} = 0 and ${own} ${op} ${theirs}))`
591
+ };
592
+ });
593
+ const terms = fields.map((_, k) => sql`(${sql.join([...fields.slice(0, k).map((f) => f.equal), fields[k].after], sql` and `)})`);
594
+ terms.push(sql`(${sql.join([...fields.map((f) => f.equal), sql`id ${op} ${decoded.id}`], sql` and `)})`);
595
+ query = query.where(sql`(${sql.join(terms, sql` or `)})`);
596
+ }
597
+ }
598
+ if (orderEntries.length > 0) {
599
+ for (const [field, direction] of orderEntries) {
600
+ const dir = direction === "desc" ? sql`desc` : sql`asc`;
601
+ const expr = sortExpr(field);
602
+ query = query.orderBy(sql`${nullRank(expr)} ${dir}`);
603
+ query = query.orderBy(sql`${expr} ${dir}`);
604
+ }
605
+ query = query.orderBy("id", descending ? "desc" : "asc");
606
+ } else query = query.orderBy("created_at", "asc").orderBy("id", "asc");
607
+ query = query.limit(limit + 1);
608
+ const rows = await query.execute();
609
+ const hasMore = rows.length > limit;
610
+ const items = rows.slice(0, limit).map((row) => ({
611
+ id: row.id,
612
+ data: JSON.parse(row.data)
613
+ }));
614
+ let nextCursor;
615
+ if (hasMore) {
616
+ const lastItem = rows[limit - 1];
617
+ if (lastItem) {
618
+ let sortValues;
619
+ if (orderEntries.length > 0) {
620
+ const candidate = sortBoundaries(JSON.parse(lastItem.data), orderEntries.map(([field]) => field));
621
+ if (candidate.every(isScalarSortBoundary)) sortValues = candidate;
622
+ }
623
+ nextCursor = encodeCursor(lastItem.created_at, lastItem.id, sortValues);
624
+ if (nextCursor.length > MAX_CURSOR_LENGTH) nextCursor = encodeCursor(lastItem.created_at, lastItem.id, void 0);
625
+ }
626
+ }
627
+ return {
628
+ items,
629
+ cursor: nextCursor,
630
+ hasMore
631
+ };
632
+ }
633
+ /**
634
+ * Count documents matching a filter
635
+ */
636
+ async count(where) {
637
+ if (where && Object.keys(where).length > 0) validateWhereClause(where, this.indexedFields, this.pluginId, this.collection);
638
+ let query = this.db.selectFrom("_plugin_storage").select(sql`COUNT(*)`.as("count")).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection);
639
+ if (where && Object.keys(where).length > 0) {
640
+ const whereResult = buildWhereClause(this.db, where);
641
+ if (whereResult.sql) query = query.where(rawWhereExpr(whereResult.sql, whereResult.params));
642
+ }
643
+ const result = await query.executeTakeFirst();
644
+ return Number(result?.count ?? 0);
645
+ }
646
+ async updateIf(id, args) {
647
+ if (typeof id !== "string") throw new TypeError("Storage ID must be a string");
648
+ const { where, setEntries, deltaEntries } = parseStorageUpdate(args);
649
+ for (const value of Object.values(where)) if (isInFilter(value) && value.in.length === 0) return { applied: false };
650
+ const now = (/* @__PURE__ */ new Date()).toISOString();
651
+ const dataExpr = pluginDataWriteExpr(this.db, setEntries, deltaEntries);
652
+ let query = this.db.updateTable("_plugin_storage").set({
653
+ data: dataExpr,
654
+ updated_at: now
655
+ }).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).where(pluginDataUpdateGuard(this.db, deltaEntries));
656
+ const whereResult = buildWhereClause(this.db, where);
657
+ if (whereResult.sql) query = query.where(rawWhereExpr(whereResult.sql, whereResult.params));
658
+ let row;
659
+ try {
660
+ row = await query.returning("data").executeTakeFirst();
661
+ } catch (err) {
662
+ throw mapSerializationFailure(err);
663
+ }
664
+ if (!row) return { applied: false };
665
+ return {
666
+ applied: true,
667
+ data: JSON.parse(row.data)
668
+ };
669
+ }
670
+ };
671
+
672
+ //#endregion
673
+ //#region src/database/repositories/seo.ts
674
+ /** Default SEO values for content without an explicit SEO row */
675
+ const SEO_DEFAULTS = {
676
+ title: null,
677
+ description: null,
678
+ image: null,
679
+ canonical: null,
680
+ noIndex: false
681
+ };
682
+ /**
683
+ * Returns true if the input has at least one explicitly-set SEO field.
684
+ * Used to skip no-op upserts when callers pass `{ seo: {} }`.
685
+ */
686
+ function hasAnyField(input) {
687
+ return input.title !== void 0 || input.description !== void 0 || input.image !== void 0 || input.canonical !== void 0 || input.noIndex !== void 0;
688
+ }
689
+ /**
690
+ * Repository for SEO metadata stored in `_emdash_seo`.
691
+ *
692
+ * SEO data lives in a separate table keyed by (collection, content_id).
693
+ * Only collections with `has_seo = 1` should use this — callers are
694
+ * responsible for checking the flag before reading/writing.
695
+ */
696
+ var SeoRepository = class {
697
+ constructor(db) {
698
+ this.db = db;
699
+ }
700
+ /**
701
+ * Check whether a collection has SEO enabled (`has_seo = 1`).
702
+ * Returns `false` if the collection does not exist.
703
+ */
704
+ async isEnabled(collection) {
705
+ return (await this.db.selectFrom("_emdash_collections").select("has_seo").where("slug", "=", collection).executeTakeFirst())?.has_seo === 1;
706
+ }
707
+ /**
708
+ * Get SEO data for a content item. Returns null defaults if no row exists.
709
+ */
710
+ async get(collection, contentId) {
711
+ const row = await this.db.selectFrom("_emdash_seo").selectAll().where("collection", "=", collection).where("content_id", "=", contentId).executeTakeFirst();
712
+ if (!row) return { ...SEO_DEFAULTS };
713
+ return {
714
+ title: row.seo_title ?? null,
715
+ description: row.seo_description ?? null,
716
+ image: row.seo_image ?? null,
717
+ canonical: row.seo_canonical ?? null,
718
+ noIndex: row.seo_no_index === 1
719
+ };
720
+ }
721
+ /**
722
+ * Get SEO data for multiple content items.
723
+ * Returns a Map keyed by content_id. Items without SEO rows get defaults.
724
+ *
725
+ * Chunks the `content_id IN (…)` clause so the total bound-parameter count
726
+ * per statement (ids + the `collection = ?` filter) stays within Cloudflare
727
+ * D1's 100-variable limit regardless of how many content items are passed.
728
+ */
729
+ async getMany(collection, contentIds) {
730
+ const result = /* @__PURE__ */ new Map();
731
+ if (contentIds.length === 0) return result;
732
+ for (const id of contentIds) result.set(id, { ...SEO_DEFAULTS });
733
+ const uniqueContentIds = [...new Set(contentIds)];
734
+ for (const chunk of chunks(uniqueContentIds, SQL_BATCH_SIZE)) {
735
+ const rows = await this.db.selectFrom("_emdash_seo").selectAll().where("collection", "=", collection).where("content_id", "in", chunk).execute();
736
+ for (const row of rows) result.set(row.content_id, {
737
+ title: row.seo_title ?? null,
738
+ description: row.seo_description ?? null,
739
+ image: row.seo_image ?? null,
740
+ canonical: row.seo_canonical ?? null,
741
+ noIndex: row.seo_no_index === 1
742
+ });
743
+ }
744
+ return result;
745
+ }
746
+ /**
747
+ * Upsert SEO data for a content item using INSERT ON CONFLICT DO UPDATE
748
+ * for atomicity. Skips no-op writes when input has no fields set.
749
+ */
750
+ async upsert(collection, contentId, input) {
751
+ if (!hasAnyField(input)) return this.get(collection, contentId);
752
+ const now = (/* @__PURE__ */ new Date()).toISOString();
753
+ await sql`
754
+ INSERT INTO _emdash_seo (
755
+ collection, content_id,
756
+ seo_title, seo_description, seo_image, seo_canonical, seo_no_index,
757
+ created_at, updated_at
758
+ ) VALUES (
759
+ ${collection}, ${contentId},
760
+ ${input.title ?? null}, ${input.description ?? null},
761
+ ${input.image ?? null}, ${input.canonical ?? null},
762
+ ${input.noIndex ? 1 : 0},
763
+ ${now}, ${now}
764
+ )
765
+ ON CONFLICT (collection, content_id) DO UPDATE SET
766
+ seo_title = ${input.title !== void 0 ? sql`${input.title}` : sql`_emdash_seo.seo_title`},
767
+ seo_description = ${input.description !== void 0 ? sql`${input.description}` : sql`_emdash_seo.seo_description`},
768
+ seo_image = ${input.image !== void 0 ? sql`${input.image}` : sql`_emdash_seo.seo_image`},
769
+ seo_canonical = ${input.canonical !== void 0 ? sql`${input.canonical}` : sql`_emdash_seo.seo_canonical`},
770
+ seo_no_index = ${input.noIndex !== void 0 ? sql`${input.noIndex ? 1 : 0}` : sql`_emdash_seo.seo_no_index`},
771
+ updated_at = ${now}
772
+ `.execute(this.db);
773
+ invalidateCollectionCache(collection);
774
+ notifyRoom({
775
+ collection,
776
+ id: contentId
777
+ }, ["seo"]);
778
+ return this.get(collection, contentId);
779
+ }
780
+ /**
781
+ * Delete SEO data for a content item.
782
+ */
783
+ async delete(collection, contentId) {
784
+ await this.db.deleteFrom("_emdash_seo").where("collection", "=", collection).where("content_id", "=", contentId).execute();
785
+ invalidateCollectionCache(collection);
786
+ }
787
+ /**
788
+ * Copy SEO data from one content item to another.
789
+ * Used by duplicate. Clears canonical (it pointed to the original).
790
+ */
791
+ async copyForDuplicate(collection, sourceId, targetId) {
792
+ const source = await this.get(collection, sourceId);
793
+ if (source.title !== null || source.description !== null || source.image !== null || source.noIndex) await this.upsert(collection, targetId, {
794
+ title: source.title,
795
+ description: source.description,
796
+ image: source.image,
797
+ canonical: null,
798
+ noIndex: source.noIndex
799
+ });
800
+ }
801
+ };
802
+
803
+ //#endregion
804
+ //#region src/plugins/byline-access.ts
805
+ const MAX_BYLINE_ENTRY_IDS = 100;
806
+ const DEFAULT_LIST_LIMIT = 50;
807
+ const MAX_LIST_LIMIT = 100;
808
+ function toBylineInfo(byline) {
809
+ return {
810
+ id: byline.id,
811
+ slug: byline.slug,
812
+ displayName: byline.displayName,
813
+ bio: byline.bio,
814
+ websiteUrl: byline.websiteUrl,
815
+ avatarMediaId: byline.avatarMediaId,
816
+ locale: byline.locale,
817
+ translationGroup: byline.translationGroup ?? byline.id
818
+ };
819
+ }
820
+ function toCreditInfo(credit) {
821
+ return {
822
+ byline: toBylineInfo(credit.byline),
823
+ sortOrder: credit.sortOrder,
824
+ roleLabel: credit.roleLabel,
825
+ source: credit.source ?? "explicit"
826
+ };
827
+ }
828
+ function clampListLimit(limit) {
829
+ if (limit === void 0 || !Number.isFinite(limit)) return DEFAULT_LIST_LIMIT;
830
+ return Math.min(Math.max(Math.trunc(limit), 1), MAX_LIST_LIMIT);
831
+ }
832
+ function selectPublicBylines(db) {
833
+ return db.selectFrom("_emdash_bylines").select([
834
+ "id",
835
+ "slug",
836
+ "display_name as displayName",
837
+ "bio",
838
+ "website_url as websiteUrl",
839
+ "avatar_media_id as avatarMediaId",
840
+ "locale",
841
+ "translation_group as translationGroup",
842
+ "created_at as createdAt"
843
+ ]);
844
+ }
845
+ async function loadEntryRefs(db, collection, entryIds) {
846
+ const tableName = `ec_${collection}`;
847
+ const refs = [];
848
+ for (const chunk of chunks(entryIds, SQL_BATCH_SIZE)) {
849
+ const result = await sql`
850
+ SELECT id, author_id, primary_byline_id, locale FROM ${sql.ref(tableName)}
851
+ WHERE id IN (${sql.join(chunk)})
852
+ AND deleted_at IS NULL
853
+ `.execute(db);
854
+ for (const row of result.rows) refs.push({
855
+ id: row.id,
856
+ authorId: row.author_id,
857
+ primaryBylineId: row.primary_byline_id,
858
+ locale: row.locale
859
+ });
860
+ }
861
+ return refs;
862
+ }
863
+ /**
864
+ * Create read-only byline access (gated on `bylines:read`).
865
+ */
866
+ function createBylineAccess(db) {
867
+ return {
868
+ async get(id) {
869
+ const row = await selectPublicBylines(db).where("id", "=", id).executeTakeFirst();
870
+ return row ? toBylineInfo(row) : null;
871
+ },
872
+ async list(options) {
873
+ const limit = clampListLimit(options?.limit);
874
+ let query = selectPublicBylines(db).orderBy("created_at", "desc").orderBy("id", "desc").limit(limit + 1);
875
+ if (options?.locale !== void 0) query = query.where(localeMatches("locale", options.locale));
876
+ if (options?.cursor) {
877
+ const decoded = decodeCursor(options.cursor);
878
+ query = query.where((eb) => eb.or([eb("created_at", "<", decoded.orderValue), eb.and([eb("created_at", "=", decoded.orderValue), eb("id", "<", decoded.id)])]));
879
+ }
880
+ const rows = await query.execute();
881
+ const pageRows = rows.slice(0, limit);
882
+ const last = pageRows.at(-1);
883
+ return {
884
+ items: pageRows.map(toBylineInfo),
885
+ hasMore: rows.length > limit,
886
+ ...rows.length > limit && last ? { cursor: encodeCursor(last.createdAt, last.id) } : {}
887
+ };
888
+ },
889
+ async getEntriesBylines(collection, entryIds) {
890
+ validateIdentifier(collection, "collection");
891
+ const uniqueIds = [...new Set(entryIds)];
892
+ if (uniqueIds.length > MAX_BYLINE_ENTRY_IDS) throw new Error(`Byline lookups accept at most ${MAX_BYLINE_ENTRY_IDS} entry IDs`);
893
+ if (uniqueIds.length === 0) return [];
894
+ const credits = await resolveBylineCredits(db, collection, await loadEntryRefs(db, collection, uniqueIds), { hydrateCustomFields: false });
895
+ return uniqueIds.map((entryId) => ({
896
+ entryId,
897
+ bylines: (credits.get(entryId) ?? []).map(toCreditInfo)
898
+ }));
899
+ }
900
+ };
901
+ }
902
+
903
+ //#endregion
904
+ //#region src/plugins/content-access.ts
905
+ function createContentAccess(db, accessOptions) {
906
+ const contentRepo = new ContentRepository(db);
907
+ const seoRepo = new SeoRepository(db);
908
+ return {
909
+ async get(collection, id) {
910
+ const item = await contentRepo.findById(collection, id);
911
+ if (!item) return null;
912
+ const result = {
913
+ id: item.id,
914
+ type: item.type,
915
+ slug: item.slug,
916
+ status: item.status,
917
+ data: item.data,
918
+ createdAt: item.createdAt,
919
+ updatedAt: item.updatedAt,
920
+ locale: item.locale,
921
+ publishedAt: item.publishedAt,
922
+ scheduledAt: item.scheduledAt,
923
+ authorId: item.authorId,
924
+ translationGroup: item.translationGroup,
925
+ liveRevisionId: item.liveRevisionId,
926
+ draftRevisionId: item.draftRevisionId,
927
+ version: item.version
928
+ };
929
+ if (await seoRepo.isEnabled(collection)) result.seo = await seoRepo.get(collection, item.id);
930
+ return result;
931
+ },
932
+ async list(collection, options) {
933
+ let orderBy;
934
+ if (options?.orderBy) {
935
+ const first = Object.entries(options.orderBy)[0];
936
+ if (first) orderBy = {
937
+ field: first[0],
938
+ direction: first[1]
939
+ };
940
+ }
941
+ const result = await contentRepo.findMany(collection, {
942
+ limit: options?.limit ?? 50,
943
+ cursor: options?.cursor,
944
+ orderBy,
945
+ where: options?.where
946
+ });
947
+ const items = result.items.map((item) => ({
948
+ id: item.id,
949
+ type: item.type,
950
+ slug: item.slug,
951
+ status: item.status,
952
+ data: item.data,
953
+ createdAt: item.createdAt,
954
+ updatedAt: item.updatedAt,
955
+ locale: item.locale,
956
+ publishedAt: item.publishedAt,
957
+ scheduledAt: item.scheduledAt,
958
+ authorId: item.authorId,
959
+ translationGroup: item.translationGroup,
960
+ liveRevisionId: item.liveRevisionId,
961
+ draftRevisionId: item.draftRevisionId,
962
+ version: item.version
963
+ }));
964
+ if (items.length > 0 && await seoRepo.isEnabled(collection)) {
965
+ const seoMap = await seoRepo.getMany(collection, items.map((item) => item.id));
966
+ for (const item of items) {
967
+ const seo = seoMap.get(item.id);
968
+ if (seo) item.seo = seo;
969
+ }
970
+ }
971
+ return {
972
+ items,
973
+ cursor: result.nextCursor,
974
+ hasMore: !!result.nextCursor
975
+ };
976
+ },
977
+ async getTranslations(collection, id) {
978
+ const item = await contentRepo.findById(collection, id);
979
+ if (!item) throw new Error(`Content not found: ${collection}/${id}`);
980
+ return {
981
+ translationGroup: item.translationGroup || item.id,
982
+ translations: (item.translationGroup ? await contentRepo.findTranslations(collection, item.translationGroup) : [item]).map((translation) => ({
983
+ id: translation.id,
984
+ locale: translation.locale,
985
+ slug: translation.slug,
986
+ status: translation.status,
987
+ updatedAt: translation.updatedAt
988
+ }))
989
+ };
990
+ },
991
+ async getPublicUrl(collection, id) {
992
+ const site = accessOptions?.site;
993
+ if (!site?.url) return null;
994
+ const [item, collectionInfo] = await Promise.all([contentRepo.findById(collection, id), new SchemaRegistry(db).getCollection(collection)]);
995
+ if (!item || item.status !== "published" || !item.slug || !collectionInfo?.routable) return null;
996
+ const path = await resolveLocalizedContentRoutePath({
997
+ pattern: collectionInfo.urlPattern ?? null,
998
+ collection,
999
+ slug: item.slug,
1000
+ id: item.id,
1001
+ date: item.publishedAt,
1002
+ locale: item.locale || site.locale,
1003
+ trailingSlash: site.trailingSlash
1004
+ });
1005
+ return path === null ? null : `${site.url}${path}`;
1006
+ },
1007
+ ...accessOptions?.revisions ? {
1008
+ async listRevisions(collection, id, revisionOptions) {
1009
+ return (await new RevisionRepository(db).findVisibleByEntry(collection, id, { limit: normalizeRevisionLimit(revisionOptions?.limit) })).map(({ authorId: _authorId, ...revision }) => revision);
1010
+ },
1011
+ async getRevision(collection, id, revisionId) {
1012
+ const revision = await new RevisionRepository(db).findVisibleById(collection, id, revisionId);
1013
+ if (!revision) return null;
1014
+ const { authorId: _authorId, ...safeRevision } = revision;
1015
+ return safeRevision;
1016
+ }
1017
+ } : {}
1018
+ };
1019
+ }
1020
+
1021
+ //#endregion
1022
+ //#region src/plugins/media.ts
1023
+ const DEFAULT_PLUGIN_MEDIA_READ_BYTES = 10 * 1024 * 1024;
1024
+ const MAX_PLUGIN_MEDIA_READ_BYTES = 16 * 1024 * 1024;
1025
+ function mediaUrl(item) {
1026
+ return `/_emdash/api/media/asset/${encodeURIComponent(item.id)}/${encodeURIComponent(item.filename)}`;
1027
+ }
1028
+ function toPluginMediaItem(item) {
1029
+ return {
1030
+ id: item.id,
1031
+ filename: item.filename,
1032
+ mimeType: item.mimeType,
1033
+ size: item.size,
1034
+ url: mediaUrl(item),
1035
+ createdAt: item.createdAt,
1036
+ width: item.width,
1037
+ height: item.height,
1038
+ alt: item.alt,
1039
+ caption: item.caption,
1040
+ focalX: item.focalX,
1041
+ focalY: item.focalY,
1042
+ blurhash: item.blurhash,
1043
+ dominantColor: item.dominantColor,
1044
+ folderId: item.folderId ?? null,
1045
+ status: "ready"
1046
+ };
1047
+ }
1048
+ function resolveByteLimit(maxBytes) {
1049
+ const limit = maxBytes ?? DEFAULT_PLUGIN_MEDIA_READ_BYTES;
1050
+ if (!Number.isSafeInteger(limit) || limit <= 0 || limit > MAX_PLUGIN_MEDIA_READ_BYTES) throw new RangeError(`media.readBytes maxBytes must be a positive integer no greater than ${MAX_PLUGIN_MEDIA_READ_BYTES}`);
1051
+ return limit;
1052
+ }
1053
+ async function readStreamWithLimit(body, maxBytes) {
1054
+ const reader = body.getReader();
1055
+ const chunks = [];
1056
+ let size = 0;
1057
+ try {
1058
+ while (true) {
1059
+ const { done, value } = await reader.read();
1060
+ if (done) break;
1061
+ size += value.byteLength;
1062
+ if (size > maxBytes) {
1063
+ try {
1064
+ await reader.cancel();
1065
+ } catch {}
1066
+ throw new PluginMediaByteLimitError(`Media exceeds the requested ${maxBytes}-byte limit`);
1067
+ }
1068
+ chunks.push(value);
1069
+ }
1070
+ } finally {
1071
+ reader.releaseLock();
1072
+ }
1073
+ const bytes = new Uint8Array(size);
1074
+ let offset = 0;
1075
+ for (const chunk of chunks) {
1076
+ bytes.set(chunk, offset);
1077
+ offset += chunk.byteLength;
1078
+ }
1079
+ return bytes;
1080
+ }
1081
+ var PluginMediaByteLimitError = class extends RangeError {};
1082
+ async function readPluginMediaBytes(db, storage, id, options) {
1083
+ if (!storage) throw new Error("Media storage is not configured");
1084
+ const limit = resolveByteLimit(options?.maxBytes);
1085
+ const item = await new MediaRepository(db).findById(id);
1086
+ if (!item || item.status !== "ready") throw new Error("Media item is not ready or does not exist");
1087
+ let bytes;
1088
+ try {
1089
+ bytes = await readStreamWithLimit((await storage.download(item.storageKey)).body, limit);
1090
+ } catch (error) {
1091
+ if (error instanceof PluginMediaByteLimitError) throw error;
1092
+ throw new Error("Failed to read media bytes");
1093
+ }
1094
+ return {
1095
+ bytes,
1096
+ filename: item.filename,
1097
+ mimeType: item.mimeType,
1098
+ size: bytes.byteLength,
1099
+ ...item.contentHash ? { contentHash: item.contentHash } : {}
1100
+ };
1101
+ }
1102
+ async function updatePluginMediaMetadata(db, id, patch) {
1103
+ const parsed = parsePluginMediaMetadataPatch(patch);
1104
+ const item = await new MediaRepository(db).updateReadyMetadata(id, parsed);
1105
+ if (!item) throw new Error("Media item is not ready or does not exist");
1106
+ return toPluginMediaItem(item);
1107
+ }
1108
+ const MEDIA_METADATA_KEYS = new Set([
1109
+ "alt",
1110
+ "caption",
1111
+ "focalX",
1112
+ "focalY"
1113
+ ]);
1114
+ function parsePluginMediaMetadataPatch(value) {
1115
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("media.updateMetadata patch must be an object");
1116
+ const keys = Object.keys(value);
1117
+ if (keys.length === 0) throw new TypeError("media.updateMetadata must change at least one metadata field");
1118
+ for (const key of keys) if (!MEDIA_METADATA_KEYS.has(key)) throw new TypeError(`media.updateMetadata cannot change ${key}`);
1119
+ const alt = Reflect.get(value, "alt");
1120
+ const caption = Reflect.get(value, "caption");
1121
+ const focalX = Reflect.get(value, "focalX");
1122
+ const focalY = Reflect.get(value, "focalY");
1123
+ if (alt !== void 0 && alt !== null && typeof alt !== "string") throw new TypeError("media.updateMetadata alt must be a string or null");
1124
+ if (caption !== void 0 && caption !== null && typeof caption !== "string") throw new TypeError("media.updateMetadata caption must be a string or null");
1125
+ if (focalX !== void 0 && focalX !== null && typeof focalX !== "number") throw new TypeError("media.updateMetadata focalX must be a number or null");
1126
+ if (focalY !== void 0 && focalY !== null && typeof focalY !== "number") throw new TypeError("media.updateMetadata focalY must be a number or null");
1127
+ const patch = {};
1128
+ if (alt !== void 0) patch.alt = alt;
1129
+ if (caption !== void 0) patch.caption = caption;
1130
+ if (focalX !== void 0) patch.focalX = focalX;
1131
+ if (focalY !== void 0) patch.focalY = focalY;
1132
+ if (!isValidFocalPointUpdate(patch)) throw new TypeError("focalX and focalY must both be valid numbers or both be null");
1133
+ return patch;
1134
+ }
1135
+
1136
+ //#endregion
1137
+ //#region src/plugins/route-error.ts
1138
+ /**
1139
+ * Error class for plugin routes
1140
+ * Allows plugins to return structured errors with specific HTTP status codes
1141
+ */
1142
+ var PluginRouteError = class PluginRouteError extends Error {
1143
+ constructor(code, message, status = 400, details) {
1144
+ super(message);
1145
+ this.code = code;
1146
+ this.status = status;
1147
+ this.details = details;
1148
+ this.name = "PluginRouteError";
1149
+ }
1150
+ /**
1151
+ * Create a bad request error (400)
1152
+ */
1153
+ static badRequest(message, details) {
1154
+ return new PluginRouteError("BAD_REQUEST", message, 400, details);
1155
+ }
1156
+ /**
1157
+ * Create an unauthorized error (401)
1158
+ */
1159
+ static unauthorized(message = "Unauthorized") {
1160
+ return new PluginRouteError("UNAUTHORIZED", message, 401);
1161
+ }
1162
+ /**
1163
+ * Create a forbidden error (403)
1164
+ */
1165
+ static forbidden(message = "Forbidden") {
1166
+ return new PluginRouteError("FORBIDDEN", message, 403);
1167
+ }
1168
+ /**
1169
+ * Create a not found error (404)
1170
+ */
1171
+ static notFound(message = "Not found") {
1172
+ return new PluginRouteError("NOT_FOUND", message, 404);
1173
+ }
1174
+ /**
1175
+ * Create a conflict error (409)
1176
+ */
1177
+ static conflict(message, details) {
1178
+ return new PluginRouteError("CONFLICT", message, 409, details);
1179
+ }
1180
+ /**
1181
+ * Create an internal error (500)
1182
+ */
1183
+ static internal(message = "Internal error") {
1184
+ return new PluginRouteError("INTERNAL_ERROR", message, 500);
1185
+ }
1186
+ };
1187
+ /**
1188
+ * Check whether a thrown value is a PluginRouteError.
1189
+ *
1190
+ * Also matches on shape, not just `instanceof`: under `astro dev`, Vite can load a
1191
+ * plugin's `emdash` import as a separate module instance, so the error the plugin
1192
+ * throws comes from a different copy of this class.
1193
+ */
1194
+ function isPluginRouteError(error) {
1195
+ if (error instanceof PluginRouteError) return true;
1196
+ if (!(error instanceof Error) || error.name !== "PluginRouteError") return false;
1197
+ const { code, status } = error;
1198
+ return typeof code === "string" && typeof status === "number";
1199
+ }
1200
+
1201
+ //#endregion
1202
+ //#region src/plugins/context.ts
1203
+ /**
1204
+ * Create KV accessor for a plugin
1205
+ * All keys are automatically prefixed with the plugin ID
1206
+ */
1207
+ function createKVAccess(optionsRepo, pluginId, settings = createSettingsAccess(optionsRepo, pluginId)) {
1208
+ const prefix = `plugin:${pluginId}:`;
1209
+ return {
1210
+ async get(key) {
1211
+ if (key.startsWith("settings:")) return settings.get(key.slice(9));
1212
+ return optionsRepo.get(`${prefix}${key}`);
1213
+ },
1214
+ async getVersioned(key) {
1215
+ assertStorageKey(key);
1216
+ if (key.startsWith("settings:")) return settings.getVersioned(key.slice(9));
1217
+ return optionsRepo.getVersioned(`${prefix}${key}`);
1218
+ },
1219
+ async compareAndSet(key, expectedRevision, value) {
1220
+ assertStorageKey(key);
1221
+ if (key.startsWith("settings:")) return settings.compareAndSet(key.slice(9), expectedRevision, value);
1222
+ return optionsRepo.compareAndSet(`${prefix}${key}`, expectedRevision, value);
1223
+ },
1224
+ async compareAndDelete(key, expectedRevision) {
1225
+ assertStorageKey(key);
1226
+ if (key.startsWith("settings:")) return settings.compareAndDelete(key.slice(9), expectedRevision);
1227
+ return optionsRepo.compareAndDelete(`${prefix}${key}`, expectedRevision);
1228
+ },
1229
+ async set(key, value) {
1230
+ if (key.startsWith("settings:")) {
1231
+ await settings.set(key.slice(9), value);
1232
+ return;
1233
+ }
1234
+ await optionsRepo.set(`${prefix}${key}`, value);
1235
+ },
1236
+ async delete(key) {
1237
+ if (key.startsWith("settings:")) return settings.delete(key.slice(9));
1238
+ return optionsRepo.delete(`${prefix}${key}`);
1239
+ },
1240
+ async list(keyPrefix) {
1241
+ const requestedPrefix = keyPrefix ?? "";
1242
+ const includesSettings = "settings:".startsWith(requestedPrefix) || requestedPrefix.startsWith("settings:");
1243
+ const fullPrefix = `${prefix}${requestedPrefix}`;
1244
+ const entriesMap = requestedPrefix.startsWith("settings:") ? /* @__PURE__ */ new Map() : await optionsRepo.getByPrefix(fullPrefix);
1245
+ const result = [];
1246
+ for (const [fullKey, value] of entriesMap) {
1247
+ const key = fullKey.slice(prefix.length);
1248
+ if (!fullKey.startsWith(fullPrefix) || key.startsWith("settings:")) continue;
1249
+ result.push({
1250
+ key,
1251
+ value
1252
+ });
1253
+ }
1254
+ if (includesSettings) {
1255
+ const settingPrefix = requestedPrefix.startsWith("settings:") ? requestedPrefix.slice(9) : "";
1256
+ for (const entry of await settings.list(settingPrefix)) {
1257
+ const key = `settings:${entry.key}`;
1258
+ if (key.startsWith(requestedPrefix)) result.push({
1259
+ key,
1260
+ value: entry.value
1261
+ });
1262
+ }
1263
+ }
1264
+ return result;
1265
+ }
1266
+ };
1267
+ }
1268
+ /**
1269
+ * Create storage collection accessor for a plugin
1270
+ * Wraps PluginStorageRepository with the v2 interface (no async iterators)
1271
+ */
1272
+ function createStorageCollection(db, pluginId, collectionName, indexes) {
1273
+ const repo = new PluginStorageRepository(db, pluginId, collectionName, indexes);
1274
+ return {
1275
+ get: (id) => repo.get(id),
1276
+ getVersioned: (id) => repo.getVersioned(id),
1277
+ compareAndSet: (id, expectedRevision, data) => repo.compareAndSet(id, expectedRevision, data),
1278
+ compareAndDelete: (id, expectedRevision) => repo.compareAndDelete(id, expectedRevision),
1279
+ put: (id, data) => repo.put(id, data),
1280
+ delete: (id) => repo.delete(id),
1281
+ exists: (id) => repo.exists(id),
1282
+ getMany: (ids) => repo.getMany(ids),
1283
+ putMany: (items) => repo.putMany(items),
1284
+ deleteMany: (ids) => repo.deleteMany(ids),
1285
+ count: (where) => repo.count(where),
1286
+ updateIf: (id, updateArgs) => repo.updateIf(id, updateArgs),
1287
+ async query(options) {
1288
+ const result = await repo.query({
1289
+ where: options?.where,
1290
+ orderBy: options?.orderBy,
1291
+ limit: options?.limit,
1292
+ cursor: options?.cursor
1293
+ });
1294
+ return {
1295
+ items: result.items,
1296
+ cursor: result.cursor,
1297
+ hasMore: result.hasMore
1298
+ };
1299
+ }
1300
+ };
1301
+ }
1302
+ /**
1303
+ * Create storage accessor with all declared collections
1304
+ */
1305
+ function createStorageAccess(db, pluginId, storageConfig) {
1306
+ const storage = {};
1307
+ for (const [collectionName, config] of Object.entries(storageConfig)) storage[collectionName] = createStorageCollection(db, pluginId, collectionName, [...config.indexes, ...config.uniqueIndexes ?? []]);
1308
+ return storage;
1309
+ }
1310
+ /**
1311
+ * Extract `seo` from a plugin-supplied content write input and return both
1312
+ * parts. Mutates nothing — returns a new field map without the `seo` key.
1313
+ */
1314
+ function splitSeoFromInput(input) {
1315
+ const { seo, ...fields } = input;
1316
+ if (seo !== void 0 && (seo === null || typeof seo !== "object" || Array.isArray(seo))) throw new Error("content.seo must be an object");
1317
+ return {
1318
+ fields,
1319
+ seo
1320
+ };
1321
+ }
1322
+ /**
1323
+ * Reject writing SEO to a collection that does not have it enabled.
1324
+ * Matches the REST API behavior (VALIDATION_ERROR).
1325
+ */
1326
+ async function assertSeoEnabled(seoRepo, collection, seo) {
1327
+ const hasSeo = await seoRepo.isEnabled(collection);
1328
+ if (seo !== void 0 && !hasSeo) throw new Error(`Collection "${collection}" does not have SEO enabled. Remove the seo field or enable SEO on this collection.`);
1329
+ return hasSeo;
1330
+ }
1331
+ /**
1332
+ * Parse the `collections` JSON column into a string array (`[]` on anything
1333
+ * else). Mirrors the guards in the Cloudflare/workerd bridges so an
1334
+ * in-process plugin degrades on malformed data instead of crashing.
1335
+ */
1336
+ function parseCollectionsColumn(value) {
1337
+ if (!value) return [];
1338
+ try {
1339
+ const parsed = JSON.parse(value);
1340
+ return Array.isArray(parsed) ? parsed.filter((item) => typeof item === "string") : [];
1341
+ } catch {
1342
+ return [];
1343
+ }
1344
+ }
1345
+ /** Map a repository `Taxonomy` row to the plugin-facing term shape. */
1346
+ function taxonomyToTermInfo(term) {
1347
+ return {
1348
+ id: term.id,
1349
+ taxonomy: term.name,
1350
+ slug: term.slug,
1351
+ label: term.label,
1352
+ parentId: term.parentId,
1353
+ data: term.data,
1354
+ locale: term.locale,
1355
+ translationGroup: term.translationGroup
1356
+ };
1357
+ }
1358
+ function collectionToSchemaInfo(collection) {
1359
+ if (!collection) return null;
1360
+ return {
1361
+ slug: collection.slug,
1362
+ label: collection.label,
1363
+ labelSingular: collection.labelSingular ?? null,
1364
+ description: collection.description ?? null,
1365
+ supports: collection.supports,
1366
+ hasSeo: collection.hasSeo,
1367
+ titleField: collection.titleField ?? null,
1368
+ dateField: collection.dateField ?? null,
1369
+ urlPattern: collection.urlPattern ?? null,
1370
+ routable: collection.routable !== false,
1371
+ hidden: collection.hidden,
1372
+ fields: collection.fields.map((field) => ({
1373
+ slug: field.slug,
1374
+ label: field.label,
1375
+ type: field.type,
1376
+ required: field.required,
1377
+ unique: field.unique,
1378
+ ...field.defaultValue === void 0 ? {} : { default: field.defaultValue },
1379
+ ...field.validation === void 0 ? {} : { validation: field.validation },
1380
+ ...field.widget === void 0 ? {} : { widget: field.widget },
1381
+ ...field.options === void 0 ? {} : { options: field.options },
1382
+ searchable: field.searchable,
1383
+ indexed: field.indexed,
1384
+ translatable: field.translatable,
1385
+ sortOrder: field.sortOrder
1386
+ }))
1387
+ };
1388
+ }
1389
+ function createSchemaAccess(db) {
1390
+ const registry = new SchemaRegistry(db);
1391
+ return {
1392
+ async listCollections() {
1393
+ const collections = [];
1394
+ for (const collection of await registry.listCollectionsWithFields()) {
1395
+ const info = collectionToSchemaInfo(collection);
1396
+ if (info) collections.push(info);
1397
+ }
1398
+ return collections;
1399
+ },
1400
+ async getCollection(slug) {
1401
+ return collectionToSchemaInfo(await registry.getCollectionWithFields(slug));
1402
+ }
1403
+ };
1404
+ }
1405
+ /**
1406
+ * Create read-only taxonomy access (gated on `taxonomies:read`).
1407
+ */
1408
+ function createTaxonomyAccess(db) {
1409
+ const taxonomyRepo = new TaxonomyRepository(db);
1410
+ return {
1411
+ async getAll(options) {
1412
+ return (await selectTaxonomyDefs(db, options?.locale).orderBy("d.name", "asc").execute()).map((row) => ({
1413
+ name: row.name,
1414
+ label: row.label,
1415
+ labelSingular: row.label_singular,
1416
+ hierarchical: row.hierarchical === 1,
1417
+ collections: parseCollectionsColumn(row.collections),
1418
+ locale: row.locale
1419
+ }));
1420
+ },
1421
+ async getTerms(taxonomy, options) {
1422
+ return (await taxonomyRepo.findByName(taxonomy, { locale: options?.locale })).map(taxonomyToTermInfo);
1423
+ },
1424
+ async getEntryTerms(collection, entryId, options) {
1425
+ return (await taxonomyRepo.getTermsForEntry(collection, entryId, options?.taxonomy, options?.locale)).map(taxonomyToTermInfo);
1426
+ }
1427
+ };
1428
+ }
1429
+ function toPluginComment(comment) {
1430
+ if (comment.status === "trash") throw new Error("Trashed comments are not plugin-readable");
1431
+ return {
1432
+ id: comment.id,
1433
+ collection: comment.collection,
1434
+ contentId: comment.contentId,
1435
+ parentId: comment.parentId,
1436
+ authorName: comment.authorName,
1437
+ authorEmail: comment.authorEmail,
1438
+ body: comment.body,
1439
+ status: comment.status,
1440
+ ipHash: comment.ipHash,
1441
+ userAgent: comment.userAgent,
1442
+ moderationMetadata: comment.moderationMetadata,
1443
+ createdAt: comment.createdAt,
1444
+ updatedAt: comment.updatedAt
1445
+ };
1446
+ }
1447
+ function createCommentAccess(db, moderate) {
1448
+ const repo = new CommentRepository(db);
1449
+ return {
1450
+ async get(id) {
1451
+ const comment = await repo.findById(id);
1452
+ return !comment || comment.status === "trash" ? null : toPluginComment(comment);
1453
+ },
1454
+ async list(options = {}) {
1455
+ const result = await repo.findForPlugin(options);
1456
+ return {
1457
+ items: result.items.map(toPluginComment),
1458
+ cursor: result.nextCursor,
1459
+ hasMore: result.nextCursor !== void 0
1460
+ };
1461
+ },
1462
+ count: (options) => repo.countForPlugin(options),
1463
+ ...moderate ? { setStatus: (id, status, options) => moderate(id, status, options.expectedStatus) } : {}
1464
+ };
1465
+ }
1466
+ var RedirectAccessError = class extends Error {
1467
+ name = "RedirectAccessError";
1468
+ constructor(code, message) {
1469
+ super(message);
1470
+ this.code = code;
1471
+ }
1472
+ };
1473
+ const REDIRECT_REVISION_PREFIX = "r1.";
1474
+ const BASE64_PADDING_RE = /=+$/;
1475
+ function encodeRedirectRevision(id, revision) {
1476
+ const payload = `${id}\0${revision}`;
1477
+ return `${REDIRECT_REVISION_PREFIX}${btoa(payload).replaceAll("+", "-").replaceAll("/", "_").replace(BASE64_PADDING_RE, "")}`;
1478
+ }
1479
+ function decodeRedirectRevision(id, revision) {
1480
+ if (typeof revision !== "string" || !revision.startsWith(REDIRECT_REVISION_PREFIX)) throw new RedirectAccessError("INVALID_PRECONDITION", "Invalid redirect revision");
1481
+ try {
1482
+ const encoded = revision.slice(3).replaceAll("-", "+").replaceAll("_", "/");
1483
+ const padded = encoded.padEnd(Math.ceil(encoded.length / 4) * 4, "=");
1484
+ const [revisionId, updatedAt, extra] = atob(padded).split("\0");
1485
+ if (revisionId !== id || !updatedAt || extra !== void 0) throw new Error("invalid");
1486
+ return updatedAt;
1487
+ } catch (error) {
1488
+ if (error instanceof RedirectAccessError) throw error;
1489
+ throw new RedirectAccessError("INVALID_PRECONDITION", "Invalid redirect revision");
1490
+ }
1491
+ }
1492
+ function toRedirectInfo(redirect) {
1493
+ return {
1494
+ ...redirect,
1495
+ type: redirect.type
1496
+ };
1497
+ }
1498
+ function toVersionedRedirect(record) {
1499
+ return {
1500
+ redirect: toRedirectInfo(record.redirect),
1501
+ _rev: encodeRedirectRevision(record.redirect.id, record.configRevision)
1502
+ };
1503
+ }
1504
+ async function readVersionedRedirect(repo, id) {
1505
+ const record = await repo.findVersionedById(id);
1506
+ return record ? toVersionedRedirect(record) : null;
1507
+ }
1508
+ function throwRedirectResult(error) {
1509
+ throw new RedirectAccessError(error.code, error.message);
1510
+ }
1511
+ function assertNoAutomaticRedirectMarker(input) {
1512
+ if (typeof input !== "object" || input === null || Array.isArray(input)) throw new RedirectAccessError("VALIDATION_ERROR", "Redirect input must be an object");
1513
+ if (Object.hasOwn(input, "auto")) throw new RedirectAccessError("VALIDATION_ERROR", "The automatic redirect marker is managed by EmDash");
1514
+ }
1515
+ function createRedirectAccess(db, writable = false) {
1516
+ const repo = new RedirectRepository(db);
1517
+ const readAccess = {
1518
+ async list(options = {}) {
1519
+ const result = await handleRedirectList(db, options);
1520
+ if (!result.success) return throwRedirectResult(result.error);
1521
+ return {
1522
+ items: result.data.items.map(toRedirectInfo),
1523
+ cursor: result.data.nextCursor,
1524
+ hasMore: result.data.nextCursor !== void 0
1525
+ };
1526
+ },
1527
+ get: (id) => readVersionedRedirect(repo, id)
1528
+ };
1529
+ if (!writable) return readAccess;
1530
+ return {
1531
+ ...readAccess,
1532
+ async create(input) {
1533
+ assertNoAutomaticRedirectMarker(input);
1534
+ const parsed = createRedirectBody.safeParse(input);
1535
+ if (!parsed.success) throw new RedirectAccessError("VALIDATION_ERROR", parsed.error.issues[0]?.message ?? "Invalid redirect");
1536
+ const result = await handleRedirectCreate(db, parsed.data);
1537
+ if (!result.success) return throwRedirectResult(result.error);
1538
+ const current = await readVersionedRedirect(repo, result.data.id);
1539
+ if (!current) throw new RedirectAccessError("NOT_FOUND", "Created redirect not found");
1540
+ return current;
1541
+ },
1542
+ async update(id, input) {
1543
+ assertNoAutomaticRedirectMarker(input);
1544
+ const { _rev, ...patch } = input;
1545
+ const expectedRevision = decodeRedirectRevision(id, _rev);
1546
+ const parsed = updateRedirectBody.safeParse(patch);
1547
+ if (!parsed.success) throw new RedirectAccessError("VALIDATION_ERROR", parsed.error.issues[0]?.message ?? "Invalid redirect");
1548
+ const result = await handleRedirectUpdate(db, id, parsed.data, { expectedRevision });
1549
+ if (!result.success) return throwRedirectResult(result.error);
1550
+ const current = await readVersionedRedirect(repo, result.data.id);
1551
+ if (!current) throw new RedirectAccessError("NOT_FOUND", "Updated redirect not found");
1552
+ return current;
1553
+ },
1554
+ async delete(id, options) {
1555
+ if (typeof options !== "object" || options === null) throw new RedirectAccessError("INVALID_PRECONDITION", "Invalid redirect revision");
1556
+ const result = await handleRedirectDelete(db, id, { expectedRevision: decodeRedirectRevision(id, options._rev) });
1557
+ if (!result.success) return throwRedirectResult(result.error);
1558
+ return result.data.deleted;
1559
+ }
1560
+ };
1561
+ }
1562
+ const MAX_TAXONOMY_DELTA_TERMS = 64;
1563
+ function taxonomyAccessError(code, message) {
1564
+ return Object.assign(new Error(message), { code });
1565
+ }
1566
+ async function resolveTaxonomyDelta(db, collection, entryId, taxonomy, termIds) {
1567
+ if (termIds.length > MAX_TAXONOMY_DELTA_TERMS) throw taxonomyAccessError("VALIDATION_ERROR", `A taxonomy assignment delta can contain at most ${MAX_TAXONOMY_DELTA_TERMS} term IDs`);
1568
+ if (termIds.some((id) => typeof id !== "string" || id.length === 0)) throw taxonomyAccessError("VALIDATION_ERROR", "Taxonomy term IDs must be non-empty strings");
1569
+ const structure = await findTaxonomyStructure(db, taxonomy);
1570
+ if (!structure) throw taxonomyAccessError("NOT_FOUND", `Taxonomy '${taxonomy}' not found`);
1571
+ if (!structure.collections.includes(collection)) throw taxonomyAccessError("VALIDATION_ERROR", `Taxonomy '${taxonomy}' is not attached to collection '${collection}'`);
1572
+ const entry = await new ContentRepository(db).findById(collection, entryId);
1573
+ if (!entry) throw taxonomyAccessError("NOT_FOUND", `Content entry '${entryId}' not found in '${collection}'`);
1574
+ const repo = new TaxonomyRepository(db);
1575
+ const groups = [];
1576
+ for (const id of new Set(termIds)) {
1577
+ const term = await repo.findByIdOrTranslationGroup(id);
1578
+ if (!term) throw taxonomyAccessError("NOT_FOUND", `Taxonomy term '${id}' not found`);
1579
+ if (term.name !== taxonomy) throw taxonomyAccessError("VALIDATION_ERROR", `Taxonomy term '${id}' belongs to '${term.name}', not '${taxonomy}'`);
1580
+ groups.push(term.translationGroup ?? term.id);
1581
+ }
1582
+ return {
1583
+ repo,
1584
+ groups,
1585
+ locale: entry.locale ?? getI18nConfig()?.defaultLocale ?? "en"
1586
+ };
1587
+ }
1588
+ async function readResolvedEntryTerms(repo, collection, entryId, taxonomy, locale) {
1589
+ const defaultLocale = getI18nConfig()?.defaultLocale ?? locale;
1590
+ return (await repo.getTermAssignmentsForEntry(collection, entryId, taxonomy, locale, defaultLocale)).flatMap(({ term }) => term ? [taxonomyToTermInfo(term)] : []);
1591
+ }
1592
+ function createTaxonomyAccessWithWrite(db) {
1593
+ return {
1594
+ ...createTaxonomyAccess(db),
1595
+ async createTerm(taxonomy, input) {
1596
+ const result = await handleTermCreate(db, taxonomy, input);
1597
+ if (!result.success) throw taxonomyAccessError(result.error.code, result.error.message);
1598
+ const { term } = result.data;
1599
+ return {
1600
+ id: term.id,
1601
+ taxonomy: term.name,
1602
+ slug: term.slug,
1603
+ label: term.label,
1604
+ parentId: term.parentId,
1605
+ data: term.description ? { description: term.description } : null,
1606
+ locale: term.locale,
1607
+ translationGroup: term.translationGroup
1608
+ };
1609
+ },
1610
+ async addEntryTerms(collection, entryId, taxonomy, termIds) {
1611
+ const { repo, groups, locale } = await resolveTaxonomyDelta(db, collection, entryId, taxonomy, termIds);
1612
+ await repo.attachGroupsToEntry(collection, entryId, groups);
1613
+ return readResolvedEntryTerms(repo, collection, entryId, taxonomy, locale);
1614
+ },
1615
+ async removeEntryTerms(collection, entryId, taxonomy, termIds) {
1616
+ const { repo, groups, locale } = await resolveTaxonomyDelta(db, collection, entryId, taxonomy, termIds);
1617
+ await repo.detachGroupsFromEntry(collection, entryId, groups);
1618
+ return readResolvedEntryTerms(repo, collection, entryId, taxonomy, locale);
1619
+ }
1620
+ };
1621
+ }
1622
+ async function afterContentWrite(recordWrite) {
1623
+ if (typeof recordWrite === "function") await recordWrite();
1624
+ }
1625
+ /**
1626
+ * Create full content access with write operations.
1627
+ *
1628
+ * `create` and `update` accept a reserved `seo` key in their `data`
1629
+ * argument. When present, it is routed to the core SEO panel
1630
+ * (`_emdash_seo`) via `SeoRepository.upsert`, in the same transaction as
1631
+ * the content write. The returned `ContentItem.seo` reflects the resulting
1632
+ * SEO state for SEO-enabled collections.
1633
+ */
1634
+ function createContentAccessWithWrite(db, beforeContentWrite, accessOptions, contentCreate) {
1635
+ return {
1636
+ ...createContentAccess(db, accessOptions),
1637
+ async create(collection, data, options) {
1638
+ const locale = resolveContentCreateLocale(options?.locale);
1639
+ const recordWrite = await beforeContentWrite?.();
1640
+ if (contentCreate) {
1641
+ const created = await contentCreate({
1642
+ collection,
1643
+ input: data,
1644
+ options: {
1645
+ ...options,
1646
+ locale
1647
+ }
1648
+ });
1649
+ await afterContentWrite(recordWrite);
1650
+ return created;
1651
+ }
1652
+ const { fields, seo } = splitSeoFromInput(data);
1653
+ let contentMutated = false;
1654
+ try {
1655
+ const created = await withTransaction(db, async (trx) => {
1656
+ const trxContentRepo = new ContentRepository(trx);
1657
+ const trxSeoRepo = new SeoRepository(trx);
1658
+ const hasSeo = await assertSeoEnabled(trxSeoRepo, collection, seo);
1659
+ const item = await trxContentRepo.create({
1660
+ type: collection,
1661
+ data: fields,
1662
+ locale,
1663
+ translationOf: options?.translationOf
1664
+ });
1665
+ contentMutated = true;
1666
+ const result = {
1667
+ id: item.id,
1668
+ type: item.type,
1669
+ slug: item.slug,
1670
+ status: item.status,
1671
+ data: item.data,
1672
+ createdAt: item.createdAt,
1673
+ updatedAt: item.updatedAt,
1674
+ locale: item.locale,
1675
+ publishedAt: item.publishedAt,
1676
+ scheduledAt: item.scheduledAt
1677
+ };
1678
+ if (hasSeo) result.seo = seo !== void 0 ? await trxSeoRepo.upsert(collection, item.id, seo) : await trxSeoRepo.get(collection, item.id);
1679
+ return result;
1680
+ });
1681
+ await markContentMediaUsageCollectionStaleSafely(db, collection, "CONTENT_USAGE_STALE");
1682
+ await afterContentWrite(recordWrite);
1683
+ return created;
1684
+ } catch (error) {
1685
+ if (contentMutated) await markContentMediaUsageCollectionStaleSafely(db, collection, "CONTENT_USAGE_STALE");
1686
+ throw error;
1687
+ }
1688
+ },
1689
+ async update(collection, id, data) {
1690
+ const recordWrite = await beforeContentWrite?.();
1691
+ const { fields, seo } = splitSeoFromInput(data);
1692
+ const hasFieldUpdates = Object.keys(fields).length > 0;
1693
+ let contentMutated = false;
1694
+ try {
1695
+ const updated = await withTransaction(db, async (trx) => {
1696
+ const trxContentRepo = new ContentRepository(trx);
1697
+ const trxSeoRepo = new SeoRepository(trx);
1698
+ const hasSeo = await assertSeoEnabled(trxSeoRepo, collection, seo);
1699
+ const item = hasFieldUpdates ? await trxContentRepo.updateDraftAware(collection, id, { data: fields }) : await (async () => {
1700
+ const existing = await trxContentRepo.findById(collection, id);
1701
+ if (!existing) throw new Error("Content not found");
1702
+ return existing;
1703
+ })();
1704
+ if (hasFieldUpdates) contentMutated = true;
1705
+ const result = {
1706
+ id: item.id,
1707
+ type: item.type,
1708
+ slug: item.slug,
1709
+ status: item.status,
1710
+ data: item.data,
1711
+ createdAt: item.createdAt,
1712
+ updatedAt: item.updatedAt,
1713
+ locale: item.locale,
1714
+ publishedAt: item.publishedAt,
1715
+ scheduledAt: item.scheduledAt
1716
+ };
1717
+ if (hasSeo) result.seo = seo !== void 0 ? await trxSeoRepo.upsert(collection, item.id, seo) : await trxSeoRepo.get(collection, item.id);
1718
+ return result;
1719
+ });
1720
+ if (hasFieldUpdates) await markContentMediaUsageCollectionStaleSafely(db, collection, "CONTENT_USAGE_STALE");
1721
+ await afterContentWrite(recordWrite);
1722
+ return updated;
1723
+ } catch (error) {
1724
+ if (contentMutated) await markContentMediaUsageCollectionStaleSafely(db, collection, "CONTENT_USAGE_STALE");
1725
+ throw error;
1726
+ }
1727
+ },
1728
+ async delete(collection, id) {
1729
+ const recordWrite = await beforeContentWrite?.();
1730
+ const deleted = await new ContentRepository(db).delete(collection, id);
1731
+ if (deleted) {
1732
+ await new EntryLockRepository(db).releaseEntry(collection, id);
1733
+ await markContentMediaUsageCollectionStaleSafely(db, collection, "CONTENT_USAGE_STALE");
1734
+ await afterContentWrite(recordWrite);
1735
+ }
1736
+ return deleted;
1737
+ }
1738
+ };
1739
+ }
1740
+ /**
1741
+ * Create read-only media access
1742
+ */
1743
+ function createMediaAccess(db) {
1744
+ const mediaRepo = new MediaRepository(db);
1745
+ return {
1746
+ async get(id) {
1747
+ const item = await mediaRepo.findById(id);
1748
+ return item?.status === "ready" ? toPluginMediaItem(item) : null;
1749
+ },
1750
+ async list(options) {
1751
+ const result = await mediaRepo.findMany({
1752
+ limit: options?.limit ?? 50,
1753
+ cursor: options?.cursor,
1754
+ mimeType: options?.mimeType
1755
+ });
1756
+ return {
1757
+ items: result.items.map(toPluginMediaItem),
1758
+ cursor: result.nextCursor,
1759
+ hasMore: !!result.nextCursor
1760
+ };
1761
+ }
1762
+ };
1763
+ }
1764
+ function mediaReadDenied() {
1765
+ throw new Error("Missing capability: media:read");
1766
+ }
1767
+ function createBlockedMediaReadAccess() {
1768
+ return {
1769
+ get: async () => mediaReadDenied(),
1770
+ list: async () => mediaReadDenied()
1771
+ };
1772
+ }
1773
+ function allowedUploadType(contentType) {
1774
+ if (!CONTENT_TYPE_RE.test(contentType)) throw PluginRouteError.badRequest("Invalid content type");
1775
+ const mimeType = normalizeMime(contentType);
1776
+ if (!matchesMimeAllowlist(mimeType, GLOBAL_UPLOAD_ALLOWLIST)) throw new PluginRouteError("UNSUPPORTED_MEDIA_TYPE", "File type not allowed", 415);
1777
+ return mimeType;
1778
+ }
1779
+ function uploadStorageKey(filename, mimeType) {
1780
+ const keyPrefix = ulid();
1781
+ const basename = filename.split("/").pop() ?? filename;
1782
+ const dotIdx = basename.lastIndexOf(".");
1783
+ const nameExt = dotIdx > 0 ? basename.slice(dotIdx + 1).toLowerCase() : "";
1784
+ const nameType = mime.getType(nameExt);
1785
+ const nameExtAllowed = nameType !== null && matchesMimeAllowlist(nameType, GLOBAL_UPLOAD_ALLOWLIST);
1786
+ const ext = nameType === mimeType ? nameExt : mime.getExtension(mimeType) ?? (nameExtAllowed ? nameExt : null);
1787
+ return {
1788
+ basename,
1789
+ storageKey: ext ? `${keyPrefix}.${ext}` : keyPrefix
1790
+ };
1791
+ }
1792
+ /**
1793
+ * Create full media access with write operations.
1794
+ *
1795
+ * `getUploadUrlFn` is optional: when omitted, `getUploadUrl()` is derived from
1796
+ * `storage` (create a pending record + a signed PUT URL), mirroring the REST
1797
+ * `/_emdash/api/media/upload-url` endpoint. `upload()` only needs `storage`.
1798
+ * If storage is not provided, both throw at call time.
1799
+ */
1800
+ function createMediaAccessWithWrite(db, getUploadUrlFn, storage, imagePlaceholders = true) {
1801
+ const mediaRepo = new MediaRepository(db);
1802
+ const readAccess = createMediaAccess(db);
1803
+ const getUploadUrl = getUploadUrlFn ? async (filename, contentType) => getUploadUrlFn(filename, allowedUploadType(contentType)) : async (filename, contentType) => {
1804
+ if (!storage) throw new Error("Media getUploadUrl() requires a storage backend. Configure storage in PluginContextFactoryOptions.");
1805
+ const mimeType = allowedUploadType(contentType);
1806
+ const { basename, storageKey } = uploadStorageKey(filename, mimeType);
1807
+ const media = await mediaRepo.createPending({
1808
+ filename: basename,
1809
+ mimeType,
1810
+ storageKey
1811
+ });
1812
+ return {
1813
+ uploadUrl: (await storage.getSignedUploadUrl({
1814
+ key: storageKey,
1815
+ contentType: mimeType,
1816
+ expiresIn: 3600
1817
+ })).url,
1818
+ mediaId: media.id
1819
+ };
1820
+ };
1821
+ return {
1822
+ ...readAccess,
1823
+ getUploadUrl,
1824
+ async upload(filename, contentType, bytes) {
1825
+ if (!storage) throw new Error("Media upload() requires a storage backend. Configure storage in PluginContextFactoryOptions.");
1826
+ const mimeType = allowedUploadType(contentType);
1827
+ const { basename, storageKey } = uploadStorageKey(filename, mimeType);
1828
+ await storage.upload({
1829
+ key: storageKey,
1830
+ body: new Uint8Array(bytes),
1831
+ contentType: mimeType
1832
+ });
1833
+ const enriched = await enrichImageMetadata(new Uint8Array(bytes), mimeType, { placeholders: imagePlaceholders });
1834
+ let media;
1835
+ try {
1836
+ media = await mediaRepo.create({
1837
+ filename: basename,
1838
+ mimeType,
1839
+ size: bytes.byteLength,
1840
+ storageKey,
1841
+ status: "ready",
1842
+ width: enriched.width,
1843
+ height: enriched.height,
1844
+ blurhash: enriched.blurhash,
1845
+ dominantColor: enriched.dominantColor
1846
+ });
1847
+ } catch (error) {
1848
+ try {
1849
+ await storage.delete(storageKey);
1850
+ } catch {}
1851
+ throw error;
1852
+ }
1853
+ return {
1854
+ mediaId: media.id,
1855
+ storageKey,
1856
+ url: `/_emdash/api/media/file/${storageKey}`
1857
+ };
1858
+ },
1859
+ async delete(id) {
1860
+ const result = await handleMediaDelete(db, id, storage);
1861
+ if (!result.success) {
1862
+ if (result.error.code === "NOT_FOUND") return false;
1863
+ throw new Error(result.error.message);
1864
+ }
1865
+ invalidateSiteSettingsCache();
1866
+ return true;
1867
+ }
1868
+ };
1869
+ }
1870
+ /** Maximum number of redirects to follow in plugin HTTP access */
1871
+ const MAX_PLUGIN_REDIRECTS = 5;
1872
+ function stripTrailingDots(value) {
1873
+ let end = value.length;
1874
+ while (end > 0 && value.charCodeAt(end - 1) === 46) end--;
1875
+ return end === value.length ? value : value.slice(0, end);
1876
+ }
1877
+ /**
1878
+ * Check if a hostname matches any pattern in the allowed list.
1879
+ * Patterns: "*" matches all, "*.example.com" matches subdomains AND bare "example.com",
1880
+ * "api.example.com" matches exactly.
1881
+ */
1882
+ function isHostAllowed(host, allowedHosts) {
1883
+ const normalizedHost = stripTrailingDots(host.toLowerCase());
1884
+ return allowedHosts.some((pattern) => {
1885
+ const normalizedPattern = stripTrailingDots(pattern.toLowerCase());
1886
+ if (normalizedPattern === "*") return true;
1887
+ if (normalizedPattern.startsWith("*.")) {
1888
+ const suffix = normalizedPattern.slice(1);
1889
+ return normalizedHost.endsWith(suffix) || normalizedHost === normalizedPattern.slice(2);
1890
+ }
1891
+ return normalizedHost === normalizedPattern;
1892
+ });
1893
+ }
1894
+ function tryParsePluginHttpTarget(url) {
1895
+ try {
1896
+ return new URL(url);
1897
+ } catch {
1898
+ return null;
1899
+ }
1900
+ }
1901
+ async function validatePluginHttpTarget(pluginId, url) {
1902
+ try {
1903
+ return await resolveAndValidateExternalUrl(url);
1904
+ } catch (error) {
1905
+ const message = error instanceof SsrfError ? error.message : "SSRF validation failed";
1906
+ const target = tryParsePluginHttpTarget(url);
1907
+ throw new Error(`Plugin "${pluginId}": blocked fetch to "${target ? target.hostname : "invalid URL"}": ${message}`, { cause: error });
1908
+ }
1909
+ }
1910
+ /**
1911
+ * Create HTTP access with host validation and SSRF protection.
1912
+ *
1913
+ * Uses redirect: "manual" to re-validate each redirect target before dispatch.
1914
+ */
1915
+ function createHttpAccess(pluginId, allowedHosts, fetchImpl = globalThis.fetch) {
1916
+ return { async fetch(url, init) {
1917
+ if (allowedHosts.length === 0) throw new Error(`Plugin "${pluginId}" has no allowed hosts configured. Add hosts to the plugin's allowedHosts array to enable HTTP requests.`);
1918
+ let currentUrl = url;
1919
+ let currentInit = init;
1920
+ let requestBuffered = false;
1921
+ let redirected = false;
1922
+ for (let i = 0; i <= MAX_PLUGIN_REDIRECTS; i++) {
1923
+ const target = tryParsePluginHttpTarget(currentUrl);
1924
+ if (target && !isHostAllowed(target.hostname, allowedHosts)) throw new Error(`Plugin "${pluginId}" is not allowed to fetch from host "${target.hostname}". Allowed hosts: ${allowedHosts.join(", ")}`);
1925
+ await validatePluginHttpTarget(pluginId, currentUrl);
1926
+ if (!requestBuffered) {
1927
+ currentInit = await bufferPluginHttpRequest(currentInit);
1928
+ requestBuffered = true;
1929
+ }
1930
+ const response = await fetchImpl(currentUrl, {
1931
+ ...currentInit,
1932
+ redirect: "manual"
1933
+ });
1934
+ const location = response.headers.get("Location");
1935
+ if (location === null) return pluginHttpResponseFromWire(await pluginHttpResponseToWire(response, currentUrl, redirected));
1936
+ const redirectAction = pluginHttpRedirectAction(response.status, true, currentInit);
1937
+ if (redirectAction === "return") return pluginHttpResponseFromWire(await pluginHttpResponseToWire(response, currentUrl, redirected));
1938
+ await response.body?.cancel();
1939
+ if (redirectAction === "error") throw new Error(`Plugin "${pluginId}": redirect mode is "error"`);
1940
+ const previousOrigin = new URL(currentUrl).origin;
1941
+ currentUrl = new URL(location, currentUrl).href;
1942
+ redirected = true;
1943
+ const nextOrigin = new URL(currentUrl).origin;
1944
+ currentInit = rewritePluginHttpRedirect(response.status, currentInit);
1945
+ if (previousOrigin !== nextOrigin && currentInit) currentInit = stripCredentialHeaders(currentInit);
1946
+ }
1947
+ throw new Error(`Plugin "${pluginId}": too many redirects (max ${MAX_PLUGIN_REDIRECTS})`);
1948
+ } };
1949
+ }
1950
+ /**
1951
+ * Create unrestricted HTTP access (for plugins with network:request:unrestricted capability).
1952
+ * No host validation, but applies SSRF protection on redirect targets to
1953
+ * prevent plugins from being tricked into reaching internal services.
1954
+ */
1955
+ function createUnrestrictedHttpAccess(pluginId, fetchImpl = globalThis.fetch) {
1956
+ return { async fetch(url, init) {
1957
+ let currentUrl = url;
1958
+ let currentInit = init;
1959
+ let requestBuffered = false;
1960
+ let redirected = false;
1961
+ for (let i = 0; i <= MAX_PLUGIN_REDIRECTS; i++) {
1962
+ await validatePluginHttpTarget(pluginId, currentUrl);
1963
+ if (!requestBuffered) {
1964
+ currentInit = await bufferPluginHttpRequest(currentInit);
1965
+ requestBuffered = true;
1966
+ }
1967
+ const response = await fetchImpl(currentUrl, {
1968
+ ...currentInit,
1969
+ redirect: "manual"
1970
+ });
1971
+ const location = response.headers.get("Location");
1972
+ if (location === null) return pluginHttpResponseFromWire(await pluginHttpResponseToWire(response, currentUrl, redirected));
1973
+ const redirectAction = pluginHttpRedirectAction(response.status, true, currentInit);
1974
+ if (redirectAction === "return") return pluginHttpResponseFromWire(await pluginHttpResponseToWire(response, currentUrl, redirected));
1975
+ await response.body?.cancel();
1976
+ if (redirectAction === "error") throw new Error(`Plugin "${pluginId}": redirect mode is "error"`);
1977
+ const previousOrigin = new URL(currentUrl).origin;
1978
+ currentUrl = new URL(location, currentUrl).href;
1979
+ redirected = true;
1980
+ const nextOrigin = new URL(currentUrl).origin;
1981
+ currentInit = rewritePluginHttpRedirect(response.status, currentInit);
1982
+ if (previousOrigin !== nextOrigin && currentInit) currentInit = stripCredentialHeaders(currentInit);
1983
+ }
1984
+ throw new Error(`Plugin "${pluginId}": too many redirects (max ${MAX_PLUGIN_REDIRECTS})`);
1985
+ } };
1986
+ }
1987
+ /**
1988
+ * Create logger for a plugin
1989
+ */
1990
+ function createLogAccess(pluginId, redactor) {
1991
+ const prefix = `[plugin:${pluginId}]`;
1992
+ const redact = (value) => redactor?.redact(value) ?? value;
1993
+ return {
1994
+ debug(message, data) {
1995
+ if (data !== void 0) console.debug(prefix, redact(message), redact(data));
1996
+ else console.debug(prefix, redact(message));
1997
+ },
1998
+ info(message, data) {
1999
+ if (data !== void 0) console.info(prefix, redact(message), redact(data));
2000
+ else console.info(prefix, redact(message));
2001
+ },
2002
+ warn(message, data) {
2003
+ if (data !== void 0) console.warn(prefix, redact(message), redact(data));
2004
+ else console.warn(prefix, redact(message));
2005
+ },
2006
+ error(message, data) {
2007
+ if (data !== void 0) console.error(prefix, redact(message), redact(data));
2008
+ else console.error(prefix, redact(message));
2009
+ }
2010
+ };
2011
+ }
2012
+ const TRAILING_SLASH_RE = /\/$/;
2013
+ /**
2014
+ * Create site info from config and settings. A missing URL becomes an
2015
+ * empty string.
2016
+ */
2017
+ function createSiteInfo(options) {
2018
+ return {
2019
+ name: options.siteName ?? "",
2020
+ url: (options.siteUrl ?? "").replace(TRAILING_SLASH_RE, ""),
2021
+ locale: options.locale ?? "en",
2022
+ trailingSlash: options.trailingSlash ?? "ignore"
2023
+ };
2024
+ }
2025
+ /**
2026
+ * Create a URL helper that generates absolute URLs from relative paths.
2027
+ * Validates that path starts with "/" and rejects protocol-relative paths ("//").
2028
+ */
2029
+ function createUrlHelper(siteUrl) {
2030
+ const base = siteUrl.replace(TRAILING_SLASH_RE, "");
2031
+ return (path) => {
2032
+ if (!path.startsWith("/")) throw new Error(`URL path must start with "/", got: "${path}"`);
2033
+ if (path.startsWith("//")) throw new Error(`URL path must not be protocol-relative, got: "${path}"`);
2034
+ return `${base}${path}`;
2035
+ };
2036
+ }
2037
+ /**
2038
+ * Convert a UserRepository user to the plugin-facing UserInfo shape.
2039
+ * Strips sensitive fields (avatarUrl, emailVerified, data).
2040
+ */
2041
+ function toUserInfo(user) {
2042
+ return {
2043
+ id: user.id,
2044
+ email: user.email,
2045
+ name: user.name,
2046
+ role: user.role,
2047
+ createdAt: user.createdAt
2048
+ };
2049
+ }
2050
+ /**
2051
+ * Create read-only user access for plugins.
2052
+ * Excludes sensitive fields (password hashes, sessions, passkeys, avatar URL, data).
2053
+ */
2054
+ function createUserAccess(db) {
2055
+ const userRepo = new UserRepository(db);
2056
+ return {
2057
+ async get(id) {
2058
+ const user = await userRepo.findById(id);
2059
+ if (!user) return null;
2060
+ return toUserInfo(user);
2061
+ },
2062
+ async getByEmail(email) {
2063
+ const user = await userRepo.findByEmail(email);
2064
+ if (!user) return null;
2065
+ return toUserInfo(user);
2066
+ },
2067
+ async list(opts) {
2068
+ const result = await userRepo.findMany({
2069
+ role: opts?.role,
2070
+ cursor: opts?.cursor,
2071
+ limit: opts?.limit
2072
+ });
2073
+ return {
2074
+ items: result.items.map(toUserInfo),
2075
+ nextCursor: result.nextCursor
2076
+ };
2077
+ }
2078
+ };
2079
+ }
2080
+ /**
2081
+ * Factory for creating plugin contexts
2082
+ */
2083
+ var PluginContextFactory = class {
2084
+ resolveDb;
2085
+ beforeContentWrite;
2086
+ contentCreate;
2087
+ contentActions;
2088
+ storage;
2089
+ getUploadUrl;
2090
+ site;
2091
+ urlHelper;
2092
+ cronReschedule;
2093
+ now;
2094
+ emailPipeline;
2095
+ commentModerate;
2096
+ imagePlaceholders;
2097
+ /**
2098
+ * Plugin IDs already warned about a missing media-write backend, so the
2099
+ * warning fires once per factory instead of on every hook/route context
2100
+ * creation (which would spam logs for hook-participating plugins).
2101
+ */
2102
+ warnedMissingMediaBackend = /* @__PURE__ */ new Set();
2103
+ constructor(options) {
2104
+ const fixedDb = options.db;
2105
+ this.resolveDb = options.getDb ?? (() => fixedDb);
2106
+ this.beforeContentWrite = options.beforeContentWrite;
2107
+ this.contentCreate = options.contentCreate;
2108
+ this.contentActions = options.contentActions;
2109
+ this.storage = options.storage;
2110
+ this.getUploadUrl = options.getUploadUrl;
2111
+ this.site = createSiteInfo(options.siteInfo ?? {});
2112
+ this.urlHelper = createUrlHelper(this.site.url);
2113
+ this.cronReschedule = options.cronReschedule;
2114
+ this.now = options.now ?? (() => /* @__PURE__ */ new Date());
2115
+ this.emailPipeline = options.emailPipeline;
2116
+ this.commentModerate = options.commentModerate;
2117
+ this.imagePlaceholders = options.imagePlaceholders ?? true;
2118
+ }
2119
+ /**
2120
+ * Create the unified plugin context
2121
+ */
2122
+ createContext(plugin) {
2123
+ const capabilities = new Set(plugin.capabilities);
2124
+ const db = this.resolveDb();
2125
+ const optionsRepo = new OptionsRepository(db);
2126
+ const secretRedactor = createPluginSecretRedactor();
2127
+ const settings = createSettingsAccess(optionsRepo, plugin.id, plugin.admin.settingsSchema ?? {}, void 0, secretRedactor.add);
2128
+ const kv = createKVAccess(optionsRepo, plugin.id, settings);
2129
+ const log = createLogAccess(plugin.id, secretRedactor);
2130
+ const storage = createStorageAccess(db, plugin.id, plugin.storage);
2131
+ let content;
2132
+ if (capabilities.has("content:write")) content = createContentAccessWithWrite(db, this.beforeContentWrite, {
2133
+ site: this.site,
2134
+ revisions: capabilities.has("content:revisions:read")
2135
+ }, this.contentCreate ? (input) => this.contentCreate(plugin.id, input.collection, input.input, input.options) : void 0);
2136
+ else if (capabilities.has("content:read")) content = createContentAccess(db, {
2137
+ site: this.site,
2138
+ revisions: capabilities.has("content:revisions:read")
2139
+ });
2140
+ if (capabilities.has("content:publish") && this.contentActions) content = Object.assign(content ?? createContentAccess(db), {
2141
+ getVersioned: (collection, id) => this.contentActions.getVersioned(plugin.id, collection, id),
2142
+ publish: (collection, id, options) => this.contentActions.publish(plugin.id, collection, id, options),
2143
+ unpublish: (collection, id, options) => this.contentActions.unpublish(plugin.id, collection, id, options),
2144
+ schedule: (collection, id, options) => this.contentActions.schedule(plugin.id, collection, id, options),
2145
+ unschedule: (collection, id, options) => this.contentActions.unschedule(plugin.id, collection, id, options)
2146
+ });
2147
+ if (capabilities.has("content:restore") && this.contentActions) content = Object.assign(content ?? {
2148
+ get: async () => {
2149
+ throw new Error("Missing capability: content:read");
2150
+ },
2151
+ list: async () => {
2152
+ throw new Error("Missing capability: content:read");
2153
+ }
2154
+ }, {
2155
+ getTrashedVersioned: (collection, id) => this.contentActions.getTrashedVersioned(plugin.id, collection, id),
2156
+ restore: (collection, id, options) => this.contentActions.restore(plugin.id, collection, id, options)
2157
+ });
2158
+ const schema = capabilities.has("schema:read") ? createSchemaAccess(db) : void 0;
2159
+ let taxonomies;
2160
+ if (capabilities.has("taxonomies:write")) taxonomies = createTaxonomyAccessWithWrite(db);
2161
+ else if (capabilities.has("taxonomies:read")) taxonomies = createTaxonomyAccess(db);
2162
+ const bylines = capabilities.has("bylines:read") ? createBylineAccess(db) : void 0;
2163
+ let redirects;
2164
+ if (capabilities.has("redirects:write")) redirects = createRedirectAccess(db, true);
2165
+ else if (capabilities.has("redirects:read")) redirects = createRedirectAccess(db);
2166
+ let media;
2167
+ if (capabilities.has("media:read") || capabilities.has("media:write") || capabilities.has("media:bytes:read") || capabilities.has("media:metadata:write")) media = capabilities.has("media:read") || capabilities.has("media:write") ? createMediaAccess(db) : createBlockedMediaReadAccess();
2168
+ if (capabilities.has("media:write")) if (this.getUploadUrl || this.storage) media = createMediaAccessWithWrite(db, this.getUploadUrl, this.storage, this.imagePlaceholders);
2169
+ else {
2170
+ if (!this.warnedMissingMediaBackend.has(plugin.id)) {
2171
+ this.warnedMissingMediaBackend.add(plugin.id);
2172
+ log.warn("declares the media:write capability but no storage backend is configured; upload() is unavailable.");
2173
+ }
2174
+ media ??= createMediaAccess(db);
2175
+ }
2176
+ if (capabilities.has("media:bytes:read") && media) media.readBytes = (id, options) => readPluginMediaBytes(db, this.storage, id, options);
2177
+ if (capabilities.has("media:metadata:write") && media) media.updateMetadata = (id, patch) => updatePluginMediaMetadata(db, id, patch);
2178
+ let http;
2179
+ if (capabilities.has("network:request:unrestricted")) http = createUnrestrictedHttpAccess(plugin.id);
2180
+ else if (capabilities.has("network:request")) http = createHttpAccess(plugin.id, plugin.allowedHosts);
2181
+ let users;
2182
+ if (capabilities.has("users:read")) users = createUserAccess(db);
2183
+ let comments;
2184
+ if (capabilities.has("comments:moderate")) comments = createCommentAccess(db, (id, status, expectedStatus) => {
2185
+ if (!this.commentModerate) throw new Error("Comment moderation is unavailable");
2186
+ return this.commentModerate(plugin.id, id, status, expectedStatus);
2187
+ });
2188
+ else if (capabilities.has("comments:read")) comments = createCommentAccess(db);
2189
+ let cron;
2190
+ if (this.cronReschedule) cron = new CronAccessImpl(db, plugin.id, this.cronReschedule, this.now);
2191
+ let email;
2192
+ if (capabilities.has("email:send") && this.emailPipeline?.isAvailable()) {
2193
+ const pipeline = this.emailPipeline;
2194
+ const pluginId = plugin.id;
2195
+ email = { send: (message) => pipeline.send(message, pluginId) };
2196
+ }
2197
+ return {
2198
+ plugin: {
2199
+ id: plugin.id,
2200
+ version: plugin.version
2201
+ },
2202
+ storage,
2203
+ kv,
2204
+ settings,
2205
+ content,
2206
+ schema,
2207
+ taxonomies,
2208
+ bylines,
2209
+ redirects,
2210
+ media,
2211
+ http,
2212
+ log,
2213
+ site: this.site,
2214
+ url: this.urlHelper,
2215
+ users,
2216
+ comments,
2217
+ cron,
2218
+ email
2219
+ };
2220
+ }
2221
+ };
2222
+
2223
+ //#endregion
2224
+ export { createBylineAccess as C, StorageSerializationError as D, PluginStorageRepository as E, createContentAccess as S, SeoRepository as T, MAX_PLUGIN_MEDIA_READ_BYTES as _, createHttpAccess as a, toPluginMediaItem as b, createRedirectAccess as c, createStorageAccess as d, createTaxonomyAccessWithWrite as f, DEFAULT_PLUGIN_MEDIA_READ_BYTES as g, isPluginRouteError as h, createContentAccessWithWrite as i, createSchemaAccess as l, PluginRouteError as m, RedirectAccessError as n, createKVAccess as o, createUnrestrictedHttpAccess as p, createCommentAccess as r, createMediaAccess as s, PluginContextFactory as t, createSiteInfo as u, parsePluginMediaMetadataPatch as v, toBylineInfo as w, updatePluginMediaMetadata as x, readPluginMediaBytes as y };
2225
+ //# sourceMappingURL=context-C3OZjexd.mjs.map