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