emdash 0.19.0 → 0.21.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 (595) hide show
  1. package/dist/{adapters-C5AWLJSD.d.mts → adapters-BxSmgtbF.d.mts} +1 -1
  2. package/dist/{adapters-C5AWLJSD.d.mts.map → adapters-BxSmgtbF.d.mts.map} +1 -1
  3. package/dist/{allowed-origins-CyYLEJkp.mjs → allowed-origins-BqC8cul8.mjs} +2 -2
  4. package/dist/{allowed-origins-CyYLEJkp.mjs.map → allowed-origins-BqC8cul8.mjs.map} +1 -1
  5. package/dist/api/route-utils.d.mts +3 -3
  6. package/dist/api/route-utils.mjs +13 -12
  7. package/dist/api/route-utils.mjs.map +1 -1
  8. package/dist/api/schemas/index.d.mts +1 -1
  9. package/dist/api/schemas/index.mjs +3 -2
  10. package/dist/{api-BZ6bhjYs.mjs → api-DxjIV2o8.mjs} +46 -15
  11. package/dist/api-DxjIV2o8.mjs.map +1 -0
  12. package/dist/{api-tokens-VrXNiNvV.mjs → api-tokens-BFFkB0jB.mjs} +2 -2
  13. package/dist/{api-tokens-VrXNiNvV.mjs.map → api-tokens-BFFkB0jB.mjs.map} +1 -1
  14. package/dist/{apply-hQkKKBCf.mjs → apply-CLjxheyb.mjs} +12 -12
  15. package/dist/{apply-hQkKKBCf.mjs.map → apply-CLjxheyb.mjs.map} +1 -1
  16. package/dist/astro/index.d.mts +10 -10
  17. package/dist/astro/index.d.mts.map +1 -1
  18. package/dist/astro/index.mjs +50 -15
  19. package/dist/astro/index.mjs.map +1 -1
  20. package/dist/astro/middleware/auth.d.mts +9 -9
  21. package/dist/astro/middleware/auth.mjs +5 -5
  22. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  23. package/dist/astro/middleware/redirect.mjs +11 -2
  24. package/dist/astro/middleware/redirect.mjs.map +1 -1
  25. package/dist/astro/middleware/request-context.mjs +3 -2
  26. package/dist/astro/middleware/request-context.mjs.map +1 -1
  27. package/dist/astro/middleware/setup.mjs +1 -1
  28. package/dist/astro/middleware.d.mts +1 -1
  29. package/dist/astro/middleware.d.mts.map +1 -1
  30. package/dist/astro/middleware.mjs +91 -137
  31. package/dist/astro/middleware.mjs.map +1 -1
  32. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -4
  33. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
  34. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -4
  35. package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
  36. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +3 -3
  37. package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -4
  38. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  39. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +8 -7
  40. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
  41. package/dist/astro/routes/api/admin/byline-fields/index.mjs +8 -7
  42. package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
  43. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +8 -7
  44. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
  45. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +14 -12
  46. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
  47. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +14 -12
  48. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  49. package/dist/astro/routes/api/admin/bylines/index.mjs +14 -12
  50. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
  51. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +9 -8
  52. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  53. package/dist/astro/routes/api/admin/comments/_id_.mjs +3 -3
  54. package/dist/astro/routes/api/admin/comments/bulk.mjs +7 -6
  55. package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/comments/counts.mjs +3 -3
  57. package/dist/astro/routes/api/admin/comments/index.mjs +7 -6
  58. package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
  59. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +3 -3
  60. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
  61. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
  62. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
  63. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +29 -27
  64. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  65. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +29 -27
  66. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  67. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +28 -26
  68. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  69. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +28 -26
  70. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  71. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +28 -26
  72. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  73. package/dist/astro/routes/api/admin/plugins/index.mjs +28 -26
  74. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  75. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  76. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +28 -26
  77. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  78. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +28 -26
  79. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  80. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +28 -26
  81. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  82. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +28 -26
  83. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  84. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +29 -27
  85. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +28 -26
  87. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +29 -27
  89. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/plugins/updates.mjs +28 -26
  91. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +28 -26
  93. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  94. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  95. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +28 -26
  96. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  97. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
  98. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  99. package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -4
  100. package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
  101. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
  102. package/dist/astro/routes/api/admin/users/index.mjs +5 -4
  103. package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
  104. package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
  105. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  106. package/dist/astro/routes/api/auth/invite/complete.mjs +9 -8
  107. package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
  108. package/dist/astro/routes/api/auth/invite/index.mjs +6 -5
  109. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
  110. package/dist/astro/routes/api/auth/invite/register-options.mjs +8 -7
  111. package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
  112. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  113. package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -7
  114. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
  115. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  116. package/dist/astro/routes/api/auth/me.mjs +5 -4
  117. package/dist/astro/routes/api/auth/me.mjs.map +1 -1
  118. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  119. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  120. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  121. package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -4
  122. package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
  123. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  124. package/dist/astro/routes/api/auth/passkey/options.mjs +10 -9
  125. package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
  126. package/dist/astro/routes/api/auth/passkey/register/options.mjs +8 -7
  127. package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
  128. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +9 -8
  129. package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
  130. package/dist/astro/routes/api/auth/passkey/verify.mjs +9 -8
  131. package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
  132. package/dist/astro/routes/api/auth/signup/complete.mjs +9 -8
  133. package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
  134. package/dist/astro/routes/api/auth/signup/request.mjs +8 -7
  135. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
  136. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  137. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +11 -9
  138. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  139. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  140. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +2 -2
  141. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +2 -2
  142. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
  143. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -8
  144. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
  145. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +6 -5
  146. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  147. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +2 -2
  148. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  149. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +6 -5
  150. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
  151. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +10 -9
  152. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  153. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  154. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +2 -2
  155. package/dist/astro/routes/api/content/_collection_/_id_.mjs +6 -5
  156. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  157. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  158. package/dist/astro/routes/api/content/_collection_/index.mjs +6 -5
  159. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
  160. package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -5
  161. package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
  162. package/dist/astro/routes/api/dashboard.mjs +3 -3
  163. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  164. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  165. package/dist/astro/routes/api/import/probe.mjs +10 -9
  166. package/dist/astro/routes/api/import/probe.mjs.map +1 -1
  167. package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
  168. package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
  169. package/dist/astro/routes/api/import/wordpress/execute.mjs +10 -9
  170. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  171. package/dist/astro/routes/api/import/wordpress/media.mjs +8 -7
  172. package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
  173. package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -8
  174. package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
  175. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +8 -7
  176. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
  177. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  178. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +10 -9
  179. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
  180. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
  181. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +14 -12
  182. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  183. package/dist/astro/routes/api/manifest.mjs +3 -3
  184. package/dist/astro/routes/api/mcp.mjs +20 -19
  185. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  186. package/dist/astro/routes/api/media/_id_/confirm.mjs +6 -5
  187. package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
  188. package/dist/astro/routes/api/media/_id_.mjs +6 -5
  189. package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
  190. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  191. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  192. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  193. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  194. package/dist/astro/routes/api/media/upload-url.mjs +8 -7
  195. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  196. package/dist/astro/routes/api/media.mjs +10 -9
  197. package/dist/astro/routes/api/media.mjs.map +1 -1
  198. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +6 -5
  199. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  200. package/dist/astro/routes/api/menus/_name_/items.mjs +6 -5
  201. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  202. package/dist/astro/routes/api/menus/_name_/reorder.mjs +6 -5
  203. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  204. package/dist/astro/routes/api/menus/_name_/translations.mjs +6 -5
  205. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  206. package/dist/astro/routes/api/menus/_name_.mjs +6 -5
  207. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  208. package/dist/astro/routes/api/menus/index.mjs +6 -5
  209. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  210. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  211. package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
  212. package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
  213. package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
  214. package/dist/astro/routes/api/oauth/register.mjs +2 -2
  215. package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
  216. package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
  217. package/dist/astro/routes/api/oauth/token.mjs +5 -5
  218. package/dist/astro/routes/api/openapi.json.mjs +3 -2
  219. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  220. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
  221. package/dist/astro/routes/api/redirects/404s/index.mjs +7 -6
  222. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  223. package/dist/astro/routes/api/redirects/404s/summary.mjs +7 -6
  224. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  225. package/dist/astro/routes/api/redirects/_id_.mjs +8 -7
  226. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  227. package/dist/astro/routes/api/redirects/index.mjs +8 -7
  228. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  229. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  230. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  231. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +28 -26
  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 +28 -26
  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 +28 -26
  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 +28 -26
  238. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  239. package/dist/astro/routes/api/schema/collections/index.mjs +28 -26
  240. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  241. package/dist/astro/routes/api/schema/index.mjs +8 -13
  242. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  243. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +28 -26
  244. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  245. package/dist/astro/routes/api/schema/orphans/index.mjs +28 -26
  246. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  247. package/dist/astro/routes/api/search/enable.mjs +9 -8
  248. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  249. package/dist/astro/routes/api/search/index.mjs +8 -7
  250. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  251. package/dist/astro/routes/api/search/rebuild.mjs +9 -8
  252. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  253. package/dist/astro/routes/api/search/stats.mjs +5 -5
  254. package/dist/astro/routes/api/search/suggest.mjs +8 -7
  255. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  256. package/dist/astro/routes/api/sections/_slug_.mjs +8 -7
  257. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  258. package/dist/astro/routes/api/sections/index.mjs +8 -7
  259. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  260. package/dist/astro/routes/api/settings/email.mjs +3 -3
  261. package/dist/astro/routes/api/settings.mjs +11 -9
  262. package/dist/astro/routes/api/settings.mjs.map +1 -1
  263. package/dist/astro/routes/api/setup/admin-verify.mjs +10 -9
  264. package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
  265. package/dist/astro/routes/api/setup/admin.mjs +9 -8
  266. package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
  267. package/dist/astro/routes/api/setup/dev-bypass.mjs +19 -18
  268. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  269. package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
  270. package/dist/astro/routes/api/setup/index.mjs +20 -18
  271. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  272. package/dist/astro/routes/api/setup/status.mjs +3 -3
  273. package/dist/astro/routes/api/snapshot.mjs +5 -4
  274. package/dist/astro/routes/api/snapshot.mjs.map +1 -1
  275. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +11 -10
  276. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  277. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +11 -10
  278. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  279. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +11 -10
  280. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  281. package/dist/astro/routes/api/taxonomies/index.mjs +11 -10
  282. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  283. package/dist/astro/routes/api/themes/preview.mjs +5 -4
  284. package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
  285. package/dist/astro/routes/api/typegen.mjs +4 -4
  286. package/dist/astro/routes/api/well-known/auth.mjs +1 -1
  287. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  288. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  289. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +6 -5
  290. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  291. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -7
  292. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  293. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -7
  294. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  295. package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -4
  296. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  297. package/dist/astro/routes/api/widget-areas/index.mjs +9 -7
  298. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  299. package/dist/astro/routes/api/widget-components.mjs +2 -2
  300. package/dist/astro/routes/robots.txt.mjs +5 -4
  301. package/dist/astro/routes/robots.txt.mjs.map +1 -1
  302. package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -1
  303. package/dist/astro/routes/sitemap-_collection_.xml.mjs +15 -7
  304. package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
  305. package/dist/astro/routes/sitemap.xml.mjs +6 -5
  306. package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
  307. package/dist/astro/types.d.mts +12 -12
  308. package/dist/auth/providers/github.d.mts +1 -1
  309. package/dist/auth/providers/google.d.mts +1 -1
  310. package/dist/{authorize-C_8t2KGa.mjs → authorize-D5gfBVU5.mjs} +2 -2
  311. package/dist/{authorize-C_8t2KGa.mjs.map → authorize-D5gfBVU5.mjs.map} +1 -1
  312. package/dist/{byline-DUx48sJp.mjs → byline-V_Qp1Ziw.mjs} +27 -14
  313. package/dist/byline-V_Qp1Ziw.mjs.map +1 -0
  314. package/dist/{byline-fields-51kg6Vuv.mjs → byline-fields-B0NO1yUB.mjs} +3 -3
  315. package/dist/{byline-fields-51kg6Vuv.mjs.map → byline-fields-B0NO1yUB.mjs.map} +1 -1
  316. package/dist/{byline-fields-DYXKDuNX.d.mts → byline-fields-CQJRIQkn.d.mts} +36 -32
  317. package/dist/byline-fields-CQJRIQkn.d.mts.map +1 -0
  318. package/dist/{byline-fields-C_OsR-KF.mjs → byline-fields-nBVqK_Ff.mjs} +2 -2
  319. package/dist/{byline-fields-C_OsR-KF.mjs.map → byline-fields-nBVqK_Ff.mjs.map} +1 -1
  320. package/dist/{byline-registry-CWP7I71B.mjs → byline-registry-DedidtqC.mjs} +2 -2
  321. package/dist/{byline-registry-CWP7I71B.mjs.map → byline-registry-DedidtqC.mjs.map} +1 -1
  322. package/dist/{bylines-Cx5n-WqP.mjs → bylines-B2NWnIwS.mjs} +2 -2
  323. package/dist/{bylines-Cx5n-WqP.mjs.map → bylines-B2NWnIwS.mjs.map} +1 -1
  324. package/dist/{bylines-wurS258E.mjs → bylines-DfGDnred.mjs} +7 -7
  325. package/dist/{bylines-wurS258E.mjs.map → bylines-DfGDnred.mjs.map} +1 -1
  326. package/dist/{cache-B_HzASVT.mjs → cache-DTTHWD8n.mjs} +1 -1
  327. package/dist/{cache-B_HzASVT.mjs.map → cache-DTTHWD8n.mjs.map} +1 -1
  328. package/dist/{challenge-store-DGwuCc4R.mjs → challenge-store-woE0bbCf.mjs} +1 -1
  329. package/dist/{challenge-store-DGwuCc4R.mjs.map → challenge-store-woE0bbCf.mjs.map} +1 -1
  330. package/dist/cli/index.mjs +22 -20
  331. package/dist/cli/index.mjs.map +1 -1
  332. package/dist/client/cf-access.d.mts +1 -1
  333. package/dist/client/index.d.mts +1 -1
  334. package/dist/client/index.mjs +1 -1
  335. package/dist/{comments-CJ0RZsYR.mjs → comments-D2hNuxNa.mjs} +1 -1
  336. package/dist/{comments-CJ0RZsYR.mjs.map → comments-D2hNuxNa.mjs.map} +1 -1
  337. package/dist/{components-CTfpu3PZ.mjs → components-DYKp2gmo.mjs} +1 -1
  338. package/dist/{components-CTfpu3PZ.mjs.map → components-DYKp2gmo.mjs.map} +1 -1
  339. package/dist/{context-GG52SPgh.mjs → context-Cm4pt1Ws.mjs} +5 -5
  340. package/dist/{context-GG52SPgh.mjs.map → context-Cm4pt1Ws.mjs.map} +1 -1
  341. package/dist/{cron-BJ2ClIlj.mjs → cron-DdEVrQ2Y.mjs} +1 -1
  342. package/dist/{cron-BJ2ClIlj.mjs.map → cron-DdEVrQ2Y.mjs.map} +1 -1
  343. package/dist/{dashboard-2JgAMWxK.mjs → dashboard-C-UYpps0.mjs} +1 -1
  344. package/dist/{dashboard-2JgAMWxK.mjs.map → dashboard-C-UYpps0.mjs.map} +1 -1
  345. package/dist/database/instrumentation.d.mts +10 -1
  346. package/dist/database/instrumentation.d.mts.map +1 -1
  347. package/dist/database/instrumentation.mjs +13 -1
  348. package/dist/database/instrumentation.mjs.map +1 -1
  349. package/dist/db/index.d.mts +3 -3
  350. package/dist/db/libsql.d.mts +1 -1
  351. package/dist/db/postgres.d.mts +1 -1
  352. package/dist/db/sqlite.d.mts +1 -1
  353. package/dist/{db-errors-CtzxKBxe.mjs → db-errors-BluWkwGI.mjs} +1 -1
  354. package/dist/{db-errors-CtzxKBxe.mjs.map → db-errors-BluWkwGI.mjs.map} +1 -1
  355. package/dist/{default-xLFNSsZ9.mjs → default-NHGuJzQ3.mjs} +1 -1
  356. package/dist/{default-xLFNSsZ9.mjs.map → default-NHGuJzQ3.mjs.map} +1 -1
  357. package/dist/{device-flow-s6_q3T7A.mjs → device-flow-BQApWgnW.mjs} +4 -4
  358. package/dist/{device-flow-s6_q3T7A.mjs.map → device-flow-BQApWgnW.mjs.map} +1 -1
  359. package/dist/{email-console-DHT2Fbpj.mjs → email-console-BbU3RbWv.mjs} +1 -1
  360. package/dist/{email-console-DHT2Fbpj.mjs.map → email-console-BbU3RbWv.mjs.map} +1 -1
  361. package/dist/{error-RwM4dD35.mjs → error-CNn_w7jf.mjs} +1 -1
  362. package/dist/{error-RwM4dD35.mjs.map → error-CNn_w7jf.mjs.map} +1 -1
  363. package/dist/{escape-bIyGoW5W.mjs → escape-DPgcxcpL.mjs} +1 -1
  364. package/dist/{escape-bIyGoW5W.mjs.map → escape-DPgcxcpL.mjs.map} +1 -1
  365. package/dist/{fts-manager-1RgHmopc.mjs → fts-manager-Cx5z8jdA.mjs} +1 -1
  366. package/dist/{fts-manager-1RgHmopc.mjs.map → fts-manager-Cx5z8jdA.mjs.map} +1 -1
  367. package/dist/{hash-9w3pd3-m.mjs → hash-DlvIFn0b.mjs} +1 -1
  368. package/dist/{hash-9w3pd3-m.mjs.map → hash-DlvIFn0b.mjs.map} +1 -1
  369. package/dist/{import-Dh8bWmyq.mjs → import-KyxT1Mbs.mjs} +3 -3
  370. package/dist/{import-Dh8bWmyq.mjs.map → import-KyxT1Mbs.mjs.map} +1 -1
  371. package/dist/{index-FfiTQJq2.d.mts → index-D2VAiumu.d.mts} +46 -15
  372. package/dist/{index-FfiTQJq2.d.mts.map → index-D2VAiumu.d.mts.map} +1 -1
  373. package/dist/{index-BpYeJO1E.d.mts → index-uT2yR66F.d.mts} +3 -3
  374. package/dist/{index-BpYeJO1E.d.mts.map → index-uT2yR66F.d.mts.map} +1 -1
  375. package/dist/index.d.mts +16 -16
  376. package/dist/index.mjs +48 -46
  377. package/dist/init-lock-DlBHjf9-.mjs +83 -0
  378. package/dist/init-lock-DlBHjf9-.mjs.map +1 -0
  379. package/dist/{load-B84ohfBk.mjs → load-Dq91b_DK.mjs} +1 -1
  380. package/dist/{load-B84ohfBk.mjs.map → load-Dq91b_DK.mjs.map} +1 -1
  381. package/dist/{loader-CpZKpFz0.mjs → loader-BqWjcH3h.mjs} +12 -15
  382. package/dist/loader-BqWjcH3h.mjs.map +1 -0
  383. package/dist/{manifest-schema-Cj-YrzrF.mjs → manifest-schema-DFPeqMAn.mjs} +55 -2
  384. package/dist/manifest-schema-DFPeqMAn.mjs.map +1 -0
  385. package/dist/media/index.d.mts +1 -1
  386. package/dist/media/index.mjs +2 -2
  387. package/dist/media/local-runtime.d.mts +11 -11
  388. package/dist/media/local-runtime.mjs +4 -3
  389. package/dist/media/local-runtime.mjs.map +1 -1
  390. package/dist/{media-allowlist-CMcoYIjQ.mjs → media-allowlist-_A0SuDn4.mjs} +2 -2
  391. package/dist/{media-allowlist-CMcoYIjQ.mjs.map → media-allowlist-_A0SuDn4.mjs.map} +1 -1
  392. package/dist/media-url-CqLd69IO.mjs +26 -0
  393. package/dist/media-url-CqLd69IO.mjs.map +1 -0
  394. package/dist/{menus-Dp9xporj.mjs → menus-Ryk9L7fT.mjs} +10 -37
  395. package/dist/menus-Ryk9L7fT.mjs.map +1 -0
  396. package/dist/{mime-CCEzze7W.mjs → mime-YbtlEtvS.mjs} +1 -1
  397. package/dist/{mime-CCEzze7W.mjs.map → mime-YbtlEtvS.mjs.map} +1 -1
  398. package/dist/{mode-BjlXswIw.mjs → mode-CGXzIbD8.mjs} +1 -1
  399. package/dist/{mode-BjlXswIw.mjs.map → mode-CGXzIbD8.mjs.map} +1 -1
  400. package/dist/{normalize-CK5o04zr.mjs → normalize-DKsg36ty.mjs} +1 -1
  401. package/dist/{normalize-CK5o04zr.mjs.map → normalize-DKsg36ty.mjs.map} +1 -1
  402. package/dist/{oauth-authorization-1aPAYjiC.mjs → oauth-authorization-C2kVyjXI.mjs} +4 -4
  403. package/dist/{oauth-authorization-1aPAYjiC.mjs.map → oauth-authorization-C2kVyjXI.mjs.map} +1 -1
  404. package/dist/{oauth-clients-8mPDStMv.mjs → oauth-clients-BC873NCV.mjs} +1 -1
  405. package/dist/{oauth-clients-8mPDStMv.mjs.map → oauth-clients-BC873NCV.mjs.map} +1 -1
  406. package/dist/{oauth-state-store-BJ7YtrfD.mjs → oauth-state-store-Cd--TUaq.mjs} +1 -1
  407. package/dist/{oauth-state-store-BJ7YtrfD.mjs.map → oauth-state-store-Cd--TUaq.mjs.map} +1 -1
  408. package/dist/{oauth-user-lookup-BdDSDvjF.mjs → oauth-user-lookup-e4wOvDud.mjs} +1 -1
  409. package/dist/{oauth-user-lookup-BdDSDvjF.mjs.map → oauth-user-lookup-e4wOvDud.mjs.map} +1 -1
  410. package/dist/{options-D4MnavW_.d.mts → options-9kLgkE8m.d.mts} +3 -3
  411. package/dist/{options-D4MnavW_.d.mts.map → options-9kLgkE8m.d.mts.map} +1 -1
  412. package/dist/page/index.d.mts +2 -2
  413. package/dist/{parse-CrGndy1A.mjs → parse-DzSrk1t8.mjs} +2 -2
  414. package/dist/{parse-CrGndy1A.mjs.map → parse-DzSrk1t8.mjs.map} +1 -1
  415. package/dist/{passkey-config-BDVM86Tj.mjs → passkey-config-BpjbE_Uv.mjs} +1 -1
  416. package/dist/{passkey-config-BDVM86Tj.mjs.map → passkey-config-BpjbE_Uv.mjs.map} +1 -1
  417. package/dist/{placeholder-BZxr8W1j.mjs → placeholder-2xumZh4g.mjs} +1 -1
  418. package/dist/{placeholder-BZxr8W1j.mjs.map → placeholder-2xumZh4g.mjs.map} +1 -1
  419. package/dist/{placeholder-B9lUUEmj.d.mts → placeholder-BevVKfay.d.mts} +1 -1
  420. package/dist/{placeholder-B9lUUEmj.d.mts.map → placeholder-BevVKfay.d.mts.map} +1 -1
  421. package/dist/plugin-types.d.mts +1 -1
  422. package/dist/plugin-utils.d.mts +9 -9
  423. package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
  424. package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
  425. package/dist/{preview-BfuRkVKW.mjs → preview-Dqv2hwXr.mjs} +2 -2
  426. package/dist/{preview-BfuRkVKW.mjs.map → preview-Dqv2hwXr.mjs.map} +1 -1
  427. package/dist/{public-url-egRHCy1m.mjs → public-url-D_zARuvZ.mjs} +1 -1
  428. package/dist/{public-url-egRHCy1m.mjs.map → public-url-D_zARuvZ.mjs.map} +1 -1
  429. package/dist/{query-BFQ029Ts.mjs → query-Crm038Mc.mjs} +21 -11
  430. package/dist/query-Crm038Mc.mjs.map +1 -0
  431. package/dist/{rate-limit-ClFFUga6.mjs → rate-limit-hRTBqmw1.mjs} +2 -2
  432. package/dist/{rate-limit-ClFFUga6.mjs.map → rate-limit-hRTBqmw1.mjs.map} +1 -1
  433. package/dist/{redirect-Cw3JTlmj.mjs → redirect-C-OOkyku.mjs} +1 -1
  434. package/dist/{redirect-Cw3JTlmj.mjs.map → redirect-C-OOkyku.mjs.map} +1 -1
  435. package/dist/{redirects-DEygMrRO.mjs → redirects-6Zg2SoYo.mjs} +11 -10
  436. package/dist/redirects-6Zg2SoYo.mjs.map +1 -0
  437. package/dist/{redirects-OIu6vQ2i.mjs → redirects-CP3TnTLO.mjs} +20 -14
  438. package/dist/redirects-CP3TnTLO.mjs.map +1 -0
  439. package/dist/{registry-brYh-rAT.mjs → registry-diMzD1Wf.mjs} +3 -3
  440. package/dist/{registry-brYh-rAT.mjs.map → registry-diMzD1Wf.mjs.map} +1 -1
  441. package/dist/{request-cache-D32LpnmI.mjs → request-cache-UwmBAiUK.mjs} +1 -1
  442. package/dist/{request-cache-D32LpnmI.mjs.map → request-cache-UwmBAiUK.mjs.map} +1 -1
  443. package/dist/request-context.d.mts +7 -0
  444. package/dist/request-context.d.mts.map +1 -1
  445. package/dist/request-context.mjs +2 -1
  446. package/dist/request-context.mjs.map +1 -1
  447. package/dist/{request-meta-7ByVLxB-.mjs → request-meta-DPechd0W.mjs} +2 -2
  448. package/dist/{request-meta-7ByVLxB-.mjs.map → request-meta-DPechd0W.mjs.map} +1 -1
  449. package/dist/{resolve-BqYMVG0D.mjs → resolve-B3NUUtVY.mjs} +1 -1
  450. package/dist/{resolve-BqYMVG0D.mjs.map → resolve-B3NUUtVY.mjs.map} +1 -1
  451. package/dist/{runner-BcRuXq_h.d.mts → runner-C8vcbvCe.d.mts} +2 -2
  452. package/dist/{runner-BcRuXq_h.d.mts.map → runner-C8vcbvCe.d.mts.map} +1 -1
  453. package/dist/runtime.d.mts +10 -10
  454. package/dist/runtime.mjs +1 -1
  455. package/dist/{schema-CS7Eg5gh.mjs → schema-BDOkd3OU.mjs} +4 -4
  456. package/dist/{schema-CS7Eg5gh.mjs.map → schema-BDOkd3OU.mjs.map} +1 -1
  457. package/dist/{search-o-aQzHI1.mjs → search-Bs_J_EW-.mjs} +3 -3
  458. package/dist/{search-o-aQzHI1.mjs.map → search-Bs_J_EW-.mjs.map} +1 -1
  459. package/dist/{secrets-C_ZtRos3.mjs → secrets-C8xmE6mR.mjs} +21 -11
  460. package/dist/secrets-C8xmE6mR.mjs.map +1 -0
  461. package/dist/{sections-DhsZ0ns9.mjs → sections-P0zuBlyz.mjs} +2 -2
  462. package/dist/{sections-DhsZ0ns9.mjs.map → sections-P0zuBlyz.mjs.map} +1 -1
  463. package/dist/seed/index.d.mts +2 -2
  464. package/dist/seed/index.mjs +14 -13
  465. package/dist/seo/index.d.mts +1 -1
  466. package/dist/seo/index.d.mts.map +1 -1
  467. package/dist/seo/index.mjs +3 -12
  468. package/dist/seo/index.mjs.map +1 -1
  469. package/dist/{seo-DfjLvu8i.mjs → seo-CLhm-Fmb.mjs} +4 -3
  470. package/dist/seo-CLhm-Fmb.mjs.map +1 -0
  471. package/dist/{seo-B5e6y9Wk.mjs → seo-DpNgGQjF.mjs} +1 -1
  472. package/dist/{seo-B5e6y9Wk.mjs.map → seo-DpNgGQjF.mjs.map} +1 -1
  473. package/dist/{service-DAxg8RPR.mjs → service-CDQQnT8W.mjs} +2 -2
  474. package/dist/{service-DAxg8RPR.mjs.map → service-CDQQnT8W.mjs.map} +1 -1
  475. package/dist/{settings-B1p-gPUK.mjs → settings-BjBsmVAo.mjs} +32 -30
  476. package/dist/settings-BjBsmVAo.mjs.map +1 -0
  477. package/dist/{settings-DIsbHTRE.mjs → settings-sO0Fif4p.mjs} +2 -2
  478. package/dist/{settings-DIsbHTRE.mjs.map → settings-sO0Fif4p.mjs.map} +1 -1
  479. package/dist/{setup-complete-Yuv78yua.mjs → setup-complete-CMMr-oZU.mjs} +1 -1
  480. package/dist/{setup-complete-Yuv78yua.mjs.map → setup-complete-CMMr-oZU.mjs.map} +1 -1
  481. package/dist/{setup-nonce-Bm0uKqmf.mjs → setup-nonce-169xl4fV.mjs} +1 -1
  482. package/dist/{setup-nonce-Bm0uKqmf.mjs.map → setup-nonce-169xl4fV.mjs.map} +1 -1
  483. package/dist/single-flight-cache-C0UV1Npg.mjs +104 -0
  484. package/dist/single-flight-cache-C0UV1Npg.mjs.map +1 -0
  485. package/dist/{site-url-mEVmwIFi.mjs → site-url-vtsuOvSD.mjs} +1 -1
  486. package/dist/{site-url-mEVmwIFi.mjs.map → site-url-vtsuOvSD.mjs.map} +1 -1
  487. package/dist/{ssrf-BsVGIE0Z.mjs → ssrf-XO05Voq6.mjs} +1 -1
  488. package/dist/{ssrf-BsVGIE0Z.mjs.map → ssrf-XO05Voq6.mjs.map} +1 -1
  489. package/dist/status-2gZklYuj.mjs +30 -0
  490. package/dist/status-2gZklYuj.mjs.map +1 -0
  491. package/dist/storage/local.d.mts +1 -1
  492. package/dist/storage/local.mjs +2 -2
  493. package/dist/storage/s3.d.mts +1 -1
  494. package/dist/storage/s3.mjs +1 -1
  495. package/dist/{taxonomies-BEW7S5AI.mjs → taxonomies-BBxYA38v.mjs} +49 -12
  496. package/dist/taxonomies-BBxYA38v.mjs.map +1 -0
  497. package/dist/{taxonomies-UusDXv3C.mjs → taxonomies-DuESHWKI.mjs} +2 -2
  498. package/dist/{taxonomies-UusDXv3C.mjs.map → taxonomies-DuESHWKI.mjs.map} +1 -1
  499. package/dist/{tokens-Bx2afeT-.mjs → tokens-DMkVjxrx.mjs} +1 -1
  500. package/dist/{tokens-Bx2afeT-.mjs.map → tokens-DMkVjxrx.mjs.map} +1 -1
  501. package/dist/{transport--Ck3RBin.mjs → transport-1cIrOb1Y.mjs} +1 -1
  502. package/dist/{transport--Ck3RBin.mjs.map → transport-1cIrOb1Y.mjs.map} +1 -1
  503. package/dist/{transport-BwQeeY2p.d.mts → transport-jdvsZEIt.d.mts} +1 -1
  504. package/dist/{transport-BwQeeY2p.d.mts.map → transport-jdvsZEIt.d.mts.map} +1 -1
  505. package/dist/{trusted-proxy-B4AfnoAp.mjs → trusted-proxy-CHp41Fjj.mjs} +1 -1
  506. package/dist/{trusted-proxy-B4AfnoAp.mjs.map → trusted-proxy-CHp41Fjj.mjs.map} +1 -1
  507. package/dist/{types-DWnN7weG.d.mts → types-BFgYtuKd.d.mts} +1 -1
  508. package/dist/{types-DWnN7weG.d.mts.map → types-BFgYtuKd.d.mts.map} +1 -1
  509. package/dist/{types-DZk_y-MU.mjs → types-BIduXPJk.mjs} +1 -1
  510. package/dist/types-BIduXPJk.mjs.map +1 -0
  511. package/dist/{types-WVmpZBJV.d.mts → types-BTnnBYVX.d.mts} +2 -2
  512. package/dist/{types-WVmpZBJV.d.mts.map → types-BTnnBYVX.d.mts.map} +1 -1
  513. package/dist/types-BoRm8-pp.mjs +3 -0
  514. package/dist/{types-DbCWhHet.d.mts → types-Bzfk2yC8.d.mts} +2 -2
  515. package/dist/types-Bzfk2yC8.d.mts.map +1 -0
  516. package/dist/{types-Qa7-HJJC.d.mts → types-CkEuk-Zr.d.mts} +1 -1
  517. package/dist/{types-Qa7-HJJC.d.mts.map → types-CkEuk-Zr.d.mts.map} +1 -1
  518. package/dist/{types-DMwSpvcw.d.mts → types-DO7whVYU.d.mts} +9 -3
  519. package/dist/{types-DMwSpvcw.d.mts.map → types-DO7whVYU.d.mts.map} +1 -1
  520. package/dist/{types-DX6v9KzJ.d.mts → types-DdkL6fyv.d.mts} +1 -1
  521. package/dist/{types-DX6v9KzJ.d.mts.map → types-DdkL6fyv.d.mts.map} +1 -1
  522. package/dist/{types-DpFmlNyB.mjs → types-DejCHqWT.mjs} +1 -1
  523. package/dist/{types-DpFmlNyB.mjs.map → types-DejCHqWT.mjs.map} +1 -1
  524. package/dist/{types-OT_Es5mp.d.mts → types-Del0VMij.d.mts} +1 -1
  525. package/dist/{types-OT_Es5mp.d.mts.map → types-Del0VMij.d.mts.map} +1 -1
  526. package/dist/{types-kwqCOUxj.d.mts → types-u_XxjbS8.d.mts} +1 -1
  527. package/dist/{types-kwqCOUxj.d.mts.map → types-u_XxjbS8.d.mts.map} +1 -1
  528. package/dist/{utils-C4Ih4DML.mjs → utils-C4M981Br.mjs} +1 -1
  529. package/dist/{utils-C4Ih4DML.mjs.map → utils-C4M981Br.mjs.map} +1 -1
  530. package/dist/{validate-ZP9Dvg0P.mjs → validate-DGhQPXzI.mjs} +2 -2
  531. package/dist/{validate-ZP9Dvg0P.mjs.map → validate-DGhQPXzI.mjs.map} +1 -1
  532. package/dist/{validate-BPAHUSge.d.mts → validate-cJOiOvT2.d.mts} +5 -5
  533. package/dist/{validate-BPAHUSge.d.mts.map → validate-cJOiOvT2.d.mts.map} +1 -1
  534. package/dist/{validation-CE5i4q0c.mjs → validation-DVHjPM1M.mjs} +5 -5
  535. package/dist/{validation-CE5i4q0c.mjs.map → validation-DVHjPM1M.mjs.map} +1 -1
  536. package/dist/version-BOjj_cfz.mjs +7 -0
  537. package/dist/{version-Dw0JXu45.mjs.map → version-BOjj_cfz.mjs.map} +1 -1
  538. package/dist/{widgets-ClEnYQCH.mjs → widgets-Ci6hLwfO.mjs} +47 -44
  539. package/dist/widgets-Ci6hLwfO.mjs.map +1 -0
  540. package/dist/{zod-generator-Djo_VHCt.mjs → zod-generator-CarzgPAu.mjs} +2 -2
  541. package/dist/{zod-generator-Djo_VHCt.mjs.map → zod-generator-CarzgPAu.mjs.map} +1 -1
  542. package/package.json +10 -10
  543. package/src/api/handlers/marketplace.ts +2 -5
  544. package/src/api/handlers/redirects.ts +24 -13
  545. package/src/api/handlers/registry.ts +70 -0
  546. package/src/api/handlers/seo.ts +9 -1
  547. package/src/api/schemas/redirects.ts +11 -4
  548. package/src/api/schemas/schema.ts +13 -1
  549. package/src/astro/integration/index.ts +44 -8
  550. package/src/astro/integration/routes.ts +46 -9
  551. package/src/astro/middleware/redirect.ts +12 -0
  552. package/src/astro/middleware.ts +20 -6
  553. package/src/astro/routes/api/schema/index.ts +7 -15
  554. package/src/astro/routes/sitemap-[collection].xml.ts +13 -2
  555. package/src/bylines/field-defs-cache.ts +70 -20
  556. package/src/cli/commands/bundle-utils.ts +2 -0
  557. package/src/cli/commands/doctor.ts +1 -1
  558. package/src/cli/commands/secrets.ts +2 -2
  559. package/src/config/secrets.ts +28 -14
  560. package/src/database/instrumentation.ts +13 -0
  561. package/src/emdash-runtime.ts +31 -25
  562. package/src/loader.ts +24 -15
  563. package/src/plugins/manifest-schema.ts +75 -0
  564. package/src/plugins/marketplace.ts +2 -5
  565. package/src/plugins/types.ts +12 -0
  566. package/src/query.ts +13 -2
  567. package/src/redirects/status.ts +27 -0
  568. package/src/request-context.ts +8 -0
  569. package/src/schema/types.ts +11 -1
  570. package/src/seo/index.ts +2 -28
  571. package/src/seo/media-url.ts +32 -0
  572. package/src/settings/index.ts +32 -40
  573. package/src/taxonomies/index.ts +78 -12
  574. package/src/utils/single-flight-cache.ts +194 -0
  575. package/src/widgets/index.ts +57 -54
  576. package/dist/api-BZ6bhjYs.mjs.map +0 -1
  577. package/dist/byline-DUx48sJp.mjs.map +0 -1
  578. package/dist/byline-fields-DYXKDuNX.d.mts.map +0 -1
  579. package/dist/loader-CpZKpFz0.mjs.map +0 -1
  580. package/dist/manifest-schema-Cj-YrzrF.mjs.map +0 -1
  581. package/dist/menus-Dp9xporj.mjs.map +0 -1
  582. package/dist/query-BFQ029Ts.mjs.map +0 -1
  583. package/dist/redirects-DEygMrRO.mjs.map +0 -1
  584. package/dist/redirects-OIu6vQ2i.mjs.map +0 -1
  585. package/dist/secrets-C_ZtRos3.mjs.map +0 -1
  586. package/dist/seo-DfjLvu8i.mjs.map +0 -1
  587. package/dist/settings-B1p-gPUK.mjs.map +0 -1
  588. package/dist/taxonomies-BEW7S5AI.mjs.map +0 -1
  589. package/dist/types-Cj2S6FuC.mjs +0 -3
  590. package/dist/types-DZk_y-MU.mjs.map +0 -1
  591. package/dist/types-DbCWhHet.d.mts.map +0 -1
  592. package/dist/version-Dw0JXu45.mjs +0 -7
  593. package/dist/widgets-ClEnYQCH.mjs.map +0 -1
  594. /package/dist/{api-tokens-B6VgoE6M.mjs → api-tokens-C7ywRx7l.mjs} +0 -0
  595. /package/dist/{ssrf-BvgVcfNQ.mjs → ssrf-CRZGzjdL.mjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"byline-fields-51kg6Vuv.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"],"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});\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"],"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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CAAgC,EAC3C,OAAO,EACP,OAAO,EAAE,MAAM,4BAA4B,EAC3C,CAAC,CACD,KAAK,EAAE,IAAI,2BAA2B,CAAC;;;;;;;;;;;AAYzC,MAAa,iCAAiC,EAC5C,OAAO;CACP,wBAAwB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CACtD,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CAC/C,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CACjD,CAAC,CACD,KAAK,EAAE,IAAI,4BAA4B,CAAC"}
1
+ {"version":3,"file":"byline-fields-B0NO1yUB.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"],"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});\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"],"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,y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,CAAC,KAAK,CAAC,aAAa;CACtD,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CAC/C,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CACjD,CAAC,CACD,KAAK,EAAE,IAAI,4BAA4B,CAAC"}
@@ -574,11 +574,11 @@ declare const createCollectionBody: z.ZodObject<{
574
574
  description: z.ZodOptional<z.ZodString>;
575
575
  icon: z.ZodOptional<z.ZodString>;
576
576
  supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
577
+ search: "search";
577
578
  drafts: "drafts";
578
579
  revisions: "revisions";
579
580
  preview: "preview";
580
581
  scheduling: "scheduling";
581
- search: "search";
582
582
  }>>>;
583
583
  source: z.ZodOptional<z.ZodString>;
584
584
  urlPattern: z.ZodOptional<z.ZodString>;
@@ -590,11 +590,11 @@ declare const updateCollectionBody: z.ZodObject<{
590
590
  description: z.ZodOptional<z.ZodString>;
591
591
  icon: z.ZodOptional<z.ZodString>;
592
592
  supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
593
+ search: "search";
593
594
  drafts: "drafts";
594
595
  revisions: "revisions";
595
596
  preview: "preview";
596
597
  scheduling: "scheduling";
597
- search: "search";
598
598
  }>>>;
599
599
  urlPattern: z.ZodOptional<z.ZodNullable<z.ZodString>>;
600
600
  hasSeo: z.ZodOptional<z.ZodBoolean>;
@@ -614,14 +614,14 @@ declare const createFieldBody: z.ZodObject<{
614
614
  string: "string";
615
615
  number: "number";
616
616
  boolean: "boolean";
617
- slug: "slug";
618
- text: "text";
619
- url: "url";
620
- select: "select";
621
617
  file: "file";
618
+ url: "url";
622
619
  image: "image";
623
620
  datetime: "datetime";
621
+ slug: "slug";
622
+ text: "text";
624
623
  integer: "integer";
624
+ select: "select";
625
625
  multiSelect: "multiSelect";
626
626
  portableText: "portableText";
627
627
  reference: "reference";
@@ -645,10 +645,12 @@ declare const createFieldBody: z.ZodObject<{
645
645
  string: "string";
646
646
  number: "number";
647
647
  boolean: "boolean";
648
- text: "text";
649
- select: "select";
648
+ url: "url";
649
+ image: "image";
650
650
  datetime: "datetime";
651
+ text: "text";
651
652
  integer: "integer";
653
+ select: "select";
652
654
  }>;
653
655
  label: z.ZodString;
654
656
  required: z.ZodOptional<z.ZodBoolean>;
@@ -683,10 +685,12 @@ declare const updateFieldBody: z.ZodObject<{
683
685
  string: "string";
684
686
  number: "number";
685
687
  boolean: "boolean";
686
- text: "text";
687
- select: "select";
688
+ url: "url";
689
+ image: "image";
688
690
  datetime: "datetime";
691
+ text: "text";
689
692
  integer: "integer";
693
+ select: "select";
690
694
  }>;
691
695
  label: z.ZodString;
692
696
  required: z.ZodOptional<z.ZodBoolean>;
@@ -739,14 +743,14 @@ declare const fieldSchema: z.ZodObject<{
739
743
  string: "string";
740
744
  number: "number";
741
745
  boolean: "boolean";
742
- slug: "slug";
743
- text: "text";
744
- url: "url";
745
- select: "select";
746
746
  file: "file";
747
+ url: "url";
747
748
  image: "image";
748
749
  datetime: "datetime";
750
+ slug: "slug";
751
+ text: "text";
749
752
  integer: "integer";
753
+ select: "select";
750
754
  multiSelect: "multiSelect";
751
755
  portableText: "portableText";
752
756
  reference: "reference";
@@ -804,14 +808,14 @@ declare const collectionWithFieldsResponseSchema: z.ZodObject<{
804
808
  string: "string";
805
809
  number: "number";
806
810
  boolean: "boolean";
807
- slug: "slug";
808
- text: "text";
809
- url: "url";
810
- select: "select";
811
811
  file: "file";
812
+ url: "url";
812
813
  image: "image";
813
814
  datetime: "datetime";
815
+ slug: "slug";
816
+ text: "text";
814
817
  integer: "integer";
818
+ select: "select";
815
819
  multiSelect: "multiSelect";
816
820
  portableText: "portableText";
817
821
  reference: "reference";
@@ -858,14 +862,14 @@ declare const fieldResponseSchema: z.ZodObject<{
858
862
  string: "string";
859
863
  number: "number";
860
864
  boolean: "boolean";
861
- slug: "slug";
862
- text: "text";
863
- url: "url";
864
- select: "select";
865
865
  file: "file";
866
+ url: "url";
866
867
  image: "image";
867
868
  datetime: "datetime";
869
+ slug: "slug";
870
+ text: "text";
868
871
  integer: "integer";
872
+ select: "select";
869
873
  multiSelect: "multiSelect";
870
874
  portableText: "portableText";
871
875
  reference: "reference";
@@ -895,14 +899,14 @@ declare const fieldListResponseSchema: z.ZodObject<{
895
899
  string: "string";
896
900
  number: "number";
897
901
  boolean: "boolean";
898
- slug: "slug";
899
- text: "text";
900
- url: "url";
901
- select: "select";
902
902
  file: "file";
903
+ url: "url";
903
904
  image: "image";
904
905
  datetime: "datetime";
906
+ slug: "slug";
907
+ text: "text";
905
908
  integer: "integer";
909
+ select: "select";
906
910
  multiSelect: "multiSelect";
907
911
  portableText: "portableText";
908
912
  reference: "reference";
@@ -1842,14 +1846,14 @@ declare const widgetAreaWithWidgetsAndCountSchema: z.ZodObject<{
1842
1846
  //#region src/api/schemas/redirects.d.ts
1843
1847
  declare const createRedirectBody: z.ZodObject<{
1844
1848
  source: z.ZodString;
1845
- destination: z.ZodString;
1849
+ destination: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>>;
1846
1850
  type: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1847
1851
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1848
1852
  groupName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1849
1853
  }, z.core.$strip>;
1850
1854
  declare const updateRedirectBody: z.ZodObject<{
1851
1855
  source: z.ZodOptional<z.ZodString>;
1852
- destination: z.ZodOptional<z.ZodString>;
1856
+ destination: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>>;
1853
1857
  type: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1854
1858
  enabled: z.ZodOptional<z.ZodBoolean>;
1855
1859
  groupName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -2077,8 +2081,8 @@ declare const bylineFieldCreateBody: z.ZodObject<{
2077
2081
  type: z.ZodEnum<{
2078
2082
  string: "string";
2079
2083
  boolean: "boolean";
2080
- text: "text";
2081
2084
  url: "url";
2085
+ text: "text";
2082
2086
  select: "select";
2083
2087
  }>;
2084
2088
  required: z.ZodOptional<z.ZodBoolean>;
@@ -2113,8 +2117,8 @@ declare const bylineFieldDefinitionSchema: z.ZodObject<{
2113
2117
  type: z.ZodEnum<{
2114
2118
  string: "string";
2115
2119
  boolean: "boolean";
2116
- text: "text";
2117
2120
  url: "url";
2121
+ text: "text";
2118
2122
  select: "select";
2119
2123
  }>;
2120
2124
  required: z.ZodBoolean;
@@ -2134,8 +2138,8 @@ declare const bylineFieldListResponseSchema: z.ZodObject<{
2134
2138
  type: z.ZodEnum<{
2135
2139
  string: "string";
2136
2140
  boolean: "boolean";
2137
- text: "text";
2138
2141
  url: "url";
2142
+ text: "text";
2139
2143
  select: "select";
2140
2144
  }>;
2141
2145
  required: z.ZodBoolean;
@@ -2165,4 +2169,4 @@ declare const bylineFieldUsageResponseSchema: z.ZodObject<{
2165
2169
  }, z.core.$strip>;
2166
2170
  //#endregion
2167
2171
  export { wpRewriteUrlsBody as $, trashedContentListResponseSchema as $n, commentSchema as $t, reorderWidgetsBody as A, mediaResponseSchema as An, menuSchema as At, userSchema as B, contentListResponseSchema as Bn, magicLinkSendBody as Bt, notFoundSummarySchema as C, mediaConfirmBody as Cn, termWithCountSchema as Ct, updateRedirectBody as D, mediaListQuery as Dn, menuItemSchema as Dt, redirectsListQuery as E, mediaItemSchema as En, createMenuItemBody as Et, widgetSchema as F, contentAuthorsResponseSchema as Fn, updateMenuItemBody as Ft, setupAdminVerifyBody as G, contentSeoInput as Gn, passkeyVerifyBody as Gt, usersListQuery as H, contentPublishBody as Hn, passkeyRegisterOptionsBody as Ht, allowedDomainCreateBody as I, contentCompareResponseSchema as In, authMeActionBody as It, importProbeBody as J, contentTranslationSchema as Jn, adminCommentListResponseSchema as Jt, setupAtprotoAdminBody as K, contentSeoSchema as Kn, signupCompleteBody as Kt, allowedDomainUpdateBody as L, contentCreateBody as Ln, inviteCompleteBody as Lt, widgetAreaSchema as M, mediaUploadUrlBody as Mn, menuWithItemsSchema as Mt, widgetAreaWithWidgetsAndCountSchema as N, mediaUploadUrlResponseSchema as Nn, reorderMenuItemsBody as Nt, createWidgetAreaBody as O, mediaListResponseSchema as On, menuItemTypeEnum as Ot, widgetAreaWithWidgetsSchema as P, contentAuthorSchema as Pn, updateMenuBody as Pt, wpPrepareBody as Q, trashedContentItemSchema as Qn, commentListQuery as Qt, userDetailSchema as R, contentItemSchema as Rn, inviteCreateBody as Rt, notFoundSummaryResponseSchema as S, formatFileSize as Sn, termTranslationsSchema as St, redirectSchema as T, mediaExistingResponseSchema as Tn, createMenuBody as Tt, atprotoLoginBody as U, contentResponseSchema as Un, passkeyRegisterVerifyBody as Ut, userUpdateBody as V, contentPreviewUrlBody as Vn, passkeyOptionsBody as Vt, setupAdminBody as W, contentScheduleBody as Wn, passkeyRenameBody as Wt, wpPluginAnalyzeBody as X, contentTrashQuery as Xn, commentBulkResponseSchema as Xt, wpMediaImportBody as Y, contentTranslationsResponseSchema as Yn, commentBulkBody as Yt, wpPluginExecuteBody as Z, contentUpdateBody as Zn, commentCountsResponseSchema as Zt, notFoundEntrySchema as _, orphanedTableSchema as _n, taxonomyListResponseSchema as _t, bylineFieldUpdateBody as a, collectionListResponseSchema as an, httpUrl as ar, searchSuggestQuery as at, notFoundPruneBody as b, updateFieldBody as bn, termResponseSchema as bt, bylineCreditSchema as c, collectionWithFieldsResponseSchema as cn, offsetPaginationQuery as cr, createSectionBody as ct, bylineTranslationCreateBody as d, fieldListResponseSchema as dn, successEnvelope as dr, sectionsListQuery as dt, commentStatusBody as en, VALID_ROLE_LEVELS as er, searchEnableBody as et, bylineTranslationsResponseSchema as f, fieldReorderBody as fn, updateSectionBody as ft, createRedirectBody as g, orphanedTableListResponseSchema as gn, taxonomyDefTranslationsSchema as gt, contentBylineInputSchema as h, orphanRegisterBody as hn, taxonomyDefSchema as ht, bylineFieldReorderBody as i, collectionGetQuery as in, deleteResponseSchema as ir, searchResultSchema as it, updateWidgetBody as j, mediaUpdateBody as jn, menuTranslationsSchema as jt, createWidgetBody as k, mediaProviderListQuery as kn, menuListItemSchema as kt, bylineListResponseSchema as l, createCollectionBody as ln, roleLevel as lr, sectionListResponseSchema as lt, bylinesListQuery as m, fieldSchema as mn, createTermBody as mt, bylineFieldDefinitionSchema as n, publicCommentListResponseSchema as nn, countResponseSchema as nr, searchRebuildBody as nt, bylineFieldUsageResponseSchema as o, collectionResponseSchema as on, localeCode as or, settingsUpdateBody as ot, bylineUpdateBody as p, fieldResponseSchema as pn, createTaxonomyDefBody as pt, setupBody as q, contentTermsBody as qn, signupRequestBody as qt, bylineFieldListResponseSchema as r, publicCommentSchema as rn, cursorPaginationQuery as rr, searchResponseSchema as rt, bylineCreateBody as s, collectionSchema as sn, localeFilterQuery as sr, siteSettingsSchema as st, bylineFieldCreateBody as t, createCommentBody as tn, apiErrorSchema as tr, searchQuery as tt, bylineSummarySchema as u, createFieldBody as un, slugPattern as ur, sectionSchema as ut, notFoundListQuery as v, schemaExportQuery as vn, termGetResponseSchema as vt, redirectListResponseSchema as w, mediaConfirmResponseSchema as wn, updateTermBody as wt, notFoundSummaryQuery as x, DEFAULT_MAX_UPLOAD_SIZE as xn, termSchema as xt, notFoundListResponseSchema as y, updateCollectionBody as yn, termListResponseSchema as yt, userListResponseSchema as z, contentListQuery as zn, inviteRegisterOptionsBody as zt };
2168
- //# sourceMappingURL=byline-fields-DYXKDuNX.d.mts.map
2172
+ //# sourceMappingURL=byline-fields-CQJRIQkn.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byline-fields-CQJRIQkn.d.mts","names":[],"sources":["../src/api/schemas/common.ts","../src/api/schemas/content.ts","../src/api/schemas/media.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"],"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,EAAqB,CAAA,CAAA,SAAA;;;;;cAUrB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;cAYrB,WAAA,EAAW,MAAA;;cAMX,OAAA,EAAO,CAAA,CAAA,SAAA;;cAMP,UAAA,EAAU,CAAA,CAAA,OAAA,CAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,YAAA;;cAMV,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;AAxC9B;AAAA,cAmDa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;iBAUX,eAAA,WAA0B,CAAA,CAAE,OAAA,CAAA,CAAS,UAAA,EAAY,CAAA,GAAC,CAAA,CAAA,SAAA;;;;cAKrD,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;cAKpB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;cCnFnB,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;cAkBf,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAwBhB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;cAcjB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;cAiBjB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;cASnB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;cAiBlB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;cAOrB,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;cAMhB,iBAAA,EAAiB,CAAA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tB,2BAAA,EAA2B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAmB3B,6BAAA,EAA6B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AjBnH1C;;;;;AAMA;ciB6Ha,8BAAA,EAA8B,CAAA,CAAA,SAAA"}
@@ -1,4 +1,4 @@
1
- import { n as BylineSchemaRegistry, r as mapBylineSchemaError, t as BylineSchemaError } from "./byline-registry-CWP7I71B.mjs";
1
+ import { n as BylineSchemaRegistry, r as mapBylineSchemaError, t as BylineSchemaError } from "./byline-registry-DedidtqC.mjs";
2
2
 
3
3
  //#region src/api/handlers/byline-fields.ts
4
4
  /**
@@ -120,4 +120,4 @@ async function handleBylineFieldReorder(db, slugs) {
120
120
 
121
121
  //#endregion
122
122
  export { handleBylineFieldReorder as a, handleBylineFieldList as i, handleBylineFieldDelete as n, handleBylineFieldUpdate as o, handleBylineFieldGet as r, handleBylineFieldUsage as s, handleBylineFieldCreate as t };
123
- //# sourceMappingURL=byline-fields-C_OsR-KF.mjs.map
123
+ //# sourceMappingURL=byline-fields-nBVqK_Ff.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"byline-fields-C_OsR-KF.mjs","names":[],"sources":["../src/api/handlers/byline-fields.ts"],"sourcesContent":["/**\n * Handler layer for the byline-fields admin API (Phase 4 of Discussion\n * #1174).\n *\n * Each handler:\n * - Takes the `Kysely<Database>` from the route, returns `ApiResult<T>`.\n * - Wraps the registry call in try/catch.\n * - Translates `BylineSchemaError` → shared `ErrorCode` via\n * `mapBylineSchemaError`. HTTP status comes from `mapErrorStatus` at\n * the route's `unwrapResult` site — handlers don't know about\n * statuses.\n * - Catches everything else, logs server-side, returns a 500-class\n * code without leaking `error.message`.\n *\n * Reserved-slug + identifier validation runs at the zod layer (see\n * `schemas/byline-fields.ts`); the registry repeats it for defence in\n * depth (non-HTTP callers). This module assumes inputs have already\n * passed through whichever zod schema the route used.\n */\n\nimport type { Kysely } from \"kysely\";\n\nimport type { Database } from \"../../database/types.js\";\nimport {\n\tBylineSchemaError,\n\tBylineSchemaRegistry,\n\tmapBylineSchemaError,\n} from \"../../schema/byline-registry.js\";\nimport type {\n\tBylineFieldDefinition,\n\tCreateBylineFieldInput,\n\tUpdateBylineFieldInput,\n} from \"../../schema/types.js\";\nimport type { ApiResult } from \"../types.js\";\n\n/**\n * Build a structured failure envelope from a `BylineSchemaError`.\n * Centralised so every handler emits the same shape.\n */\nfunction bylineSchemaErrorResult<T>(error: BylineSchemaError): ApiResult<T> {\n\tconst mapped = mapBylineSchemaError(error);\n\treturn {\n\t\tsuccess: false,\n\t\terror: { code: mapped.code, message: mapped.message, details: mapped.details },\n\t};\n}\n\n/**\n * Build a 500-class failure envelope. Logs the underlying error\n * server-side; the message returned to the client is the static\n * fallback to avoid leaking internals.\n */\nfunction internalErrorResult<T>(\n\terror: unknown,\n\tcode: string,\n\tfallbackMessage: string,\n): ApiResult<T> {\n\tconsole.error(`[${code}]`, error);\n\treturn {\n\t\tsuccess: false,\n\t\terror: { code, message: fallbackMessage },\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// List\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldList(\n\tdb: Kysely<Database>,\n): Promise<ApiResult<{ items: BylineFieldDefinition[] }>> {\n\ttry {\n\t\tconst items = await new BylineSchemaRegistry(db).listFields();\n\t\treturn { success: true, data: { items } };\n\t} catch (error) {\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_LIST_ERROR\", \"Failed to list byline fields\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Create\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldCreate(\n\tdb: Kysely<Database>,\n\tinput: CreateBylineFieldInput,\n): Promise<ApiResult<BylineFieldDefinition>> {\n\ttry {\n\t\tconst field = await new BylineSchemaRegistry(db).createField(input);\n\t\treturn { success: true, data: field };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_CREATE_ERROR\", \"Failed to create byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Get one\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldGet(\n\tdb: Kysely<Database>,\n\tslug: string,\n): Promise<ApiResult<BylineFieldDefinition>> {\n\ttry {\n\t\tconst field = await new BylineSchemaRegistry(db).getField(slug);\n\t\tif (!field) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: \"NOT_FOUND\", message: \"Byline field not found\" },\n\t\t\t};\n\t\t}\n\t\treturn { success: true, data: field };\n\t} catch (error) {\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_GET_ERROR\", \"Failed to get byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Update\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldUpdate(\n\tdb: Kysely<Database>,\n\tslug: string,\n\tinput: UpdateBylineFieldInput,\n): Promise<ApiResult<BylineFieldDefinition>> {\n\ttry {\n\t\tconst field = await new BylineSchemaRegistry(db).updateField(slug, input);\n\t\treturn { success: true, data: field };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_UPDATE_ERROR\", \"Failed to update byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Delete\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldDelete(\n\tdb: Kysely<Database>,\n\tslug: string,\n): Promise<ApiResult<{ deleted: true }>> {\n\ttry {\n\t\tawait new BylineSchemaRegistry(db).deleteField(slug);\n\t\treturn { success: true, data: { deleted: true } };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_DELETE_ERROR\", \"Failed to delete byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Usage\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldUsage(\n\tdb: Kysely<Database>,\n\tslug: string,\n): Promise<\n\tApiResult<{\n\t\ttranslatableValueCount: number;\n\t\tgroupValueCount: number;\n\t\ttotalAffectedRows: number;\n\t}>\n> {\n\ttry {\n\t\tconst usage = await new BylineSchemaRegistry(db).getFieldUsage(slug);\n\t\treturn { success: true, data: usage };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(\n\t\t\terror,\n\t\t\t\"SCHEMA_FIELD_GET_ERROR\",\n\t\t\t\"Failed to read byline field usage\",\n\t\t);\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Reorder\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldReorder(\n\tdb: Kysely<Database>,\n\tslugs: string[],\n): Promise<ApiResult<{ items: BylineFieldDefinition[] }>> {\n\ttry {\n\t\tconst registry = new BylineSchemaRegistry(db);\n\t\tawait registry.reorderFields(slugs);\n\t\tconst items = await registry.listFields();\n\t\treturn { success: true, data: { items } };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(\n\t\t\terror,\n\t\t\t\"SCHEMA_FIELD_REORDER_ERROR\",\n\t\t\t\"Failed to reorder byline fields\",\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAuCA,SAAS,wBAA2B,OAAwC;CAC3E,MAAM,SAAS,qBAAqB,MAAM;AAC1C,QAAO;EACN,SAAS;EACT,OAAO;GAAE,MAAM,OAAO;GAAM,SAAS,OAAO;GAAS,SAAS,OAAO;GAAS;EAC9E;;;;;;;AAQF,SAAS,oBACR,OACA,MACA,iBACe;AACf,SAAQ,MAAM,IAAI,KAAK,IAAI,MAAM;AACjC,QAAO;EACN,SAAS;EACT,OAAO;GA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AEtC,SAAO,oBAAoB,OAAO,6BAA6B,gCAAgC;;;AAQjG,eAAsB,uBACrB,IACA,MAOC;AACD,KAAI;AAEH,SAAO;GAAE,SAAS;GAAM,MADV,MAAM,IAAI,qBAAqB,GAAG,CAAC,cAAc,KAAK;GAC/B;UAC7B,OAAO;AACf,MAAI,iBAAiB,kBACpB,QAAO,wBAAwB,MAAM;AAEtC,SAAO,oBACN,OACA,0BACA,oCACA;;;AAQH,eAAsB,yBACrB,IACA,OACyD;AACzD,KAAI;EACH,MAAM,WAAW,IAAI,qBAAqB,GAAG;AAC7C,QAAM,SAAS,cAAc,MAAM;AAEnC,SAAO;GAAE,SAAS;GAAM,MAAM,EAAE,OADlB,MAAM,SAAS,YAAY,EACF;GAAE;UACjC,OAAO;AACf,MAAI,iBAAiB,kBACpB,QAAO,wBAAwB,MAAM;AAEtC,SAAO,oBACN,OACA,8BACA,kCACA"}
1
+ {"version":3,"file":"byline-fields-nBVqK_Ff.mjs","names":[],"sources":["../src/api/handlers/byline-fields.ts"],"sourcesContent":["/**\n * Handler layer for the byline-fields admin API (Phase 4 of Discussion\n * #1174).\n *\n * Each handler:\n * - Takes the `Kysely<Database>` from the route, returns `ApiResult<T>`.\n * - Wraps the registry call in try/catch.\n * - Translates `BylineSchemaError` → shared `ErrorCode` via\n * `mapBylineSchemaError`. HTTP status comes from `mapErrorStatus` at\n * the route's `unwrapResult` site — handlers don't know about\n * statuses.\n * - Catches everything else, logs server-side, returns a 500-class\n * code without leaking `error.message`.\n *\n * Reserved-slug + identifier validation runs at the zod layer (see\n * `schemas/byline-fields.ts`); the registry repeats it for defence in\n * depth (non-HTTP callers). This module assumes inputs have already\n * passed through whichever zod schema the route used.\n */\n\nimport type { Kysely } from \"kysely\";\n\nimport type { Database } from \"../../database/types.js\";\nimport {\n\tBylineSchemaError,\n\tBylineSchemaRegistry,\n\tmapBylineSchemaError,\n} from \"../../schema/byline-registry.js\";\nimport type {\n\tBylineFieldDefinition,\n\tCreateBylineFieldInput,\n\tUpdateBylineFieldInput,\n} from \"../../schema/types.js\";\nimport type { ApiResult } from \"../types.js\";\n\n/**\n * Build a structured failure envelope from a `BylineSchemaError`.\n * Centralised so every handler emits the same shape.\n */\nfunction bylineSchemaErrorResult<T>(error: BylineSchemaError): ApiResult<T> {\n\tconst mapped = mapBylineSchemaError(error);\n\treturn {\n\t\tsuccess: false,\n\t\terror: { code: mapped.code, message: mapped.message, details: mapped.details },\n\t};\n}\n\n/**\n * Build a 500-class failure envelope. Logs the underlying error\n * server-side; the message returned to the client is the static\n * fallback to avoid leaking internals.\n */\nfunction internalErrorResult<T>(\n\terror: unknown,\n\tcode: string,\n\tfallbackMessage: string,\n): ApiResult<T> {\n\tconsole.error(`[${code}]`, error);\n\treturn {\n\t\tsuccess: false,\n\t\terror: { code, message: fallbackMessage },\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// List\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldList(\n\tdb: Kysely<Database>,\n): Promise<ApiResult<{ items: BylineFieldDefinition[] }>> {\n\ttry {\n\t\tconst items = await new BylineSchemaRegistry(db).listFields();\n\t\treturn { success: true, data: { items } };\n\t} catch (error) {\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_LIST_ERROR\", \"Failed to list byline fields\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Create\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldCreate(\n\tdb: Kysely<Database>,\n\tinput: CreateBylineFieldInput,\n): Promise<ApiResult<BylineFieldDefinition>> {\n\ttry {\n\t\tconst field = await new BylineSchemaRegistry(db).createField(input);\n\t\treturn { success: true, data: field };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_CREATE_ERROR\", \"Failed to create byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Get one\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldGet(\n\tdb: Kysely<Database>,\n\tslug: string,\n): Promise<ApiResult<BylineFieldDefinition>> {\n\ttry {\n\t\tconst field = await new BylineSchemaRegistry(db).getField(slug);\n\t\tif (!field) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: \"NOT_FOUND\", message: \"Byline field not found\" },\n\t\t\t};\n\t\t}\n\t\treturn { success: true, data: field };\n\t} catch (error) {\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_GET_ERROR\", \"Failed to get byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Update\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldUpdate(\n\tdb: Kysely<Database>,\n\tslug: string,\n\tinput: UpdateBylineFieldInput,\n): Promise<ApiResult<BylineFieldDefinition>> {\n\ttry {\n\t\tconst field = await new BylineSchemaRegistry(db).updateField(slug, input);\n\t\treturn { success: true, data: field };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_UPDATE_ERROR\", \"Failed to update byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Delete\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldDelete(\n\tdb: Kysely<Database>,\n\tslug: string,\n): Promise<ApiResult<{ deleted: true }>> {\n\ttry {\n\t\tawait new BylineSchemaRegistry(db).deleteField(slug);\n\t\treturn { success: true, data: { deleted: true } };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(error, \"SCHEMA_FIELD_DELETE_ERROR\", \"Failed to delete byline field\");\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Usage\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldUsage(\n\tdb: Kysely<Database>,\n\tslug: string,\n): Promise<\n\tApiResult<{\n\t\ttranslatableValueCount: number;\n\t\tgroupValueCount: number;\n\t\ttotalAffectedRows: number;\n\t}>\n> {\n\ttry {\n\t\tconst usage = await new BylineSchemaRegistry(db).getFieldUsage(slug);\n\t\treturn { success: true, data: usage };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(\n\t\t\terror,\n\t\t\t\"SCHEMA_FIELD_GET_ERROR\",\n\t\t\t\"Failed to read byline field usage\",\n\t\t);\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Reorder\n// ---------------------------------------------------------------------------\n\nexport async function handleBylineFieldReorder(\n\tdb: Kysely<Database>,\n\tslugs: string[],\n): Promise<ApiResult<{ items: BylineFieldDefinition[] }>> {\n\ttry {\n\t\tconst registry = new BylineSchemaRegistry(db);\n\t\tawait registry.reorderFields(slugs);\n\t\tconst items = await registry.listFields();\n\t\treturn { success: true, data: { items } };\n\t} catch (error) {\n\t\tif (error instanceof BylineSchemaError) {\n\t\t\treturn bylineSchemaErrorResult(error);\n\t\t}\n\t\treturn internalErrorResult(\n\t\t\terror,\n\t\t\t\"SCHEMA_FIELD_REORDER_ERROR\",\n\t\t\t\"Failed to reorder byline fields\",\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAuCA,SAAS,wBAA2B,OAAwC;CAC3E,MAAM,SAAS,qBAAqB,MAAM;AAC1C,QAAO;EACN,SAAS;EACT,OAAO;GAAE,MAAM,OAAO;GAAM,SAAS,OAAO;GAAS,SAAS,OAAO;GAAS;EAC9E;;;;;;;AAQF,SAAS,oBACR,OACA,MACA,iBACe;AACf,SAAQ,MAAM,IAAI,KAAK,IAAI,MAAM;AACjC,QAAO;EACN,SAAS;EACT,OAAO;GAAE;GAAM,SAAS;GAAiB;EACzC;;AAOF,eAAsB,sBACrB,IACyD;AACzD,KAAI;AAEH,SAAO;GAAE,SAAS;GAAM,MAAM,EAAE,OADlB,MAAM,IAAI,qBAAqB,GAAG,CA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AAG,CAAC,cAAc,KAAK;GAC/B;UAC7B,OAAO;AACf,MAAI,iBAAiB,kBACpB,QAAO,wBAAwB,MAAM;AAEtC,SAAO,oBACN,OACA,0BACA,oCACA;;;AAQH,eAAsB,yBACrB,IACA,OACyD;AACzD,KAAI;EACH,MAAM,WAAW,IAAI,qBAAqB,GAAG;AAC7C,QAAM,SAAS,cAAc,MAAM;AAEnC,SAAO;GAAE,SAAS;GAAM,MAAM,EAAE,OADlB,MAAM,SAAS,YAAY,EACF;GAAE;UACjC,OAAO;AACf,MAAI,iBAAiB,kBACpB,QAAO,wBAAwB,MAAM;AAEtC,SAAO,oBACN,OACA,8BACA,kCACA"}
@@ -1,6 +1,6 @@
1
1
  import { t as validateIdentifier } from "./validate-VPnKoIzW.mjs";
2
2
  import { t as withTransaction } from "./transaction-x2tJQ-A1.mjs";
3
- import { i as RESERVED_BYLINE_FIELD_SLUGS, t as BYLINE_FIELD_TYPES } from "./types-DZk_y-MU.mjs";
3
+ import { i as RESERVED_BYLINE_FIELD_SLUGS, t as BYLINE_FIELD_TYPES } from "./types-BIduXPJk.mjs";
4
4
  import { sql } from "kysely";
5
5
  import { ulid } from "ulidx";
6
6
 
@@ -403,4 +403,4 @@ function mapFieldRow(row) {
403
403
 
404
404
  //#endregion
405
405
  export { BylineSchemaRegistry as n, mapBylineSchemaError as r, BylineSchemaError as t };
406
- //# sourceMappingURL=byline-registry-CWP7I71B.mjs.map
406
+ //# sourceMappingURL=byline-registry-DedidtqC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"byline-registry-CWP7I71B.mjs","names":[],"sources":["../src/schema/byline-registry.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\nimport { sql } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { withTransaction } from \"../database/transaction.js\";\nimport type { BylineFieldTable, Database } from \"../database/types.js\";\nimport { validateIdentifier } from \"../database/validate.js\";\nimport {\n\tBYLINE_FIELD_TYPES,\n\tRESERVED_BYLINE_FIELD_SLUGS,\n\ttype BylineFieldDefinition,\n\ttype BylineFieldType,\n\ttype BylineFieldValidation,\n\ttype CreateBylineFieldInput,\n\ttype UpdateBylineFieldInput,\n} from \"./types.js\";\n\nconst RESERVED_SET: ReadonlySet<string> = new Set(RESERVED_BYLINE_FIELD_SLUGS);\nconst TYPE_SET: ReadonlySet<string> = new Set(BYLINE_FIELD_TYPES);\n\nconst VERSION_KEY = \"byline_fields_version\";\n\n/** Hard cap on the choices array for a `select`-type field. */\nconst MAX_SELECT_OPTIONS = 200;\n/** Hard cap on a slug — mirrors `SchemaRegistry.validateSlug`. */\nconst MAX_SLUG_LENGTH = 63;\n/** Hard cap on a label. Bigger than slugs because labels are display strings. */\nconst MAX_LABEL_LENGTH = 200;\n\n/**\n * Error thrown for byline-schema validation failures. Mirrors\n * `SchemaError` in `registry.ts` so the admin API layer can map a small\n * set of codes to HTTP statuses without inspecting messages.\n *\n * Codes:\n * - `INVALID_SLUG` — slug fails identifier rules or length cap\n * - `RESERVED_SLUG` — slug collides with a fixed `_emdash_bylines` column\n * - `INVALID_TYPE` — type is not one of the five v1 field types\n * - `INVALID_LABEL` — label missing or exceeds length cap\n * - `INVALID_VALIDATION` — validation payload malformed (e.g. `select` with\n * no `options`, duplicates in `options`)\n * - `FIELD_EXISTS` — slug already registered\n * - `FIELD_NOT_FOUND` — slug not registered\n * - `TRANSLATABLE_LOCKED` — attempt to flip `translatable` while stored\n * values reference the field\n * - `REORDER_MISMATCH` — reorder input doesn't match the registered set\n */\nexport class BylineSchemaError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic code: string,\n\t\tpublic details?: Record<string, unknown>,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BylineSchemaError\";\n\t}\n}\n\n/**\n * Translate a `BylineSchemaError` code to a shared `ErrorCode` for the\n * admin API. HTTP status is then derived by `mapErrorStatus` — this\n * function deliberately doesn't carry one, so the API/handler boundary\n * matches the rest of the codebase (handlers return `ApiResult<T>` with\n * a code, the route layer maps to status via `unwrapResult`).\n *\n * Every code on the right-hand side of `case ... return ...` is defined\n * in `ErrorCode` (`api/errors.ts`). `INVALID_LABEL` and\n * `INVALID_VALIDATION` are intentionally folded into the `default`\n * branch (→ `VALIDATION_ERROR`) so no ad-hoc codes leak out — the\n * registry's domain code names them but the HTTP surface should not.\n *\n * `RESERVED_SLUG` / `INVALID_SLUG` typically don't reach this layer for\n * HTTP callers — the zod schema rejects them first with a clean\n * `VALIDATION_ERROR`. They're still listed so non-HTTP callers (and the\n * test layer) get consistent mapping.\n *\n * `FIELD_NOT_FOUND` is normalised to the shared `NOT_FOUND` code so the\n * admin client can branch on one constant across resource types.\n */\nexport function mapBylineSchemaError(error: BylineSchemaError): {\n\tcode: string;\n\tmessage: string;\n\tdetails?: Record<string, unknown>;\n} {\n\tswitch (error.code) {\n\t\tcase \"FIELD_NOT_FOUND\":\n\t\t\treturn { code: \"NOT_FOUND\", message: error.message, details: error.details };\n\t\tcase \"FIELD_EXISTS\":\n\t\tcase \"TRANSLATABLE_LOCKED\":\n\t\tcase \"REORDER_MISMATCH\":\n\t\tcase \"INVALID_SLUG\":\n\t\tcase \"RESERVED_SLUG\":\n\t\tcase \"INVALID_TYPE\":\n\t\t\treturn { code: error.code, message: error.message, details: error.details };\n\t\tdefault:\n\t\t\t// Catches INVALID_LABEL, INVALID_VALIDATION, and any future\n\t\t\t// registry codes we forget to wire up explicitly.\n\t\t\treturn { code: \"VALIDATION_ERROR\", message: error.message, details: error.details };\n\t}\n}\n\n/**\n * Registry for byline custom fields (Discussion #1174).\n *\n * Owns CRUD over `_emdash_byline_fields` and the\n * `options.byline_fields_version` counter that drives cache\n * invalidation in `bylines/field-defs-cache.ts`.\n *\n * **Dirty-bit bookend.** Every mutation runs `markVersionDirty` before\n * the schema write and `markVersionClean` after, as standalone writes\n * (not inside `withTransaction`) so concurrent isolates observe the\n * dirty mark *before* the mutation lands. Parity carries meaning:\n * odd = mutation in flight or crashed mid-flight, even = stable.\n * The cache bypasses the global holder while odd.\n *\n * `markVersionDirty` is parity-aware (idempotent on odd) so a\n * crashed prior attempt doesn't invert the bit.\n * `markVersionClean` always advances to a new even value (+2 from\n * even, +1 from odd) so concurrent mutators can't collapse on the\n * same key and pin a stale cache snapshot. Idempotent-retry exits\n * (`FIELD_EXISTS` / `FIELD_NOT_FOUND` / no-op update) call\n * `markVersionClean` too — same code path doubles as crash recovery\n * and false-clean recovery.\n *\n * The residual race: a reader caching between two concurrent\n * `markVersionClean` calls sees a partial-set snapshot until the\n * second clean lands. Bounded by the inter-clean window (~ms).\n * Schema mutations are admin-only and rare; acceptable for now.\n * A CAS-on-bump or dialect-specific lock is tracked as follow-up.\n *\n * **`deleteField` cascade.** Migration 041 already declares\n * `ON DELETE CASCADE` on both value tables. The explicit deletes\n * here are defense-in-depth against FK-pragma misconfig and mirror\n * `BylineRepository.delete`'s app-level cascade for the bylines\n * domain.\n *\n * Reserved-slug rejection runs at the API layer (zod) *and* here so\n * non-HTTP callers (seeds, scripts) can't bypass the check.\n */\nexport class BylineSchemaRegistry {\n\tconstructor(private db: Kysely<Database>) {}\n\n\tasync listFields(): Promise<BylineFieldDefinition[]> {\n\t\tconst rows = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.selectAll()\n\t\t\t.orderBy(\"sort_order\", \"asc\")\n\t\t\t.orderBy(\"created_at\", \"asc\")\n\t\t\t.execute();\n\t\treturn rows.map((row) => mapFieldRow(row));\n\t}\n\n\tasync getField(slug: string): Promise<BylineFieldDefinition | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.selectAll()\n\t\t\t.where(\"slug\", \"=\", slug)\n\t\t\t.executeTakeFirst();\n\t\treturn row ? mapFieldRow(row) : null;\n\t}\n\n\tasync getFieldById(id: string): Promise<BylineFieldDefinition | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.selectAll()\n\t\t\t.where(\"id\", \"=\", id)\n\t\t\t.executeTakeFirst();\n\t\treturn row ? mapFieldRow(row) : null;\n\t}\n\n\tasync createField(input: CreateBylineFieldInput): Promise<BylineFieldDefinition> {\n\t\tthis.validateSlug(input.slug);\n\t\tthis.validateLabel(input.label);\n\t\tthis.validateType(input.type);\n\t\tconst validation = this.normaliseValidation(input.type, input.validation ?? null);\n\n\t\tconst existing = await this.getField(input.slug);\n\t\tif (existing) {\n\t\t\t// Idempotent retry exit — see class JSDoc.\n\t\t\tawait this.markVersionClean();\n\t\t\tthrow new BylineSchemaError(`Byline field \"${input.slug}\" already exists`, \"FIELD_EXISTS\", {\n\t\t\t\tslug: input.slug,\n\t\t\t});\n\t\t}\n\n\t\tconst id = ulid();\n\t\tconst sortOrder = input.sortOrder ?? (await this.nextSortOrder());\n\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tawait trx\n\t\t\t\t.insertInto(\"_emdash_byline_fields\")\n\t\t\t\t.values({\n\t\t\t\t\tid,\n\t\t\t\t\tslug: input.slug,\n\t\t\t\t\tlabel: input.label,\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\trequired: input.required ? 1 : 0,\n\t\t\t\t\ttranslatable: input.translatable === false ? 0 : 1,\n\t\t\t\t\tvalidation: validation ? JSON.stringify(validation) : null,\n\t\t\t\t\tsort_order: sortOrder,\n\t\t\t\t})\n\t\t\t\t.execute();\n\t\t});\n\t\tawait this.markVersionClean();\n\n\t\tconst created = await this.getFieldById(id);\n\t\tif (!created) {\n\t\t\t// Should be unreachable on a working DB — but a typed error\n\t\t\t// beats letting the route returning null on a successful path.\n\t\t\tthrow new BylineSchemaError(\"Failed to load created field\", \"FIELD_NOT_FOUND\", {\n\t\t\t\tid,\n\t\t\t});\n\t\t}\n\t\treturn created;\n\t}\n\n\tasync updateField(slug: string, input: UpdateBylineFieldInput): Promise<BylineFieldDefinition> {\n\t\tconst field = await this.getField(slug);\n\t\tif (!field) {\n\t\t\t// Idempotent retry exit — see class JSDoc.\n\t\t\tawait this.markVersionClean();\n\t\t\tthrow new BylineSchemaError(`Byline field \"${slug}\" not found`, \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\n\t\tconst updates: Partial<{\n\t\t\tlabel: string;\n\t\t\trequired: number;\n\t\t\ttranslatable: number;\n\t\t\tvalidation: string | null;\n\t\t\tsort_order: number;\n\t\t\tupdated_at: string;\n\t\t}> = {};\n\n\t\tif (input.label !== undefined) {\n\t\t\tthis.validateLabel(input.label);\n\t\t\tupdates.label = input.label;\n\t\t}\n\n\t\tif (input.required !== undefined) {\n\t\t\tupdates.required = input.required ? 1 : 0;\n\t\t}\n\n\t\tif (input.validation !== undefined) {\n\t\t\t// Validation payload is normalised against the *current* field\n\t\t\t// type — `type` is not updatable, so it's safe to use `field.type`.\n\t\t\tconst validation = this.normaliseValidation(field.type, input.validation);\n\t\t\tupdates.validation = validation ? JSON.stringify(validation) : null;\n\t\t}\n\n\t\tif (input.translatable !== undefined && input.translatable !== field.translatable) {\n\t\t\t// Flipping `translatable` would orphan any values already stored\n\t\t\t// in the table matching the *current* flag. Reject when any\n\t\t\t// value rows reference this field — admins can delete the field\n\t\t\t// (cascading the values) and re-create it with the new flag if\n\t\t\t// they want a clean re-start. Migrating values across tables is\n\t\t\t// out of scope (Discussion #1174 doesn't authorise it).\n\t\t\tconst usage = await this.countFieldValues(field.id);\n\t\t\tif (usage > 0) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t`Cannot change \"translatable\" on field \"${slug}\" while ${usage} value row(s) exist. ` +\n\t\t\t\t\t\t`Delete the values (or the field) and re-create with the new setting.`,\n\t\t\t\t\t\"TRANSLATABLE_LOCKED\",\n\t\t\t\t\t{ slug, valueCount: usage },\n\t\t\t\t);\n\t\t\t}\n\t\t\tupdates.translatable = input.translatable ? 1 : 0;\n\t\t}\n\n\t\tif (input.sortOrder !== undefined) {\n\t\t\tupdates.sort_order = input.sortOrder;\n\t\t}\n\n\t\tif (Object.keys(updates).length === 0) {\n\t\t\t// No-op update — still advance the clean marker in case\n\t\t\t// we're recovering a crashed prior attempt.\n\t\t\tawait this.markVersionClean();\n\t\t\treturn field;\n\t\t}\n\n\t\tupdates.updated_at = new Date().toISOString();\n\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tawait trx\n\t\t\t\t.updateTable(\"_emdash_byline_fields\")\n\t\t\t\t.set(updates)\n\t\t\t\t.where(\"id\", \"=\", field.id)\n\t\t\t\t.execute();\n\t\t});\n\t\tawait this.markVersionClean();\n\n\t\tconst updated = await this.getFieldById(field.id);\n\t\tif (!updated) {\n\t\t\tthrow new BylineSchemaError(\"Failed to load updated field\", \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\t\treturn updated;\n\t}\n\n\tasync deleteField(slug: string): Promise<void> {\n\t\tconst field = await this.getField(slug);\n\t\tif (!field) {\n\t\t\t// Idempotent retry exit — see class JSDoc.\n\t\t\tawait this.markVersionClean();\n\t\t\tthrow new BylineSchemaError(`Byline field \"${slug}\" not found`, \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\n\t\t// Delete order matters on D1 (no tx): value rows first, definition\n\t\t// row last, so a crash leaves the definition recoverable on retry\n\t\t// rather than orphan values pointing at a vanished id.\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tawait trx\n\t\t\t\t.deleteFrom(\"_emdash_byline_field_values\")\n\t\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t\t.execute();\n\t\t\tawait trx\n\t\t\t\t.deleteFrom(\"_emdash_byline_field_group_values\")\n\t\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t\t.execute();\n\t\t\tawait trx.deleteFrom(\"_emdash_byline_fields\").where(\"id\", \"=\", field.id).execute();\n\t\t});\n\t\tawait this.markVersionClean();\n\t}\n\n\t/**\n\t * Reorder fields by slug. The input must be the *exact* set of\n\t * currently registered slugs — no adds, no drops, no duplicates. This\n\t * keeps the operation invertible (any reorder is followed by a reverse\n\t * reorder) and removes a class of \"did I forget a field?\" bugs at the\n\t * API layer.\n\t */\n\tasync reorderFields(slugs: string[]): Promise<void> {\n\t\tif (new Set(slugs).size !== slugs.length) {\n\t\t\tthrow new BylineSchemaError(\"Reorder input contains duplicate slugs\", \"REORDER_MISMATCH\", {\n\t\t\t\tslugs,\n\t\t\t});\n\t\t}\n\n\t\tconst registered = await this.listFields();\n\t\tconst registeredSlugs = registered.map((f) => f.slug).toSorted();\n\t\tconst inputSlugs = slugs.toSorted();\n\n\t\tif (registeredSlugs.length !== inputSlugs.length) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Reorder input has ${inputSlugs.length} slug(s); ${registeredSlugs.length} registered`,\n\t\t\t\t\"REORDER_MISMATCH\",\n\t\t\t\t{ registered: registeredSlugs, input: inputSlugs },\n\t\t\t);\n\t\t}\n\t\tfor (let i = 0; i < registeredSlugs.length; i++) {\n\t\t\tif (registeredSlugs[i] !== inputSlugs[i]) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t\"Reorder input does not match the registered field set\",\n\t\t\t\t\t\"REORDER_MISMATCH\",\n\t\t\t\t\t{ registered: registeredSlugs, input: inputSlugs },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst now = new Date().toISOString();\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tfor (let i = 0; i < slugs.length; i++) {\n\t\t\t\tconst slug = slugs[i];\n\t\t\t\tif (slug === undefined) continue;\n\t\t\t\tawait trx\n\t\t\t\t\t.updateTable(\"_emdash_byline_fields\")\n\t\t\t\t\t.set({ sort_order: i, updated_at: now })\n\t\t\t\t\t.where(\"slug\", \"=\", slug)\n\t\t\t\t\t.execute();\n\t\t\t}\n\t\t});\n\t\tawait this.markVersionClean();\n\t}\n\n\t/**\n\t * Per-table usage counts for a field, plus the sum. Backs the\n\t * destructive-delete confirm dialog in the admin UI (Phase 5).\n\t *\n\t * Both counts are surfaced separately for diagnostic value: a\n\t * non-zero count on the table that doesn't match the field's current\n\t * `translatable` flag indicates historical drift (e.g. a flip from\n\t * an older code path). Today the registry rejects such flips with\n\t * `TRANSLATABLE_LOCKED`, so any drift originates pre-Phase-2.\n\t *\n\t * Throws `FIELD_NOT_FOUND` when the slug doesn't resolve — callers\n\t * shouldn't get back zero counts for a missing field.\n\t */\n\tasync getFieldUsage(slug: string): Promise<{\n\t\ttranslatableValueCount: number;\n\t\tgroupValueCount: number;\n\t\ttotalAffectedRows: number;\n\t}> {\n\t\tconst field = await this.getField(slug);\n\t\tif (!field) {\n\t\t\tthrow new BylineSchemaError(`Byline field \"${slug}\" not found`, \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\t\tconst tr = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t.executeTakeFirst();\n\t\tconst grp = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_group_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t.executeTakeFirst();\n\t\tconst translatableValueCount = Number(tr?.count ?? 0);\n\t\tconst groupValueCount = Number(grp?.count ?? 0);\n\t\treturn {\n\t\t\ttranslatableValueCount,\n\t\t\tgroupValueCount,\n\t\t\ttotalAffectedRows: translatableValueCount + groupValueCount,\n\t\t};\n\t}\n\n\t/**\n\t * Read the persisted version counter. Used by the field-defs cache\n\t * (Phase 3) to detect invalidation. Returns `0` when the row is\n\t * missing — covers the \"tests that didn't run migration 041\" case\n\t * without throwing.\n\t */\n\tasync getVersion(): Promise<number> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"options\")\n\t\t\t.select(\"value\")\n\t\t\t.where(\"name\", \"=\", VERSION_KEY)\n\t\t\t.executeTakeFirst();\n\t\tif (!row) return 0;\n\t\tconst parsed = Number.parseInt(row.value, 10);\n\t\treturn Number.isFinite(parsed) ? parsed : 0;\n\t}\n\n\t// ============================================\n\t// Private helpers\n\t// ============================================\n\n\t/**\n\t * Force the version counter to an odd integer (\"dirty\"). Idempotent\n\t * on odd so a crashed prior attempt can't invert parity. Upsert (not\n\t * UPDATE) so a missing row still flips parity — `getVersion` returns\n\t * 0 on missing, which is even, so a bare UPDATE would leave the\n\t * cache pinned on a stale snapshot. See the class JSDoc.\n\t *\n\t * `options.value` qualified: PG's `ON CONFLICT DO UPDATE` puts both\n\t * the target and `EXCLUDED.value` in scope; bare `value` is ambiguous.\n\t */\n\tprivate async markVersionDirty(): Promise<void> {\n\t\tawait sql`\n\t\t\tINSERT INTO options (name, value)\n\t\t\tVALUES (${VERSION_KEY}, '1')\n\t\t\tON CONFLICT(name) DO UPDATE SET value = CASE\n\t\t\t\tWHEN CAST(options.value AS INTEGER) % 2 = 0\n\t\t\t\t\tTHEN CAST(CAST(options.value AS INTEGER) + 1 AS TEXT)\n\t\t\t\tELSE options.value\n\t\t\tEND\n\t\t`.execute(this.db);\n\t}\n\n\t/**\n\t * Force the version counter to a **new** even integer (+2 from even,\n\t * +1 from odd). Always-advance — never a no-op — so two concurrent\n\t * mutators can't collapse on the same even key and pin a stale cache\n\t * snapshot. See the class JSDoc for the concurrent-collapse rationale.\n\t *\n\t * `options.value` qualified — see `markVersionDirty`.\n\t */\n\tprivate async markVersionClean(): Promise<void> {\n\t\tawait sql`\n\t\t\tINSERT INTO options (name, value)\n\t\t\tVALUES (${VERSION_KEY}, '2')\n\t\t\tON CONFLICT(name) DO UPDATE SET value = CASE\n\t\t\t\tWHEN CAST(options.value AS INTEGER) % 2 = 0\n\t\t\t\t\tTHEN CAST(CAST(options.value AS INTEGER) + 2 AS TEXT)\n\t\t\t\tELSE CAST(CAST(options.value AS INTEGER) + 1 AS TEXT)\n\t\t\tEND\n\t\t`.execute(this.db);\n\t}\n\n\tprivate async nextSortOrder(): Promise<number> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.select(({ fn }) => [fn.max<number | null>(\"sort_order\").as(\"max\")])\n\t\t\t.executeTakeFirst();\n\t\tconst max = row?.max ?? null;\n\t\treturn max === null ? 0 : max + 1;\n\t}\n\n\tprivate async countFieldValues(fieldId: string): Promise<number> {\n\t\t// Count both per-locale and group-shared values. A field can only\n\t\t// store in one table at a time (translatable picks), but historic\n\t\t// rows might exist in the other if a prior version of this code\n\t\t// allowed the flip — count both to be safe.\n\t\tconst tr = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", fieldId)\n\t\t\t.executeTakeFirst();\n\t\tconst grp = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_group_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", fieldId)\n\t\t\t.executeTakeFirst();\n\t\treturn Number(tr?.count ?? 0) + Number(grp?.count ?? 0);\n\t}\n\n\tprivate validateSlug(slug: string): void {\n\t\tif (!slug || typeof slug !== \"string\") {\n\t\t\tthrow new BylineSchemaError(\"Byline field slug is required\", \"INVALID_SLUG\", { slug });\n\t\t}\n\t\tif (slug.length > MAX_SLUG_LENGTH) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Byline field slug must be ${MAX_SLUG_LENGTH} characters or less`,\n\t\t\t\t\"INVALID_SLUG\",\n\t\t\t\t{ slug },\n\t\t\t);\n\t\t}\n\t\t// `validateIdentifier` enforces /^[a-z][a-z0-9_]*$/ — rejects\n\t\t// camelCase, PascalCase, hyphens, leading digits, and identifiers\n\t\t// over 128 characters. We hit the 63-char cap above first, which\n\t\t// matches the content-collection slug cap.\n\t\ttry {\n\t\t\tvalidateIdentifier(slug, \"byline field slug\");\n\t\t} catch (error) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\terror instanceof Error ? error.message : \"Invalid byline field slug\",\n\t\t\t\t\"INVALID_SLUG\",\n\t\t\t\t{ slug },\n\t\t\t);\n\t\t}\n\t\tif (RESERVED_SET.has(slug)) {\n\t\t\tthrow new BylineSchemaError(`Byline field slug \"${slug}\" is reserved`, \"RESERVED_SLUG\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate validateLabel(label: string): void {\n\t\tif (!label || typeof label !== \"string\") {\n\t\t\tthrow new BylineSchemaError(\"Byline field label is required\", \"INVALID_LABEL\", {\n\t\t\t\tlabel,\n\t\t\t});\n\t\t}\n\t\tif (label.length > MAX_LABEL_LENGTH) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Byline field label must be ${MAX_LABEL_LENGTH} characters or less`,\n\t\t\t\t\"INVALID_LABEL\",\n\t\t\t\t{ length: label.length },\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate validateType(type: BylineFieldType): void {\n\t\tif (!TYPE_SET.has(type)) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Byline field type \"${type}\" is not supported. Valid types: ${[...TYPE_SET].join(\", \")}`,\n\t\t\t\t\"INVALID_TYPE\",\n\t\t\t\t{ type },\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Normalise + validate a validation payload for a given field type.\n\t *\n\t * - `select`: `options` is required, must be a non-empty array of unique\n\t * non-empty strings, capped at `MAX_SELECT_OPTIONS`.\n\t * - any other type: `options` is silently dropped if present (a future\n\t * field type might use it, but v1 doesn't).\n\t *\n\t * Returns `null` when the resulting validation object is empty, so the\n\t * storage column stays NULL rather than carrying `'{}'`.\n\t */\n\tprivate normaliseValidation(\n\t\ttype: BylineFieldType,\n\t\tvalidation: BylineFieldValidation | null,\n\t): BylineFieldValidation | null {\n\t\tif (type === \"select\") {\n\t\t\tconst options = validation?.options;\n\t\t\tif (!Array.isArray(options) || options.length === 0) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t`Byline field of type \"select\" requires non-empty \"validation.options\"`,\n\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t{ type },\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (options.length > MAX_SELECT_OPTIONS) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t`Byline field \"select\" cannot have more than ${MAX_SELECT_OPTIONS} options`,\n\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t{ count: options.length },\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst seen = new Set<string>();\n\t\t\tfor (const option of options) {\n\t\t\t\tif (typeof option !== \"string\" || option.length === 0) {\n\t\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t\t`Byline field \"select\" options must be non-empty strings`,\n\t\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t\t{ option },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (seen.has(option)) {\n\t\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t\t`Byline field \"select\" options must be unique`,\n\t\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t\t{ option },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tseen.add(option);\n\t\t\t}\n\t\t\treturn { options };\n\t\t}\n\n\t\tif (validation == null) return null;\n\t\t// Non-select: drop `options` if present. Strip nothing else — future\n\t\t// field types might extend the shape and we don't want to lose\n\t\t// payload silently. Today's `BylineFieldValidation` is `{ options? }`\n\t\t// only, so this branch is a pass-through; left explicit for clarity.\n\t\tconst { options: _drop, ...rest } = validation;\n\t\treturn Object.keys(rest).length === 0 ? null : (rest as BylineFieldValidation);\n\t}\n}\n\nfunction mapFieldRow(row: {\n\tid: string;\n\tslug: string;\n\tlabel: string;\n\ttype: string;\n\trequired: number;\n\ttranslatable: number;\n\tvalidation: string | null;\n\tsort_order: number;\n\tcreated_at: string;\n\tupdated_at: string;\n}): BylineFieldDefinition {\n\treturn {\n\t\tid: row.id,\n\t\tslug: row.slug,\n\t\tlabel: row.label,\n\t\t// `type` is stored as TEXT but `createField` rejects anything outside\n\t\t// `BYLINE_FIELD_TYPES` before inserting. The assertion narrows on\n\t\t// that write-time guarantee.\n\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- validated at write\n\t\ttype: row.type as BylineFieldType,\n\t\trequired: row.required === 1,\n\t\ttranslatable: row.translatable === 1,\n\t\t// `validation` is JSON-encoded `BylineFieldValidation | null`, written\n\t\t// only through `normaliseValidation`. The cast matches the\n\t\t// `JSON.parse(...) as T` pattern in `OptionsRepository`.\n\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- validated at write\n\t\tvalidation: row.validation ? (JSON.parse(row.validation) as BylineFieldValidation) : null,\n\t\tsortOrder: row.sort_order,\n\t\tcreatedAt: row.created_at,\n\t\tupdatedAt: row.updated_at,\n\t};\n}\n\n// Re-export the table type for callers that want to spell it explicitly.\n// Most callers should rely on the Database interface; this is convenience\n// for tests that hand-roll Kysely queries.\nexport type { BylineFieldTable };\n"],"mappings":";;;;;;;AAiBA,MAAM,eAAoC,IAAI,IAAI,4BAA4B;AAC9E,MAAM,WAAgC,IAAI,IAAI,mBAAmB;AAEjE,MAAM,cAAc;;AAGpB,MAAM,qBAAqB;;AAE3B,MAAM,kBAAkB;;AAExB,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;AAoBzB,IAAa,oBAAb,cAAuC,MAAM;CAC5C,YACC,SACA,AAAO,MACP,AAAO,SACN;AACD,QAAM,QAAQ;EAHP;EACA;AAGP,OAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;AAyBd,SAAgB,qBAAqB,OAInC;AACD,SAAQ,MAAM,MAAd;EACC,KAAK,kBACJ,QAAO;GAAE,MAAM;GAAa,SAAS,MAAM;GAAS,SAAS,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,MAAM,QAAQ,QAAQ,IAAI,QAAQ,WAAW,EACjD,OAAM,IAAI,kBACT,yEACA,sBACA,EAAE,MAAM,CACR;AAEF,OAAI,QAAQ,SAAS,mBACpB,OAAM,IAAI,kBACT,+CAA+C,mBAAmB,WAClE,sBACA,EAAE,OAAO,QAAQ,QAAQ,CACzB;GAEF,MAAM,uBAAO,IAAI,KAAa;AAC9B,QAAK,MAAM,UAAU,SAAS;AAC7B,QAAI,OAAO,WAAW,YAAY,OAAO,WAAW,EACnD,OAAM,IAAI,kBACT,2DACA,sBACA,EAAE,QAAQ,CACV;AAEF,QAAI,KAAK,IAAI,OAAO,CACnB,OAAM,IAAI,kBACT,gDACA,sBACA,EAAE,QAAQ,CACV;AAEF,SAAK,IAAI,OAAO;;AAEjB,UAAO,EAAE,SAAS;;AAGnB,MAAI,cAAc,KAAM,QAAO;EAK/B,MAAM,EAAE,SAAS,OAAO,GAAG,SAAS;AACpC,SAAO,OAAO,KAAK,KAAK,CAAC,WAAW,IAAI,OAAQ;;;AAIlD,SAAS,YAAY,KAWK;AACzB,QAAO;EACN,IAAI,IAAI;EACR,MAAM,IAAI;EACV,OAAO,IAAI;EAKX,MAAM,IAAI;EACV,UAAU,IAAI,aAAa;EAC3B,cAAc,IAAI,iBAAiB;EAKnC,YAAY,IAAI,aAAc,KAAK,MAAM,IAAI,WAAW,GAA6B;EACrF,WAAW,IAAI;EACf,WAAW,IAAI;EACf,WAAW,IAAI;EACf"}
1
+ {"version":3,"file":"byline-registry-DedidtqC.mjs","names":[],"sources":["../src/schema/byline-registry.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\nimport { sql } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { withTransaction } from \"../database/transaction.js\";\nimport type { BylineFieldTable, Database } from \"../database/types.js\";\nimport { validateIdentifier } from \"../database/validate.js\";\nimport {\n\tBYLINE_FIELD_TYPES,\n\tRESERVED_BYLINE_FIELD_SLUGS,\n\ttype BylineFieldDefinition,\n\ttype BylineFieldType,\n\ttype BylineFieldValidation,\n\ttype CreateBylineFieldInput,\n\ttype UpdateBylineFieldInput,\n} from \"./types.js\";\n\nconst RESERVED_SET: ReadonlySet<string> = new Set(RESERVED_BYLINE_FIELD_SLUGS);\nconst TYPE_SET: ReadonlySet<string> = new Set(BYLINE_FIELD_TYPES);\n\nconst VERSION_KEY = \"byline_fields_version\";\n\n/** Hard cap on the choices array for a `select`-type field. */\nconst MAX_SELECT_OPTIONS = 200;\n/** Hard cap on a slug — mirrors `SchemaRegistry.validateSlug`. */\nconst MAX_SLUG_LENGTH = 63;\n/** Hard cap on a label. Bigger than slugs because labels are display strings. */\nconst MAX_LABEL_LENGTH = 200;\n\n/**\n * Error thrown for byline-schema validation failures. Mirrors\n * `SchemaError` in `registry.ts` so the admin API layer can map a small\n * set of codes to HTTP statuses without inspecting messages.\n *\n * Codes:\n * - `INVALID_SLUG` — slug fails identifier rules or length cap\n * - `RESERVED_SLUG` — slug collides with a fixed `_emdash_bylines` column\n * - `INVALID_TYPE` — type is not one of the five v1 field types\n * - `INVALID_LABEL` — label missing or exceeds length cap\n * - `INVALID_VALIDATION` — validation payload malformed (e.g. `select` with\n * no `options`, duplicates in `options`)\n * - `FIELD_EXISTS` — slug already registered\n * - `FIELD_NOT_FOUND` — slug not registered\n * - `TRANSLATABLE_LOCKED` — attempt to flip `translatable` while stored\n * values reference the field\n * - `REORDER_MISMATCH` — reorder input doesn't match the registered set\n */\nexport class BylineSchemaError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic code: string,\n\t\tpublic details?: Record<string, unknown>,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"BylineSchemaError\";\n\t}\n}\n\n/**\n * Translate a `BylineSchemaError` code to a shared `ErrorCode` for the\n * admin API. HTTP status is then derived by `mapErrorStatus` — this\n * function deliberately doesn't carry one, so the API/handler boundary\n * matches the rest of the codebase (handlers return `ApiResult<T>` with\n * a code, the route layer maps to status via `unwrapResult`).\n *\n * Every code on the right-hand side of `case ... return ...` is defined\n * in `ErrorCode` (`api/errors.ts`). `INVALID_LABEL` and\n * `INVALID_VALIDATION` are intentionally folded into the `default`\n * branch (→ `VALIDATION_ERROR`) so no ad-hoc codes leak out — the\n * registry's domain code names them but the HTTP surface should not.\n *\n * `RESERVED_SLUG` / `INVALID_SLUG` typically don't reach this layer for\n * HTTP callers — the zod schema rejects them first with a clean\n * `VALIDATION_ERROR`. They're still listed so non-HTTP callers (and the\n * test layer) get consistent mapping.\n *\n * `FIELD_NOT_FOUND` is normalised to the shared `NOT_FOUND` code so the\n * admin client can branch on one constant across resource types.\n */\nexport function mapBylineSchemaError(error: BylineSchemaError): {\n\tcode: string;\n\tmessage: string;\n\tdetails?: Record<string, unknown>;\n} {\n\tswitch (error.code) {\n\t\tcase \"FIELD_NOT_FOUND\":\n\t\t\treturn { code: \"NOT_FOUND\", message: error.message, details: error.details };\n\t\tcase \"FIELD_EXISTS\":\n\t\tcase \"TRANSLATABLE_LOCKED\":\n\t\tcase \"REORDER_MISMATCH\":\n\t\tcase \"INVALID_SLUG\":\n\t\tcase \"RESERVED_SLUG\":\n\t\tcase \"INVALID_TYPE\":\n\t\t\treturn { code: error.code, message: error.message, details: error.details };\n\t\tdefault:\n\t\t\t// Catches INVALID_LABEL, INVALID_VALIDATION, and any future\n\t\t\t// registry codes we forget to wire up explicitly.\n\t\t\treturn { code: \"VALIDATION_ERROR\", message: error.message, details: error.details };\n\t}\n}\n\n/**\n * Registry for byline custom fields (Discussion #1174).\n *\n * Owns CRUD over `_emdash_byline_fields` and the\n * `options.byline_fields_version` counter that drives cache\n * invalidation in `bylines/field-defs-cache.ts`.\n *\n * **Dirty-bit bookend.** Every mutation runs `markVersionDirty` before\n * the schema write and `markVersionClean` after, as standalone writes\n * (not inside `withTransaction`) so concurrent isolates observe the\n * dirty mark *before* the mutation lands. Parity carries meaning:\n * odd = mutation in flight or crashed mid-flight, even = stable.\n * The cache bypasses the global holder while odd.\n *\n * `markVersionDirty` is parity-aware (idempotent on odd) so a\n * crashed prior attempt doesn't invert the bit.\n * `markVersionClean` always advances to a new even value (+2 from\n * even, +1 from odd) so concurrent mutators can't collapse on the\n * same key and pin a stale cache snapshot. Idempotent-retry exits\n * (`FIELD_EXISTS` / `FIELD_NOT_FOUND` / no-op update) call\n * `markVersionClean` too — same code path doubles as crash recovery\n * and false-clean recovery.\n *\n * The residual race: a reader caching between two concurrent\n * `markVersionClean` calls sees a partial-set snapshot until the\n * second clean lands. Bounded by the inter-clean window (~ms).\n * Schema mutations are admin-only and rare; acceptable for now.\n * A CAS-on-bump or dialect-specific lock is tracked as follow-up.\n *\n * **`deleteField` cascade.** Migration 041 already declares\n * `ON DELETE CASCADE` on both value tables. The explicit deletes\n * here are defense-in-depth against FK-pragma misconfig and mirror\n * `BylineRepository.delete`'s app-level cascade for the bylines\n * domain.\n *\n * Reserved-slug rejection runs at the API layer (zod) *and* here so\n * non-HTTP callers (seeds, scripts) can't bypass the check.\n */\nexport class BylineSchemaRegistry {\n\tconstructor(private db: Kysely<Database>) {}\n\n\tasync listFields(): Promise<BylineFieldDefinition[]> {\n\t\tconst rows = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.selectAll()\n\t\t\t.orderBy(\"sort_order\", \"asc\")\n\t\t\t.orderBy(\"created_at\", \"asc\")\n\t\t\t.execute();\n\t\treturn rows.map((row) => mapFieldRow(row));\n\t}\n\n\tasync getField(slug: string): Promise<BylineFieldDefinition | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.selectAll()\n\t\t\t.where(\"slug\", \"=\", slug)\n\t\t\t.executeTakeFirst();\n\t\treturn row ? mapFieldRow(row) : null;\n\t}\n\n\tasync getFieldById(id: string): Promise<BylineFieldDefinition | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.selectAll()\n\t\t\t.where(\"id\", \"=\", id)\n\t\t\t.executeTakeFirst();\n\t\treturn row ? mapFieldRow(row) : null;\n\t}\n\n\tasync createField(input: CreateBylineFieldInput): Promise<BylineFieldDefinition> {\n\t\tthis.validateSlug(input.slug);\n\t\tthis.validateLabel(input.label);\n\t\tthis.validateType(input.type);\n\t\tconst validation = this.normaliseValidation(input.type, input.validation ?? null);\n\n\t\tconst existing = await this.getField(input.slug);\n\t\tif (existing) {\n\t\t\t// Idempotent retry exit — see class JSDoc.\n\t\t\tawait this.markVersionClean();\n\t\t\tthrow new BylineSchemaError(`Byline field \"${input.slug}\" already exists`, \"FIELD_EXISTS\", {\n\t\t\t\tslug: input.slug,\n\t\t\t});\n\t\t}\n\n\t\tconst id = ulid();\n\t\tconst sortOrder = input.sortOrder ?? (await this.nextSortOrder());\n\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tawait trx\n\t\t\t\t.insertInto(\"_emdash_byline_fields\")\n\t\t\t\t.values({\n\t\t\t\t\tid,\n\t\t\t\t\tslug: input.slug,\n\t\t\t\t\tlabel: input.label,\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\trequired: input.required ? 1 : 0,\n\t\t\t\t\ttranslatable: input.translatable === false ? 0 : 1,\n\t\t\t\t\tvalidation: validation ? JSON.stringify(validation) : null,\n\t\t\t\t\tsort_order: sortOrder,\n\t\t\t\t})\n\t\t\t\t.execute();\n\t\t});\n\t\tawait this.markVersionClean();\n\n\t\tconst created = await this.getFieldById(id);\n\t\tif (!created) {\n\t\t\t// Should be unreachable on a working DB — but a typed error\n\t\t\t// beats letting the route returning null on a successful path.\n\t\t\tthrow new BylineSchemaError(\"Failed to load created field\", \"FIELD_NOT_FOUND\", {\n\t\t\t\tid,\n\t\t\t});\n\t\t}\n\t\treturn created;\n\t}\n\n\tasync updateField(slug: string, input: UpdateBylineFieldInput): Promise<BylineFieldDefinition> {\n\t\tconst field = await this.getField(slug);\n\t\tif (!field) {\n\t\t\t// Idempotent retry exit — see class JSDoc.\n\t\t\tawait this.markVersionClean();\n\t\t\tthrow new BylineSchemaError(`Byline field \"${slug}\" not found`, \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\n\t\tconst updates: Partial<{\n\t\t\tlabel: string;\n\t\t\trequired: number;\n\t\t\ttranslatable: number;\n\t\t\tvalidation: string | null;\n\t\t\tsort_order: number;\n\t\t\tupdated_at: string;\n\t\t}> = {};\n\n\t\tif (input.label !== undefined) {\n\t\t\tthis.validateLabel(input.label);\n\t\t\tupdates.label = input.label;\n\t\t}\n\n\t\tif (input.required !== undefined) {\n\t\t\tupdates.required = input.required ? 1 : 0;\n\t\t}\n\n\t\tif (input.validation !== undefined) {\n\t\t\t// Validation payload is normalised against the *current* field\n\t\t\t// type — `type` is not updatable, so it's safe to use `field.type`.\n\t\t\tconst validation = this.normaliseValidation(field.type, input.validation);\n\t\t\tupdates.validation = validation ? JSON.stringify(validation) : null;\n\t\t}\n\n\t\tif (input.translatable !== undefined && input.translatable !== field.translatable) {\n\t\t\t// Flipping `translatable` would orphan any values already stored\n\t\t\t// in the table matching the *current* flag. Reject when any\n\t\t\t// value rows reference this field — admins can delete the field\n\t\t\t// (cascading the values) and re-create it with the new flag if\n\t\t\t// they want a clean re-start. Migrating values across tables is\n\t\t\t// out of scope (Discussion #1174 doesn't authorise it).\n\t\t\tconst usage = await this.countFieldValues(field.id);\n\t\t\tif (usage > 0) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t`Cannot change \"translatable\" on field \"${slug}\" while ${usage} value row(s) exist. ` +\n\t\t\t\t\t\t`Delete the values (or the field) and re-create with the new setting.`,\n\t\t\t\t\t\"TRANSLATABLE_LOCKED\",\n\t\t\t\t\t{ slug, valueCount: usage },\n\t\t\t\t);\n\t\t\t}\n\t\t\tupdates.translatable = input.translatable ? 1 : 0;\n\t\t}\n\n\t\tif (input.sortOrder !== undefined) {\n\t\t\tupdates.sort_order = input.sortOrder;\n\t\t}\n\n\t\tif (Object.keys(updates).length === 0) {\n\t\t\t// No-op update — still advance the clean marker in case\n\t\t\t// we're recovering a crashed prior attempt.\n\t\t\tawait this.markVersionClean();\n\t\t\treturn field;\n\t\t}\n\n\t\tupdates.updated_at = new Date().toISOString();\n\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tawait trx\n\t\t\t\t.updateTable(\"_emdash_byline_fields\")\n\t\t\t\t.set(updates)\n\t\t\t\t.where(\"id\", \"=\", field.id)\n\t\t\t\t.execute();\n\t\t});\n\t\tawait this.markVersionClean();\n\n\t\tconst updated = await this.getFieldById(field.id);\n\t\tif (!updated) {\n\t\t\tthrow new BylineSchemaError(\"Failed to load updated field\", \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\t\treturn updated;\n\t}\n\n\tasync deleteField(slug: string): Promise<void> {\n\t\tconst field = await this.getField(slug);\n\t\tif (!field) {\n\t\t\t// Idempotent retry exit — see class JSDoc.\n\t\t\tawait this.markVersionClean();\n\t\t\tthrow new BylineSchemaError(`Byline field \"${slug}\" not found`, \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\n\t\t// Delete order matters on D1 (no tx): value rows first, definition\n\t\t// row last, so a crash leaves the definition recoverable on retry\n\t\t// rather than orphan values pointing at a vanished id.\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tawait trx\n\t\t\t\t.deleteFrom(\"_emdash_byline_field_values\")\n\t\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t\t.execute();\n\t\t\tawait trx\n\t\t\t\t.deleteFrom(\"_emdash_byline_field_group_values\")\n\t\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t\t.execute();\n\t\t\tawait trx.deleteFrom(\"_emdash_byline_fields\").where(\"id\", \"=\", field.id).execute();\n\t\t});\n\t\tawait this.markVersionClean();\n\t}\n\n\t/**\n\t * Reorder fields by slug. The input must be the *exact* set of\n\t * currently registered slugs — no adds, no drops, no duplicates. This\n\t * keeps the operation invertible (any reorder is followed by a reverse\n\t * reorder) and removes a class of \"did I forget a field?\" bugs at the\n\t * API layer.\n\t */\n\tasync reorderFields(slugs: string[]): Promise<void> {\n\t\tif (new Set(slugs).size !== slugs.length) {\n\t\t\tthrow new BylineSchemaError(\"Reorder input contains duplicate slugs\", \"REORDER_MISMATCH\", {\n\t\t\t\tslugs,\n\t\t\t});\n\t\t}\n\n\t\tconst registered = await this.listFields();\n\t\tconst registeredSlugs = registered.map((f) => f.slug).toSorted();\n\t\tconst inputSlugs = slugs.toSorted();\n\n\t\tif (registeredSlugs.length !== inputSlugs.length) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Reorder input has ${inputSlugs.length} slug(s); ${registeredSlugs.length} registered`,\n\t\t\t\t\"REORDER_MISMATCH\",\n\t\t\t\t{ registered: registeredSlugs, input: inputSlugs },\n\t\t\t);\n\t\t}\n\t\tfor (let i = 0; i < registeredSlugs.length; i++) {\n\t\t\tif (registeredSlugs[i] !== inputSlugs[i]) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t\"Reorder input does not match the registered field set\",\n\t\t\t\t\t\"REORDER_MISMATCH\",\n\t\t\t\t\t{ registered: registeredSlugs, input: inputSlugs },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst now = new Date().toISOString();\n\t\tawait this.markVersionDirty();\n\t\tawait withTransaction(this.db, async (trx) => {\n\t\t\tfor (let i = 0; i < slugs.length; i++) {\n\t\t\t\tconst slug = slugs[i];\n\t\t\t\tif (slug === undefined) continue;\n\t\t\t\tawait trx\n\t\t\t\t\t.updateTable(\"_emdash_byline_fields\")\n\t\t\t\t\t.set({ sort_order: i, updated_at: now })\n\t\t\t\t\t.where(\"slug\", \"=\", slug)\n\t\t\t\t\t.execute();\n\t\t\t}\n\t\t});\n\t\tawait this.markVersionClean();\n\t}\n\n\t/**\n\t * Per-table usage counts for a field, plus the sum. Backs the\n\t * destructive-delete confirm dialog in the admin UI (Phase 5).\n\t *\n\t * Both counts are surfaced separately for diagnostic value: a\n\t * non-zero count on the table that doesn't match the field's current\n\t * `translatable` flag indicates historical drift (e.g. a flip from\n\t * an older code path). Today the registry rejects such flips with\n\t * `TRANSLATABLE_LOCKED`, so any drift originates pre-Phase-2.\n\t *\n\t * Throws `FIELD_NOT_FOUND` when the slug doesn't resolve — callers\n\t * shouldn't get back zero counts for a missing field.\n\t */\n\tasync getFieldUsage(slug: string): Promise<{\n\t\ttranslatableValueCount: number;\n\t\tgroupValueCount: number;\n\t\ttotalAffectedRows: number;\n\t}> {\n\t\tconst field = await this.getField(slug);\n\t\tif (!field) {\n\t\t\tthrow new BylineSchemaError(`Byline field \"${slug}\" not found`, \"FIELD_NOT_FOUND\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\t\tconst tr = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t.executeTakeFirst();\n\t\tconst grp = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_group_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", field.id)\n\t\t\t.executeTakeFirst();\n\t\tconst translatableValueCount = Number(tr?.count ?? 0);\n\t\tconst groupValueCount = Number(grp?.count ?? 0);\n\t\treturn {\n\t\t\ttranslatableValueCount,\n\t\t\tgroupValueCount,\n\t\t\ttotalAffectedRows: translatableValueCount + groupValueCount,\n\t\t};\n\t}\n\n\t/**\n\t * Read the persisted version counter. Used by the field-defs cache\n\t * (Phase 3) to detect invalidation. Returns `0` when the row is\n\t * missing — covers the \"tests that didn't run migration 041\" case\n\t * without throwing.\n\t */\n\tasync getVersion(): Promise<number> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"options\")\n\t\t\t.select(\"value\")\n\t\t\t.where(\"name\", \"=\", VERSION_KEY)\n\t\t\t.executeTakeFirst();\n\t\tif (!row) return 0;\n\t\tconst parsed = Number.parseInt(row.value, 10);\n\t\treturn Number.isFinite(parsed) ? parsed : 0;\n\t}\n\n\t// ============================================\n\t// Private helpers\n\t// ============================================\n\n\t/**\n\t * Force the version counter to an odd integer (\"dirty\"). Idempotent\n\t * on odd so a crashed prior attempt can't invert parity. Upsert (not\n\t * UPDATE) so a missing row still flips parity — `getVersion` returns\n\t * 0 on missing, which is even, so a bare UPDATE would leave the\n\t * cache pinned on a stale snapshot. See the class JSDoc.\n\t *\n\t * `options.value` qualified: PG's `ON CONFLICT DO UPDATE` puts both\n\t * the target and `EXCLUDED.value` in scope; bare `value` is ambiguous.\n\t */\n\tprivate async markVersionDirty(): Promise<void> {\n\t\tawait sql`\n\t\t\tINSERT INTO options (name, value)\n\t\t\tVALUES (${VERSION_KEY}, '1')\n\t\t\tON CONFLICT(name) DO UPDATE SET value = CASE\n\t\t\t\tWHEN CAST(options.value AS INTEGER) % 2 = 0\n\t\t\t\t\tTHEN CAST(CAST(options.value AS INTEGER) + 1 AS TEXT)\n\t\t\t\tELSE options.value\n\t\t\tEND\n\t\t`.execute(this.db);\n\t}\n\n\t/**\n\t * Force the version counter to a **new** even integer (+2 from even,\n\t * +1 from odd). Always-advance — never a no-op — so two concurrent\n\t * mutators can't collapse on the same even key and pin a stale cache\n\t * snapshot. See the class JSDoc for the concurrent-collapse rationale.\n\t *\n\t * `options.value` qualified — see `markVersionDirty`.\n\t */\n\tprivate async markVersionClean(): Promise<void> {\n\t\tawait sql`\n\t\t\tINSERT INTO options (name, value)\n\t\t\tVALUES (${VERSION_KEY}, '2')\n\t\t\tON CONFLICT(name) DO UPDATE SET value = CASE\n\t\t\t\tWHEN CAST(options.value AS INTEGER) % 2 = 0\n\t\t\t\t\tTHEN CAST(CAST(options.value AS INTEGER) + 2 AS TEXT)\n\t\t\t\tELSE CAST(CAST(options.value AS INTEGER) + 1 AS TEXT)\n\t\t\tEND\n\t\t`.execute(this.db);\n\t}\n\n\tprivate async nextSortOrder(): Promise<number> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_fields\")\n\t\t\t.select(({ fn }) => [fn.max<number | null>(\"sort_order\").as(\"max\")])\n\t\t\t.executeTakeFirst();\n\t\tconst max = row?.max ?? null;\n\t\treturn max === null ? 0 : max + 1;\n\t}\n\n\tprivate async countFieldValues(fieldId: string): Promise<number> {\n\t\t// Count both per-locale and group-shared values. A field can only\n\t\t// store in one table at a time (translatable picks), but historic\n\t\t// rows might exist in the other if a prior version of this code\n\t\t// allowed the flip — count both to be safe.\n\t\tconst tr = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", fieldId)\n\t\t\t.executeTakeFirst();\n\t\tconst grp = await this.db\n\t\t\t.selectFrom(\"_emdash_byline_field_group_values\")\n\t\t\t.select(({ fn }) => [fn.count<number>(\"field_id\").as(\"count\")])\n\t\t\t.where(\"field_id\", \"=\", fieldId)\n\t\t\t.executeTakeFirst();\n\t\treturn Number(tr?.count ?? 0) + Number(grp?.count ?? 0);\n\t}\n\n\tprivate validateSlug(slug: string): void {\n\t\tif (!slug || typeof slug !== \"string\") {\n\t\t\tthrow new BylineSchemaError(\"Byline field slug is required\", \"INVALID_SLUG\", { slug });\n\t\t}\n\t\tif (slug.length > MAX_SLUG_LENGTH) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Byline field slug must be ${MAX_SLUG_LENGTH} characters or less`,\n\t\t\t\t\"INVALID_SLUG\",\n\t\t\t\t{ slug },\n\t\t\t);\n\t\t}\n\t\t// `validateIdentifier` enforces /^[a-z][a-z0-9_]*$/ — rejects\n\t\t// camelCase, PascalCase, hyphens, leading digits, and identifiers\n\t\t// over 128 characters. We hit the 63-char cap above first, which\n\t\t// matches the content-collection slug cap.\n\t\ttry {\n\t\t\tvalidateIdentifier(slug, \"byline field slug\");\n\t\t} catch (error) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\terror instanceof Error ? error.message : \"Invalid byline field slug\",\n\t\t\t\t\"INVALID_SLUG\",\n\t\t\t\t{ slug },\n\t\t\t);\n\t\t}\n\t\tif (RESERVED_SET.has(slug)) {\n\t\t\tthrow new BylineSchemaError(`Byline field slug \"${slug}\" is reserved`, \"RESERVED_SLUG\", {\n\t\t\t\tslug,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate validateLabel(label: string): void {\n\t\tif (!label || typeof label !== \"string\") {\n\t\t\tthrow new BylineSchemaError(\"Byline field label is required\", \"INVALID_LABEL\", {\n\t\t\t\tlabel,\n\t\t\t});\n\t\t}\n\t\tif (label.length > MAX_LABEL_LENGTH) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Byline field label must be ${MAX_LABEL_LENGTH} characters or less`,\n\t\t\t\t\"INVALID_LABEL\",\n\t\t\t\t{ length: label.length },\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate validateType(type: BylineFieldType): void {\n\t\tif (!TYPE_SET.has(type)) {\n\t\t\tthrow new BylineSchemaError(\n\t\t\t\t`Byline field type \"${type}\" is not supported. Valid types: ${[...TYPE_SET].join(\", \")}`,\n\t\t\t\t\"INVALID_TYPE\",\n\t\t\t\t{ type },\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Normalise + validate a validation payload for a given field type.\n\t *\n\t * - `select`: `options` is required, must be a non-empty array of unique\n\t * non-empty strings, capped at `MAX_SELECT_OPTIONS`.\n\t * - any other type: `options` is silently dropped if present (a future\n\t * field type might use it, but v1 doesn't).\n\t *\n\t * Returns `null` when the resulting validation object is empty, so the\n\t * storage column stays NULL rather than carrying `'{}'`.\n\t */\n\tprivate normaliseValidation(\n\t\ttype: BylineFieldType,\n\t\tvalidation: BylineFieldValidation | null,\n\t): BylineFieldValidation | null {\n\t\tif (type === \"select\") {\n\t\t\tconst options = validation?.options;\n\t\t\tif (!Array.isArray(options) || options.length === 0) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t`Byline field of type \"select\" requires non-empty \"validation.options\"`,\n\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t{ type },\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (options.length > MAX_SELECT_OPTIONS) {\n\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t`Byline field \"select\" cannot have more than ${MAX_SELECT_OPTIONS} options`,\n\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t{ count: options.length },\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst seen = new Set<string>();\n\t\t\tfor (const option of options) {\n\t\t\t\tif (typeof option !== \"string\" || option.length === 0) {\n\t\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t\t`Byline field \"select\" options must be non-empty strings`,\n\t\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t\t{ option },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (seen.has(option)) {\n\t\t\t\t\tthrow new BylineSchemaError(\n\t\t\t\t\t\t`Byline field \"select\" options must be unique`,\n\t\t\t\t\t\t\"INVALID_VALIDATION\",\n\t\t\t\t\t\t{ option },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tseen.add(option);\n\t\t\t}\n\t\t\treturn { options };\n\t\t}\n\n\t\tif (validation == null) return null;\n\t\t// Non-select: drop `options` if present. Strip nothing else — future\n\t\t// field types might extend the shape and we don't want to lose\n\t\t// payload silently. Today's `BylineFieldValidation` is `{ options? }`\n\t\t// only, so this branch is a pass-through; left explicit for clarity.\n\t\tconst { options: _drop, ...rest } = validation;\n\t\treturn Object.keys(rest).length === 0 ? null : (rest as BylineFieldValidation);\n\t}\n}\n\nfunction mapFieldRow(row: {\n\tid: string;\n\tslug: string;\n\tlabel: string;\n\ttype: string;\n\trequired: number;\n\ttranslatable: number;\n\tvalidation: string | null;\n\tsort_order: number;\n\tcreated_at: string;\n\tupdated_at: string;\n}): BylineFieldDefinition {\n\treturn {\n\t\tid: row.id,\n\t\tslug: row.slug,\n\t\tlabel: row.label,\n\t\t// `type` is stored as TEXT but `createField` rejects anything outside\n\t\t// `BYLINE_FIELD_TYPES` before inserting. The assertion narrows on\n\t\t// that write-time guarantee.\n\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- validated at write\n\t\ttype: row.type as BylineFieldType,\n\t\trequired: row.required === 1,\n\t\ttranslatable: row.translatable === 1,\n\t\t// `validation` is JSON-encoded `BylineFieldValidation | null`, written\n\t\t// only through `normaliseValidation`. The cast matches the\n\t\t// `JSON.parse(...) as T` pattern in `OptionsRepository`.\n\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- validated at write\n\t\tvalidation: row.validation ? (JSON.parse(row.validation) as BylineFieldValidation) : null,\n\t\tsortOrder: row.sort_order,\n\t\tcreatedAt: row.created_at,\n\t\tupdatedAt: row.updated_at,\n\t};\n}\n\n// Re-export the table type for callers that want to spell it explicitly.\n// Most callers should rely on the Database interface; this is convenience\n// for tests that hand-roll Kysely queries.\nexport type { BylineFieldTable };\n"],"mappings":";;;;;;;AAiBA,MAAM,eAAoC,IAAI,IAAI,4BAA4B;AAC9E,MAAM,WAAgC,IAAI,IAAI,mBAAmB;AAEjE,MAAM,cAAc;;AAGpB,MAAM,qBAAqB;;AAE3B,MAAM,kBAAkB;;AAExB,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;AAoBzB,IAAa,oBAAb,cAAuC,MAAM;CAC5C,YACC,SACA,AAAO,MACP,AAAO,SACN;AACD,QAAM,QAAQ;EAHP;EACA;AAGP,OAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;AAyBd,SAAgB,qBAAqB,OAInC;AACD,SAAQ,MAAM,MAAd;EACC,KAAK,kBACJ,QAAO;GAAE,MAAM;GAAa,SAAS,MAAM;GAAS,SAAS,MAAM;GAAS;EAC7E,KAAK;EACL,KAAK;E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AW,EACjD,OAAM,IAAI,kBACT,yEACA,sBACA,EAAE,MAAM,CACR;AAEF,OAAI,QAAQ,SAAS,mBACpB,OAAM,IAAI,kBACT,+CAA+C,mBAAmB,WAClE,sBACA,EAAE,OAAO,QAAQ,QAAQ,CACzB;GAEF,MAAM,uBAAO,IAAI,KAAa;AAC9B,QAAK,MAAM,UAAU,SAAS;AAC7B,QAAI,OAAO,WAAW,YAAY,OAAO,WAAW,EACnD,OAAM,IAAI,kBACT,2DACA,sBACA,EAAE,QAAQ,CACV;AAEF,QAAI,KAAK,IAAI,OAAO,CACnB,OAAM,IAAI,kBACT,gDACA,sBACA,EAAE,QAAQ,CACV;AAEF,SAAK,IAAI,OAAO;;AAEjB,UAAO,EAAE,SAAS;;AAGnB,MAAI,cAAc,KAAM,QAAO;EAK/B,MAAM,EAAE,SAAS,OAAO,GAAG,SAAS;AACpC,SAAO,OAAO,KAAK,KAAK,CAAC,WAAW,IAAI,OAAQ;;;AAIlD,SAAS,YAAY,KAWK;AACzB,QAAO;EACN,IAAI,IAAI;EACR,MAAM,IAAI;EACV,OAAO,IAAI;EAKX,MAAM,IAAI;EACV,UAAU,IAAI,aAAa;EAC3B,cAAc,IAAI,iBAAiB;EAKnC,YAAY,IAAI,aAAc,KAAK,MAAM,IAAI,WAAW,GAA6B;EACrF,WAAW,IAAI;EACf,WAAW,IAAI;EACf,WAAW,IAAI;EACf"}
@@ -1,6 +1,6 @@
1
1
  import { n as getI18nConfig } from "./config-CVssduLe.mjs";
2
2
  import { t as EmDashValidationError } from "./types-BXSUSAjt.mjs";
3
- import { t as BylineRepository } from "./byline-DUx48sJp.mjs";
3
+ import { t as BylineRepository } from "./byline-V_Qp1Ziw.mjs";
4
4
 
5
5
  //#region src/api/handlers/bylines.ts
6
6
  const norm = (v) => v ?? null;
@@ -201,4 +201,4 @@ async function handleBylineUpdate(db, id, input) {
201
201
 
202
202
  //#endregion
203
203
  export { handleBylineTranslations as n, handleBylineUpdate as r, handleBylineCreate as t };
204
- //# sourceMappingURL=bylines-Cx5n-WqP.mjs.map
204
+ //# sourceMappingURL=bylines-B2NWnIwS.mjs.map