emdash 0.31.1 → 0.33.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 (746) hide show
  1. package/dist/{adapters-C0ONzkUP.d.mts → adapters-BMyNSSZi.d.mts} +9 -1
  2. package/dist/adapters-BMyNSSZi.d.mts.map +1 -0
  3. package/dist/after-CBU2vkoO.mjs +96 -0
  4. package/dist/after-CBU2vkoO.mjs.map +1 -0
  5. package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-CG1pACtS.mjs} +2 -2
  6. package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-CG1pACtS.mjs.map} +1 -1
  7. package/dist/api/route-utils.d.mts +3 -4
  8. package/dist/api/route-utils.d.mts.map +1 -1
  9. package/dist/api/route-utils.mjs +23 -21
  10. package/dist/api/route-utils.mjs.map +1 -1
  11. package/dist/api/schemas/index.d.mts +2 -2
  12. package/dist/api/schemas/index.mjs +5 -5
  13. package/dist/{api-BkqFzIu4.mjs → api-D2hunekQ.mjs} +254 -48
  14. package/dist/api-D2hunekQ.mjs.map +1 -0
  15. package/dist/{api-tokens-uPt8UDpx.mjs → api-tokens-CSND0i1z.mjs} +2 -2
  16. package/dist/{api-tokens-uPt8UDpx.mjs.map → api-tokens-CSND0i1z.mjs.map} +1 -1
  17. package/dist/{apply-DuXsqll7.mjs → apply-kwNEJW2l.mjs} +36 -23
  18. package/dist/apply-kwNEJW2l.mjs.map +1 -0
  19. package/dist/astro/index.d.mts +12 -12
  20. package/dist/astro/index.mjs +17 -3
  21. package/dist/astro/index.mjs.map +1 -1
  22. package/dist/astro/middleware/auth.d.mts +10 -10
  23. package/dist/astro/middleware/auth.mjs +8 -8
  24. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  25. package/dist/astro/middleware/redirect.mjs +8 -8
  26. package/dist/astro/middleware/redirect.mjs.map +1 -1
  27. package/dist/astro/middleware/request-context.mjs +4 -4
  28. package/dist/astro/middleware/setup.mjs +1 -1
  29. package/dist/astro/middleware.d.mts +10 -10
  30. package/dist/astro/middleware.d.mts.map +1 -1
  31. package/dist/astro/middleware.mjs +370 -171
  32. package/dist/astro/middleware.mjs.map +1 -1
  33. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
  34. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
  35. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  36. package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
  37. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -5
  38. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -10
  39. package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -10
  40. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -10
  41. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +19 -18
  42. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
  43. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +19 -18
  44. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  45. package/dist/astro/routes/api/admin/bylines/index.mjs +19 -19
  46. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +16 -16
  47. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  48. package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -7
  49. package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -12
  50. package/dist/astro/routes/api/admin/comments/counts.mjs +7 -7
  51. package/dist/astro/routes/api/admin/comments/index.mjs +12 -12
  52. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
  53. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
  54. package/dist/astro/routes/api/admin/media-usage/repair.mjs +13 -11
  55. package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
  57. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
  58. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +47 -44
  59. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  60. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +47 -44
  61. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  62. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +46 -43
  63. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  64. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +5 -5
  65. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +46 -43
  66. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  67. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +46 -43
  68. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  69. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +46 -43
  70. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  71. package/dist/astro/routes/api/admin/plugins/index.mjs +46 -43
  72. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  73. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
  74. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -43
  75. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  76. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +46 -43
  77. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  78. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -43
  79. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  80. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +46 -43
  81. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  82. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +47 -44
  83. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  84. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +46 -43
  85. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +47 -44
  87. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -43
  89. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -43
  91. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
  93. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -43
  94. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  96. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  97. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -8
  98. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
  99. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
  100. package/dist/astro/routes/api/admin/users/index.mjs +7 -7
  101. package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -6
  102. package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
  103. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  104. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
  105. package/dist/astro/routes/api/auth/invite/index.mjs +10 -10
  106. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
  107. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
  108. package/dist/astro/routes/api/auth/logout.mjs +3 -3
  109. package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -12
  110. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
  111. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  112. package/dist/astro/routes/api/auth/me.mjs +8 -8
  113. package/dist/astro/routes/api/auth/mode.mjs +3 -3
  114. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
  115. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  116. package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
  117. package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
  118. package/dist/astro/routes/api/auth/passkey/options.mjs +13 -13
  119. package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
  120. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
  121. package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
  122. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
  123. package/dist/astro/routes/api/auth/signup/request.mjs +12 -12
  124. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
  125. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  126. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +18 -18
  127. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  128. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +15 -15
  129. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
  130. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
  131. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
  132. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
  133. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +14 -14
  134. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -9
  135. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +19 -17
  136. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
  137. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +19 -17
  138. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
  139. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
  140. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
  141. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +9 -9
  142. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -16
  143. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  144. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
  145. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
  146. package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
  147. package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -10
  148. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  149. package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
  150. package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
  151. package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
  152. package/dist/astro/routes/api/dashboard.mjs +9 -9
  153. package/dist/astro/routes/api/dev/emails.mjs +3 -3
  154. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  155. package/dist/astro/routes/api/import/probe.mjs +19 -19
  156. package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
  157. package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
  158. package/dist/astro/routes/api/import/wordpress/execute.mjs +16 -15
  159. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  160. package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
  161. package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
  162. package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -11
  163. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
  164. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +13 -11
  165. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
  166. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  167. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -19
  168. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
  169. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +28 -27
  170. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  171. package/dist/astro/routes/api/manifest.mjs +5 -5
  172. package/dist/astro/routes/api/mcp.mjs +42 -42
  173. package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -1
  174. package/dist/astro/routes/api/media/_id_/confirm.mjs +106 -37
  175. package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
  176. package/dist/astro/routes/api/media/_id_/upload.d.mts +8 -0
  177. package/dist/astro/routes/api/media/_id_/upload.d.mts.map +1 -0
  178. package/dist/astro/routes/api/media/_id_/upload.mjs +168 -0
  179. package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -0
  180. package/dist/astro/routes/api/media/_id_/usage.mjs +15 -13
  181. package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
  182. package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
  183. package/dist/astro/routes/api/media/_id_.mjs +22 -15
  184. package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
  185. package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
  186. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
  187. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
  188. package/dist/astro/routes/api/media/providers/index.mjs +3 -3
  189. package/dist/astro/routes/api/media/upload-url.d.mts.map +1 -1
  190. package/dist/astro/routes/api/media/upload-url.mjs +35 -24
  191. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  192. package/dist/astro/routes/api/media.mjs +14 -13
  193. package/dist/astro/routes/api/media.mjs.map +1 -1
  194. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +12 -11
  195. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  196. package/dist/astro/routes/api/menus/_name_/items.mjs +12 -11
  197. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  198. package/dist/astro/routes/api/menus/_name_/reorder.mjs +12 -11
  199. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  200. package/dist/astro/routes/api/menus/_name_/translations.mjs +12 -11
  201. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  202. package/dist/astro/routes/api/menus/_name_.mjs +12 -11
  203. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  204. package/dist/astro/routes/api/menus/index.mjs +12 -11
  205. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  206. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  207. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  208. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  209. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  210. package/dist/astro/routes/api/oauth/register.mjs +3 -3
  211. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  212. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  213. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  214. package/dist/astro/routes/api/openapi.json.mjs +62 -9
  215. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  216. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
  217. package/dist/astro/routes/api/redirects/404s/index.mjs +12 -12
  218. package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -12
  219. package/dist/astro/routes/api/redirects/_id_.mjs +14 -13
  220. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  221. package/dist/astro/routes/api/redirects/index.mjs +14 -13
  222. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  223. package/dist/astro/routes/api/relations/_id_/index.mjs +19 -17
  224. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
  225. package/dist/astro/routes/api/relations/_id_/translations.mjs +14 -12
  226. package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
  227. package/dist/astro/routes/api/relations/index.mjs +19 -17
  228. package/dist/astro/routes/api/relations/index.mjs.map +1 -1
  229. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
  230. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
  231. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +46 -43
  232. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  233. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +46 -43
  234. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  235. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +46 -43
  236. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  237. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +46 -43
  238. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  239. package/dist/astro/routes/api/schema/collections/index.mjs +46 -43
  240. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  241. package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
  242. package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
  243. package/dist/astro/routes/api/schema/collections/reorder.mjs +66 -0
  244. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
  245. package/dist/astro/routes/api/schema/index.mjs +12 -8
  246. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  247. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -43
  248. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  249. package/dist/astro/routes/api/schema/orphans/index.mjs +46 -43
  250. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  251. package/dist/astro/routes/api/search/enable.d.mts +1 -0
  252. package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
  253. package/dist/astro/routes/api/search/enable.mjs +18 -13
  254. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  255. package/dist/astro/routes/api/search/index.mjs +12 -11
  256. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  257. package/dist/astro/routes/api/search/rebuild.mjs +14 -13
  258. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  259. package/dist/astro/routes/api/search/stats.mjs +8 -7
  260. package/dist/astro/routes/api/search/stats.mjs.map +1 -1
  261. package/dist/astro/routes/api/search/suggest.mjs +12 -11
  262. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  263. package/dist/astro/routes/api/sections/_slug_.mjs +11 -11
  264. package/dist/astro/routes/api/sections/index.mjs +11 -11
  265. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
  266. package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -6
  267. package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
  268. package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
  269. package/dist/astro/routes/api/settings/email.mjs +5 -5
  270. package/dist/astro/routes/api/settings.mjs +16 -16
  271. package/dist/astro/routes/api/setup/admin-verify.mjs +13 -13
  272. package/dist/astro/routes/api/setup/admin.mjs +12 -12
  273. package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -29
  274. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  275. package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
  276. package/dist/astro/routes/api/setup/index.mjs +33 -31
  277. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  278. package/dist/astro/routes/api/setup/status.mjs +4 -4
  279. package/dist/astro/routes/api/snapshot.mjs +9 -9
  280. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
  281. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
  282. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +43 -0
  283. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
  284. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +17 -16
  285. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  286. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +17 -16
  287. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  288. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
  289. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -18
  290. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  291. package/dist/astro/routes/api/taxonomies/index.mjs +17 -16
  292. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  293. package/dist/astro/routes/api/themes/preview.mjs +7 -7
  294. package/dist/astro/routes/api/typegen.mjs +5 -5
  295. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  296. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  297. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  298. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +8 -8
  299. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -11
  300. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -11
  301. package/dist/astro/routes/api/widget-areas/_name_.mjs +6 -6
  302. package/dist/astro/routes/api/widget-areas/index.mjs +11 -11
  303. package/dist/astro/routes/api/widget-components.mjs +3 -3
  304. package/dist/astro/routes/robots.txt.mjs +9 -9
  305. package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -13
  306. package/dist/astro/routes/sitemap.xml.mjs +10 -10
  307. package/dist/astro/types.d.mts +20 -13
  308. package/dist/astro/types.d.mts.map +1 -1
  309. package/dist/auth/providers/github.d.mts +1 -1
  310. package/dist/auth/providers/google.d.mts +1 -1
  311. package/dist/{authorize-6WPZa1xZ.mjs → authorize-qRhWQnel.mjs} +2 -2
  312. package/dist/{authorize-6WPZa1xZ.mjs.map → authorize-qRhWQnel.mjs.map} +1 -1
  313. package/dist/{backup-DoW-H0r4.mjs → backup-CtA6LDNw.mjs} +5 -5
  314. package/dist/{backup-DoW-H0r4.mjs.map → backup-CtA6LDNw.mjs.map} +1 -1
  315. package/dist/{byline-BTOxUlFF.mjs → byline-Cp6csL84.mjs} +9 -9
  316. package/dist/{byline-BTOxUlFF.mjs.map → byline-Cp6csL84.mjs.map} +1 -1
  317. package/dist/{byline-fields-CdU_LTF1.mjs → byline-fields-CNc0Yq5i.mjs} +2 -2
  318. package/dist/{byline-fields-CdU_LTF1.mjs.map → byline-fields-CNc0Yq5i.mjs.map} +1 -1
  319. package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-ZkPKqEwC.mjs} +4 -4
  320. package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-ZkPKqEwC.mjs.map} +1 -1
  321. package/dist/{bylines-Bc-3xtpz.mjs → bylines-CEj5CdT4.mjs} +7 -7
  322. package/dist/{bylines-Bc-3xtpz.mjs.map → bylines-CEj5CdT4.mjs.map} +1 -1
  323. package/dist/{bylines-oVN0iPwX.mjs → bylines-cf-C9lmF.mjs} +5 -5
  324. package/dist/{bylines-oVN0iPwX.mjs.map → bylines-cf-C9lmF.mjs.map} +1 -1
  325. package/dist/cache-C9FptTFR.mjs +108 -0
  326. package/dist/cache-C9FptTFR.mjs.map +1 -0
  327. package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-D9VNKELo.mjs} +1 -1
  328. package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-D9VNKELo.mjs.map} +1 -1
  329. package/dist/{chunks-Bq-5DPrD.mjs → chunks-DbYzib_k.mjs} +2 -2
  330. package/dist/{chunks-Bq-5DPrD.mjs.map → chunks-DbYzib_k.mjs.map} +1 -1
  331. package/dist/cli/index.mjs +41 -32
  332. package/dist/cli/index.mjs.map +1 -1
  333. package/dist/client/cf-access.d.mts +1 -1
  334. package/dist/client/index.d.mts +1 -1
  335. package/dist/client/index.mjs +2 -2
  336. package/dist/{comment-B9cUud8H.mjs → comment-BIkJ6Fil.mjs} +3 -3
  337. package/dist/{comment-B9cUud8H.mjs.map → comment-BIkJ6Fil.mjs.map} +1 -1
  338. package/dist/{comment-reaction-VUXO981F.mjs → comment-reaction-D-laEceb.mjs} +2 -2
  339. package/dist/{comment-reaction-VUXO981F.mjs.map → comment-reaction-D-laEceb.mjs.map} +1 -1
  340. package/dist/{comments-PXj1E9Si.mjs → comments-0_w6KChA.mjs} +3 -3
  341. package/dist/{comments-PXj1E9Si.mjs.map → comments-0_w6KChA.mjs.map} +1 -1
  342. package/dist/{components-DZkL4Fx0.mjs → components-BPxrRjpE.mjs} +1 -1
  343. package/dist/{components-DZkL4Fx0.mjs.map → components-BPxrRjpE.mjs.map} +1 -1
  344. package/dist/{config-B6b_BobR.mjs → config-DyF3OKg_.mjs} +15 -10
  345. package/dist/config-DyF3OKg_.mjs.map +1 -0
  346. package/dist/{content-BC43pICM.mjs → content-CJ94NEx5.mjs} +170 -117
  347. package/dist/content-CJ94NEx5.mjs.map +1 -0
  348. package/dist/{content-refresh-CPMSauD3.mjs → content-refresh-Xw7aKmou.mjs} +7 -7
  349. package/dist/{content-refresh-CPMSauD3.mjs.map → content-refresh-Xw7aKmou.mjs.map} +1 -1
  350. package/dist/{context-DOurRIrb.mjs → context-C_1nrqnW.mjs} +14 -14
  351. package/dist/{context-DOurRIrb.mjs.map → context-C_1nrqnW.mjs.map} +1 -1
  352. package/dist/{cron-BlKIMD_e.mjs → cron-DRV-UC4K.mjs} +1 -1
  353. package/dist/{cron-BlKIMD_e.mjs.map → cron-DRV-UC4K.mjs.map} +1 -1
  354. package/dist/{dashboard-CBm4zhc3.mjs → dashboard-DINnNVVU.mjs} +5 -5
  355. package/dist/{dashboard-CBm4zhc3.mjs.map → dashboard-DINnNVVU.mjs.map} +1 -1
  356. package/dist/db/index.d.mts +3 -3
  357. package/dist/db/index.mjs +3 -2
  358. package/dist/db/index.mjs.map +1 -1
  359. package/dist/db/libsql.d.mts +1 -1
  360. package/dist/db/postgres.d.mts +1 -1
  361. package/dist/db/sqlite.d.mts +1 -1
  362. package/dist/{default-C4v9KP56.mjs → default-BD2FG0xV.mjs} +1 -1
  363. package/dist/{default-C4v9KP56.mjs.map → default-BD2FG0xV.mjs.map} +1 -1
  364. package/dist/deferred-tasks-C-WRCcKo.d.mts +9 -0
  365. package/dist/deferred-tasks-C-WRCcKo.d.mts.map +1 -0
  366. package/dist/{device-flow-BeA6lUS1.mjs → device-flow-CTqd8mud.mjs} +5 -5
  367. package/dist/{device-flow-BeA6lUS1.mjs.map → device-flow-CTqd8mud.mjs.map} +1 -1
  368. package/dist/{dialect-helpers-BtOwo2us.mjs → dialect-helpers-BSbfaO3F.mjs} +43 -16
  369. package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
  370. package/dist/{email-console-C-9Ng8DM.mjs → email-console-C6WdcWbL.mjs} +1 -1
  371. package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-C6WdcWbL.mjs.map} +1 -1
  372. package/dist/{error-DJ98TRbQ.mjs → error-oh_9i6bR.mjs} +3 -3
  373. package/dist/{error-DJ98TRbQ.mjs.map → error-oh_9i6bR.mjs.map} +1 -1
  374. package/dist/{errors-DtEXIQQV.mjs → errors-BucQ8VYz.mjs} +2 -1
  375. package/dist/errors-BucQ8VYz.mjs.map +1 -0
  376. package/dist/{escape-CFedIB1C.mjs → escape-CXps5F_v.mjs} +1 -1
  377. package/dist/{escape-CFedIB1C.mjs.map → escape-CXps5F_v.mjs.map} +1 -1
  378. package/dist/{field-defs-cache-KfNJ_qLQ.mjs → field-defs-cache-WD82dMQq.mjs} +4 -4
  379. package/dist/{field-defs-cache-KfNJ_qLQ.mjs.map → field-defs-cache-WD82dMQq.mjs.map} +1 -1
  380. package/dist/{fts-manager-hyCU9OOp.mjs → fts-manager-BITakW_R.mjs} +37 -13
  381. package/dist/fts-manager-BITakW_R.mjs.map +1 -0
  382. package/dist/{hash-DFFrkivP.mjs → hash-Cg0TXJPV.mjs} +8 -4
  383. package/dist/hash-Cg0TXJPV.mjs.map +1 -0
  384. package/dist/{hreflang-CIxH_LKz.d.mts → hreflang-BaLCNcDx.d.mts} +2 -2
  385. package/dist/{hreflang-CIxH_LKz.d.mts.map → hreflang-BaLCNcDx.d.mts.map} +1 -1
  386. package/dist/{hreflang-CbYeCzl9.mjs → hreflang-BdZuVBhL.mjs} +7 -7
  387. package/dist/{hreflang-CbYeCzl9.mjs.map → hreflang-BdZuVBhL.mjs.map} +1 -1
  388. package/dist/{import-oDYCgNYQ.mjs → import-C-9uqyT3.mjs} +6 -6
  389. package/dist/{import-oDYCgNYQ.mjs.map → import-C-9uqyT3.mjs.map} +1 -1
  390. package/dist/{index-BZJ_5FOX.d.mts → index-M37iz29I.d.mts} +112 -37
  391. package/dist/index-M37iz29I.d.mts.map +1 -0
  392. package/dist/{index-BEui-cRd.d.mts → index-MGw47uWq.d.mts} +3 -3
  393. package/dist/{index-BEui-cRd.d.mts.map → index-MGw47uWq.d.mts.map} +1 -1
  394. package/dist/index.d.mts +19 -19
  395. package/dist/index.mjs +69 -67
  396. package/dist/{load-Dg5gtWma.mjs → load-DV1DZuUJ.mjs} +2 -2
  397. package/dist/{load-Dg5gtWma.mjs.map → load-DV1DZuUJ.mjs.map} +1 -1
  398. package/dist/{loader-D4rigvjR.mjs → loader-CGugY7Zl.mjs} +29 -15
  399. package/dist/loader-CGugY7Zl.mjs.map +1 -0
  400. package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-Da7kj23y.mjs} +1 -1
  401. package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-Da7kj23y.mjs.map} +1 -1
  402. package/dist/media/index.d.mts +1 -1
  403. package/dist/media/local-runtime.d.mts +12 -12
  404. package/dist/media/local-runtime.mjs +8 -8
  405. package/dist/{media-its1WLYv.mjs → media-BP7S-nHT.mjs} +60 -15
  406. package/dist/media-BP7S-nHT.mjs.map +1 -0
  407. package/dist/{media-BJ6SRY3g.mjs → media-OhYL-7Io.mjs} +8 -4
  408. package/dist/{media-BJ6SRY3g.mjs.map → media-OhYL-7Io.mjs.map} +1 -1
  409. package/dist/{media-allowlist-jUppPWFy.mjs → media-allowlist-D-peH1H5.mjs} +1 -1
  410. package/dist/{media-allowlist-jUppPWFy.mjs.map → media-allowlist-D-peH1H5.mjs.map} +1 -1
  411. package/dist/{media-upload-DNu3QySc.mjs → media-upload-DtrwU2B0.mjs} +7 -7
  412. package/dist/{media-upload-DNu3QySc.mjs.map → media-upload-DtrwU2B0.mjs.map} +1 -1
  413. package/dist/{media-url-BCm5vBn6.mjs → media-url-DYs_YLOx.mjs} +1 -1
  414. package/dist/{media-url-BCm5vBn6.mjs.map → media-url-DYs_YLOx.mjs.map} +1 -1
  415. package/dist/{media-usage-DPQ3K4xB.mjs → media-usage-BlxfTkN0.mjs} +8 -8
  416. package/dist/{media-usage-DPQ3K4xB.mjs.map → media-usage-BlxfTkN0.mjs.map} +1 -1
  417. package/dist/{menus-BMGzWyWH.mjs → menus-BcQWxeXu.mjs} +5 -5
  418. package/dist/{menus-BMGzWyWH.mjs.map → menus-BcQWxeXu.mjs.map} +1 -1
  419. package/dist/{menus-CPf_SW7u.mjs → menus-Y54RDPIN.mjs} +215 -38
  420. package/dist/menus-Y54RDPIN.mjs.map +1 -0
  421. package/dist/{mode-fiXRMfeA.mjs → mode-BWyTBe3I.mjs} +1 -1
  422. package/dist/{mode-fiXRMfeA.mjs.map → mode-BWyTBe3I.mjs.map} +1 -1
  423. package/dist/{oauth-authorization-oqfbBuMH.mjs → oauth-authorization-ClvktmrL.mjs} +5 -5
  424. package/dist/{oauth-authorization-oqfbBuMH.mjs.map → oauth-authorization-ClvktmrL.mjs.map} +1 -1
  425. package/dist/{oauth-clients-BlrUHAsf.mjs → oauth-clients-8ao-U66l.mjs} +1 -1
  426. package/dist/{oauth-clients-BlrUHAsf.mjs.map → oauth-clients-8ao-U66l.mjs.map} +1 -1
  427. package/dist/{oauth-state-store-DnvjRMy6.mjs → oauth-state-store-B1ofdTiQ.mjs} +1 -1
  428. package/dist/{oauth-state-store-DnvjRMy6.mjs.map → oauth-state-store-B1ofdTiQ.mjs.map} +1 -1
  429. package/dist/{oauth-user-lookup-oUllxvAv.mjs → oauth-user-lookup-CscEuIiR.mjs} +1 -1
  430. package/dist/{oauth-user-lookup-oUllxvAv.mjs.map → oauth-user-lookup-CscEuIiR.mjs.map} +1 -1
  431. package/dist/object-cache/memory.d.mts +1 -1
  432. package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
  433. package/dist/object-cache-71tPfV4A.mjs.map +1 -0
  434. package/dist/{options-BqMkWfYa.d.mts → options-CA4eVX6P.d.mts} +3 -3
  435. package/dist/{options-BqMkWfYa.d.mts.map → options-CA4eVX6P.d.mts.map} +1 -1
  436. package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
  437. package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
  438. package/dist/page/index.d.mts +2 -2
  439. package/dist/{parse-53zyxlpv.mjs → parse-CJKNuewM.mjs} +2 -2
  440. package/dist/{parse-53zyxlpv.mjs.map → parse-CJKNuewM.mjs.map} +1 -1
  441. package/dist/{passkey-config-C-SKpc0-.mjs → passkey-config-D-zrzMJI.mjs} +1 -1
  442. package/dist/{passkey-config-C-SKpc0-.mjs.map → passkey-config-D-zrzMJI.mjs.map} +1 -1
  443. package/dist/{placeholder-Dop47JMM.d.mts → placeholder-DaeNS-VG.d.mts} +1 -1
  444. package/dist/{placeholder-Dop47JMM.d.mts.map → placeholder-DaeNS-VG.d.mts.map} +1 -1
  445. package/dist/plugin-types.d.mts +1 -1
  446. package/dist/plugin-utils.d.mts +10 -10
  447. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
  448. package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
  449. package/dist/{portable-text-sDj92Kxv.mjs → portable-text-B_kqBmXB.mjs} +1 -1
  450. package/dist/{portable-text-sDj92Kxv.mjs.map → portable-text-B_kqBmXB.mjs.map} +1 -1
  451. package/dist/{preview-D4Jnbfx7.mjs → preview-BU6PaLpM.mjs} +2 -2
  452. package/dist/{preview-D4Jnbfx7.mjs.map → preview-BU6PaLpM.mjs.map} +1 -1
  453. package/dist/{public-url-DSGTnJFw.mjs → public-url-Ox9oOlgp.mjs} +14 -3
  454. package/dist/public-url-Ox9oOlgp.mjs.map +1 -0
  455. package/dist/{query-Bz9bWZfm.mjs → query-C5w7PsRQ.mjs} +43 -44
  456. package/dist/query-C5w7PsRQ.mjs.map +1 -0
  457. package/dist/{query-DdFGHzQF.mjs → query-rC9HKv1N.mjs} +4 -4
  458. package/dist/{query-DdFGHzQF.mjs.map → query-rC9HKv1N.mjs.map} +1 -1
  459. package/dist/{rate-limit-D3IEiUi2.mjs → rate-limit-kug6q99V.mjs} +2 -2
  460. package/dist/{rate-limit-D3IEiUi2.mjs.map → rate-limit-kug6q99V.mjs.map} +1 -1
  461. package/dist/{redirect-BoUac4NT.mjs → redirect-DIJxXKOG.mjs} +3 -3
  462. package/dist/{redirect-BoUac4NT.mjs.map → redirect-DIJxXKOG.mjs.map} +1 -1
  463. package/dist/{redirect-Botom7X6.mjs → redirect-Egf2R9yP.mjs} +1 -1
  464. package/dist/{redirect-Botom7X6.mjs.map → redirect-Egf2R9yP.mjs.map} +1 -1
  465. package/dist/{redirects-ChbpqKiS.mjs → redirects-Bzm812bY.mjs} +5 -5
  466. package/dist/{redirects-ChbpqKiS.mjs.map → redirects-Bzm812bY.mjs.map} +1 -1
  467. package/dist/{redirects-D457qwt0.mjs → redirects-G8wAhWAf.mjs} +25 -7
  468. package/dist/redirects-G8wAhWAf.mjs.map +1 -0
  469. package/dist/{registry-y21kjhfG.mjs → registry-Dbodb4Uo.mjs} +59 -14
  470. package/dist/registry-Dbodb4Uo.mjs.map +1 -0
  471. package/dist/{relation-Du0r04E0.mjs → relation-Cbe3Sd3m.mjs} +3 -3
  472. package/dist/{relation-Du0r04E0.mjs.map → relation-Cbe3Sd3m.mjs.map} +1 -1
  473. package/dist/{relations-CZMpBqEd.mjs → relations-Bw_E1TXo.mjs} +3 -3
  474. package/dist/{relations-CZMpBqEd.mjs.map → relations-Bw_E1TXo.mjs.map} +1 -1
  475. package/dist/{relations-qKmSj9KM.d.mts → relations-G2ta7GIl.d.mts} +50 -12
  476. package/dist/relations-G2ta7GIl.d.mts.map +1 -0
  477. package/dist/{relations-DtX1UMBH.mjs → relations-qHwpUe66.mjs} +6 -6
  478. package/dist/{relations-DtX1UMBH.mjs.map → relations-qHwpUe66.mjs.map} +1 -1
  479. package/dist/request-context.d.mts +3 -0
  480. package/dist/request-context.d.mts.map +1 -1
  481. package/dist/request-context.mjs.map +1 -1
  482. package/dist/{request-meta-DzXYYI-n.mjs → request-meta-Df-jFbAd.mjs} +2 -2
  483. package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-Df-jFbAd.mjs.map} +1 -1
  484. package/dist/{resolve-DFr4kq72.mjs → resolve-DZzG4HqM.mjs} +2 -2
  485. package/dist/{resolve-DFr4kq72.mjs.map → resolve-DZzG4HqM.mjs.map} +1 -1
  486. package/dist/{runner-BdeLEgad.mjs → runner-BFTrkYhu.mjs} +497 -213
  487. package/dist/runner-BFTrkYhu.mjs.map +1 -0
  488. package/dist/{runner-Dd8m8k9F.d.mts → runner-BaADli8l.d.mts} +2 -2
  489. package/dist/{runner-Dd8m8k9F.d.mts.map → runner-BaADli8l.d.mts.map} +1 -1
  490. package/dist/runtime.d.mts +11 -11
  491. package/dist/runtime.mjs +3 -3
  492. package/dist/{schema-BH8P8vaC.mjs → schema-CiQXr6_F.mjs} +3 -3
  493. package/dist/{schema-BH8P8vaC.mjs.map → schema-CiQXr6_F.mjs.map} +1 -1
  494. package/dist/{scopes-DTIkIaGA.mjs → scopes-CNJVT5i5.mjs} +3 -3
  495. package/dist/{scopes-DTIkIaGA.mjs.map → scopes-CNJVT5i5.mjs.map} +1 -1
  496. package/dist/{search-D-Yhpmvs.mjs → search-FZhx5dDU.mjs} +7 -7
  497. package/dist/{search-D-Yhpmvs.mjs.map → search-FZhx5dDU.mjs.map} +1 -1
  498. package/dist/{secrets-CQ-69kF9.mjs → secrets-DLd8RXee.mjs} +4 -4
  499. package/dist/{secrets-CQ-69kF9.mjs.map → secrets-DLd8RXee.mjs.map} +1 -1
  500. package/dist/{sections-CzVBAKjw.mjs → sections-BrIrMUCn.mjs} +3 -3
  501. package/dist/{sections-CzVBAKjw.mjs.map → sections-BrIrMUCn.mjs.map} +1 -1
  502. package/dist/seed/index.d.mts +2 -2
  503. package/dist/seed/index.mjs +25 -23
  504. package/dist/seo/index.d.mts +3 -3
  505. package/dist/seo/index.mjs +18 -16
  506. package/dist/seo/index.mjs.map +1 -1
  507. package/dist/{seo-C3GDfT0V.mjs → seo-CobNfOvb.mjs} +2 -2
  508. package/dist/{seo-C3GDfT0V.mjs.map → seo-CobNfOvb.mjs.map} +1 -1
  509. package/dist/{seo-kJzVAmmu.mjs → seo-DTHRntNC.mjs} +3 -3
  510. package/dist/{seo-kJzVAmmu.mjs.map → seo-DTHRntNC.mjs.map} +1 -1
  511. package/dist/{service-CQnc276a.mjs → service-B-pYGPgR.mjs} +4 -4
  512. package/dist/{service-CQnc276a.mjs.map → service-B-pYGPgR.mjs.map} +1 -1
  513. package/dist/{session-user-DbHqKDKe.mjs → session-user-BvM9-zNl.mjs} +2 -2
  514. package/dist/{session-user-DbHqKDKe.mjs.map → session-user-BvM9-zNl.mjs.map} +1 -1
  515. package/dist/{settings-Dtc0DU31.mjs → settings-DPHau-WH.mjs} +3 -3
  516. package/dist/{settings-Dtc0DU31.mjs.map → settings-DPHau-WH.mjs.map} +1 -1
  517. package/dist/{settings-C2PaBS49.mjs → settings-kJhGiQ4z.mjs} +7 -7
  518. package/dist/{settings-C2PaBS49.mjs.map → settings-kJhGiQ4z.mjs.map} +1 -1
  519. package/dist/{setup-complete-CdIlqloh.mjs → setup-complete-u50Qm8rY.mjs} +2 -2
  520. package/dist/{setup-complete-CdIlqloh.mjs.map → setup-complete-u50Qm8rY.mjs.map} +1 -1
  521. package/dist/{setup-nonce-DqiIPr-J.mjs → setup-nonce-DCjiiOD2.mjs} +1 -1
  522. package/dist/{setup-nonce-DqiIPr-J.mjs.map → setup-nonce-DCjiiOD2.mjs.map} +1 -1
  523. package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-DW3w11Pu.mjs} +1 -1
  524. package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-DW3w11Pu.mjs.map} +1 -1
  525. package/dist/site-url-I-lJ5kma.mjs +16 -0
  526. package/dist/site-url-I-lJ5kma.mjs.map +1 -0
  527. package/dist/{snapshot-BdpUJKD-.mjs → snapshot-I_fjLDaD.mjs} +2 -2
  528. package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-I_fjLDaD.mjs.map} +1 -1
  529. package/dist/{ssrf-CviKqWmq.mjs → ssrf-CTa6v21i.mjs} +1 -1
  530. package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-CTa6v21i.mjs.map} +1 -1
  531. package/dist/{state-xxv6ZTMv.mjs → state-CQvoefYP.mjs} +1 -1
  532. package/dist/{state-xxv6ZTMv.mjs.map → state-CQvoefYP.mjs.map} +1 -1
  533. package/dist/{status-COfycGIU.mjs → status-CIsmlC1E.mjs} +1 -1
  534. package/dist/{status-COfycGIU.mjs.map → status-CIsmlC1E.mjs.map} +1 -1
  535. package/dist/storage/local.d.mts +1 -1
  536. package/dist/storage/local.mjs +1 -1
  537. package/dist/storage/s3.d.mts +1 -1
  538. package/dist/storage/s3.mjs +2 -2
  539. package/dist/storage/s3.mjs.map +1 -1
  540. package/dist/{taxonomies-BN6M9Nrv.mjs → taxonomies-CKuaZER5.mjs} +90 -9
  541. package/dist/taxonomies-CKuaZER5.mjs.map +1 -0
  542. package/dist/{taxonomies-r7pqLBCn.mjs → taxonomies-CLN1N92E.mjs} +57 -32
  543. package/dist/taxonomies-CLN1N92E.mjs.map +1 -0
  544. package/dist/{taxonomy-0mCI25HN.mjs → taxonomy-pOrB2kZe.mjs} +142 -15
  545. package/dist/taxonomy-pOrB2kZe.mjs.map +1 -0
  546. package/dist/{tokens-DVltpO2D.mjs → tokens-DagaJGK8.mjs} +1 -1
  547. package/dist/{tokens-DVltpO2D.mjs.map → tokens-DagaJGK8.mjs.map} +1 -1
  548. package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
  549. package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
  550. package/dist/{transport-Vd7VdqHv.d.mts → transport-CAwTaTp_.d.mts} +1 -1
  551. package/dist/{transport-Vd7VdqHv.d.mts.map → transport-CAwTaTp_.d.mts.map} +1 -1
  552. package/dist/{transport-CKrlqSpD.mjs → transport-DVsa5YYo.mjs} +1 -1
  553. package/dist/{transport-CKrlqSpD.mjs.map → transport-DVsa5YYo.mjs.map} +1 -1
  554. package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-D20_7fyX.mjs} +1 -1
  555. package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-D20_7fyX.mjs.map} +1 -1
  556. package/dist/{types-BfYUPJdP.d.mts → types-BGWPMiBO.d.mts} +2 -2
  557. package/dist/{types-BfYUPJdP.d.mts.map → types-BGWPMiBO.d.mts.map} +1 -1
  558. package/dist/{types-iVeZ5g6N.d.mts → types-BK6U01Ro.d.mts} +1 -1
  559. package/dist/{types-iVeZ5g6N.d.mts.map → types-BK6U01Ro.d.mts.map} +1 -1
  560. package/dist/{types-BD40g7zz.mjs → types-BjxTKxrZ.mjs} +1 -1
  561. package/dist/{types-BD40g7zz.mjs.map → types-BjxTKxrZ.mjs.map} +1 -1
  562. package/dist/{types-Kmaxdarz.d.mts → types-BnFP1M3J.d.mts} +22 -1
  563. package/dist/types-BnFP1M3J.d.mts.map +1 -0
  564. package/dist/{types-C7U0HlEr.d.mts → types-C8oz_ayJ.d.mts} +1 -1
  565. package/dist/{types-C7U0HlEr.d.mts.map → types-C8oz_ayJ.d.mts.map} +1 -1
  566. package/dist/{types-B4vm81VH.d.mts → types-CbUcuxxc.d.mts} +1 -1
  567. package/dist/{types-B4vm81VH.d.mts.map → types-CbUcuxxc.d.mts.map} +1 -1
  568. package/dist/{types-CrRUFdej.mjs → types-Cd8iuS1J.mjs} +10 -3
  569. package/dist/{types-CrRUFdej.mjs.map → types-Cd8iuS1J.mjs.map} +1 -1
  570. package/dist/types-CtzytVXn.mjs +18 -0
  571. package/dist/types-CtzytVXn.mjs.map +1 -0
  572. package/dist/{types-BvB7gDOD.d.mts → types-Cz8hNch2.d.mts} +5 -5
  573. package/dist/{types-BvB7gDOD.d.mts.map → types-Cz8hNch2.d.mts.map} +1 -1
  574. package/dist/{types-B97jg3aW.d.mts → types-DLG4IFEQ.d.mts} +1 -1
  575. package/dist/{types-B97jg3aW.d.mts.map → types-DLG4IFEQ.d.mts.map} +1 -1
  576. package/dist/{types-DPKhI5ib.d.mts → types-Dc4ntQjQ.d.mts} +18 -1
  577. package/dist/types-Dc4ntQjQ.d.mts.map +1 -0
  578. package/dist/{types-BNfPHfay.d.mts → types-LoagAGzH.d.mts} +1 -1
  579. package/dist/{types-BNfPHfay.d.mts.map → types-LoagAGzH.d.mts.map} +1 -1
  580. package/dist/{types-o7xo7VgH.mjs → types-NBI3rF-_.mjs} +3 -2
  581. package/dist/types-NBI3rF-_.mjs.map +1 -0
  582. package/dist/upload-attempts-D8QAFLUJ.mjs +27 -0
  583. package/dist/upload-attempts-D8QAFLUJ.mjs.map +1 -0
  584. package/dist/{user-aTXqmXBz.mjs → user-DBrq4UVq.mjs} +3 -3
  585. package/dist/{user-aTXqmXBz.mjs.map → user-DBrq4UVq.mjs.map} +1 -1
  586. package/dist/{utils-BbUgmeZG.mjs → utils-hLzi_2Fn.mjs} +2 -2
  587. package/dist/{utils-BbUgmeZG.mjs.map → utils-hLzi_2Fn.mjs.map} +1 -1
  588. package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
  589. package/dist/validate-BpwoDOgt.mjs.map +1 -0
  590. package/dist/{validate-DULfgpJP.d.mts → validate-C3oSmA7F.d.mts} +15 -5
  591. package/dist/validate-C3oSmA7F.d.mts.map +1 -0
  592. package/dist/{validate-CDT1jl6_.mjs → validate-mKo3RxBM.mjs} +4 -4
  593. package/dist/{validate-CDT1jl6_.mjs.map → validate-mKo3RxBM.mjs.map} +1 -1
  594. package/dist/{validation-DlD0E35W.mjs → validation-BgpucsvF.mjs} +11 -9
  595. package/dist/{validation-DlD0E35W.mjs.map → validation-BgpucsvF.mjs.map} +1 -1
  596. package/dist/version-C4PnpmoV.mjs +7 -0
  597. package/dist/{version-BRMngh9I.mjs.map → version-C4PnpmoV.mjs.map} +1 -1
  598. package/dist/{widgets-5fipNkMT.mjs → widgets-CJJtkiKh.mjs} +3 -3
  599. package/dist/{widgets-5fipNkMT.mjs.map → widgets-CJJtkiKh.mjs.map} +1 -1
  600. package/dist/{wxr-taxonomies-DrihupaC.mjs → wxr-taxonomies-9PPSy8X6.mjs} +4 -4
  601. package/dist/{wxr-taxonomies-DrihupaC.mjs.map → wxr-taxonomies-9PPSy8X6.mjs.map} +1 -1
  602. package/dist/{wxr-taxonomies-B4tMuN5T.d.mts → wxr-taxonomies-Bkpp_2tK.d.mts} +1 -1
  603. package/dist/{wxr-taxonomies-B4tMuN5T.d.mts.map → wxr-taxonomies-Bkpp_2tK.d.mts.map} +1 -1
  604. package/dist/{zod-generator-CwkHWz4f.mjs → zod-generator-CG64Hnbh.mjs} +3 -3
  605. package/dist/{zod-generator-CwkHWz4f.mjs.map → zod-generator-CG64Hnbh.mjs.map} +1 -1
  606. package/package.json +12 -8
  607. package/src/after.ts +6 -1
  608. package/src/api/errors.ts +1 -0
  609. package/src/api/handlers/content.ts +45 -4
  610. package/src/api/handlers/marketplace.ts +14 -0
  611. package/src/api/handlers/media.ts +4 -4
  612. package/src/api/handlers/registry.ts +14 -0
  613. package/src/api/handlers/revision.ts +19 -5
  614. package/src/api/handlers/schema.ts +37 -0
  615. package/src/api/handlers/snapshot.ts +1 -1
  616. package/src/api/handlers/taxonomies.ts +111 -10
  617. package/src/api/openapi/document.ts +84 -3
  618. package/src/api/public-url.ts +14 -2
  619. package/src/api/schemas/media.ts +9 -2
  620. package/src/api/schemas/schema.ts +13 -0
  621. package/src/api/schemas/search.ts +2 -0
  622. package/src/api/schemas/taxonomies.ts +34 -1
  623. package/src/api/site-url.ts +16 -6
  624. package/src/astro/integration/routes.ts +19 -0
  625. package/src/astro/integration/runtime.ts +13 -0
  626. package/src/astro/integration/virtual-modules.ts +2 -0
  627. package/src/astro/middleware/redirect.ts +2 -10
  628. package/src/astro/middleware/scoped-db.ts +35 -4
  629. package/src/astro/middleware.ts +56 -22
  630. package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
  631. package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
  632. package/src/astro/routes/api/auth/invite/index.ts +2 -2
  633. package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
  634. package/src/astro/routes/api/auth/signup/request.ts +2 -2
  635. package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
  636. package/src/astro/routes/api/content/[collection]/[id].ts +3 -1
  637. package/src/astro/routes/api/media/[id]/confirm.ts +148 -59
  638. package/src/astro/routes/api/media/[id]/upload.ts +262 -0
  639. package/src/astro/routes/api/media/[id].ts +19 -10
  640. package/src/astro/routes/api/media/upload-url.ts +28 -31
  641. package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
  642. package/src/astro/routes/api/schema/index.ts +2 -0
  643. package/src/astro/routes/api/search/enable.ts +5 -1
  644. package/src/astro/routes/api/search/rebuild.ts +6 -1
  645. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
  646. package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +6 -3
  647. package/src/astro/types.ts +7 -0
  648. package/src/cleanup.ts +54 -26
  649. package/src/cli/commands/dev.ts +13 -3
  650. package/src/cli/commands/export-seed.ts +2 -0
  651. package/src/cli/index.ts +1 -1
  652. package/src/components/CommentForm.astro +1 -1
  653. package/src/components/Comments.astro +1 -1
  654. package/src/components/InlinePortableTextEditor.tsx +175 -31
  655. package/src/components/OrderedList.astro +14 -0
  656. package/src/components/PortableText.astro +26 -4
  657. package/src/components/code-mark.ts +11 -0
  658. package/src/components/index.ts +12 -1
  659. package/src/components/ordered-list.ts +549 -0
  660. package/src/content/converters/numbered-list.ts +148 -0
  661. package/src/content/converters/portable-text-to-prosemirror.ts +59 -9
  662. package/src/content/converters/prosemirror-to-portable-text.ts +23 -12
  663. package/src/content/converters/types.ts +2 -0
  664. package/src/content/portable-text-lists.ts +205 -0
  665. package/src/database/dialect-helpers.ts +41 -22
  666. package/src/database/migrations/054_media_upload_attempts.ts +41 -0
  667. package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
  668. package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
  669. package/src/database/migrations/057_collection_hidden.ts +24 -0
  670. package/src/database/migrations/058_collection_sort_order.ts +20 -0
  671. package/src/database/migrations/059_revision_prune_queue.ts +36 -0
  672. package/src/database/migrations/runner.ts +12 -0
  673. package/src/database/repositories/content.ts +193 -183
  674. package/src/database/repositories/media.ts +158 -28
  675. package/src/database/repositories/revision.ts +82 -17
  676. package/src/database/repositories/taxonomy.ts +202 -7
  677. package/src/database/repositories/types.ts +7 -0
  678. package/src/database/types.ts +23 -1
  679. package/src/database/validate.ts +39 -0
  680. package/src/db/adapters.ts +8 -0
  681. package/src/deferred-tasks.ts +71 -0
  682. package/src/emdash-runtime.ts +277 -88
  683. package/src/i18n/config.ts +17 -10
  684. package/src/index.ts +3 -0
  685. package/src/loader.ts +46 -24
  686. package/src/media/upload-attempts.ts +33 -0
  687. package/src/media/usage/gc.ts +50 -0
  688. package/src/object-cache/index.ts +160 -3
  689. package/src/plugins/routes.ts +34 -0
  690. package/src/plugins/storage-indexes.ts +50 -11
  691. package/src/query.ts +50 -44
  692. package/src/redirects/cache.ts +79 -19
  693. package/src/request-context.ts +3 -0
  694. package/src/scheduled-publish.ts +6 -1
  695. package/src/schema/registry.ts +95 -3
  696. package/src/schema/types.ts +24 -0
  697. package/src/search/fts-manager.ts +50 -10
  698. package/src/search/index.ts +2 -0
  699. package/src/search/types.ts +6 -0
  700. package/src/seed/apply.ts +22 -2
  701. package/src/seed/types.ts +10 -0
  702. package/src/storage/s3.ts +1 -1
  703. package/src/taxonomies/index.ts +11 -7
  704. package/src/taxonomies/term-counts.ts +56 -28
  705. package/src/ui-comments.ts +19 -0
  706. package/src/ui.ts +11 -3
  707. package/src/utils/hash.ts +14 -3
  708. package/src/virtual-modules.d.ts +8 -0
  709. package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
  710. package/dist/after-B1IIdH3Y.mjs +0 -29
  711. package/dist/after-B1IIdH3Y.mjs.map +0 -1
  712. package/dist/api-BkqFzIu4.mjs.map +0 -1
  713. package/dist/apply-DuXsqll7.mjs.map +0 -1
  714. package/dist/cache-DDwy3JDW.mjs +0 -65
  715. package/dist/cache-DDwy3JDW.mjs.map +0 -1
  716. package/dist/config-B6b_BobR.mjs.map +0 -1
  717. package/dist/content-BC43pICM.mjs.map +0 -1
  718. package/dist/dialect-helpers-BtOwo2us.mjs.map +0 -1
  719. package/dist/errors-DtEXIQQV.mjs.map +0 -1
  720. package/dist/fts-manager-hyCU9OOp.mjs.map +0 -1
  721. package/dist/hash-DFFrkivP.mjs.map +0 -1
  722. package/dist/index-BZJ_5FOX.d.mts.map +0 -1
  723. package/dist/loader-D4rigvjR.mjs.map +0 -1
  724. package/dist/media-its1WLYv.mjs.map +0 -1
  725. package/dist/menus-CPf_SW7u.mjs.map +0 -1
  726. package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
  727. package/dist/public-url-DSGTnJFw.mjs.map +0 -1
  728. package/dist/query-Bz9bWZfm.mjs.map +0 -1
  729. package/dist/redirects-D457qwt0.mjs.map +0 -1
  730. package/dist/registry-y21kjhfG.mjs.map +0 -1
  731. package/dist/relations-qKmSj9KM.d.mts.map +0 -1
  732. package/dist/runner-BdeLEgad.mjs.map +0 -1
  733. package/dist/site-url-NGJT6NTU.mjs +0 -13
  734. package/dist/site-url-NGJT6NTU.mjs.map +0 -1
  735. package/dist/taxonomies-BN6M9Nrv.mjs.map +0 -1
  736. package/dist/taxonomies-r7pqLBCn.mjs.map +0 -1
  737. package/dist/taxonomy-0mCI25HN.mjs.map +0 -1
  738. package/dist/types-DPKhI5ib.d.mts.map +0 -1
  739. package/dist/types-Kmaxdarz.d.mts.map +0 -1
  740. package/dist/types-o7xo7VgH.mjs.map +0 -1
  741. package/dist/validate-DULfgpJP.d.mts.map +0 -1
  742. package/dist/validate-VPnKoIzW.mjs.map +0 -1
  743. package/dist/version-BRMngh9I.mjs +0 -7
  744. /package/dist/{api-tokens-Cvmixds7.mjs → api-tokens-Dai9dND0.mjs} +0 -0
  745. /package/dist/{ssrf-BB__xfNM.mjs → ssrf-Cj568Dgs.mjs} +0 -0
  746. /package/dist/{types-CK0LxPUQ.mjs → types-DKuWPYV5.mjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"relations-CZMpBqEd.mjs","names":["authenticatorTransport","registrationCredential"],"sources":["../src/api/schemas/auth.ts","../src/api/schemas/import.ts","../src/api/schemas/setup.ts","../src/api/schemas/byline-fields.ts","../src/api/schemas/relations.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { roleLevel } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// WebAuthn credential schemas (matching @emdash-cms/auth/passkey types)\n// ---------------------------------------------------------------------------\n\nconst authenticatorTransport = z.enum([\"usb\", \"nfc\", \"ble\", \"internal\", \"hybrid\"]);\n\n/** RegistrationResponse — sent by the browser after navigator.credentials.create() */\nconst registrationCredential = z.object({\n\tid: z.string(),\n\trawId: z.string(),\n\ttype: z.literal(\"public-key\"),\n\tresponse: z.object({\n\t\tclientDataJSON: z.string(),\n\t\tattestationObject: z.string(),\n\t\ttransports: z.array(authenticatorTransport).optional(),\n\t}),\n\tauthenticatorAttachment: z.enum([\"platform\", \"cross-platform\"]).optional(),\n});\n\n/** AuthenticationResponse — sent by the browser after navigator.credentials.get() */\nconst authenticationCredential = z.object({\n\tid: z.string(),\n\trawId: z.string(),\n\ttype: z.literal(\"public-key\"),\n\tresponse: z.object({\n\t\tclientDataJSON: z.string(),\n\t\tauthenticatorData: z.string(),\n\t\tsignature: z.string(),\n\t\tuserHandle: z.string().optional(),\n\t}),\n\tauthenticatorAttachment: z.enum([\"platform\", \"cross-platform\"]).optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Auth: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const signupRequestBody = z\n\t.object({\n\t\temail: z.string().email(),\n\t})\n\t.meta({ id: \"SignupRequestBody\" });\n\nexport const signupCompleteBody = z\n\t.object({\n\t\ttoken: z.string().min(1),\n\t\tcredential: registrationCredential,\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"SignupCompleteBody\" });\n\nexport const inviteCreateBody = z\n\t.object({\n\t\temail: z.string().email(),\n\t\trole: roleLevel.optional(),\n\t})\n\t.meta({ id: \"InviteCreateBody\" });\n\nexport const inviteRegisterOptionsBody = z\n\t.object({\n\t\ttoken: z.string().min(1),\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"InviteRegisterOptionsBody\" });\n\nexport const inviteCompleteBody = z\n\t.object({\n\t\ttoken: z.string().min(1),\n\t\tcredential: registrationCredential,\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"InviteCompleteBody\" });\n\nexport const magicLinkSendBody = z\n\t.object({\n\t\temail: z.string().email(),\n\t})\n\t.meta({ id: \"MagicLinkSendBody\" });\n\nexport const passkeyOptionsBody = z\n\t.object({\n\t\temail: z.string().email().optional(),\n\t})\n\t.meta({ id: \"PasskeyOptionsBody\" });\n\nexport const passkeyVerifyBody = z\n\t.object({\n\t\tcredential: authenticationCredential,\n\t})\n\t.meta({ id: \"PasskeyVerifyBody\" });\n\nexport const passkeyRegisterOptionsBody = z\n\t.object({\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"PasskeyRegisterOptionsBody\" });\n\nexport const passkeyRegisterVerifyBody = z\n\t.object({\n\t\tcredential: registrationCredential,\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"PasskeyRegisterVerifyBody\" });\n\nexport const passkeyRenameBody = z\n\t.object({\n\t\tname: z.string().min(1),\n\t})\n\t.meta({ id: \"PasskeyRenameBody\" });\n\nexport const authMeActionBody = z\n\t.object({\n\t\taction: z.string().min(1),\n\t})\n\t.meta({ id: \"AuthMeActionBody\" });\n","import { z } from \"zod\";\n\nimport { httpUrl } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Import\n// ---------------------------------------------------------------------------\n\nexport const importProbeBody = z.object({\n\turl: httpUrl,\n});\n\nexport const wpPluginAnalyzeBody = z.object({\n\turl: httpUrl,\n\ttoken: z.string().min(1),\n});\n\nexport const wpPluginExecuteBody = z.object({\n\turl: httpUrl,\n\ttoken: z.string().min(1),\n\tconfig: z.record(z.string(), z.unknown()),\n\t// --- Chunked mode (issue #475). Absent phase = single-shot legacy run. ---\n\t// The admin drives the import in a loop of bounded requests; cross-chunk\n\t// state travels with the client so the server stays stateless.\n\tphase: z.enum([\"content\", \"comments\", \"finalize\"]).optional(),\n\t/** Position within the phase: post-type index + WP page (content), page (comments) */\n\tcursor: z\n\t\t.object({\n\t\t\tpostTypeIndex: z.number().int().min(0).default(0),\n\t\t\tpage: z.number().int().min(1).default(1),\n\t\t})\n\t\t.optional(),\n\t/** WP post ID -> created EmDash item, accumulated across content chunks */\n\tidMap: z\n\t\t.record(z.string(), z.object({ id: z.string().min(1), collection: z.string().min(1) }))\n\t\t.optional(),\n\t/** Source translation group -> EmDash item ID, accumulated across content chunks */\n\ttranslationGroups: z.record(z.string(), z.string().min(1)).optional(),\n\t/** WP comment ID -> EmDash root comment ID, accumulated across comment chunks */\n\tcommentRoots: z.record(z.string(), z.string().min(1)).optional(),\n});\n\nexport const wpPrepareBody = z.object({\n\tpostTypes: z.array(\n\t\tz.object({\n\t\t\tname: z.string().min(1),\n\t\t\tcollection: z.string().min(1),\n\t\t\tfields: z\n\t\t\t\t.array(\n\t\t\t\t\tz.object({\n\t\t\t\t\t\tslug: z.string().min(1),\n\t\t\t\t\t\tlabel: z.string().min(1),\n\t\t\t\t\t\ttype: z.string().min(1),\n\t\t\t\t\t\trequired: z.boolean(),\n\t\t\t\t\t\tsearchable: z.boolean().optional(),\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.optional(),\n\t\t}),\n\t),\n});\n\nexport const wpMediaImportBody = z.object({\n\tattachments: z.array(z.record(z.string(), z.unknown())),\n\tstream: z.boolean().optional(),\n});\n\nexport const wpRewriteUrlsBody = z.object({\n\turlMap: z.record(z.string(), z.string()),\n\tcollections: z.array(z.string()).optional(),\n});\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Setup\n// ---------------------------------------------------------------------------\n\n/** Registration credential — duplicated reference for setup flow.\n * The canonical definition lives in auth.ts but setup needs it independently\n * because setup runs before auth is configured. */\nconst authenticatorTransport = z.enum([\"usb\", \"nfc\", \"ble\", \"internal\", \"hybrid\"]);\n\nconst registrationCredential = z.object({\n\tid: z.string(),\n\trawId: z.string(),\n\ttype: z.literal(\"public-key\"),\n\tresponse: z.object({\n\t\tclientDataJSON: z.string(),\n\t\tattestationObject: z.string(),\n\t\ttransports: z.array(authenticatorTransport).optional(),\n\t}),\n\tauthenticatorAttachment: z.enum([\"platform\", \"cross-platform\"]).optional(),\n});\n\nexport const setupBody = z.object({\n\ttitle: z.string().min(1),\n\ttagline: z.string().optional(),\n\tincludeContent: z.boolean(),\n});\n\nexport const setupAdminBody = z.object({\n\temail: z.string().email(),\n\tname: z.string().optional(),\n});\n\nexport const setupAdminVerifyBody = z.object({\n\tcredential: registrationCredential,\n});\n\nexport const atprotoLoginBody = z.object({\n\thandle: z.string().trim().min(1),\n});\n\nexport const setupAtprotoAdminBody = z.object({\n\thandle: z.string().trim().min(1),\n});\n","/**\n * Zod schemas for the byline-fields admin API (Discussion #1174, Phase 4).\n *\n * Reserved-slug + identifier validation runs at the zod layer so the\n * route returns a clean 400 (`VALIDATION_ERROR` from `parseBody`) rather\n * than bubbling a registry-level `BylineSchemaError` (\"RESERVED_SLUG\" /\n * \"INVALID_SLUG\"). The registry repeats the same checks for non-HTTP\n * callers (seeds, scripts) — see `BylineSchemaRegistry.validateSlug`.\n *\n * Field types are constrained to the v1 subset declared in\n * `BYLINE_FIELD_TYPES`. Adding a type to the union there will require a\n * corresponding update to this enum.\n */\n\nimport { z } from \"zod\";\n\nimport { BYLINE_FIELD_TYPES, RESERVED_BYLINE_FIELD_SLUGS } from \"../../schema/types.js\";\n\n/**\n * Slug pattern for byline field definitions — matches the identifier rule\n * used by `validateIdentifier` (and `slugPattern` in `common.ts`).\n * Lowercase letters, digits, and underscores; must start with a letter.\n */\nconst bylineFieldSlugPattern = /^[a-z][a-z0-9_]*$/;\n\n/** Hard cap on a slug — mirrors `BylineSchemaRegistry.MAX_SLUG_LENGTH`. */\nconst MAX_SLUG_LENGTH = 63;\n/** Hard cap on a label — mirrors `BylineSchemaRegistry.MAX_LABEL_LENGTH`. */\nconst MAX_LABEL_LENGTH = 200;\n/** Hard cap on a select field's `options` list. */\nconst MAX_SELECT_OPTIONS = 200;\n\nconst RESERVED_SET: ReadonlySet<string> = new Set(RESERVED_BYLINE_FIELD_SLUGS);\n\n// Enumerate the v1 byline field types explicitly so zod gets the exact\n// literal union for `z.infer<>`. Mirrors `BYLINE_FIELD_TYPES`; CI's\n// type-checker catches drift via the satisfies/import below.\nconst bylineFieldTypeValues = z.enum([\"string\", \"text\", \"url\", \"boolean\", \"select\"]);\n// Compile-time guard: a drift here trips the satisfies check.\ntype _BylineFieldTypeDriftCheck =\n\t(typeof BYLINE_FIELD_TYPES)[number] extends z.infer<typeof bylineFieldTypeValues>\n\t\t? z.infer<typeof bylineFieldTypeValues> extends (typeof BYLINE_FIELD_TYPES)[number]\n\t\t\t? true\n\t\t\t: never\n\t\t: never;\nconst _bylineFieldTypeDriftCheck: _BylineFieldTypeDriftCheck = true;\nvoid _bylineFieldTypeDriftCheck;\n\n/**\n * Validation payload for a byline custom field. v1 only exposes\n * `options` (used by `select`-type fields). Empty/duplicate options are\n * rejected at the registry layer; the zod layer only enforces shape and\n * caps. Future field types may add keys here.\n */\nconst bylineFieldValidationSchema = z\n\t.object({\n\t\toptions: z\n\t\t\t.array(z.string().min(1))\n\t\t\t.min(1, \"select options must contain at least one entry\")\n\t\t\t.max(MAX_SELECT_OPTIONS, `select options cannot exceed ${MAX_SELECT_OPTIONS} entries`)\n\t\t\t.optional(),\n\t})\n\t.strict()\n\t.nullable();\n\n/**\n * Slug validation chain shared by create + reorder bodies. Centralised so\n * the reserved-slug message and pattern are identical everywhere.\n */\nconst bylineFieldSlug = z\n\t.string()\n\t.min(1, \"Byline field slug is required\")\n\t.max(MAX_SLUG_LENGTH, `Byline field slug must be ${MAX_SLUG_LENGTH} characters or less`)\n\t.regex(\n\t\tbylineFieldSlugPattern,\n\t\t\"Byline field slug must contain only lowercase letters, digits, and underscores, and start with a letter\",\n\t)\n\t.refine((slug) => !RESERVED_SET.has(slug), {\n\t\t// Surface the offending slug in the validation issue path-message\n\t\t// for easier debugging from the admin UI's error toast.\n\t\tmessage: \"Byline field slug is reserved\",\n\t});\n\nconst bylineFieldLabel = z\n\t.string()\n\t.min(1, \"Byline field label is required\")\n\t.max(MAX_LABEL_LENGTH, `Byline field label must be ${MAX_LABEL_LENGTH} characters or less`);\n\n// ---------------------------------------------------------------------------\n// Request bodies\n// ---------------------------------------------------------------------------\n\nexport const bylineFieldCreateBody = z\n\t.object({\n\t\tslug: bylineFieldSlug,\n\t\tlabel: bylineFieldLabel,\n\t\ttype: bylineFieldTypeValues,\n\t\trequired: z.boolean().optional(),\n\t\t/**\n\t\t * Whether values are stored per-locale (translatable, default) or\n\t\t * shared across the translation group. See `BylineFieldDefinition`.\n\t\t */\n\t\ttranslatable: z.boolean().optional(),\n\t\tvalidation: bylineFieldValidationSchema.optional(),\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"BylineFieldCreateBody\" });\n\n/**\n * Update body. `slug` and `type` are intentionally absent — both are\n * immutable post-create (changing them would invalidate stored values).\n * `translatable` flips are gated at the registry layer when value rows\n * exist (`TRANSLATABLE_LOCKED`).\n */\nexport const bylineFieldUpdateBody = z\n\t.object({\n\t\tlabel: bylineFieldLabel.optional(),\n\t\trequired: z.boolean().optional(),\n\t\ttranslatable: z.boolean().optional(),\n\t\tvalidation: bylineFieldValidationSchema.optional(),\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"BylineFieldUpdateBody\" });\n\nexport const bylineFieldReorderBody = z\n\t.object({\n\t\t/**\n\t\t * Exact set of currently registered slugs in the desired order.\n\t\t * The registry rejects any drift (`REORDER_MISMATCH`); the zod\n\t\t * layer enforces slug shape only. An empty array is permitted —\n\t\t * `reorderFields([])` is a valid no-op when zero fields are\n\t\t * registered (registry contract). Rejecting empty here would\n\t\t * produce a spurious 400 for an admin UI that submits a reorder\n\t\t * after deleting the last field.\n\t\t */\n\t\tslugs: z.array(bylineFieldSlug),\n\t})\n\t.strict()\n\t.meta({ id: \"BylineFieldReorderBody\" });\n\n// ---------------------------------------------------------------------------\n// Response shapes\n// ---------------------------------------------------------------------------\n\nexport const bylineFieldDefinitionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\ttype: bylineFieldTypeValues,\n\t\trequired: z.boolean(),\n\t\ttranslatable: z.boolean(),\n\t\tvalidation: z\n\t\t\t.object({\n\t\t\t\toptions: z.array(z.string()).optional(),\n\t\t\t})\n\t\t\t.nullable(),\n\t\tsortOrder: z.number().int(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"BylineFieldDefinition\" });\n\nexport const bylineFieldListResponseSchema = z\n\t.object({\n\t\titems: z.array(bylineFieldDefinitionSchema),\n\t})\n\t.meta({ id: \"BylineFieldListResponse\" });\n\n/**\n * Response shape for `GET /api/admin/byline-fields/[slug]/usage`.\n *\n * `translatableValueCount` counts rows in `_emdash_byline_field_values`.\n * `groupValueCount` counts rows in `_emdash_byline_field_group_values`.\n * `totalAffectedRows` is the sum — what the destructive-delete confirm\n * dialog surfaces. Both individual counts are exposed for diagnostic\n * value (e.g. inconsistency with the field's current `translatable`\n * flag would show non-zero on the \"wrong\" side).\n */\nexport const bylineFieldUsageResponseSchema = z\n\t.object({\n\t\ttranslatableValueCount: z.number().int().nonnegative(),\n\t\tgroupValueCount: z.number().int().nonnegative(),\n\t\ttotalAffectedRows: z.number().int().nonnegative(),\n\t})\n\t.meta({ id: \"BylineFieldUsageResponse\" });\n","import { z } from \"zod\";\n\nimport { localeCode } from \"./common.js\";\n\nconst slugPattern = /^[a-z][a-z0-9_]*$/;\nconst collectionSlug = z\n\t.string()\n\t.min(1)\n\t.max(63)\n\t.regex(slugPattern, \"Invalid collection slug format\");\n\nexport const createRelationBody = z\n\t.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.max(63)\n\t\t\t.regex(slugPattern, \"Name must be lowercase alphanumeric with underscores\"),\n\t\tparentCollection: collectionSlug.optional(),\n\t\tchildCollection: collectionSlug.optional(),\n\t\tparentLabel: z.string().min(1).max(200),\n\t\tchildLabel: z.string().min(1).max(200),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t// A translation inherits its structural fields (name, parentCollection,\n\t// childCollection) from the source relation, so the handler ignores any\n\t// collections supplied alongside `translationOf`. Require them only when\n\t// minting a base relation, so callers aren't forced to pass discarded values.\n\t.refine(\n\t\t(body) =>\n\t\t\tbody.translationOf !== undefined ||\n\t\t\t(body.parentCollection !== undefined && body.childCollection !== undefined),\n\t\t{ message: \"parentCollection and childCollection are required unless translationOf is set\" },\n\t)\n\t.meta({ id: \"CreateRelationBody\" });\n\nexport const updateRelationBody = z\n\t.object({\n\t\tparentLabel: z.string().min(1).max(200).optional(),\n\t\tchildLabel: z.string().min(1).max(200).optional(),\n\t})\n\t// Reject empty payloads: an update touching no field is a client mistake, not\n\t// a successful no-op. Without this, `{}` validates and the handler returns 200\n\t// with the unchanged row, so a typo'd payload looks like it landed.\n\t.refine((body) => body.parentLabel !== undefined || body.childLabel !== undefined, {\n\t\tmessage: \"At least one of parentLabel or childLabel is required\",\n\t})\n\t.meta({ id: \"UpdateRelationBody\" });\n\nexport const setReferenceChildrenBody = z\n\t.object({ childIds: z.array(z.string().min(1)).max(1000) })\n\t.meta({ id: \"SetReferenceChildrenBody\" });\n\nexport const relationDefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tparentCollection: z.string(),\n\t\tchildCollection: z.string(),\n\t\tparentLabel: z.string(),\n\t\tchildLabel: z.string(),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string(),\n\t})\n\t.meta({ id: \"RelationDef\" });\n\nexport const relationListResponseSchema = z\n\t.object({ relations: z.array(relationDefSchema) })\n\t.meta({ id: \"RelationListResponse\" });\n\nexport const relationResponseSchema = z\n\t.object({ relation: relationDefSchema })\n\t.meta({ id: \"RelationResponse\" });\n\nexport const relationTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t\tparentLabel: z.string(),\n\t\t\t\tchildLabel: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"RelationTranslations\" });\n\nexport const entryRefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tcollection: z.string(),\n\t\t// The actual locale of the resolved variant. When no variant matches the\n\t\t// requesting entry's locale, the ref falls back to another locale's row;\n\t\t// this field makes that substitution explicit instead of silently\n\t\t// presenting a wrong-locale entry under the requested context.\n\t\tlocale: z.string().nullable(),\n\t\tsortOrder: z.number().int().optional(),\n\t})\n\t.meta({ id: \"ReferenceEntryRef\" });\n\nexport const referenceChildrenResponseSchema = z\n\t.object({ children: z.array(entryRefSchema), nextCursor: z.string().optional() })\n\t.meta({ id: \"ReferenceChildrenResponse\" });\n\nexport const referenceParentsResponseSchema = z\n\t.object({ parents: z.array(entryRefSchema), nextCursor: z.string().optional() })\n\t.meta({ id: \"ReferenceParentsResponse\" });\n"],"mappings":";;;;;AAQA,MAAMA,2BAAyB,EAAE,KAAK;CAAC;CAAO;CAAO;CAAO;CAAY;CAAS,CAAC;;AAGlF,MAAMC,2BAAyB,EAAE,OAAO;CACvC,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,MAAM,EAAE,QAAQ,aAAa;CAC7B,UAAU,EAAE,OAAO;EAClB,gBAAgB,EAAE,QAAQ;EAC1B,mBAAmB,EAAE,QAAQ;EAC7B,YAAY,EAAE,MAAMD,yBAAuB,CAAC,UAAU;EACtD,CAAC;CACF,yBAAyB,EAAE,KAAK,CAAC,YAAY,iBAAiB,CAAC,CAAC,UAAU;CAC1E,CAAC;;AAGF,MAAM,2BAA2B,EAAE,OAAO;CACzC,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,MAAM,EAAE,QAAQ,aAAa;CAC7B,UAAU,EAAE,OAAO;EAClB,gBAAgB,EAAE,QAAQ;EAC1B,mBAAmB,EAAE,QAAQ;EAC7B,WAAW,EAAE,QAAQ;EACrB,YAAY,E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AE,QAAQ;CACd,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,YAAY,EAAE,QAAQ;CAKtB,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;CACtC,CAAC,CACD,KAAK,EAAE,IAAI,qBAAqB,CAAC;AAEnC,MAAa,kCAAkC,EAC7C,OAAO;CAAE,UAAU,EAAE,MAAM,eAAe;CAAE,YAAY,EAAE,QAAQ,CAAC,UAAU;CAAE,CAAC,CAChF,KAAK,EAAE,IAAI,6BAA6B,CAAC;AAE3C,MAAa,iCAAiC,EAC5C,OAAO;CAAE,SAAS,EAAE,MAAM,eAAe;CAAE,YAAY,EAAE,QAAQ,CAAC,UAAU;CAAE,CAAC,CAC/E,KAAK,EAAE,IAAI,4BAA4B,CAAC"}
1
+ {"version":3,"file":"relations-Bw_E1TXo.mjs","names":["authenticatorTransport","registrationCredential"],"sources":["../src/api/schemas/auth.ts","../src/api/schemas/import.ts","../src/api/schemas/setup.ts","../src/api/schemas/byline-fields.ts","../src/api/schemas/relations.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { roleLevel } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// WebAuthn credential schemas (matching @emdash-cms/auth/passkey types)\n// ---------------------------------------------------------------------------\n\nconst authenticatorTransport = z.enum([\"usb\", \"nfc\", \"ble\", \"internal\", \"hybrid\"]);\n\n/** RegistrationResponse — sent by the browser after navigator.credentials.create() */\nconst registrationCredential = z.object({\n\tid: z.string(),\n\trawId: z.string(),\n\ttype: z.literal(\"public-key\"),\n\tresponse: z.object({\n\t\tclientDataJSON: z.string(),\n\t\tattestationObject: z.string(),\n\t\ttransports: z.array(authenticatorTransport).optional(),\n\t}),\n\tauthenticatorAttachment: z.enum([\"platform\", \"cross-platform\"]).optional(),\n});\n\n/** AuthenticationResponse — sent by the browser after navigator.credentials.get() */\nconst authenticationCredential = z.object({\n\tid: z.string(),\n\trawId: z.string(),\n\ttype: z.literal(\"public-key\"),\n\tresponse: z.object({\n\t\tclientDataJSON: z.string(),\n\t\tauthenticatorData: z.string(),\n\t\tsignature: z.string(),\n\t\tuserHandle: z.string().optional(),\n\t}),\n\tauthenticatorAttachment: z.enum([\"platform\", \"cross-platform\"]).optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Auth: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const signupRequestBody = z\n\t.object({\n\t\temail: z.string().email(),\n\t})\n\t.meta({ id: \"SignupRequestBody\" });\n\nexport const signupCompleteBody = z\n\t.object({\n\t\ttoken: z.string().min(1),\n\t\tcredential: registrationCredential,\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"SignupCompleteBody\" });\n\nexport const inviteCreateBody = z\n\t.object({\n\t\temail: z.string().email(),\n\t\trole: roleLevel.optional(),\n\t})\n\t.meta({ id: \"InviteCreateBody\" });\n\nexport const inviteRegisterOptionsBody = z\n\t.object({\n\t\ttoken: z.string().min(1),\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"InviteRegisterOptionsBody\" });\n\nexport const inviteCompleteBody = z\n\t.object({\n\t\ttoken: z.string().min(1),\n\t\tcredential: registrationCredential,\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"InviteCompleteBody\" });\n\nexport const magicLinkSendBody = z\n\t.object({\n\t\temail: z.string().email(),\n\t})\n\t.meta({ id: \"MagicLinkSendBody\" });\n\nexport const passkeyOptionsBody = z\n\t.object({\n\t\temail: z.string().email().optional(),\n\t})\n\t.meta({ id: \"PasskeyOptionsBody\" });\n\nexport const passkeyVerifyBody = z\n\t.object({\n\t\tcredential: authenticationCredential,\n\t})\n\t.meta({ id: \"PasskeyVerifyBody\" });\n\nexport const passkeyRegisterOptionsBody = z\n\t.object({\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"PasskeyRegisterOptionsBody\" });\n\nexport const passkeyRegisterVerifyBody = z\n\t.object({\n\t\tcredential: registrationCredential,\n\t\tname: z.string().optional(),\n\t})\n\t.meta({ id: \"PasskeyRegisterVerifyBody\" });\n\nexport const passkeyRenameBody = z\n\t.object({\n\t\tname: z.string().min(1),\n\t})\n\t.meta({ id: \"PasskeyRenameBody\" });\n\nexport const authMeActionBody = z\n\t.object({\n\t\taction: z.string().min(1),\n\t})\n\t.meta({ id: \"AuthMeActionBody\" });\n","import { z } from \"zod\";\n\nimport { httpUrl } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Import\n// ---------------------------------------------------------------------------\n\nexport const importProbeBody = z.object({\n\turl: httpUrl,\n});\n\nexport const wpPluginAnalyzeBody = z.object({\n\turl: httpUrl,\n\ttoken: z.string().min(1),\n});\n\nexport const wpPluginExecuteBody = z.object({\n\turl: httpUrl,\n\ttoken: z.string().min(1),\n\tconfig: z.record(z.string(), z.unknown()),\n\t// --- Chunked mode (issue #475). Absent phase = single-shot legacy run. ---\n\t// The admin drives the import in a loop of bounded requests; cross-chunk\n\t// state travels with the client so the server stays stateless.\n\tphase: z.enum([\"content\", \"comments\", \"finalize\"]).optional(),\n\t/** Position within the phase: post-type index + WP page (content), page (comments) */\n\tcursor: z\n\t\t.object({\n\t\t\tpostTypeIndex: z.number().int().min(0).default(0),\n\t\t\tpage: z.number().int().min(1).default(1),\n\t\t})\n\t\t.optional(),\n\t/** WP post ID -> created EmDash item, accumulated across content chunks */\n\tidMap: z\n\t\t.record(z.string(), z.object({ id: z.string().min(1), collection: z.string().min(1) }))\n\t\t.optional(),\n\t/** Source translation group -> EmDash item ID, accumulated across content chunks */\n\ttranslationGroups: z.record(z.string(), z.string().min(1)).optional(),\n\t/** WP comment ID -> EmDash root comment ID, accumulated across comment chunks */\n\tcommentRoots: z.record(z.string(), z.string().min(1)).optional(),\n});\n\nexport const wpPrepareBody = z.object({\n\tpostTypes: z.array(\n\t\tz.object({\n\t\t\tname: z.string().min(1),\n\t\t\tcollection: z.string().min(1),\n\t\t\tfields: z\n\t\t\t\t.array(\n\t\t\t\t\tz.object({\n\t\t\t\t\t\tslug: z.string().min(1),\n\t\t\t\t\t\tlabel: z.string().min(1),\n\t\t\t\t\t\ttype: z.string().min(1),\n\t\t\t\t\t\trequired: z.boolean(),\n\t\t\t\t\t\tsearchable: z.boolean().optional(),\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.optional(),\n\t\t}),\n\t),\n});\n\nexport const wpMediaImportBody = z.object({\n\tattachments: z.array(z.record(z.string(), z.unknown())),\n\tstream: z.boolean().optional(),\n});\n\nexport const wpRewriteUrlsBody = z.object({\n\turlMap: z.record(z.string(), z.string()),\n\tcollections: z.array(z.string()).optional(),\n});\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Setup\n// ---------------------------------------------------------------------------\n\n/** Registration credential — duplicated reference for setup flow.\n * The canonical definition lives in auth.ts but setup needs it independently\n * because setup runs before auth is configured. */\nconst authenticatorTransport = z.enum([\"usb\", \"nfc\", \"ble\", \"internal\", \"hybrid\"]);\n\nconst registrationCredential = z.object({\n\tid: z.string(),\n\trawId: z.string(),\n\ttype: z.literal(\"public-key\"),\n\tresponse: z.object({\n\t\tclientDataJSON: z.string(),\n\t\tattestationObject: z.string(),\n\t\ttransports: z.array(authenticatorTransport).optional(),\n\t}),\n\tauthenticatorAttachment: z.enum([\"platform\", \"cross-platform\"]).optional(),\n});\n\nexport const setupBody = z.object({\n\ttitle: z.string().min(1),\n\ttagline: z.string().optional(),\n\tincludeContent: z.boolean(),\n});\n\nexport const setupAdminBody = z.object({\n\temail: z.string().email(),\n\tname: z.string().optional(),\n});\n\nexport const setupAdminVerifyBody = z.object({\n\tcredential: registrationCredential,\n});\n\nexport const atprotoLoginBody = z.object({\n\thandle: z.string().trim().min(1),\n});\n\nexport const setupAtprotoAdminBody = z.object({\n\thandle: z.string().trim().min(1),\n});\n","/**\n * Zod schemas for the byline-fields admin API (Discussion #1174, Phase 4).\n *\n * Reserved-slug + identifier validation runs at the zod layer so the\n * route returns a clean 400 (`VALIDATION_ERROR` from `parseBody`) rather\n * than bubbling a registry-level `BylineSchemaError` (\"RESERVED_SLUG\" /\n * \"INVALID_SLUG\"). The registry repeats the same checks for non-HTTP\n * callers (seeds, scripts) — see `BylineSchemaRegistry.validateSlug`.\n *\n * Field types are constrained to the v1 subset declared in\n * `BYLINE_FIELD_TYPES`. Adding a type to the union there will require a\n * corresponding update to this enum.\n */\n\nimport { z } from \"zod\";\n\nimport { BYLINE_FIELD_TYPES, RESERVED_BYLINE_FIELD_SLUGS } from \"../../schema/types.js\";\n\n/**\n * Slug pattern for byline field definitions — matches the identifier rule\n * used by `validateIdentifier` (and `slugPattern` in `common.ts`).\n * Lowercase letters, digits, and underscores; must start with a letter.\n */\nconst bylineFieldSlugPattern = /^[a-z][a-z0-9_]*$/;\n\n/** Hard cap on a slug — mirrors `BylineSchemaRegistry.MAX_SLUG_LENGTH`. */\nconst MAX_SLUG_LENGTH = 63;\n/** Hard cap on a label — mirrors `BylineSchemaRegistry.MAX_LABEL_LENGTH`. */\nconst MAX_LABEL_LENGTH = 200;\n/** Hard cap on a select field's `options` list. */\nconst MAX_SELECT_OPTIONS = 200;\n\nconst RESERVED_SET: ReadonlySet<string> = new Set(RESERVED_BYLINE_FIELD_SLUGS);\n\n// Enumerate the v1 byline field types explicitly so zod gets the exact\n// literal union for `z.infer<>`. Mirrors `BYLINE_FIELD_TYPES`; CI's\n// type-checker catches drift via the satisfies/import below.\nconst bylineFieldTypeValues = z.enum([\"string\", \"text\", \"url\", \"boolean\", \"select\"]);\n// Compile-time guard: a drift here trips the satisfies check.\ntype _BylineFieldTypeDriftCheck =\n\t(typeof BYLINE_FIELD_TYPES)[number] extends z.infer<typeof bylineFieldTypeValues>\n\t\t? z.infer<typeof bylineFieldTypeValues> extends (typeof BYLINE_FIELD_TYPES)[number]\n\t\t\t? true\n\t\t\t: never\n\t\t: never;\nconst _bylineFieldTypeDriftCheck: _BylineFieldTypeDriftCheck = true;\nvoid _bylineFieldTypeDriftCheck;\n\n/**\n * Validation payload for a byline custom field. v1 only exposes\n * `options` (used by `select`-type fields). Empty/duplicate options are\n * rejected at the registry layer; the zod layer only enforces shape and\n * caps. Future field types may add keys here.\n */\nconst bylineFieldValidationSchema = z\n\t.object({\n\t\toptions: z\n\t\t\t.array(z.string().min(1))\n\t\t\t.min(1, \"select options must contain at least one entry\")\n\t\t\t.max(MAX_SELECT_OPTIONS, `select options cannot exceed ${MAX_SELECT_OPTIONS} entries`)\n\t\t\t.optional(),\n\t})\n\t.strict()\n\t.nullable();\n\n/**\n * Slug validation chain shared by create + reorder bodies. Centralised so\n * the reserved-slug message and pattern are identical everywhere.\n */\nconst bylineFieldSlug = z\n\t.string()\n\t.min(1, \"Byline field slug is required\")\n\t.max(MAX_SLUG_LENGTH, `Byline field slug must be ${MAX_SLUG_LENGTH} characters or less`)\n\t.regex(\n\t\tbylineFieldSlugPattern,\n\t\t\"Byline field slug must contain only lowercase letters, digits, and underscores, and start with a letter\",\n\t)\n\t.refine((slug) => !RESERVED_SET.has(slug), {\n\t\t// Surface the offending slug in the validation issue path-message\n\t\t// for easier debugging from the admin UI's error toast.\n\t\tmessage: \"Byline field slug is reserved\",\n\t});\n\nconst bylineFieldLabel = z\n\t.string()\n\t.min(1, \"Byline field label is required\")\n\t.max(MAX_LABEL_LENGTH, `Byline field label must be ${MAX_LABEL_LENGTH} characters or less`);\n\n// ---------------------------------------------------------------------------\n// Request bodies\n// ---------------------------------------------------------------------------\n\nexport const bylineFieldCreateBody = z\n\t.object({\n\t\tslug: bylineFieldSlug,\n\t\tlabel: bylineFieldLabel,\n\t\ttype: bylineFieldTypeValues,\n\t\trequired: z.boolean().optional(),\n\t\t/**\n\t\t * Whether values are stored per-locale (translatable, default) or\n\t\t * shared across the translation group. See `BylineFieldDefinition`.\n\t\t */\n\t\ttranslatable: z.boolean().optional(),\n\t\tvalidation: bylineFieldValidationSchema.optional(),\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"BylineFieldCreateBody\" });\n\n/**\n * Update body. `slug` and `type` are intentionally absent — both are\n * immutable post-create (changing them would invalidate stored values).\n * `translatable` flips are gated at the registry layer when value rows\n * exist (`TRANSLATABLE_LOCKED`).\n */\nexport const bylineFieldUpdateBody = z\n\t.object({\n\t\tlabel: bylineFieldLabel.optional(),\n\t\trequired: z.boolean().optional(),\n\t\ttranslatable: z.boolean().optional(),\n\t\tvalidation: bylineFieldValidationSchema.optional(),\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"BylineFieldUpdateBody\" });\n\nexport const bylineFieldReorderBody = z\n\t.object({\n\t\t/**\n\t\t * Exact set of currently registered slugs in the desired order.\n\t\t * The registry rejects any drift (`REORDER_MISMATCH`); the zod\n\t\t * layer enforces slug shape only. An empty array is permitted —\n\t\t * `reorderFields([])` is a valid no-op when zero fields are\n\t\t * registered (registry contract). Rejecting empty here would\n\t\t * produce a spurious 400 for an admin UI that submits a reorder\n\t\t * after deleting the last field.\n\t\t */\n\t\tslugs: z.array(bylineFieldSlug),\n\t})\n\t.strict()\n\t.meta({ id: \"BylineFieldReorderBody\" });\n\n// ---------------------------------------------------------------------------\n// Response shapes\n// ---------------------------------------------------------------------------\n\nexport const bylineFieldDefinitionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\ttype: bylineFieldTypeValues,\n\t\trequired: z.boolean(),\n\t\ttranslatable: z.boolean(),\n\t\tvalidation: z\n\t\t\t.object({\n\t\t\t\toptions: z.array(z.string()).optional(),\n\t\t\t})\n\t\t\t.nullable(),\n\t\tsortOrder: z.number().int(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"BylineFieldDefinition\" });\n\nexport const bylineFieldListResponseSchema = z\n\t.object({\n\t\titems: z.array(bylineFieldDefinitionSchema),\n\t})\n\t.meta({ id: \"BylineFieldListResponse\" });\n\n/**\n * Response shape for `GET /api/admin/byline-fields/[slug]/usage`.\n *\n * `translatableValueCount` counts rows in `_emdash_byline_field_values`.\n * `groupValueCount` counts rows in `_emdash_byline_field_group_values`.\n * `totalAffectedRows` is the sum — what the destructive-delete confirm\n * dialog surfaces. Both individual counts are exposed for diagnostic\n * value (e.g. inconsistency with the field's current `translatable`\n * flag would show non-zero on the \"wrong\" side).\n */\nexport const bylineFieldUsageResponseSchema = z\n\t.object({\n\t\ttranslatableValueCount: z.number().int().nonnegative(),\n\t\tgroupValueCount: z.number().int().nonnegative(),\n\t\ttotalAffectedRows: z.number().int().nonnegative(),\n\t})\n\t.meta({ id: \"BylineFieldUsageResponse\" });\n","import { z } from \"zod\";\n\nimport { localeCode } from \"./common.js\";\n\nconst slugPattern = /^[a-z][a-z0-9_]*$/;\nconst collectionSlug = z\n\t.string()\n\t.min(1)\n\t.max(63)\n\t.regex(slugPattern, \"Invalid collection slug format\");\n\nexport const createRelationBody = z\n\t.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.max(63)\n\t\t\t.regex(slugPattern, \"Name must be lowercase alphanumeric with underscores\"),\n\t\tparentCollection: collectionSlug.optional(),\n\t\tchildCollection: collectionSlug.optional(),\n\t\tparentLabel: z.string().min(1).max(200),\n\t\tchildLabel: z.string().min(1).max(200),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t// A translation inherits its structural fields (name, parentCollection,\n\t// childCollection) from the source relation, so the handler ignores any\n\t// collections supplied alongside `translationOf`. Require them only when\n\t// minting a base relation, so callers aren't forced to pass discarded values.\n\t.refine(\n\t\t(body) =>\n\t\t\tbody.translationOf !== undefined ||\n\t\t\t(body.parentCollection !== undefined && body.childCollection !== undefined),\n\t\t{ message: \"parentCollection and childCollection are required unless translationOf is set\" },\n\t)\n\t.meta({ id: \"CreateRelationBody\" });\n\nexport const updateRelationBody = z\n\t.object({\n\t\tparentLabel: z.string().min(1).max(200).optional(),\n\t\tchildLabel: z.string().min(1).max(200).optional(),\n\t})\n\t// Reject empty payloads: an update touching no field is a client mistake, not\n\t// a successful no-op. Without this, `{}` validates and the handler returns 200\n\t// with the unchanged row, so a typo'd payload looks like it landed.\n\t.refine((body) => body.parentLabel !== undefined || body.childLabel !== undefined, {\n\t\tmessage: \"At least one of parentLabel or childLabel is required\",\n\t})\n\t.meta({ id: \"UpdateRelationBody\" });\n\nexport const setReferenceChildrenBody = z\n\t.object({ childIds: z.array(z.string().min(1)).max(1000) })\n\t.meta({ id: \"SetReferenceChildrenBody\" });\n\nexport const relationDefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tparentCollection: z.string(),\n\t\tchildCollection: z.string(),\n\t\tparentLabel: z.string(),\n\t\tchildLabel: z.string(),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string(),\n\t})\n\t.meta({ id: \"RelationDef\" });\n\nexport const relationListResponseSchema = z\n\t.object({ relations: z.array(relationDefSchema) })\n\t.meta({ id: \"RelationListResponse\" });\n\nexport const relationResponseSchema = z\n\t.object({ relation: relationDefSchema })\n\t.meta({ id: \"RelationResponse\" });\n\nexport const relationTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t\tparentLabel: z.string(),\n\t\t\t\tchildLabel: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"RelationTranslations\" });\n\nexport const entryRefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tcollection: z.string(),\n\t\t// The actual locale of the resolved variant. When no variant matches the\n\t\t// requesting entry's locale, the ref falls back to another locale's row;\n\t\t// this field makes that substitution explicit instead of silently\n\t\t// presenting a wrong-locale entry under the requested context.\n\t\tlocale: z.string().nullable(),\n\t\tsortOrder: z.number().int().optional(),\n\t})\n\t.meta({ id: \"ReferenceEntryRef\" });\n\nexport const referenceChildrenResponseSchema = z\n\t.object({ children: z.array(entryRefSchema), nextCursor: z.string().optional() })\n\t.meta({ id: \"ReferenceChildrenResponse\" });\n\nexport const referenceParentsResponseSchema = z\n\t.object({ parents: z.array(entryRefSchema), nextCursor: z.string().optional() })\n\t.meta({ id: \"ReferenceParentsResponse\" });\n"],"mappings":";;;;;AAQA,MAAMA,2BAAyB,EAAE,KAAK;CAAC;CAAO;CAAO;CAAO;CAAY;CAAS,CAAC;;AAGlF,MAAMC,2BAAyB,EAAE,OAAO;CACvC,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,MAAM,EAAE,QAAQ,aAAa;CAC7B,UAAU,EAAE,OAAO;EAClB,gBAAgB,EAAE,QAAQ;EAC1B,mBAAmB,EAAE,QAAQ;EAC7B,YAAY,EAAE,MAAMD,yBAAuB,CAAC,UAAU;EACtD,CAAC;CACF,yBAAyB,EAAE,KAAK,CAAC,YAAY,iBAAiB,CAAC,CAAC,UAAU;CAC1E,CAAC;;AAGF,MAAM,2BAA2B,EAAE,OAAO;CACzC,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,MAAM,EAAE,QAAQ,aAAa;CAC7B,UAAU,EAAE,OAAO;EAClB,gBAAgB,EAAE,QAAQ;EAC1B,mBAAmB,EAAE,QAAQ;EAC7B,WAAW,EAAE,QAAQ;EACrB,YAAY,EAAE,QAAQ,CAAC,UAAU;EACjC,CAAC;CACF,yBAAyB,EAAE,KAAK,CAAC,YAAY,iBAAiB,CAAC,CAAC,UAAU;CAC1E,CAAC;AAMF,MAAa,oBAAoB,EAC/B,OAAO,EACP,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,CAAC,CACD,KAAK,EAAE,IAAI,qBAAqB,CAAC;AAEnC,MAAa,qBAAqB,EAChC,OAAO;CACP,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE;CACxB,YAAYC;CACZ,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC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AC;AAE3C,MAAa,iCAAiC,EAC5C,OAAO;CAAE,SAAS,EAAE,MAAM,eAAe;CAAE,YAAY,EAAE,QAAQ,CAAC,UAAU;CAAE,CAAC,CAC/E,KAAK,EAAE,IAAI,4BAA4B,CAAC"}
@@ -4,7 +4,7 @@ import { z } from "zod";
4
4
  /** Valid role level values */
5
5
  declare const VALID_ROLE_LEVELS: Set<number>;
6
6
  /** Role level — coerces string/number to valid RoleLevel (10|20|30|40|50) */
7
- declare const roleLevel: z.ZodCoercedNumber<unknown> & z.ZodType<50 | 10 | 20 | 30 | 40, unknown, z.core.$ZodTypeInternals<50 | 10 | 20 | 30 | 40, unknown>>;
7
+ declare const roleLevel: z.ZodCoercedNumber<unknown> & z.ZodType<10 | 20 | 30 | 40 | 50, unknown, z.core.$ZodTypeInternals<10 | 20 | 30 | 40 | 50, unknown>>;
8
8
  /** Pagination query params — cursor-based */
9
9
  declare const cursorPaginationQuery: z.ZodObject<{
10
10
  cursor: z.ZodOptional<z.ZodString>;
@@ -741,6 +741,10 @@ declare const mediaConfirmResponseSchema: z.ZodObject<{
741
741
  url: z.ZodString;
742
742
  }, z.core.$strip>;
743
743
  }, z.core.$strip>;
744
+ declare const mediaStreamUploadResponseSchema: z.ZodObject<{
745
+ uploaded: z.ZodLiteral<true>;
746
+ size: z.ZodNumber;
747
+ }, z.core.$strip>;
744
748
  //#endregion
745
749
  //#region src/api/schemas/media-usage.d.ts
746
750
  declare const mediaUsageCoverageStatusSchema: z.ZodEnum<{
@@ -954,15 +958,17 @@ declare const createCollectionBody: z.ZodObject<{
954
958
  description: z.ZodOptional<z.ZodString>;
955
959
  icon: z.ZodOptional<z.ZodString>;
956
960
  supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
957
- search: "search";
958
961
  drafts: "drafts";
959
962
  revisions: "revisions";
960
963
  preview: "preview";
961
964
  scheduling: "scheduling";
965
+ search: "search";
962
966
  }>>>;
963
967
  source: z.ZodOptional<z.ZodString>;
964
968
  urlPattern: z.ZodOptional<z.ZodString>;
965
969
  hasSeo: z.ZodOptional<z.ZodBoolean>;
970
+ hidden: z.ZodOptional<z.ZodBoolean>;
971
+ sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
966
972
  }, z.core.$strip>;
967
973
  declare const updateCollectionBody: z.ZodObject<{
968
974
  label: z.ZodOptional<z.ZodString>;
@@ -970,14 +976,16 @@ declare const updateCollectionBody: z.ZodObject<{
970
976
  description: z.ZodOptional<z.ZodString>;
971
977
  icon: z.ZodOptional<z.ZodString>;
972
978
  supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
973
- search: "search";
974
979
  drafts: "drafts";
975
980
  revisions: "revisions";
976
981
  preview: "preview";
977
982
  scheduling: "scheduling";
983
+ search: "search";
978
984
  }>>>;
979
985
  urlPattern: z.ZodOptional<z.ZodNullable<z.ZodString>>;
980
986
  hasSeo: z.ZodOptional<z.ZodBoolean>;
987
+ hidden: z.ZodOptional<z.ZodBoolean>;
988
+ sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
981
989
  commentsEnabled: z.ZodOptional<z.ZodBoolean>;
982
990
  commentsModeration: z.ZodOptional<z.ZodEnum<{
983
991
  all: "all";
@@ -1107,6 +1115,9 @@ declare const updateFieldBody: z.ZodObject<{
1107
1115
  declare const fieldReorderBody: z.ZodObject<{
1108
1116
  fieldSlugs: z.ZodArray<z.ZodString>;
1109
1117
  }, z.core.$strip>;
1118
+ declare const collectionReorderBody: z.ZodObject<{
1119
+ slugs: z.ZodArray<z.ZodString>;
1120
+ }, z.core.$strip>;
1110
1121
  declare const orphanRegisterBody: z.ZodObject<{
1111
1122
  label: z.ZodOptional<z.ZodString>;
1112
1123
  labelSingular: z.ZodOptional<z.ZodString>;
@@ -1129,6 +1140,8 @@ declare const collectionSchema: z.ZodObject<{
1129
1140
  source: z.ZodNullable<z.ZodString>;
1130
1141
  urlPattern: z.ZodNullable<z.ZodString>;
1131
1142
  hasSeo: z.ZodBoolean;
1143
+ hidden: z.ZodBoolean;
1144
+ sortOrder: z.ZodNullable<z.ZodNumber>;
1132
1145
  createdAt: z.ZodString;
1133
1146
  updatedAt: z.ZodString;
1134
1147
  }, z.core.$strip>;
@@ -1179,6 +1192,8 @@ declare const collectionResponseSchema: z.ZodObject<{
1179
1192
  source: z.ZodNullable<z.ZodString>;
1180
1193
  urlPattern: z.ZodNullable<z.ZodString>;
1181
1194
  hasSeo: z.ZodBoolean;
1195
+ hidden: z.ZodBoolean;
1196
+ sortOrder: z.ZodNullable<z.ZodNumber>;
1182
1197
  createdAt: z.ZodString;
1183
1198
  updatedAt: z.ZodString;
1184
1199
  }, z.core.$strip>;
@@ -1195,6 +1210,8 @@ declare const collectionWithFieldsResponseSchema: z.ZodObject<{
1195
1210
  source: z.ZodNullable<z.ZodString>;
1196
1211
  urlPattern: z.ZodNullable<z.ZodString>;
1197
1212
  hasSeo: z.ZodBoolean;
1213
+ hidden: z.ZodBoolean;
1214
+ sortOrder: z.ZodNullable<z.ZodNumber>;
1198
1215
  createdAt: z.ZodString;
1199
1216
  updatedAt: z.ZodString;
1200
1217
  fields: z.ZodArray<z.ZodObject<{
@@ -1246,6 +1263,8 @@ declare const collectionListResponseSchema: z.ZodObject<{
1246
1263
  source: z.ZodNullable<z.ZodString>;
1247
1264
  urlPattern: z.ZodNullable<z.ZodString>;
1248
1265
  hasSeo: z.ZodBoolean;
1266
+ hidden: z.ZodBoolean;
1267
+ sortOrder: z.ZodNullable<z.ZodNumber>;
1249
1268
  createdAt: z.ZodString;
1250
1269
  updatedAt: z.ZodString;
1251
1270
  }, z.core.$strip>>;
@@ -1489,7 +1508,7 @@ declare const signupCompleteBody: z.ZodObject<{
1489
1508
  }, z.core.$strip>;
1490
1509
  declare const inviteCreateBody: z.ZodObject<{
1491
1510
  email: z.ZodString;
1492
- role: z.ZodOptional<z.ZodCoercedNumber<unknown> & z.ZodType<50 | 10 | 20 | 30 | 40, unknown, z.core.$ZodTypeInternals<50 | 10 | 20 | 30 | 40, unknown>>>;
1511
+ role: z.ZodOptional<z.ZodCoercedNumber<unknown> & z.ZodType<10 | 20 | 30 | 40 | 50, unknown, z.core.$ZodTypeInternals<10 | 20 | 30 | 40 | 50, unknown>>>;
1493
1512
  }, z.core.$strip>;
1494
1513
  declare const inviteRegisterOptionsBody: z.ZodObject<{
1495
1514
  token: z.ZodString;
@@ -1581,8 +1600,8 @@ declare const authMeActionBody: z.ZodObject<{
1581
1600
  * from `referenceCollection` + `referenceId` (a translation_group id).
1582
1601
  */
1583
1602
  declare const menuItemTypeEnum: z.ZodEnum<{
1584
- custom: "custom";
1585
1603
  collection: "collection";
1604
+ custom: "custom";
1586
1605
  page: "page";
1587
1606
  post: "post";
1588
1607
  taxonomy: "taxonomy";
@@ -1598,8 +1617,8 @@ declare const updateMenuBody: z.ZodObject<{
1598
1617
  }, z.core.$strict>;
1599
1618
  declare const createMenuItemBody: z.ZodObject<{
1600
1619
  type: z.ZodEnum<{
1601
- custom: "custom";
1602
1620
  collection: "collection";
1621
+ custom: "custom";
1603
1622
  page: "page";
1604
1623
  post: "post";
1605
1624
  taxonomy: "taxonomy";
@@ -1727,6 +1746,17 @@ declare const updateTermBody: z.ZodObject<{
1727
1746
  parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1728
1747
  description: z.ZodOptional<z.ZodString>;
1729
1748
  }, z.core.$strip>;
1749
+ declare const reorderTermsBody: z.ZodObject<{
1750
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1751
+ ids: z.ZodArray<z.ZodString>;
1752
+ }, z.core.$strict>;
1753
+ declare const termListQuery: z.ZodObject<{
1754
+ locale: z.ZodOptional<z.ZodString>;
1755
+ includeCounts: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodEnum<{
1756
+ true: "true";
1757
+ false: "false";
1758
+ }>, z.ZodTransform<boolean, "true" | "false">>>>;
1759
+ }, z.core.$strip>;
1730
1760
  declare const taxonomyDefSchema: z.ZodObject<{
1731
1761
  id: z.ZodString;
1732
1762
  name: z.ZodString;
@@ -1793,6 +1823,9 @@ declare const termResponseSchema: z.ZodObject<{
1793
1823
  translationGroup: z.ZodNullable<z.ZodString>;
1794
1824
  }, z.core.$strip>;
1795
1825
  }, z.core.$strip>;
1826
+ declare const termReorderResponseSchema: z.ZodObject<{
1827
+ reordered: z.ZodLiteral<true>;
1828
+ }, z.core.$strip>;
1796
1829
  declare const termGetResponseSchema: z.ZodObject<{
1797
1830
  term: z.ZodObject<{
1798
1831
  id: z.ZodString;
@@ -1978,6 +2011,11 @@ declare const searchEnableBody: z.ZodObject<{
1978
2011
  collection: z.ZodString;
1979
2012
  enabled: z.ZodBoolean;
1980
2013
  weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2014
+ tokenize: z.ZodOptional<z.ZodEnum<{
2015
+ "porter unicode61": "porter unicode61";
2016
+ unicode61: "unicode61";
2017
+ trigram: "trigram";
2018
+ }>>;
1981
2019
  }, z.core.$strip>;
1982
2020
  declare const searchResultSchema: z.ZodObject<{
1983
2021
  collection: z.ZodString;
@@ -2014,8 +2052,8 @@ declare const wpPluginExecuteBody: z.ZodObject<{
2014
2052
  token: z.ZodString;
2015
2053
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2016
2054
  phase: z.ZodOptional<z.ZodEnum<{
2017
- content: "content";
2018
2055
  comments: "comments";
2056
+ content: "content";
2019
2057
  finalize: "finalize";
2020
2058
  }>>;
2021
2059
  cursor: z.ZodOptional<z.ZodObject<{
@@ -2100,15 +2138,15 @@ declare const usersListQuery: z.ZodObject<{
2100
2138
  declare const userUpdateBody: z.ZodObject<{
2101
2139
  name: z.ZodOptional<z.ZodString>;
2102
2140
  email: z.ZodOptional<z.ZodString>;
2103
- role: z.ZodOptional<z.ZodCoercedNumber<unknown> & z.ZodType<50 | 10 | 20 | 30 | 40, unknown, z.core.$ZodTypeInternals<50 | 10 | 20 | 30 | 40, unknown>>>;
2141
+ role: z.ZodOptional<z.ZodCoercedNumber<unknown> & z.ZodType<10 | 20 | 30 | 40 | 50, unknown, z.core.$ZodTypeInternals<10 | 20 | 30 | 40 | 50, unknown>>>;
2104
2142
  }, z.core.$strip>;
2105
2143
  declare const allowedDomainCreateBody: z.ZodObject<{
2106
2144
  domain: z.ZodString;
2107
- defaultRole: z.ZodCoercedNumber<unknown> & z.ZodType<50 | 10 | 20 | 30 | 40, unknown, z.core.$ZodTypeInternals<50 | 10 | 20 | 30 | 40, unknown>>;
2145
+ defaultRole: z.ZodCoercedNumber<unknown> & z.ZodType<10 | 20 | 30 | 40 | 50, unknown, z.core.$ZodTypeInternals<10 | 20 | 30 | 40 | 50, unknown>>;
2108
2146
  }, z.core.$strip>;
2109
2147
  declare const allowedDomainUpdateBody: z.ZodObject<{
2110
2148
  enabled: z.ZodOptional<z.ZodBoolean>;
2111
- defaultRole: z.ZodOptional<z.ZodCoercedNumber<unknown> & z.ZodType<50 | 10 | 20 | 30 | 40, unknown, z.core.$ZodTypeInternals<50 | 10 | 20 | 30 | 40, unknown>>>;
2149
+ defaultRole: z.ZodOptional<z.ZodCoercedNumber<unknown> & z.ZodType<10 | 20 | 30 | 40 | 50, unknown, z.core.$ZodTypeInternals<10 | 20 | 30 | 40 | 50, unknown>>>;
2112
2150
  }, z.core.$strip>;
2113
2151
  declare const userSchema: z.ZodObject<{
2114
2152
  id: z.ZodString;
@@ -2685,5 +2723,5 @@ declare const referenceParentsResponseSchema: z.ZodObject<{
2685
2723
  nextCursor: z.ZodOptional<z.ZodString>;
2686
2724
  }, z.core.$strip>;
2687
2725
  //#endregion
2688
- export { atprotoLoginBody as $, CONTENT_TYPE_RE as $n, passkeyRegisterVerifyBody as $t, notFoundPruneBody as A, updateCollectionBody as An, contentSeoSchema as Ar, termResponseSchema as At, reorderWidgetsBody as B, MediaUsageSummary as Bn, countResponseSchema as Br, menuSchema as Bt, bylineUpdateBody as C, fieldReorderBody as Cn, contentListQuery as Cr, createTaxonomyDefBody as Ct, notFoundEntrySchema as D, orphanedTableListResponseSchema as Dn, contentResponseSchema as Dr, taxonomyListResponseSchema as Dt, createRedirectBody as E, orphanRegisterBody as En, contentPublishBody as Er, taxonomyDefTranslationsSchema as Et, redirectSchema as F, MediaUsageEntryDetail as Fn, contentUpdateBody as Fr, createMenuBody as Ft, widgetSchema as G, mediaUsageEntryDetailSchema as Gn, localeFilterQuery as Gr, updateMenuItemBody as Gt, widgetAreaSchema as H, mediaUsageCoverageStatusSchema as Hn, deleteResponseSchema as Hr, menuWithItemsSchema as Ht, redirectsListQuery as I, MediaUsageOccurrenceDetail as In, trashedContentItemSchema as Ir, createMenuItemBody as It, userDetailSchema as J, mediaUsageRepairCollectionSummarySchema as Jn, slugPattern as Jr, inviteCreateBody as Jt, allowedDomainCreateBody as K, mediaUsageOccurrenceDetailSchema as Kn, offsetPaginationQuery as Kr, authMeActionBody as Kt, updateRedirectBody as L, MediaUsageRepairRequest as Ln, trashedContentListResponseSchema as Lr, menuItemSchema as Lt, notFoundSummaryResponseSchema as M, MediaUsageCoverage as Mn, contentTranslationSchema as Mr, termTranslationsSchema as Mt, notFoundSummarySchema as N, MediaUsageCoverageStatus as Nn, contentTranslationsResponseSchema as Nr, termWithCountSchema as Nt, notFoundListQuery as O, orphanedTableSchema as On, contentScheduleBody as Or, termGetResponseSchema as Ot, redirectListResponseSchema as P, MediaUsageDetailsResponse as Pn, contentTrashQuery as Pr, updateTermBody as Pt, usersListQuery as Q, mediaUsageSummarySchema as Qn, passkeyRegisterOptionsBody as Qt, createWidgetAreaBody as R, MediaUsageRepairResponse as Rn, VALID_ROLE_LEVELS as Rr, menuItemTypeEnum as Rt, bylineTranslationsResponseSchema as S, fieldListResponseSchema as Sn, contentItemSchema as Sr, updateSectionBody as St, contentBylineInputSchema as T, fieldSchema as Tn, contentPreviewUrlBody as Tr, taxonomyDefSchema as Tt, widgetAreaWithWidgetsAndCountSchema as U, mediaUsageDetailsQuery as Un, httpUrl as Ur, reorderMenuItemsBody as Ut, updateWidgetBody as V, mediaUsageCoverageSchema as Vn, cursorPaginationQuery as Vr, menuTranslationsSchema as Vt, widgetAreaWithWidgetsSchema as W, mediaUsageDetailsResponseSchema as Wn, localeCode as Wr, updateMenuBody as Wt, userSchema as X, mediaUsageRepairStatusSchema as Xn, magicLinkSendBody as Xt, userListResponseSchema as Y, mediaUsageRepairResponseSchema as Yn, successEnvelope as Yr, inviteRegisterOptionsBody as Yt, userUpdateBody as Z, mediaUsageSourceDetailSchema as Zn, passkeyOptionsBody as Zt, bylineCreateBody as _, collectionResponseSchema as _n, mediaUploadUrlResponseSchema as _r, siteSettingsSchema as _t, relationDefSchema as a, commentBulkBody as an, mediaGetQuery as ar, wpMediaImportBody as at, bylineSummarySchema as b, createCollectionBody as bn, contentCompareResponseSchema as br, sectionSchema as bt, relationTranslationsSchema as c, commentListQuery as cn, mediaListReadItemSchema as cr, wpPrepareBody as ct, bylineFieldCreateBody as d, createCommentBody as dn, mediaProviderListQuery as dr, searchQuery as dt, passkeyRenameBody as en, DEFAULT_MAX_UPLOAD_SIZE as er, setupAdminBody as et, bylineFieldDefinitionSchema as f, createReactionBody as fn, mediaReadItemSchema as fr, searchRebuildBody as ft, bylineFieldUsageResponseSchema as g, collectionListResponseSchema as gn, mediaUploadUrlBody as gr, settingsUpdateBody as gt, bylineFieldUpdateBody as h, collectionGetQuery as hn, mediaUpdateBody as hr, searchSuggestQuery as ht, referenceParentsResponseSchema as i, adminCommentListResponseSchema as in, mediaExistingResponseSchema as ir, importProbeBody as it, notFoundSummaryQuery as j, updateFieldBody as jn, contentTermsBody as jr, termSchema as jt, notFoundListResponseSchema as k, schemaExportQuery as kn, contentSeoInput as kr, termListResponseSchema as kt, setReferenceChildrenBody as l, commentSchema as ln, mediaListReadResponseSchema as lr, wpRewriteUrlsBody as lt, bylineFieldReorderBody as m, publicCommentSchema as mn, mediaResponseSchema as mr, searchResultSchema as mt, entryRefSchema as n, signupCompleteBody as nn, mediaConfirmBody as nr, setupAtprotoAdminBody as nt, relationListResponseSchema as o, commentBulkResponseSchema as on, mediaItemSchema as or, wpPluginAnalyzeBody as ot, bylineFieldListResponseSchema as p, publicCommentListResponseSchema as pn, mediaReadResponseSchema as pr, searchResponseSchema as pt, allowedDomainUpdateBody as q, mediaUsageRepairBody as qn, roleLevel as qr, inviteCompleteBody as qt, referenceChildrenResponseSchema as r, signupRequestBody as rn, mediaConfirmResponseSchema as rr, setupBody as rt, relationResponseSchema as s, commentCountsResponseSchema as sn, mediaListQuery as sr, wpPluginExecuteBody as st, createRelationBody as t, passkeyVerifyBody as tn, formatFileSize as tr, setupAdminVerifyBody as tt, updateRelationBody as u, commentStatusBody as un, mediaListResponseSchema as ur, searchEnableBody as ut, bylineCreditSchema as v, collectionSchema as vn, contentAuthorSchema as vr, createSectionBody as vt, bylinesListQuery as w, fieldResponseSchema as wn, contentListResponseSchema as wr, createTermBody as wt, bylineTranslationCreateBody as x, createFieldBody as xn, contentCreateBody as xr, sectionsListQuery as xt, bylineListResponseSchema as y, collectionWithFieldsResponseSchema as yn, contentAuthorsResponseSchema as yr, sectionListResponseSchema as yt, createWidgetBody as z, MediaUsageSourceDetail as zn, apiErrorSchema as zr, menuListItemSchema as zt };
2689
- //# sourceMappingURL=relations-qKmSj9KM.d.mts.map
2726
+ export { atprotoLoginBody as $, mediaUsageRepairResponseSchema as $n, slugPattern as $r, magicLinkSendBody as $t, notFoundPruneBody as A, orphanRegisterBody as An, contentPreviewUrlBody as Ar, termListQuery as At, reorderWidgetsBody as B, MediaUsageOccurrenceDetail as Bn, contentUpdateBody as Br, menuItemSchema as Bt, bylineUpdateBody as C, collectionWithFieldsResponseSchema as Cn, contentAuthorSchema as Cr, createTaxonomyDefBody as Ct, notFoundEntrySchema as D, fieldReorderBody as Dn, contentItemSchema as Dr, taxonomyDefTranslationsSchema as Dt, createRedirectBody as E, fieldListResponseSchema as En, contentCreateBody as Er, taxonomyDefSchema as Et, redirectSchema as F, updateFieldBody as Fn, contentSeoSchema as Fr, termTranslationsSchema as Ft, widgetSchema as G, mediaUsageCoverageSchema as Gn, countResponseSchema as Gr, menuWithItemsSchema as Gt, widgetAreaSchema as H, MediaUsageRepairResponse as Hn, trashedContentListResponseSchema as Hr, menuListItemSchema as Ht, redirectsListQuery as I, MediaUsageCoverage as In, contentTermsBody as Ir, termWithCountSchema as It, userDetailSchema as J, mediaUsageDetailsResponseSchema as Jn, httpUrl as Jr, updateMenuItemBody as Jt, allowedDomainCreateBody as K, mediaUsageCoverageStatusSchema as Kn, cursorPaginationQuery as Kr, reorderMenuItemsBody as Kt, updateRedirectBody as L, MediaUsageCoverageStatus as Ln, contentTranslationSchema as Lr, updateTermBody as Lt, notFoundSummaryResponseSchema as M, orphanedTableSchema as Mn, contentResponseSchema as Mr, termReorderResponseSchema as Mt, notFoundSummarySchema as N, schemaExportQuery as Nn, contentScheduleBody as Nr, termResponseSchema as Nt, notFoundListQuery as O, fieldResponseSchema as On, contentListQuery as Or, taxonomyListResponseSchema as Ot, redirectListResponseSchema as P, updateCollectionBody as Pn, contentSeoInput as Pr, termSchema as Pt, usersListQuery as Q, mediaUsageRepairCollectionSummarySchema as Qn, roleLevel as Qr, inviteRegisterOptionsBody as Qt, createWidgetAreaBody as R, MediaUsageDetailsResponse as Rn, contentTranslationsResponseSchema as Rr, createMenuBody as Rt, bylineTranslationsResponseSchema as S, collectionSchema as Sn, mediaUploadUrlResponseSchema as Sr, updateSectionBody as St, contentBylineInputSchema as T, createFieldBody as Tn, contentCompareResponseSchema as Tr, reorderTermsBody as Tt, widgetAreaWithWidgetsAndCountSchema as U, MediaUsageSourceDetail as Un, VALID_ROLE_LEVELS as Ur, menuSchema as Ut, updateWidgetBody as V, MediaUsageRepairRequest as Vn, trashedContentItemSchema as Vr, menuItemTypeEnum as Vt, widgetAreaWithWidgetsSchema as W, MediaUsageSummary as Wn, apiErrorSchema as Wr, menuTranslationsSchema as Wt, userSchema as X, mediaUsageOccurrenceDetailSchema as Xn, localeFilterQuery as Xr, inviteCompleteBody as Xt, userListResponseSchema as Y, mediaUsageEntryDetailSchema as Yn, localeCode as Yr, authMeActionBody as Yt, userUpdateBody as Z, mediaUsageRepairBody as Zn, offsetPaginationQuery as Zr, inviteCreateBody as Zt, bylineCreateBody as _, publicCommentSchema as _n, mediaReadResponseSchema as _r, siteSettingsSchema as _t, relationDefSchema as a, signupCompleteBody as an, formatFileSize as ar, wpMediaImportBody as at, bylineSummarySchema as b, collectionReorderBody as bn, mediaUpdateBody as br, sectionSchema as bt, relationTranslationsSchema as c, commentBulkBody as cn, mediaExistingResponseSchema as cr, wpPrepareBody as ct, bylineFieldCreateBody as d, commentListQuery as dn, mediaListQuery as dr, searchQuery as dt, successEnvelope as ei, passkeyOptionsBody as en, mediaUsageRepairStatusSchema as er, setupAdminBody as et, bylineFieldDefinitionSchema as f, commentSchema as fn, mediaListReadItemSchema as fr, searchRebuildBody as ft, bylineFieldUsageResponseSchema as g, publicCommentListResponseSchema as gn, mediaReadItemSchema as gr, settingsUpdateBody as gt, bylineFieldUpdateBody as h, createReactionBody as hn, mediaProviderListQuery as hr, searchSuggestQuery as ht, referenceParentsResponseSchema as i, passkeyVerifyBody as in, DEFAULT_MAX_UPLOAD_SIZE as ir, importProbeBody as it, notFoundSummaryQuery as j, orphanedTableListResponseSchema as jn, contentPublishBody as jr, termListResponseSchema as jt, notFoundListResponseSchema as k, fieldSchema as kn, contentListResponseSchema as kr, termGetResponseSchema as kt, setReferenceChildrenBody as l, commentBulkResponseSchema as ln, mediaGetQuery as lr, wpRewriteUrlsBody as lt, bylineFieldReorderBody as m, createCommentBody as mn, mediaListResponseSchema as mr, searchResultSchema as mt, entryRefSchema as n, passkeyRegisterVerifyBody as nn, mediaUsageSummarySchema as nr, setupAtprotoAdminBody as nt, relationListResponseSchema as o, signupRequestBody as on, mediaConfirmBody as or, wpPluginAnalyzeBody as ot, bylineFieldListResponseSchema as p, commentStatusBody as pn, mediaListReadResponseSchema as pr, searchResponseSchema as pt, allowedDomainUpdateBody as q, mediaUsageDetailsQuery as qn, deleteResponseSchema as qr, updateMenuBody as qt, referenceChildrenResponseSchema as r, passkeyRenameBody as rn, CONTENT_TYPE_RE as rr, setupBody as rt, relationResponseSchema as s, adminCommentListResponseSchema as sn, mediaConfirmResponseSchema as sr, wpPluginExecuteBody as st, createRelationBody as t, passkeyRegisterOptionsBody as tn, mediaUsageSourceDetailSchema as tr, setupAdminVerifyBody as tt, updateRelationBody as u, commentCountsResponseSchema as un, mediaItemSchema as ur, searchEnableBody as ut, bylineCreditSchema as v, collectionGetQuery as vn, mediaResponseSchema as vr, createSectionBody as vt, bylinesListQuery as w, createCollectionBody as wn, contentAuthorsResponseSchema as wr, createTermBody as wt, bylineTranslationCreateBody as x, collectionResponseSchema as xn, mediaUploadUrlBody as xr, sectionsListQuery as xt, bylineListResponseSchema as y, collectionListResponseSchema as yn, mediaStreamUploadResponseSchema as yr, sectionListResponseSchema as yt, createWidgetBody as z, MediaUsageEntryDetail as zn, contentTrashQuery as zr, createMenuItemBody as zt };
2727
+ //# sourceMappingURL=relations-G2ta7GIl.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations-G2ta7GIl.d.mts","names":[],"sources":["../src/api/schemas/common.ts","../src/api/schemas/content.ts","../src/api/schemas/media.ts","../src/api/schemas/media-usage.ts","../src/api/schemas/schema.ts","../src/api/schemas/comments.ts","../src/api/schemas/auth.ts","../src/api/schemas/menus.ts","../src/api/schemas/taxonomies.ts","../src/api/schemas/sections.ts","../src/api/schemas/settings.ts","../src/api/schemas/search.ts","../src/api/schemas/import.ts","../src/api/schemas/setup.ts","../src/api/schemas/users.ts","../src/api/schemas/widgets.ts","../src/api/schemas/redirects.ts","../src/api/schemas/bylines.ts","../src/api/schemas/byline-fields.ts","../src/api/schemas/relations.ts"],"mappings":";;;;cAOa,iBAAA,EAAiB,GAAA;AAA9B;AAAA,cAGa,SAAA,EAAS,CAAA,CAAA,gBAAA,YAAA,CAAA,CAAA,OAAA,kCAAA,CAAA,CAAA,IAAA,CAAA,iBAAA;;cAYT,qBAAA,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CursorError } from "./types-CrRUFdej.mjs";
4
- import { t as RelationRepository } from "./relation-Du0r04E0.mjs";
5
- import { n as SchemaRegistry } from "./registry-y21kjhfG.mjs";
1
+ import { i as resolveConfiguredLocale } from "./config-DyF3OKg_.mjs";
2
+ import { t as ContentRepository } from "./content-CJ94NEx5.mjs";
3
+ import { r as InvalidCursorError } from "./types-Cd8iuS1J.mjs";
4
+ import { t as RelationRepository } from "./relation-Cbe3Sd3m.mjs";
5
+ import { n as SchemaRegistry } from "./registry-Dbodb4Uo.mjs";
6
6
 
7
7
  //#region src/api/handlers/relations.ts
8
8
  /** Map an edge-read failure: a bad pagination cursor is a 400 client error,
@@ -400,4 +400,4 @@ async function handleReferenceParentsGet(db, collection, entryId, relation, page
400
400
 
401
401
  //#endregion
402
402
  export { handleRelationDelete as a, handleRelationTranslations as c, handleRelationCreate as i, handleRelationUpdate as l, handleReferenceChildrenSet as n, handleRelationGet as o, handleReferenceParentsGet as r, handleRelationList as s, handleReferenceChildrenGet as t };
403
- //# sourceMappingURL=relations-DtX1UMBH.mjs.map
403
+ //# sourceMappingURL=relations-qHwpUe66.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"relations-DtX1UMBH.mjs","names":[],"sources":["../src/api/handlers/relations.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\n\nimport { ContentRepository } from \"../../database/repositories/content.js\";\nimport {\n\tRelationRepository,\n\ttype ContentReference,\n\ttype CreateRelationInput,\n\ttype Relation,\n} from \"../../database/repositories/relation.js\";\nimport { InvalidCursorError } from \"../../database/repositories/types.js\";\nimport type { ContentItem } from \"../../database/repositories/types.js\";\nimport type { Database } from \"../../database/types.js\";\nimport { resolveConfiguredLocale } from \"../../i18n/config.js\";\nimport { SchemaRegistry } from \"../../schema/registry.js\";\nimport type { ApiResult } from \"../types.js\";\n\n/** Map an edge-read failure: a bad pagination cursor is a 400 client error,\n * everything else is the generic 500-shaped reference-read error. */\nfunction referencesGetError(error: unknown): ApiResult<never> {\n\tif (error instanceof InvalidCursorError) {\n\t\treturn { success: false, error: { code: \"INVALID_CURSOR\", message: error.message } };\n\t}\n\treturn {\n\t\tsuccess: false,\n\t\terror: { code: \"REFERENCES_GET_ERROR\", message: \"Failed to get references\" },\n\t};\n}\n\n/** True for SQLite UNIQUE / Postgres unique_violation messages (matches the\n * fingerprint used in the content handlers). Narrow enough not to catch NOT\n * NULL / CHECK violations whose messages also say \"constraint\". */\nfunction isUniqueViolation(error: unknown): boolean {\n\tconst message = error instanceof Error ? error.message.toLowerCase() : \"\";\n\treturn message.includes(\"unique constraint failed\") || message.includes(\"duplicate key\");\n}\n\nexport async function handleRelationCreate(\n\tdb: Kysely<Database>,\n\tinput: CreateRelationInput,\n): Promise<ApiResult<{ relation: Relation }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\n\t\t// Invariant: a relation must point at collections that exist. There is no\n\t\t// SQL FK (group-linking precludes it), so a ghost collection would yield a\n\t\t// structurally-valid-but-permanently-useless relation. Skip when\n\t\t// `translationOf` is set — structural fields are then inherited from an\n\t\t// already-validated source, and the input collections are ignored.\n\t\tif (!input.translationOf) {\n\t\t\tif (!input.parentCollection || !input.childCollection) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"parentCollection and childCollection are required unless translationOf is set\",\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst registry = new SchemaRegistry(db);\n\t\t\tfor (const collection of [input.parentCollection, input.childCollection]) {\n\t\t\t\tif (!(await registry.getCollection(collection))) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsuccess: false,\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tcode: \"COLLECTION_NOT_FOUND\",\n\t\t\t\t\t\t\tmessage: `Collection '${collection}' not found`,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst relation = await repo.create({\n\t\t\t...input,\n\t\t\tlocale: input.locale ? resolveConfiguredLocale(input.locale) : undefined,\n\t\t});\n\t\treturn { success: true, data: { relation } };\n\t} catch (error) {\n\t\t// A bad `translationOf` makes the repo throw loudly rather than mint an\n\t\t// unlinked relation — surface it as 404, not a generic 500.\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.includes(\"Source relation for translation not found\")\n\t\t) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: \"NOT_FOUND\", message: \"Source relation for translation not found\" },\n\t\t\t};\n\t\t}\n\t\t// UNIQUE(name, locale) collision, or a second translation for an\n\t\t// already-present (translation_group, locale) — both are client conflicts.\n\t\tif (isUniqueViolation(error)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"CONFLICT\",\n\t\t\t\t\tmessage: \"A relation with this name or locale already exists\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_CREATE_ERROR\", message: \"Failed to create relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationGet(\n\tdb: Kysely<Database>,\n\tid: string,\n): Promise<ApiResult<{ relation: Relation }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst relation = await repo.findById(id);\n\t\tif (!relation) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\treturn { success: true, data: { relation } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_GET_ERROR\", message: \"Failed to get relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationList(\n\tdb: Kysely<Database>,\n\topts: { locale?: string },\n): Promise<ApiResult<{ relations: Relation[] }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst locale = opts.locale ? resolveConfiguredLocale(opts.locale) : undefined;\n\t\tconst relations = await repo.list(locale);\n\t\treturn { success: true, data: { relations } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_LIST_ERROR\", message: \"Failed to list relations\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationUpdate(\n\tdb: Kysely<Database>,\n\tid: string,\n\tinput: { parentLabel?: string; childLabel?: string },\n): Promise<ApiResult<{ relation: Relation }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst relation = await repo.update(id, input);\n\t\tif (!relation) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\treturn { success: true, data: { relation } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_UPDATE_ERROR\", message: \"Failed to update relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationDelete(\n\tdb: Kysely<Database>,\n\tid: string,\n): Promise<ApiResult<{ deleted: true }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst deleted = await repo.delete(id);\n\t\tif (!deleted) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\treturn { success: true, data: { deleted: true } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_DELETE_ERROR\", message: \"Failed to delete relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationTranslations(\n\tdb: Kysely<Database>,\n\tid: string,\n): Promise<\n\tApiResult<{\n\t\ttranslationGroup: string;\n\t\ttranslations: {\n\t\t\tid: string;\n\t\t\tname: string;\n\t\t\tlocale: string;\n\t\t\tparentLabel: string;\n\t\t\tchildLabel: string;\n\t\t}[];\n\t}>\n> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst relation = await repo.findById(id);\n\t\tif (!relation) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\tconst siblings = await repo.findTranslations(relation.translationGroup);\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\ttranslationGroup: relation.translationGroup,\n\t\t\t\ttranslations: siblings.map((r) => ({\n\t\t\t\t\tid: r.id,\n\t\t\t\t\tname: r.name,\n\t\t\t\t\tlocale: r.locale,\n\t\t\t\t\tparentLabel: r.parentLabel,\n\t\t\t\t\tchildLabel: r.childLabel,\n\t\t\t\t})),\n\t\t\t},\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_TRANSLATIONS_ERROR\", message: \"Failed to get translations\" },\n\t\t};\n\t}\n}\n\nexport type EntryRef = {\n\tid: string;\n\tslug: string | null;\n\tcollection: string;\n\t/** The actual locale of the resolved variant — see `pickVariant`. */\n\tlocale: string | null;\n\tsortOrder?: number;\n};\n\n/** Resolve a relation from an id OR its translation_group. */\nasync function resolveRelation(\n\trepo: RelationRepository,\n\tidOrGroup: string,\n): Promise<Relation | null> {\n\tconst byId = await repo.findById(idOrGroup);\n\tif (byId) return byId;\n\tconst group = await repo.findTranslations(idOrGroup);\n\treturn group[0] ?? null;\n}\n\n/**\n * Pick the locale variant matching `locale`, falling back to the first entry\n * (lowest locale code). The fallback is intentional — an edge is keyed by\n * `translation_group`, so a referenced entry that exists only in another locale\n * is still a real reference — but the returned ref carries the variant's actual\n * `locale` so callers never mistake a fallback for the requested locale.\n */\nfunction pickVariant(items: ContentItem[], locale: string | null): ContentItem | undefined {\n\treturn items.find((i) => i.locale === locale) ?? items[0];\n}\n\n/**\n * Resolve edge groups to loadable entries in `collection` at `locale`.\n * Dangling groups (no surviving entry) are skipped — cleanup is a later slice.\n *\n * All groups are loaded in one batched query (chunked at `SQL_BATCH_SIZE`)\n * rather than a `findTranslations` per edge, so a parent with N children costs\n * a constant number of queries, not N+1. Edge order (the caller's `sort_order`)\n * is preserved by iterating `edges`.\n *\n * `includeDrafts` is false for callers without `content:read_drafts`: the load\n * is restricted to published entries so a draft/scheduled entry referenced by an\n * edge is skipped exactly like a dangling one, never leaking its id/slug/locale.\n */\nasync function resolveEntries(\n\tcontent: ContentRepository,\n\tcollection: string,\n\tedges: ContentReference[],\n\tpick: (e: ContentReference) => string,\n\tlocale: string | null,\n\tincludeDrafts: boolean,\n): Promise<EntryRef[]> {\n\tconst groups = edges.map(pick);\n\tconst all = await content.findTranslationsForGroups(collection, groups, {\n\t\tpublishedOnly: !includeDrafts,\n\t});\n\n\t// Group the flat variant list by translation_group so each edge can pick its\n\t// own locale variant.\n\tconst variantsByGroup = new Map<string, ContentItem[]>();\n\tfor (const item of all) {\n\t\tif (item.translationGroup == null) continue;\n\t\tconst list = variantsByGroup.get(item.translationGroup);\n\t\tif (list) list.push(item);\n\t\telse variantsByGroup.set(item.translationGroup, [item]);\n\t}\n\n\tconst refs: EntryRef[] = [];\n\tfor (const edge of edges) {\n\t\tconst variants = variantsByGroup.get(pick(edge));\n\t\tif (!variants) continue;\n\t\tconst entry = pickVariant(variants, locale);\n\t\tif (!entry) continue;\n\t\trefs.push({\n\t\t\tid: entry.id,\n\t\t\tslug: entry.slug,\n\t\t\tcollection,\n\t\t\tlocale: entry.locale,\n\t\t\tsortOrder: edge.sortOrder,\n\t\t});\n\t}\n\treturn refs;\n}\n\n/** Pagination inputs for the edge read endpoints. */\nexport type PageOptions = { limit?: number; cursor?: string };\n\nexport async function handleReferenceChildrenGet(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\trelation: string,\n\tpage: PageOptions = {},\n\tincludeDrafts = false,\n): Promise<ApiResult<{ children: EntryRef[]; nextCursor?: string }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst content = new ContentRepository(db);\n\n\t\tconst rel = await resolveRelation(repo, relation);\n\t\tif (!rel)\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\tif (collection !== rel.parentCollection) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tmessage: \"Entry is not the parent side of this relation\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst entry = await content.findByIdOrSlug(collection, entryId);\n\t\t// A caller without draft access must not anchor on a non-published entry —\n\t\t// return NOT_FOUND (not 403) so they can't probe draft ids by status code,\n\t\t// mirroring the single-item content read.\n\t\tif (!entry?.translationGroup || (!includeDrafts && entry.status !== \"published\")) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Content entry not found\" } };\n\t\t}\n\n\t\tconst edges = await repo.getChildrenPage(rel.translationGroup, entry.translationGroup, page);\n\t\tconst children = await resolveEntries(\n\t\t\tcontent,\n\t\t\trel.childCollection,\n\t\t\tedges.items,\n\t\t\t(e) => e.childGroup,\n\t\t\tentry.locale,\n\t\t\tincludeDrafts,\n\t\t);\n\t\treturn { success: true, data: { children, nextCursor: edges.nextCursor } };\n\t} catch (error) {\n\t\treturn referencesGetError(error);\n\t}\n}\n\nexport async function handleReferenceChildrenSet(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\trelation: string,\n\tchildIds: string[],\n): Promise<ApiResult<{ children: EntryRef[]; nextCursor?: string }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst content = new ContentRepository(db);\n\n\t\tconst rel = await resolveRelation(repo, relation);\n\t\tif (!rel)\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\tif (collection !== rel.parentCollection) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tmessage: \"Entry is not the parent side of this relation\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst entry = await content.findByIdOrSlug(collection, entryId);\n\t\tif (!entry?.translationGroup) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Content entry not found\" } };\n\t\t}\n\n\t\t// Resolve every child within the relation's child_collection in one batch\n\t\t// (constant queries, not an N+1 of point lookups for a set up to 1000). A\n\t\t// child id that does not resolve there fails collection-agreement\n\t\t// (invariant 3); order is preserved by iterating the caller's `childIds`.\n\t\tconst resolvedChildren = await content.findManyByIdOrSlug(rel.childCollection, childIds);\n\t\tconst childGroups: string[] = [];\n\t\tfor (const childId of childIds) {\n\t\t\tconst child = resolvedChildren.get(childId);\n\t\t\tif (!child?.translationGroup) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: \"NOT_FOUND\",\n\t\t\t\t\t\tmessage: `Child entry '${childId}' not found in ${rel.childCollection}`,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tchildGroups.push(child.translationGroup);\n\t\t}\n\n\t\tawait repo.setChildren(rel.translationGroup, entry.translationGroup, childGroups);\n\n\t\t// Return the first page of the new set, mirroring the GET shape. The actor\n\t\t// holds an edit permission (gated by the route), so draft children are\n\t\t// included in the echo.\n\t\tconst edges = await repo.getChildrenPage(rel.translationGroup, entry.translationGroup);\n\t\tconst children = await resolveEntries(\n\t\t\tcontent,\n\t\t\trel.childCollection,\n\t\t\tedges.items,\n\t\t\t(e) => e.childGroup,\n\t\t\tentry.locale,\n\t\t\ttrue,\n\t\t);\n\t\treturn { success: true, data: { children, nextCursor: edges.nextCursor } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"REFERENCES_SET_ERROR\", message: \"Failed to set references\" },\n\t\t};\n\t}\n}\n\nexport async function handleReferenceParentsGet(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\trelation: string,\n\tpage: PageOptions = {},\n\tincludeDrafts = false,\n): Promise<ApiResult<{ parents: EntryRef[]; nextCursor?: string }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst content = new ContentRepository(db);\n\n\t\tconst rel = await resolveRelation(repo, relation);\n\t\tif (!rel)\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\tif (collection !== rel.childCollection) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tmessage: \"Entry is not the child side of this relation\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst entry = await content.findByIdOrSlug(collection, entryId);\n\t\t// Same draft-anchor guard as the children read: a non-draft-reader anchoring\n\t\t// on an unpublished entry gets NOT_FOUND, not its backlinks.\n\t\tif (!entry?.translationGroup || (!includeDrafts && entry.status !== \"published\")) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Content entry not found\" } };\n\t\t}\n\n\t\tconst edges = await repo.getParentsPage(rel.translationGroup, entry.translationGroup, page);\n\t\tconst parents = await resolveEntries(\n\t\t\tcontent,\n\t\t\trel.parentCollection,\n\t\t\tedges.items,\n\t\t\t(e) => e.parentGroup,\n\t\t\tentry.locale,\n\t\t\tincludeDrafts,\n\t\t);\n\t\treturn { success: true, data: { parents, nextCursor: edges.nextCursor } };\n\t} catch (error) {\n\t\treturn referencesGetError(error);\n\t}\n}\n"],"mappings":";;;;;;;;;AAkBA,SAAS,mBAAmB,OAAkC;AAC7D,KAAI,iBAAiB,mBACpB,QAAO;EAAE,SAAS;EAAO,OAAO;GAAE,MAAM;GAAkB,SAAS,MAAM;GAAS;EAAE;AAErF,QAAO;EACN,SAAS;EACT,OAAO;GAAE,MAAM;GAAwB,SAAS;GAA4B;EAC5E;;;;;AAMF,SAAS,kBAAkB,OAAyB;CACnD,MAAM,UAAU,iBAAiB,QAAQ,MAAM,QAAQ,aAAa,GAAG;AACvE,QAAO,QAAQ,SAAS,2BAA2B,IAAI,QAAQ,SAAS,gBAAgB;;AAGzF,eAAsB,q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QAAQ,eAAe,YAAY,QAAQ;AAG/D,MAAI,CAAC,OAAO,oBAAqB,CAAC,iBAAiB,MAAM,WAAW,YACnE,QAAO;GAAE,SAAS;GAAO,OAAO;IAAE,MAAM;IAAa,SAAS;IAA2B;GAAE;EAG5F,MAAM,QAAQ,MAAM,KAAK,eAAe,IAAI,kBAAkB,MAAM,kBAAkB,KAAK;AAS3F,SAAO;GAAE,SAAS;GAAM,MAAM;IAAE,SARhB,MAAM,eACrB,SACA,IAAI,kBACJ,MAAM,QACL,MAAM,EAAE,aACT,MAAM,QACN,cACA;IACwC,YAAY,MAAM;IAAY;GAAE;UACjE,OAAO;AACf,SAAO,mBAAmB,MAAM"}
1
+ {"version":3,"file":"relations-qHwpUe66.mjs","names":[],"sources":["../src/api/handlers/relations.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\n\nimport { ContentRepository } from \"../../database/repositories/content.js\";\nimport {\n\tRelationRepository,\n\ttype ContentReference,\n\ttype CreateRelationInput,\n\ttype Relation,\n} from \"../../database/repositories/relation.js\";\nimport { InvalidCursorError } from \"../../database/repositories/types.js\";\nimport type { ContentItem } from \"../../database/repositories/types.js\";\nimport type { Database } from \"../../database/types.js\";\nimport { resolveConfiguredLocale } from \"../../i18n/config.js\";\nimport { SchemaRegistry } from \"../../schema/registry.js\";\nimport type { ApiResult } from \"../types.js\";\n\n/** Map an edge-read failure: a bad pagination cursor is a 400 client error,\n * everything else is the generic 500-shaped reference-read error. */\nfunction referencesGetError(error: unknown): ApiResult<never> {\n\tif (error instanceof InvalidCursorError) {\n\t\treturn { success: false, error: { code: \"INVALID_CURSOR\", message: error.message } };\n\t}\n\treturn {\n\t\tsuccess: false,\n\t\terror: { code: \"REFERENCES_GET_ERROR\", message: \"Failed to get references\" },\n\t};\n}\n\n/** True for SQLite UNIQUE / Postgres unique_violation messages (matches the\n * fingerprint used in the content handlers). Narrow enough not to catch NOT\n * NULL / CHECK violations whose messages also say \"constraint\". */\nfunction isUniqueViolation(error: unknown): boolean {\n\tconst message = error instanceof Error ? error.message.toLowerCase() : \"\";\n\treturn message.includes(\"unique constraint failed\") || message.includes(\"duplicate key\");\n}\n\nexport async function handleRelationCreate(\n\tdb: Kysely<Database>,\n\tinput: CreateRelationInput,\n): Promise<ApiResult<{ relation: Relation }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\n\t\t// Invariant: a relation must point at collections that exist. There is no\n\t\t// SQL FK (group-linking precludes it), so a ghost collection would yield a\n\t\t// structurally-valid-but-permanently-useless relation. Skip when\n\t\t// `translationOf` is set — structural fields are then inherited from an\n\t\t// already-validated source, and the input collections are ignored.\n\t\tif (!input.translationOf) {\n\t\t\tif (!input.parentCollection || !input.childCollection) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"parentCollection and childCollection are required unless translationOf is set\",\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst registry = new SchemaRegistry(db);\n\t\t\tfor (const collection of [input.parentCollection, input.childCollection]) {\n\t\t\t\tif (!(await registry.getCollection(collection))) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsuccess: false,\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tcode: \"COLLECTION_NOT_FOUND\",\n\t\t\t\t\t\t\tmessage: `Collection '${collection}' not found`,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst relation = await repo.create({\n\t\t\t...input,\n\t\t\tlocale: input.locale ? resolveConfiguredLocale(input.locale) : undefined,\n\t\t});\n\t\treturn { success: true, data: { relation } };\n\t} catch (error) {\n\t\t// A bad `translationOf` makes the repo throw loudly rather than mint an\n\t\t// unlinked relation — surface it as 404, not a generic 500.\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.includes(\"Source relation for translation not found\")\n\t\t) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: \"NOT_FOUND\", message: \"Source relation for translation not found\" },\n\t\t\t};\n\t\t}\n\t\t// UNIQUE(name, locale) collision, or a second translation for an\n\t\t// already-present (translation_group, locale) — both are client conflicts.\n\t\tif (isUniqueViolation(error)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"CONFLICT\",\n\t\t\t\t\tmessage: \"A relation with this name or locale already exists\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_CREATE_ERROR\", message: \"Failed to create relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationGet(\n\tdb: Kysely<Database>,\n\tid: string,\n): Promise<ApiResult<{ relation: Relation }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst relation = await repo.findById(id);\n\t\tif (!relation) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\treturn { success: true, data: { relation } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_GET_ERROR\", message: \"Failed to get relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationList(\n\tdb: Kysely<Database>,\n\topts: { locale?: string },\n): Promise<ApiResult<{ relations: Relation[] }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst locale = opts.locale ? resolveConfiguredLocale(opts.locale) : undefined;\n\t\tconst relations = await repo.list(locale);\n\t\treturn { success: true, data: { relations } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_LIST_ERROR\", message: \"Failed to list relations\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationUpdate(\n\tdb: Kysely<Database>,\n\tid: string,\n\tinput: { parentLabel?: string; childLabel?: string },\n): Promise<ApiResult<{ relation: Relation }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst relation = await repo.update(id, input);\n\t\tif (!relation) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\treturn { success: true, data: { relation } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_UPDATE_ERROR\", message: \"Failed to update relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationDelete(\n\tdb: Kysely<Database>,\n\tid: string,\n): Promise<ApiResult<{ deleted: true }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst deleted = await repo.delete(id);\n\t\tif (!deleted) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\treturn { success: true, data: { deleted: true } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_DELETE_ERROR\", message: \"Failed to delete relation\" },\n\t\t};\n\t}\n}\n\nexport async function handleRelationTranslations(\n\tdb: Kysely<Database>,\n\tid: string,\n): Promise<\n\tApiResult<{\n\t\ttranslationGroup: string;\n\t\ttranslations: {\n\t\t\tid: string;\n\t\t\tname: string;\n\t\t\tlocale: string;\n\t\t\tparentLabel: string;\n\t\t\tchildLabel: string;\n\t\t}[];\n\t}>\n> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst relation = await repo.findById(id);\n\t\tif (!relation) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\t}\n\t\tconst siblings = await repo.findTranslations(relation.translationGroup);\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\ttranslationGroup: relation.translationGroup,\n\t\t\t\ttranslations: siblings.map((r) => ({\n\t\t\t\t\tid: r.id,\n\t\t\t\t\tname: r.name,\n\t\t\t\t\tlocale: r.locale,\n\t\t\t\t\tparentLabel: r.parentLabel,\n\t\t\t\t\tchildLabel: r.childLabel,\n\t\t\t\t})),\n\t\t\t},\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"RELATION_TRANSLATIONS_ERROR\", message: \"Failed to get translations\" },\n\t\t};\n\t}\n}\n\nexport type EntryRef = {\n\tid: string;\n\tslug: string | null;\n\tcollection: string;\n\t/** The actual locale of the resolved variant — see `pickVariant`. */\n\tlocale: string | null;\n\tsortOrder?: number;\n};\n\n/** Resolve a relation from an id OR its translation_group. */\nasync function resolveRelation(\n\trepo: RelationRepository,\n\tidOrGroup: string,\n): Promise<Relation | null> {\n\tconst byId = await repo.findById(idOrGroup);\n\tif (byId) return byId;\n\tconst group = await repo.findTranslations(idOrGroup);\n\treturn group[0] ?? null;\n}\n\n/**\n * Pick the locale variant matching `locale`, falling back to the first entry\n * (lowest locale code). The fallback is intentional — an edge is keyed by\n * `translation_group`, so a referenced entry that exists only in another locale\n * is still a real reference — but the returned ref carries the variant's actual\n * `locale` so callers never mistake a fallback for the requested locale.\n */\nfunction pickVariant(items: ContentItem[], locale: string | null): ContentItem | undefined {\n\treturn items.find((i) => i.locale === locale) ?? items[0];\n}\n\n/**\n * Resolve edge groups to loadable entries in `collection` at `locale`.\n * Dangling groups (no surviving entry) are skipped — cleanup is a later slice.\n *\n * All groups are loaded in one batched query (chunked at `SQL_BATCH_SIZE`)\n * rather than a `findTranslations` per edge, so a parent with N children costs\n * a constant number of queries, not N+1. Edge order (the caller's `sort_order`)\n * is preserved by iterating `edges`.\n *\n * `includeDrafts` is false for callers without `content:read_drafts`: the load\n * is restricted to published entries so a draft/scheduled entry referenced by an\n * edge is skipped exactly like a dangling one, never leaking its id/slug/locale.\n */\nasync function resolveEntries(\n\tcontent: ContentRepository,\n\tcollection: string,\n\tedges: ContentReference[],\n\tpick: (e: ContentReference) => string,\n\tlocale: string | null,\n\tincludeDrafts: boolean,\n): Promise<EntryRef[]> {\n\tconst groups = edges.map(pick);\n\tconst all = await content.findTranslationsForGroups(collection, groups, {\n\t\tpublishedOnly: !includeDrafts,\n\t});\n\n\t// Group the flat variant list by translation_group so each edge can pick its\n\t// own locale variant.\n\tconst variantsByGroup = new Map<string, ContentItem[]>();\n\tfor (const item of all) {\n\t\tif (item.translationGroup == null) continue;\n\t\tconst list = variantsByGroup.get(item.translationGroup);\n\t\tif (list) list.push(item);\n\t\telse variantsByGroup.set(item.translationGroup, [item]);\n\t}\n\n\tconst refs: EntryRef[] = [];\n\tfor (const edge of edges) {\n\t\tconst variants = variantsByGroup.get(pick(edge));\n\t\tif (!variants) continue;\n\t\tconst entry = pickVariant(variants, locale);\n\t\tif (!entry) continue;\n\t\trefs.push({\n\t\t\tid: entry.id,\n\t\t\tslug: entry.slug,\n\t\t\tcollection,\n\t\t\tlocale: entry.locale,\n\t\t\tsortOrder: edge.sortOrder,\n\t\t});\n\t}\n\treturn refs;\n}\n\n/** Pagination inputs for the edge read endpoints. */\nexport type PageOptions = { limit?: number; cursor?: string };\n\nexport async function handleReferenceChildrenGet(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\trelation: string,\n\tpage: PageOptions = {},\n\tincludeDrafts = false,\n): Promise<ApiResult<{ children: EntryRef[]; nextCursor?: string }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst content = new ContentRepository(db);\n\n\t\tconst rel = await resolveRelation(repo, relation);\n\t\tif (!rel)\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\tif (collection !== rel.parentCollection) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tmessage: \"Entry is not the parent side of this relation\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst entry = await content.findByIdOrSlug(collection, entryId);\n\t\t// A caller without draft access must not anchor on a non-published entry —\n\t\t// return NOT_FOUND (not 403) so they can't probe draft ids by status code,\n\t\t// mirroring the single-item content read.\n\t\tif (!entry?.translationGroup || (!includeDrafts && entry.status !== \"published\")) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Content entry not found\" } };\n\t\t}\n\n\t\tconst edges = await repo.getChildrenPage(rel.translationGroup, entry.translationGroup, page);\n\t\tconst children = await resolveEntries(\n\t\t\tcontent,\n\t\t\trel.childCollection,\n\t\t\tedges.items,\n\t\t\t(e) => e.childGroup,\n\t\t\tentry.locale,\n\t\t\tincludeDrafts,\n\t\t);\n\t\treturn { success: true, data: { children, nextCursor: edges.nextCursor } };\n\t} catch (error) {\n\t\treturn referencesGetError(error);\n\t}\n}\n\nexport async function handleReferenceChildrenSet(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\trelation: string,\n\tchildIds: string[],\n): Promise<ApiResult<{ children: EntryRef[]; nextCursor?: string }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst content = new ContentRepository(db);\n\n\t\tconst rel = await resolveRelation(repo, relation);\n\t\tif (!rel)\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\tif (collection !== rel.parentCollection) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tmessage: \"Entry is not the parent side of this relation\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst entry = await content.findByIdOrSlug(collection, entryId);\n\t\tif (!entry?.translationGroup) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Content entry not found\" } };\n\t\t}\n\n\t\t// Resolve every child within the relation's child_collection in one batch\n\t\t// (constant queries, not an N+1 of point lookups for a set up to 1000). A\n\t\t// child id that does not resolve there fails collection-agreement\n\t\t// (invariant 3); order is preserved by iterating the caller's `childIds`.\n\t\tconst resolvedChildren = await content.findManyByIdOrSlug(rel.childCollection, childIds);\n\t\tconst childGroups: string[] = [];\n\t\tfor (const childId of childIds) {\n\t\t\tconst child = resolvedChildren.get(childId);\n\t\t\tif (!child?.translationGroup) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: \"NOT_FOUND\",\n\t\t\t\t\t\tmessage: `Child entry '${childId}' not found in ${rel.childCollection}`,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tchildGroups.push(child.translationGroup);\n\t\t}\n\n\t\tawait repo.setChildren(rel.translationGroup, entry.translationGroup, childGroups);\n\n\t\t// Return the first page of the new set, mirroring the GET shape. The actor\n\t\t// holds an edit permission (gated by the route), so draft children are\n\t\t// included in the echo.\n\t\tconst edges = await repo.getChildrenPage(rel.translationGroup, entry.translationGroup);\n\t\tconst children = await resolveEntries(\n\t\t\tcontent,\n\t\t\trel.childCollection,\n\t\t\tedges.items,\n\t\t\t(e) => e.childGroup,\n\t\t\tentry.locale,\n\t\t\ttrue,\n\t\t);\n\t\treturn { success: true, data: { children, nextCursor: edges.nextCursor } };\n\t} catch {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: \"REFERENCES_SET_ERROR\", message: \"Failed to set references\" },\n\t\t};\n\t}\n}\n\nexport async function handleReferenceParentsGet(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\trelation: string,\n\tpage: PageOptions = {},\n\tincludeDrafts = false,\n): Promise<ApiResult<{ parents: EntryRef[]; nextCursor?: string }>> {\n\ttry {\n\t\tconst repo = new RelationRepository(db);\n\t\tconst content = new ContentRepository(db);\n\n\t\tconst rel = await resolveRelation(repo, relation);\n\t\tif (!rel)\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Relation not found\" } };\n\t\tif (collection !== rel.childCollection) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tmessage: \"Entry is not the child side of this relation\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst entry = await content.findByIdOrSlug(collection, entryId);\n\t\t// Same draft-anchor guard as the children read: a non-draft-reader anchoring\n\t\t// on an unpublished entry gets NOT_FOUND, not its backlinks.\n\t\tif (!entry?.translationGroup || (!includeDrafts && entry.status !== \"published\")) {\n\t\t\treturn { success: false, error: { code: \"NOT_FOUND\", message: \"Content entry not found\" } };\n\t\t}\n\n\t\tconst edges = await repo.getParentsPage(rel.translationGroup, entry.translationGroup, page);\n\t\tconst parents = await resolveEntries(\n\t\t\tcontent,\n\t\t\trel.parentCollection,\n\t\t\tedges.items,\n\t\t\t(e) => e.parentGroup,\n\t\t\tentry.locale,\n\t\t\tincludeDrafts,\n\t\t);\n\t\treturn { success: true, data: { parents, nextCursor: edges.nextCursor } };\n\t} catch (error) {\n\t\treturn referencesGetError(error);\n\t}\n}\n"],"mappings":";;;;;;;;;AAkBA,SAAS,mBAAmB,OAAkC;AAC7D,KAAI,iBAAiB,mBACpB,QAAO;EAAE,SAAS;EAAO,OAAO;GAAE,MAAM;GAAkB,SAAS,MAAM;GAAS;EAAE;AAErF,QAAO;EACN,SAAS;EACT,OAAO;GAAE,MAAM;GAAwB,SAAS;GAA4B;EAC5E;;;;;AAMF,SAAS,kBAAkB,OAAyB;CACnD,MAAM,UAAU,iBAAiB,QAAQ,MAAM,QAAQ,aAAa,GAAG;AACvE,QAAO,QAAQ,SAAS,2BAA2B,IAAI,QAAQ,SAAS,gBAAgB;;AAGzF,eAAsB,qBACrB,IACA,OAC6C;AAC7C,KAAI;EACH,MAAM,OAAO,IAAI,mBAAmB,GAAG;AAOvC,MAAI,CAAC,MAAM,eAAe;AACzB,OAAI,CAAC,MAAM,oBAAoB,CAAC,MAAM,gBACrC,QAAO;IACN,SAAS;IACT,OAAO;KACN,MAAM;KACN,SACC;KACD;IACD;GAEF,MAAM,WAAW,IAAI,eAAe,GAAG;AACvC,QAAK,MAAM,cAAc,CAAC,MAAM,kBAAk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,eACrB,SACA,IAAI,kBACJ,MAAM,QACL,MAAM,EAAE,aACT,MAAM,QACN,cACA;IACwC,YAAY,MAAM;IAAY;GAAE;UACjE,OAAO;AACf,SAAO,mBAAmB,MAAM"}
@@ -1,4 +1,5 @@
1
1
  import { QueryRecorder } from "./database/instrumentation.mjs";
2
+ import { t as DeferredTaskTracker } from "./deferred-tasks-C-WRCcKo.mjs";
2
3
 
3
4
  //#region src/request-context.d.ts
4
5
  /**
@@ -69,6 +70,8 @@ interface EmDashRequestContext {
69
70
  * and `requestCached`.
70
71
  */
71
72
  metrics?: RequestMetrics;
73
+ /** Deferred work that owns resources scoped to this request. */
74
+ deferredTasks?: DeferredTaskTracker;
72
75
  }
73
76
  /**
74
77
  * Run a function within an EmDash request context.
@@ -1 +1 @@
1
- {"version":3,"file":"request-context.d.mts","names":[],"sources":["../src/request-context.ts"],"mappings":";;;;;;AA+DA;;;;;;;UA9BiB,cAAA;EAChB,KAAA;EACA,OAAA;EACA,SAAA;EACA,aAAA;EACA,YAAA;EACA,SAAA;EACA,WAAA;EA+DwB;;AAoBzB;;;;EA5EC,QAAA;AAAA;AAAA,iBAGe,oBAAA,CAAqB,KAAA,WAAgB,cAAA;AAAA,UAapC,oBAAA;EA4Dc;EA1D9B,QAAA;EA0DiC;EAxDjC,OAAA;IACC,UAAA;IACA,EAAA;EAAA;EAsD0E;EAnD3E,MAAA;EA2DgC;;;;;;;EAnDhC,EAAA;;;;;;;;;;;EAWA,YAAA;;;;;;EAMA,aAAA,GAAgB,aAAA;;;;;;EAMhB,OAAA,GAAU,cAAA;AAAA;;;;;iBAoBK,cAAA,GAAA,CAAkB,GAAA,EAAK,oBAAA,EAAsB,EAAA,QAAU,CAAA,GAAI,CAAA;;;;;iBAQ3D,iBAAA,CAAA,GAAqB,oBAAA"}
1
+ {"version":3,"file":"request-context.d.mts","names":[],"sources":["../src/request-context.ts"],"mappings":";;;;;;;AAgEA;;;;;;;UA9BiB,cAAA;EAChB,KAAA;EACA,OAAA;EACA,SAAA;EACA,aAAA;EACA,YAAA;EACA,SAAA;EACA,WAAA;EAyDA;;;;;;EAlDA,QAAA;AAAA;AAAA,iBAGe,oBAAA,CAAqB,KAAA,WAAgB,cAAA;AAAA,UAapC,oBAAA;EA8Da;EA5D7B,QAAA;EA4DsE;EA1DtE,OAAA;IACC,UAAA;IACA,EAAA;EAAA;EAwDqC;EArDtC,MAAA;EAqDsE;;;;;AAQvE;;EArDC,EAAA;EAqDoC;;;;;;;;;;EA1CpC,YAAA;;;;;;EAMA,aAAA,GAAgB,aAAA;;;;;;EAMhB,OAAA,GAAU,cAAA;;EAEV,aAAA,GAAgB,mBAAA;AAAA;;;;;iBAoBD,cAAA,GAAA,CAAkB,GAAA,EAAK,oBAAA,EAAsB,EAAA,QAAU,CAAA,GAAI,CAAA;;;;;iBAQ3D,iBAAA,CAAA,GAAqB,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"request-context.mjs","names":[],"sources":["../src/request-context.ts"],"sourcesContent":["/**\n * EmDash Request Context\n *\n * Uses AsyncLocalStorage to provide request-scoped state to query functions\n * without requiring explicit parameter passing. The middleware wraps next()\n * in als.run(), making the context available to all code during rendering.\n *\n * Middleware always wraps each request in a context so per-request\n * metrics (db.*, cache.*) can be surfaced via Server-Timing. The cost is\n * one ALS frame per request — sub-microsecond, negligible compared to\n * any real work.\n *\n * The AsyncLocalStorage instance is stored on globalThis with a Symbol key\n * to guarantee a singleton even when bundlers duplicate this module across\n * code-split chunks. Without this, Rollup/Vite may inline the module into\n * multiple chunks (e.g. middleware and page components), each with its own\n * ALS instance — breaking request-scoped state propagation.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport type { QueryRecorder } from \"./database/instrumentation.js\";\n\n/**\n * Lightweight always-on counters surfaced in Server-Timing.\n *\n * Bumped by the Kysely log hook (db queries) and by `requestCached`\n * (cache hits/misses). Read by middleware after the response is\n * generated to emit `db.*` and `cache.*` Server-Timing fields.\n *\n * Offsets are milliseconds from `start` (the request's entry into\n * middleware), captured via `performance.now()`.\n */\nexport interface RequestMetrics {\n\tstart: number;\n\tdbCount: number;\n\tdbTotalMs: number;\n\tdbFirstOffset: number | null;\n\tdbLastOffset: number | null;\n\tcacheHits: number;\n\tcacheMisses: number;\n\t/**\n\t * Physical database round trips. Differs from `dbCount` (logical queries)\n\t * when a backend batches: the DO SQL driver coalesces same-turn SELECTs into\n\t * one RPC, so `rpcCount` can be far lower than `dbCount`. Bumped by the\n\t * adapter, not the Kysely log hook.\n\t */\n\trpcCount: number;\n}\n\nexport function createRequestMetrics(start: number): RequestMetrics {\n\treturn {\n\t\tstart,\n\t\tdbCount: 0,\n\t\tdbTotalMs: 0,\n\t\tdbFirstOffset: null,\n\t\tdbLastOffset: null,\n\t\tcacheHits: 0,\n\t\tcacheMisses: 0,\n\t\trpcCount: 0,\n\t};\n}\n\nexport interface EmDashRequestContext {\n\t/** Whether the current request is in visual editing mode */\n\teditMode: boolean;\n\t/** Preview token info, if this is a preview request */\n\tpreview?: {\n\t\tcollection: string;\n\t\tid: string;\n\t};\n\t/** Current locale from Astro's i18n routing (when configured) */\n\tlocale?: string;\n\t/**\n\t * Per-request database override.\n\t *\n\t * Set by middleware when D1 read replica sessions are enabled.\n\t * The runtime's `db` getter checks this first, falling back to\n\t * the singleton instance. Also used by the DO preview pattern.\n\t */\n\tdb?: unknown;\n\t/**\n\t * Indicates the per-request `db` points at an isolated database\n\t * instance whose schema may diverge from the configured one\n\t * (playground, DO preview sessions). When true, schema-derived caches\n\t * (manifest, taxonomy defs, etc.) must not be reused across requests.\n\t *\n\t * Plain D1 Sessions API routing does NOT set this — sessions are just\n\t * a routing hint over the same schema, so the module-scoped manifest\n\t * cache remains valid.\n\t */\n\tdbIsIsolated?: boolean;\n\t/**\n\t * Query recorder attached by middleware when EMDASH_QUERY_LOG_FILE is set.\n\t * The Kysely `log` hook appends an event per query; middleware flushes\n\t * to NDJSON after the response.\n\t */\n\tqueryRecorder?: QueryRecorder;\n\t/**\n\t * Per-request metrics for Server-Timing. Always attached by middleware\n\t * for requests that emit timing headers; bumped by the Kysely log hook\n\t * and `requestCached`.\n\t */\n\tmetrics?: RequestMetrics;\n}\n\nconst ALS_KEY = Symbol.for(\"emdash:request-context\");\n\nconst storage: AsyncLocalStorage<EmDashRequestContext> =\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern\n\t((globalThis as Record<symbol, unknown>)[ALS_KEY] as\n\t\t| AsyncLocalStorage<EmDashRequestContext>\n\t\t| undefined) ??\n\t(() => {\n\t\tconst als = new AsyncLocalStorage<EmDashRequestContext>();\n\t\t(globalThis as Record<symbol, unknown>)[ALS_KEY] = als;\n\t\treturn als;\n\t})();\n\n/**\n * Run a function within an EmDash request context.\n * Called by middleware to wrap next().\n */\nexport function runWithContext<T>(ctx: EmDashRequestContext, fn: () => T): T {\n\treturn storage.run(ctx, fn);\n}\n\n/**\n * Get the current request context.\n * Returns undefined if no context is set (logged-out fast path).\n */\nexport function getRequestContext(): EmDashRequestContext | undefined {\n\treturn storage.getStore();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkDA,SAAgB,qBAAqB,OAA+B;AACnE,QAAO;EACN;EACA,SAAS;EACT,WAAW;EACX,eAAe;EACf,cAAc;EACd,WAAW;EACX,aAAa;EACb,UAAU;EACV;;AA8CF,MAAM,UAAU,OAAO,IAAI,yBAAyB;AAEpD,MAAM,UAEH,WAAuC,mBAGlC;CACN,MAAM,MAAM,IAAI,mBAAyC;AACzD,CAAC,WAAuC,WAAW;AACnD,QAAO;IACJ;;;;;AAML,SAAgB,eAAkB,KAA2B,IAAgB;AAC5E,QAAO,QAAQ,IAAI,KAAK,GAAG;;;;;;AAO5B,SAAgB,oBAAsD;AACrE,QAAO,QAAQ,UAAU"}
1
+ {"version":3,"file":"request-context.mjs","names":[],"sources":["../src/request-context.ts"],"sourcesContent":["/**\n * EmDash Request Context\n *\n * Uses AsyncLocalStorage to provide request-scoped state to query functions\n * without requiring explicit parameter passing. The middleware wraps next()\n * in als.run(), making the context available to all code during rendering.\n *\n * Middleware always wraps each request in a context so per-request\n * metrics (db.*, cache.*) can be surfaced via Server-Timing. The cost is\n * one ALS frame per request — sub-microsecond, negligible compared to\n * any real work.\n *\n * The AsyncLocalStorage instance is stored on globalThis with a Symbol key\n * to guarantee a singleton even when bundlers duplicate this module across\n * code-split chunks. Without this, Rollup/Vite may inline the module into\n * multiple chunks (e.g. middleware and page components), each with its own\n * ALS instance — breaking request-scoped state propagation.\n */\n\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport type { QueryRecorder } from \"./database/instrumentation.js\";\nimport type { DeferredTaskTracker } from \"./deferred-tasks.js\";\n\n/**\n * Lightweight always-on counters surfaced in Server-Timing.\n *\n * Bumped by the Kysely log hook (db queries) and by `requestCached`\n * (cache hits/misses). Read by middleware after the response is\n * generated to emit `db.*` and `cache.*` Server-Timing fields.\n *\n * Offsets are milliseconds from `start` (the request's entry into\n * middleware), captured via `performance.now()`.\n */\nexport interface RequestMetrics {\n\tstart: number;\n\tdbCount: number;\n\tdbTotalMs: number;\n\tdbFirstOffset: number | null;\n\tdbLastOffset: number | null;\n\tcacheHits: number;\n\tcacheMisses: number;\n\t/**\n\t * Physical database round trips. Differs from `dbCount` (logical queries)\n\t * when a backend batches: the DO SQL driver coalesces same-turn SELECTs into\n\t * one RPC, so `rpcCount` can be far lower than `dbCount`. Bumped by the\n\t * adapter, not the Kysely log hook.\n\t */\n\trpcCount: number;\n}\n\nexport function createRequestMetrics(start: number): RequestMetrics {\n\treturn {\n\t\tstart,\n\t\tdbCount: 0,\n\t\tdbTotalMs: 0,\n\t\tdbFirstOffset: null,\n\t\tdbLastOffset: null,\n\t\tcacheHits: 0,\n\t\tcacheMisses: 0,\n\t\trpcCount: 0,\n\t};\n}\n\nexport interface EmDashRequestContext {\n\t/** Whether the current request is in visual editing mode */\n\teditMode: boolean;\n\t/** Preview token info, if this is a preview request */\n\tpreview?: {\n\t\tcollection: string;\n\t\tid: string;\n\t};\n\t/** Current locale from Astro's i18n routing (when configured) */\n\tlocale?: string;\n\t/**\n\t * Per-request database override.\n\t *\n\t * Set by middleware when D1 read replica sessions are enabled.\n\t * The runtime's `db` getter checks this first, falling back to\n\t * the singleton instance. Also used by the DO preview pattern.\n\t */\n\tdb?: unknown;\n\t/**\n\t * Indicates the per-request `db` points at an isolated database\n\t * instance whose schema may diverge from the configured one\n\t * (playground, DO preview sessions). When true, schema-derived caches\n\t * (manifest, taxonomy defs, etc.) must not be reused across requests.\n\t *\n\t * Plain D1 Sessions API routing does NOT set this — sessions are just\n\t * a routing hint over the same schema, so the module-scoped manifest\n\t * cache remains valid.\n\t */\n\tdbIsIsolated?: boolean;\n\t/**\n\t * Query recorder attached by middleware when EMDASH_QUERY_LOG_FILE is set.\n\t * The Kysely `log` hook appends an event per query; middleware flushes\n\t * to NDJSON after the response.\n\t */\n\tqueryRecorder?: QueryRecorder;\n\t/**\n\t * Per-request metrics for Server-Timing. Always attached by middleware\n\t * for requests that emit timing headers; bumped by the Kysely log hook\n\t * and `requestCached`.\n\t */\n\tmetrics?: RequestMetrics;\n\t/** Deferred work that owns resources scoped to this request. */\n\tdeferredTasks?: DeferredTaskTracker;\n}\n\nconst ALS_KEY = Symbol.for(\"emdash:request-context\");\n\nconst storage: AsyncLocalStorage<EmDashRequestContext> =\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern\n\t((globalThis as Record<symbol, unknown>)[ALS_KEY] as\n\t\t| AsyncLocalStorage<EmDashRequestContext>\n\t\t| undefined) ??\n\t(() => {\n\t\tconst als = new AsyncLocalStorage<EmDashRequestContext>();\n\t\t(globalThis as Record<symbol, unknown>)[ALS_KEY] = als;\n\t\treturn als;\n\t})();\n\n/**\n * Run a function within an EmDash request context.\n * Called by middleware to wrap next().\n */\nexport function runWithContext<T>(ctx: EmDashRequestContext, fn: () => T): T {\n\treturn storage.run(ctx, fn);\n}\n\n/**\n * Get the current request context.\n * Returns undefined if no context is set (logged-out fast path).\n */\nexport function getRequestContext(): EmDashRequestContext | undefined {\n\treturn storage.getStore();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgB,qBAAqB,OAA+B;AACnE,QAAO;EACN;EACA,SAAS;EACT,WAAW;EACX,eAAe;EACf,cAAc;EACd,WAAW;EACX,aAAa;EACb,UAAU;EACV;;AAgDF,MAAM,UAAU,OAAO,IAAI,yBAAyB;AAEpD,MAAM,UAEH,WAAuC,mBAGlC;CACN,MAAM,MAAM,IAAI,mBAAyC;AACzD,CAAC,WAAuC,WAAW;AACnD,QAAO;IACJ;;;;;AAML,SAAgB,eAAkB,KAA2B,IAAgB;AAC5E,QAAO,QAAQ,IAAI,KAAK,GAAG;;;;;;AAO5B,SAAgB,oBAAsD;AACrE,QAAO,QAAQ,UAAU"}
@@ -1,4 +1,4 @@
1
- import { n as normalizeTrustedHeaders, t as getTrustedProxyHeaders } from "./trusted-proxy-CwjQj0YG.mjs";
1
+ import { n as normalizeTrustedHeaders, t as getTrustedProxyHeaders } from "./trusted-proxy-D20_7fyX.mjs";
2
2
 
3
3
  //#region src/plugins/request-meta.ts
4
4
  /**
@@ -137,4 +137,4 @@ function sanitizeHeadersForSandbox(headers) {
137
137
 
138
138
  //#endregion
139
139
  export { sanitizeHeadersForSandbox as n, extractRequestMeta as t };
140
- //# sourceMappingURL=request-meta-DzXYYI-n.mjs.map
140
+ //# sourceMappingURL=request-meta-Df-jFbAd.mjs.map