emdash 0.26.0 → 0.28.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 (564) hide show
  1. package/dist/{adapters-DAAjOID4.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
  2. package/dist/{adapters-DAAjOID4.d.mts.map → adapters-hUy8vOB-.d.mts.map} +1 -1
  3. package/dist/{allowed-origins-D5FxMUo8.mjs → allowed-origins-CRsJ6BPM.mjs} +2 -2
  4. package/dist/{allowed-origins-D5FxMUo8.mjs.map → allowed-origins-CRsJ6BPM.mjs.map} +1 -1
  5. package/dist/api/route-utils.d.mts +3 -3
  6. package/dist/api/route-utils.mjs +17 -16
  7. package/dist/api/route-utils.mjs.map +1 -1
  8. package/dist/api/schemas/index.d.mts +1 -1
  9. package/dist/api/schemas/index.mjs +3 -3
  10. package/dist/{api-BMfveMoB.mjs → api-BFURZn1i.mjs} +104 -38
  11. package/dist/api-BFURZn1i.mjs.map +1 -0
  12. package/dist/{api-tokens-D6ppjIVi.mjs → api-tokens-DvqeZmVq.mjs} +2 -2
  13. package/dist/{api-tokens-D6ppjIVi.mjs.map → api-tokens-DvqeZmVq.mjs.map} +1 -1
  14. package/dist/{apply--IVNSdXn.mjs → apply-Bu-8nYHL.mjs} +113 -76
  15. package/dist/apply-Bu-8nYHL.mjs.map +1 -0
  16. package/dist/astro/index.d.mts +12 -11
  17. package/dist/astro/index.d.mts.map +1 -1
  18. package/dist/astro/index.mjs +13 -5
  19. package/dist/astro/index.mjs.map +1 -1
  20. package/dist/astro/middleware/auth.d.mts +10 -9
  21. package/dist/astro/middleware/auth.d.mts.map +1 -1
  22. package/dist/astro/middleware/auth.mjs +52 -12
  23. package/dist/astro/middleware/auth.mjs.map +1 -1
  24. package/dist/astro/middleware/redirect.mjs +5 -5
  25. package/dist/astro/middleware/request-context.mjs +2 -2
  26. package/dist/astro/middleware/setup.mjs +1 -1
  27. package/dist/astro/middleware.d.mts +2 -9
  28. package/dist/astro/middleware.d.mts.map +1 -1
  29. package/dist/astro/middleware.mjs +125 -71
  30. package/dist/astro/middleware.mjs.map +1 -1
  31. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
  32. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
  33. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  34. package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
  35. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  36. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +8 -8
  37. package/dist/astro/routes/api/admin/byline-fields/index.mjs +8 -8
  38. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +8 -8
  39. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +14 -14
  40. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +14 -14
  41. package/dist/astro/routes/api/admin/bylines/index.mjs +14 -14
  42. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
  43. package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
  44. package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
  45. package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
  46. package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
  47. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
  48. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  49. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
  50. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
  51. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +38 -37
  52. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  53. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +38 -37
  54. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  55. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +37 -36
  56. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  57. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +36 -35
  58. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  59. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +36 -35
  60. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  61. package/dist/astro/routes/api/admin/plugins/index.mjs +37 -36
  62. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  63. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
  64. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +36 -35
  65. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  66. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +36 -35
  67. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  68. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +36 -35
  69. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  70. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +36 -35
  71. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  72. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +37 -36
  73. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  74. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +36 -35
  75. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  76. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +37 -36
  77. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  78. package/dist/astro/routes/api/admin/plugins/updates.mjs +36 -35
  79. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  80. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +36 -35
  81. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  82. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
  83. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +36 -35
  84. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  85. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
  86. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  87. package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
  88. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
  89. package/dist/astro/routes/api/admin/users/index.mjs +6 -6
  90. package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
  91. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  92. package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
  93. package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
  94. package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
  95. package/dist/astro/routes/api/auth/logout.mjs +3 -3
  96. package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
  97. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  98. package/dist/astro/routes/api/auth/me.mjs +7 -7
  99. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  100. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  101. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  102. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
  103. package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
  104. package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
  105. package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
  106. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
  107. package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
  108. package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
  109. package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
  110. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  111. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
  112. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
  113. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
  114. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
  115. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
  116. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
  117. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
  118. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -7
  119. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
  120. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
  121. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +7 -7
  122. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
  123. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
  124. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
  125. package/dist/astro/routes/api/content/_collection_/_id_.mjs +7 -7
  126. package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
  127. package/dist/astro/routes/api/content/_collection_/index.mjs +7 -7
  128. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
  129. package/dist/astro/routes/api/dashboard.mjs +8 -8
  130. package/dist/astro/routes/api/dev/emails.mjs +3 -3
  131. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  132. package/dist/astro/routes/api/import/probe.mjs +19 -11
  133. package/dist/astro/routes/api/import/probe.mjs.map +1 -1
  134. package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
  135. package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -40
  136. package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
  137. package/dist/astro/routes/api/import/wordpress/execute.mjs +12 -407
  138. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  139. package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -9
  140. package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
  141. package/dist/astro/routes/api/import/wordpress/media.mjs +9 -9
  142. package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
  143. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +19 -1
  144. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
  145. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +97 -79
  146. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
  147. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  148. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -11
  149. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
  150. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +40 -2
  151. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
  152. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +519 -39
  153. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  154. package/dist/astro/routes/api/manifest.d.mts.map +1 -1
  155. package/dist/astro/routes/api/manifest.mjs +14 -5
  156. package/dist/astro/routes/api/manifest.mjs.map +1 -1
  157. package/dist/astro/routes/api/mcp.mjs +39 -39
  158. package/dist/astro/routes/api/media/_id_/confirm.mjs +7 -7
  159. package/dist/astro/routes/api/media/_id_.mjs +7 -7
  160. package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
  161. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
  162. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
  163. package/dist/astro/routes/api/media/providers/index.mjs +3 -3
  164. package/dist/astro/routes/api/media/upload-url.mjs +8 -8
  165. package/dist/astro/routes/api/media.mjs +9 -9
  166. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +9 -9
  167. package/dist/astro/routes/api/menus/_name_/items.mjs +9 -9
  168. package/dist/astro/routes/api/menus/_name_/reorder.mjs +9 -9
  169. package/dist/astro/routes/api/menus/_name_/translations.mjs +9 -9
  170. package/dist/astro/routes/api/menus/_name_.mjs +9 -9
  171. package/dist/astro/routes/api/menus/index.mjs +9 -9
  172. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  173. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  174. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  175. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  176. package/dist/astro/routes/api/oauth/register.mjs +3 -3
  177. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  178. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  179. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  180. package/dist/astro/routes/api/openapi.json.mjs +4 -4
  181. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
  182. package/dist/astro/routes/api/redirects/404s/index.mjs +9 -9
  183. package/dist/astro/routes/api/redirects/404s/summary.mjs +9 -9
  184. package/dist/astro/routes/api/redirects/_id_.mjs +10 -10
  185. package/dist/astro/routes/api/redirects/index.mjs +10 -10
  186. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
  187. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
  188. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +36 -35
  189. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  190. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +36 -35
  191. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  192. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +36 -35
  193. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  194. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +36 -35
  195. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  196. package/dist/astro/routes/api/schema/collections/index.mjs +36 -35
  197. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  198. package/dist/astro/routes/api/schema/index.mjs +7 -6
  199. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  200. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +36 -35
  201. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  202. package/dist/astro/routes/api/schema/orphans/index.mjs +36 -35
  203. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  204. package/dist/astro/routes/api/search/enable.mjs +10 -10
  205. package/dist/astro/routes/api/search/index.mjs +9 -9
  206. package/dist/astro/routes/api/search/rebuild.mjs +10 -10
  207. package/dist/astro/routes/api/search/stats.mjs +6 -6
  208. package/dist/astro/routes/api/search/suggest.mjs +9 -9
  209. package/dist/astro/routes/api/sections/_slug_.mjs +9 -9
  210. package/dist/astro/routes/api/sections/index.mjs +9 -9
  211. package/dist/astro/routes/api/settings/email.mjs +4 -4
  212. package/dist/astro/routes/api/settings.mjs +12 -12
  213. package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
  214. package/dist/astro/routes/api/setup/admin.mjs +10 -10
  215. package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
  216. package/dist/astro/routes/api/setup/dev-bypass.mjs +28 -25
  217. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  218. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  219. package/dist/astro/routes/api/setup/index.mjs +26 -25
  220. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  221. package/dist/astro/routes/api/setup/status.mjs +4 -4
  222. package/dist/astro/routes/api/snapshot.mjs +6 -6
  223. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +13 -13
  224. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +13 -13
  225. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +13 -13
  226. package/dist/astro/routes/api/taxonomies/index.mjs +13 -13
  227. package/dist/astro/routes/api/themes/preview.mjs +5 -5
  228. package/dist/astro/routes/api/typegen.mjs +5 -5
  229. package/dist/astro/routes/api/well-known/auth.mjs +1 -1
  230. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  231. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  232. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +7 -7
  233. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -9
  234. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -9
  235. package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
  236. package/dist/astro/routes/api/widget-areas/index.mjs +9 -9
  237. package/dist/astro/routes/api/widget-components.mjs +3 -3
  238. package/dist/astro/routes/robots.txt.mjs +6 -6
  239. package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
  240. package/dist/astro/routes/sitemap.xml.mjs +7 -7
  241. package/dist/astro/types.d.mts +14 -12
  242. package/dist/astro/types.d.mts.map +1 -1
  243. package/dist/auth/providers/github.d.mts +1 -1
  244. package/dist/auth/providers/google.d.mts +1 -1
  245. package/dist/{authorize-BZnOGJFo.mjs → authorize-Dz88F_Fw.mjs} +2 -2
  246. package/dist/{authorize-BZnOGJFo.mjs.map → authorize-Dz88F_Fw.mjs.map} +1 -1
  247. package/dist/{byline-LL8lyqdb.mjs → byline-Bm8ZgUP9.mjs} +6 -6
  248. package/dist/{byline-LL8lyqdb.mjs.map → byline-Bm8ZgUP9.mjs.map} +1 -1
  249. package/dist/{byline-fields-eyJMblSr.mjs → byline-fields-2Lp5Hbgf.mjs} +18 -3
  250. package/dist/byline-fields-2Lp5Hbgf.mjs.map +1 -0
  251. package/dist/{byline-fields-DaMKzkhO.mjs → byline-fields-CIx_GuN4.mjs} +1 -1
  252. package/dist/{byline-fields-DaMKzkhO.mjs.map → byline-fields-CIx_GuN4.mjs.map} +1 -1
  253. package/dist/{byline-fields-KD3JFRuH.d.mts → byline-fields-Cgrt9-aL.d.mts} +18 -3
  254. package/dist/{byline-fields-KD3JFRuH.d.mts.map → byline-fields-Cgrt9-aL.d.mts.map} +1 -1
  255. package/dist/{bylines-BmJ7Vg7J.mjs → bylines-6tm9mgQb.mjs} +4 -4
  256. package/dist/{bylines-BmJ7Vg7J.mjs.map → bylines-6tm9mgQb.mjs.map} +1 -1
  257. package/dist/{bylines-DE47vP8d.mjs → bylines-Woq87129.mjs} +6 -6
  258. package/dist/{bylines-DE47vP8d.mjs.map → bylines-Woq87129.mjs.map} +1 -1
  259. package/dist/{cache-D9jF5bYw.mjs → cache-CEBAZjir.mjs} +2 -2
  260. package/dist/{cache-D9jF5bYw.mjs.map → cache-CEBAZjir.mjs.map} +1 -1
  261. package/dist/{challenge-store-LhiqMccz.mjs → challenge-store-anhwVER0.mjs} +1 -1
  262. package/dist/{challenge-store-LhiqMccz.mjs.map → challenge-store-anhwVER0.mjs.map} +1 -1
  263. package/dist/{chunks-OCG163rN.mjs → chunks-B2isWQhr.mjs} +2 -2
  264. package/dist/{chunks-OCG163rN.mjs.map → chunks-B2isWQhr.mjs.map} +1 -1
  265. package/dist/cli/index.mjs +23 -22
  266. package/dist/cli/index.mjs.map +1 -1
  267. package/dist/client/cf-access.d.mts +1 -1
  268. package/dist/client/index.d.mts +1 -1
  269. package/dist/client/index.mjs +2 -2
  270. package/dist/{comment-D9BLDpZI.mjs → comment-CzeatwBV.mjs} +3 -3
  271. package/dist/{comment-D9BLDpZI.mjs.map → comment-CzeatwBV.mjs.map} +1 -1
  272. package/dist/{comment-reaction-Drl9SkNu.mjs → comment-reaction-Cj9QJY7I.mjs} +2 -2
  273. package/dist/{comment-reaction-Drl9SkNu.mjs.map → comment-reaction-Cj9QJY7I.mjs.map} +1 -1
  274. package/dist/{comments-BjJ9SKGU.mjs → comments-BLE-jv5k.mjs} +3 -3
  275. package/dist/{comments-BjJ9SKGU.mjs.map → comments-BLE-jv5k.mjs.map} +1 -1
  276. package/dist/{components-CYt4uVK9.mjs → components-B_sATNUc.mjs} +1 -1
  277. package/dist/{components-CYt4uVK9.mjs.map → components-B_sATNUc.mjs.map} +1 -1
  278. package/dist/{content-ncUWWjna.mjs → content-DhgEth4k.mjs} +4 -4
  279. package/dist/{content-ncUWWjna.mjs.map → content-DhgEth4k.mjs.map} +1 -1
  280. package/dist/content-refresh-CA4uKwzH.mjs +1531 -0
  281. package/dist/content-refresh-CA4uKwzH.mjs.map +1 -0
  282. package/dist/{context-C_g-iJVA.mjs → context-CUsR9dXL.mjs} +76 -54
  283. package/dist/context-CUsR9dXL.mjs.map +1 -0
  284. package/dist/{cron-C5LVoNmP.mjs → cron-v4FTEFR_.mjs} +1 -1
  285. package/dist/{cron-C5LVoNmP.mjs.map → cron-v4FTEFR_.mjs.map} +1 -1
  286. package/dist/{dashboard-CotyqQrW.mjs → dashboard-EvEKF5en.mjs} +4 -4
  287. package/dist/{dashboard-CotyqQrW.mjs.map → dashboard-EvEKF5en.mjs.map} +1 -1
  288. package/dist/db/index.d.mts +3 -3
  289. package/dist/db/index.mjs +1 -1
  290. package/dist/db/libsql.d.mts +1 -1
  291. package/dist/db/postgres.d.mts +1 -1
  292. package/dist/db/sqlite.d.mts +1 -1
  293. package/dist/{default-CeRG-Ot4.mjs → default-CM_D83Mg.mjs} +1 -1
  294. package/dist/{default-CeRG-Ot4.mjs.map → default-CM_D83Mg.mjs.map} +1 -1
  295. package/dist/{device-flow-DENDCQ9F.mjs → device-flow-CfGP18Uw.mjs} +4 -4
  296. package/dist/{device-flow-DENDCQ9F.mjs.map → device-flow-CfGP18Uw.mjs.map} +1 -1
  297. package/dist/{email-console-DJP32ucW.mjs → email-console-CIf4Lfvv.mjs} +1 -1
  298. package/dist/{email-console-DJP32ucW.mjs.map → email-console-CIf4Lfvv.mjs.map} +1 -1
  299. package/dist/{error-rVGiqWDt.mjs → error-CkAseSqZ.mjs} +2 -2
  300. package/dist/{error-rVGiqWDt.mjs.map → error-CkAseSqZ.mjs.map} +1 -1
  301. package/dist/{escape-Bjio4ZsM.mjs → escape-DqD0aCKu.mjs} +1 -1
  302. package/dist/{escape-Bjio4ZsM.mjs.map → escape-DqD0aCKu.mjs.map} +1 -1
  303. package/dist/{field-defs-cache-ljXzJCfc.mjs → field-defs-cache-WUI88LX5.mjs} +2 -2
  304. package/dist/{field-defs-cache-ljXzJCfc.mjs.map → field-defs-cache-WUI88LX5.mjs.map} +1 -1
  305. package/dist/{fts-manager-BbCCbEKA.mjs → fts-manager-BbFaF_V8.mjs} +2 -2
  306. package/dist/{fts-manager-BbCCbEKA.mjs.map → fts-manager-BbFaF_V8.mjs.map} +1 -1
  307. package/dist/{import-Bb1T9WJS.mjs → import-fYLf14Co.mjs} +514 -25
  308. package/dist/import-fYLf14Co.mjs.map +1 -0
  309. package/dist/{index-BRNabKrx.d.mts → index-B9sIxwe4.d.mts} +2420 -2379
  310. package/dist/index-B9sIxwe4.d.mts.map +1 -0
  311. package/dist/{index-Dt0OKJB4.d.mts → index-Bm-Gy8Mh.d.mts} +25 -4
  312. package/dist/index-Bm-Gy8Mh.d.mts.map +1 -0
  313. package/dist/index.d.mts +18 -17
  314. package/dist/index.mjs +54 -53
  315. package/dist/{load-DMjXghbZ.mjs → load-Djn3HWQS.mjs} +2 -2
  316. package/dist/{load-DMjXghbZ.mjs.map → load-Djn3HWQS.mjs.map} +1 -1
  317. package/dist/{loader-BA_zhkS_.mjs → loader-CB6YHeul.mjs} +6 -5
  318. package/dist/loader-CB6YHeul.mjs.map +1 -0
  319. package/dist/{manifest-schema-kPGX7VS-.mjs → manifest-schema-BHlgZM1W.mjs} +1 -1
  320. package/dist/{manifest-schema-kPGX7VS-.mjs.map → manifest-schema-BHlgZM1W.mjs.map} +1 -1
  321. package/dist/media/index.d.mts +1 -1
  322. package/dist/media/local-runtime.d.mts +12 -11
  323. package/dist/media/local-runtime.d.mts.map +1 -1
  324. package/dist/media/local-runtime.mjs +5 -5
  325. package/dist/{media-C5t_eCnk.mjs → media-BrXIaMFN.mjs} +2 -2
  326. package/dist/{media-C5t_eCnk.mjs.map → media-BrXIaMFN.mjs.map} +1 -1
  327. package/dist/{media-allowlist-Du8t1u6a.mjs → media-allowlist-CRHEeJ_i.mjs} +1 -1
  328. package/dist/{media-allowlist-Du8t1u6a.mjs.map → media-allowlist-CRHEeJ_i.mjs.map} +1 -1
  329. package/dist/{media-url-O4rm9-SQ.mjs → media-url-CKi5XSw4.mjs} +1 -1
  330. package/dist/{media-url-O4rm9-SQ.mjs.map → media-url-CKi5XSw4.mjs.map} +1 -1
  331. package/dist/{menus-CBb6UrMU.mjs → menus-Cfivc2Ad.mjs} +3 -3
  332. package/dist/{menus-CBb6UrMU.mjs.map → menus-Cfivc2Ad.mjs.map} +1 -1
  333. package/dist/{menus-CYH09a41.mjs → menus-CsZ2ZEK2.mjs} +16 -12
  334. package/dist/{menus-CYH09a41.mjs.map → menus-CsZ2ZEK2.mjs.map} +1 -1
  335. package/dist/{mode-BB0F8xTC.mjs → mode-BM9QgEmt.mjs} +1 -1
  336. package/dist/{mode-BB0F8xTC.mjs.map → mode-BM9QgEmt.mjs.map} +1 -1
  337. package/dist/{oauth-authorization-CsvzIp_F.mjs → oauth-authorization-CXWkIGT4.mjs} +4 -4
  338. package/dist/{oauth-authorization-CsvzIp_F.mjs.map → oauth-authorization-CXWkIGT4.mjs.map} +1 -1
  339. package/dist/{oauth-clients-C9SYwEbZ.mjs → oauth-clients-BmTI5rsl.mjs} +1 -1
  340. package/dist/{oauth-clients-C9SYwEbZ.mjs.map → oauth-clients-BmTI5rsl.mjs.map} +1 -1
  341. package/dist/{oauth-state-store---zrApfB.mjs → oauth-state-store-YLFLcH5F.mjs} +1 -1
  342. package/dist/{oauth-state-store---zrApfB.mjs.map → oauth-state-store-YLFLcH5F.mjs.map} +1 -1
  343. package/dist/{oauth-user-lookup-SHsWRlG9.mjs → oauth-user-lookup-Bsc_GsX-.mjs} +1 -1
  344. package/dist/{oauth-user-lookup-SHsWRlG9.mjs.map → oauth-user-lookup-Bsc_GsX-.mjs.map} +1 -1
  345. package/dist/object-cache/memory.d.mts +1 -1
  346. package/dist/{object-cache-CHbHv83-.mjs → object-cache-Bok5j2ae.mjs} +43 -3
  347. package/dist/object-cache-Bok5j2ae.mjs.map +1 -0
  348. package/dist/{options-41nCWqi9.d.mts → options-iMpRRxIe.d.mts} +3 -3
  349. package/dist/{options-41nCWqi9.d.mts.map → options-iMpRRxIe.d.mts.map} +1 -1
  350. package/dist/page/index.d.mts +2 -2
  351. package/dist/{parse-BwAdS7FZ.mjs → parse-GmjecGct.mjs} +2 -2
  352. package/dist/{parse-BwAdS7FZ.mjs.map → parse-GmjecGct.mjs.map} +1 -1
  353. package/dist/{passkey-config-C0YfSBko.mjs → passkey-config-De0ahnRg.mjs} +1 -1
  354. package/dist/{passkey-config-C0YfSBko.mjs.map → passkey-config-De0ahnRg.mjs.map} +1 -1
  355. package/dist/{placeholder-Cuce9U-m.d.mts → placeholder-BSKwzRe4.d.mts} +1 -1
  356. package/dist/{placeholder-Cuce9U-m.d.mts.map → placeholder-BSKwzRe4.d.mts.map} +1 -1
  357. package/dist/plugin-types.d.mts +1 -1
  358. package/dist/plugin-utils.d.mts +10 -9
  359. package/dist/plugin-utils.d.mts.map +1 -1
  360. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -9
  361. package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
  362. package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
  363. package/dist/{portable-text-BICg8bTk.mjs → portable-text-cCa0cGV6.mjs} +1 -1
  364. package/dist/{portable-text-BICg8bTk.mjs.map → portable-text-cCa0cGV6.mjs.map} +1 -1
  365. package/dist/{preview-DKGCt2_p.mjs → preview-SSXNVPAC.mjs} +2 -2
  366. package/dist/{preview-DKGCt2_p.mjs.map → preview-SSXNVPAC.mjs.map} +1 -1
  367. package/dist/{public-url-CTVqgMmg.mjs → public-url-Danv47cS.mjs} +1 -1
  368. package/dist/{public-url-CTVqgMmg.mjs.map → public-url-Danv47cS.mjs.map} +1 -1
  369. package/dist/{query-BpQb-blG.mjs → query-ByGq6ver.mjs} +14 -14
  370. package/dist/{query-BpQb-blG.mjs.map → query-ByGq6ver.mjs.map} +1 -1
  371. package/dist/{rate-limit-Dap6HMNM.mjs → rate-limit-C_Lf63Dd.mjs} +2 -2
  372. package/dist/{rate-limit-Dap6HMNM.mjs.map → rate-limit-C_Lf63Dd.mjs.map} +1 -1
  373. package/dist/{redirect-CS-PHtNh.mjs → redirect-CoW3G-0U.mjs} +1 -1
  374. package/dist/{redirect-CS-PHtNh.mjs.map → redirect-CoW3G-0U.mjs.map} +1 -1
  375. package/dist/{redirect-_M0trWoo.mjs → redirect-IyfNirgS.mjs} +2 -2
  376. package/dist/{redirect-_M0trWoo.mjs.map → redirect-IyfNirgS.mjs.map} +1 -1
  377. package/dist/{redirects-w0V9vj_j.mjs → redirects-Bs1g42Ri.mjs} +4 -4
  378. package/dist/{redirects-w0V9vj_j.mjs.map → redirects-Bs1g42Ri.mjs.map} +1 -1
  379. package/dist/{redirects-Dcbuisoj.mjs → redirects-DXEXBAII.mjs} +2 -2
  380. package/dist/{redirects-Dcbuisoj.mjs.map → redirects-DXEXBAII.mjs.map} +1 -1
  381. package/dist/{registry-g8yYt4cC.mjs → registry-B65mUtPa.mjs} +122 -79
  382. package/dist/registry-B65mUtPa.mjs.map +1 -0
  383. package/dist/{request-meta-CmS1tDFf.mjs → request-meta-DbvXaAvU.mjs} +2 -2
  384. package/dist/{request-meta-CmS1tDFf.mjs.map → request-meta-DbvXaAvU.mjs.map} +1 -1
  385. package/dist/{resolve-C7I0qiR0.mjs → resolve-DR3wqMTy.mjs} +1 -1
  386. package/dist/{resolve-C7I0qiR0.mjs.map → resolve-DR3wqMTy.mjs.map} +1 -1
  387. package/dist/{runner-BbR3DfrL.d.mts → runner-DvFWoz8-.d.mts} +2 -2
  388. package/dist/{runner-BbR3DfrL.d.mts.map → runner-DvFWoz8-.d.mts.map} +1 -1
  389. package/dist/{runner-DPdt_Wpa.mjs → runner-K8XK101B.mjs} +351 -199
  390. package/dist/runner-K8XK101B.mjs.map +1 -0
  391. package/dist/runtime.d.mts +11 -10
  392. package/dist/runtime.d.mts.map +1 -1
  393. package/dist/runtime.mjs +2 -2
  394. package/dist/scheduled-publish-Drffrf2a.d.mts +11 -0
  395. package/dist/scheduled-publish-Drffrf2a.d.mts.map +1 -0
  396. package/dist/{schema-DoLd3j2e.mjs → schema-Blhoxp3P.mjs} +5 -5
  397. package/dist/{schema-DoLd3j2e.mjs.map → schema-Blhoxp3P.mjs.map} +1 -1
  398. package/dist/{search-BR0ZeZmh.mjs → search-DZN2HZ-V.mjs} +6 -4
  399. package/dist/search-DZN2HZ-V.mjs.map +1 -0
  400. package/dist/{secrets-BSf9pRRY.mjs → secrets-kp760LlD.mjs} +2 -2
  401. package/dist/{secrets-BSf9pRRY.mjs.map → secrets-kp760LlD.mjs.map} +1 -1
  402. package/dist/{sections-5J2YJPqJ.mjs → sections-CpF5SaGr.mjs} +3 -3
  403. package/dist/{sections-5J2YJPqJ.mjs.map → sections-CpF5SaGr.mjs.map} +1 -1
  404. package/dist/seed/index.d.mts +2 -2
  405. package/dist/seed/index.mjs +19 -18
  406. package/dist/seo/index.d.mts +1 -1
  407. package/dist/seo/index.mjs +1 -1
  408. package/dist/{seo-BkhuuaaE.mjs → seo-89-53DDs.mjs} +1 -1
  409. package/dist/{seo-BkhuuaaE.mjs.map → seo-89-53DDs.mjs.map} +1 -1
  410. package/dist/{seo-DKeXHkzE.mjs → seo-DXu2UQnC.mjs} +3 -3
  411. package/dist/{seo-DKeXHkzE.mjs.map → seo-DXu2UQnC.mjs.map} +1 -1
  412. package/dist/{service-BbO2s8gT.mjs → service-DQmiBMzt.mjs} +3 -3
  413. package/dist/{service-BbO2s8gT.mjs.map → service-DQmiBMzt.mjs.map} +1 -1
  414. package/dist/{session-user-B8aLtKAH.mjs → session-user-Cascbax7.mjs} +1 -1
  415. package/dist/{session-user-B8aLtKAH.mjs.map → session-user-Cascbax7.mjs.map} +1 -1
  416. package/dist/{settings-BMNr9Dmi.mjs → settings-rZyHEcNT.mjs} +3 -3
  417. package/dist/{settings-BMNr9Dmi.mjs.map → settings-rZyHEcNT.mjs.map} +1 -1
  418. package/dist/{settings-DJeki-97.mjs → settings-zhmdKyJQ.mjs} +5 -5
  419. package/dist/{settings-DJeki-97.mjs.map → settings-zhmdKyJQ.mjs.map} +1 -1
  420. package/dist/{setup-complete-gEiySUc-.mjs → setup-complete-Cb3LRyzy.mjs} +1 -1
  421. package/dist/{setup-complete-gEiySUc-.mjs.map → setup-complete-Cb3LRyzy.mjs.map} +1 -1
  422. package/dist/{setup-nonce-DzS50zme.mjs → setup-nonce-Z8x0tHf8.mjs} +1 -1
  423. package/dist/{setup-nonce-DzS50zme.mjs.map → setup-nonce-Z8x0tHf8.mjs.map} +1 -1
  424. package/dist/{single-flight-cache-Cdfkic3t.mjs → single-flight-cache-BG3B_GhN.mjs} +1 -1
  425. package/dist/{single-flight-cache-Cdfkic3t.mjs.map → single-flight-cache-BG3B_GhN.mjs.map} +1 -1
  426. package/dist/{site-url-BLebyON8.mjs → site-url-BBfDTgZB.mjs} +1 -1
  427. package/dist/{site-url-BLebyON8.mjs.map → site-url-BBfDTgZB.mjs.map} +1 -1
  428. package/dist/{ssrf-BRKb343l.mjs → ssrf-1g7usGBg.mjs} +1 -1
  429. package/dist/{ssrf-BRKb343l.mjs.map → ssrf-1g7usGBg.mjs.map} +1 -1
  430. package/dist/{status-vUK0SA17.mjs → status-CqJQX1QN.mjs} +1 -1
  431. package/dist/{status-vUK0SA17.mjs.map → status-CqJQX1QN.mjs.map} +1 -1
  432. package/dist/storage/local.d.mts +1 -1
  433. package/dist/storage/local.mjs +1 -1
  434. package/dist/storage/s3.d.mts +1 -1
  435. package/dist/storage/s3.mjs +1 -1
  436. package/dist/{taxonomies-CM_fUqLU.mjs → taxonomies-BGBd16Eu.mjs} +4 -4
  437. package/dist/{taxonomies-CM_fUqLU.mjs.map → taxonomies-BGBd16Eu.mjs.map} +1 -1
  438. package/dist/{taxonomies-D13i2ctt.mjs → taxonomies-Cnb4F-Pb.mjs} +7 -7
  439. package/dist/{taxonomies-D13i2ctt.mjs.map → taxonomies-Cnb4F-Pb.mjs.map} +1 -1
  440. package/dist/{taxonomy-BU0LjdVb.mjs → taxonomy-BxGxZZdu.mjs} +4 -4
  441. package/dist/{taxonomy-BU0LjdVb.mjs.map → taxonomy-BxGxZZdu.mjs.map} +1 -1
  442. package/dist/{tokens-LeuXF9gG.mjs → tokens-BGT0TUUo.mjs} +1 -1
  443. package/dist/{tokens-LeuXF9gG.mjs.map → tokens-BGT0TUUo.mjs.map} +1 -1
  444. package/dist/{transport-BZ-03aFT.d.mts → transport-BMDWHSgZ.d.mts} +1 -1
  445. package/dist/{transport-BZ-03aFT.d.mts.map → transport-BMDWHSgZ.d.mts.map} +1 -1
  446. package/dist/{transport-_2nBz7e9.mjs → transport-DPefPMcz.mjs} +1 -1
  447. package/dist/{transport-_2nBz7e9.mjs.map → transport-DPefPMcz.mjs.map} +1 -1
  448. package/dist/{trusted-proxy-DZY5WCn2.mjs → trusted-proxy-VTPRiX2s.mjs} +1 -1
  449. package/dist/{trusted-proxy-DZY5WCn2.mjs.map → trusted-proxy-VTPRiX2s.mjs.map} +1 -1
  450. package/dist/{types-ETmO_jQr.d.mts → types-BcLUUbbR.d.mts} +2 -2
  451. package/dist/{types-ETmO_jQr.d.mts.map → types-BcLUUbbR.d.mts.map} +1 -1
  452. package/dist/{types-BYnDBVwe.d.mts → types-CGbYowGQ.d.mts} +2 -2
  453. package/dist/{types-BYnDBVwe.d.mts.map → types-CGbYowGQ.d.mts.map} +1 -1
  454. package/dist/{types-BWqGVhFn.d.mts → types-CgvhU-hF.d.mts} +1 -1
  455. package/dist/{types-BWqGVhFn.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
  456. package/dist/{types-fS7-VTdR.d.mts → types-ClUkdbWb.d.mts} +1 -1
  457. package/dist/{types-fS7-VTdR.d.mts.map → types-ClUkdbWb.d.mts.map} +1 -1
  458. package/dist/{types-CZgK3EMW.mjs → types-CuW0zWDA.mjs} +2 -2
  459. package/dist/{types-CZgK3EMW.mjs.map → types-CuW0zWDA.mjs.map} +1 -1
  460. package/dist/{types-BG8_XTLj.d.mts → types-DmHk7vAt.d.mts} +1 -1
  461. package/dist/{types-BG8_XTLj.d.mts.map → types-DmHk7vAt.d.mts.map} +1 -1
  462. package/dist/{types-CQAugunJ.mjs → types-Jo3UYd6b.mjs} +1 -1
  463. package/dist/{types-CQAugunJ.mjs.map → types-Jo3UYd6b.mjs.map} +1 -1
  464. package/dist/{types-xIfVRNLp.d.mts → types-_HFLRzTn.d.mts} +22 -1
  465. package/dist/types-_HFLRzTn.d.mts.map +1 -0
  466. package/dist/{types-DrYMm9s5.d.mts → types-ea9sAPck.d.mts} +1 -1
  467. package/dist/{types-DrYMm9s5.d.mts.map → types-ea9sAPck.d.mts.map} +1 -1
  468. package/dist/{types-CNlaBFzx.d.mts → types-g_aFIdW0.d.mts} +1 -1
  469. package/dist/{types-CNlaBFzx.d.mts.map → types-g_aFIdW0.d.mts.map} +1 -1
  470. package/dist/{types-CUsXGRVj.d.mts → types-vgEWF18A.d.mts} +19 -1
  471. package/dist/{types-CUsXGRVj.d.mts.map → types-vgEWF18A.d.mts.map} +1 -1
  472. package/dist/{user-DkG2jKCp.mjs → user-BjAOvU3Z.mjs} +3 -3
  473. package/dist/{user-DkG2jKCp.mjs.map → user-BjAOvU3Z.mjs.map} +1 -1
  474. package/dist/{utils-B7A57fm9.mjs → utils-BJXElxdw.mjs} +156 -7
  475. package/dist/utils-BJXElxdw.mjs.map +1 -0
  476. package/dist/{validate-CuJ1Ps9j.mjs → validate-CWSnKVIJ.mjs} +2 -2
  477. package/dist/{validate-CuJ1Ps9j.mjs.map → validate-CWSnKVIJ.mjs.map} +1 -1
  478. package/dist/{validate-CG0V0wNR.d.mts → validate-Z1b86_3B.d.mts} +11 -6
  479. package/dist/{validate-CG0V0wNR.d.mts.map → validate-Z1b86_3B.d.mts.map} +1 -1
  480. package/dist/{validation-CwUfTdGF.mjs → validation-c8WjhH8z.mjs} +8 -5
  481. package/dist/{validation-CwUfTdGF.mjs.map → validation-c8WjhH8z.mjs.map} +1 -1
  482. package/dist/version-CaccU7DM.mjs +7 -0
  483. package/dist/{version-BoNBItP_.mjs.map → version-CaccU7DM.mjs.map} +1 -1
  484. package/dist/{widgets-BfOZ-ajY.mjs → widgets-hWcIicX8.mjs} +3 -3
  485. package/dist/{widgets-BfOZ-ajY.mjs.map → widgets-hWcIicX8.mjs.map} +1 -1
  486. package/dist/wxr-taxonomies-0_uxSrmf.d.mts +34 -0
  487. package/dist/wxr-taxonomies-0_uxSrmf.d.mts.map +1 -0
  488. package/dist/wxr-taxonomies-BC3OYpvx.mjs +425 -0
  489. package/dist/wxr-taxonomies-BC3OYpvx.mjs.map +1 -0
  490. package/dist/{zod-generator-gFsRuNNy.mjs → zod-generator-CacrR-i8.mjs} +2 -2
  491. package/dist/{zod-generator-gFsRuNNy.mjs.map → zod-generator-CacrR-i8.mjs.map} +1 -1
  492. package/package.json +6 -6
  493. package/src/api/handlers/content.ts +69 -23
  494. package/src/api/handlers/plugins.ts +77 -10
  495. package/src/api/schemas/import.ts +19 -0
  496. package/src/astro/integration/runtime.ts +3 -6
  497. package/src/astro/integration/vite-config.ts +19 -1
  498. package/src/astro/middleware/auth.ts +10 -3
  499. package/src/astro/middleware/csp.ts +54 -3
  500. package/src/astro/middleware.ts +1 -0
  501. package/src/astro/routes/admin.astro +9 -0
  502. package/src/astro/routes/api/admin/plugins/[id]/disable.ts +6 -1
  503. package/src/astro/routes/api/admin/plugins/[id]/enable.ts +6 -1
  504. package/src/astro/routes/api/admin/plugins/[id]/index.ts +1 -0
  505. package/src/astro/routes/api/admin/plugins/index.ts +1 -0
  506. package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +122 -98
  507. package/src/astro/routes/api/import/wordpress-plugin/execute.ts +794 -44
  508. package/src/astro/routes/api/manifest.ts +20 -1
  509. package/src/astro/routes/api/setup/dev-bypass.ts +7 -2
  510. package/src/astro/types.ts +4 -0
  511. package/src/cli/commands/seed.ts +1 -1
  512. package/src/components/EmDashImage.astro +59 -23
  513. package/src/components/Image.astro +36 -35
  514. package/src/components/LiveSearch.astro +40 -4
  515. package/src/components/live-search-routing.ts +30 -0
  516. package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +23 -18
  517. package/src/database/migrations/048_restore_content_taxonomies_term_index.ts +32 -0
  518. package/src/database/migrations/049_taxonomies_name_locale_index.ts +42 -0
  519. package/src/database/migrations/050_media_usage_index_status.ts +142 -0
  520. package/src/database/migrations/runner.ts +6 -0
  521. package/src/database/repositories/media-usage.ts +932 -58
  522. package/src/database/types.ts +22 -0
  523. package/src/emdash-runtime.ts +123 -3
  524. package/src/import/comments.ts +159 -0
  525. package/src/import/index.ts +8 -1
  526. package/src/import/settings.ts +65 -189
  527. package/src/import/sources/wordpress-plugin.ts +338 -42
  528. package/src/import/sources/wxr.ts +4 -1
  529. package/src/import/types.ts +12 -0
  530. package/src/import/utils.ts +207 -0
  531. package/src/import/wxr-taxonomies.ts +39 -0
  532. package/src/loader.ts +13 -2
  533. package/src/media/usage/content-fields.ts +119 -0
  534. package/src/media/usage/content-refresh.ts +524 -0
  535. package/src/media/usage/content-repair.ts +491 -0
  536. package/src/media/usage/content-snapshots.ts +435 -0
  537. package/src/media/usage/extractor.ts +4 -4
  538. package/src/media/usage/source-key.ts +22 -0
  539. package/src/menus/index.ts +17 -1
  540. package/src/object-cache/index.ts +82 -7
  541. package/src/plugins/context.ts +100 -71
  542. package/src/schema/registry.ts +240 -154
  543. package/src/search/query.ts +3 -0
  544. package/src/search/types.ts +2 -0
  545. package/src/seed/apply.ts +158 -101
  546. package/src/seed/types.ts +6 -1
  547. package/dist/api-BMfveMoB.mjs.map +0 -1
  548. package/dist/apply--IVNSdXn.mjs.map +0 -1
  549. package/dist/byline-fields-eyJMblSr.mjs.map +0 -1
  550. package/dist/context-C_g-iJVA.mjs.map +0 -1
  551. package/dist/import-Bb1T9WJS.mjs.map +0 -1
  552. package/dist/index-BRNabKrx.d.mts.map +0 -1
  553. package/dist/index-Dt0OKJB4.d.mts.map +0 -1
  554. package/dist/loader-BA_zhkS_.mjs.map +0 -1
  555. package/dist/object-cache-CHbHv83-.mjs.map +0 -1
  556. package/dist/registry-g8yYt4cC.mjs.map +0 -1
  557. package/dist/runner-DPdt_Wpa.mjs.map +0 -1
  558. package/dist/search-BR0ZeZmh.mjs.map +0 -1
  559. package/dist/types-xIfVRNLp.d.mts.map +0 -1
  560. package/dist/utils-B7A57fm9.mjs.map +0 -1
  561. package/dist/version-BoNBItP_.mjs +0 -7
  562. /package/dist/{api-tokens-B4BQybOp.mjs → api-tokens-DsvvCtdh.mjs} +0 -0
  563. /package/dist/{ssrf-CcX9zvMK.mjs → ssrf-CmuGgCq3.mjs} +0 -0
  564. /package/dist/{types-BvbeGEtr.mjs → types-DROWRxYV.mjs} +0 -0
@@ -1,6 +1,9 @@
1
+ import { s as invalidateCommentObjectCache } from "./object-cache-Bok5j2ae.mjs";
1
2
  import { n as slugify } from "./slugify-Cce3dTdg.mjs";
2
- import { a as validateExternalUrl, n as resolveAndValidateExternalUrl, r as ssrfSafeFetch } from "./ssrf-BRKb343l.mjs";
3
- import { a as getFilenameFromUrl, c as isInternalMetaKey, d as mapPostTypeToCollection, f as mapWpStatus, i as checkSchemaCompatibility, l as isInternalPostType, n as FEATURED_IMAGE_FIELD, o as guessMimeType, p as normalizeUrl$1, r as buildAttachmentMap, s as inferMetaType, t as BASE_REQUIRED_FIELDS, u as mapMetaKeyToField } from "./utils-B7A57fm9.mjs";
3
+ import { t as OptionsRepository } from "./options-DTTML-Tx.mjs";
4
+ import { o as invalidateSiteSettingsCache } from "./settings-zhmdKyJQ.mjs";
5
+ import { a as validateExternalUrl, n as resolveAndValidateExternalUrl, r as ssrfSafeFetch } from "./ssrf-1g7usGBg.mjs";
6
+ import { _ as sanitizeFieldSlug, a as getFilenameFromUrl, c as isInternalMetaKey, d as mapMetaKeyToField, f as mapPostTypeToCollection, h as relativizeContentLinks, i as checkSchemaCompatibility, l as isInternalPostType, m as normalizeUrl$1, n as FEATURED_IMAGE_FIELD, o as guessMimeType, p as mapWpStatus, r as buildAttachmentMap, s as inferMetaType, t as BASE_REQUIRED_FIELDS, u as isPluginBookkeepingMeta } from "./utils-BJXElxdw.mjs";
4
7
  import { ulid } from "ulidx";
5
8
  import sax from "sax";
6
9
  import { gutenbergToPortableText } from "@emdash-cms/gutenberg-to-portable-text";
@@ -844,6 +847,135 @@ function buildNavMenus(navMenuItemPosts, menuTermsBySlug) {
844
847
  return menus;
845
848
  }
846
849
 
850
+ //#endregion
851
+ //#region src/import/menus.ts
852
+ /**
853
+ * Import navigation menus from Plugin API
854
+ *
855
+ * @param menus - Menus from plugin API
856
+ * @param db - Database connection
857
+ * @param contentIdMap - Map from WP post ID to EmDash content ID
858
+ * @returns Import result with counts and ID mapping
859
+ */
860
+ async function importMenusFromPlugin(menus, db, contentIdMap) {
861
+ const result = {
862
+ menusCreated: 0,
863
+ itemsCreated: 0,
864
+ menuIdMap: /* @__PURE__ */ new Map(),
865
+ errors: []
866
+ };
867
+ for (const menu of menus) try {
868
+ const existing = await db.selectFrom("_emdash_menus").select("id").where("name", "=", menu.name).executeTakeFirst();
869
+ if (existing) {
870
+ result.menuIdMap.set(menu.name, existing.id);
871
+ continue;
872
+ }
873
+ const menuId = ulid();
874
+ await db.insertInto("_emdash_menus").values({
875
+ id: menuId,
876
+ name: menu.name,
877
+ label: menu.label
878
+ }).execute();
879
+ result.menusCreated++;
880
+ result.menuIdMap.set(menu.name, menuId);
881
+ const itemsCreated = await importPluginMenuItems(menu.items, menuId, db, contentIdMap);
882
+ result.itemsCreated += itemsCreated;
883
+ } catch (error) {
884
+ result.errors.push({
885
+ menu: menu.name,
886
+ error: error instanceof Error ? error.message : String(error)
887
+ });
888
+ }
889
+ return result;
890
+ }
891
+ /**
892
+ * Import menu items from Plugin API format
893
+ */
894
+ async function importPluginMenuItems(items, menuId, db, contentIdMap) {
895
+ const itemIdMap = /* @__PURE__ */ new Map();
896
+ let count = 0;
897
+ const sortedItems = items.toSorted((a, b) => a.sort_order - b.sort_order);
898
+ for (const item of sortedItems) {
899
+ const itemId = ulid();
900
+ itemIdMap.set(item.id, itemId);
901
+ const { type, collection, referenceId, customUrl } = mapPluginMenuItem(item, contentIdMap);
902
+ await db.insertInto("_emdash_menu_items").values({
903
+ id: itemId,
904
+ menu_id: menuId,
905
+ parent_id: null,
906
+ sort_order: item.sort_order,
907
+ type,
908
+ reference_collection: collection,
909
+ reference_id: referenceId,
910
+ custom_url: customUrl,
911
+ label: item.title,
912
+ title_attr: null,
913
+ target: item.target || null,
914
+ css_classes: item.classes || null
915
+ }).execute();
916
+ count++;
917
+ }
918
+ for (const item of sortedItems) if (item.parent_id) {
919
+ const itemId = itemIdMap.get(item.id);
920
+ const parentId = itemIdMap.get(item.parent_id);
921
+ if (itemId && parentId) await db.updateTable("_emdash_menu_items").set({ parent_id: parentId }).where("id", "=", itemId).execute();
922
+ }
923
+ return count;
924
+ }
925
+ /**
926
+ * Map Plugin menu item to EmDash format
927
+ */
928
+ function mapPluginMenuItem(item, contentIdMap) {
929
+ switch (item.type) {
930
+ case "custom": return {
931
+ type: "custom",
932
+ collection: null,
933
+ referenceId: null,
934
+ customUrl: item.url || "#"
935
+ };
936
+ case "post_type": {
937
+ const collection = mapObjectToCollection(item.object);
938
+ const referenceId = item.object_id ? contentIdMap.get(item.object_id) || null : null;
939
+ if (!referenceId && item.url) return {
940
+ type: "custom",
941
+ collection: null,
942
+ referenceId: null,
943
+ customUrl: item.url
944
+ };
945
+ return {
946
+ type: collection === "pages" ? "page" : "post",
947
+ collection,
948
+ referenceId,
949
+ customUrl: null
950
+ };
951
+ }
952
+ case "taxonomy": return {
953
+ type: "custom",
954
+ collection: null,
955
+ referenceId: null,
956
+ customUrl: item.url || "#"
957
+ };
958
+ default: return {
959
+ type: "custom",
960
+ collection: null,
961
+ referenceId: null,
962
+ customUrl: item.url || "#"
963
+ };
964
+ }
965
+ }
966
+ /**
967
+ * Map WordPress object type to EmDash collection name
968
+ */
969
+ function mapObjectToCollection(objectType) {
970
+ if (!objectType) return "posts";
971
+ return {
972
+ post: "posts",
973
+ page: "pages",
974
+ product: "products",
975
+ portfolio: "portfolio"
976
+ }[objectType] || objectType;
977
+ }
978
+
847
979
  //#endregion
848
980
  //#region src/import/sections.ts
849
981
  /**
@@ -893,6 +1025,166 @@ async function importReusableBlocksAsSections(posts, db) {
893
1025
  return result;
894
1026
  }
895
1027
 
1028
+ //#endregion
1029
+ //#region src/import/comments.ts
1030
+ /**
1031
+ * Import comments from the plugin API.
1032
+ *
1033
+ * Preserves original timestamps and threading. Comments whose post was
1034
+ * not imported (no entry in `contentIdMap`) are skipped. Re-running the
1035
+ * import is idempotent: a comment with the same post, author email, and
1036
+ * timestamp is not created twice.
1037
+ *
1038
+ * @param comments - Comments from the plugin API (all pages, flat)
1039
+ * @param db - Database connection
1040
+ * @param contentIdMap - WP post ID -> EmDash content ID
1041
+ * @param collectionMap - WP post ID -> EmDash collection slug
1042
+ * @param rootIds - Optional pre-seeded WP-comment-ID -> EmDash-root-ID map.
1043
+ * The chunked import passes the map accumulated from earlier pages so a
1044
+ * reply in page N can thread onto a parent imported in page N-1; the
1045
+ * function adds this page's entries to it.
1046
+ */
1047
+ async function importCommentsFromPlugin(comments, db, contentIdMap, collectionMap, rootIds) {
1048
+ const result = {
1049
+ imported: 0,
1050
+ skipped: 0,
1051
+ errors: []
1052
+ };
1053
+ const commentIdMap = /* @__PURE__ */ new Map();
1054
+ const rootIdMap = rootIds ?? /* @__PURE__ */ new Map();
1055
+ const sorted = comments.toSorted((a, b) => a.id - b.id);
1056
+ for (const comment of sorted) {
1057
+ const label = `${comment.author_name || "Anonymous"} (${comment.date_gmt})`;
1058
+ try {
1059
+ const contentId = contentIdMap.get(comment.post_id);
1060
+ const collection = collectionMap.get(comment.post_id);
1061
+ if (!contentId || !collection) {
1062
+ result.skipped++;
1063
+ continue;
1064
+ }
1065
+ const parsed = new Date(comment.date_gmt);
1066
+ const createdAt = Number.isNaN(parsed.getTime()) ? (/* @__PURE__ */ new Date()).toISOString() : parsed.toISOString();
1067
+ const existing = await db.selectFrom("_emdash_comments").select("id").where("content_id", "=", contentId).where("author_email", "=", comment.author_email).where("created_at", "=", createdAt).where("body", "=", comment.body).executeTakeFirst();
1068
+ const parentId = comment.parent_id !== null ? rootIdMap.get(comment.parent_id) ?? null : null;
1069
+ if (existing) {
1070
+ commentIdMap.set(comment.id, existing.id);
1071
+ rootIdMap.set(comment.id, parentId ?? existing.id);
1072
+ result.skipped++;
1073
+ continue;
1074
+ }
1075
+ const id = ulid();
1076
+ await db.insertInto("_emdash_comments").values({
1077
+ id,
1078
+ collection,
1079
+ content_id: contentId,
1080
+ parent_id: parentId,
1081
+ author_name: comment.author_name || "Anonymous",
1082
+ author_email: comment.author_email,
1083
+ author_user_id: null,
1084
+ body: comment.body,
1085
+ status: comment.status,
1086
+ ip_hash: null,
1087
+ user_agent: null,
1088
+ moderation_metadata: null,
1089
+ created_at: createdAt,
1090
+ updated_at: createdAt
1091
+ }).execute();
1092
+ commentIdMap.set(comment.id, id);
1093
+ rootIdMap.set(comment.id, parentId ?? id);
1094
+ result.imported++;
1095
+ } catch (error) {
1096
+ result.errors.push({
1097
+ comment: label,
1098
+ error: error instanceof Error ? error.message : String(error)
1099
+ });
1100
+ }
1101
+ }
1102
+ if (result.imported > 0) invalidateCommentObjectCache();
1103
+ return result;
1104
+ }
1105
+
1106
+ //#endregion
1107
+ //#region src/import/settings.ts
1108
+ /** Options key prefix used by the site settings module (`settings/index.ts`). */
1109
+ const SETTINGS_PREFIX = "site:";
1110
+ /**
1111
+ * Import site settings from analysis into EmDash site settings.
1112
+ *
1113
+ * Writes the `site:*` options consumed by `getSiteSettings()` and
1114
+ * invalidates the settings cache. Logo/favicon are only applied when
1115
+ * the caller resolved them to EmDash media IDs.
1116
+ *
1117
+ * @param settings - Site settings analysis
1118
+ * @param db - Database connection
1119
+ * @param overwrite - Whether to overwrite existing settings (a fresh
1120
+ * site's seed already sets title/tagline, so migrations pass true)
1121
+ * @param media - Resolved media IDs for logo/favicon
1122
+ */
1123
+ async function importSiteSettings(settings, db, overwrite = false, media = {}) {
1124
+ const result = {
1125
+ applied: [],
1126
+ skipped: [],
1127
+ errors: []
1128
+ };
1129
+ const updates = [];
1130
+ if (settings.title) updates.push({
1131
+ setting: "title",
1132
+ value: settings.title
1133
+ });
1134
+ if (settings.tagline) updates.push({
1135
+ setting: "tagline",
1136
+ value: settings.tagline
1137
+ });
1138
+ if (media.logoMediaId) updates.push({
1139
+ setting: "logo",
1140
+ value: { mediaId: media.logoMediaId }
1141
+ });
1142
+ if (media.faviconMediaId) updates.push({
1143
+ setting: "favicon",
1144
+ value: { mediaId: media.faviconMediaId }
1145
+ });
1146
+ if (updates.length === 0) return result;
1147
+ const options = new OptionsRepository(db);
1148
+ try {
1149
+ for (const { setting, value } of updates) try {
1150
+ const key = `${SETTINGS_PREFIX}${setting}`;
1151
+ if (!overwrite) {
1152
+ if (await options.get(key) !== null) {
1153
+ result.skipped.push(setting);
1154
+ continue;
1155
+ }
1156
+ }
1157
+ await options.set(key, value);
1158
+ result.applied.push(setting);
1159
+ } catch (error) {
1160
+ result.errors.push({
1161
+ setting,
1162
+ error: error instanceof Error ? error.message : String(error)
1163
+ });
1164
+ }
1165
+ } finally {
1166
+ if (result.applied.length > 0) invalidateSiteSettingsCache();
1167
+ }
1168
+ return result;
1169
+ }
1170
+ /**
1171
+ * Parse site settings from WordPress plugin options response
1172
+ */
1173
+ function parseSiteSettingsFromPlugin(options) {
1174
+ const settings = {};
1175
+ if (typeof options.blogname === "string" && options.blogname.trim() !== "") settings.title = options.blogname;
1176
+ if (typeof options.blogdescription === "string" && options.blogdescription.trim() !== "") settings.tagline = options.blogdescription;
1177
+ if (typeof options.custom_logo_url === "string" && options.custom_logo_url !== "") settings.logo = {
1178
+ url: options.custom_logo_url,
1179
+ id: typeof options.custom_logo === "number" ? options.custom_logo : void 0
1180
+ };
1181
+ if (typeof options.site_icon_url === "string" && options.site_icon_url !== "") settings.favicon = {
1182
+ url: options.site_icon_url,
1183
+ id: typeof options.site_icon === "number" ? options.site_icon : void 0
1184
+ };
1185
+ return settings;
1186
+ }
1187
+
896
1188
  //#endregion
897
1189
  //#region src/import/registry.ts
898
1190
  /**
@@ -1004,7 +1296,7 @@ const wxrSource = {
1004
1296
  if (!options.postTypes.includes(postType)) continue;
1005
1297
  if (isInternalPostType(postType)) continue;
1006
1298
  if (!options.includeDrafts && post.status !== "publish") continue;
1007
- yield wxrPostToNormalizedItem(post, attachmentMap);
1299
+ yield wxrPostToNormalizedItem(post, attachmentMap, wxr.site.link || "");
1008
1300
  count++;
1009
1301
  if (options.limit && count >= options.limit) break;
1010
1302
  }
@@ -1123,8 +1415,9 @@ function analyzeWxrData(wxr, existingCollections) {
1123
1415
  /**
1124
1416
  * Convert a WXR post to a normalized item
1125
1417
  */
1126
- function wxrPostToNormalizedItem(post, attachmentMap) {
1418
+ function wxrPostToNormalizedItem(post, attachmentMap, siteUrl) {
1127
1419
  const content = post.content ? gutenbergToPortableText(post.content) : [];
1420
+ if (siteUrl) relativizeContentLinks(content, siteUrl);
1128
1421
  const thumbnailId = post.meta.get("_thumbnail_id");
1129
1422
  const featuredImage = thumbnailId ? attachmentMap.get(String(thumbnailId)) : void 0;
1130
1423
  let customTaxonomies;
@@ -1297,6 +1590,44 @@ async function getPublicContentCounts(siteUrl) {
1297
1590
  * Connects to self-hosted WordPress sites running the EmDash Exporter plugin.
1298
1591
  * Provides full access to all content including drafts, custom post types, and ACF fields.
1299
1592
  */
1593
+ /**
1594
+ * Build the REST API URL for a plugin endpoint.
1595
+ *
1596
+ * `restRoute: false` uses the pretty form (`/wp-json/emdash/v1/...`),
1597
+ * `restRoute: true` uses the `?rest_route=` form that works on sites with
1598
+ * plain permalinks (where `/wp-json/` doesn't exist).
1599
+ */
1600
+ function pluginApiUrl(siteUrl, path, params = {}, restRoute = false) {
1601
+ if (restRoute) {
1602
+ const url = new URL(siteUrl + "/");
1603
+ url.searchParams.set("rest_route", `/emdash/v1/${path}`);
1604
+ for (const [key, value] of Object.entries(params)) url.searchParams.set(key, value);
1605
+ return url.toString();
1606
+ }
1607
+ const url = new URL(`${siteUrl}/wp-json/emdash/v1/${path}`);
1608
+ for (const [key, value] of Object.entries(params)) url.searchParams.set(key, value);
1609
+ return url.toString();
1610
+ }
1611
+ /**
1612
+ * Fetch a plugin API endpoint, falling back to the `?rest_route=` form when
1613
+ * the pretty `/wp-json/` route 404s or is unreachable. Sites with "Plain"
1614
+ * permalinks have no `/wp-json/` rewrite, so without this fallback they
1615
+ * always fail with a misleading 404.
1616
+ */
1617
+ async function fetchPluginApi(siteUrl, path, params, headers, timeoutMs) {
1618
+ let pretty = null;
1619
+ try {
1620
+ pretty = await ssrfSafeFetch(pluginApiUrl(siteUrl, path, params), {
1621
+ headers,
1622
+ signal: AbortSignal.timeout(timeoutMs)
1623
+ });
1624
+ } catch {}
1625
+ if (pretty && pretty.status !== 404) return pretty;
1626
+ return ssrfSafeFetch(pluginApiUrl(siteUrl, path, params, true), {
1627
+ headers,
1628
+ signal: AbortSignal.timeout(timeoutMs)
1629
+ });
1630
+ }
1300
1631
  const wordpressPluginSource = {
1301
1632
  id: "wordpress-plugin",
1302
1633
  name: "WordPress (EmDash Exporter)",
@@ -1308,10 +1639,7 @@ const wordpressPluginSource = {
1308
1639
  try {
1309
1640
  const siteUrl = normalizeUrl$1(url);
1310
1641
  validateExternalUrl(siteUrl);
1311
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/emdash/v1/probe`, {
1312
- headers: { Accept: "application/json" },
1313
- signal: AbortSignal.timeout(1e4)
1314
- });
1642
+ const response = await fetchPluginApi(siteUrl, "probe", {}, { Accept: "application/json" }, 1e4);
1315
1643
  if (!response.ok) return null;
1316
1644
  const data = await response.json();
1317
1645
  if (!data.emdash_exporter) return null;
@@ -1349,10 +1677,7 @@ const wordpressPluginSource = {
1349
1677
  },
1350
1678
  async analyze(input, context) {
1351
1679
  const { siteUrl, headers } = getRequestConfig(input);
1352
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/emdash/v1/analyze`, {
1353
- headers,
1354
- signal: AbortSignal.timeout(3e4)
1355
- });
1680
+ const response = await fetchPluginApi(siteUrl, "analyze", {}, headers, 3e4);
1356
1681
  if (!response.ok) {
1357
1682
  const body = await response.json().catch(() => void 0);
1358
1683
  const message = typeof body === "object" && body !== null && "message" in body && typeof body.message === "string" ? body.message : "";
@@ -1364,6 +1689,19 @@ const wordpressPluginSource = {
1364
1689
  const suggestedCollection = mapPostTypeToCollection(pt.name);
1365
1690
  const existingCollection = existingCollections.get(suggestedCollection);
1366
1691
  const requiredFields = pt.supports && "thumbnail" in pt.supports ? [...BASE_REQUIRED_FIELDS, FEATURED_IMAGE_FIELD] : [...BASE_REQUIRED_FIELDS];
1692
+ const knownSlugs = new Set(requiredFields.map((f) => f.slug));
1693
+ for (const customField of pt.custom_fields ?? []) {
1694
+ if (isPluginBookkeepingMeta(customField.key)) continue;
1695
+ const slug = sanitizeFieldSlug(customField.key);
1696
+ if (knownSlugs.has(slug)) continue;
1697
+ knownSlugs.add(slug);
1698
+ requiredFields.push({
1699
+ slug,
1700
+ label: fieldLabelFromKey(customField.key),
1701
+ type: mapInferredFieldType(customField.inferred_type),
1702
+ required: false
1703
+ });
1704
+ }
1367
1705
  return {
1368
1706
  name: pt.name,
1369
1707
  count: pt.total,
@@ -1374,12 +1712,16 @@ const wordpressPluginSource = {
1374
1712
  });
1375
1713
  const attachments = [];
1376
1714
  if (data.attachments.count > 0) try {
1377
- const mediaResponse = await ssrfSafeFetch(`${siteUrl}/wp-json/emdash/v1/media?per_page=500`, {
1378
- headers,
1379
- signal: AbortSignal.timeout(3e4)
1380
- });
1381
- if (mediaResponse.ok) {
1715
+ let page = 1;
1716
+ let totalPages = 1;
1717
+ while (page <= totalPages) {
1718
+ const mediaResponse = await fetchPluginApi(siteUrl, "media", {
1719
+ per_page: "500",
1720
+ page: String(page)
1721
+ }, headers, 3e4);
1722
+ if (!mediaResponse.ok) break;
1382
1723
  const mediaData = await mediaResponse.json();
1724
+ totalPages = mediaData.pages;
1383
1725
  for (const item of mediaData.items) attachments.push({
1384
1726
  id: item.id,
1385
1727
  url: item.url,
@@ -1391,6 +1733,7 @@ const wordpressPluginSource = {
1391
1733
  width: item.width,
1392
1734
  height: item.height
1393
1735
  });
1736
+ page++;
1394
1737
  }
1395
1738
  } catch (e) {
1396
1739
  console.warn("Failed to fetch media list:", e);
@@ -1427,15 +1770,17 @@ const wordpressPluginSource = {
1427
1770
  let totalPages = 1;
1428
1771
  let yielded = 0;
1429
1772
  while (page <= totalPages) {
1430
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/emdash/v1/content?post_type=${postType}&status=${options.includeDrafts ? "any" : "publish"}&per_page=100&page=${page}`, {
1431
- headers,
1432
- signal: AbortSignal.timeout(6e4)
1433
- });
1773
+ const response = await fetchPluginApi(siteUrl, "content", {
1774
+ post_type: postType,
1775
+ status: options.includeDrafts ? "any" : "publish",
1776
+ per_page: "100",
1777
+ page: String(page)
1778
+ }, headers, 6e4);
1434
1779
  if (!response.ok) throw new Error(`Failed to fetch ${postType}: ${response.statusText}`);
1435
1780
  const data = await response.json();
1436
1781
  totalPages = data.pages;
1437
1782
  for (const post of data.items) {
1438
- yield pluginPostToNormalizedItem(post);
1783
+ yield pluginPostToNormalizedItem(post, siteUrl);
1439
1784
  yielded++;
1440
1785
  if (options.limit && yielded >= options.limit) return;
1441
1786
  }
@@ -1451,6 +1796,54 @@ const wordpressPluginSource = {
1451
1796
  }
1452
1797
  };
1453
1798
  /**
1799
+ * Fetch a single page of content for one post type. This is the unit of
1800
+ * work for the chunked import: one Worker invocation imports one page,
1801
+ * keeping each request far below Cloudflare's CPU and subrequest limits
1802
+ * (see issue #475).
1803
+ */
1804
+ async function fetchPluginContentPage(options) {
1805
+ const { siteUrl, headers } = getRequestConfig({
1806
+ type: "url",
1807
+ url: options.siteUrl,
1808
+ token: options.token
1809
+ });
1810
+ const response = await fetchPluginApi(siteUrl, "content", {
1811
+ post_type: options.postType,
1812
+ status: options.includeDrafts ? "any" : "publish",
1813
+ per_page: String(options.perPage),
1814
+ page: String(options.page)
1815
+ }, headers, 6e4);
1816
+ if (!response.ok) throw new Error(`Failed to fetch ${options.postType}: ${response.statusText}`);
1817
+ const data = await response.json();
1818
+ return {
1819
+ items: data.items.map((post) => pluginPostToNormalizedItem(post, siteUrl)),
1820
+ totalPages: data.pages
1821
+ };
1822
+ }
1823
+ /** Plugin `inferred_type` values that are valid EmDash field types as-is */
1824
+ const VALID_INFERRED_TYPES = new Set([
1825
+ "string",
1826
+ "text",
1827
+ "number",
1828
+ "integer",
1829
+ "boolean",
1830
+ "datetime",
1831
+ "json",
1832
+ "reference"
1833
+ ]);
1834
+ /**
1835
+ * Map the plugin's inferred custom-field type to an EmDash field type.
1836
+ * Unknown values fall back to string (always safe for TEXT storage).
1837
+ */
1838
+ function mapInferredFieldType(inferredType) {
1839
+ return VALID_INFERRED_TYPES.has(inferredType) ? inferredType : "string";
1840
+ }
1841
+ const FIELD_KEY_SEPARATORS = /[_-]+/;
1842
+ /** Derive a human label from a meta key: "event_start-date" -> "Event Start Date" */
1843
+ function fieldLabelFromKey(key) {
1844
+ return key.split(FIELD_KEY_SEPARATORS).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
1845
+ }
1846
+ /**
1454
1847
  * Convert plugin i18n info to the shared I18nDetection type.
1455
1848
  * Returns undefined when no multilingual plugin is detected.
1456
1849
  */
@@ -1492,10 +1885,21 @@ function getRequestConfig(input) {
1492
1885
  /**
1493
1886
  * Convert plugin post to normalized item
1494
1887
  */
1495
- function pluginPostToNormalizedItem(post) {
1888
+ function pluginPostToNormalizedItem(post, siteUrl) {
1496
1889
  const content = post.content ? gutenbergToPortableText(post.content) : [];
1890
+ relativizeContentLinks(content, siteUrl);
1497
1891
  const categories = post.taxonomies?.category?.map((c) => c.slug) ?? post.taxonomies?.categories?.map((c) => c.slug) ?? [];
1498
1892
  const tags = post.taxonomies?.post_tag?.map((t) => t.slug) ?? post.taxonomies?.tags?.map((t) => t.slug) ?? [];
1893
+ const customTaxonomies = {};
1894
+ for (const [name, terms] of Object.entries(post.taxonomies ?? {})) {
1895
+ if ([
1896
+ "category",
1897
+ "categories",
1898
+ "post_tag",
1899
+ "tags"
1900
+ ].includes(name)) continue;
1901
+ if (Array.isArray(terms) && terms.length > 0) customTaxonomies[name] = terms.map((t) => t.slug);
1902
+ }
1499
1903
  const meta = { ...post.meta };
1500
1904
  if (post.acf) meta._acf = post.acf;
1501
1905
  if (post.yoast) meta._yoast = post.yoast;
@@ -1513,12 +1917,97 @@ function pluginPostToNormalizedItem(post) {
1513
1917
  author: post.author?.login,
1514
1918
  categories,
1515
1919
  tags,
1920
+ customTaxonomies: Object.keys(customTaxonomies).length > 0 ? customTaxonomies : void 0,
1516
1921
  meta,
1517
1922
  featuredImage: post.featured_image?.url,
1518
1923
  locale: post.locale,
1519
1924
  translationGroup: post.translation_group
1520
1925
  };
1521
1926
  }
1927
+ /**
1928
+ * Fetch taxonomies from plugin API
1929
+ */
1930
+ async function fetchPluginTaxonomies(siteUrl, authToken) {
1931
+ const normalizedSiteUrl = normalizeUrl$1(siteUrl);
1932
+ validateExternalUrl(normalizedSiteUrl);
1933
+ const response = await fetchPluginApi(normalizedSiteUrl, "taxonomies", {}, {
1934
+ Accept: "application/json",
1935
+ Authorization: `Basic ${authToken}`
1936
+ }, 3e4);
1937
+ if (!response.ok) throw new Error(`Failed to fetch taxonomies: ${response.statusText}`);
1938
+ return response.json();
1939
+ }
1940
+ /**
1941
+ * Fetch navigation menus from plugin API (added in emdash-exporter 1.1.0).
1942
+ * Returns an empty array when the endpoint doesn't exist (older plugin).
1943
+ */
1944
+ async function fetchPluginMenus(siteUrl, authToken) {
1945
+ const normalizedSiteUrl = normalizeUrl$1(siteUrl);
1946
+ validateExternalUrl(normalizedSiteUrl);
1947
+ const response = await fetchPluginApi(normalizedSiteUrl, "menus", {}, {
1948
+ Accept: "application/json",
1949
+ Authorization: `Basic ${authToken}`
1950
+ }, 3e4);
1951
+ if (response.status === 404) return [];
1952
+ if (!response.ok) throw new Error(`Failed to fetch menus: ${response.statusText}`);
1953
+ return response.json();
1954
+ }
1955
+ /**
1956
+ * Fetch site options from plugin API (title, tagline, logo, favicon, ...)
1957
+ */
1958
+ async function fetchPluginOptions(siteUrl, authToken) {
1959
+ const normalizedSiteUrl = normalizeUrl$1(siteUrl);
1960
+ validateExternalUrl(normalizedSiteUrl);
1961
+ const response = await fetchPluginApi(normalizedSiteUrl, "options", {}, {
1962
+ Accept: "application/json",
1963
+ Authorization: `Basic ${authToken}`
1964
+ }, 3e4);
1965
+ if (!response.ok) throw new Error(`Failed to fetch options: ${response.statusText}`);
1966
+ return response.json();
1967
+ }
1968
+ /**
1969
+ * Fetch a single page of comments from the plugin API (added in
1970
+ * emdash-exporter 1.2.0). The exporter orders by comment ID ascending, so
1971
+ * parents always appear before their children across pages. Returns
1972
+ * `totalPages: 0` when the endpoint doesn't exist (older plugin).
1973
+ */
1974
+ async function fetchPluginCommentsPage(siteUrl, authToken, page) {
1975
+ const normalizedSiteUrl = normalizeUrl$1(siteUrl);
1976
+ validateExternalUrl(normalizedSiteUrl);
1977
+ const response = await fetchPluginApi(normalizedSiteUrl, "comments", {
1978
+ per_page: "500",
1979
+ page: String(page)
1980
+ }, {
1981
+ Accept: "application/json",
1982
+ Authorization: `Basic ${authToken}`
1983
+ }, 3e4);
1984
+ if (response.status === 404) return {
1985
+ items: [],
1986
+ totalPages: 0
1987
+ };
1988
+ if (!response.ok) throw new Error(`Failed to fetch comments: ${response.statusText}`);
1989
+ const data = await response.json();
1990
+ return {
1991
+ items: data.items,
1992
+ totalPages: data.pages
1993
+ };
1994
+ }
1995
+ /**
1996
+ * Fetch all comments from plugin API, paginating through every page.
1997
+ * Returns an empty array when the endpoint doesn't exist (older plugin).
1998
+ */
1999
+ async function fetchPluginComments(siteUrl, authToken) {
2000
+ const comments = [];
2001
+ let page = 1;
2002
+ let totalPages = 1;
2003
+ while (page <= totalPages) {
2004
+ const result = await fetchPluginCommentsPage(siteUrl, authToken, page);
2005
+ totalPages = result.totalPages;
2006
+ comments.push(...result.items);
2007
+ page++;
2008
+ }
2009
+ return comments;
2010
+ }
1522
2011
 
1523
2012
  //#endregion
1524
2013
  //#region src/import/index.ts
@@ -1527,5 +2016,5 @@ registerSource(wordpressRestSource);
1527
2016
  registerSource(wxrSource);
1528
2017
 
1529
2018
  //#endregion
1530
- export { getAllSources as a, getUrlSources as c, importReusableBlocksAsSections as d, parseWxr as f, clearSources as i, probeUrl as l, parseWxrDate as n, getFileSources as o, parseWxrString as p, wxrSource as r, getSource as s, wordpressRestSource as t, registerSource as u };
1531
- //# sourceMappingURL=import-Bb1T9WJS.mjs.map
2019
+ export { parseWxrString as C, parseWxr as S, importSiteSettings as _, fetchPluginOptions as a, importReusableBlocksAsSections as b, parseWxrDate as c, getAllSources as d, getFileSources as f, registerSource as g, probeUrl as h, fetchPluginMenus as i, wxrSource as l, getUrlSources as m, fetchPluginCommentsPage as n, fetchPluginTaxonomies as o, getSource as p, fetchPluginContentPage as r, wordpressRestSource as s, fetchPluginComments as t, clearSources as u, parseSiteSettingsFromPlugin as v, importMenusFromPlugin as x, importCommentsFromPlugin as y };
2020
+ //# sourceMappingURL=import-fYLf14Co.mjs.map