emdash 0.32.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (681) hide show
  1. package/dist/{adapters-C0ONzkUP.d.mts → adapters-BMyNSSZi.d.mts} +9 -1
  2. package/dist/adapters-BMyNSSZi.d.mts.map +1 -0
  3. package/dist/after-CBU2vkoO.mjs +96 -0
  4. package/dist/after-CBU2vkoO.mjs.map +1 -0
  5. package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-CG1pACtS.mjs} +2 -2
  6. package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-CG1pACtS.mjs.map} +1 -1
  7. package/dist/api/route-utils.d.mts +3 -4
  8. package/dist/api/route-utils.d.mts.map +1 -1
  9. package/dist/api/route-utils.mjs +22 -22
  10. package/dist/api/schemas/index.d.mts +2 -2
  11. package/dist/api/schemas/index.mjs +5 -5
  12. package/dist/{api-DgPbMlng.mjs → api-D2hunekQ.mjs} +247 -45
  13. package/dist/api-D2hunekQ.mjs.map +1 -0
  14. package/dist/{api-tokens-p-iMzvXR.mjs → api-tokens-CSND0i1z.mjs} +2 -2
  15. package/dist/{api-tokens-p-iMzvXR.mjs.map → api-tokens-CSND0i1z.mjs.map} +1 -1
  16. package/dist/{apply-1_6ra7NP.mjs → apply-kwNEJW2l.mjs} +35 -22
  17. package/dist/apply-kwNEJW2l.mjs.map +1 -0
  18. package/dist/astro/index.d.mts +12 -12
  19. package/dist/astro/index.mjs +13 -3
  20. package/dist/astro/index.mjs.map +1 -1
  21. package/dist/astro/middleware/auth.d.mts +10 -10
  22. package/dist/astro/middleware/auth.mjs +8 -8
  23. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  24. package/dist/astro/middleware/redirect.mjs +8 -8
  25. package/dist/astro/middleware/redirect.mjs.map +1 -1
  26. package/dist/astro/middleware/request-context.mjs +4 -4
  27. package/dist/astro/middleware/setup.mjs +1 -1
  28. package/dist/astro/middleware.d.mts +10 -10
  29. package/dist/astro/middleware.d.mts.map +1 -1
  30. package/dist/astro/middleware.mjs +344 -173
  31. package/dist/astro/middleware.mjs.map +1 -1
  32. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
  33. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
  34. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  35. package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
  36. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -5
  37. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -10
  38. package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -10
  39. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -10
  40. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +18 -18
  41. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +18 -18
  42. package/dist/astro/routes/api/admin/bylines/index.mjs +18 -18
  43. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +16 -16
  44. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  45. package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -7
  46. package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -12
  47. package/dist/astro/routes/api/admin/comments/counts.mjs +7 -7
  48. package/dist/astro/routes/api/admin/comments/index.mjs +12 -12
  49. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
  50. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
  51. package/dist/astro/routes/api/admin/media-usage/repair.mjs +12 -12
  52. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
  53. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
  54. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +46 -45
  55. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +46 -45
  57. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  58. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +45 -44
  59. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  60. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +5 -5
  61. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +45 -44
  62. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  63. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +45 -44
  64. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  65. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +45 -44
  66. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  67. package/dist/astro/routes/api/admin/plugins/index.mjs +45 -44
  68. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  69. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
  70. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +45 -44
  71. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  72. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +45 -44
  73. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  74. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +45 -44
  75. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  76. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +45 -44
  77. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  78. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +46 -45
  79. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  80. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +45 -44
  81. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  82. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +46 -45
  83. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  84. package/dist/astro/routes/api/admin/plugins/updates.mjs +45 -44
  85. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +45 -44
  87. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
  89. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +45 -44
  90. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  91. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  92. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  93. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -8
  94. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
  95. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
  96. package/dist/astro/routes/api/admin/users/index.mjs +7 -7
  97. package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -6
  98. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  99. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
  100. package/dist/astro/routes/api/auth/invite/index.mjs +10 -10
  101. package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
  102. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
  103. package/dist/astro/routes/api/auth/logout.mjs +3 -3
  104. package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -12
  105. package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
  106. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  107. package/dist/astro/routes/api/auth/me.mjs +8 -8
  108. package/dist/astro/routes/api/auth/mode.mjs +3 -3
  109. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
  110. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  111. package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
  112. package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
  113. package/dist/astro/routes/api/auth/passkey/options.mjs +13 -13
  114. package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
  115. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
  116. package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
  117. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
  118. package/dist/astro/routes/api/auth/signup/request.mjs +12 -12
  119. package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
  120. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  121. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +18 -18
  122. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  123. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +15 -15
  124. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
  125. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
  126. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
  127. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
  128. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -13
  129. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -9
  130. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +18 -18
  131. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +18 -18
  132. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
  133. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
  134. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +9 -9
  135. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -16
  136. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
  137. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
  138. package/dist/astro/routes/api/content/_collection_/_id_.mjs +9 -9
  139. package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
  140. package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
  141. package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
  142. package/dist/astro/routes/api/dashboard.mjs +9 -9
  143. package/dist/astro/routes/api/dev/emails.mjs +3 -3
  144. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  145. package/dist/astro/routes/api/import/probe.mjs +19 -19
  146. package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
  147. package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
  148. package/dist/astro/routes/api/import/wordpress/execute.mjs +15 -15
  149. package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
  150. package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
  151. package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -11
  152. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
  153. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -12
  154. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  155. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -19
  156. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
  157. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +27 -27
  158. package/dist/astro/routes/api/manifest.mjs +5 -5
  159. package/dist/astro/routes/api/mcp.mjs +42 -42
  160. package/dist/astro/routes/api/media/_id_/confirm.mjs +10 -10
  161. package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
  162. package/dist/astro/routes/api/media/_id_/usage.mjs +14 -14
  163. package/dist/astro/routes/api/media/_id_.mjs +13 -13
  164. package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
  165. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
  166. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
  167. package/dist/astro/routes/api/media/providers/index.mjs +3 -3
  168. package/dist/astro/routes/api/media/upload-url.mjs +9 -9
  169. package/dist/astro/routes/api/media.mjs +13 -13
  170. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -11
  171. package/dist/astro/routes/api/menus/_name_/items.mjs +11 -11
  172. package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -11
  173. package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -11
  174. package/dist/astro/routes/api/menus/_name_.mjs +11 -11
  175. package/dist/astro/routes/api/menus/index.mjs +11 -11
  176. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  177. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  178. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  179. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  180. package/dist/astro/routes/api/oauth/register.mjs +3 -3
  181. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  182. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  183. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  184. package/dist/astro/routes/api/openapi.json.mjs +36 -5
  185. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  186. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
  187. package/dist/astro/routes/api/redirects/404s/index.mjs +12 -12
  188. package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -12
  189. package/dist/astro/routes/api/redirects/_id_.mjs +14 -13
  190. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  191. package/dist/astro/routes/api/redirects/index.mjs +14 -13
  192. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  193. package/dist/astro/routes/api/relations/_id_/index.mjs +18 -18
  194. package/dist/astro/routes/api/relations/_id_/translations.mjs +13 -13
  195. package/dist/astro/routes/api/relations/index.mjs +18 -18
  196. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
  197. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
  198. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +45 -44
  199. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  200. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +45 -44
  201. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  202. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +45 -44
  203. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  204. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +45 -44
  205. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  206. package/dist/astro/routes/api/schema/collections/index.mjs +45 -44
  207. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  208. package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
  209. package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
  210. package/dist/astro/routes/api/schema/collections/reorder.mjs +66 -0
  211. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
  212. package/dist/astro/routes/api/schema/index.mjs +11 -9
  213. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  214. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +45 -44
  215. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  216. package/dist/astro/routes/api/schema/orphans/index.mjs +45 -44
  217. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  218. package/dist/astro/routes/api/search/enable.d.mts +1 -0
  219. package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
  220. package/dist/astro/routes/api/search/enable.mjs +17 -13
  221. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  222. package/dist/astro/routes/api/search/index.mjs +11 -11
  223. package/dist/astro/routes/api/search/rebuild.mjs +13 -13
  224. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  225. package/dist/astro/routes/api/search/stats.mjs +7 -7
  226. package/dist/astro/routes/api/search/suggest.mjs +11 -11
  227. package/dist/astro/routes/api/sections/_slug_.mjs +11 -11
  228. package/dist/astro/routes/api/sections/index.mjs +11 -11
  229. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
  230. package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -6
  231. package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
  232. package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
  233. package/dist/astro/routes/api/settings/email.mjs +5 -5
  234. package/dist/astro/routes/api/settings.mjs +16 -16
  235. package/dist/astro/routes/api/setup/admin-verify.mjs +13 -13
  236. package/dist/astro/routes/api/setup/admin.mjs +12 -12
  237. package/dist/astro/routes/api/setup/dev-bypass.mjs +30 -30
  238. package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
  239. package/dist/astro/routes/api/setup/index.mjs +32 -32
  240. package/dist/astro/routes/api/setup/status.mjs +4 -4
  241. package/dist/astro/routes/api/snapshot.mjs +9 -9
  242. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
  243. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
  244. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +43 -0
  245. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
  246. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -16
  247. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -16
  248. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -16
  249. package/dist/astro/routes/api/taxonomies/index.mjs +16 -16
  250. package/dist/astro/routes/api/themes/preview.mjs +7 -7
  251. package/dist/astro/routes/api/typegen.mjs +5 -5
  252. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  253. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  254. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  255. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +8 -8
  256. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -11
  257. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -11
  258. package/dist/astro/routes/api/widget-areas/_name_.mjs +6 -6
  259. package/dist/astro/routes/api/widget-areas/index.mjs +11 -11
  260. package/dist/astro/routes/api/widget-components.mjs +3 -3
  261. package/dist/astro/routes/robots.txt.mjs +9 -9
  262. package/dist/astro/routes/sitemap-_collection_.xml.mjs +12 -12
  263. package/dist/astro/routes/sitemap.xml.mjs +10 -10
  264. package/dist/astro/types.d.mts +19 -13
  265. package/dist/astro/types.d.mts.map +1 -1
  266. package/dist/auth/providers/github.d.mts +1 -1
  267. package/dist/auth/providers/google.d.mts +1 -1
  268. package/dist/{authorize-R5iYYrpa.mjs → authorize-qRhWQnel.mjs} +2 -2
  269. package/dist/{authorize-R5iYYrpa.mjs.map → authorize-qRhWQnel.mjs.map} +1 -1
  270. package/dist/{backup-LpQ1V_sR.mjs → backup-CtA6LDNw.mjs} +5 -5
  271. package/dist/{backup-LpQ1V_sR.mjs.map → backup-CtA6LDNw.mjs.map} +1 -1
  272. package/dist/{byline-C5TAqs8N.mjs → byline-Cp6csL84.mjs} +9 -9
  273. package/dist/{byline-C5TAqs8N.mjs.map → byline-Cp6csL84.mjs.map} +1 -1
  274. package/dist/{byline-fields-T9ZLZMxJ.mjs → byline-fields-CNc0Yq5i.mjs} +2 -2
  275. package/dist/{byline-fields-T9ZLZMxJ.mjs.map → byline-fields-CNc0Yq5i.mjs.map} +1 -1
  276. package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-ZkPKqEwC.mjs} +4 -4
  277. package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-ZkPKqEwC.mjs.map} +1 -1
  278. package/dist/{bylines-B8-WGdja.mjs → bylines-CEj5CdT4.mjs} +7 -7
  279. package/dist/{bylines-B8-WGdja.mjs.map → bylines-CEj5CdT4.mjs.map} +1 -1
  280. package/dist/{bylines-DGuqBLjV.mjs → bylines-cf-C9lmF.mjs} +4 -4
  281. package/dist/{bylines-DGuqBLjV.mjs.map → bylines-cf-C9lmF.mjs.map} +1 -1
  282. package/dist/cache-C9FptTFR.mjs +108 -0
  283. package/dist/cache-C9FptTFR.mjs.map +1 -0
  284. package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-D9VNKELo.mjs} +1 -1
  285. package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-D9VNKELo.mjs.map} +1 -1
  286. package/dist/{chunks-D5dlPeRb.mjs → chunks-DbYzib_k.mjs} +2 -2
  287. package/dist/{chunks-D5dlPeRb.mjs.map → chunks-DbYzib_k.mjs.map} +1 -1
  288. package/dist/cli/index.mjs +40 -32
  289. package/dist/cli/index.mjs.map +1 -1
  290. package/dist/client/cf-access.d.mts +1 -1
  291. package/dist/client/index.d.mts +1 -1
  292. package/dist/client/index.mjs +2 -2
  293. package/dist/{comment-DnTxxVHv.mjs → comment-BIkJ6Fil.mjs} +3 -3
  294. package/dist/{comment-DnTxxVHv.mjs.map → comment-BIkJ6Fil.mjs.map} +1 -1
  295. package/dist/{comment-reaction-BUlUz2bh.mjs → comment-reaction-D-laEceb.mjs} +2 -2
  296. package/dist/{comment-reaction-BUlUz2bh.mjs.map → comment-reaction-D-laEceb.mjs.map} +1 -1
  297. package/dist/{comments-QPKgK3nk.mjs → comments-0_w6KChA.mjs} +3 -3
  298. package/dist/{comments-QPKgK3nk.mjs.map → comments-0_w6KChA.mjs.map} +1 -1
  299. package/dist/{components-DZkL4Fx0.mjs → components-BPxrRjpE.mjs} +1 -1
  300. package/dist/{components-DZkL4Fx0.mjs.map → components-BPxrRjpE.mjs.map} +1 -1
  301. package/dist/{content-CpfKV9QE.mjs → content-CJ94NEx5.mjs} +165 -112
  302. package/dist/content-CJ94NEx5.mjs.map +1 -0
  303. package/dist/{content-refresh-DgqUBeTv.mjs → content-refresh-Xw7aKmou.mjs} +6 -6
  304. package/dist/{content-refresh-DgqUBeTv.mjs.map → content-refresh-Xw7aKmou.mjs.map} +1 -1
  305. package/dist/{context-kO4YZB03.mjs → context-C_1nrqnW.mjs} +14 -14
  306. package/dist/{context-kO4YZB03.mjs.map → context-C_1nrqnW.mjs.map} +1 -1
  307. package/dist/{cron-BlKIMD_e.mjs → cron-DRV-UC4K.mjs} +1 -1
  308. package/dist/{cron-BlKIMD_e.mjs.map → cron-DRV-UC4K.mjs.map} +1 -1
  309. package/dist/{dashboard-DoBwPnON.mjs → dashboard-DINnNVVU.mjs} +5 -5
  310. package/dist/{dashboard-DoBwPnON.mjs.map → dashboard-DINnNVVU.mjs.map} +1 -1
  311. package/dist/db/index.d.mts +3 -3
  312. package/dist/db/index.mjs +2 -2
  313. package/dist/db/index.mjs.map +1 -1
  314. package/dist/db/libsql.d.mts +1 -1
  315. package/dist/db/postgres.d.mts +1 -1
  316. package/dist/db/sqlite.d.mts +1 -1
  317. package/dist/{default-C4v9KP56.mjs → default-BD2FG0xV.mjs} +1 -1
  318. package/dist/{default-C4v9KP56.mjs.map → default-BD2FG0xV.mjs.map} +1 -1
  319. package/dist/deferred-tasks-C-WRCcKo.d.mts +9 -0
  320. package/dist/deferred-tasks-C-WRCcKo.d.mts.map +1 -0
  321. package/dist/{device-flow-DhUsyJU6.mjs → device-flow-CTqd8mud.mjs} +5 -5
  322. package/dist/{device-flow-DhUsyJU6.mjs.map → device-flow-CTqd8mud.mjs.map} +1 -1
  323. package/dist/{dialect-helpers-DFwyWjTM.mjs → dialect-helpers-BSbfaO3F.mjs} +24 -16
  324. package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
  325. package/dist/{email-console-C-9Ng8DM.mjs → email-console-C6WdcWbL.mjs} +1 -1
  326. package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-C6WdcWbL.mjs.map} +1 -1
  327. package/dist/{error-DmmN74gW.mjs → error-oh_9i6bR.mjs} +3 -3
  328. package/dist/{error-DmmN74gW.mjs.map → error-oh_9i6bR.mjs.map} +1 -1
  329. package/dist/{errors-DtEXIQQV.mjs → errors-BucQ8VYz.mjs} +2 -1
  330. package/dist/errors-BucQ8VYz.mjs.map +1 -0
  331. package/dist/{escape-CdW31WsG.mjs → escape-CXps5F_v.mjs} +1 -1
  332. package/dist/{escape-CdW31WsG.mjs.map → escape-CXps5F_v.mjs.map} +1 -1
  333. package/dist/{field-defs-cache-QMVnzTH6.mjs → field-defs-cache-WD82dMQq.mjs} +4 -4
  334. package/dist/{field-defs-cache-QMVnzTH6.mjs.map → field-defs-cache-WD82dMQq.mjs.map} +1 -1
  335. package/dist/{fts-manager-vncsZIJm.mjs → fts-manager-BITakW_R.mjs} +37 -13
  336. package/dist/fts-manager-BITakW_R.mjs.map +1 -0
  337. package/dist/{hash-Cb7U1b5M.mjs → hash-Cg0TXJPV.mjs} +1 -1
  338. package/dist/{hash-Cb7U1b5M.mjs.map → hash-Cg0TXJPV.mjs.map} +1 -1
  339. package/dist/{hreflang-CZbSx6Bg.d.mts → hreflang-BaLCNcDx.d.mts} +2 -2
  340. package/dist/{hreflang-CZbSx6Bg.d.mts.map → hreflang-BaLCNcDx.d.mts.map} +1 -1
  341. package/dist/{hreflang-Bg-zMpkr.mjs → hreflang-BdZuVBhL.mjs} +6 -6
  342. package/dist/{hreflang-Bg-zMpkr.mjs.map → hreflang-BdZuVBhL.mjs.map} +1 -1
  343. package/dist/{import-PKhLeXvn.mjs → import-C-9uqyT3.mjs} +6 -6
  344. package/dist/{import-PKhLeXvn.mjs.map → import-C-9uqyT3.mjs.map} +1 -1
  345. package/dist/{index-j9rTh3cp.d.mts → index-M37iz29I.d.mts} +75 -35
  346. package/dist/index-M37iz29I.d.mts.map +1 -0
  347. package/dist/{index-BeNto_Vs.d.mts → index-MGw47uWq.d.mts} +3 -3
  348. package/dist/{index-BeNto_Vs.d.mts.map → index-MGw47uWq.d.mts.map} +1 -1
  349. package/dist/index.d.mts +19 -19
  350. package/dist/index.mjs +68 -66
  351. package/dist/{load-BwTdWE8B.mjs → load-DV1DZuUJ.mjs} +2 -2
  352. package/dist/{load-BwTdWE8B.mjs.map → load-DV1DZuUJ.mjs.map} +1 -1
  353. package/dist/{loader-C1XOLV5b.mjs → loader-CGugY7Zl.mjs} +29 -15
  354. package/dist/loader-CGugY7Zl.mjs.map +1 -0
  355. package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-Da7kj23y.mjs} +1 -1
  356. package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-Da7kj23y.mjs.map} +1 -1
  357. package/dist/media/index.d.mts +1 -1
  358. package/dist/media/local-runtime.d.mts +12 -12
  359. package/dist/media/local-runtime.mjs +8 -8
  360. package/dist/{media-tQDZEdu7.mjs → media-BP7S-nHT.mjs} +2 -2
  361. package/dist/{media-tQDZEdu7.mjs.map → media-BP7S-nHT.mjs.map} +1 -1
  362. package/dist/{media-DWIzoVFL.mjs → media-OhYL-7Io.mjs} +1 -1
  363. package/dist/{media-DWIzoVFL.mjs.map → media-OhYL-7Io.mjs.map} +1 -1
  364. package/dist/{media-allowlist-B7TPD6aq.mjs → media-allowlist-D-peH1H5.mjs} +1 -1
  365. package/dist/{media-allowlist-B7TPD6aq.mjs.map → media-allowlist-D-peH1H5.mjs.map} +1 -1
  366. package/dist/{media-upload-Bc9Nc5Zf.mjs → media-upload-DtrwU2B0.mjs} +7 -7
  367. package/dist/{media-upload-Bc9Nc5Zf.mjs.map → media-upload-DtrwU2B0.mjs.map} +1 -1
  368. package/dist/{media-url-BCm5vBn6.mjs → media-url-DYs_YLOx.mjs} +1 -1
  369. package/dist/{media-url-BCm5vBn6.mjs.map → media-url-DYs_YLOx.mjs.map} +1 -1
  370. package/dist/{media-usage-DPJcNaAq.mjs → media-usage-BlxfTkN0.mjs} +8 -8
  371. package/dist/{media-usage-DPJcNaAq.mjs.map → media-usage-BlxfTkN0.mjs.map} +1 -1
  372. package/dist/{menus-BxPLFfIc.mjs → menus-BcQWxeXu.mjs} +4 -4
  373. package/dist/{menus-BxPLFfIc.mjs.map → menus-BcQWxeXu.mjs.map} +1 -1
  374. package/dist/{menus-C6qhqP4X.mjs → menus-Y54RDPIN.mjs} +215 -38
  375. package/dist/menus-Y54RDPIN.mjs.map +1 -0
  376. package/dist/{mode-fiXRMfeA.mjs → mode-BWyTBe3I.mjs} +1 -1
  377. package/dist/{mode-fiXRMfeA.mjs.map → mode-BWyTBe3I.mjs.map} +1 -1
  378. package/dist/{oauth-authorization-C9tFinly.mjs → oauth-authorization-ClvktmrL.mjs} +5 -5
  379. package/dist/{oauth-authorization-C9tFinly.mjs.map → oauth-authorization-ClvktmrL.mjs.map} +1 -1
  380. package/dist/{oauth-clients-BwTxE1aE.mjs → oauth-clients-8ao-U66l.mjs} +1 -1
  381. package/dist/{oauth-clients-BwTxE1aE.mjs.map → oauth-clients-8ao-U66l.mjs.map} +1 -1
  382. package/dist/{oauth-state-store-DaRUwPWO.mjs → oauth-state-store-B1ofdTiQ.mjs} +1 -1
  383. package/dist/{oauth-state-store-DaRUwPWO.mjs.map → oauth-state-store-B1ofdTiQ.mjs.map} +1 -1
  384. package/dist/{oauth-user-lookup-CzuzOSlF.mjs → oauth-user-lookup-CscEuIiR.mjs} +1 -1
  385. package/dist/{oauth-user-lookup-CzuzOSlF.mjs.map → oauth-user-lookup-CscEuIiR.mjs.map} +1 -1
  386. package/dist/object-cache/memory.d.mts +1 -1
  387. package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
  388. package/dist/object-cache-71tPfV4A.mjs.map +1 -0
  389. package/dist/{options-aeIs8WFu.d.mts → options-CA4eVX6P.d.mts} +3 -3
  390. package/dist/{options-aeIs8WFu.d.mts.map → options-CA4eVX6P.d.mts.map} +1 -1
  391. package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
  392. package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
  393. package/dist/page/index.d.mts +2 -2
  394. package/dist/{parse-BL49yb9D.mjs → parse-CJKNuewM.mjs} +2 -2
  395. package/dist/{parse-BL49yb9D.mjs.map → parse-CJKNuewM.mjs.map} +1 -1
  396. package/dist/{passkey-config-KMhgFjdQ.mjs → passkey-config-D-zrzMJI.mjs} +1 -1
  397. package/dist/{passkey-config-KMhgFjdQ.mjs.map → passkey-config-D-zrzMJI.mjs.map} +1 -1
  398. package/dist/{placeholder-Dxo5Zt58.d.mts → placeholder-DaeNS-VG.d.mts} +1 -1
  399. package/dist/{placeholder-Dxo5Zt58.d.mts.map → placeholder-DaeNS-VG.d.mts.map} +1 -1
  400. package/dist/plugin-types.d.mts +1 -1
  401. package/dist/plugin-utils.d.mts +10 -10
  402. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
  403. package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
  404. package/dist/{portable-text-CNahFfj6.mjs → portable-text-B_kqBmXB.mjs} +1 -1
  405. package/dist/{portable-text-CNahFfj6.mjs.map → portable-text-B_kqBmXB.mjs.map} +1 -1
  406. package/dist/{preview-D4Jnbfx7.mjs → preview-BU6PaLpM.mjs} +2 -2
  407. package/dist/{preview-D4Jnbfx7.mjs.map → preview-BU6PaLpM.mjs.map} +1 -1
  408. package/dist/{public-url-DSGTnJFw.mjs → public-url-Ox9oOlgp.mjs} +14 -3
  409. package/dist/public-url-Ox9oOlgp.mjs.map +1 -0
  410. package/dist/{query-DCiXI7OZ.mjs → query-C5w7PsRQ.mjs} +20 -41
  411. package/dist/query-C5w7PsRQ.mjs.map +1 -0
  412. package/dist/{query-1xOcEy18.mjs → query-rC9HKv1N.mjs} +4 -4
  413. package/dist/{query-1xOcEy18.mjs.map → query-rC9HKv1N.mjs.map} +1 -1
  414. package/dist/{rate-limit-Vkp9gQ1Y.mjs → rate-limit-kug6q99V.mjs} +2 -2
  415. package/dist/{rate-limit-Vkp9gQ1Y.mjs.map → rate-limit-kug6q99V.mjs.map} +1 -1
  416. package/dist/{redirect-BJ6d1yHh.mjs → redirect-DIJxXKOG.mjs} +3 -3
  417. package/dist/{redirect-BJ6d1yHh.mjs.map → redirect-DIJxXKOG.mjs.map} +1 -1
  418. package/dist/{redirect-CDgfv9vh.mjs → redirect-Egf2R9yP.mjs} +1 -1
  419. package/dist/{redirect-CDgfv9vh.mjs.map → redirect-Egf2R9yP.mjs.map} +1 -1
  420. package/dist/{redirects-Cwkq2H-G.mjs → redirects-Bzm812bY.mjs} +5 -5
  421. package/dist/{redirects-Cwkq2H-G.mjs.map → redirects-Bzm812bY.mjs.map} +1 -1
  422. package/dist/{redirects-BOn2DIUs.mjs → redirects-G8wAhWAf.mjs} +20 -6
  423. package/dist/redirects-G8wAhWAf.mjs.map +1 -0
  424. package/dist/{registry-BP1JK2xh.mjs → registry-Dbodb4Uo.mjs} +59 -14
  425. package/dist/registry-Dbodb4Uo.mjs.map +1 -0
  426. package/dist/{relation-DJ5DZh7B.mjs → relation-Cbe3Sd3m.mjs} +3 -3
  427. package/dist/{relation-DJ5DZh7B.mjs.map → relation-Cbe3Sd3m.mjs.map} +1 -1
  428. package/dist/{relations-C4duJnwI.mjs → relations-Bw_E1TXo.mjs} +3 -3
  429. package/dist/{relations-C4duJnwI.mjs.map → relations-Bw_E1TXo.mjs.map} +1 -1
  430. package/dist/{relations-DHFQGX0h.d.mts → relations-G2ta7GIl.d.mts} +36 -9
  431. package/dist/relations-G2ta7GIl.d.mts.map +1 -0
  432. package/dist/{relations-DpTjftCl.mjs → relations-qHwpUe66.mjs} +5 -5
  433. package/dist/{relations-DpTjftCl.mjs.map → relations-qHwpUe66.mjs.map} +1 -1
  434. package/dist/request-context.d.mts +3 -0
  435. package/dist/request-context.d.mts.map +1 -1
  436. package/dist/request-context.mjs.map +1 -1
  437. package/dist/{request-meta-DzXYYI-n.mjs → request-meta-Df-jFbAd.mjs} +2 -2
  438. package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-Df-jFbAd.mjs.map} +1 -1
  439. package/dist/{resolve-BUvFE0Lr.mjs → resolve-DZzG4HqM.mjs} +1 -1
  440. package/dist/{resolve-BUvFE0Lr.mjs.map → resolve-DZzG4HqM.mjs.map} +1 -1
  441. package/dist/{runner-BsI18UgP.mjs → runner-BFTrkYhu.mjs} +482 -216
  442. package/dist/runner-BFTrkYhu.mjs.map +1 -0
  443. package/dist/{runner-CHdkERbt.d.mts → runner-BaADli8l.d.mts} +2 -2
  444. package/dist/{runner-CHdkERbt.d.mts.map → runner-BaADli8l.d.mts.map} +1 -1
  445. package/dist/runtime.d.mts +11 -11
  446. package/dist/runtime.mjs +3 -3
  447. package/dist/{schema-eqZhkR0S.mjs → schema-CiQXr6_F.mjs} +3 -3
  448. package/dist/{schema-eqZhkR0S.mjs.map → schema-CiQXr6_F.mjs.map} +1 -1
  449. package/dist/{scopes-Be2d8bSb.mjs → scopes-CNJVT5i5.mjs} +3 -3
  450. package/dist/{scopes-Be2d8bSb.mjs.map → scopes-CNJVT5i5.mjs.map} +1 -1
  451. package/dist/{search-CeO678cp.mjs → search-FZhx5dDU.mjs} +6 -6
  452. package/dist/{search-CeO678cp.mjs.map → search-FZhx5dDU.mjs.map} +1 -1
  453. package/dist/{secrets-870d-7yA.mjs → secrets-DLd8RXee.mjs} +4 -4
  454. package/dist/{secrets-870d-7yA.mjs.map → secrets-DLd8RXee.mjs.map} +1 -1
  455. package/dist/{sections-DSuEfirn.mjs → sections-BrIrMUCn.mjs} +3 -3
  456. package/dist/{sections-DSuEfirn.mjs.map → sections-BrIrMUCn.mjs.map} +1 -1
  457. package/dist/seed/index.d.mts +2 -2
  458. package/dist/seed/index.mjs +24 -24
  459. package/dist/seo/index.d.mts +3 -3
  460. package/dist/seo/index.mjs +17 -17
  461. package/dist/{seo-C3GDfT0V.mjs → seo-CobNfOvb.mjs} +2 -2
  462. package/dist/{seo-C3GDfT0V.mjs.map → seo-CobNfOvb.mjs.map} +1 -1
  463. package/dist/{seo-BAPKiED8.mjs → seo-DTHRntNC.mjs} +3 -3
  464. package/dist/{seo-BAPKiED8.mjs.map → seo-DTHRntNC.mjs.map} +1 -1
  465. package/dist/{service-DyFT-k-R.mjs → service-B-pYGPgR.mjs} +4 -4
  466. package/dist/{service-DyFT-k-R.mjs.map → service-B-pYGPgR.mjs.map} +1 -1
  467. package/dist/{session-user-BrK2zz7S.mjs → session-user-BvM9-zNl.mjs} +2 -2
  468. package/dist/{session-user-BrK2zz7S.mjs.map → session-user-BvM9-zNl.mjs.map} +1 -1
  469. package/dist/{settings-CREKyj8I.mjs → settings-DPHau-WH.mjs} +3 -3
  470. package/dist/{settings-CREKyj8I.mjs.map → settings-DPHau-WH.mjs.map} +1 -1
  471. package/dist/{settings-DgKouY2S.mjs → settings-kJhGiQ4z.mjs} +7 -7
  472. package/dist/{settings-DgKouY2S.mjs.map → settings-kJhGiQ4z.mjs.map} +1 -1
  473. package/dist/{setup-complete-L7bMK2VI.mjs → setup-complete-u50Qm8rY.mjs} +2 -2
  474. package/dist/{setup-complete-L7bMK2VI.mjs.map → setup-complete-u50Qm8rY.mjs.map} +1 -1
  475. package/dist/{setup-nonce-Ct5tjWcq.mjs → setup-nonce-DCjiiOD2.mjs} +1 -1
  476. package/dist/{setup-nonce-Ct5tjWcq.mjs.map → setup-nonce-DCjiiOD2.mjs.map} +1 -1
  477. package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-DW3w11Pu.mjs} +1 -1
  478. package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-DW3w11Pu.mjs.map} +1 -1
  479. package/dist/site-url-I-lJ5kma.mjs +16 -0
  480. package/dist/site-url-I-lJ5kma.mjs.map +1 -0
  481. package/dist/{snapshot-BdpUJKD-.mjs → snapshot-I_fjLDaD.mjs} +2 -2
  482. package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-I_fjLDaD.mjs.map} +1 -1
  483. package/dist/{ssrf-CviKqWmq.mjs → ssrf-CTa6v21i.mjs} +1 -1
  484. package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-CTa6v21i.mjs.map} +1 -1
  485. package/dist/{state-xxv6ZTMv.mjs → state-CQvoefYP.mjs} +1 -1
  486. package/dist/{state-xxv6ZTMv.mjs.map → state-CQvoefYP.mjs.map} +1 -1
  487. package/dist/{status-COfycGIU.mjs → status-CIsmlC1E.mjs} +1 -1
  488. package/dist/{status-COfycGIU.mjs.map → status-CIsmlC1E.mjs.map} +1 -1
  489. package/dist/storage/local.d.mts +1 -1
  490. package/dist/storage/local.mjs +1 -1
  491. package/dist/storage/s3.d.mts +1 -1
  492. package/dist/storage/s3.mjs +1 -1
  493. package/dist/{taxonomies-Dbdki3Un.mjs → taxonomies-CKuaZER5.mjs} +85 -5
  494. package/dist/taxonomies-CKuaZER5.mjs.map +1 -0
  495. package/dist/{taxonomies-B61CRSha.mjs → taxonomies-CLN1N92E.mjs} +16 -17
  496. package/dist/taxonomies-CLN1N92E.mjs.map +1 -0
  497. package/dist/{taxonomy-DvwWAPvA.mjs → taxonomy-pOrB2kZe.mjs} +142 -15
  498. package/dist/taxonomy-pOrB2kZe.mjs.map +1 -0
  499. package/dist/{tokens-DVltpO2D.mjs → tokens-DagaJGK8.mjs} +1 -1
  500. package/dist/{tokens-DVltpO2D.mjs.map → tokens-DagaJGK8.mjs.map} +1 -1
  501. package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
  502. package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
  503. package/dist/{transport-DokJOScS.d.mts → transport-CAwTaTp_.d.mts} +1 -1
  504. package/dist/{transport-DokJOScS.d.mts.map → transport-CAwTaTp_.d.mts.map} +1 -1
  505. package/dist/{transport-BWQo0Foy.mjs → transport-DVsa5YYo.mjs} +1 -1
  506. package/dist/{transport-BWQo0Foy.mjs.map → transport-DVsa5YYo.mjs.map} +1 -1
  507. package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-D20_7fyX.mjs} +1 -1
  508. package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-D20_7fyX.mjs.map} +1 -1
  509. package/dist/{types-DqZVPILm.d.mts → types-BGWPMiBO.d.mts} +2 -2
  510. package/dist/{types-DqZVPILm.d.mts.map → types-BGWPMiBO.d.mts.map} +1 -1
  511. package/dist/{types-DsAMyD_o.d.mts → types-BK6U01Ro.d.mts} +1 -1
  512. package/dist/{types-DsAMyD_o.d.mts.map → types-BK6U01Ro.d.mts.map} +1 -1
  513. package/dist/{types-BD40g7zz.mjs → types-BjxTKxrZ.mjs} +1 -1
  514. package/dist/{types-BD40g7zz.mjs.map → types-BjxTKxrZ.mjs.map} +1 -1
  515. package/dist/{types-jISEalTX.d.mts → types-BnFP1M3J.d.mts} +22 -1
  516. package/dist/types-BnFP1M3J.d.mts.map +1 -0
  517. package/dist/{types-Dr2GLlwu.d.mts → types-C8oz_ayJ.d.mts} +1 -1
  518. package/dist/{types-Dr2GLlwu.d.mts.map → types-C8oz_ayJ.d.mts.map} +1 -1
  519. package/dist/{types-C9P3ysxq.d.mts → types-CbUcuxxc.d.mts} +1 -1
  520. package/dist/{types-C9P3ysxq.d.mts.map → types-CbUcuxxc.d.mts.map} +1 -1
  521. package/dist/{types-XrQQ-Aex.mjs → types-Cd8iuS1J.mjs} +10 -3
  522. package/dist/{types-XrQQ-Aex.mjs.map → types-Cd8iuS1J.mjs.map} +1 -1
  523. package/dist/types-CtzytVXn.mjs +18 -0
  524. package/dist/types-CtzytVXn.mjs.map +1 -0
  525. package/dist/{types-BQY7VYw6.d.mts → types-Cz8hNch2.d.mts} +5 -5
  526. package/dist/{types-BQY7VYw6.d.mts.map → types-Cz8hNch2.d.mts.map} +1 -1
  527. package/dist/{types-CcSZCcF1.d.mts → types-DLG4IFEQ.d.mts} +1 -1
  528. package/dist/{types-CcSZCcF1.d.mts.map → types-DLG4IFEQ.d.mts.map} +1 -1
  529. package/dist/{types-84Bque3-.d.mts → types-Dc4ntQjQ.d.mts} +10 -1
  530. package/dist/types-Dc4ntQjQ.d.mts.map +1 -0
  531. package/dist/{types-DQLZ58GV.d.mts → types-LoagAGzH.d.mts} +1 -1
  532. package/dist/{types-DQLZ58GV.d.mts.map → types-LoagAGzH.d.mts.map} +1 -1
  533. package/dist/{types-o7xo7VgH.mjs → types-NBI3rF-_.mjs} +3 -2
  534. package/dist/types-NBI3rF-_.mjs.map +1 -0
  535. package/dist/{upload-attempts-C5yd6Gae.mjs → upload-attempts-D8QAFLUJ.mjs} +1 -1
  536. package/dist/{upload-attempts-C5yd6Gae.mjs.map → upload-attempts-D8QAFLUJ.mjs.map} +1 -1
  537. package/dist/{user-BAumEmpA.mjs → user-DBrq4UVq.mjs} +3 -3
  538. package/dist/{user-BAumEmpA.mjs.map → user-DBrq4UVq.mjs.map} +1 -1
  539. package/dist/{utils-BbUgmeZG.mjs → utils-hLzi_2Fn.mjs} +2 -2
  540. package/dist/{utils-BbUgmeZG.mjs.map → utils-hLzi_2Fn.mjs.map} +1 -1
  541. package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
  542. package/dist/validate-BpwoDOgt.mjs.map +1 -0
  543. package/dist/{validate-CdYcY-Ln.d.mts → validate-C3oSmA7F.d.mts} +15 -5
  544. package/dist/validate-C3oSmA7F.d.mts.map +1 -0
  545. package/dist/{validate-Bs_wT2ul.mjs → validate-mKo3RxBM.mjs} +3 -3
  546. package/dist/{validate-Bs_wT2ul.mjs.map → validate-mKo3RxBM.mjs.map} +1 -1
  547. package/dist/{validation-BngR0nit.mjs → validation-BgpucsvF.mjs} +10 -10
  548. package/dist/{validation-BngR0nit.mjs.map → validation-BgpucsvF.mjs.map} +1 -1
  549. package/dist/version-C4PnpmoV.mjs +7 -0
  550. package/dist/{version-Bdfb34kk.mjs.map → version-C4PnpmoV.mjs.map} +1 -1
  551. package/dist/{widgets-L-VndTKD.mjs → widgets-CJJtkiKh.mjs} +3 -3
  552. package/dist/{widgets-L-VndTKD.mjs.map → widgets-CJJtkiKh.mjs.map} +1 -1
  553. package/dist/{wxr-taxonomies-BexjtNid.mjs → wxr-taxonomies-9PPSy8X6.mjs} +4 -4
  554. package/dist/{wxr-taxonomies-BexjtNid.mjs.map → wxr-taxonomies-9PPSy8X6.mjs.map} +1 -1
  555. package/dist/{wxr-taxonomies-DueaLFd9.d.mts → wxr-taxonomies-Bkpp_2tK.d.mts} +1 -1
  556. package/dist/{wxr-taxonomies-DueaLFd9.d.mts.map → wxr-taxonomies-Bkpp_2tK.d.mts.map} +1 -1
  557. package/dist/{zod-generator-DMzfga3g.mjs → zod-generator-CG64Hnbh.mjs} +3 -3
  558. package/dist/{zod-generator-DMzfga3g.mjs.map → zod-generator-CG64Hnbh.mjs.map} +1 -1
  559. package/package.json +11 -8
  560. package/src/after.ts +6 -1
  561. package/src/api/errors.ts +1 -0
  562. package/src/api/handlers/content.ts +45 -4
  563. package/src/api/handlers/marketplace.ts +14 -0
  564. package/src/api/handlers/registry.ts +14 -0
  565. package/src/api/handlers/revision.ts +19 -5
  566. package/src/api/handlers/schema.ts +37 -0
  567. package/src/api/handlers/snapshot.ts +1 -1
  568. package/src/api/handlers/taxonomies.ts +101 -1
  569. package/src/api/openapi/document.ts +48 -0
  570. package/src/api/public-url.ts +14 -2
  571. package/src/api/schemas/schema.ts +13 -0
  572. package/src/api/schemas/search.ts +2 -0
  573. package/src/api/schemas/taxonomies.ts +18 -0
  574. package/src/api/site-url.ts +16 -6
  575. package/src/astro/integration/routes.ts +14 -0
  576. package/src/astro/integration/runtime.ts +13 -0
  577. package/src/astro/integration/virtual-modules.ts +2 -0
  578. package/src/astro/middleware/redirect.ts +2 -10
  579. package/src/astro/middleware/scoped-db.ts +35 -4
  580. package/src/astro/middleware.ts +56 -22
  581. package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
  582. package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
  583. package/src/astro/routes/api/auth/invite/index.ts +2 -2
  584. package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
  585. package/src/astro/routes/api/auth/signup/request.ts +2 -2
  586. package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
  587. package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
  588. package/src/astro/routes/api/schema/index.ts +2 -0
  589. package/src/astro/routes/api/search/enable.ts +5 -1
  590. package/src/astro/routes/api/search/rebuild.ts +6 -1
  591. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
  592. package/src/astro/types.ts +6 -0
  593. package/src/cleanup.ts +31 -26
  594. package/src/cli/commands/dev.ts +13 -3
  595. package/src/cli/commands/export-seed.ts +2 -0
  596. package/src/cli/index.ts +1 -1
  597. package/src/components/CommentForm.astro +1 -1
  598. package/src/components/Comments.astro +1 -1
  599. package/src/components/InlinePortableTextEditor.tsx +171 -31
  600. package/src/components/OrderedList.astro +14 -0
  601. package/src/components/PortableText.astro +26 -4
  602. package/src/components/index.ts +12 -1
  603. package/src/components/ordered-list.ts +549 -0
  604. package/src/content/converters/numbered-list.ts +148 -0
  605. package/src/content/converters/portable-text-to-prosemirror.ts +59 -9
  606. package/src/content/converters/prosemirror-to-portable-text.ts +23 -12
  607. package/src/content/converters/types.ts +2 -0
  608. package/src/content/portable-text-lists.ts +205 -0
  609. package/src/database/dialect-helpers.ts +3 -22
  610. package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
  611. package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
  612. package/src/database/migrations/057_collection_hidden.ts +24 -0
  613. package/src/database/migrations/058_collection_sort_order.ts +20 -0
  614. package/src/database/migrations/059_revision_prune_queue.ts +36 -0
  615. package/src/database/migrations/runner.ts +10 -0
  616. package/src/database/repositories/content.ts +191 -178
  617. package/src/database/repositories/revision.ts +82 -17
  618. package/src/database/repositories/taxonomy.ts +202 -7
  619. package/src/database/repositories/types.ts +7 -0
  620. package/src/database/types.ts +13 -1
  621. package/src/database/validate.ts +39 -0
  622. package/src/db/adapters.ts +8 -0
  623. package/src/deferred-tasks.ts +71 -0
  624. package/src/emdash-runtime.ts +268 -92
  625. package/src/index.ts +2 -0
  626. package/src/loader.ts +46 -24
  627. package/src/media/usage/gc.ts +50 -0
  628. package/src/object-cache/index.ts +160 -3
  629. package/src/plugins/routes.ts +34 -0
  630. package/src/plugins/storage-indexes.ts +50 -11
  631. package/src/query.ts +21 -42
  632. package/src/redirects/cache.ts +79 -19
  633. package/src/request-context.ts +3 -0
  634. package/src/scheduled-publish.ts +6 -1
  635. package/src/schema/registry.ts +95 -3
  636. package/src/schema/types.ts +24 -0
  637. package/src/search/fts-manager.ts +50 -10
  638. package/src/search/index.ts +2 -0
  639. package/src/search/types.ts +6 -0
  640. package/src/seed/apply.ts +22 -2
  641. package/src/seed/types.ts +10 -0
  642. package/src/taxonomies/index.ts +11 -7
  643. package/src/taxonomies/term-counts.ts +2 -4
  644. package/src/ui-comments.ts +19 -0
  645. package/src/ui.ts +11 -3
  646. package/src/virtual-modules.d.ts +8 -0
  647. package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
  648. package/dist/after-B1IIdH3Y.mjs +0 -29
  649. package/dist/after-B1IIdH3Y.mjs.map +0 -1
  650. package/dist/api-DgPbMlng.mjs.map +0 -1
  651. package/dist/apply-1_6ra7NP.mjs.map +0 -1
  652. package/dist/cache-B26cufFd.mjs +0 -65
  653. package/dist/cache-B26cufFd.mjs.map +0 -1
  654. package/dist/content-CpfKV9QE.mjs.map +0 -1
  655. package/dist/dialect-helpers-DFwyWjTM.mjs.map +0 -1
  656. package/dist/errors-DtEXIQQV.mjs.map +0 -1
  657. package/dist/fts-manager-vncsZIJm.mjs.map +0 -1
  658. package/dist/index-j9rTh3cp.d.mts.map +0 -1
  659. package/dist/loader-C1XOLV5b.mjs.map +0 -1
  660. package/dist/menus-C6qhqP4X.mjs.map +0 -1
  661. package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
  662. package/dist/public-url-DSGTnJFw.mjs.map +0 -1
  663. package/dist/query-DCiXI7OZ.mjs.map +0 -1
  664. package/dist/redirects-BOn2DIUs.mjs.map +0 -1
  665. package/dist/registry-BP1JK2xh.mjs.map +0 -1
  666. package/dist/relations-DHFQGX0h.d.mts.map +0 -1
  667. package/dist/runner-BsI18UgP.mjs.map +0 -1
  668. package/dist/site-url-8N3kSyVZ.mjs +0 -13
  669. package/dist/site-url-8N3kSyVZ.mjs.map +0 -1
  670. package/dist/taxonomies-B61CRSha.mjs.map +0 -1
  671. package/dist/taxonomies-Dbdki3Un.mjs.map +0 -1
  672. package/dist/taxonomy-DvwWAPvA.mjs.map +0 -1
  673. package/dist/types-84Bque3-.d.mts.map +0 -1
  674. package/dist/types-jISEalTX.d.mts.map +0 -1
  675. package/dist/types-o7xo7VgH.mjs.map +0 -1
  676. package/dist/validate-CdYcY-Ln.d.mts.map +0 -1
  677. package/dist/validate-VPnKoIzW.mjs.map +0 -1
  678. package/dist/version-Bdfb34kk.mjs +0 -7
  679. /package/dist/{api-tokens-CEsW_jCg.mjs → api-tokens-Dai9dND0.mjs} +0 -0
  680. /package/dist/{ssrf-BB__xfNM.mjs → ssrf-Cj568Dgs.mjs} +0 -0
  681. /package/dist/{types-CK0LxPUQ.mjs → types-DKuWPYV5.mjs} +0 -0
@@ -9,6 +9,11 @@ interface RevisionTable {
9
9
  author_id: string | null;
10
10
  created_at: Generated<string>;
11
11
  }
12
+ interface RevisionPruneQueueTable {
13
+ collection: string;
14
+ entry_id: string;
15
+ revision_id: string;
16
+ }
12
17
  interface TaxonomyTable {
13
18
  id: string;
14
19
  name: string;
@@ -18,6 +23,7 @@ interface TaxonomyTable {
18
23
  data: string | null;
19
24
  locale: Generated<string>;
20
25
  translation_group: string | null;
26
+ sort_order: Generated<number>;
21
27
  }
22
28
  interface ContentTaxonomyTable {
23
29
  collection: string;
@@ -259,6 +265,8 @@ interface CollectionTable {
259
265
  search_config: string | null;
260
266
  has_seo: number;
261
267
  url_pattern: string | null;
268
+ hidden: Generated<number>;
269
+ sort_order: number | null;
262
270
  comments_enabled: Generated<number>;
263
271
  comments_moderation: Generated<string>;
264
272
  comments_closed_after_days: Generated<number>;
@@ -424,6 +432,7 @@ interface SectionTable {
424
432
  }
425
433
  interface Database {
426
434
  revisions: RevisionTable;
435
+ _emdash_revision_prune_queue: RevisionPruneQueueTable;
427
436
  taxonomies: TaxonomyTable;
428
437
  content_taxonomies: ContentTaxonomyTable;
429
438
  _emdash_taxonomy_defs: TaxonomyDefTable;
@@ -599,4 +608,4 @@ interface RateLimitTable {
599
608
  }
600
609
  //#endregion
601
610
  export { MediaTable as n, UserTable as r, Database as t };
602
- //# sourceMappingURL=types-84Bque3-.d.mts.map
611
+ //# sourceMappingURL=types-Dc4ntQjQ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-Dc4ntQjQ.d.mts","names":[],"sources":["../src/database/types.ts"],"mappings":";;;UAMiB,aAAA;EAChB,EAAA;EACA,UAAA;EACA,QAAA;EACA,IAAA;EACA,SAAA;EACA,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,uBAAA;EAChB,UAAA;EACA,QAAA;EACA,WAAA;AAAA;AAAA,UAGgB,aAAA;EAChB,EAAA;EACA,IAAA;EACA,IAAA;EACA,KAAA;EACA,SAAA;EACA,IAAA;EACA,MAAA,EAAQ,SAAA;EACR,iBAAA;EAGA,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,oBAAA;EAChB,UAAA;EACA,QAAA;EACA,WAAA;EAgBA,MAAA,EAAQ,SAAA;EACR,YAAA,EAAc,SAAA;EACd,UAAA,EAAY,SAAA;EACZ,MAAA,EAAQ,SAAA;EACR,YAAA,EAAc,SAAA;EACd,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,gBAAA;EAChB,EAAA;EACA,IAAA;EACA,KAAA;EACA,cAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA,EAAY,SAAA;EACZ,MAAA,EAAQ,SAAA;EACR,iBAAA;AAAA;AAAA,UAGgB,U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;AAAA,UAGI,qBAAA;EAChB,SAAA;EACA,QAAA;EAhRiB;EAkRjB,KAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,0BAAA;EAChB,iBAAA;EACA,QAAA;EA1RY;EA4RZ,KAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAUI,aAAA;EAChB,EAAA;EACA,IAAA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,WAAA;EACA,MAAA,EAAQ,SAAA;EACR,iBAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,qBAAA;EAChB,EAAA;EAvSA;EAySA,cAAA;EAvSA;EAySA,YAAA;EAxSY;EA0SZ,WAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAKI,cAAA;EAChB,GAAA;EACA,MAAA;EACA,KAAA;AAAA"}
@@ -72,4 +72,4 @@ interface SiteSettings {
72
72
  type SiteSettingKey = keyof SiteSettings;
73
73
  //#endregion
74
74
  export { SiteSettings as i, SeoSettings as n, SiteSettingKey as r, MediaReference as t };
75
- //# sourceMappingURL=types-DQLZ58GV.d.mts.map
75
+ //# sourceMappingURL=types-LoagAGzH.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DQLZ58GV.d.mts","names":[],"sources":["../src/settings/types.ts"],"mappings":";;AAyBA;;;;;;;;;;;;AAcA;;;;;;;;;;;UAdiB,cAAA;EAChB,OAAA;EACA,GAAA;;EAEA,GAAA;EA6BU;EA3BV,WAAA;EAgDiB;EA9CjB,KAAA;EAsBA;EApBA,MAAA;AAAA;;UAIgB,WAAA;EAmBN;EAjBV,cAAA;EAuBA;EArBA,cAAA,GAAiB,cAAA;EAuBjB;EArBA,SAAA;EAyBC;EAvBD,kBAAA;EAyBC;EAvBD,gBAAA;AAAA;;UAIgB,YAAA;EAEhB,KAAA;EACA,OAAA;EACA,IAAA,GAAO,cAAA;EACP,OAAA,GAAU,cAAA;EAGV,GAAA;EAGA,YAAA;EACA,UAAA;EACA,QAAA;EAGA,MAAA;IACC,OAAA;IACA,MAAA;IACA,QAAA;IACA,SAAA;IACA,QAAA;IACA,OAAA;EAAA;EAID,GAAA,GAAM,WAAA;AAAA;;KAIK,cAAA,SAAuB,YAAA"}
1
+ {"version":3,"file":"types-LoagAGzH.d.mts","names":[],"sources":["../src/settings/types.ts"],"mappings":";;AAyBA;;;;;;;;;;;;AAcA;;;;;;;;;;;UAdiB,cAAA;EAChB,OAAA;EACA,GAAA;;EAEA,GAAA;EA6BU;EA3BV,WAAA;EAgDiB;EA9CjB,KAAA;EAsBA;EApBA,MAAA;AAAA;;UAIgB,WAAA;EAmBN;EAjBV,cAAA;EAuBA;EArBA,cAAA,GAAiB,cAAA;EAuBjB;EArBA,SAAA;EAyBC;EAvBD,kBAAA;EAyBC;EAvBD,gBAAA;AAAA;;UAIgB,YAAA;EAEhB,KAAA;EACA,OAAA;EACA,IAAA,GAAO,cAAA;EACP,OAAA,GAAU,cAAA;EAGV,GAAA;EAGA,YAAA;EACA,UAAA;EACA,QAAA;EAGA,MAAA;IACC,OAAA;IACA,MAAA;IACA,QAAA;IACA,SAAA;IACA,QAAA;IACA,OAAA;EAAA;EAID,GAAA,GAAM,WAAA;AAAA;;KAIK,cAAA,SAAuB,YAAA"}
@@ -75,7 +75,8 @@ const RESERVED_COLLECTION_SLUGS = [
75
75
  "revisions",
76
76
  "taxonomies",
77
77
  "options",
78
- "audit_logs"
78
+ "audit_logs",
79
+ "reorder"
79
80
  ];
80
81
  const BYLINE_FIELD_TYPES = [
81
82
  "string",
@@ -122,4 +123,4 @@ const RESERVED_BYLINE_FIELD_SLUGS = [
122
123
 
123
124
  //#endregion
124
125
  export { RESERVED_COLLECTION_SLUGS as a, RESERVED_BYLINE_FIELD_SLUGS as i, FIELD_TYPES as n, RESERVED_FIELD_SLUGS as o, FIELD_TYPE_TO_COLUMN as r, BYLINE_FIELD_TYPES as t };
125
- //# sourceMappingURL=types-o7xo7VgH.mjs.map
126
+ //# sourceMappingURL=types-NBI3rF-_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-NBI3rF-_.mjs","names":[],"sources":["../src/schema/types.ts"],"sourcesContent":["/**\n * Schema Registry Types\n *\n * These types represent the schema definitions stored in D1.\n * They are the source of truth for all collections and fields.\n */\n\n/**\n * Supported field types\n */\nexport type FieldType =\n\t| \"string\"\n\t| \"text\"\n\t| \"url\"\n\t| \"number\"\n\t| \"integer\"\n\t| \"boolean\"\n\t| \"datetime\"\n\t| \"select\"\n\t| \"multiSelect\"\n\t| \"portableText\"\n\t| \"image\"\n\t| \"file\"\n\t| \"reference\"\n\t| \"json\"\n\t| \"slug\"\n\t| \"repeater\";\n\n/**\n * Array of all field types for validation\n */\nexport const FIELD_TYPES: readonly FieldType[] = [\n\t\"string\",\n\t\"text\",\n\t\"url\",\n\t\"number\",\n\t\"integer\",\n\t\"boolean\",\n\t\"datetime\",\n\t\"select\",\n\t\"multiSelect\",\n\t\"portableText\",\n\t\"image\",\n\t\"file\",\n\t\"reference\",\n\t\"json\",\n\t\"slug\",\n\t\"repeater\",\n] as const;\n\n/**\n * SQLite column types that map from field types\n */\nexport type ColumnType = \"TEXT\" | \"REAL\" | \"INTEGER\" | \"JSON\";\n\n/**\n * Map field types to their SQLite column types\n */\nexport const FIELD_TYPE_TO_COLUMN: Record<FieldType, ColumnType> = {\n\tstring: \"TEXT\",\n\ttext: \"TEXT\",\n\tnumber: \"REAL\",\n\tinteger: \"INTEGER\",\n\tboolean: \"INTEGER\",\n\tdatetime: \"TEXT\",\n\tselect: \"TEXT\",\n\tmultiSelect: \"JSON\",\n\tportableText: \"JSON\",\n\timage: \"TEXT\",\n\tfile: \"TEXT\",\n\treference: \"TEXT\",\n\tjson: \"JSON\",\n\tslug: \"TEXT\",\n\turl: \"TEXT\",\n\trepeater: \"JSON\",\n};\n\n/**\n * Features a collection can support\n */\nexport type CollectionSupport =\n\t| \"drafts\"\n\t| \"revisions\"\n\t| \"preview\"\n\t| \"scheduling\"\n\t| \"search\"\n\t| \"seo\";\n\n/**\n * Sources for how a collection was created\n */\nexport type CollectionSource =\n\t| `template:${string}`\n\t| `import:${string}`\n\t| \"manual\"\n\t| \"discovered\"\n\t| \"seed\";\n\n/**\n * Validation rules for a field\n */\n/** Sub-field definition for repeater fields */\nexport interface RepeaterSubField {\n\tslug: string;\n\ttype:\n\t\t| \"string\"\n\t\t| \"text\"\n\t\t| \"url\"\n\t\t| \"number\"\n\t\t| \"integer\"\n\t\t| \"boolean\"\n\t\t| \"datetime\"\n\t\t| \"select\"\n\t\t| \"image\";\n\tlabel: string;\n\trequired?: boolean;\n\toptions?: string[]; // For select sub-fields\n}\n\n/** Allowed types for repeater sub-fields (no nesting, no complex types) */\nexport const REPEATER_SUB_FIELD_TYPES = [\n\t\"string\",\n\t\"text\",\n\t\"url\",\n\t\"number\",\n\t\"integer\",\n\t\"boolean\",\n\t\"datetime\",\n\t\"select\",\n\t\"image\",\n] as const;\n\nexport interface FieldValidation {\n\trequired?: boolean;\n\tmin?: number;\n\tmax?: number;\n\tminLength?: number;\n\tmaxLength?: number;\n\tpattern?: string;\n\toptions?: string[]; // For select/multiSelect\n\tsubFields?: RepeaterSubField[]; // For repeater fields\n\tminItems?: number; // For repeater fields\n\tmaxItems?: number; // For repeater fields\n\tallowedMimeTypes?: string[];\n}\n\n/**\n * Widget options for field rendering\n */\nexport interface FieldWidgetOptions {\n\trows?: number; // For textarea\n\tshowPreview?: boolean; // For image/file\n\tcollection?: string; // For reference - which collection to reference\n\tallowMultiple?: boolean; // For reference\n\t[key: string]: unknown;\n}\n\n/**\n * A collection definition\n */\nexport interface Collection {\n\tid: string;\n\tslug: string;\n\tlabel: string;\n\tlabelSingular?: string;\n\tdescription?: string;\n\ticon?: string;\n\tsupports: CollectionSupport[];\n\tsource?: CollectionSource;\n\t/** Whether this collection has SEO metadata fields enabled */\n\thasSeo: boolean;\n\t/** URL pattern with {slug} placeholder (e.g. \"/{slug}\", \"/blog/{slug}\") */\n\turlPattern?: string;\n\t/**\n\t * Omit this collection's auto-generated entry from the admin sidebar.\n\t * The collection stays fully functional everywhere else (API, MCP, hooks,\n\t * direct `/content/:collection` URLs) — this only hides the nav link, so a\n\t * plugin that owns the collection can point editors at its own admin UI.\n\t */\n\thidden: boolean;\n\t/**\n\t * Explicit position in the admin sidebar. Collections with a `sortOrder`\n\t * come first, in ascending order; the rest keep the alphabetical-by-slug\n\t * order and follow. `undefined` means \"no explicit position\".\n\t */\n\tsortOrder?: number;\n\t/** Whether comments are enabled for this collection */\n\tcommentsEnabled: boolean;\n\t/** Moderation strategy: \"all\" | \"first_time\" | \"none\" */\n\tcommentsModeration: \"all\" | \"first_time\" | \"none\";\n\t/** Auto-close comments after N days. 0 = never close. */\n\tcommentsClosedAfterDays: number;\n\t/** Auto-approve comments from authenticated CMS users */\n\tcommentsAutoApproveUsers: boolean;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\n/**\n * A field definition\n */\nexport interface Field {\n\tid: string;\n\tcollectionId: string;\n\tslug: string;\n\tlabel: string;\n\ttype: FieldType;\n\tcolumnType: ColumnType;\n\trequired: boolean;\n\tunique: boolean;\n\tdefaultValue?: unknown;\n\tvalidation?: FieldValidation;\n\twidget?: string;\n\toptions?: FieldWidgetOptions;\n\tsortOrder: number;\n\tsearchable: boolean;\n\t/** Whether this field is translatable (default true). Non-translatable fields are synced across locales. */\n\ttranslatable: boolean;\n\tcreatedAt: string;\n}\n\n/**\n * Input for creating a collection\n */\nexport interface CreateCollectionInput {\n\tslug: string;\n\tlabel: string;\n\tlabelSingular?: string;\n\tdescription?: string;\n\ticon?: string;\n\tsupports?: CollectionSupport[];\n\tsource?: CollectionSource;\n\turlPattern?: string;\n\thasSeo?: boolean;\n\t/** Omit the auto-generated admin sidebar entry (defaults to false) */\n\thidden?: boolean;\n\t/** Explicit admin sidebar position (omit for the alphabetical fallback) */\n\tsortOrder?: number | null;\n\tcommentsEnabled?: boolean;\n}\n\n/**\n * Input for updating a collection\n */\nexport interface UpdateCollectionInput {\n\tlabel?: string;\n\tlabelSingular?: string;\n\tdescription?: string;\n\ticon?: string;\n\tsupports?: CollectionSupport[];\n\turlPattern?: string;\n\thasSeo?: boolean;\n\t/** Omit the auto-generated admin sidebar entry */\n\thidden?: boolean;\n\t/** Explicit admin sidebar position; `null` clears it back to alphabetical */\n\tsortOrder?: number | null;\n\tcommentsEnabled?: boolean;\n\tcommentsModeration?: \"all\" | \"first_time\" | \"none\";\n\tcommentsClosedAfterDays?: number;\n\tcommentsAutoApproveUsers?: boolean;\n}\n\n/**\n * Input for creating a field\n */\nexport interface CreateFieldInput {\n\tslug: string;\n\tlabel: string;\n\ttype: FieldType;\n\trequired?: boolean;\n\tunique?: boolean;\n\tdefaultValue?: unknown;\n\tvalidation?: FieldValidation | null;\n\twidget?: string;\n\toptions?: FieldWidgetOptions;\n\tsortOrder?: number;\n\t/** Whether this field should be indexed for search */\n\tsearchable?: boolean;\n\t/** Whether this field is translatable (default true). Non-translatable fields are synced across locales. */\n\ttranslatable?: boolean;\n}\n\n/**\n * Input for updating a field\n */\nexport interface UpdateFieldInput {\n\tlabel?: string;\n\t/**\n\t * Change the field's type. Only type changes that keep the same underlying\n\t * column type (per `FIELD_TYPE_TO_COLUMN`) are allowed — e.g. `string` to\n\t * `slug` (both TEXT). A change that would alter the column affinity (e.g.\n\t * `text` TEXT to `portableText` JSON) is rejected, because there is no\n\t * in-place column migration and silently rewriting the metadata would\n\t * desync `column_type` from the real `ec_*` column. Omit to keep the\n\t * current type.\n\t */\n\ttype?: FieldType;\n\trequired?: boolean;\n\tunique?: boolean;\n\tdefaultValue?: unknown;\n\tvalidation?: FieldValidation | null;\n\twidget?: string;\n\toptions?: FieldWidgetOptions;\n\tsortOrder?: number;\n\t/** Whether this field should be indexed for search */\n\tsearchable?: boolean;\n\t/** Whether this field is translatable (default true). Non-translatable fields are synced across locales. */\n\ttranslatable?: boolean;\n}\n\n/**\n * A collection with its fields\n */\nexport interface CollectionWithFields extends Collection {\n\tfields: Field[];\n}\n\n/**\n * Reserved field slugs that cannot be used.\n *\n * Includes names reserved for runtime hydration (`terms`, `bylines`, `byline`)\n * so user-defined fields never shadow the auto-hydrated values on entry.data.\n */\nexport const RESERVED_FIELD_SLUGS = [\n\t\"id\",\n\t\"slug\",\n\t\"status\",\n\t\"author_id\",\n\t\"primary_byline_id\",\n\t\"created_at\",\n\t\"updated_at\",\n\t\"published_at\",\n\t\"scheduled_at\",\n\t\"deleted_at\",\n\t\"version\",\n\t\"live_revision_id\",\n\t\"draft_revision_id\",\n\t// Runtime-hydrated fields\n\t\"terms\",\n\t\"bylines\",\n\t\"byline\",\n];\n\n/**\n * Reserved collection slugs that cannot be used\n */\nexport const RESERVED_COLLECTION_SLUGS = [\n\t\"content\",\n\t\"media\",\n\t\"users\",\n\t\"revisions\",\n\t\"taxonomies\",\n\t\"options\",\n\t\"audit_logs\",\n\t// Shadowed by the static POST /schema/collections/reorder route: a\n\t// collection with this slug could never be addressed at its own URL.\n\t\"reorder\",\n];\n\n/**\n * Byline custom fields (Discussion #1174).\n *\n * Sites declare site-specific byline metadata (`job_title`, `pronouns`,\n * `twitter_handle`, `company`, …) without touching emdash core. Definitions\n * live in `_emdash_byline_fields`; values in either\n * `_emdash_byline_field_values` (translatable, keyed by `byline_id`) or\n * `_emdash_byline_field_group_values` (non-translatable, keyed by\n * `translation_group`). The per-field `translatable` flag decides which\n * value table is used. See migration 041.\n */\n\n/**\n * The five v1 field types supported on byline custom fields. Deliberately\n * narrower than the content `FieldType` union — bylines don't need\n * `portableText`, `reference`, `image`, etc. v2 may extend this; v1 keeps\n * the storage and UI surfaces small.\n */\nexport type BylineFieldType = \"string\" | \"text\" | \"url\" | \"boolean\" | \"select\";\n\nexport const BYLINE_FIELD_TYPES: readonly BylineFieldType[] = [\n\t\"string\",\n\t\"text\",\n\t\"url\",\n\t\"boolean\",\n\t\"select\",\n] as const;\n\n/**\n * Validation rules for a byline custom field. v1 only exposes `options`\n * (the choice list for `select` fields). The shape mirrors the content-\n * field convention so the admin UI patterns transfer.\n */\nexport interface BylineFieldValidation {\n\t/** Choices for `select`-type fields. Ignored for other types. */\n\toptions?: string[];\n}\n\n/**\n * Runtime shape of a registered byline custom field. Stored in\n * `_emdash_byline_fields` (see migration 041).\n */\nexport interface BylineFieldDefinition {\n\tid: string;\n\tslug: string;\n\tlabel: string;\n\ttype: BylineFieldType;\n\trequired: boolean;\n\t/**\n\t * Whether values are stored per-locale (`true`, in\n\t * `_emdash_byline_field_values` keyed by `byline_id`) or shared across\n\t * every locale variant of the same byline identity (`false`, in\n\t * `_emdash_byline_field_group_values` keyed by `translation_group`).\n\t * Defaults to `true` at the DB level.\n\t */\n\ttranslatable: boolean;\n\tvalidation: BylineFieldValidation | null;\n\tsortOrder: number;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\n/**\n * Input for creating a byline custom field. `slug` and `type` are not\n * updatable post-create — changing either would invalidate stored values.\n */\nexport interface CreateBylineFieldInput {\n\tslug: string;\n\tlabel: string;\n\ttype: BylineFieldType;\n\trequired?: boolean;\n\ttranslatable?: boolean;\n\tvalidation?: BylineFieldValidation | null;\n\tsortOrder?: number;\n}\n\n/**\n * Input for updating a byline custom field. `slug` and `type` are\n * intentionally not present — see `CreateBylineFieldInput`.\n */\nexport interface UpdateBylineFieldInput {\n\tlabel?: string;\n\trequired?: boolean;\n\ttranslatable?: boolean;\n\tvalidation?: BylineFieldValidation | null;\n\tsortOrder?: number;\n}\n\n/**\n * Runtime value type for a byline custom field. The narrow union mirrors\n * what the five v1 field types can produce: `string`/`text`/`url`/`select`\n * → string, `boolean` → boolean, plus `null` for cleared values.\n */\nexport type CustomFieldValue = string | boolean | null;\n\n/**\n * Reserved byline-field slugs. Two reasons a slug ends up here:\n *\n * 1. **Column collision.** Slugs that match a fixed column on\n * `_emdash_bylines` (migrations 031 + 040) would shadow that column\n * on hydration. The first 12 entries cover this.\n * 2. **Route collision.** Static file routes under\n * `/_emdash/api/admin/byline-fields/` take precedence over the\n * `[slug].ts` dynamic route in Astro, so a custom field whose slug\n * matches a sibling static file (e.g. `reorder.ts`) is unreachable\n * via single-field CRUD — the static route handles only its own\n * method (POST for `reorder`) and 405s everything else.\n * `reorder` is the only such sibling today; new sibling routes\n * (e.g. a hypothetical `import.ts`) must be added here.\n * `[slug]/usage.ts` lives a level deeper so a slug of `usage` does\n * not collide — it resolves cleanly to `[slug].ts`.\n *\n * Enforced at the registry layer (Phase 2) and the admin API zod layer\n * (Phase 4) so non-HTTP callers (seeds, scripts) get the same guarantee.\n */\nexport const RESERVED_BYLINE_FIELD_SLUGS = [\n\t// 1. Column-collision slugs (matches `_emdash_bylines` fixed columns).\n\t\"id\",\n\t\"slug\",\n\t\"display_name\",\n\t\"bio\",\n\t\"avatar_media_id\",\n\t\"website_url\",\n\t\"user_id\",\n\t\"is_guest\",\n\t\"locale\",\n\t\"translation_group\",\n\t\"created_at\",\n\t\"updated_at\",\n\t// 2. Route-collision slugs (matches static sibling files of `[slug].ts`).\n\t\"reorder\",\n] as const;\n"],"mappings":";;;;AA+BA,MAAa,cAAoC;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;AAUD,MAAa,uBAAsD;CAClE,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,SAAS;CACT,SAAS;CACT,UAAU;CACV,QAAQ;CACR,aAAa;CACb,cAAc;CACd,OAAO;CACP,MAAM;CACN,WAAW;CACX,MAAM;CACN,MAAM;CACN,KAAK;CACL,UAAU;CACV;;;;;;;AAwPD,MAAa,uBAAuB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;;;;AAKD,MAAa,4BAA4B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;AAsBD,MAAa,qBAAiD;CAC7D;CACA;CACA;CACA;CACA;CACA;;;;;;;;;;;;;;;;;;;;;AAyFD,MAAa,8BAA8B;CAE1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA"}
@@ -24,4 +24,4 @@ async function removeUploadAttempt(storage, repo, storageKey, options = {}) {
24
24
 
25
25
  //#endregion
26
26
  export { removeUploadAttempt as t };
27
- //# sourceMappingURL=upload-attempts-C5yd6Gae.mjs.map
27
+ //# sourceMappingURL=upload-attempts-D8QAFLUJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"upload-attempts-C5yd6Gae.mjs","names":[],"sources":["../src/media/upload-attempts.ts"],"sourcesContent":["import type { MediaRepository } from \"../database/repositories/media.js\";\nimport type { Storage } from \"../storage/types.js\";\n\nexport async function removeUploadAttempt(\n\tstorage: Storage,\n\trepo: MediaRepository,\n\tstorageKey: string,\n\toptions: { allowUntracked?: boolean } = {},\n): Promise<boolean> {\n\ttry {\n\t\tif (!(await repo.claimUploadAttemptForCleanup(storageKey))) {\n\t\t\tconst tracked = await repo.hasUploadAttempt(storageKey);\n\t\t\tif (tracked || !options.allowUntracked) return false;\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup claim failed:\", error);\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tawait storage.delete(storageKey);\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup failed:\", error);\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tawait repo.deleteUploadAttempt(storageKey);\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup record deletion failed:\", error);\n\t}\n\treturn true;\n}\n"],"mappings":";AAGA,eAAsB,oBACrB,SACA,MACA,YACA,UAAwC,EAAE,EACvB;AACnB,KAAI;AACH,MAAI,CAAE,MAAM,KAAK,6BAA6B,WAAW,EAExD;OADgB,MAAM,KAAK,iBAAiB,WAAW,IACxC,CAAC,QAAQ,eAAgB,QAAO;;UAExC,OAAO;AACf,UAAQ,MAAM,wCAAwC,MAAM;AAC5D,SAAO;;AAGR,KAAI;AACH,QAAM,QAAQ,OAAO,WAAW;UACxB,OAAO;AACf,UAAQ,MAAM,kCAAkC,MAAM;AACtD,SAAO;;AAGR,KAAI;AACH,QAAM,KAAK,oBAAoB,WAAW;UAClC,OAAO;AACf,UAAQ,MAAM,kDAAkD,MAAM;;AAEvE,QAAO"}
1
+ {"version":3,"file":"upload-attempts-D8QAFLUJ.mjs","names":[],"sources":["../src/media/upload-attempts.ts"],"sourcesContent":["import type { MediaRepository } from \"../database/repositories/media.js\";\nimport type { Storage } from \"../storage/types.js\";\n\nexport async function removeUploadAttempt(\n\tstorage: Storage,\n\trepo: MediaRepository,\n\tstorageKey: string,\n\toptions: { allowUntracked?: boolean } = {},\n): Promise<boolean> {\n\ttry {\n\t\tif (!(await repo.claimUploadAttemptForCleanup(storageKey))) {\n\t\t\tconst tracked = await repo.hasUploadAttempt(storageKey);\n\t\t\tif (tracked || !options.allowUntracked) return false;\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup claim failed:\", error);\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tawait storage.delete(storageKey);\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup failed:\", error);\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tawait repo.deleteUploadAttempt(storageKey);\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup record deletion failed:\", error);\n\t}\n\treturn true;\n}\n"],"mappings":";AAGA,eAAsB,oBACrB,SACA,MACA,YACA,UAAwC,EAAE,EACvB;AACnB,KAAI;AACH,MAAI,CAAE,MAAM,KAAK,6BAA6B,WAAW,EAExD;OADgB,MAAM,KAAK,iBAAiB,WAAW,IACxC,CAAC,QAAQ,eAAgB,QAAO;;UAExC,OAAO;AACf,UAAQ,MAAM,wCAAwC,MAAM;AAC5D,SAAO;;AAGR,KAAI;AACH,QAAM,QAAQ,OAAO,WAAW;UACxB,OAAO;AACf,UAAQ,MAAM,kCAAkC,MAAM;AACtD,SAAO;;AAGR,KAAI;AACH,QAAM,KAAK,oBAAoB,WAAW;UAClC,OAAO;AACf,UAAQ,MAAM,kDAAkD,MAAM;;AAEvE,QAAO"}
@@ -1,5 +1,5 @@
1
- import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-D5dlPeRb.mjs";
2
- import { a as encodeCursor, i as decodeCursor } from "./types-XrQQ-Aex.mjs";
1
+ import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DbYzib_k.mjs";
2
+ import { a as decodeCursor, o as encodeCursor } from "./types-Cd8iuS1J.mjs";
3
3
  import { ulid } from "ulidx";
4
4
 
5
5
  //#region src/database/repositories/user.ts
@@ -168,4 +168,4 @@ var UserRepository = class UserRepository {
168
168
 
169
169
  //#endregion
170
170
  export { UserRepository as t };
171
- //# sourceMappingURL=user-BAumEmpA.mjs.map
171
+ //# sourceMappingURL=user-DBrq4UVq.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-BAumEmpA.mjs","names":[],"sources":["../src/database/repositories/user.ts"],"sourcesContent":["import type { Kysely, Selectable, Updateable } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { chunks, SQL_BATCH_SIZE } from \"../../utils/chunks.js\";\nimport type { Database, UserTable } from \"../types.js\";\nimport { encodeCursor, decodeCursor, type FindManyResult } from \"./types.js\";\n\ntype UserRow = Selectable<UserTable>;\n\n/**\n * Valid role levels matching the database schema.\n * 10=subscriber, 20=contributor, 30=author, 40=editor, 50=admin\n */\nexport type UserRole = 10 | 20 | 30 | 40 | 50;\n\n/** String role names for convenience APIs */\nexport type UserRoleName = \"subscriber\" | \"contributor\" | \"author\" | \"editor\" | \"admin\";\n\nexport interface User {\n\tid: string;\n\temail: string;\n\tname: string | null;\n\trole: UserRole;\n\tavatarUrl: string | null;\n\temailVerified: boolean;\n\tdata: Record<string, unknown> | null;\n\tcreatedAt: string;\n}\n\nexport interface CreateUserInput {\n\temail: string;\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string;\n\tdata?: Record<string, unknown>;\n}\n\nexport interface UpdateUserInput {\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string | null;\n\tdata?: Record<string, unknown>;\n}\n\n/**\n * User repository for CRUD operations\n */\nexport class UserRepository {\n\tconstructor(private db: Kysely<Database>) {}\n\n\t/**\n\t * Create a new user\n\t */\n\tasync create(input: CreateUserInput): Promise<User> {\n\t\tconst id = ulid();\n\n\t\tconst row: Omit<UserTable, \"created_at\" | \"updated_at\" | \"disabled\"> = {\n\t\t\tid,\n\t\t\temail: input.email.toLowerCase(),\n\t\t\tname: input.name ?? null,\n\t\t\trole: UserRepository.resolveRole(input.role ?? 10),\n\t\t\tavatar_url: input.avatarUrl ?? null,\n\t\t\temail_verified: 0,\n\t\t\tdata: input.data ? JSON.stringify(input.data) : null,\n\t\t};\n\n\t\tawait this.db.insertInto(\"users\").values(row).execute();\n\n\t\tconst user = await this.findById(id);\n\t\tif (!user) {\n\t\t\tthrow new Error(\"Failed to create user\");\n\t\t}\n\t\treturn user;\n\t}\n\n\t/**\n\t * Find user by ID\n\t */\n\tasync findById(id: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"id\", \"=\", id)\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * Batch-resolve users by ID. Returns only the users that exist; missing\n\t * IDs are silently dropped. Chunked at `SQL_BATCH_SIZE` to stay within\n\t * D1's bind-parameter limit.\n\t */\n\tasync findByIds(ids: string[]): Promise<User[]> {\n\t\tconst unique = [...new Set(ids)].filter((id) => id.length > 0);\n\t\tif (unique.length === 0) return [];\n\n\t\tconst out: User[] = [];\n\t\tfor (const batch of chunks(unique, SQL_BATCH_SIZE)) {\n\t\t\tconst rows = await this.db.selectFrom(\"users\").selectAll().where(\"id\", \"in\", batch).execute();\n\t\t\tfor (const row of rows) out.push(this.rowToUser(row));\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t * Find user by email (case-insensitive)\n\t */\n\tasync findByEmail(email: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * List all users with cursor-based pagination\n\t */\n\tasync findMany(\n\t\toptions: {\n\t\t\trole?: UserRole | UserRoleName;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t} = {},\n\t): Promise<FindManyResult<User>> {\n\t\tconst limit = Math.min(Math.max(1, options.limit || 50), 100);\n\n\t\tlet query = this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.orderBy(\"created_at\", \"desc\")\n\t\t\t.orderBy(\"id\", \"desc\")\n\t\t\t.limit(limit + 1);\n\n\t\tif (options.role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(options.role));\n\t\t}\n\n\t\tif (options.cursor) {\n\t\t\tconst decoded = decodeCursor(options.cursor);\n\t\t\tquery = query.where((eb) =>\n\t\t\t\teb.or([\n\t\t\t\t\teb(\"created_at\", \"<\", decoded.orderValue),\n\t\t\t\t\teb.and([eb(\"created_at\", \"=\", decoded.orderValue), eb(\"id\", \"<\", decoded.id)]),\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\tconst rows = await query.execute();\n\t\tconst items = rows.slice(0, limit).map((row) => this.rowToUser(row));\n\t\tconst result: FindManyResult<User> = { items };\n\n\t\tif (rows.length > limit && items.length > 0) {\n\t\t\tconst last = items.at(-1)!;\n\t\t\tresult.nextCursor = encodeCursor(last.createdAt, last.id);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Update a user\n\t */\n\tasync update(id: string, input: UpdateUserInput): Promise<User | null> {\n\t\tconst existing = await this.findById(id);\n\t\tif (!existing) return null;\n\n\t\tconst updates: Updateable<UserTable> = {};\n\t\tif (input.name !== undefined) updates.name = input.name;\n\t\tif (input.role !== undefined) updates.role = UserRepository.resolveRole(input.role);\n\t\tif (input.avatarUrl !== undefined) updates.avatar_url = input.avatarUrl;\n\t\tif (input.data !== undefined) updates.data = JSON.stringify(input.data);\n\n\t\tif (Object.keys(updates).length > 0) {\n\t\t\tawait this.db.updateTable(\"users\").set(updates).where(\"id\", \"=\", id).execute();\n\t\t}\n\n\t\treturn this.findById(id);\n\t}\n\n\t/**\n\t * Delete a user\n\t */\n\tasync delete(id: string): Promise<boolean> {\n\t\tconst result = await this.db.deleteFrom(\"users\").where(\"id\", \"=\", id).executeTakeFirst();\n\n\t\treturn (result.numDeletedRows ?? 0) > 0;\n\t}\n\n\t/**\n\t * Count users\n\t */\n\tasync count(role?: UserRole | UserRoleName): Promise<number> {\n\t\tlet query = this.db.selectFrom(\"users\").select((eb) => eb.fn.count(\"id\").as(\"count\"));\n\n\t\tif (role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(role));\n\t\t}\n\n\t\tconst result = await query.executeTakeFirst();\n\t\treturn Number(result?.count || 0);\n\t}\n\n\t/**\n\t * Check if email exists\n\t */\n\tasync emailExists(email: string): Promise<boolean> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.select(\"id\")\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn !!row;\n\t}\n\n\t/**\n\t * Convert database row to User object\n\t */\n\tprivate rowToUser(row: UserRow): User {\n\t\treturn {\n\t\t\tid: row.id,\n\t\t\temail: row.email,\n\t\t\tname: row.name,\n\t\t\trole: UserRepository.toRole(row.role),\n\t\t\tavatarUrl: row.avatar_url,\n\t\t\temailVerified: row.email_verified === 1,\n\t\t\tdata: row.data ? JSON.parse(row.data) : null,\n\t\t\tcreatedAt: row.created_at,\n\t\t};\n\t}\n\n\t/** Map of role name strings to numeric levels */\n\tprivate static readonly ROLE_NAME_TO_LEVEL: Record<UserRoleName, UserRole> = {\n\t\tsubscriber: 10,\n\t\tcontributor: 20,\n\t\tauthor: 30,\n\t\teditor: 40,\n\t\tadmin: 50,\n\t};\n\n\t/** Valid numeric role levels */\n\tprivate static readonly VALID_LEVELS = new Set<number>([10, 20, 30, 40, 50]);\n\n\t/**\n\t * Resolve a role name or number to a valid numeric UserRole.\n\t * Accepts both string names (\"admin\") and numeric levels (50).\n\t */\n\tstatic resolveRole(role: UserRole | UserRoleName): UserRole {\n\t\tif (typeof role === \"string\") {\n\t\t\tconst level = UserRepository.ROLE_NAME_TO_LEVEL[role];\n\t\t\tif (level === undefined) {\n\t\t\t\tthrow new Error(`Invalid role name: ${role}`);\n\t\t\t}\n\t\t\treturn level;\n\t\t}\n\t\tif (!UserRepository.VALID_LEVELS.has(role)) {\n\t\t\tthrow new Error(`Invalid role level: ${role}`);\n\t\t}\n\t\treturn role;\n\t}\n\n\t/**\n\t * Convert a raw DB integer to a typed UserRole.\n\t * Falls back to subscriber (10) for unknown values.\n\t */\n\tprivate static toRole(level: number): UserRole {\n\t\tif (UserRepository.VALID_LEVELS.has(level)) return level as UserRole;\n\t\treturn 10;\n\t}\n}\n"],"mappings":";;;;;;;;AA+CA,IAAa,iBAAb,MAAa,eAAe;CAC3B,YAAY,AAAQ,IAAsB;EAAtB;;;;;CAKpB,MAAM,OAAO,OAAuC;EACnD,MAAM,KAAK,MAAM;EAEjB,MAAM,MAAiE;GACtE;GACA,OAAO,MAAM,MAAM,aAAa;GAChC,MAAM,MAAM,QAAQ;GACpB,MAAM,eAAe,YAAY,MAAM,QAAQ,GAAG;GAClD,YAAY,MAAM,aAAa;GAC/B,gBAAgB;GAChB,MAAM,MAAM,OAAO,KAAK,UAAU,MAAM,KAAK,GAAG;GAChD;AAED,QAAM,KAAK,GAAG,WAAW,QAAQ,CAAC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MAAI,eAAe,aAAa,IAAI,MAAM,CAAE,QAAO;AACnD,SAAO"}
1
+ {"version":3,"file":"user-DBrq4UVq.mjs","names":[],"sources":["../src/database/repositories/user.ts"],"sourcesContent":["import type { Kysely, Selectable, Updateable } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { chunks, SQL_BATCH_SIZE } from \"../../utils/chunks.js\";\nimport type { Database, UserTable } from \"../types.js\";\nimport { encodeCursor, decodeCursor, type FindManyResult } from \"./types.js\";\n\ntype UserRow = Selectable<UserTable>;\n\n/**\n * Valid role levels matching the database schema.\n * 10=subscriber, 20=contributor, 30=author, 40=editor, 50=admin\n */\nexport type UserRole = 10 | 20 | 30 | 40 | 50;\n\n/** String role names for convenience APIs */\nexport type UserRoleName = \"subscriber\" | \"contributor\" | \"author\" | \"editor\" | \"admin\";\n\nexport interface User {\n\tid: string;\n\temail: string;\n\tname: string | null;\n\trole: UserRole;\n\tavatarUrl: string | null;\n\temailVerified: boolean;\n\tdata: Record<string, unknown> | null;\n\tcreatedAt: string;\n}\n\nexport interface CreateUserInput {\n\temail: string;\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string;\n\tdata?: Record<string, unknown>;\n}\n\nexport interface UpdateUserInput {\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string | null;\n\tdata?: Record<string, unknown>;\n}\n\n/**\n * User repository for CRUD operations\n */\nexport class UserRepository {\n\tconstructor(private db: Kysely<Database>) {}\n\n\t/**\n\t * Create a new user\n\t */\n\tasync create(input: CreateUserInput): Promise<User> {\n\t\tconst id = ulid();\n\n\t\tconst row: Omit<UserTable, \"created_at\" | \"updated_at\" | \"disabled\"> = {\n\t\t\tid,\n\t\t\temail: input.email.toLowerCase(),\n\t\t\tname: input.name ?? null,\n\t\t\trole: UserRepository.resolveRole(input.role ?? 10),\n\t\t\tavatar_url: input.avatarUrl ?? null,\n\t\t\temail_verified: 0,\n\t\t\tdata: input.data ? JSON.stringify(input.data) : null,\n\t\t};\n\n\t\tawait this.db.insertInto(\"users\").values(row).execute();\n\n\t\tconst user = await this.findById(id);\n\t\tif (!user) {\n\t\t\tthrow new Error(\"Failed to create user\");\n\t\t}\n\t\treturn user;\n\t}\n\n\t/**\n\t * Find user by ID\n\t */\n\tasync findById(id: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"id\", \"=\", id)\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * Batch-resolve users by ID. Returns only the users that exist; missing\n\t * IDs are silently dropped. Chunked at `SQL_BATCH_SIZE` to stay within\n\t * D1's bind-parameter limit.\n\t */\n\tasync findByIds(ids: string[]): Promise<User[]> {\n\t\tconst unique = [...new Set(ids)].filter((id) => id.length > 0);\n\t\tif (unique.length === 0) return [];\n\n\t\tconst out: User[] = [];\n\t\tfor (const batch of chunks(unique, SQL_BATCH_SIZE)) {\n\t\t\tconst rows = await this.db.selectFrom(\"users\").selectAll().where(\"id\", \"in\", batch).execute();\n\t\t\tfor (const row of rows) out.push(this.rowToUser(row));\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t * Find user by email (case-insensitive)\n\t */\n\tasync findByEmail(email: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * List all users with cursor-based pagination\n\t */\n\tasync findMany(\n\t\toptions: {\n\t\t\trole?: UserRole | UserRoleName;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t} = {},\n\t): Promise<FindManyResult<User>> {\n\t\tconst limit = Math.min(Math.max(1, options.limit || 50), 100);\n\n\t\tlet query = this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.orderBy(\"created_at\", \"desc\")\n\t\t\t.orderBy(\"id\", \"desc\")\n\t\t\t.limit(limit + 1);\n\n\t\tif (options.role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(options.role));\n\t\t}\n\n\t\tif (options.cursor) {\n\t\t\tconst decoded = decodeCursor(options.cursor);\n\t\t\tquery = query.where((eb) =>\n\t\t\t\teb.or([\n\t\t\t\t\teb(\"created_at\", \"<\", decoded.orderValue),\n\t\t\t\t\teb.and([eb(\"created_at\", \"=\", decoded.orderValue), eb(\"id\", \"<\", decoded.id)]),\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\tconst rows = await query.execute();\n\t\tconst items = rows.slice(0, limit).map((row) => this.rowToUser(row));\n\t\tconst result: FindManyResult<User> = { items };\n\n\t\tif (rows.length > limit && items.length > 0) {\n\t\t\tconst last = items.at(-1)!;\n\t\t\tresult.nextCursor = encodeCursor(last.createdAt, last.id);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Update a user\n\t */\n\tasync update(id: string, input: UpdateUserInput): Promise<User | null> {\n\t\tconst existing = await this.findById(id);\n\t\tif (!existing) return null;\n\n\t\tconst updates: Updateable<UserTable> = {};\n\t\tif (input.name !== undefined) updates.name = input.name;\n\t\tif (input.role !== undefined) updates.role = UserRepository.resolveRole(input.role);\n\t\tif (input.avatarUrl !== undefined) updates.avatar_url = input.avatarUrl;\n\t\tif (input.data !== undefined) updates.data = JSON.stringify(input.data);\n\n\t\tif (Object.keys(updates).length > 0) {\n\t\t\tawait this.db.updateTable(\"users\").set(updates).where(\"id\", \"=\", id).execute();\n\t\t}\n\n\t\treturn this.findById(id);\n\t}\n\n\t/**\n\t * Delete a user\n\t */\n\tasync delete(id: string): Promise<boolean> {\n\t\tconst result = await this.db.deleteFrom(\"users\").where(\"id\", \"=\", id).executeTakeFirst();\n\n\t\treturn (result.numDeletedRows ?? 0) > 0;\n\t}\n\n\t/**\n\t * Count users\n\t */\n\tasync count(role?: UserRole | UserRoleName): Promise<number> {\n\t\tlet query = this.db.selectFrom(\"users\").select((eb) => eb.fn.count(\"id\").as(\"count\"));\n\n\t\tif (role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(role));\n\t\t}\n\n\t\tconst result = await query.executeTakeFirst();\n\t\treturn Number(result?.count || 0);\n\t}\n\n\t/**\n\t * Check if email exists\n\t */\n\tasync emailExists(email: string): Promise<boolean> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.select(\"id\")\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn !!row;\n\t}\n\n\t/**\n\t * Convert database row to User object\n\t */\n\tprivate rowToUser(row: UserRow): User {\n\t\treturn {\n\t\t\tid: row.id,\n\t\t\temail: row.email,\n\t\t\tname: row.name,\n\t\t\trole: UserRepository.toRole(row.role),\n\t\t\tavatarUrl: row.avatar_url,\n\t\t\temailVerified: row.email_verified === 1,\n\t\t\tdata: row.data ? JSON.parse(row.data) : null,\n\t\t\tcreatedAt: row.created_at,\n\t\t};\n\t}\n\n\t/** Map of role name strings to numeric levels */\n\tprivate static readonly ROLE_NAME_TO_LEVEL: Record<UserRoleName, UserRole> = {\n\t\tsubscriber: 10,\n\t\tcontributor: 20,\n\t\tauthor: 30,\n\t\teditor: 40,\n\t\tadmin: 50,\n\t};\n\n\t/** Valid numeric role levels */\n\tprivate static readonly VALID_LEVELS = new Set<number>([10, 20, 30, 40, 50]);\n\n\t/**\n\t * Resolve a role name or number to a valid numeric UserRole.\n\t * Accepts both string names (\"admin\") and numeric levels (50).\n\t */\n\tstatic resolveRole(role: UserRole | UserRoleName): UserRole {\n\t\tif (typeof role === \"string\") {\n\t\t\tconst level = UserRepository.ROLE_NAME_TO_LEVEL[role];\n\t\t\tif (level === undefined) {\n\t\t\t\tthrow new Error(`Invalid role name: ${role}`);\n\t\t\t}\n\t\t\treturn level;\n\t\t}\n\t\tif (!UserRepository.VALID_LEVELS.has(role)) {\n\t\t\tthrow new Error(`Invalid role level: ${role}`);\n\t\t}\n\t\treturn role;\n\t}\n\n\t/**\n\t * Convert a raw DB integer to a typed UserRole.\n\t * Falls back to subscriber (10) for unknown values.\n\t */\n\tprivate static toRole(level: number): UserRole {\n\t\tif (UserRepository.VALID_LEVELS.has(level)) return level as UserRole;\n\t\treturn 10;\n\t}\n}\n"],"mappings":";;;;;;;;AA+CA,IAAa,iBAAb,MAAa,eAAe;CAC3B,YAAY,AAAQ,IAAsB;EAAtB;;;;;CAKpB,MAAM,OAAO,OAAuC;EACnD,MAAM,KAAK,MAAM;EAEjB,MAAM,MAAiE;GACtE;GACA,OAAO,MAAM,MAAM,aAAa;GAChC,MAAM,MAAM,QAAQ;GACpB,MAAM,eAAe,YAAY,MAAM,QAAQ,GAAG;GAClD,YAAY,MAAM,aAAa;GAC/B,gBAAgB;GAChB,MAAM,MAAM,OAAO,KAAK,UAAU,MAAM,KAAK,GAAG;GAChD;AAED,QAAM,KAAK,GAAG,WAAW,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS;EAEvD,MAAM,OAAO,MAAM,KAAK,SAAS,GAAG;AACpC,MAAI,CAAC,KACJ,OAAM,IAAI,MAAM,wBAAwB;AAEzC,SAAO;;;;;CAMR,MAAM,SAAS,IAAkC;EAChD,MAAM,MAAM,MAAM,KAAK,GACrB,WAAW,QAAQ,CACnB,WAAW,CACX,MAAM,MAAM,KAAK,GAAG,CACpB,kBAAkB;AAEpB,SAAO,MAAM,KAAK,UAAU,IAAI,GAAG;;;;;;;CAQpC,MAAM,UAAU,KAAgC;EAC/C,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG,SAAS,EAAE;AAC9D,MAAI,OAAO,WAAW,EAAG,QAAO,EAAE;EAElC,MAAM,MAAc,EAAE;AACtB,OAAK,MAAM,SAAS,OAAO,QAAQ,eAAe,EAAE;GACnD,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AAO;GACN,IAAI,IAAI;GACR,OAAO,IAAI;GACX,MAAM,IAAI;GACV,MAAM,eAAe,OAAO,IAAI,KAAK;GACrC,WAAW,IAAI;GACf,eAAe,IAAI,mBAAmB;GACtC,MAAM,IAAI,OAAO,KAAK,MAAM,IAAI,KAAK,GAAG;GACxC,WAAW,IAAI;GACf;;;CAIF,OAAwB,qBAAqD;EAC5E,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;;CAGD,OAAwB,eAAe,IAAI,IAAY;EAAC;EAAI;EAAI;EAAI;EAAI;EAAG,CAAC;;;;;CAM5E,OAAO,YAAY,MAAyC;AAC3D,MAAI,OAAO,SAAS,UAAU;GAC7B,MAAM,QAAQ,eAAe,mBAAmB;AAChD,OAAI,UAAU,OACb,OAAM,IAAI,MAAM,sBAAsB,OAAO;AAE9C,UAAO;;AAER,MAAI,CAAC,eAAe,aAAa,IAAI,KAAK,CACzC,OAAM,IAAI,MAAM,uBAAuB,OAAO;AAE/C,SAAO;;;;;;CAOR,OAAe,OAAO,OAAyB;AAC9C,MAAI,eAAe,aAAa,IAAI,MAAM,CAAE,QAAO;AACnD,SAAO"}
@@ -1,5 +1,5 @@
1
1
  import { n as slugify } from "./slugify-C_tqlU4G.mjs";
2
- import { o as RESERVED_FIELD_SLUGS } from "./types-o7xo7VgH.mjs";
2
+ import { o as RESERVED_FIELD_SLUGS } from "./types-NBI3rF-_.mjs";
3
3
  import mime from "mime/lite";
4
4
 
5
5
  //#region src/import/utils.ts
@@ -432,4 +432,4 @@ function checkSchemaCompatibility(requiredFields, existingCollection) {
432
432
 
433
433
  //#endregion
434
434
  export { sanitizeFieldSlug as _, getFilenameFromUrl as a, isInternalMetaKey as c, mapMetaKeyToField as d, mapPostTypeToCollection as f, resolveImportByline as g, relativizeContentLinks as h, checkSchemaCompatibility as i, isInternalPostType as l, normalizeUrl as m, FEATURED_IMAGE_FIELD as n, guessMimeType as o, mapWpStatus as p, buildAttachmentMap as r, inferMetaType as s, BASE_REQUIRED_FIELDS as t, isPluginBookkeepingMeta as u };
435
- //# sourceMappingURL=utils-BbUgmeZG.mjs.map
435
+ //# sourceMappingURL=utils-hLzi_2Fn.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-BbUgmeZG.mjs","names":["slugifyFn"],"sources":["../src/import/utils.ts"],"sourcesContent":["/**\n * Shared import utilities\n *\n * Common constants and functions used across all WordPress import sources.\n */\n\nimport type { PortableTextBlock } from \"@emdash-cms/gutenberg-to-portable-text\";\nimport mime from \"mime/lite\";\n\nimport { RESERVED_FIELD_SLUGS } from \"../schema/types.js\";\nimport type { ImportFieldDef, CollectionSchemaStatus } from \"./types.js\";\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** Internal WordPress post types that should be excluded from import */\nexport const INTERNAL_POST_TYPES = [\n\t\"revision\",\n\t\"nav_menu_item\",\n\t\"custom_css\",\n\t\"customize_changeset\",\n\t\"oembed_cache\",\n\t\"wp_global_styles\",\n\t\"wp_navigation\",\n\t\"wp_template\",\n\t\"wp_template_part\",\n\t\"attachment\", // Handled separately as media\n\t\"wp_block\", // Handled separately as sections (reusable blocks)\n];\n\n/** Internal meta key prefixes to filter out */\nexport const INTERNAL_META_PREFIXES = [\"_edit_\", \"_wp_\"];\n\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst TRAILING_SLASHES = /\\/+$/;\nconst WP_JSON_SUFFIX = /\\/wp-json\\/?.*$/;\n\n/** Specific internal meta keys */\nexport const INTERNAL_META_KEYS = [\"_edit_last\", \"_edit_lock\", \"_pingme\", \"_encloseme\"];\n\n/** Base fields required for any WordPress import */\nexport const BASE_REQUIRED_FIELDS: ImportFieldDef[] = [\n\t{ slug: \"title\", label: \"Title\", type: \"string\", required: true, searchable: true },\n\t{ slug: \"content\", label: \"Content\", type: \"portableText\", required: false, searchable: true },\n\t{ slug: \"excerpt\", label: \"Excerpt\", type: \"text\", required: false },\n];\n\n/** Featured image field - only added to post types that have _thumbnail_id */\nexport const FEATURED_IMAGE_FIELD: ImportFieldDef = {\n\tslug: \"featured_image\",\n\tlabel: \"Featured Image\",\n\ttype: \"image\",\n\trequired: false,\n};\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Check if a post type is internal/should be excluded\n */\nexport function isInternalPostType(type: string): boolean {\n\treturn INTERNAL_POST_TYPES.includes(type);\n}\n\n/**\n * Check if a meta key is internal/should be filtered out\n */\nexport function isInternalMetaKey(key: string): boolean {\n\t// Check specific keys\n\tif (INTERNAL_META_KEYS.includes(key)) return true;\n\n\t// Check prefixes\n\tfor (const prefix of INTERNAL_META_PREFIXES) {\n\t\tif (key.startsWith(prefix)) return true;\n\t}\n\n\t// Keep these useful ones\n\tif (key === \"_thumbnail_id\") return false;\n\tif (key.startsWith(\"_yoast_\")) return false;\n\tif (key.startsWith(\"_rank_math_\")) return false;\n\n\t// Other underscore prefixes are usually internal\n\tif (key.startsWith(\"_\")) return true;\n\n\treturn false;\n}\n\n// =============================================================================\n// Status Mapping\n// =============================================================================\n\n/** Valid WordPress statuses */\nexport type WpStatus = \"publish\" | \"draft\" | \"pending\" | \"private\" | \"future\";\n\n/**\n * Map WordPress status to normalized status\n */\nexport function mapWpStatus(status: string | undefined): WpStatus {\n\tswitch (status) {\n\t\tcase \"publish\":\n\t\t\treturn \"publish\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"pending\";\n\t\tcase \"private\":\n\t\t\treturn \"private\";\n\t\tcase \"future\":\n\t\t\treturn \"future\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n\n// =============================================================================\n// Collection Mapping\n// =============================================================================\n\n/** Default mappings from WordPress post types to EmDash collections */\nconst POST_TYPE_TO_COLLECTION: Record<string, string> = {\n\tpost: \"posts\",\n\tpage: \"pages\",\n\tattachment: \"media\",\n\tproduct: \"products\",\n\tportfolio: \"portfolio\",\n\ttestimonial: \"testimonials\",\n\tteam: \"team\",\n\tevent: \"events\",\n\tfaq: \"faqs\",\n};\n\n/**\n * Map WordPress post type to EmDash collection name\n */\nexport function mapPostTypeToCollection(postType: string): string {\n\treturn POST_TYPE_TO_COLLECTION[postType] || postType;\n}\n\n// =============================================================================\n// Meta Key Mapping\n// =============================================================================\n\n/**\n * Map WordPress meta key to EmDash field slug\n */\nexport function mapMetaKeyToField(key: string): string {\n\t// SEO plugins\n\tif (key === \"_yoast_wpseo_title\") return \"seo_title\";\n\tif (key === \"_yoast_wpseo_metadesc\") return \"seo_description\";\n\tif (key === \"_rank_math_title\") return \"seo_title\";\n\tif (key === \"_rank_math_description\") return \"seo_description\";\n\tif (key === \"_thumbnail_id\") return \"featured_image\";\n\n\t// Remove leading underscore\n\tif (key.startsWith(\"_\")) return key.slice(1);\n\n\treturn key;\n}\n\n/**\n * Infer field type from meta key name and sample value\n */\nexport function inferMetaType(\n\tkey: string,\n\tvalue: string | undefined,\n): \"string\" | \"number\" | \"boolean\" | \"date\" | \"json\" {\n\tif (key.endsWith(\"_id\") || key === \"_thumbnail_id\") return \"string\";\n\tif (key.endsWith(\"_date\") || key.endsWith(\"_time\")) return \"date\";\n\tif (key.endsWith(\"_count\") || key.endsWith(\"_number\")) return \"number\";\n\n\tif (!value) return \"string\";\n\n\t// Serialized PHP or JSON\n\tif (value.startsWith(\"a:\") || value.startsWith(\"{\") || value.startsWith(\"[\")) return \"json\";\n\n\t// Number\n\tif (NUMERIC_PATTERN.test(value)) return \"number\";\n\n\t// Boolean\n\tif ([\"0\", \"1\", \"true\", \"false\"].includes(value)) return \"boolean\";\n\n\treturn \"string\";\n}\n\n// =============================================================================\n// Plugin Bookkeeping Meta\n// =============================================================================\n\n/**\n * Meta prefixes written by well-known WordPress plugins as operational\n * bookkeeping (sync state, counters, cache keys) — not content. Without\n * this filter, a mature site's analysis suggests dozens of junk fields\n * per post type and the real content fields drown in them.\n *\n * ponytail: curated list of the plugins we've seen in the wild, not a\n * taxonomy of the WP ecosystem. Unknown plugins' meta still gets through;\n * extend the list as real sites surface new offenders.\n */\nconst PLUGIN_META_PREFIXES = [\n\t\"aawp_\", // AAWP (Amazon affiliate)\n\t\"algolia_\", // Algolia / WP Search with Algolia\n\t\"amazon_polly_\", // Amazon Polly\n\t\"ampforwp_\", // AMP for WP\n\t\"classifai_\", // ClassifAI\n\t\"essb_\", // Easy Social Share Buttons\n\t\"eg_\", // Essential Grid\n\t\"gnpub_\", // Google News publisher tools\n\t\"jetpack_\", // Jetpack\n\t\"mashsb_\", // MashShare\n\t\"monsterinsights_\", // MonsterInsights\n\t\"onesignal_\", // OneSignal push\n\t\"penci_\", // Penci themes\n\t\"perfmatters_\", // Perfmatters\n\t\"pys_\", // PixelYourSite\n\t\"rank_math_\", // Rank Math internals (title/description go through the SEO pass)\n\t\"rp4wp_\", // Related Posts for WP\n\t\"saswp_\", // Schema & Structured Data for WP\n\t\"sbg_\", // Simple Blog Grid\n\t\"snap_\", // SNAP auto-poster\n\t\"spay_\", // Simple Pay\n\t\"tie_\", // TieLabs themes\n\t\"wl_\", // WordLift\n\t\"wpil_\", // Link Whisper\n\t\"wprm_\", // WP Recipe Maker internals\n\t\"wpswa_\", // WP Search with Algolia\n\t\"wpuf_\", // WP User Frontend\n\t\"yarpp_\", // YARPP\n];\n\n/** Exact meta keys that are plugin/core bookkeeping, not content. */\nconst PLUGIN_META_KEYS = new Set([\n\t\"entity_same_as\", // WordLift\n\t\"exclude_from_search\", // search exclusion plugins\n\t\"footnotes\", // Gutenberg core footnotes store\n\t\"inline_featured_image\", // inline featured image plugin\n\t\"os_meta\", // theme option stores\n\t\"thirstydata\", // ThirstyAffiliates\n]);\n\n/**\n * Check whether a meta key is well-known plugin bookkeeping that should\n * not become a content field. Hyphens are normalized to underscores\n * before matching (e.g. `ampforwp-amp-on-off`).\n */\nexport function isPluginBookkeepingMeta(key: string): boolean {\n\tconst normalized = key.replaceAll(\"-\", \"_\");\n\tif (PLUGIN_META_KEYS.has(normalized)) return true;\n\treturn PLUGIN_META_PREFIXES.some((prefix) => normalized.startsWith(prefix));\n}\n\n// =============================================================================\n// Field Slug Sanitization\n// =============================================================================\n\nconst INVALID_FIELD_SLUG_CHARS = /[^a-z0-9_]+/g;\nconst LEADING_NON_ALPHA_CHARS = /^[^a-z]+/;\n\n/**\n * Sanitize a WordPress meta/ACF key into a valid EmDash field slug\n * (`/^[a-z][a-z0-9_]*$/`, max 63 chars, not reserved).\n *\n * Must be applied consistently on both sides of an import: once when\n * creating fields from the analysis, and again when matching incoming\n * meta keys onto schema fields — otherwise keys like `my-field` create\n * `my_field` but never receive values.\n */\nexport function sanitizeFieldSlug(key: string): string {\n\tconst sanitized = key\n\t\t.toLowerCase()\n\t\t.replace(INVALID_FIELD_SLUG_CHARS, \"_\")\n\t\t.replace(LEADING_NON_ALPHA_CHARS, \"\")\n\t\t.slice(0, 63);\n\tif (!sanitized) return \"field\";\n\tif (RESERVED_FIELD_SLUGS.includes(sanitized)) return `wp_${sanitized}`;\n\treturn sanitized;\n}\n\n// =============================================================================\n// Internal Link Relativization\n// =============================================================================\n\nconst REGEX_SPECIALS = /[.*+?^${}()|[\\]\\\\]/g;\nconst LEADING_WWW = /^www\\./;\n\n/**\n * Turn an absolute URL into a root-relative one when it points at the\n * source site (www-insensitive). Returns null when the URL should be\n * left alone: external links, non-http(s) schemes, and `/wp-content/`\n * media files — those stay absolute so the later media pass can match\n * them against its old-URL -> new-URL map.\n */\nfunction relativizeUrl(url: string, sourceHost: string): string | null {\n\tif (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) return null;\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.hostname.replace(LEADING_WWW, \"\") !== sourceHost) return null;\n\t\tif (parsed.pathname.startsWith(\"/wp-content/\")) return null;\n\t\treturn `${parsed.pathname}${parsed.search}${parsed.hash}` || \"/\";\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction relativizeMarkDefs(\n\tmarkDefs: Array<{ _type: string; [key: string]: unknown }> | undefined,\n\tsourceHost: string,\n): void {\n\tfor (const def of markDefs ?? []) {\n\t\tif (def._type === \"link\" && typeof def.href === \"string\") {\n\t\t\tdef.href = relativizeUrl(def.href, sourceHost) ?? def.href;\n\t\t}\n\t}\n}\n\n/**\n * Rewrite internal links in imported content to root-relative URLs, in\n * place. Without this, imported posts keep linking back to the old\n * WordPress domain (e.g. `https://oldsite.com/companies/google/`)\n * instead of staying on the new site.\n *\n * ponytail: path structures are kept as-is (WP permalink /2024/05/slug/\n * stays /2024/05/slug/) — mapping old paths onto the new site's routes\n * is the planned permalink->redirect-map feature.\n */\nexport function relativizeContentLinks(blocks: PortableTextBlock[], siteUrl: string): void {\n\tlet sourceHost: string;\n\ttry {\n\t\tsourceHost = new URL(siteUrl).hostname.replace(LEADING_WWW, \"\");\n\t} catch {\n\t\treturn;\n\t}\n\t// Raw HTML in the wild uses double-quoted, single-quoted, and unquoted\n\t// href values; the backreference \\1 matches the closing quote (or\n\t// nothing, for unquoted). Rewritten links are normalized to href=\"...\".\n\tconst hrefPattern = new RegExp(\n\t\t`href=([\"']?)https?://(?:www\\\\.)?${sourceHost.replace(REGEX_SPECIALS, \"\\\\$&\")}(/[^\"'\\\\s>]*)?\\\\1`,\n\t\t\"gi\",\n\t);\n\n\tfor (const block of blocks) {\n\t\tswitch (block._type) {\n\t\t\tcase \"block\":\n\t\t\t\trelativizeMarkDefs(block.markDefs, sourceHost);\n\t\t\t\tbreak;\n\t\t\tcase \"image\":\n\t\t\t\t// asset.url stays absolute (media pass), only the click-through link\n\t\t\t\tif (block.link) block.link = relativizeUrl(block.link, sourceHost) ?? block.link;\n\t\t\t\tbreak;\n\t\t\tcase \"table\":\n\t\t\t\tfor (const row of block.rows) {\n\t\t\t\t\tfor (const cell of row.cells) relativizeMarkDefs(cell.markDefs, sourceHost);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"columns\":\n\t\t\t\tfor (const column of block.columns) relativizeContentLinks(column.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"cover\":\n\t\t\t\trelativizeContentLinks(block.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"button\":\n\t\t\t\tif (block.url) block.url = relativizeUrl(block.url, sourceHost) ?? block.url;\n\t\t\t\tbreak;\n\t\t\tcase \"buttons\":\n\t\t\t\tfor (const button of block.buttons) {\n\t\t\t\t\tif (button.url) button.url = relativizeUrl(button.url, sourceHost) ?? button.url;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"htmlBlock\":\n\t\t\t\tblock.html = block.html.replace(\n\t\t\t\t\threfPattern,\n\t\t\t\t\t(_m, _quote: string, path: string | undefined) => {\n\t\t\t\t\t\treturn `href=\"${path || \"/\"}\"`;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t// URL-less or media-only blocks: media URLs are the media pass's job\n\t\t\tcase \"code\":\n\t\t\tcase \"embed\":\n\t\t\tcase \"gallery\":\n\t\t\tcase \"break\":\n\t\t\tcase \"file\":\n\t\t\tcase \"pullquote\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tblock satisfies never;\n\t\t}\n\t}\n}\n\n// =============================================================================\n// String Utilities\n// =============================================================================\n\nexport { slugify } from \"../utils/slugify.js\";\n\n/**\n * Normalize URL for API requests\n */\nexport function normalizeUrl(url: string): string {\n\tlet normalized = url.trim();\n\n\t// Add protocol if missing\n\tif (!normalized.startsWith(\"http\")) {\n\t\tnormalized = `https://${normalized}`;\n\t}\n\n\t// Remove trailing slash\n\tnormalized = normalized.replace(TRAILING_SLASHES, \"\");\n\n\t// Remove /wp-json if included\n\tnormalized = normalized.replace(WP_JSON_SUFFIX, \"\");\n\n\treturn normalized;\n}\n\n// =============================================================================\n// File Utilities\n// =============================================================================\n\n/**\n * Extract filename from URL\n */\nexport function getFilenameFromUrl(url: string): string | undefined {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tconst segments = parsed.pathname.split(\"/\").filter(Boolean);\n\t\treturn segments.pop();\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Guess MIME type from filename\n */\nexport function guessMimeType(filename: string): string | undefined {\n\treturn mime.getType(filename) ?? undefined;\n}\n\n// =============================================================================\n// Attachment Map Builder\n// =============================================================================\n\n/**\n * Build a map of attachment IDs to URLs for resolving featured images\n */\nexport function buildAttachmentMap(\n\tattachments: Array<{ id?: number | string; url?: string }>,\n): Map<string, string> {\n\tconst map = new Map<string, string>();\n\tfor (const att of attachments) {\n\t\tif (att.id && att.url) {\n\t\t\tmap.set(String(att.id), att.url);\n\t\t}\n\t}\n\treturn map;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check if two field types are compatible for import\n */\nexport function isTypeCompatible(requiredType: string, existingType: string): boolean {\n\tif (requiredType === existingType) return true;\n\n\tconst compatibleTypes: Record<string, string[]> = {\n\t\tstring: [\"string\", \"text\", \"slug\"],\n\t\ttext: [\"string\", \"text\"],\n\t\tportableText: [\"portableText\", \"json\"],\n\t\tnumber: [\"number\", \"integer\"],\n\t\tinteger: [\"number\", \"integer\"],\n\t};\n\n\tconst compatible = compatibleTypes[requiredType];\n\treturn compatible?.includes(existingType) ?? false;\n}\n\n// =============================================================================\n// Byline Import Utilities\n// =============================================================================\n\nimport type { BylineRepository } from \"../database/repositories/byline.js\";\nimport { slugify as slugifyFn } from \"../utils/slugify.js\";\n\nconst MAX_SLUG_COLLISION_ATTEMPTS = 1000;\n\n/**\n * Find or create a unique byline slug, capped at MAX_SLUG_COLLISION_ATTEMPTS.\n */\nexport async function ensureUniqueBylineSlug(\n\tbylineRepo: BylineRepository,\n\tbaseSlug: string,\n): Promise<string> {\n\tlet candidate = baseSlug;\n\tlet suffix = 2;\n\twhile (await bylineRepo.findBySlug(candidate)) {\n\t\tif (suffix > MAX_SLUG_COLLISION_ATTEMPTS) {\n\t\t\tthrow new Error(\n\t\t\t\t`Byline slug collision limit exceeded for base slug \"${baseSlug}\". ` +\n\t\t\t\t\t`Tried ${MAX_SLUG_COLLISION_ATTEMPTS} variants.`,\n\t\t\t);\n\t\t}\n\t\tcandidate = `${baseSlug}-${suffix}`;\n\t\tsuffix++;\n\t}\n\treturn candidate;\n}\n\n/**\n * Resolve (find-or-create) a byline for an imported WordPress author.\n * Caches results in `cache` keyed by `authorLogin:mappedUserId`.\n */\nexport async function resolveImportByline(\n\tauthorLogin: string | undefined,\n\tdisplayName: string | undefined,\n\tmappedUserId: string | undefined,\n\tbylineRepo: BylineRepository,\n\tcache: Map<string, string>,\n): Promise<string | undefined> {\n\tif (!authorLogin) return undefined;\n\tconst cacheKey = `${authorLogin}:${mappedUserId ?? \"\"}`;\n\tconst cached = cache.get(cacheKey);\n\tif (cached) return cached;\n\n\tif (mappedUserId) {\n\t\tconst existingForUser = await bylineRepo.findByUserId(mappedUserId);\n\t\tif (existingForUser) {\n\t\t\tcache.set(cacheKey, existingForUser.id);\n\t\t\treturn existingForUser.id;\n\t\t}\n\t}\n\n\tconst name = displayName || authorLogin;\n\tconst slugBase = slugifyFn(authorLogin);\n\tconst slug = await ensureUniqueBylineSlug(bylineRepo, slugBase || \"author\");\n\tconst created = await bylineRepo.create({\n\t\tslug,\n\t\tdisplayName: name,\n\t\tuserId: mappedUserId ?? null,\n\t\tisGuest: !mappedUserId,\n\t});\n\n\tcache.set(cacheKey, created.id);\n\treturn created.id;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check schema compatibility between required fields and existing collection\n */\nexport function checkSchemaCompatibility(\n\trequiredFields: ImportFieldDef[],\n\texistingCollection: { slug: string; fields: Map<string, { type: string }> } | undefined,\n): CollectionSchemaStatus {\n\tif (!existingCollection) {\n\t\t// Collection doesn't exist - will need to create it\n\t\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\t\tfor (const field of requiredFields) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\texists: false,\n\t\t\tfieldStatus,\n\t\t\tcanImport: true,\n\t\t};\n\t}\n\n\t// Collection exists - check field compatibility\n\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\tconst incompatibleFields: string[] = [];\n\n\tfor (const field of requiredFields) {\n\t\tconst existingField = existingCollection.fields.get(field.slug);\n\n\t\tif (!existingField) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else if (isTypeCompatible(field.type, existingField.type)) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"compatible\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"type_mismatch\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t\tincompatibleFields.push(field.slug);\n\t\t}\n\t}\n\n\tconst canImport = incompatibleFields.length === 0;\n\tconst reason = canImport\n\t\t? undefined\n\t\t: `Incompatible field types: ${incompatibleFields.join(\", \")}`;\n\n\treturn {\n\t\texists: true,\n\t\tfieldStatus,\n\t\tcanImport,\n\t\treason,\n\t};\n}\n"],"mappings":";;;;;;AAiBA,MAAa,sBAAsB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAGD,MAAa,yBAAyB,CAAC,UAAU,OAAO;AAExD,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;AAGvB,MAAa,qBAAqB;CAAC;CAAc;CAAc;CAAW;CAAa;;AAGvF,MAAa,uBAAyC;CACrD;EAAE,MAAM;EAAS,OAAO;EAAS,MAAM;EAAU,UAAU;EAAM,YAAY;EAAM;CACnF;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAgB,UAAU;EAAO,YAAY;EAAM;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;GACzB,QAAQ;GACR,cAAc,MAAM;GACpB;WACS,iBAAiB,MAAM,MAAM,cAAc,KAAK,CAC1D,aAAY,MAAM,QAAQ;GACzB,QAAQ;GACR,cAAc,cAAc;GAC5B,cAAc,MAAM;GACpB;OACK;AACN,eAAY,MAAM,QAAQ;IACzB,QAAQ;IACR,cAAc,cAAc;IAC5B,cAAc,MAAM;IACpB;AACD,sBAAmB,KAAK,MAAM,KAAK;;;CAIrC,MAAM,YAAY,mBAAmB,WAAW;AAKhD,QAAO;EACN,QAAQ;EACR;EACA;EACA,QARc,YACZ,SACA,6BAA6B,mBAAmB,KAAK,KAAK;EAO5D"}
1
+ {"version":3,"file":"utils-hLzi_2Fn.mjs","names":["slugifyFn"],"sources":["../src/import/utils.ts"],"sourcesContent":["/**\n * Shared import utilities\n *\n * Common constants and functions used across all WordPress import sources.\n */\n\nimport type { PortableTextBlock } from \"@emdash-cms/gutenberg-to-portable-text\";\nimport mime from \"mime/lite\";\n\nimport { RESERVED_FIELD_SLUGS } from \"../schema/types.js\";\nimport type { ImportFieldDef, CollectionSchemaStatus } from \"./types.js\";\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** Internal WordPress post types that should be excluded from import */\nexport const INTERNAL_POST_TYPES = [\n\t\"revision\",\n\t\"nav_menu_item\",\n\t\"custom_css\",\n\t\"customize_changeset\",\n\t\"oembed_cache\",\n\t\"wp_global_styles\",\n\t\"wp_navigation\",\n\t\"wp_template\",\n\t\"wp_template_part\",\n\t\"attachment\", // Handled separately as media\n\t\"wp_block\", // Handled separately as sections (reusable blocks)\n];\n\n/** Internal meta key prefixes to filter out */\nexport const INTERNAL_META_PREFIXES = [\"_edit_\", \"_wp_\"];\n\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst TRAILING_SLASHES = /\\/+$/;\nconst WP_JSON_SUFFIX = /\\/wp-json\\/?.*$/;\n\n/** Specific internal meta keys */\nexport const INTERNAL_META_KEYS = [\"_edit_last\", \"_edit_lock\", \"_pingme\", \"_encloseme\"];\n\n/** Base fields required for any WordPress import */\nexport const BASE_REQUIRED_FIELDS: ImportFieldDef[] = [\n\t{ slug: \"title\", label: \"Title\", type: \"string\", required: true, searchable: true },\n\t{ slug: \"content\", label: \"Content\", type: \"portableText\", required: false, searchable: true },\n\t{ slug: \"excerpt\", label: \"Excerpt\", type: \"text\", required: false },\n];\n\n/** Featured image field - only added to post types that have _thumbnail_id */\nexport const FEATURED_IMAGE_FIELD: ImportFieldDef = {\n\tslug: \"featured_image\",\n\tlabel: \"Featured Image\",\n\ttype: \"image\",\n\trequired: false,\n};\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Check if a post type is internal/should be excluded\n */\nexport function isInternalPostType(type: string): boolean {\n\treturn INTERNAL_POST_TYPES.includes(type);\n}\n\n/**\n * Check if a meta key is internal/should be filtered out\n */\nexport function isInternalMetaKey(key: string): boolean {\n\t// Check specific keys\n\tif (INTERNAL_META_KEYS.includes(key)) return true;\n\n\t// Check prefixes\n\tfor (const prefix of INTERNAL_META_PREFIXES) {\n\t\tif (key.startsWith(prefix)) return true;\n\t}\n\n\t// Keep these useful ones\n\tif (key === \"_thumbnail_id\") return false;\n\tif (key.startsWith(\"_yoast_\")) return false;\n\tif (key.startsWith(\"_rank_math_\")) return false;\n\n\t// Other underscore prefixes are usually internal\n\tif (key.startsWith(\"_\")) return true;\n\n\treturn false;\n}\n\n// =============================================================================\n// Status Mapping\n// =============================================================================\n\n/** Valid WordPress statuses */\nexport type WpStatus = \"publish\" | \"draft\" | \"pending\" | \"private\" | \"future\";\n\n/**\n * Map WordPress status to normalized status\n */\nexport function mapWpStatus(status: string | undefined): WpStatus {\n\tswitch (status) {\n\t\tcase \"publish\":\n\t\t\treturn \"publish\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"pending\";\n\t\tcase \"private\":\n\t\t\treturn \"private\";\n\t\tcase \"future\":\n\t\t\treturn \"future\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n\n// =============================================================================\n// Collection Mapping\n// =============================================================================\n\n/** Default mappings from WordPress post types to EmDash collections */\nconst POST_TYPE_TO_COLLECTION: Record<string, string> = {\n\tpost: \"posts\",\n\tpage: \"pages\",\n\tattachment: \"media\",\n\tproduct: \"products\",\n\tportfolio: \"portfolio\",\n\ttestimonial: \"testimonials\",\n\tteam: \"team\",\n\tevent: \"events\",\n\tfaq: \"faqs\",\n};\n\n/**\n * Map WordPress post type to EmDash collection name\n */\nexport function mapPostTypeToCollection(postType: string): string {\n\treturn POST_TYPE_TO_COLLECTION[postType] || postType;\n}\n\n// =============================================================================\n// Meta Key Mapping\n// =============================================================================\n\n/**\n * Map WordPress meta key to EmDash field slug\n */\nexport function mapMetaKeyToField(key: string): string {\n\t// SEO plugins\n\tif (key === \"_yoast_wpseo_title\") return \"seo_title\";\n\tif (key === \"_yoast_wpseo_metadesc\") return \"seo_description\";\n\tif (key === \"_rank_math_title\") return \"seo_title\";\n\tif (key === \"_rank_math_description\") return \"seo_description\";\n\tif (key === \"_thumbnail_id\") return \"featured_image\";\n\n\t// Remove leading underscore\n\tif (key.startsWith(\"_\")) return key.slice(1);\n\n\treturn key;\n}\n\n/**\n * Infer field type from meta key name and sample value\n */\nexport function inferMetaType(\n\tkey: string,\n\tvalue: string | undefined,\n): \"string\" | \"number\" | \"boolean\" | \"date\" | \"json\" {\n\tif (key.endsWith(\"_id\") || key === \"_thumbnail_id\") return \"string\";\n\tif (key.endsWith(\"_date\") || key.endsWith(\"_time\")) return \"date\";\n\tif (key.endsWith(\"_count\") || key.endsWith(\"_number\")) return \"number\";\n\n\tif (!value) return \"string\";\n\n\t// Serialized PHP or JSON\n\tif (value.startsWith(\"a:\") || value.startsWith(\"{\") || value.startsWith(\"[\")) return \"json\";\n\n\t// Number\n\tif (NUMERIC_PATTERN.test(value)) return \"number\";\n\n\t// Boolean\n\tif ([\"0\", \"1\", \"true\", \"false\"].includes(value)) return \"boolean\";\n\n\treturn \"string\";\n}\n\n// =============================================================================\n// Plugin Bookkeeping Meta\n// =============================================================================\n\n/**\n * Meta prefixes written by well-known WordPress plugins as operational\n * bookkeeping (sync state, counters, cache keys) — not content. Without\n * this filter, a mature site's analysis suggests dozens of junk fields\n * per post type and the real content fields drown in them.\n *\n * ponytail: curated list of the plugins we've seen in the wild, not a\n * taxonomy of the WP ecosystem. Unknown plugins' meta still gets through;\n * extend the list as real sites surface new offenders.\n */\nconst PLUGIN_META_PREFIXES = [\n\t\"aawp_\", // AAWP (Amazon affiliate)\n\t\"algolia_\", // Algolia / WP Search with Algolia\n\t\"amazon_polly_\", // Amazon Polly\n\t\"ampforwp_\", // AMP for WP\n\t\"classifai_\", // ClassifAI\n\t\"essb_\", // Easy Social Share Buttons\n\t\"eg_\", // Essential Grid\n\t\"gnpub_\", // Google News publisher tools\n\t\"jetpack_\", // Jetpack\n\t\"mashsb_\", // MashShare\n\t\"monsterinsights_\", // MonsterInsights\n\t\"onesignal_\", // OneSignal push\n\t\"penci_\", // Penci themes\n\t\"perfmatters_\", // Perfmatters\n\t\"pys_\", // PixelYourSite\n\t\"rank_math_\", // Rank Math internals (title/description go through the SEO pass)\n\t\"rp4wp_\", // Related Posts for WP\n\t\"saswp_\", // Schema & Structured Data for WP\n\t\"sbg_\", // Simple Blog Grid\n\t\"snap_\", // SNAP auto-poster\n\t\"spay_\", // Simple Pay\n\t\"tie_\", // TieLabs themes\n\t\"wl_\", // WordLift\n\t\"wpil_\", // Link Whisper\n\t\"wprm_\", // WP Recipe Maker internals\n\t\"wpswa_\", // WP Search with Algolia\n\t\"wpuf_\", // WP User Frontend\n\t\"yarpp_\", // YARPP\n];\n\n/** Exact meta keys that are plugin/core bookkeeping, not content. */\nconst PLUGIN_META_KEYS = new Set([\n\t\"entity_same_as\", // WordLift\n\t\"exclude_from_search\", // search exclusion plugins\n\t\"footnotes\", // Gutenberg core footnotes store\n\t\"inline_featured_image\", // inline featured image plugin\n\t\"os_meta\", // theme option stores\n\t\"thirstydata\", // ThirstyAffiliates\n]);\n\n/**\n * Check whether a meta key is well-known plugin bookkeeping that should\n * not become a content field. Hyphens are normalized to underscores\n * before matching (e.g. `ampforwp-amp-on-off`).\n */\nexport function isPluginBookkeepingMeta(key: string): boolean {\n\tconst normalized = key.replaceAll(\"-\", \"_\");\n\tif (PLUGIN_META_KEYS.has(normalized)) return true;\n\treturn PLUGIN_META_PREFIXES.some((prefix) => normalized.startsWith(prefix));\n}\n\n// =============================================================================\n// Field Slug Sanitization\n// =============================================================================\n\nconst INVALID_FIELD_SLUG_CHARS = /[^a-z0-9_]+/g;\nconst LEADING_NON_ALPHA_CHARS = /^[^a-z]+/;\n\n/**\n * Sanitize a WordPress meta/ACF key into a valid EmDash field slug\n * (`/^[a-z][a-z0-9_]*$/`, max 63 chars, not reserved).\n *\n * Must be applied consistently on both sides of an import: once when\n * creating fields from the analysis, and again when matching incoming\n * meta keys onto schema fields — otherwise keys like `my-field` create\n * `my_field` but never receive values.\n */\nexport function sanitizeFieldSlug(key: string): string {\n\tconst sanitized = key\n\t\t.toLowerCase()\n\t\t.replace(INVALID_FIELD_SLUG_CHARS, \"_\")\n\t\t.replace(LEADING_NON_ALPHA_CHARS, \"\")\n\t\t.slice(0, 63);\n\tif (!sanitized) return \"field\";\n\tif (RESERVED_FIELD_SLUGS.includes(sanitized)) return `wp_${sanitized}`;\n\treturn sanitized;\n}\n\n// =============================================================================\n// Internal Link Relativization\n// =============================================================================\n\nconst REGEX_SPECIALS = /[.*+?^${}()|[\\]\\\\]/g;\nconst LEADING_WWW = /^www\\./;\n\n/**\n * Turn an absolute URL into a root-relative one when it points at the\n * source site (www-insensitive). Returns null when the URL should be\n * left alone: external links, non-http(s) schemes, and `/wp-content/`\n * media files — those stay absolute so the later media pass can match\n * them against its old-URL -> new-URL map.\n */\nfunction relativizeUrl(url: string, sourceHost: string): string | null {\n\tif (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) return null;\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.hostname.replace(LEADING_WWW, \"\") !== sourceHost) return null;\n\t\tif (parsed.pathname.startsWith(\"/wp-content/\")) return null;\n\t\treturn `${parsed.pathname}${parsed.search}${parsed.hash}` || \"/\";\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction relativizeMarkDefs(\n\tmarkDefs: Array<{ _type: string; [key: string]: unknown }> | undefined,\n\tsourceHost: string,\n): void {\n\tfor (const def of markDefs ?? []) {\n\t\tif (def._type === \"link\" && typeof def.href === \"string\") {\n\t\t\tdef.href = relativizeUrl(def.href, sourceHost) ?? def.href;\n\t\t}\n\t}\n}\n\n/**\n * Rewrite internal links in imported content to root-relative URLs, in\n * place. Without this, imported posts keep linking back to the old\n * WordPress domain (e.g. `https://oldsite.com/companies/google/`)\n * instead of staying on the new site.\n *\n * ponytail: path structures are kept as-is (WP permalink /2024/05/slug/\n * stays /2024/05/slug/) — mapping old paths onto the new site's routes\n * is the planned permalink->redirect-map feature.\n */\nexport function relativizeContentLinks(blocks: PortableTextBlock[], siteUrl: string): void {\n\tlet sourceHost: string;\n\ttry {\n\t\tsourceHost = new URL(siteUrl).hostname.replace(LEADING_WWW, \"\");\n\t} catch {\n\t\treturn;\n\t}\n\t// Raw HTML in the wild uses double-quoted, single-quoted, and unquoted\n\t// href values; the backreference \\1 matches the closing quote (or\n\t// nothing, for unquoted). Rewritten links are normalized to href=\"...\".\n\tconst hrefPattern = new RegExp(\n\t\t`href=([\"']?)https?://(?:www\\\\.)?${sourceHost.replace(REGEX_SPECIALS, \"\\\\$&\")}(/[^\"'\\\\s>]*)?\\\\1`,\n\t\t\"gi\",\n\t);\n\n\tfor (const block of blocks) {\n\t\tswitch (block._type) {\n\t\t\tcase \"block\":\n\t\t\t\trelativizeMarkDefs(block.markDefs, sourceHost);\n\t\t\t\tbreak;\n\t\t\tcase \"image\":\n\t\t\t\t// asset.url stays absolute (media pass), only the click-through link\n\t\t\t\tif (block.link) block.link = relativizeUrl(block.link, sourceHost) ?? block.link;\n\t\t\t\tbreak;\n\t\t\tcase \"table\":\n\t\t\t\tfor (const row of block.rows) {\n\t\t\t\t\tfor (const cell of row.cells) relativizeMarkDefs(cell.markDefs, sourceHost);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"columns\":\n\t\t\t\tfor (const column of block.columns) relativizeContentLinks(column.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"cover\":\n\t\t\t\trelativizeContentLinks(block.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"button\":\n\t\t\t\tif (block.url) block.url = relativizeUrl(block.url, sourceHost) ?? block.url;\n\t\t\t\tbreak;\n\t\t\tcase \"buttons\":\n\t\t\t\tfor (const button of block.buttons) {\n\t\t\t\t\tif (button.url) button.url = relativizeUrl(button.url, sourceHost) ?? button.url;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"htmlBlock\":\n\t\t\t\tblock.html = block.html.replace(\n\t\t\t\t\threfPattern,\n\t\t\t\t\t(_m, _quote: string, path: string | undefined) => {\n\t\t\t\t\t\treturn `href=\"${path || \"/\"}\"`;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t// URL-less or media-only blocks: media URLs are the media pass's job\n\t\t\tcase \"code\":\n\t\t\tcase \"embed\":\n\t\t\tcase \"gallery\":\n\t\t\tcase \"break\":\n\t\t\tcase \"file\":\n\t\t\tcase \"pullquote\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tblock satisfies never;\n\t\t}\n\t}\n}\n\n// =============================================================================\n// String Utilities\n// =============================================================================\n\nexport { slugify } from \"../utils/slugify.js\";\n\n/**\n * Normalize URL for API requests\n */\nexport function normalizeUrl(url: string): string {\n\tlet normalized = url.trim();\n\n\t// Add protocol if missing\n\tif (!normalized.startsWith(\"http\")) {\n\t\tnormalized = `https://${normalized}`;\n\t}\n\n\t// Remove trailing slash\n\tnormalized = normalized.replace(TRAILING_SLASHES, \"\");\n\n\t// Remove /wp-json if included\n\tnormalized = normalized.replace(WP_JSON_SUFFIX, \"\");\n\n\treturn normalized;\n}\n\n// =============================================================================\n// File Utilities\n// =============================================================================\n\n/**\n * Extract filename from URL\n */\nexport function getFilenameFromUrl(url: string): string | undefined {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tconst segments = parsed.pathname.split(\"/\").filter(Boolean);\n\t\treturn segments.pop();\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Guess MIME type from filename\n */\nexport function guessMimeType(filename: string): string | undefined {\n\treturn mime.getType(filename) ?? undefined;\n}\n\n// =============================================================================\n// Attachment Map Builder\n// =============================================================================\n\n/**\n * Build a map of attachment IDs to URLs for resolving featured images\n */\nexport function buildAttachmentMap(\n\tattachments: Array<{ id?: number | string; url?: string }>,\n): Map<string, string> {\n\tconst map = new Map<string, string>();\n\tfor (const att of attachments) {\n\t\tif (att.id && att.url) {\n\t\t\tmap.set(String(att.id), att.url);\n\t\t}\n\t}\n\treturn map;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check if two field types are compatible for import\n */\nexport function isTypeCompatible(requiredType: string, existingType: string): boolean {\n\tif (requiredType === existingType) return true;\n\n\tconst compatibleTypes: Record<string, string[]> = {\n\t\tstring: [\"string\", \"text\", \"slug\"],\n\t\ttext: [\"string\", \"text\"],\n\t\tportableText: [\"portableText\", \"json\"],\n\t\tnumber: [\"number\", \"integer\"],\n\t\tinteger: [\"number\", \"integer\"],\n\t};\n\n\tconst compatible = compatibleTypes[requiredType];\n\treturn compatible?.includes(existingType) ?? false;\n}\n\n// =============================================================================\n// Byline Import Utilities\n// =============================================================================\n\nimport type { BylineRepository } from \"../database/repositories/byline.js\";\nimport { slugify as slugifyFn } from \"../utils/slugify.js\";\n\nconst MAX_SLUG_COLLISION_ATTEMPTS = 1000;\n\n/**\n * Find or create a unique byline slug, capped at MAX_SLUG_COLLISION_ATTEMPTS.\n */\nexport async function ensureUniqueBylineSlug(\n\tbylineRepo: BylineRepository,\n\tbaseSlug: string,\n): Promise<string> {\n\tlet candidate = baseSlug;\n\tlet suffix = 2;\n\twhile (await bylineRepo.findBySlug(candidate)) {\n\t\tif (suffix > MAX_SLUG_COLLISION_ATTEMPTS) {\n\t\t\tthrow new Error(\n\t\t\t\t`Byline slug collision limit exceeded for base slug \"${baseSlug}\". ` +\n\t\t\t\t\t`Tried ${MAX_SLUG_COLLISION_ATTEMPTS} variants.`,\n\t\t\t);\n\t\t}\n\t\tcandidate = `${baseSlug}-${suffix}`;\n\t\tsuffix++;\n\t}\n\treturn candidate;\n}\n\n/**\n * Resolve (find-or-create) a byline for an imported WordPress author.\n * Caches results in `cache` keyed by `authorLogin:mappedUserId`.\n */\nexport async function resolveImportByline(\n\tauthorLogin: string | undefined,\n\tdisplayName: string | undefined,\n\tmappedUserId: string | undefined,\n\tbylineRepo: BylineRepository,\n\tcache: Map<string, string>,\n): Promise<string | undefined> {\n\tif (!authorLogin) return undefined;\n\tconst cacheKey = `${authorLogin}:${mappedUserId ?? \"\"}`;\n\tconst cached = cache.get(cacheKey);\n\tif (cached) return cached;\n\n\tif (mappedUserId) {\n\t\tconst existingForUser = await bylineRepo.findByUserId(mappedUserId);\n\t\tif (existingForUser) {\n\t\t\tcache.set(cacheKey, existingForUser.id);\n\t\t\treturn existingForUser.id;\n\t\t}\n\t}\n\n\tconst name = displayName || authorLogin;\n\tconst slugBase = slugifyFn(authorLogin);\n\tconst slug = await ensureUniqueBylineSlug(bylineRepo, slugBase || \"author\");\n\tconst created = await bylineRepo.create({\n\t\tslug,\n\t\tdisplayName: name,\n\t\tuserId: mappedUserId ?? null,\n\t\tisGuest: !mappedUserId,\n\t});\n\n\tcache.set(cacheKey, created.id);\n\treturn created.id;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check schema compatibility between required fields and existing collection\n */\nexport function checkSchemaCompatibility(\n\trequiredFields: ImportFieldDef[],\n\texistingCollection: { slug: string; fields: Map<string, { type: string }> } | undefined,\n): CollectionSchemaStatus {\n\tif (!existingCollection) {\n\t\t// Collection doesn't exist - will need to create it\n\t\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\t\tfor (const field of requiredFields) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\texists: false,\n\t\t\tfieldStatus,\n\t\t\tcanImport: true,\n\t\t};\n\t}\n\n\t// Collection exists - check field compatibility\n\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\tconst incompatibleFields: string[] = [];\n\n\tfor (const field of requiredFields) {\n\t\tconst existingField = existingCollection.fields.get(field.slug);\n\n\t\tif (!existingField) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else if (isTypeCompatible(field.type, existingField.type)) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"compatible\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"type_mismatch\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t\tincompatibleFields.push(field.slug);\n\t\t}\n\t}\n\n\tconst canImport = incompatibleFields.length === 0;\n\tconst reason = canImport\n\t\t? undefined\n\t\t: `Incompatible field types: ${incompatibleFields.join(\", \")}`;\n\n\treturn {\n\t\texists: true,\n\t\tfieldStatus,\n\t\tcanImport,\n\t\treason,\n\t};\n}\n"],"mappings":";;;;;;AAiBA,MAAa,sBAAsB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAGD,MAAa,yBAAyB,CAAC,UAAU,OAAO;AAExD,MAAM,kBAAkB;AACxB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AAQ;GACR,cAAc,MAAM;GACpB;AAEF,SAAO;GACN,QAAQ;GACR;GACA,WAAW;GACX;;CAIF,MAAM,cAAqD,EAAE;CAC7D,MAAM,qBAA+B,EAAE;AAEvC,MAAK,MAAM,SAAS,gBAAgB;EACnC,MAAM,gBAAgB,mBAAmB,OAAO,IAAI,MAAM,KAAK;AAE/D,MAAI,CAAC,cACJ,aAAY,MAAM,QAAQ;GACzB,QAAQ;GACR,cAAc,MAAM;GACpB;WACS,iBAAiB,MAAM,MAAM,cAAc,KAAK,CAC1D,aAAY,MAAM,QAAQ;GACzB,QAAQ;GACR,cAAc,cAAc;GAC5B,cAAc,MAAM;GACpB;OACK;AACN,eAAY,MAAM,QAAQ;IACzB,QAAQ;IACR,cAAc,cAAc;IAC5B,cAAc,MAAM;IACpB;AACD,sBAAmB,KAAK,MAAM,KAAK;;;CAIrC,MAAM,YAAY,mBAAmB,WAAW;AAKhD,QAAO;EACN,QAAQ;EACR;EACA;EACA,QARc,YACZ,SACA,6BAA6B,mBAAmB,KAAK,KAAK;EAO5D"}
@@ -24,6 +24,12 @@ const GENERIC_IDENTIFIER_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]*$/;
24
24
  */
25
25
  const PLUGIN_IDENTIFIER_PATTERN = /^[a-z][a-z0-9_-]*$/;
26
26
  /**
27
+ * Pattern for plugin storage collection names.
28
+ * Manifests declare these as free-form keys, so both cases and hyphens are
29
+ * allowed; the charset still excludes quotes, whitespace, and punctuation.
30
+ */
31
+ const STORAGE_COLLECTION_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
32
+ /**
27
33
  * Maximum length for SQL identifiers.
28
34
  * SQLite has no formal limit, but we cap at 128 for sanity.
29
35
  */
@@ -91,7 +97,24 @@ function validatePluginIdentifier(value, label = "plugin identifier") {
91
97
  if (value.length > MAX_IDENTIFIER_LENGTH) throw new IdentifierError(`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`, value);
92
98
  if (!PLUGIN_IDENTIFIER_PATTERN.test(value)) throw new IdentifierError(`${label} must match /^[a-z][a-z0-9_-]*$/ (got "${value}")`, value);
93
99
  }
100
+ /**
101
+ * Validate a plugin storage collection name.
102
+ *
103
+ * Collections are declared as free-form manifest keys and stored as opaque
104
+ * text, so this is deliberately more permissive than `validateIdentifier`:
105
+ * `form-submissions` and `formSubmissions` are legitimate. The charset still
106
+ * rejects quotes and punctuation, keeping generated index names inert.
107
+ *
108
+ * @param value - The string to validate
109
+ * @param label - Human-readable label for error messages
110
+ * @throws {IdentifierError} If the value is not valid
111
+ */
112
+ function validateStorageCollectionName(value, label = "collection name") {
113
+ if (!value || typeof value !== "string") throw new IdentifierError(`${label} must be a non-empty string`, String(value));
114
+ if (value.length > MAX_IDENTIFIER_LENGTH) throw new IdentifierError(`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`, value);
115
+ if (!STORAGE_COLLECTION_PATTERN.test(value)) throw new IdentifierError(`${label} must match /^[a-zA-Z][a-zA-Z0-9_-]*$/ (got "${value}")`, value);
116
+ }
94
117
 
95
118
  //#endregion
96
- export { validateJsonFieldName as n, validatePluginIdentifier as r, validateIdentifier as t };
97
- //# sourceMappingURL=validate-VPnKoIzW.mjs.map
119
+ export { validateStorageCollectionName as i, validateJsonFieldName as n, validatePluginIdentifier as r, validateIdentifier as t };
120
+ //# sourceMappingURL=validate-BpwoDOgt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-BpwoDOgt.mjs","names":[],"sources":["../src/database/validate.ts"],"sourcesContent":["/**\n * SQL Identifier Validation\n *\n * Validates identifiers (table names, column names, index names) before\n * they are used in raw SQL expressions. This is the primary defense against\n * SQL injection via dynamic identifier interpolation.\n *\n * @see AGENTS.md § Database: Never Interpolate Into SQL\n */\n\n/**\n * Pattern for safe SQL identifiers.\n * Must start with a lowercase letter, followed by lowercase letters, digits, or underscores.\n */\nconst IDENTIFIER_PATTERN = /^[a-z][a-z0-9_]*$/;\n\n/**\n * Pattern for generic alphanumeric identifiers (case-insensitive).\n * Must start with a letter, followed by letters, digits, or underscores.\n */\nconst GENERIC_IDENTIFIER_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]*$/;\n\n/**\n * Pattern for plugin identifiers.\n * Must start with a lowercase letter, followed by lowercase letters, digits, underscores, or hyphens.\n */\nconst PLUGIN_IDENTIFIER_PATTERN = /^[a-z][a-z0-9_-]*$/;\n\n/**\n * Pattern for plugin storage collection names.\n * Manifests declare these as free-form keys, so both cases and hyphens are\n * allowed; the charset still excludes quotes, whitespace, and punctuation.\n */\nconst STORAGE_COLLECTION_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;\n\n/**\n * Maximum length for SQL identifiers.\n * SQLite has no formal limit, but we cap at 128 for sanity.\n */\nconst MAX_IDENTIFIER_LENGTH = 128;\n\n/**\n * Error thrown when an identifier fails validation.\n */\nexport class IdentifierError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic identifier: string,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"IdentifierError\";\n\t}\n}\n\n/**\n * Validate that a string is a safe SQL identifier.\n *\n * Safe identifiers match `/^[a-z][a-z0-9_]*$/` and are at most 128 characters.\n * This prevents SQL injection when identifiers must be interpolated into raw SQL\n * (e.g., dynamic table names, column names in json_extract paths).\n *\n * @param value - The string to validate\n * @param label - Human-readable label for error messages (e.g., \"field name\", \"table name\")\n * @throws {IdentifierError} If the value is not a valid identifier\n *\n * @example\n * ```typescript\n * validateIdentifier(fieldName, \"field name\");\n * // safe to use in: json_extract(data, '$.${fieldName}')\n * ```\n */\nexport function validateIdentifier(value: string, label = \"identifier\"): void {\n\tif (!value || typeof value !== \"string\") {\n\t\tthrow new IdentifierError(`${label} must be a non-empty string`, String(value));\n\t}\n\n\tif (value.length > MAX_IDENTIFIER_LENGTH) {\n\t\tthrow new IdentifierError(\n\t\t\t`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`,\n\t\t\tvalue,\n\t\t);\n\t}\n\n\tif (!IDENTIFIER_PATTERN.test(value)) {\n\t\tthrow new IdentifierError(`${label} must match /^[a-z][a-z0-9_]*$/ (got \"${value}\")`, value);\n\t}\n}\n\n/**\n * Validate that a string is a safe JSON field name for use in json_extract paths.\n *\n * More permissive than `validateIdentifier` — allows camelCase (mixed case)\n * since JSON keys in plugin storage data blobs commonly use camelCase.\n * Matches `/^[a-zA-Z][a-zA-Z0-9_]*$/`.\n *\n * @param value - The string to validate\n * @param label - Human-readable label for error messages\n * @throws {IdentifierError} If the value is not valid\n */\nexport function validateJsonFieldName(value: string, label = \"JSON field name\"): void {\n\tif (!value || typeof value !== \"string\") {\n\t\tthrow new IdentifierError(`${label} must be a non-empty string`, String(value));\n\t}\n\n\tif (value.length > MAX_IDENTIFIER_LENGTH) {\n\t\tthrow new IdentifierError(\n\t\t\t`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`,\n\t\t\tvalue,\n\t\t);\n\t}\n\n\tif (!GENERIC_IDENTIFIER_PATTERN.test(value)) {\n\t\tthrow new IdentifierError(\n\t\t\t`${label} must match /^[a-zA-Z][a-zA-Z0-9_]*$/ (got \"${value}\")`,\n\t\t\tvalue,\n\t\t);\n\t}\n}\n\n/**\n * Validate that a string is a safe SQL identifier, allowing hyphens.\n *\n * Like `validateIdentifier` but also permits hyphens, which appear in\n * plugin IDs (e.g., \"my-plugin\"). Matches `/^[a-z][a-z0-9_-]*$/`.\n *\n * @param value - The string to validate\n * @param label - Human-readable label for error messages\n * @throws {IdentifierError} If the value is not valid\n */\nexport function validatePluginIdentifier(value: string, label = \"plugin identifier\"): void {\n\tif (!value || typeof value !== \"string\") {\n\t\tthrow new IdentifierError(`${label} must be a non-empty string`, String(value));\n\t}\n\n\tif (value.length > MAX_IDENTIFIER_LENGTH) {\n\t\tthrow new IdentifierError(\n\t\t\t`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`,\n\t\t\tvalue,\n\t\t);\n\t}\n\n\tif (!PLUGIN_IDENTIFIER_PATTERN.test(value)) {\n\t\tthrow new IdentifierError(`${label} must match /^[a-z][a-z0-9_-]*$/ (got \"${value}\")`, value);\n\t}\n}\n\n/**\n * Validate a plugin storage collection name.\n *\n * Collections are declared as free-form manifest keys and stored as opaque\n * text, so this is deliberately more permissive than `validateIdentifier`:\n * `form-submissions` and `formSubmissions` are legitimate. The charset still\n * rejects quotes and punctuation, keeping generated index names inert.\n *\n * @param value - The string to validate\n * @param label - Human-readable label for error messages\n * @throws {IdentifierError} If the value is not valid\n */\nexport function validateStorageCollectionName(value: string, label = \"collection name\"): void {\n\tif (!value || typeof value !== \"string\") {\n\t\tthrow new IdentifierError(`${label} must be a non-empty string`, String(value));\n\t}\n\n\tif (value.length > MAX_IDENTIFIER_LENGTH) {\n\t\tthrow new IdentifierError(\n\t\t\t`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`,\n\t\t\tvalue,\n\t\t);\n\t}\n\n\tif (!STORAGE_COLLECTION_PATTERN.test(value)) {\n\t\tthrow new IdentifierError(\n\t\t\t`${label} must match /^[a-zA-Z][a-zA-Z0-9_-]*$/ (got \"${value}\")`,\n\t\t\tvalue,\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,qBAAqB;;;;;AAM3B,MAAM,6BAA6B;;;;;AAMnC,MAAM,4BAA4B;;;;;;AAOlC,MAAM,6BAA6B;;;;;AAMnC,MAAM,wBAAwB;;;;AAK9B,IAAa,kBAAb,cAAqC,MAAM;CAC1C,YACC,SACA,AAAO,YACN;AACD,QAAM,QAAQ;EAFP;AAGP,OAAK,OAAO;;;;;;;;;;;;;;;;;;;;AAqBd,SAAgB,mBAAmB,OAAe,QAAQ,cAAoB;AAC7E,KAAI,CAAC,SAAS,OAAO,UAAU,SAC9B,OAAM,IAAI,gBAAgB,GAAG,MAAM,8BAA8B,OAAO,MAAM,CAAC;AAGhF,KAAI,MAAM,SAAS,sBAClB,OA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gBACT,GAAG,MAAM,+CAA+C,MAAM,KAC9D,MACA"}
@@ -1,7 +1,7 @@
1
- import { d as FieldType } from "./types-jISEalTX.mjs";
2
- import { t as Database } from "./types-84Bque3-.mjs";
3
- import { d as Storage } from "./types-CcSZCcF1.mjs";
4
- import { i as SiteSettings } from "./types-DQLZ58GV.mjs";
1
+ import { d as FieldType } from "./types-BnFP1M3J.mjs";
2
+ import { t as Database } from "./types-Dc4ntQjQ.mjs";
3
+ import { d as Storage } from "./types-DLG4IFEQ.mjs";
4
+ import { i as SiteSettings } from "./types-LoagAGzH.mjs";
5
5
  import { Kysely } from "kysely";
6
6
 
7
7
  //#region src/seed/types.d.ts
@@ -57,6 +57,16 @@ interface SeedCollection {
57
57
  icon?: string;
58
58
  supports?: ("drafts" | "revisions" | "preview" | "scheduling" | "search" | "seo")[];
59
59
  urlPattern?: string;
60
+ /**
61
+ * Omit this collection from the admin sidebar. It stays reachable through
62
+ * the API, MCP, plugin hooks, and direct `/content/:collection` URLs.
63
+ */
64
+ hidden?: boolean;
65
+ /**
66
+ * Explicit position in the admin sidebar (ascending). Collections without
67
+ * a `sortOrder` keep the alphabetical order and follow the ordered ones.
68
+ */
69
+ sortOrder?: number;
60
70
  /** Enable comments on this collection */
61
71
  commentsEnabled?: boolean;
62
72
  fields: SeedField[];
@@ -379,4 +389,4 @@ declare function loadUserSeed(): Promise<SeedFile | null>;
379
389
  declare function validateSeed(data: unknown): ValidationResult;
380
390
  //#endregion
381
391
  export { SeedTaxonomyTerm as _, applySeed as a, ValidationResult as b, SeedCollection as c, SeedFile as d, SeedMenu as f, SeedTaxonomy as g, SeedSection as h, defaultSeed as i, SeedContentEntry as l, SeedRedirect as m, loadSeed as n, SeedApplyOptions as o, SeedMenuItem as p, loadUserSeed as r, SeedApplyResult as s, validateSeed as t, SeedField as u, SeedWidget as v, SeedWidgetArea as y };
382
- //# sourceMappingURL=validate-CdYcY-Ln.d.mts.map
392
+ //# sourceMappingURL=validate-C3oSmA7F.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-C3oSmA7F.d.mts","names":[],"sources":["../src/seed/types.ts","../src/seed/apply.ts","../src/seed/default.ts","../src/seed/load.ts","../src/seed/validate.ts"],"mappings":";;;;;;;;;;UAciB,QAAA;EA8BH;EA5Bb,OAAA;EAkCY;EA/BZ,OAAA;EAqCW;;;;;;;EA5BX,aAAA;EAAA;EAGA,IAAA;IACC,IAAA;IACA,WAAA;IACA,MAAA;EAAA;EAIU;EAAX,QAAA,GAAW,OAAA,CAAQ,YAAA;EAGnB;EAAA,WAAA,GAAc,cAAA;EAGd;EAAA,UAAA,GAAa,YAAA;EAGb;EAAA,KAAA,GAAQ,QAAA;EAGR;EAAA,SAAA,GAAY,YAAA;EAGZ;EAAA,WAAA,GAAc,cAAA;EAGd;EAAA,QAAA,GAAW,WAAA;EAGX;EAAA,OAAA,GAAU,UAAA;EAGV;EAAA,OAAA,GAAU,MAAA,SAAe,gBAAA;AAAA;;;AAM1B;UAAiB,cAAA;EAChB,IAAA;EACA,KAAA;EACA,aAAA;EACA,WAAA;EACA,IAAA;EACA,QAAA;EACA,UAAA;EADA;;;;EAMA,MAAA;EAQA;;;;EAHA,SAAA;EASyB;EAPzB,eAAA;EACA,MAAA,EAAQ,SAAA;AAAA;;;;UAMQ,SAAA;EAChB,IAAA;EACA,KAAA;EACA,IAAA,EAAM,SAAA;EACN,QAAA;EACA,MAAA;EACA,UAAA;EACA,YAAA;EACA,UAAA,GAAa,MAAA;EACb,MAAA;EACA,OAAA,GAAU,MAAA;AAAA;;;;AAOX;UAAiB,YAAA;;EAEhB,EAAA;EACA,IAAA;EACA,KAAA;EACA,aAAA;EACA,YAAA;EACA,WAAA;EACA,MAAA;EACA,aAAA;EACA,KAAA,GAAQ,gBAAA;AAAA;;;;UAMQ,gBAAA;EAAgB;EAEhC,EAAA;EACA,IAAA;EACA,KAAA;EACA,WAAA;EACA,MAAA;EACA,MAAA;EACA,aAAA;AAAA;;;;UAMgB,QAA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exportAll } from "./runner-BFTrkYhu.mjs";
2
2
  import { i as resolveConfiguredLocale, n as getI18nConfig } from "./config-DyF3OKg_.mjs";
3
- import { n as FIELD_TYPES } from "./types-o7xo7VgH.mjs";
3
+ import { n as FIELD_TYPES } from "./types-NBI3rF-_.mjs";
4
4
 
5
5
  //#region src/seed/validate.ts
6
6
  /**
@@ -357,4 +357,4 @@ function validateMenuItemRefs(items, contentIds, warnings) {
357
357
 
358
358
  //#endregion
359
359
  export { validate_exports as n, validateSeed as t };
360
- //# sourceMappingURL=validate-Bs_wT2ul.mjs.map
360
+ //# sourceMappingURL=validate-mKo3RxBM.mjs.map