emdash 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1618) hide show
  1. package/dist/action-token-DyXQ5VhB.mjs +26 -0
  2. package/dist/action-token-DyXQ5VhB.mjs.map +1 -0
  3. package/dist/activation-BRmrunZ3.mjs +387 -0
  4. package/dist/activation-BRmrunZ3.mjs.map +1 -0
  5. package/dist/adapters-CMuwJgdX.d.mts +173 -0
  6. package/dist/adapters-CMuwJgdX.d.mts.map +1 -0
  7. package/dist/after-B8cG5P6f.mjs +53 -0
  8. package/dist/after-B8cG5P6f.mjs.map +1 -0
  9. package/dist/allowed-origins-CUNAP6hl.mjs +116 -0
  10. package/dist/allowed-origins-CUNAP6hl.mjs.map +1 -0
  11. package/dist/api/route-utils.d.mts +4 -4
  12. package/dist/api/route-utils.mjs +6 -5
  13. package/dist/api/route-utils.mjs.map +1 -1
  14. package/dist/api/schemas/index.d.mts +2 -2
  15. package/dist/api/schemas/index.mjs +7 -7
  16. package/dist/api-tokens-BIwfh_Ke.mjs +173 -0
  17. package/dist/api-tokens-BIwfh_Ke.mjs.map +1 -0
  18. package/dist/apply-CmE9k57Q.mjs +1774 -0
  19. package/dist/apply-CmE9k57Q.mjs.map +1 -0
  20. package/dist/approvals-DbCK12-7.mjs +460 -0
  21. package/dist/approvals-DbCK12-7.mjs.map +1 -0
  22. package/dist/artifact-fetch-DXHP2vKC.mjs +659 -0
  23. package/dist/artifact-fetch-DXHP2vKC.mjs.map +1 -0
  24. package/dist/artifacts-a_0bb4Ks.mjs +323 -0
  25. package/dist/artifacts-a_0bb4Ks.mjs.map +1 -0
  26. package/dist/astro/image-endpoint.d.mts.map +1 -1
  27. package/dist/astro/image-endpoint.mjs +12 -4
  28. package/dist/astro/image-endpoint.mjs.map +1 -1
  29. package/dist/astro/index.d.mts +17 -17
  30. package/dist/astro/index.d.mts.map +1 -1
  31. package/dist/astro/index.mjs +28 -12
  32. package/dist/astro/index.mjs.map +1 -1
  33. package/dist/astro/middleware/auth.d.mts +17 -15
  34. package/dist/astro/middleware/auth.d.mts.map +1 -1
  35. package/dist/astro/middleware/auth.mjs +31 -20
  36. package/dist/astro/middleware/auth.mjs.map +1 -1
  37. package/dist/astro/middleware/media-usage-write-fence.mjs +2 -2
  38. package/dist/astro/middleware/redirect.d.mts +2 -1
  39. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  40. package/dist/astro/middleware/redirect.mjs +29 -19
  41. package/dist/astro/middleware/redirect.mjs.map +1 -1
  42. package/dist/astro/middleware/request-context.d.mts.map +1 -1
  43. package/dist/astro/middleware/request-context.mjs +6 -5
  44. package/dist/astro/middleware/request-context.mjs.map +1 -1
  45. package/dist/astro/middleware.d.mts +19 -21
  46. package/dist/astro/middleware.d.mts.map +1 -1
  47. package/dist/astro/middleware.mjs +179 -129
  48. package/dist/astro/middleware.mjs.map +1 -1
  49. package/dist/astro/routes/PluginRegistry.d.mts +2 -3
  50. package/dist/astro/routes/PluginRegistry.d.mts.map +1 -1
  51. package/dist/astro/routes/PluginRegistry.mjs +1 -1
  52. package/dist/astro/routes/PluginRegistry.mjs.map +1 -1
  53. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +3 -3
  54. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +3 -3
  55. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -2
  56. package/dist/astro/routes/api/admin/api-tokens/index.mjs +3 -3
  57. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -5
  58. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -1
  59. package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts.map +1 -1
  60. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +8 -11
  61. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
  62. package/dist/astro/routes/api/admin/byline-fields/index.d.mts.map +1 -1
  63. package/dist/astro/routes/api/admin/byline-fields/index.mjs +7 -9
  64. package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
  65. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +6 -7
  66. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
  67. package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts.map +1 -1
  68. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +9 -10
  69. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
  70. package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts.map +1 -1
  71. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +10 -12
  72. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  73. package/dist/astro/routes/api/admin/bylines/index.mjs +8 -8
  74. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +8 -8
  75. package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
  76. package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -1
  77. package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -8
  78. package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
  79. package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
  80. package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
  81. package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
  82. package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
  83. package/dist/astro/routes/api/admin/comments/index.mjs +7 -7
  84. package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
  85. package/dist/astro/routes/api/admin/core-update.mjs +6 -6
  86. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +3 -3
  87. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
  88. package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -1
  89. package/dist/astro/routes/api/admin/media-usage/activation.mjs +8 -10
  90. package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
  91. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +7 -8
  92. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
  93. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +7 -8
  94. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -1
  96. package/dist/astro/routes/api/admin/media-usage/progress.mjs +6 -8
  97. package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -1
  98. package/dist/astro/routes/api/admin/media-usage/repair.mjs +6 -7
  99. package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
  100. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +7 -8
  101. package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
  102. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +7 -8
  103. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
  104. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
  105. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
  106. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +4 -4
  107. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +4 -4
  108. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +3 -3
  109. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
  110. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +4 -4
  111. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +5 -5
  112. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +9 -8
  113. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  114. package/dist/astro/routes/api/admin/plugins/index.mjs +3 -3
  115. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
  116. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +3 -3
  117. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +8 -7
  118. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  119. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +3 -3
  120. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +7 -7
  121. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +14 -13
  122. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  123. package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -1
  124. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +6 -6
  125. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  126. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +10 -10
  127. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +4 -4
  128. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +8 -8
  129. package/dist/astro/routes/api/admin/plugins/updates.mjs +7 -7
  130. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +2 -2
  131. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +3 -3
  132. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
  133. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +3 -3
  134. package/dist/astro/routes/api/admin/transfer/_...path_.mjs +1 -1
  135. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +7 -8
  136. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -1
  137. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +7 -8
  138. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -1
  139. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +9 -10
  140. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -1
  141. package/dist/astro/routes/api/admin/transfer/capabilities.mjs +9 -10
  142. package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -1
  143. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +8 -9
  144. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -1
  145. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +9 -10
  146. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -1
  147. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +9 -10
  148. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -1
  149. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +8 -9
  150. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -1
  151. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +9 -10
  152. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -1
  153. package/dist/astro/routes/api/admin/transfer/exports/index.d.mts.map +1 -1
  154. package/dist/astro/routes/api/admin/transfer/exports/index.mjs +11 -13
  155. package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -1
  156. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +8 -9
  157. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -1
  158. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +8 -9
  159. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -1
  160. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +10 -11
  161. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -1
  162. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +8 -9
  163. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -1
  164. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +11 -12
  165. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -1
  166. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +9 -10
  167. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -1
  168. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +8 -9
  169. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -1
  170. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +10 -11
  171. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -1
  172. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +8 -9
  173. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -1
  174. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +8 -9
  175. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -1
  176. package/dist/astro/routes/api/admin/transfer/imports/index.d.mts.map +1 -1
  177. package/dist/astro/routes/api/admin/transfer/imports/index.mjs +13 -15
  178. package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -1
  179. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
  180. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  181. package/dist/astro/routes/api/admin/users/_id_/index.mjs +4 -4
  182. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
  183. package/dist/astro/routes/api/admin/users/index.mjs +3 -3
  184. package/dist/astro/routes/api/auth/dev-bypass.mjs +2 -2
  185. package/dist/astro/routes/api/auth/handover.mjs +3 -3
  186. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  187. package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -1
  188. package/dist/astro/routes/api/auth/invite/complete.mjs +10 -9
  189. package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
  190. package/dist/astro/routes/api/auth/invite/index.mjs +6 -6
  191. package/dist/astro/routes/api/auth/invite/register-options.mjs +6 -6
  192. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  193. package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -8
  194. package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -1
  195. package/dist/astro/routes/api/auth/magic-link/verify.mjs +7 -6
  196. package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -1
  197. package/dist/astro/routes/api/auth/me.mjs +4 -4
  198. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  199. package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
  200. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +6 -5
  201. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
  202. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  203. package/dist/astro/routes/api/auth/passkey/_id_.mjs +3 -3
  204. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  205. package/dist/astro/routes/api/auth/passkey/options.mjs +9 -9
  206. package/dist/astro/routes/api/auth/passkey/register/options.mjs +6 -6
  207. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +7 -7
  208. package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -1
  209. package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -9
  210. package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
  211. package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -1
  212. package/dist/astro/routes/api/auth/signup/complete.mjs +10 -9
  213. package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
  214. package/dist/astro/routes/api/auth/signup/register-options.d.mts +8 -0
  215. package/dist/astro/routes/api/auth/signup/register-options.d.mts.map +1 -0
  216. package/dist/astro/routes/api/auth/signup/register-options.mjs +44 -0
  217. package/dist/astro/routes/api/auth/signup/register-options.mjs.map +1 -0
  218. package/dist/astro/routes/api/auth/signup/request.mjs +7 -7
  219. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  220. package/dist/astro/routes/api/calendar.mjs +4 -4
  221. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -1
  222. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +6 -7
  223. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
  224. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -1
  225. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +11 -12
  226. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
  227. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  228. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +9 -10
  229. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
  230. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -7
  231. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
  232. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -1
  233. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +15 -15
  234. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -1
  235. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
  236. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +2 -2
  237. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +8 -8
  238. package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -1
  239. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -10
  240. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  241. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +6 -7
  242. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
  243. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +6 -7
  244. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
  245. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
  246. package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs +2 -2
  247. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +6 -6
  248. package/dist/astro/routes/api/content/_collection_/_id_/room.mjs +4 -4
  249. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +6 -6
  250. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
  251. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -19
  252. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  253. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  254. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +9 -10
  255. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
  256. package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
  257. package/dist/astro/routes/api/content/_collection_/_id_.mjs +19 -19
  258. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  259. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  260. package/dist/astro/routes/api/content/_collection_/index.mjs +5 -5
  261. package/dist/astro/routes/api/content/_collection_/trash.mjs +4 -4
  262. package/dist/astro/routes/api/dashboard.mjs +6 -6
  263. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  264. package/dist/astro/routes/api/dev/scheduled-tasks.mjs +4 -3
  265. package/dist/astro/routes/api/dev/scheduled-tasks.mjs.map +1 -1
  266. package/dist/astro/routes/api/health.mjs +3 -3
  267. package/dist/astro/routes/api/import/probe.d.mts +4 -4
  268. package/dist/astro/routes/api/import/probe.mjs +6 -6
  269. package/dist/astro/routes/api/import/wordpress/analyze.d.mts +3 -3
  270. package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
  271. package/dist/astro/routes/api/import/wordpress/execute.d.mts +16 -16
  272. package/dist/astro/routes/api/import/wordpress/execute.mjs +7 -7
  273. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  274. package/dist/astro/routes/api/import/wordpress/media.d.mts +15 -15
  275. package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
  276. package/dist/astro/routes/api/import/wordpress/media.mjs +9 -8
  277. package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
  278. package/dist/astro/routes/api/import/wordpress/prepare.mjs +7 -7
  279. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +16 -16
  280. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +6 -6
  281. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  282. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +6 -6
  283. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +16 -16
  284. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +13 -13
  285. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  286. package/dist/astro/routes/api/manifest.mjs +4 -4
  287. package/dist/astro/routes/api/mcp.mjs +84 -77
  288. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  289. package/dist/astro/routes/api/media/_id_/confirm.mjs +7 -7
  290. package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -1
  291. package/dist/astro/routes/api/media/_id_/replace.mjs +8 -6
  292. package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
  293. package/dist/astro/routes/api/media/_id_/upload.mjs +5 -5
  294. package/dist/astro/routes/api/media/_id_/usage.mjs +6 -6
  295. package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
  296. package/dist/astro/routes/api/media/_id_.mjs +11 -8
  297. package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
  298. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +3 -3
  299. package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
  300. package/dist/astro/routes/api/media/file/_...key_.mjs +7 -5
  301. package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
  302. package/dist/astro/routes/api/media/folders/_id_.mjs +5 -5
  303. package/dist/astro/routes/api/media/folders/index.mjs +5 -5
  304. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts.map +1 -1
  305. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +10 -4
  306. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -1
  307. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  308. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  309. package/dist/astro/routes/api/media/upload-url.mjs +7 -7
  310. package/dist/astro/routes/api/media.mjs +9 -9
  311. package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -1
  312. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -6
  313. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  314. package/dist/astro/routes/api/menus/_name_/items.mjs +7 -6
  315. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  316. package/dist/astro/routes/api/menus/_name_/reorder.mjs +7 -6
  317. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  318. package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -1
  319. package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -9
  320. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  321. package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -1
  322. package/dist/astro/routes/api/menus/_name_.mjs +9 -6
  323. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  324. package/dist/astro/routes/api/menus/index.d.mts.map +1 -1
  325. package/dist/astro/routes/api/menus/index.mjs +8 -6
  326. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  327. package/dist/astro/routes/api/oauth/authorize.mjs +3 -3
  328. package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -3
  329. package/dist/astro/routes/api/oauth/device/code.mjs +6 -6
  330. package/dist/astro/routes/api/oauth/device/token.mjs +5 -5
  331. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  332. package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -3
  333. package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -3
  334. package/dist/astro/routes/api/oauth/token.mjs +4 -4
  335. package/dist/astro/routes/api/openapi.json.mjs +9 -9
  336. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  337. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +2 -2
  338. package/dist/astro/routes/api/redirects/404s/index.d.mts.map +1 -1
  339. package/dist/astro/routes/api/redirects/404s/index.mjs +8 -11
  340. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  341. package/dist/astro/routes/api/redirects/404s/summary.mjs +6 -7
  342. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  343. package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -1
  344. package/dist/astro/routes/api/redirects/_id_.mjs +9 -12
  345. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  346. package/dist/astro/routes/api/redirects/index.d.mts.map +1 -1
  347. package/dist/astro/routes/api/redirects/index.mjs +8 -10
  348. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  349. package/dist/astro/routes/api/relations/_id_/index.d.mts.map +1 -1
  350. package/dist/astro/routes/api/relations/_id_/index.mjs +8 -11
  351. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
  352. package/dist/astro/routes/api/relations/index.d.mts.map +1 -1
  353. package/dist/astro/routes/api/relations/index.mjs +7 -9
  354. package/dist/astro/routes/api/relations/index.mjs.map +1 -1
  355. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  356. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +6 -6
  357. package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts.map +1 -1
  358. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +7 -9
  359. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
  360. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +6 -7
  361. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
  362. package/dist/astro/routes/api/schema/block-types/index.d.mts.map +1 -1
  363. package/dist/astro/routes/api/schema/block-types/index.mjs +7 -9
  364. package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
  365. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts.map +1 -1
  366. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +8 -11
  367. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  368. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts.map +1 -1
  369. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +7 -9
  370. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  371. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +6 -7
  372. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  373. package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -1
  374. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +8 -11
  375. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  376. package/dist/astro/routes/api/schema/collections/index.d.mts.map +1 -1
  377. package/dist/astro/routes/api/schema/collections/index.mjs +7 -9
  378. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  379. package/dist/astro/routes/api/schema/collections/reorder.mjs +6 -7
  380. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  381. package/dist/astro/routes/api/schema/index.mjs +4 -5
  382. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  383. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +6 -7
  384. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  385. package/dist/astro/routes/api/schema/orphans/index.mjs +4 -5
  386. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  387. package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
  388. package/dist/astro/routes/api/search/enable.mjs +8 -5
  389. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  390. package/dist/astro/routes/api/search/index.d.mts.map +1 -1
  391. package/dist/astro/routes/api/search/index.mjs +7 -4
  392. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  393. package/dist/astro/routes/api/search/rebuild.d.mts.map +1 -1
  394. package/dist/astro/routes/api/search/rebuild.mjs +8 -5
  395. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  396. package/dist/astro/routes/api/search/stats.d.mts.map +1 -1
  397. package/dist/astro/routes/api/search/stats.mjs +6 -3
  398. package/dist/astro/routes/api/search/stats.mjs.map +1 -1
  399. package/dist/astro/routes/api/search/suggest.d.mts.map +1 -1
  400. package/dist/astro/routes/api/search/suggest.mjs +7 -4
  401. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  402. package/dist/astro/routes/api/sections/_slug_.d.mts.map +1 -1
  403. package/dist/astro/routes/api/sections/_slug_.mjs +8 -11
  404. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  405. package/dist/astro/routes/api/sections/index.d.mts.map +1 -1
  406. package/dist/astro/routes/api/sections/index.mjs +7 -9
  407. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  408. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +4 -4
  409. package/dist/astro/routes/api/settings/backups/archives/index.mjs +3 -3
  410. package/dist/astro/routes/api/settings/backups/export.mjs +4 -4
  411. package/dist/astro/routes/api/settings/backups/index.mjs +5 -5
  412. package/dist/astro/routes/api/settings/domain-notify.mjs +6 -6
  413. package/dist/astro/routes/api/settings/domain.mjs +6 -6
  414. package/dist/astro/routes/api/settings/email.mjs +5 -5
  415. package/dist/astro/routes/api/settings.mjs +5 -5
  416. package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -1
  417. package/dist/astro/routes/api/setup/admin-verify.mjs +12 -11
  418. package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
  419. package/dist/astro/routes/api/setup/admin.mjs +7 -7
  420. package/dist/astro/routes/api/setup/dev-bypass.mjs +8 -8
  421. package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
  422. package/dist/astro/routes/api/setup/index.mjs +8 -8
  423. package/dist/astro/routes/api/setup/status.mjs +2 -2
  424. package/dist/astro/routes/api/site/domain-proof.mjs +2 -2
  425. package/dist/astro/routes/api/snapshot.mjs +6 -6
  426. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +6 -7
  427. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
  428. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -1
  429. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +7 -9
  430. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  431. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -1
  432. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +9 -12
  433. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  434. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
  435. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +7 -9
  436. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  437. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +6 -7
  438. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
  439. package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -1
  440. package/dist/astro/routes/api/taxonomies/_name_.mjs +9 -12
  441. package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
  442. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +12 -13
  443. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -1
  444. package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -1
  445. package/dist/astro/routes/api/taxonomies/index.mjs +8 -10
  446. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  447. package/dist/astro/routes/api/themes/preview.mjs +4 -4
  448. package/dist/astro/routes/api/typegen.mjs +3 -3
  449. package/dist/astro/routes/api/visual-editing/action-token.mjs +3 -3
  450. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +3 -3
  451. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +1 -1
  452. package/dist/astro/routes/api/well-known/auth.mjs +1 -1
  453. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +1 -1
  454. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +1 -1
  455. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +6 -5
  456. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  457. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
  458. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +8 -6
  459. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  460. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +7 -6
  461. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  462. package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -1
  463. package/dist/astro/routes/api/widget-areas/_name_.mjs +6 -4
  464. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  465. package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -1
  466. package/dist/astro/routes/api/widget-areas/index.mjs +8 -6
  467. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  468. package/dist/astro/routes/api/widget-components.mjs +2 -2
  469. package/dist/astro/routes/robots.txt.mjs +2 -2
  470. package/dist/astro/routes/sitemap-_collection_.xml.mjs +5 -5
  471. package/dist/astro/routes/sitemap.xml.mjs +3 -3
  472. package/dist/astro/types.d.mts +82 -69
  473. package/dist/astro/types.d.mts.map +1 -1
  474. package/dist/auth/providers/github.d.mts +1 -1
  475. package/dist/auth/providers/google.d.mts +1 -1
  476. package/dist/auth/providers/microsoft.d.mts +1 -1
  477. package/dist/authoritative-records-DFHFmreO.mjs +5183 -0
  478. package/dist/authoritative-records-DFHFmreO.mjs.map +1 -0
  479. package/dist/authorize-6a0h5NN5.mjs +74 -0
  480. package/dist/authorize-6a0h5NN5.mjs.map +1 -0
  481. package/dist/backup-GBRxixs1.mjs +246 -0
  482. package/dist/backup-GBRxixs1.mjs.map +1 -0
  483. package/dist/block-types-BeLZ85Sw.mjs +132 -0
  484. package/dist/block-types-BeLZ85Sw.mjs.map +1 -0
  485. package/dist/block-values-BRJZHvF4.mjs +215 -0
  486. package/dist/block-values-BRJZHvF4.mjs.map +1 -0
  487. package/dist/byline-BufjxQyd.mjs +930 -0
  488. package/dist/byline-BufjxQyd.mjs.map +1 -0
  489. package/dist/byline-fields-Bw7z2opJ.mjs +123 -0
  490. package/dist/byline-fields-Bw7z2opJ.mjs.map +1 -0
  491. package/dist/byline-registry-edmv55U7.mjs +406 -0
  492. package/dist/byline-registry-edmv55U7.mjs.map +1 -0
  493. package/dist/bylines-C8ZT6iWw.mjs +234 -0
  494. package/dist/bylines-C8ZT6iWw.mjs.map +1 -0
  495. package/dist/bylines-a01JW9yq.mjs +150 -0
  496. package/dist/bylines-a01JW9yq.mjs.map +1 -0
  497. package/dist/cache-LOb3NthC.mjs +151 -0
  498. package/dist/cache-LOb3NthC.mjs.map +1 -0
  499. package/dist/canonical-CUkatNPc.mjs +174 -0
  500. package/dist/canonical-CUkatNPc.mjs.map +1 -0
  501. package/dist/capture-triggers-BK2pp_kZ.mjs +362 -0
  502. package/dist/capture-triggers-BK2pp_kZ.mjs.map +1 -0
  503. package/dist/checksum-C8lkApUe.mjs +162 -0
  504. package/dist/checksum-C8lkApUe.mjs.map +1 -0
  505. package/dist/chunks-CvgCLYip.mjs +25 -0
  506. package/dist/chunks-CvgCLYip.mjs.map +1 -0
  507. package/dist/cli/index.mjs +24 -24
  508. package/dist/client/cf-access.d.mts +1 -1
  509. package/dist/client/index.d.mts +63 -63
  510. package/dist/client/index.d.mts.map +1 -1
  511. package/dist/client/index.mjs +6 -4
  512. package/dist/client/index.mjs.map +1 -1
  513. package/dist/collection-slugs-cache-CLR_8fY5.mjs +91 -0
  514. package/dist/collection-slugs-cache-CLR_8fY5.mjs.map +1 -0
  515. package/dist/comment-C163Gl_4.mjs +335 -0
  516. package/dist/comment-C163Gl_4.mjs.map +1 -0
  517. package/dist/comment-reaction-1Df3G-ij.mjs +85 -0
  518. package/dist/comment-reaction-1Df3G-ij.mjs.map +1 -0
  519. package/dist/comments-BFyw2y-m.mjs +99 -0
  520. package/dist/comments-BFyw2y-m.mjs.map +1 -0
  521. package/dist/comments-D73Sy_2U.mjs +195 -0
  522. package/dist/comments-D73Sy_2U.mjs.map +1 -0
  523. package/dist/components-DjV1sxUL.mjs +112 -0
  524. package/dist/components-DjV1sxUL.mjs.map +1 -0
  525. package/dist/config-B27hvMjf.d.mts +7274 -0
  526. package/dist/config-B27hvMjf.d.mts.map +1 -0
  527. package/dist/config-DLzKVQBA.d.mts +41 -0
  528. package/dist/config-DLzKVQBA.d.mts.map +1 -0
  529. package/dist/config-DeluGa9H.mjs +228 -0
  530. package/dist/config-DeluGa9H.mjs.map +1 -0
  531. package/dist/connection-D6aKSo2Y.mjs +36 -0
  532. package/dist/connection-D6aKSo2Y.mjs.map +1 -0
  533. package/dist/content-2gjSbGP3.mjs +2295 -0
  534. package/dist/content-2gjSbGP3.mjs.map +1 -0
  535. package/dist/content-list-query-B9SlIDbL.d.mts +26 -0
  536. package/dist/content-list-query-B9SlIDbL.d.mts.map +1 -0
  537. package/dist/content-repair-Dizo4qiY.mjs +443 -0
  538. package/dist/content-repair-Dizo4qiY.mjs.map +1 -0
  539. package/dist/content-save-BKDTKmkx.mjs +202 -0
  540. package/dist/content-save-BKDTKmkx.mjs.map +1 -0
  541. package/dist/context-DCQrjN95.mjs +2242 -0
  542. package/dist/context-DCQrjN95.mjs.map +1 -0
  543. package/dist/credits-Bxp4F72g.mjs +110 -0
  544. package/dist/credits-Bxp4F72g.mjs.map +1 -0
  545. package/dist/cron-DEV8oz3R.mjs +310 -0
  546. package/dist/cron-DEV8oz3R.mjs.map +1 -0
  547. package/dist/db/index.d.mts +3 -3
  548. package/dist/db/index.mjs +1 -1
  549. package/dist/db/libsql-migrations.d.mts +1 -1
  550. package/dist/db/libsql-migrations.mjs +2 -2
  551. package/dist/db/libsql.d.mts +1 -1
  552. package/dist/db/postgres-migrations.d.mts +1 -1
  553. package/dist/db/postgres-migrations.mjs +2 -2
  554. package/dist/db/postgres.d.mts +1 -1
  555. package/dist/db/sqlite-migrations.d.mts +1 -1
  556. package/dist/db/sqlite-migrations.mjs +2 -2
  557. package/dist/db/sqlite.d.mts +1 -1
  558. package/dist/db/sqlite.mjs +1 -1
  559. package/dist/default-DKs7zP7m.mjs +81 -0
  560. package/dist/default-DKs7zP7m.mjs.map +1 -0
  561. package/dist/deferred-tasks-B5LQWb5F.d.mts +10 -0
  562. package/dist/deferred-tasks-B5LQWb5F.d.mts.map +1 -0
  563. package/dist/device-flow-D6kyi3jX.mjs +519 -0
  564. package/dist/device-flow-D6kyi3jX.mjs.map +1 -0
  565. package/dist/dialect-helpers-DRe1Y08G.mjs +355 -0
  566. package/dist/dialect-helpers-DRe1Y08G.mjs.map +1 -0
  567. package/dist/digest-DSsUd9oL.mjs +194 -0
  568. package/dist/digest-DSsUd9oL.mjs.map +1 -0
  569. package/dist/direct-executor-DAcU8MTG.mjs +117 -0
  570. package/dist/direct-executor-DAcU8MTG.mjs.map +1 -0
  571. package/dist/email-console-CBZpj1VI.mjs +50 -0
  572. package/dist/email-console-CBZpj1VI.mjs.map +1 -0
  573. package/dist/email-locale-CGjBa23b.mjs +25 -0
  574. package/dist/email-locale-CGjBa23b.mjs.map +1 -0
  575. package/dist/email-smtp-CE6nESRL.mjs +643 -0
  576. package/dist/email-smtp-CE6nESRL.mjs.map +1 -0
  577. package/dist/emdash-runtime-CF6KAut9.mjs +5576 -0
  578. package/dist/emdash-runtime-CF6KAut9.mjs.map +1 -0
  579. package/dist/enrich-C4vKniyi.mjs +203 -0
  580. package/dist/enrich-C4vKniyi.mjs.map +1 -0
  581. package/dist/entry-lock-DJgDNfMf.mjs +1230 -0
  582. package/dist/entry-lock-DJgDNfMf.mjs.map +1 -0
  583. package/dist/entry-lock-GKD0lJI5.mjs +207 -0
  584. package/dist/entry-lock-GKD0lJI5.mjs.map +1 -0
  585. package/dist/entry-locks-B58Q9LZh.mjs +173 -0
  586. package/dist/entry-locks-B58Q9LZh.mjs.map +1 -0
  587. package/dist/env-types-EL7WTMzr.mjs +38 -0
  588. package/dist/env-types-EL7WTMzr.mjs.map +1 -0
  589. package/dist/error-0Y0dFPxm.mjs +82 -0
  590. package/dist/error-0Y0dFPxm.mjs.map +1 -0
  591. package/dist/errors-OTWh4SC_.mjs +502 -0
  592. package/dist/errors-OTWh4SC_.mjs.map +1 -0
  593. package/dist/errors-u5rZhbVQ.mjs +120 -0
  594. package/dist/errors-u5rZhbVQ.mjs.map +1 -0
  595. package/dist/fence-CkdbSoZX.mjs +162 -0
  596. package/dist/fence-CkdbSoZX.mjs.map +1 -0
  597. package/dist/field-defs-cache-BW0Y9Wrp.mjs +79 -0
  598. package/dist/field-defs-cache-BW0Y9Wrp.mjs.map +1 -0
  599. package/dist/field-map-Bhqs6zUK.mjs +84 -0
  600. package/dist/field-map-Bhqs6zUK.mjs.map +1 -0
  601. package/dist/fts-manager-m8GPxogO.mjs +532 -0
  602. package/dist/fts-manager-m8GPxogO.mjs.map +1 -0
  603. package/dist/gc-CEhfEMLY.mjs +62 -0
  604. package/dist/gc-CEhfEMLY.mjs.map +1 -0
  605. package/dist/hook-result-CG0uHAT5.d.mts +31 -0
  606. package/dist/hook-result-CG0uHAT5.d.mts.map +1 -0
  607. package/dist/hook-result-mOyk-VCt.mjs +3855 -0
  608. package/dist/hook-result-mOyk-VCt.mjs.map +1 -0
  609. package/dist/hreflang-B1E64c5R.d.mts +51 -0
  610. package/dist/hreflang-B1E64c5R.d.mts.map +1 -0
  611. package/dist/hreflang-DaMRoUor.mjs +105 -0
  612. package/dist/hreflang-DaMRoUor.mjs.map +1 -0
  613. package/dist/http-route-dispatch-Y8bwyixm.mjs +348 -0
  614. package/dist/http-route-dispatch-Y8bwyixm.mjs.map +1 -0
  615. package/dist/identity-cqdOzgy9.mjs +35 -0
  616. package/dist/identity-cqdOzgy9.mjs.map +1 -0
  617. package/dist/index-CzbH8FX2.d.mts +261 -0
  618. package/dist/index-CzbH8FX2.d.mts.map +1 -0
  619. package/dist/index.d.mts +25 -25
  620. package/dist/index.mjs +60 -53
  621. package/dist/index.mjs.map +1 -1
  622. package/dist/install-finalization-B02IcpqW.mjs +58 -0
  623. package/dist/install-finalization-B02IcpqW.mjs.map +1 -0
  624. package/dist/json-recordset-2VNAgija.mjs +12 -0
  625. package/dist/json-recordset-2VNAgija.mjs.map +1 -0
  626. package/dist/json-schema-CnImQ4DF.mjs +15 -0
  627. package/dist/json-schema-CnImQ4DF.mjs.map +1 -0
  628. package/dist/keys-B5WUGmYK.mjs +61 -0
  629. package/dist/keys-B5WUGmYK.mjs.map +1 -0
  630. package/dist/kinds-DyAmbNrx.mjs +974 -0
  631. package/dist/kinds-DyAmbNrx.mjs.map +1 -0
  632. package/dist/lifecycle-1Nl01SeB.mjs +53 -0
  633. package/dist/lifecycle-1Nl01SeB.mjs.map +1 -0
  634. package/dist/limits-BuiMu9zx.mjs +44 -0
  635. package/dist/limits-BuiMu9zx.mjs.map +1 -0
  636. package/dist/load-CEt0TQ4_.mjs +36 -0
  637. package/dist/load-CEt0TQ4_.mjs.map +1 -0
  638. package/dist/loader-DF6J1Fpd.mjs +1537 -0
  639. package/dist/loader-DF6J1Fpd.mjs.map +1 -0
  640. package/dist/loops-3DdrfQ6y.mjs +217 -0
  641. package/dist/loops-3DdrfQ6y.mjs.map +1 -0
  642. package/dist/manifest-builder-Dcfqd9Aw.mjs +196 -0
  643. package/dist/manifest-builder-Dcfqd9Aw.mjs.map +1 -0
  644. package/dist/manifest-schema-Pi_JP_Wi.mjs +497 -0
  645. package/dist/manifest-schema-Pi_JP_Wi.mjs.map +1 -0
  646. package/dist/marketplace-BsMC_Z7o.mjs +257 -0
  647. package/dist/marketplace-BsMC_Z7o.mjs.map +1 -0
  648. package/dist/marketplace-D9fChLav.mjs +965 -0
  649. package/dist/marketplace-D9fChLav.mjs.map +1 -0
  650. package/dist/media/image-endpoint.d.mts +33 -1
  651. package/dist/media/image-endpoint.d.mts.map +1 -1
  652. package/dist/media/image-endpoint.mjs +77 -1
  653. package/dist/media/image-endpoint.mjs.map +1 -1
  654. package/dist/media/index.d.mts +1 -1
  655. package/dist/media/index.mjs +1 -1
  656. package/dist/media/local-runtime.d.mts +17 -17
  657. package/dist/media/local-runtime.mjs +3 -3
  658. package/dist/media--P-IEycF.mjs +2813 -0
  659. package/dist/media--P-IEycF.mjs.map +1 -0
  660. package/dist/media-CTA82rU1.mjs +295 -0
  661. package/dist/media-CTA82rU1.mjs.map +1 -0
  662. package/dist/media-Cq_oKN_Y.mjs +425 -0
  663. package/dist/media-Cq_oKN_Y.mjs.map +1 -0
  664. package/dist/media-DRDkfiDv.d.mts +203 -0
  665. package/dist/media-DRDkfiDv.d.mts.map +1 -0
  666. package/dist/media-allowlist-C_kSleFj.mjs +103 -0
  667. package/dist/media-allowlist-C_kSleFj.mjs.map +1 -0
  668. package/dist/media-folders-Lc9Ks8az.mjs +205 -0
  669. package/dist/media-folders-Lc9Ks8az.mjs.map +1 -0
  670. package/dist/media-url-BEvOId4Z.mjs +43 -0
  671. package/dist/media-url-BEvOId4Z.mjs.map +1 -0
  672. package/dist/media-usage-D6LjfdGn.mjs +282 -0
  673. package/dist/media-usage-D6LjfdGn.mjs.map +1 -0
  674. package/dist/media-usage-activation-i6tqb6cn.mjs +78 -0
  675. package/dist/media-usage-activation-i6tqb6cn.mjs.map +1 -0
  676. package/dist/media-usage-work-C5HHgfEU.mjs +1036 -0
  677. package/dist/media-usage-work-C5HHgfEU.mjs.map +1 -0
  678. package/dist/media-usage-work-CxqS_Ny9.mjs +151 -0
  679. package/dist/media-usage-work-CxqS_Ny9.mjs.map +1 -0
  680. package/dist/menu-CvWToneO.mjs +420 -0
  681. package/dist/menu-CvWToneO.mjs.map +1 -0
  682. package/dist/menus-BzjHvAM4.mjs +434 -0
  683. package/dist/menus-BzjHvAM4.mjs.map +1 -0
  684. package/dist/menus-CnEw5nz8.mjs +92 -0
  685. package/dist/menus-CnEw5nz8.mjs.map +1 -0
  686. package/dist/menus-DoVbs2sn.mjs +433 -0
  687. package/dist/menus-DoVbs2sn.mjs.map +1 -0
  688. package/dist/migrations/index.d.mts +1 -1
  689. package/dist/migrations/index.mjs +2 -2
  690. package/dist/mime-C_YV5Mjm.mjs +90 -0
  691. package/dist/mime-C_YV5Mjm.mjs.map +1 -0
  692. package/dist/node-sqlite-compat-DHFDZMe2.mjs +68 -0
  693. package/dist/node-sqlite-compat-DHFDZMe2.mjs.map +1 -0
  694. package/dist/oauth-authorization-CvT-8KtG.mjs +287 -0
  695. package/dist/oauth-authorization-CvT-8KtG.mjs.map +1 -0
  696. package/dist/oauth-clients-ohsH0FlQ.mjs +266 -0
  697. package/dist/oauth-clients-ohsH0FlQ.mjs.map +1 -0
  698. package/dist/oauth-state-store-V4y2qZwD.mjs +80 -0
  699. package/dist/oauth-state-store-V4y2qZwD.mjs.map +1 -0
  700. package/dist/oauth-user-lookup-D2NTHxcr.mjs +26 -0
  701. package/dist/oauth-user-lookup-D2NTHxcr.mjs.map +1 -0
  702. package/dist/object-cache/memory.d.mts +1 -1
  703. package/dist/object-cache-I4Re7BOR.mjs +807 -0
  704. package/dist/object-cache-I4Re7BOR.mjs.map +1 -0
  705. package/dist/options-CbSYZAwr.d.mts +81 -0
  706. package/dist/options-CbSYZAwr.d.mts.map +1 -0
  707. package/dist/page/index.d.mts +2 -2
  708. package/dist/parse-BTfkfMuL.mjs +82 -0
  709. package/dist/parse-BTfkfMuL.mjs.map +1 -0
  710. package/dist/parse-CBM779p-.d.mts +180 -0
  711. package/dist/parse-CBM779p-.d.mts.map +1 -0
  712. package/dist/parts-i0nNljq-.mjs +68 -0
  713. package/dist/parts-i0nNljq-.mjs.map +1 -0
  714. package/dist/passkey-config-D9iYgt4G.mjs +46 -0
  715. package/dist/passkey-config-D9iYgt4G.mjs.map +1 -0
  716. package/dist/paths-B1TgS0ir.mjs +77 -0
  717. package/dist/paths-B1TgS0ir.mjs.map +1 -0
  718. package/dist/placeholder-PFMxMYTa.d.mts +316 -0
  719. package/dist/placeholder-PFMxMYTa.d.mts.map +1 -0
  720. package/dist/plan-DQoNgF2Y.mjs +135 -0
  721. package/dist/plan-DQoNgF2Y.mjs.map +1 -0
  722. package/dist/plugin-settings-CKffVNYE.mjs +162 -0
  723. package/dist/plugin-settings-CKffVNYE.mjs.map +1 -0
  724. package/dist/plugin-test-runtime.d.mts +23 -22
  725. package/dist/plugin-test-runtime.d.mts.map +1 -1
  726. package/dist/plugin-test-runtime.mjs +9 -8
  727. package/dist/plugin-types.d.mts +2 -2
  728. package/dist/plugin-utils.d.mts +15 -15
  729. package/dist/plugins/adapt-sandbox-entry.d.mts +15 -15
  730. package/dist/plugins/adapt-sandbox-entry.mjs +4 -4
  731. package/dist/plugins/host.d.mts +6 -6
  732. package/dist/plugins/host.mjs +8 -7
  733. package/dist/plugins-DDiWIA_N.mjs +261 -0
  734. package/dist/plugins-DDiWIA_N.mjs.map +1 -0
  735. package/dist/policy-72PGoCgJ.mjs +56 -0
  736. package/dist/policy-72PGoCgJ.mjs.map +1 -0
  737. package/dist/portable-text-D18C1jR6.mjs +457 -0
  738. package/dist/portable-text-D18C1jR6.mjs.map +1 -0
  739. package/dist/protocol-CbSoh3FE.d.mts +65 -0
  740. package/dist/protocol-CbSoh3FE.d.mts.map +1 -0
  741. package/dist/public-plugin-api-routes-Bq55wwHn.mjs +323 -0
  742. package/dist/public-plugin-api-routes-Bq55wwHn.mjs.map +1 -0
  743. package/dist/public-submission-BEcSmcWi.mjs +253 -0
  744. package/dist/public-submission-BEcSmcWi.mjs.map +1 -0
  745. package/dist/public-url-DYZMfvpa.mjs +123 -0
  746. package/dist/public-url-DYZMfvpa.mjs.map +1 -0
  747. package/dist/query-CslUTGOV.mjs +1221 -0
  748. package/dist/query-CslUTGOV.mjs.map +1 -0
  749. package/dist/query-Cv8bjIwl.mjs +41 -0
  750. package/dist/query-Cv8bjIwl.mjs.map +1 -0
  751. package/dist/range-CzdsIs-O.mjs +51 -0
  752. package/dist/range-CzdsIs-O.mjs.map +1 -0
  753. package/dist/rate-limit-iZgsy_oY.mjs +127 -0
  754. package/dist/rate-limit-iZgsy_oY.mjs.map +1 -0
  755. package/dist/receipt-CqxAacXn.mjs +43 -0
  756. package/dist/receipt-CqxAacXn.mjs.map +1 -0
  757. package/dist/redirect-3A3kqsD-.mjs +19 -0
  758. package/dist/redirect-3A3kqsD-.mjs.map +1 -0
  759. package/dist/redirect-DsaFuuQi.mjs +466 -0
  760. package/dist/redirect-DsaFuuQi.mjs.map +1 -0
  761. package/dist/redirect-paths-DgkkN0qJ.mjs +36 -0
  762. package/dist/redirect-paths-DgkkN0qJ.mjs.map +1 -0
  763. package/dist/redirects-DfvdrgF1.mjs +446 -0
  764. package/dist/redirects-DfvdrgF1.mjs.map +1 -0
  765. package/dist/redirects-Yo8YTJMV.mjs +148 -0
  766. package/dist/redirects-Yo8YTJMV.mjs.map +1 -0
  767. package/dist/registry/testing.mjs +2 -2
  768. package/dist/registry-2vAYgqCz.mjs +755 -0
  769. package/dist/registry-2vAYgqCz.mjs.map +1 -0
  770. package/dist/registry-COR9pjyi.mjs +1449 -0
  771. package/dist/registry-COR9pjyi.mjs.map +1 -0
  772. package/dist/registry-CSLrHSx1.mjs +6139 -0
  773. package/dist/registry-CSLrHSx1.mjs.map +1 -0
  774. package/dist/relations-5fVj42fZ.mjs +798 -0
  775. package/dist/relations-5fVj42fZ.mjs.map +1 -0
  776. package/dist/request-context.d.mts +2 -2
  777. package/dist/request-meta-B0TPrDpq.mjs +141 -0
  778. package/dist/request-meta-B0TPrDpq.mjs.map +1 -0
  779. package/dist/resolve--EmZidEz.mjs +92 -0
  780. package/dist/resolve--EmZidEz.mjs.map +1 -0
  781. package/dist/revision-Dk9VI8Vf.mjs +503 -0
  782. package/dist/revision-Dk9VI8Vf.mjs.map +1 -0
  783. package/dist/rooms/index.d.mts +15 -15
  784. package/dist/rooms/index.mjs +3 -3
  785. package/dist/rooms/node/index.d.mts +15 -15
  786. package/dist/rooms/node/index.mjs +6 -6
  787. package/dist/rooms/notifications.d.mts +15 -15
  788. package/dist/rooms/notifications.mjs +2 -2
  789. package/dist/rooms/room.d.mts +15 -15
  790. package/dist/rooms/room.mjs +2 -2
  791. package/dist/rooms/site.d.mts +15 -15
  792. package/dist/rooms/site.mjs +4 -4
  793. package/dist/rooms-AcO0YNUt.mjs +335 -0
  794. package/dist/rooms-AcO0YNUt.mjs.map +1 -0
  795. package/dist/rooms-B2P1xIS_.d.mts +4778 -0
  796. package/dist/rooms-B2P1xIS_.d.mts.map +1 -0
  797. package/dist/rooms-C08U-F8Y.mjs +169 -0
  798. package/dist/rooms-C08U-F8Y.mjs.map +1 -0
  799. package/dist/route-cache-CvTJlNVT.mjs +30 -0
  800. package/dist/route-cache-CvTJlNVT.mjs.map +1 -0
  801. package/dist/route-wire-NAkNES3Z.mjs +197 -0
  802. package/dist/route-wire-NAkNES3Z.mjs.map +1 -0
  803. package/dist/routes-BScyES_G.mjs +272 -0
  804. package/dist/routes-BScyES_G.mjs.map +1 -0
  805. package/dist/runner-C6gBIcTD.d.mts +79 -0
  806. package/dist/runner-C6gBIcTD.d.mts.map +1 -0
  807. package/dist/runner-Nv0yWP-G.mjs +6964 -0
  808. package/dist/runner-Nv0yWP-G.mjs.map +1 -0
  809. package/dist/runtime-holder-DkZ_0f7A.mjs +36 -0
  810. package/dist/runtime-holder-DkZ_0f7A.mjs.map +1 -0
  811. package/dist/runtime.d.mts +16 -16
  812. package/dist/runtime.mjs +1 -1
  813. package/dist/scheduler-health-B5n19775.mjs +31 -0
  814. package/dist/scheduler-health-B5n19775.mjs.map +1 -0
  815. package/dist/schema/project-env-types.mjs +6 -6
  816. package/dist/schema-B7ODIkP4.mjs +13 -0
  817. package/dist/schema-B7ODIkP4.mjs.map +1 -0
  818. package/dist/schema-D04_n_7j.mjs +815 -0
  819. package/dist/schema-D04_n_7j.mjs.map +1 -0
  820. package/dist/scopes-CHc86VzZ.mjs +34 -0
  821. package/dist/scopes-CHc86VzZ.mjs.map +1 -0
  822. package/dist/search-BxBg7Xq1.mjs +503 -0
  823. package/dist/search-BxBg7Xq1.mjs.map +1 -0
  824. package/dist/search-SRLBXKJU.mjs +12 -0
  825. package/dist/search-SRLBXKJU.mjs.map +1 -0
  826. package/dist/secrets-O25WpEe_.mjs +369 -0
  827. package/dist/secrets-O25WpEe_.mjs.map +1 -0
  828. package/dist/sections-BK7soA2U.mjs +222 -0
  829. package/dist/sections-BK7soA2U.mjs.map +1 -0
  830. package/dist/sections-CLejSkAG.mjs +129 -0
  831. package/dist/sections-CLejSkAG.mjs.map +1 -0
  832. package/dist/seed/index.d.mts +2 -2
  833. package/dist/seed/index.mjs +4 -4
  834. package/dist/seo/index.d.mts +3 -3
  835. package/dist/seo/index.mjs +3 -3
  836. package/dist/seo-Ie7B6cud.mjs +194 -0
  837. package/dist/seo-Ie7B6cud.mjs.map +1 -0
  838. package/dist/service-DbKGSUHC.mjs +150 -0
  839. package/dist/service-DbKGSUHC.mjs.map +1 -0
  840. package/dist/session-user-BrCPLyWB.mjs +61 -0
  841. package/dist/session-user-BrCPLyWB.mjs.map +1 -0
  842. package/dist/settings-BApLX_aS.mjs +413 -0
  843. package/dist/settings-BApLX_aS.mjs.map +1 -0
  844. package/dist/settings-Ces2K0VL.mjs +74 -0
  845. package/dist/settings-Ces2K0VL.mjs.map +1 -0
  846. package/dist/settings-DMHIgDyb.mjs +66 -0
  847. package/dist/settings-DMHIgDyb.mjs.map +1 -0
  848. package/dist/settings-DgnWX0GN.mjs +157 -0
  849. package/dist/settings-DgnWX0GN.mjs.map +1 -0
  850. package/dist/setup-complete-DQ1nNEjm.mjs +65 -0
  851. package/dist/setup-complete-DQ1nNEjm.mjs.map +1 -0
  852. package/dist/setup-nonce-5k8BY3W_.mjs +25 -0
  853. package/dist/setup-nonce-5k8BY3W_.mjs.map +1 -0
  854. package/dist/site-domain-B2KvJstd.mjs +131 -0
  855. package/dist/site-domain-B2KvJstd.mjs.map +1 -0
  856. package/dist/site-settings-B7VxSqP6.mjs +50 -0
  857. package/dist/site-settings-B7VxSqP6.mjs.map +1 -0
  858. package/dist/site-title-DHgWlyMw.mjs +14 -0
  859. package/dist/site-title-DHgWlyMw.mjs.map +1 -0
  860. package/dist/site-url-OBYES-gb.mjs +45 -0
  861. package/dist/site-url-OBYES-gb.mjs.map +1 -0
  862. package/dist/sitemap-name-BZXv5sf0.mjs +26 -0
  863. package/dist/sitemap-name-BZXv5sf0.mjs.map +1 -0
  864. package/dist/slug-CFsfrxUp.mjs +16 -0
  865. package/dist/slug-CFsfrxUp.mjs.map +1 -0
  866. package/dist/snapshot-BaIv7afB.mjs +466 -0
  867. package/dist/snapshot-BaIv7afB.mjs.map +1 -0
  868. package/dist/snapshot-VQM7BcdM.mjs +184 -0
  869. package/dist/snapshot-VQM7BcdM.mjs.map +1 -0
  870. package/dist/ssrf-Em0CeaaN.mjs +406 -0
  871. package/dist/ssrf-Em0CeaaN.mjs.map +1 -0
  872. package/dist/stage-Ctas_E7M.mjs +662 -0
  873. package/dist/stage-Ctas_E7M.mjs.map +1 -0
  874. package/dist/staged-C746SkS0.mjs +686 -0
  875. package/dist/staged-C746SkS0.mjs.map +1 -0
  876. package/dist/start-user-session-CdyNie0P.mjs +9 -0
  877. package/dist/start-user-session-CdyNie0P.mjs.map +1 -0
  878. package/dist/state-Cdkt6b1h.mjs +282 -0
  879. package/dist/state-Cdkt6b1h.mjs.map +1 -0
  880. package/dist/storage/local.d.mts +1 -1
  881. package/dist/storage/local.mjs +2 -2
  882. package/dist/storage/s3.d.mts +1 -1
  883. package/dist/storage/s3.mjs +1 -1
  884. package/dist/storage-query-DdKo8oes.d.mts +1614 -0
  885. package/dist/storage-query-DdKo8oes.d.mts.map +1 -0
  886. package/dist/tar-Tbl91sMI.mjs +449 -0
  887. package/dist/tar-Tbl91sMI.mjs.map +1 -0
  888. package/dist/target-Bjxlaj4T.mjs +27 -0
  889. package/dist/target-Bjxlaj4T.mjs.map +1 -0
  890. package/dist/taxonomies-D5bavOHA.mjs +937 -0
  891. package/dist/taxonomies-D5bavOHA.mjs.map +1 -0
  892. package/dist/taxonomies-DApyZAJq.mjs +722 -0
  893. package/dist/taxonomies-DApyZAJq.mjs.map +1 -0
  894. package/dist/taxonomy-D4Fl2smf.mjs +593 -0
  895. package/dist/taxonomy-D4Fl2smf.mjs.map +1 -0
  896. package/dist/tokens-DvEbszXd.mjs +171 -0
  897. package/dist/tokens-DvEbszXd.mjs.map +1 -0
  898. package/dist/transaction-D5Kq7MTL.mjs +44 -0
  899. package/dist/transaction-D5Kq7MTL.mjs.map +1 -0
  900. package/dist/transfer-BwKpOrTV.mjs +8963 -0
  901. package/dist/transfer-BwKpOrTV.mjs.map +1 -0
  902. package/dist/transfer-CafpWTD6.mjs +166 -0
  903. package/dist/transfer-CafpWTD6.mjs.map +1 -0
  904. package/dist/transfer-download-H8beYs2r.mjs +33 -0
  905. package/dist/transfer-download-H8beYs2r.mjs.map +1 -0
  906. package/dist/transformations-DX_dwSfp.mjs +196 -0
  907. package/dist/transformations-DX_dwSfp.mjs.map +1 -0
  908. package/dist/transport-7mI_Nvnn.d.mts +42 -0
  909. package/dist/transport-7mI_Nvnn.d.mts.map +1 -0
  910. package/dist/transport-Cs1Xl7-v.mjs +144 -0
  911. package/dist/transport-Cs1Xl7-v.mjs.map +1 -0
  912. package/dist/trusted-proxy-DaSru7xW.mjs +51 -0
  913. package/dist/trusted-proxy-DaSru7xW.mjs.map +1 -0
  914. package/dist/turnstile-DNR0cwtt.mjs +58 -0
  915. package/dist/turnstile-DNR0cwtt.mjs.map +1 -0
  916. package/dist/types-8q-gxKfV.d.mts +935 -0
  917. package/dist/types-8q-gxKfV.d.mts.map +1 -0
  918. package/dist/types-BBH-w_KS.mjs.map +1 -1
  919. package/dist/types-BE4og6EZ.d.mts +292 -0
  920. package/dist/types-BE4og6EZ.d.mts.map +1 -0
  921. package/dist/types-BbOWBoRk.d.mts +384 -0
  922. package/dist/types-BbOWBoRk.d.mts.map +1 -0
  923. package/dist/types-BmBK2cqf.mjs.map +1 -1
  924. package/dist/types-C3tTVw9y.mjs +37 -0
  925. package/dist/types-C3tTVw9y.mjs.map +1 -0
  926. package/dist/types-CTQEkZcI.mjs +16 -0
  927. package/dist/types-CTQEkZcI.mjs.map +1 -0
  928. package/dist/types-CbfB5YfA.d.mts +209 -0
  929. package/dist/types-CbfB5YfA.d.mts.map +1 -0
  930. package/dist/types-CeknTiV0.d.mts +93 -0
  931. package/dist/types-CeknTiV0.d.mts.map +1 -0
  932. package/dist/types-CpFfDrGH.mjs.map +1 -1
  933. package/dist/types-DHjtQujX.mjs +77 -0
  934. package/dist/types-DHjtQujX.mjs.map +1 -0
  935. package/dist/types-EYyvAjNA.d.mts +125 -0
  936. package/dist/types-EYyvAjNA.d.mts.map +1 -0
  937. package/dist/types-VMZCO8hc.d.mts +366 -0
  938. package/dist/types-VMZCO8hc.d.mts.map +1 -0
  939. package/dist/types-YTpIfKXX.d.mts +1756 -0
  940. package/dist/types-YTpIfKXX.d.mts.map +1 -0
  941. package/dist/types-iSBIMGiz.d.mts +227 -0
  942. package/dist/types-iSBIMGiz.d.mts.map +1 -0
  943. package/dist/upload-attempts-ChkgAfye.mjs +32 -0
  944. package/dist/upload-attempts-ChkgAfye.mjs.map +1 -0
  945. package/dist/url-CBR5ZBBQ.mjs +87 -0
  946. package/dist/url-CBR5ZBBQ.mjs.map +1 -0
  947. package/dist/url-pattern-DViEwhDu.mjs +41 -0
  948. package/dist/url-pattern-DViEwhDu.mjs.map +1 -0
  949. package/dist/urls-BCnpTM3T.mjs +79 -0
  950. package/dist/urls-BCnpTM3T.mjs.map +1 -0
  951. package/dist/user-Cy4kOmtD.mjs +184 -0
  952. package/dist/user-Cy4kOmtD.mjs.map +1 -0
  953. package/dist/utils-0R0olFJs.d.mts +374 -0
  954. package/dist/utils-0R0olFJs.d.mts.map +1 -0
  955. package/dist/utils-DIfKXQ5o.mjs +450 -0
  956. package/dist/utils-DIfKXQ5o.mjs.map +1 -0
  957. package/dist/validate-CYHbSQ-M.d.mts +472 -0
  958. package/dist/validate-CYHbSQ-M.d.mts.map +1 -0
  959. package/dist/validate-DBnEN6hU.mjs +524 -0
  960. package/dist/validate-DBnEN6hU.mjs.map +1 -0
  961. package/dist/validation-Becbh-zl.mjs +204 -0
  962. package/dist/validation-Becbh-zl.mjs.map +1 -0
  963. package/dist/version-BE4RahxC.mjs +7 -0
  964. package/dist/version-BE4RahxC.mjs.map +1 -0
  965. package/dist/version-C3C6o1xi.mjs +9 -0
  966. package/dist/version-C3C6o1xi.mjs.map +1 -0
  967. package/dist/version-PIyVra05.mjs +49 -0
  968. package/dist/version-PIyVra05.mjs.map +1 -0
  969. package/dist/video-Cgw31pIP.mjs +18 -0
  970. package/dist/video-Cgw31pIP.mjs.map +1 -0
  971. package/dist/virtual-modules-DAvm-Tct.mjs +565 -0
  972. package/dist/virtual-modules-DAvm-Tct.mjs.map +1 -0
  973. package/dist/widgets-HYhp_QtR.mjs +134 -0
  974. package/dist/widgets-HYhp_QtR.mjs.map +1 -0
  975. package/dist/wxr-CDtij4U5.mjs +1054 -0
  976. package/dist/wxr-CDtij4U5.mjs.map +1 -0
  977. package/dist/wxr-taxonomies-fliLjgKD.mjs +735 -0
  978. package/dist/wxr-taxonomies-fliLjgKD.mjs.map +1 -0
  979. package/dist/wxr-taxonomies-uZgPVgPe.d.mts +34 -0
  980. package/dist/wxr-taxonomies-uZgPVgPe.d.mts.map +1 -0
  981. package/package.json +11 -10
  982. package/src/after.ts +17 -10
  983. package/src/api/error.ts +0 -13
  984. package/src/api/handlers/manifest.ts +1 -0
  985. package/src/api/handlers/media-allowlist.ts +66 -7
  986. package/src/api/handlers/media-usage.ts +2 -1
  987. package/src/api/handlers/media.ts +4 -2
  988. package/src/api/handlers/seo.ts +19 -7
  989. package/src/api/openapi/document.ts +1 -1
  990. package/src/api/schemas/auth.ts +7 -0
  991. package/src/api/schemas/media-usage.ts +1 -0
  992. package/src/api/schemas/media.ts +13 -3
  993. package/src/api/schemas/schema.ts +14 -0
  994. package/src/api/search.ts +15 -0
  995. package/src/api/types.ts +3 -0
  996. package/src/astro/image-endpoint.ts +30 -4
  997. package/src/astro/integration/dev-scheduler-bridge.ts +1 -2
  998. package/src/astro/integration/index.ts +22 -1
  999. package/src/astro/integration/routes.ts +4 -0
  1000. package/src/astro/integration/virtual-modules.ts +3 -6
  1001. package/src/astro/integration/vite-config.ts +13 -6
  1002. package/src/astro/middleware/auth.ts +18 -11
  1003. package/src/astro/middleware/redirect.ts +41 -23
  1004. package/src/astro/middleware/request-context.ts +4 -2
  1005. package/src/astro/middleware/scoped-db.ts +4 -4
  1006. package/src/astro/middleware.ts +288 -204
  1007. package/src/astro/prefetch.ts +21 -17
  1008. package/src/astro/public-plugin-api-routes.ts +4 -4
  1009. package/src/astro/routes/PluginRegistry.tsx +2 -3
  1010. package/src/astro/routes/api/admin/byline-fields/[slug]/usage.ts +4 -3
  1011. package/src/astro/routes/api/admin/byline-fields/[slug].ts +10 -7
  1012. package/src/astro/routes/api/admin/byline-fields/index.ts +7 -5
  1013. package/src/astro/routes/api/admin/byline-fields/reorder.ts +4 -3
  1014. package/src/astro/routes/api/admin/bylines/[id]/index.ts +4 -3
  1015. package/src/astro/routes/api/admin/bylines/[id]/translations.ts +7 -5
  1016. package/src/astro/routes/api/admin/comments/[id]/status.ts +4 -3
  1017. package/src/astro/routes/api/admin/comments/[id].ts +7 -5
  1018. package/src/astro/routes/api/admin/comments/bulk.ts +4 -3
  1019. package/src/astro/routes/api/admin/comments/counts.ts +4 -3
  1020. package/src/astro/routes/api/admin/comments/index.ts +4 -3
  1021. package/src/astro/routes/api/admin/media-usage/activation.ts +7 -5
  1022. package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +4 -3
  1023. package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +4 -3
  1024. package/src/astro/routes/api/admin/media-usage/progress.ts +7 -5
  1025. package/src/astro/routes/api/admin/media-usage/repair.ts +4 -3
  1026. package/src/astro/routes/api/admin/media-usage/work/index.ts +4 -3
  1027. package/src/astro/routes/api/admin/media-usage/work/retry.ts +4 -3
  1028. package/src/astro/routes/api/admin/plugins/registry/artifact.ts +7 -4
  1029. package/src/astro/routes/api/admin/transfer/approvals/[id]/approve.ts +4 -3
  1030. package/src/astro/routes/api/admin/transfer/approvals/[id]/deny.ts +4 -3
  1031. package/src/astro/routes/api/admin/transfer/approvals/index.ts +4 -3
  1032. package/src/astro/routes/api/admin/transfer/capabilities.ts +4 -3
  1033. package/src/astro/routes/api/admin/transfer/exports/[id]/advance.ts +4 -3
  1034. package/src/astro/routes/api/admin/transfer/exports/[id]/archive.ts +4 -3
  1035. package/src/astro/routes/api/admin/transfer/exports/[id]/files/[...path].ts +4 -3
  1036. package/src/astro/routes/api/admin/transfer/exports/[id]/index.ts +4 -3
  1037. package/src/astro/routes/api/admin/transfer/exports/[id]/manifest.ts +4 -3
  1038. package/src/astro/routes/api/admin/transfer/exports/index.ts +7 -5
  1039. package/src/astro/routes/api/admin/transfer/imports/[id]/abandon.ts +4 -3
  1040. package/src/astro/routes/api/admin/transfer/imports/[id]/advance.ts +4 -3
  1041. package/src/astro/routes/api/admin/transfer/imports/[id]/analyze.ts +4 -3
  1042. package/src/astro/routes/api/admin/transfer/imports/[id]/cancel.ts +4 -3
  1043. package/src/astro/routes/api/admin/transfer/imports/[id]/execute.ts +4 -3
  1044. package/src/astro/routes/api/admin/transfer/imports/[id]/files/[...path].ts +4 -3
  1045. package/src/astro/routes/api/admin/transfer/imports/[id]/index.ts +4 -3
  1046. package/src/astro/routes/api/admin/transfer/imports/[id]/missing.ts +4 -3
  1047. package/src/astro/routes/api/admin/transfer/imports/[id]/plan.ts +4 -3
  1048. package/src/astro/routes/api/admin/transfer/imports/[id]/receipt.ts +4 -3
  1049. package/src/astro/routes/api/admin/transfer/imports/index.ts +7 -5
  1050. package/src/astro/routes/api/auth/invite/complete.ts +2 -1
  1051. package/src/astro/routes/api/auth/magic-link/verify.ts +2 -1
  1052. package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +2 -1
  1053. package/src/astro/routes/api/auth/passkey/verify.ts +2 -1
  1054. package/src/astro/routes/api/auth/signup/complete.ts +2 -1
  1055. package/src/astro/routes/api/auth/signup/register-options.ts +69 -0
  1056. package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +7 -5
  1057. package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +7 -5
  1058. package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +3 -13
  1059. package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +3 -13
  1060. package/src/astro/routes/api/content/[collection]/[id]/lock.ts +19 -19
  1061. package/src/astro/routes/api/content/[collection]/[id]/publish.ts +3 -12
  1062. package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +4 -3
  1063. package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/parents.ts +4 -3
  1064. package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +11 -19
  1065. package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +3 -12
  1066. package/src/astro/routes/api/content/[collection]/[id].ts +12 -34
  1067. package/src/astro/routes/api/import/wordpress/execute.ts +1 -4
  1068. package/src/astro/routes/api/import/wordpress/media.ts +3 -2
  1069. package/src/astro/routes/api/import/wordpress-plugin/execute.ts +1 -4
  1070. package/src/astro/routes/api/media/[id]/replace.ts +11 -2
  1071. package/src/astro/routes/api/media/[id].ts +16 -3
  1072. package/src/astro/routes/api/media/file/[...key].ts +11 -0
  1073. package/src/astro/routes/api/media/providers/[providerId]/[itemId].ts +18 -2
  1074. package/src/astro/routes/api/menus/[name]/items/[id].ts +6 -0
  1075. package/src/astro/routes/api/menus/[name]/items.ts +4 -1
  1076. package/src/astro/routes/api/menus/[name]/reorder.ts +4 -1
  1077. package/src/astro/routes/api/menus/[name]/translations.ts +7 -5
  1078. package/src/astro/routes/api/menus/[name].ts +10 -1
  1079. package/src/astro/routes/api/menus/index.ts +7 -1
  1080. package/src/astro/routes/api/redirects/404s/index.ts +10 -7
  1081. package/src/astro/routes/api/redirects/404s/summary.ts +4 -3
  1082. package/src/astro/routes/api/redirects/[id].ts +10 -7
  1083. package/src/astro/routes/api/redirects/index.ts +7 -5
  1084. package/src/astro/routes/api/relations/[id]/index.ts +10 -7
  1085. package/src/astro/routes/api/relations/index.ts +7 -5
  1086. package/src/astro/routes/api/schema/block-types/[slug]/index.ts +7 -5
  1087. package/src/astro/routes/api/schema/block-types/[slug]/versions/[version]/activate.ts +4 -3
  1088. package/src/astro/routes/api/schema/block-types/index.ts +7 -5
  1089. package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +10 -7
  1090. package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +7 -5
  1091. package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +4 -3
  1092. package/src/astro/routes/api/schema/collections/[slug]/index.ts +10 -7
  1093. package/src/astro/routes/api/schema/collections/index.ts +7 -5
  1094. package/src/astro/routes/api/schema/collections/reorder.ts +4 -3
  1095. package/src/astro/routes/api/schema/index.ts +4 -3
  1096. package/src/astro/routes/api/schema/orphans/[slug].ts +4 -3
  1097. package/src/astro/routes/api/schema/orphans/index.ts +4 -3
  1098. package/src/astro/routes/api/search/enable.ts +4 -0
  1099. package/src/astro/routes/api/search/index.ts +5 -3
  1100. package/src/astro/routes/api/search/rebuild.ts +4 -0
  1101. package/src/astro/routes/api/search/stats.ts +4 -0
  1102. package/src/astro/routes/api/search/suggest.ts +4 -0
  1103. package/src/astro/routes/api/sections/[slug].ts +10 -7
  1104. package/src/astro/routes/api/sections/index.ts +7 -5
  1105. package/src/astro/routes/api/setup/admin-verify.ts +2 -1
  1106. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +4 -3
  1107. package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +7 -5
  1108. package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +10 -7
  1109. package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +7 -5
  1110. package/src/astro/routes/api/taxonomies/[name]/translations.ts +4 -3
  1111. package/src/astro/routes/api/taxonomies/[name].ts +10 -7
  1112. package/src/astro/routes/api/taxonomies/bulk-tag.ts +4 -3
  1113. package/src/astro/routes/api/taxonomies/index.ts +7 -5
  1114. package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -0
  1115. package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +6 -0
  1116. package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -0
  1117. package/src/astro/routes/api/widget-areas/[name].ts +6 -0
  1118. package/src/astro/routes/api/widget-areas/index.ts +6 -0
  1119. package/src/astro/session-user.ts +8 -4
  1120. package/src/astro/types.ts +77 -53
  1121. package/src/auth/start-user-session.ts +16 -0
  1122. package/src/cleanup.ts +24 -5
  1123. package/src/client/index.ts +5 -3
  1124. package/src/client/portable-text.ts +9 -1
  1125. package/src/comments/public-submission.ts +1 -1
  1126. package/src/components/Code.astro +6 -1
  1127. package/src/components/Comments.astro +17 -6
  1128. package/src/components/InlinePortableTextEditor.tsx +9 -1
  1129. package/src/database/dialect-helpers.ts +18 -3
  1130. package/src/database/migrations/098_user_last_login.ts +13 -0
  1131. package/src/database/migrations/runner.ts +2 -0
  1132. package/src/database/repositories/content.ts +37 -0
  1133. package/src/database/repositories/media-folders.ts +2 -6
  1134. package/src/database/repositories/media.ts +16 -7
  1135. package/src/database/repositories/revision.ts +2 -2
  1136. package/src/database/repositories/seo.ts +34 -10
  1137. package/src/database/repositories/types.ts +2 -2
  1138. package/src/database/repositories/user.ts +2 -2
  1139. package/src/database/types.ts +1 -0
  1140. package/src/db/node-sqlite-compat.ts +13 -0
  1141. package/src/emdash-runtime.ts +775 -308
  1142. package/src/mcp/server.ts +27 -34
  1143. package/src/media/image-endpoint.ts +84 -0
  1144. package/src/media/url.ts +16 -3
  1145. package/src/media/usage/content-fields.ts +7 -5
  1146. package/src/media/usage/content-lock.ts +71 -0
  1147. package/src/media/usage/content-refresh.ts +3 -72
  1148. package/src/media/usage/content-snapshots.ts +26 -0
  1149. package/src/media/usage/extractor.ts +132 -32
  1150. package/src/media/usage/types.ts +3 -1
  1151. package/src/object-cache/index.ts +16 -12
  1152. package/src/plugins/context.ts +22 -1
  1153. package/src/plugins/http-route-dispatch.ts +16 -8
  1154. package/src/plugins/lifecycle.ts +16 -4
  1155. package/src/plugins/sandbox/proxy.ts +2 -2
  1156. package/src/plugins/scheduler/node.ts +17 -11
  1157. package/src/plugins/state.ts +236 -78
  1158. package/src/query.ts +36 -5
  1159. package/src/scheduled-publish.ts +54 -6
  1160. package/src/schema/block-type-contract.ts +35 -4
  1161. package/src/schema/block-type-registry.ts +1 -1
  1162. package/src/schema/types.ts +3 -0
  1163. package/src/search/fts-manager.ts +79 -19
  1164. package/src/search/query.ts +212 -101
  1165. package/src/search/types.ts +6 -1
  1166. package/src/virtual-modules.d.ts +3 -10
  1167. package/dist/action-token-CKphU6ur.mjs +0 -26
  1168. package/dist/action-token-CKphU6ur.mjs.map +0 -1
  1169. package/dist/activation-X5iMalte.mjs +0 -387
  1170. package/dist/activation-X5iMalte.mjs.map +0 -1
  1171. package/dist/adapters-DFsc9XjW.d.mts +0 -173
  1172. package/dist/adapters-DFsc9XjW.d.mts.map +0 -1
  1173. package/dist/after-B3AvMfBQ.mjs +0 -50
  1174. package/dist/after-B3AvMfBQ.mjs.map +0 -1
  1175. package/dist/allowed-origins-BFDNF-05.mjs +0 -116
  1176. package/dist/allowed-origins-BFDNF-05.mjs.map +0 -1
  1177. package/dist/api-tokens-D27OQ0oQ.mjs +0 -173
  1178. package/dist/api-tokens-D27OQ0oQ.mjs.map +0 -1
  1179. package/dist/apply-Culv7QJl.mjs +0 -1774
  1180. package/dist/apply-Culv7QJl.mjs.map +0 -1
  1181. package/dist/approvals-oLE5G5jw.mjs +0 -460
  1182. package/dist/approvals-oLE5G5jw.mjs.map +0 -1
  1183. package/dist/artifact-fetch-ByK_1pck.mjs +0 -659
  1184. package/dist/artifact-fetch-ByK_1pck.mjs.map +0 -1
  1185. package/dist/artifacts-BXKMIV2F.mjs +0 -323
  1186. package/dist/artifacts-BXKMIV2F.mjs.map +0 -1
  1187. package/dist/authoritative-records-Cd5BVXRs.mjs +0 -5183
  1188. package/dist/authoritative-records-Cd5BVXRs.mjs.map +0 -1
  1189. package/dist/authorize-B-4ogCQG.mjs +0 -74
  1190. package/dist/authorize-B-4ogCQG.mjs.map +0 -1
  1191. package/dist/backup-BQhg3MEK.mjs +0 -246
  1192. package/dist/backup-BQhg3MEK.mjs.map +0 -1
  1193. package/dist/block-types-BTzqdEZV.mjs +0 -132
  1194. package/dist/block-types-BTzqdEZV.mjs.map +0 -1
  1195. package/dist/block-values-DzZIh7WN.mjs +0 -215
  1196. package/dist/block-values-DzZIh7WN.mjs.map +0 -1
  1197. package/dist/byline--sweE_MZ.mjs +0 -930
  1198. package/dist/byline--sweE_MZ.mjs.map +0 -1
  1199. package/dist/byline-fields-Czdq4Yad.mjs +0 -123
  1200. package/dist/byline-fields-Czdq4Yad.mjs.map +0 -1
  1201. package/dist/byline-registry-Cr7kjrxM.mjs +0 -406
  1202. package/dist/byline-registry-Cr7kjrxM.mjs.map +0 -1
  1203. package/dist/bylines-DnuH3H8z.mjs +0 -234
  1204. package/dist/bylines-DnuH3H8z.mjs.map +0 -1
  1205. package/dist/bylines-txlwgzIK.mjs +0 -150
  1206. package/dist/bylines-txlwgzIK.mjs.map +0 -1
  1207. package/dist/cache-BjnpmIpb.mjs +0 -151
  1208. package/dist/cache-BjnpmIpb.mjs.map +0 -1
  1209. package/dist/canonical-Cb-rJGRU.mjs +0 -174
  1210. package/dist/canonical-Cb-rJGRU.mjs.map +0 -1
  1211. package/dist/capture-triggers-BZmIEdX2.mjs +0 -362
  1212. package/dist/capture-triggers-BZmIEdX2.mjs.map +0 -1
  1213. package/dist/checksum-CH9TyM-N.mjs +0 -162
  1214. package/dist/checksum-CH9TyM-N.mjs.map +0 -1
  1215. package/dist/chunks-DRnEstVb.mjs +0 -25
  1216. package/dist/chunks-DRnEstVb.mjs.map +0 -1
  1217. package/dist/collection-slugs-cache-CYMrqHZ6.mjs +0 -91
  1218. package/dist/collection-slugs-cache-CYMrqHZ6.mjs.map +0 -1
  1219. package/dist/comment-BGeXmJ8F.mjs +0 -335
  1220. package/dist/comment-BGeXmJ8F.mjs.map +0 -1
  1221. package/dist/comment-reaction-ty-JEDYR.mjs +0 -85
  1222. package/dist/comment-reaction-ty-JEDYR.mjs.map +0 -1
  1223. package/dist/comments-ByrrLvZL.mjs +0 -99
  1224. package/dist/comments-ByrrLvZL.mjs.map +0 -1
  1225. package/dist/comments-DqhARoef.mjs +0 -195
  1226. package/dist/comments-DqhARoef.mjs.map +0 -1
  1227. package/dist/components-u2HE5Mu9.mjs +0 -112
  1228. package/dist/components-u2HE5Mu9.mjs.map +0 -1
  1229. package/dist/config-B4F2ttAZ.d.mts +0 -7230
  1230. package/dist/config-B4F2ttAZ.d.mts.map +0 -1
  1231. package/dist/config-BnrtMvHW.mjs +0 -228
  1232. package/dist/config-BnrtMvHW.mjs.map +0 -1
  1233. package/dist/config-DEse9gaE.d.mts +0 -41
  1234. package/dist/config-DEse9gaE.d.mts.map +0 -1
  1235. package/dist/connection-BaIVuaDX.mjs +0 -36
  1236. package/dist/connection-BaIVuaDX.mjs.map +0 -1
  1237. package/dist/content-Dxztag5t.mjs +0 -2270
  1238. package/dist/content-Dxztag5t.mjs.map +0 -1
  1239. package/dist/content-list-query-yYbBU-dB.d.mts +0 -26
  1240. package/dist/content-list-query-yYbBU-dB.d.mts.map +0 -1
  1241. package/dist/content-repair-2PdahlgZ.mjs +0 -443
  1242. package/dist/content-repair-2PdahlgZ.mjs.map +0 -1
  1243. package/dist/content-save-KMll0S7E.mjs +0 -202
  1244. package/dist/content-save-KMll0S7E.mjs.map +0 -1
  1245. package/dist/context-C3OZjexd.mjs +0 -2225
  1246. package/dist/context-C3OZjexd.mjs.map +0 -1
  1247. package/dist/credits-C8uXoWfN.mjs +0 -110
  1248. package/dist/credits-C8uXoWfN.mjs.map +0 -1
  1249. package/dist/cron-CrjBjDuy.mjs +0 -310
  1250. package/dist/cron-CrjBjDuy.mjs.map +0 -1
  1251. package/dist/default-DPoN3H5H.mjs +0 -81
  1252. package/dist/default-DPoN3H5H.mjs.map +0 -1
  1253. package/dist/deferred-tasks-uSx5qCFn.d.mts +0 -10
  1254. package/dist/deferred-tasks-uSx5qCFn.d.mts.map +0 -1
  1255. package/dist/device-flow-hT8lKWXq.mjs +0 -519
  1256. package/dist/device-flow-hT8lKWXq.mjs.map +0 -1
  1257. package/dist/dialect-helpers-DqUMP9fJ.mjs +0 -350
  1258. package/dist/dialect-helpers-DqUMP9fJ.mjs.map +0 -1
  1259. package/dist/digest-xYRiuW_E.mjs +0 -194
  1260. package/dist/digest-xYRiuW_E.mjs.map +0 -1
  1261. package/dist/direct-executor-CZ2SH1bq.mjs +0 -117
  1262. package/dist/direct-executor-CZ2SH1bq.mjs.map +0 -1
  1263. package/dist/email-console-CochjAlh.mjs +0 -50
  1264. package/dist/email-console-CochjAlh.mjs.map +0 -1
  1265. package/dist/email-locale-BoxaIPG8.mjs +0 -25
  1266. package/dist/email-locale-BoxaIPG8.mjs.map +0 -1
  1267. package/dist/email-smtp-BnHR_Ccx.mjs +0 -643
  1268. package/dist/email-smtp-BnHR_Ccx.mjs.map +0 -1
  1269. package/dist/emdash-runtime-CXsdCQnM.mjs +0 -5262
  1270. package/dist/emdash-runtime-CXsdCQnM.mjs.map +0 -1
  1271. package/dist/enrich-BReo_COC.mjs +0 -203
  1272. package/dist/enrich-BReo_COC.mjs.map +0 -1
  1273. package/dist/entry-lock-BfnhlRhC.mjs +0 -207
  1274. package/dist/entry-lock-BfnhlRhC.mjs.map +0 -1
  1275. package/dist/entry-lock-DsVhZcJN.mjs +0 -1228
  1276. package/dist/entry-lock-DsVhZcJN.mjs.map +0 -1
  1277. package/dist/entry-locks-D_kjygT1.mjs +0 -173
  1278. package/dist/entry-locks-D_kjygT1.mjs.map +0 -1
  1279. package/dist/env-types-CXI9uaMU.mjs +0 -38
  1280. package/dist/env-types-CXI9uaMU.mjs.map +0 -1
  1281. package/dist/error-DcDNU7hZ.mjs +0 -92
  1282. package/dist/error-DcDNU7hZ.mjs.map +0 -1
  1283. package/dist/errors-CJ6711al.mjs +0 -120
  1284. package/dist/errors-CJ6711al.mjs.map +0 -1
  1285. package/dist/errors-CwYHYcWF.mjs +0 -502
  1286. package/dist/errors-CwYHYcWF.mjs.map +0 -1
  1287. package/dist/fence-C3MLClBo.mjs +0 -162
  1288. package/dist/fence-C3MLClBo.mjs.map +0 -1
  1289. package/dist/field-defs-cache-Cpk0eFsQ.mjs +0 -79
  1290. package/dist/field-defs-cache-Cpk0eFsQ.mjs.map +0 -1
  1291. package/dist/field-map-6o9hPcRl.mjs +0 -84
  1292. package/dist/field-map-6o9hPcRl.mjs.map +0 -1
  1293. package/dist/fts-manager-B3iLXCGz.mjs +0 -500
  1294. package/dist/fts-manager-B3iLXCGz.mjs.map +0 -1
  1295. package/dist/gc-D24C-KP7.mjs +0 -62
  1296. package/dist/gc-D24C-KP7.mjs.map +0 -1
  1297. package/dist/hook-result-BU5rI-6M.d.mts +0 -31
  1298. package/dist/hook-result-BU5rI-6M.d.mts.map +0 -1
  1299. package/dist/hook-result-CO4E3zDv.mjs +0 -3854
  1300. package/dist/hook-result-CO4E3zDv.mjs.map +0 -1
  1301. package/dist/hreflang-Bzvlo9Ci.mjs +0 -105
  1302. package/dist/hreflang-Bzvlo9Ci.mjs.map +0 -1
  1303. package/dist/hreflang-Ds0WbBOu.d.mts +0 -51
  1304. package/dist/hreflang-Ds0WbBOu.d.mts.map +0 -1
  1305. package/dist/http-route-dispatch-BsjkWBZF.mjs +0 -348
  1306. package/dist/http-route-dispatch-BsjkWBZF.mjs.map +0 -1
  1307. package/dist/identity-CahxkBZC.mjs +0 -35
  1308. package/dist/identity-CahxkBZC.mjs.map +0 -1
  1309. package/dist/index-BauU0yTw.d.mts +0 -261
  1310. package/dist/index-BauU0yTw.d.mts.map +0 -1
  1311. package/dist/install-finalization-CIl610wT.mjs +0 -58
  1312. package/dist/install-finalization-CIl610wT.mjs.map +0 -1
  1313. package/dist/json-recordset-CrS6ZqMk.mjs +0 -12
  1314. package/dist/json-recordset-CrS6ZqMk.mjs.map +0 -1
  1315. package/dist/json-schema-CBcJlGcY.mjs +0 -15
  1316. package/dist/json-schema-CBcJlGcY.mjs.map +0 -1
  1317. package/dist/keys-DJ62Wt5b.mjs +0 -61
  1318. package/dist/keys-DJ62Wt5b.mjs.map +0 -1
  1319. package/dist/kinds-D7_f3Qu3.mjs +0 -974
  1320. package/dist/kinds-D7_f3Qu3.mjs.map +0 -1
  1321. package/dist/lifecycle-DPCkpFHV.mjs +0 -49
  1322. package/dist/lifecycle-DPCkpFHV.mjs.map +0 -1
  1323. package/dist/limits-Bv6mXNM-.mjs +0 -44
  1324. package/dist/limits-Bv6mXNM-.mjs.map +0 -1
  1325. package/dist/load-r9P0fsRH.mjs +0 -36
  1326. package/dist/load-r9P0fsRH.mjs.map +0 -1
  1327. package/dist/loader-CSEfTKzr.mjs +0 -1537
  1328. package/dist/loader-CSEfTKzr.mjs.map +0 -1
  1329. package/dist/loops-BxzrcxPO.mjs +0 -217
  1330. package/dist/loops-BxzrcxPO.mjs.map +0 -1
  1331. package/dist/manifest-builder-BLWqITXR.mjs +0 -196
  1332. package/dist/manifest-builder-BLWqITXR.mjs.map +0 -1
  1333. package/dist/manifest-schema-BRpk5V7x.mjs +0 -497
  1334. package/dist/manifest-schema-BRpk5V7x.mjs.map +0 -1
  1335. package/dist/marketplace-5YFgYPVr.mjs +0 -257
  1336. package/dist/marketplace-5YFgYPVr.mjs.map +0 -1
  1337. package/dist/marketplace-zPVE4UY5.mjs +0 -965
  1338. package/dist/marketplace-zPVE4UY5.mjs.map +0 -1
  1339. package/dist/media-C5fg1Xte.d.mts +0 -203
  1340. package/dist/media-C5fg1Xte.d.mts.map +0 -1
  1341. package/dist/media-CPETKjop.mjs +0 -424
  1342. package/dist/media-CPETKjop.mjs.map +0 -1
  1343. package/dist/media-Cid3xIHk.mjs +0 -294
  1344. package/dist/media-Cid3xIHk.mjs.map +0 -1
  1345. package/dist/media-DJaAAYI2.mjs +0 -2805
  1346. package/dist/media-DJaAAYI2.mjs.map +0 -1
  1347. package/dist/media-allowlist-B7JwNf-U.mjs +0 -75
  1348. package/dist/media-allowlist-B7JwNf-U.mjs.map +0 -1
  1349. package/dist/media-folders-BI7B7XUM.mjs +0 -210
  1350. package/dist/media-folders-BI7B7XUM.mjs.map +0 -1
  1351. package/dist/media-url-xWuPVfqO.mjs +0 -43
  1352. package/dist/media-url-xWuPVfqO.mjs.map +0 -1
  1353. package/dist/media-usage-SwtWPxy4.mjs +0 -282
  1354. package/dist/media-usage-SwtWPxy4.mjs.map +0 -1
  1355. package/dist/media-usage-activation-BTa1H4wE.mjs +0 -78
  1356. package/dist/media-usage-activation-BTa1H4wE.mjs.map +0 -1
  1357. package/dist/media-usage-work-BxHWfbKq.mjs +0 -1036
  1358. package/dist/media-usage-work-BxHWfbKq.mjs.map +0 -1
  1359. package/dist/media-usage-work-DYenZS8y.mjs +0 -151
  1360. package/dist/media-usage-work-DYenZS8y.mjs.map +0 -1
  1361. package/dist/menu-FtSf33fF.mjs +0 -420
  1362. package/dist/menu-FtSf33fF.mjs.map +0 -1
  1363. package/dist/menus--MSfZ5Eu.mjs +0 -433
  1364. package/dist/menus--MSfZ5Eu.mjs.map +0 -1
  1365. package/dist/menus-C8h6Jtpu.mjs +0 -92
  1366. package/dist/menus-C8h6Jtpu.mjs.map +0 -1
  1367. package/dist/menus-CpFAi_LK.mjs +0 -434
  1368. package/dist/menus-CpFAi_LK.mjs.map +0 -1
  1369. package/dist/mime-Dx6aHTsR.mjs +0 -82
  1370. package/dist/mime-Dx6aHTsR.mjs.map +0 -1
  1371. package/dist/node-sqlite-compat-DvYkqx7Q.mjs +0 -63
  1372. package/dist/node-sqlite-compat-DvYkqx7Q.mjs.map +0 -1
  1373. package/dist/oauth-authorization-CBxtOboy.mjs +0 -287
  1374. package/dist/oauth-authorization-CBxtOboy.mjs.map +0 -1
  1375. package/dist/oauth-clients-HLGHmHqI.mjs +0 -266
  1376. package/dist/oauth-clients-HLGHmHqI.mjs.map +0 -1
  1377. package/dist/oauth-state-store-B4YAveSb.mjs +0 -80
  1378. package/dist/oauth-state-store-B4YAveSb.mjs.map +0 -1
  1379. package/dist/oauth-user-lookup-CTYMaKlq.mjs +0 -26
  1380. package/dist/oauth-user-lookup-CTYMaKlq.mjs.map +0 -1
  1381. package/dist/object-cache-DeATK4vw.mjs +0 -805
  1382. package/dist/object-cache-DeATK4vw.mjs.map +0 -1
  1383. package/dist/options-BJZMHnpx.d.mts +0 -81
  1384. package/dist/options-BJZMHnpx.d.mts.map +0 -1
  1385. package/dist/parse-B1E5cdyD.mjs +0 -82
  1386. package/dist/parse-B1E5cdyD.mjs.map +0 -1
  1387. package/dist/parse-Clt6wmpy.d.mts +0 -178
  1388. package/dist/parse-Clt6wmpy.d.mts.map +0 -1
  1389. package/dist/parts-CMwESQ6e.mjs +0 -68
  1390. package/dist/parts-CMwESQ6e.mjs.map +0 -1
  1391. package/dist/passkey-config-DiVZI-cx.mjs +0 -46
  1392. package/dist/passkey-config-DiVZI-cx.mjs.map +0 -1
  1393. package/dist/paths-NrYImb_h.mjs +0 -77
  1394. package/dist/paths-NrYImb_h.mjs.map +0 -1
  1395. package/dist/placeholder-B0vI-EQ9.d.mts +0 -316
  1396. package/dist/placeholder-B0vI-EQ9.d.mts.map +0 -1
  1397. package/dist/plan-CSb3BdFS.mjs +0 -135
  1398. package/dist/plan-CSb3BdFS.mjs.map +0 -1
  1399. package/dist/plugin-settings-HdYYRFi3.mjs +0 -162
  1400. package/dist/plugin-settings-HdYYRFi3.mjs.map +0 -1
  1401. package/dist/plugins-Bc70Xs37.mjs +0 -261
  1402. package/dist/plugins-Bc70Xs37.mjs.map +0 -1
  1403. package/dist/policy-C-ngDrxa.mjs +0 -56
  1404. package/dist/policy-C-ngDrxa.mjs.map +0 -1
  1405. package/dist/portable-text-T17rOqF7.mjs +0 -454
  1406. package/dist/portable-text-T17rOqF7.mjs.map +0 -1
  1407. package/dist/protocol-CmSX4cXv.d.mts +0 -65
  1408. package/dist/protocol-CmSX4cXv.d.mts.map +0 -1
  1409. package/dist/public-plugin-api-routes-_xsWTlwE.mjs +0 -316
  1410. package/dist/public-plugin-api-routes-_xsWTlwE.mjs.map +0 -1
  1411. package/dist/public-submission-ui3pFYtq.mjs +0 -253
  1412. package/dist/public-submission-ui3pFYtq.mjs.map +0 -1
  1413. package/dist/public-url-DMRZPAiW.mjs +0 -123
  1414. package/dist/public-url-DMRZPAiW.mjs.map +0 -1
  1415. package/dist/query-C1K9PzUc.mjs +0 -41
  1416. package/dist/query-C1K9PzUc.mjs.map +0 -1
  1417. package/dist/query-DdmHrvie.mjs +0 -1201
  1418. package/dist/query-DdmHrvie.mjs.map +0 -1
  1419. package/dist/range-BaF0521t.mjs +0 -51
  1420. package/dist/range-BaF0521t.mjs.map +0 -1
  1421. package/dist/rate-limit-6MngP0_m.mjs +0 -127
  1422. package/dist/rate-limit-6MngP0_m.mjs.map +0 -1
  1423. package/dist/receipt-BFm5eaN7.mjs +0 -43
  1424. package/dist/receipt-BFm5eaN7.mjs.map +0 -1
  1425. package/dist/redirect-ChcHI1KC.mjs +0 -466
  1426. package/dist/redirect-ChcHI1KC.mjs.map +0 -1
  1427. package/dist/redirect-EpidEf_5.mjs +0 -19
  1428. package/dist/redirect-EpidEf_5.mjs.map +0 -1
  1429. package/dist/redirect-paths-B9cXh9Wv.mjs +0 -36
  1430. package/dist/redirect-paths-B9cXh9Wv.mjs.map +0 -1
  1431. package/dist/redirects-D3zHoxhn.mjs +0 -446
  1432. package/dist/redirects-D3zHoxhn.mjs.map +0 -1
  1433. package/dist/redirects-dFPJ0HrD.mjs +0 -148
  1434. package/dist/redirects-dFPJ0HrD.mjs.map +0 -1
  1435. package/dist/registry-CDzYrAFY.mjs +0 -6074
  1436. package/dist/registry-CDzYrAFY.mjs.map +0 -1
  1437. package/dist/registry-Cf9vkVxW.mjs +0 -1449
  1438. package/dist/registry-Cf9vkVxW.mjs.map +0 -1
  1439. package/dist/registry-mZi_lxtT.mjs +0 -755
  1440. package/dist/registry-mZi_lxtT.mjs.map +0 -1
  1441. package/dist/relations-Eyop_U4o.mjs +0 -798
  1442. package/dist/relations-Eyop_U4o.mjs.map +0 -1
  1443. package/dist/request-meta-DsSkOdO0.mjs +0 -141
  1444. package/dist/request-meta-DsSkOdO0.mjs.map +0 -1
  1445. package/dist/resolve-s7ANHtFx.mjs +0 -92
  1446. package/dist/resolve-s7ANHtFx.mjs.map +0 -1
  1447. package/dist/revision-D7EedSdU.mjs +0 -503
  1448. package/dist/revision-D7EedSdU.mjs.map +0 -1
  1449. package/dist/rooms-CSNLTJsG.mjs +0 -331
  1450. package/dist/rooms-CSNLTJsG.mjs.map +0 -1
  1451. package/dist/rooms-CVsLla78.mjs +0 -169
  1452. package/dist/rooms-CVsLla78.mjs.map +0 -1
  1453. package/dist/rooms-CyXG83RZ.d.mts +0 -4653
  1454. package/dist/rooms-CyXG83RZ.d.mts.map +0 -1
  1455. package/dist/route-cache-CBpXPq-N.mjs +0 -30
  1456. package/dist/route-cache-CBpXPq-N.mjs.map +0 -1
  1457. package/dist/route-wire-DKSTaEz_.mjs +0 -197
  1458. package/dist/route-wire-DKSTaEz_.mjs.map +0 -1
  1459. package/dist/routes-QcHRiebw.mjs +0 -272
  1460. package/dist/routes-QcHRiebw.mjs.map +0 -1
  1461. package/dist/runner-4BfB04Rg.mjs +0 -6950
  1462. package/dist/runner-4BfB04Rg.mjs.map +0 -1
  1463. package/dist/runner-CAHS_KER.d.mts +0 -79
  1464. package/dist/runner-CAHS_KER.d.mts.map +0 -1
  1465. package/dist/runtime-holder-0g6pqbzx.mjs +0 -36
  1466. package/dist/runtime-holder-0g6pqbzx.mjs.map +0 -1
  1467. package/dist/scheduler-health-C5HEg2Yl.mjs +0 -31
  1468. package/dist/scheduler-health-C5HEg2Yl.mjs.map +0 -1
  1469. package/dist/schema-DS7ooMmp.mjs +0 -13
  1470. package/dist/schema-DS7ooMmp.mjs.map +0 -1
  1471. package/dist/schema-Mjtj7n1t.mjs +0 -815
  1472. package/dist/schema-Mjtj7n1t.mjs.map +0 -1
  1473. package/dist/scopes-BaR6WUyq.mjs +0 -34
  1474. package/dist/scopes-BaR6WUyq.mjs.map +0 -1
  1475. package/dist/search-B9RFgr0N.mjs +0 -450
  1476. package/dist/search-B9RFgr0N.mjs.map +0 -1
  1477. package/dist/secrets-C4UrjPiG.mjs +0 -369
  1478. package/dist/secrets-C4UrjPiG.mjs.map +0 -1
  1479. package/dist/sections-Bfa0oF8Q.mjs +0 -129
  1480. package/dist/sections-Bfa0oF8Q.mjs.map +0 -1
  1481. package/dist/sections-Bn2C6we7.mjs +0 -222
  1482. package/dist/sections-Bn2C6we7.mjs.map +0 -1
  1483. package/dist/seo-DPW6k5_-.mjs +0 -188
  1484. package/dist/seo-DPW6k5_-.mjs.map +0 -1
  1485. package/dist/service-B4mHMku9.mjs +0 -150
  1486. package/dist/service-B4mHMku9.mjs.map +0 -1
  1487. package/dist/session-user-CF2jNfj7.mjs +0 -61
  1488. package/dist/session-user-CF2jNfj7.mjs.map +0 -1
  1489. package/dist/settings-4r88LLIM.mjs +0 -66
  1490. package/dist/settings-4r88LLIM.mjs.map +0 -1
  1491. package/dist/settings-BB2xxz3Y.mjs +0 -74
  1492. package/dist/settings-BB2xxz3Y.mjs.map +0 -1
  1493. package/dist/settings-BTkGl-bX.mjs +0 -413
  1494. package/dist/settings-BTkGl-bX.mjs.map +0 -1
  1495. package/dist/settings-y8Jx8b7g.mjs +0 -157
  1496. package/dist/settings-y8Jx8b7g.mjs.map +0 -1
  1497. package/dist/setup-complete-BGRiC59t.mjs +0 -65
  1498. package/dist/setup-complete-BGRiC59t.mjs.map +0 -1
  1499. package/dist/setup-nonce-D43FsOgZ.mjs +0 -25
  1500. package/dist/setup-nonce-D43FsOgZ.mjs.map +0 -1
  1501. package/dist/site-domain-CFX7g6ik.mjs +0 -131
  1502. package/dist/site-domain-CFX7g6ik.mjs.map +0 -1
  1503. package/dist/site-settings-C0D9fv7e.mjs +0 -50
  1504. package/dist/site-settings-C0D9fv7e.mjs.map +0 -1
  1505. package/dist/site-title-C0JVN6en.mjs +0 -14
  1506. package/dist/site-title-C0JVN6en.mjs.map +0 -1
  1507. package/dist/site-url-DzVnHJ8j.mjs +0 -45
  1508. package/dist/site-url-DzVnHJ8j.mjs.map +0 -1
  1509. package/dist/sitemap-name-Ja_Cvwx9.mjs +0 -26
  1510. package/dist/sitemap-name-Ja_Cvwx9.mjs.map +0 -1
  1511. package/dist/slug-CO2jtUda.mjs +0 -16
  1512. package/dist/slug-CO2jtUda.mjs.map +0 -1
  1513. package/dist/snapshot-C9OWUtFr.mjs +0 -466
  1514. package/dist/snapshot-C9OWUtFr.mjs.map +0 -1
  1515. package/dist/snapshot-CR5tan8p.mjs +0 -184
  1516. package/dist/snapshot-CR5tan8p.mjs.map +0 -1
  1517. package/dist/ssrf-Lj1KZxYt.mjs +0 -406
  1518. package/dist/ssrf-Lj1KZxYt.mjs.map +0 -1
  1519. package/dist/stage-ChbGIslu.mjs +0 -662
  1520. package/dist/stage-ChbGIslu.mjs.map +0 -1
  1521. package/dist/staged-BN8pRZwX.mjs +0 -686
  1522. package/dist/staged-BN8pRZwX.mjs.map +0 -1
  1523. package/dist/state-DtcE0eN3.mjs +0 -178
  1524. package/dist/state-DtcE0eN3.mjs.map +0 -1
  1525. package/dist/storage-query-BDUX3Cef.d.mts +0 -1608
  1526. package/dist/storage-query-BDUX3Cef.d.mts.map +0 -1
  1527. package/dist/tar-CAvEHFbE.mjs +0 -449
  1528. package/dist/tar-CAvEHFbE.mjs.map +0 -1
  1529. package/dist/target-BM_6fT9m.mjs +0 -27
  1530. package/dist/target-BM_6fT9m.mjs.map +0 -1
  1531. package/dist/taxonomies-BMuFLd53.mjs +0 -722
  1532. package/dist/taxonomies-BMuFLd53.mjs.map +0 -1
  1533. package/dist/taxonomies-ClkYcmcH.mjs +0 -937
  1534. package/dist/taxonomies-ClkYcmcH.mjs.map +0 -1
  1535. package/dist/taxonomy-s1GcBCRo.mjs +0 -593
  1536. package/dist/taxonomy-s1GcBCRo.mjs.map +0 -1
  1537. package/dist/tokens-Cpm6FIKJ.mjs +0 -171
  1538. package/dist/tokens-Cpm6FIKJ.mjs.map +0 -1
  1539. package/dist/transaction-SKrr6u84.mjs +0 -44
  1540. package/dist/transaction-SKrr6u84.mjs.map +0 -1
  1541. package/dist/transfer-B3CsI5MG.mjs +0 -8963
  1542. package/dist/transfer-B3CsI5MG.mjs.map +0 -1
  1543. package/dist/transfer-DqUiK3ca.mjs +0 -166
  1544. package/dist/transfer-DqUiK3ca.mjs.map +0 -1
  1545. package/dist/transfer-download-CWPfhL91.mjs +0 -33
  1546. package/dist/transfer-download-CWPfhL91.mjs.map +0 -1
  1547. package/dist/transformations-ClH4dJeM.mjs +0 -196
  1548. package/dist/transformations-ClH4dJeM.mjs.map +0 -1
  1549. package/dist/transport-C6Ps8ejN.mjs +0 -144
  1550. package/dist/transport-C6Ps8ejN.mjs.map +0 -1
  1551. package/dist/transport-D4hWYmO_.d.mts +0 -42
  1552. package/dist/transport-D4hWYmO_.d.mts.map +0 -1
  1553. package/dist/trusted-proxy-CWX1sqgb.mjs +0 -51
  1554. package/dist/trusted-proxy-CWX1sqgb.mjs.map +0 -1
  1555. package/dist/turnstile-B6zM50Mh.mjs +0 -58
  1556. package/dist/turnstile-B6zM50Mh.mjs.map +0 -1
  1557. package/dist/types-Ba3bWb9D.mjs +0 -37
  1558. package/dist/types-Ba3bWb9D.mjs.map +0 -1
  1559. package/dist/types-C0M6z2A4.mjs +0 -16
  1560. package/dist/types-C0M6z2A4.mjs.map +0 -1
  1561. package/dist/types-CG1dR_Cm.d.mts +0 -934
  1562. package/dist/types-CG1dR_Cm.d.mts.map +0 -1
  1563. package/dist/types-CImd8MBY.d.mts +0 -1756
  1564. package/dist/types-CImd8MBY.d.mts.map +0 -1
  1565. package/dist/types-CML-oGr6.d.mts +0 -293
  1566. package/dist/types-CML-oGr6.d.mts.map +0 -1
  1567. package/dist/types-CZO9f_vJ.d.mts +0 -381
  1568. package/dist/types-CZO9f_vJ.d.mts.map +0 -1
  1569. package/dist/types-DLKviL1s.d.mts +0 -93
  1570. package/dist/types-DLKviL1s.d.mts.map +0 -1
  1571. package/dist/types-Df0R58Wu.mjs +0 -77
  1572. package/dist/types-Df0R58Wu.mjs.map +0 -1
  1573. package/dist/types-DwNwhyWP.d.mts +0 -227
  1574. package/dist/types-DwNwhyWP.d.mts.map +0 -1
  1575. package/dist/types-DwZgl0Zn.d.mts +0 -366
  1576. package/dist/types-DwZgl0Zn.d.mts.map +0 -1
  1577. package/dist/types-Dyb_OuSw.d.mts +0 -125
  1578. package/dist/types-Dyb_OuSw.d.mts.map +0 -1
  1579. package/dist/types-iOnPkHRk.d.mts +0 -209
  1580. package/dist/types-iOnPkHRk.d.mts.map +0 -1
  1581. package/dist/upload-attempts-5Ot7-vsw.mjs +0 -32
  1582. package/dist/upload-attempts-5Ot7-vsw.mjs.map +0 -1
  1583. package/dist/url-ZCjpMO-q.mjs +0 -74
  1584. package/dist/url-ZCjpMO-q.mjs.map +0 -1
  1585. package/dist/url-pattern-BQT-sGmD.mjs +0 -41
  1586. package/dist/url-pattern-BQT-sGmD.mjs.map +0 -1
  1587. package/dist/urls-Cq_hUk4P.mjs +0 -79
  1588. package/dist/urls-Cq_hUk4P.mjs.map +0 -1
  1589. package/dist/user-C4km6fox.mjs +0 -184
  1590. package/dist/user-C4km6fox.mjs.map +0 -1
  1591. package/dist/utils-Cpo0_V09.d.mts +0 -374
  1592. package/dist/utils-Cpo0_V09.d.mts.map +0 -1
  1593. package/dist/utils-DMDmdhU3.mjs +0 -450
  1594. package/dist/utils-DMDmdhU3.mjs.map +0 -1
  1595. package/dist/validate-BNupiQtz.mjs +0 -524
  1596. package/dist/validate-BNupiQtz.mjs.map +0 -1
  1597. package/dist/validate-DBfkJa3O.d.mts +0 -472
  1598. package/dist/validate-DBfkJa3O.d.mts.map +0 -1
  1599. package/dist/validation-W_efZFgP.mjs +0 -204
  1600. package/dist/validation-W_efZFgP.mjs.map +0 -1
  1601. package/dist/version-C61rw8-y.mjs +0 -9
  1602. package/dist/version-C61rw8-y.mjs.map +0 -1
  1603. package/dist/version-DhGLeLRo.mjs +0 -7
  1604. package/dist/version-DhGLeLRo.mjs.map +0 -1
  1605. package/dist/version-eqLBDtcz.mjs +0 -49
  1606. package/dist/version-eqLBDtcz.mjs.map +0 -1
  1607. package/dist/video-My3h7vwE.mjs +0 -18
  1608. package/dist/video-My3h7vwE.mjs.map +0 -1
  1609. package/dist/virtual-modules-BZKqvjRC.mjs +0 -568
  1610. package/dist/virtual-modules-BZKqvjRC.mjs.map +0 -1
  1611. package/dist/widgets-DAdni19y.mjs +0 -134
  1612. package/dist/widgets-DAdni19y.mjs.map +0 -1
  1613. package/dist/wxr-DDPJOgkM.mjs +0 -1054
  1614. package/dist/wxr-DDPJOgkM.mjs.map +0 -1
  1615. package/dist/wxr-taxonomies-B0U2fJgs.mjs +0 -735
  1616. package/dist/wxr-taxonomies-B0U2fJgs.mjs.map +0 -1
  1617. package/dist/wxr-taxonomies-CyP2k4-Q.d.mts +0 -34
  1618. package/dist/wxr-taxonomies-CyP2k4-Q.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"execute.mjs","names":["sanitizeSlug"],"sources":["../../../../../../src/astro/routes/api/import/wordpress/execute.ts"],"sourcesContent":["/**\n * WordPress WXR execute import endpoint\n *\n * POST /_emdash/api/import/wordpress/execute\n *\n * Accepts WXR file and import configuration, imports content into the database.\n */\n\nimport { gutenbergToPortableText } from \"@emdash-cms/gutenberg-to-portable-text\";\nimport type { APIRoute } from \"astro\";\nimport {\n\tparseWxrString,\n\tContentRepository,\n\timportReusableBlocksAsSections,\n\ttype WxrPost,\n\tparseWxrDate,\n} from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { wxrChunkCursor, wxrChunkState, wxrImportConfig } from \"#api/schemas.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\nimport { importMenusFromWxr, type WxrMenuArchive, type WxrMenuTarget } from \"#import/menus.js\";\nimport { relativizeContentLinks, resolveImportByline } from \"#import/utils.js\";\nimport {\n\tattachPostTaxonomies,\n\tisWxrTaxonomyConflictError,\n\tloadTaxonomyPlanFromDb,\n\tmirrorTermsToLocales,\n\tpreImportWxrTaxonomies,\n\tsetPostTermAssignmentsReplacing,\n\ttype TaxonomyImportPlan,\n} from \"#import/wxr-taxonomies.js\";\nimport type { EmDashHandlers, EmDashManifest } from \"#types\";\nimport { slugify } from \"#utils/slugify.js\";\n\nimport { resolveContentCreateLocale } from \"../../../../../i18n/config.js\";\nimport { sanitizeSlug } from \"./analyze.js\";\n\nexport const prerender = false;\n\n/** Posts processed per Worker invocation in chunked WXR imports. */\nconst WXR_CONTENT_CHUNK_SIZE = 30;\n\n/** Phase/cursor payload for chunked WXR imports. */\ninterface WxrChunkCursor {\n\toffset: number;\n\tsource: string;\n\ttaxonomiesReady: true;\n}\n\n/** Cross-chunk state carried by the client. */\ninterface WxrChunkState {\n\ttranslationGroups: Record<string, string>;\n\tbylines?: Record<string, string>;\n}\n\n/** Chunked response shape mirrors the wordpress-plugin execute endpoint. */\ninterface WxrChunkResponse {\n\tsuccess: boolean;\n\tresult: ImportResult;\n\tdone: boolean;\n\tcursor?: WxrChunkCursor;\n\tchunk?: WxrChunkState;\n}\n\nexport interface ImportConfig {\n\t/** Map WordPress post types to EmDash collections */\n\tpostTypeMappings: Record<\n\t\tstring,\n\t\t{\n\t\t\tcollection: string;\n\t\t\tenabled: boolean;\n\t\t}\n\t>;\n\t/** Whether to skip items that already exist (by slug) */\n\tskipExisting: boolean;\n\t/** Whether to import reusable blocks (wp_block) as sections */\n\timportSections?: boolean;\n\t/** Author mappings (WP author login -> EmDash user ID) */\n\tauthorMappings?: Record<string, string | null>;\n\t/** BCP 47 locale for all imported items. When omitted, defaults to defaultLocale. */\n\tlocale?: string;\n\t/** Whether to import the export's menus. Defaults to true. */\n\timportMenus?: boolean;\n}\n\nexport interface ImportResult {\n\tsuccess: boolean;\n\timported: number;\n\t/** Entries not imported because the slug already exists in the collection and locale. */\n\tskipped: number;\n\terrors: Array<{ title: string; error: string }>;\n\tbyCollection: Record<string, number>;\n\t/** Entries imported as drafts because they had a password in WordPress */\n\tpasswordProtected?: Array<{ id: string; collection: string; title: string }>;\n\t/** Sections import results (if enabled) */\n\tsections?: {\n\t\tcreated: number;\n\t\tskipped: number;\n\t};\n\t/** Menu import results (if the export has menus) */\n\tmenus?: {\n\t\tcreated: number;\n\t\titems: number;\n\t\t/** Menus left as they were because the site has one with the same name in that locale */\n\t\tskipped: number;\n\t\t/** Items left out because what they link to wasn't imported */\n\t\titemsSkipped: number;\n\t};\n\t/** Taxonomy import results (categories, tags, custom taxonomies). */\n\ttaxonomies?: {\n\t\t/** Terms newly created during this import, keyed by taxonomy name. */\n\t\ttermsCreated: Record<string, number>;\n\t\t/** Existing terms that were re-used, keyed by taxonomy name. */\n\t\ttermsReused: Record<string, number>;\n\t\t/** Total pivot rows (post <-> term) written to `content_taxonomies`. */\n\t\tassignments: number;\n\t\t/**\n\t\t * Custom taxonomy names from the WXR file that had no matching EmDash\n\t\t * definition and were therefore skipped. Lets the admin UI surface a\n\t\t * \"create taxonomy X first\" hint without re-running the import.\n\t\t */\n\t\tmissingTaxonomies: string[];\n\t};\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\tif (!emdash?.handleContentCreate) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash not configured\", 500);\n\t}\n\n\ttry {\n\t\tconst emdashManifest = await emdash.getManifest();\n\n\t\tconst formData = await request.formData();\n\t\tconst fileEntry = formData.get(\"file\");\n\t\tconst file = fileEntry instanceof File ? fileEntry : null;\n\t\tconst configEntry = formData.get(\"config\");\n\t\tconst configJson = typeof configEntry === \"string\" ? configEntry : null;\n\n\t\tif (!file) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"No file provided\", 400);\n\t\t}\n\n\t\tif (!configJson) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"No config provided\", 400);\n\t\t}\n\n\t\tconst parsedConfig = parseJsonField(configJson, \"config\");\n\t\tif (\"response\" in parsedConfig) return parsedConfig.response;\n\t\tconst configResult = wxrImportConfig.safeParse(parsedConfig.value);\n\t\tif (!configResult.success) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import config\", 400);\n\t\t}\n\t\tconst config: ImportConfig = configResult.data;\n\n\t\tconst phaseEntry = formData.get(\"phase\");\n\t\tif (\n\t\t\tphaseEntry !== null &&\n\t\t\tphaseEntry !== \"taxonomy\" &&\n\t\t\tphaseEntry !== \"content\" &&\n\t\t\tphaseEntry !== \"finalize\"\n\t\t) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import phase\", 400);\n\t\t}\n\t\tconst phase = phaseEntry;\n\n\t\tconst cursorEntry = formData.get(\"cursor\");\n\t\tlet cursor: WxrChunkCursor | undefined;\n\t\tif (typeof cursorEntry === \"string\" && cursorEntry.length > 0) {\n\t\t\tconst parsedCursor = parseJsonField(cursorEntry, \"cursor\");\n\t\t\tif (\"response\" in parsedCursor) return parsedCursor.response;\n\t\t\tconst cursorResult = wxrChunkCursor.safeParse(parsedCursor.value);\n\t\t\tif (!cursorResult.success) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import cursor\", 400);\n\t\t\t}\n\t\t\tcursor = cursorResult.data;\n\t\t}\n\n\t\tconst chunkEntry = formData.get(\"chunk\");\n\t\tlet incomingChunk: WxrChunkState | undefined;\n\t\tif (typeof chunkEntry === \"string\" && chunkEntry.length > 0) {\n\t\t\tconst parsedChunk = parseJsonField(chunkEntry, \"chunk\");\n\t\t\tif (\"response\" in parsedChunk) return parsedChunk.response;\n\t\t\tconst chunkResult = wxrChunkState.safeParse(parsedChunk.value);\n\t\t\tif (!chunkResult.success) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import chunk state\", 400);\n\t\t\t}\n\t\t\tincomingChunk = chunkResult.data;\n\t\t}\n\n\t\t// Parse WXR\n\t\tconst text = await file.text();\n\t\tconst wxr = await parseWxrString(text);\n\t\tconst source = await importFingerprint(text, configJson);\n\n\t\tif (cursor && cursor.source !== source) {\n\t\t\treturn apiError(\n\t\t\t\t\"WXR_IMPORT_SOURCE_CHANGED\",\n\t\t\t\t\"The WXR file or import configuration changed after this import started\",\n\t\t\t\t409,\n\t\t\t);\n\t\t}\n\n\t\t// Build attachment ID -> URL map for featured images\n\t\tconst attachmentMap = new Map<string, string>();\n\t\tfor (const att of wxr.attachments) {\n\t\t\tif (att.id && att.url) {\n\t\t\t\tattachmentMap.set(String(att.id), att.url);\n\t\t\t}\n\t\t}\n\n\t\t// Build author login -> display name map\n\t\tconst authorDisplayNames = new Map<string, string>();\n\t\tfor (const author of wxr.authors) {\n\t\t\tif (!author.login) continue;\n\t\t\tauthorDisplayNames.set(author.login, author.displayName || author.login);\n\t\t}\n\n\t\tif (phase === \"content\") {\n\t\t\tif (!cursor?.taxonomiesReady) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Taxonomy preparation is not complete\", 400);\n\t\t\t}\n\t\t\tconst chunkResponse = await runContentChunk(\n\t\t\t\twxr,\n\t\t\t\tconfig,\n\t\t\t\temdash,\n\t\t\t\temdashManifest,\n\t\t\t\tattachmentMap,\n\t\t\t\tauthorDisplayNames,\n\t\t\t\tcursor,\n\t\t\t\tincomingChunk,\n\t\t\t\tsource,\n\t\t\t);\n\t\t\tif (chunkResponse instanceof Response) return chunkResponse;\n\t\t\treturn apiSuccess(chunkResponse);\n\t\t}\n\n\t\tif (phase === \"taxonomy\") {\n\t\t\tif (cursor || incomingChunk) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Taxonomy preparation cannot be resumed\", 400);\n\t\t\t}\n\t\t\tlet taxonomyPlan: TaxonomyImportPlan;\n\t\t\ttry {\n\t\t\t\ttaxonomyPlan = await prepareTaxonomies(wxr, emdash, config.locale);\n\t\t\t} catch (error) {\n\t\t\t\tif (isWxrTaxonomyConflictError(error)) {\n\t\t\t\t\tconsole.error(\"[WXR_IMPORT_TAXONOMY_CONFLICT]\", error);\n\t\t\t\t\treturn apiError(\"WXR_IMPORT_TAXONOMY_CONFLICT\", error.publicMessage, 409);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tconst result = emptyImportResult();\n\t\t\tresult.taxonomies = {\n\t\t\t\ttermsCreated: taxonomyPlan.termsCreated,\n\t\t\t\ttermsReused: taxonomyPlan.termsReused,\n\t\t\t\tassignments: 0,\n\t\t\t\tmissingTaxonomies: taxonomyPlan.missingTaxonomies,\n\t\t\t};\n\t\t\treturn apiSuccess({\n\t\t\t\tsuccess: true,\n\t\t\t\tresult,\n\t\t\t\tdone: true,\n\t\t\t\tcursor: { offset: 0, source, taxonomiesReady: true as const },\n\t\t\t\tchunk: { translationGroups: {} },\n\t\t\t});\n\t\t}\n\n\t\tif (phase === \"finalize\") {\n\t\t\tif (!cursor || cursor.offset !== wxr.posts.length) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Content import is not complete\", 400);\n\t\t\t}\n\t\t\tconst result = emptyImportResult();\n\t\t\tif (config.importSections !== false) {\n\t\t\t\tconst sectionsResult = await importReusableBlocksAsSections(wxr.posts, emdash.db);\n\t\t\t\tresult.sections = {\n\t\t\t\t\tcreated: sectionsResult.sectionsCreated,\n\t\t\t\t\tskipped: sectionsResult.sectionsSkipped,\n\t\t\t\t};\n\t\t\t\tresult.errors.push(...sectionsResult.errors);\n\t\t\t\tresult.success = result.errors.length === 0;\n\t\t\t}\n\t\t\tawait importWxrMenus(wxr, config, emdash.db, emdashManifest, result);\n\t\t\treturn apiSuccess({ success: result.success, result, done: true });\n\t\t}\n\n\t\tif (wxr.posts.length > WXR_CONTENT_CHUNK_SIZE) {\n\t\t\treturn apiError(\n\t\t\t\t\"WXR_IMPORT_TOO_LARGE\",\n\t\t\t\t`This WXR contains ${wxr.posts.length} posts, which exceeds the ${WXR_CONTENT_CHUNK_SIZE}-post limit for a single import request. ` +\n\t\t\t\t\t`Run the import in chunked mode or split the file into smaller exports.`,\n\t\t\t\t413,\n\t\t\t);\n\t\t}\n\n\t\t// Pre-create taxonomy terms (categories, tags, custom taxonomies) so\n\t\t// per-post assignments can resolve to existing rows. Done before any\n\t\t// content insert because WXR exports list terms at the top of the\n\t\t// file but per-item assignments only reference them by slug.\n\t\tconst taxonomyPlan = await preImportWxrTaxonomies(\n\t\t\temdash.db,\n\t\t\twxr.posts,\n\t\t\twxr.categories,\n\t\t\twxr.tags,\n\t\t\twxr.terms,\n\t\t\tconfig.locale,\n\t\t);\n\n\t\t// Multilingual imports (WPML / Polylang -- see #1080) need a term\n\t\t// row at each per-post locale, all sharing the canonical term's\n\t\t// `translation_group`. Without this, `getTermsForEntry(..., locale)`\n\t\t// on non-canonical translations comes back empty.\n\t\t//\n\t\t// The mirror raises `WxrTaxonomyConflictError` with an operator-\n\t\t// actionable message when an existing locale row has an\n\t\t// incompatible group. Surface its `publicMessage` directly so the\n\t\t// admin UI can tell the user which (taxonomy, slug, locale) needs\n\t\t// reconciliation. Other errors (DB connectivity, unexpected\n\t\t// repository failures) re-throw to the outer catch where\n\t\t// `handleError` masks them with the generic \"Failed to import\n\t\t// content\" -- exposing raw DB errors to clients would leak schema\n\t\t// names and bypass the AGENTS.md \"never expose error.message\" rule.\n\t\tconst postLocales = new Set<string>();\n\t\tfor (const post of wxr.posts) {\n\t\t\tif (post.locale) postLocales.add(post.locale);\n\t\t}\n\t\tif (postLocales.size > 0) {\n\t\t\ttry {\n\t\t\t\tawait mirrorTermsToLocales(emdash.db, taxonomyPlan, postLocales, config.locale);\n\t\t\t} catch (mirrorError) {\n\t\t\t\tif (isWxrTaxonomyConflictError(mirrorError)) {\n\t\t\t\t\tconsole.error(\"[WXR_IMPORT_TAXONOMY_CONFLICT]\", mirrorError);\n\t\t\t\t\treturn apiError(\"WXR_IMPORT_TAXONOMY_CONFLICT\", mirrorError.publicMessage, 409);\n\t\t\t\t}\n\t\t\t\tthrow mirrorError;\n\t\t\t}\n\t\t}\n\n\t\t// Import content (locale from config scopes all items)\n\t\tconst result = await importContent(\n\t\t\twxr.posts,\n\t\t\tconfig,\n\t\t\temdash,\n\t\t\temdashManifest,\n\t\t\tattachmentMap,\n\t\t\tconfig.locale,\n\t\t\tauthorDisplayNames,\n\t\t\ttaxonomyPlan,\n\t\t\tnew Map(),\n\t\t\twxr.site.link,\n\t\t);\n\n\t\t// Import reusable blocks as sections (if enabled)\n\t\tif (config.importSections !== false) {\n\t\t\tconst sectionsResult = await importReusableBlocksAsSections(wxr.posts, emdash.db);\n\t\t\tresult.sections = {\n\t\t\t\tcreated: sectionsResult.sectionsCreated,\n\t\t\t\tskipped: sectionsResult.sectionsSkipped,\n\t\t\t};\n\t\t\t// Add section errors to main errors array\n\t\t\tresult.errors.push(...sectionsResult.errors);\n\t\t\tif (sectionsResult.errors.length > 0) {\n\t\t\t\tresult.success = false;\n\t\t\t}\n\t\t}\n\n\t\tawait importWxrMenus(wxr, config, emdash.db, emdashManifest, result);\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to import content\", \"WXR_IMPORT_ERROR\");\n\t}\n};\n\nfunction parseJsonField(\n\tvalue: string,\n\tfieldName: string,\n): { value: unknown } | { response: Response } {\n\ttry {\n\t\treturn { value: JSON.parse(value) };\n\t} catch {\n\t\treturn { response: apiError(\"VALIDATION_ERROR\", `Invalid JSON in ${fieldName}`, 400) };\n\t}\n}\n\nasync function importFingerprint(text: string, configJson: string): Promise<string> {\n\tconst bytes = new TextEncoder().encode(`${configJson}\\u0000${text}`);\n\tconst digest = await crypto.subtle.digest(\"SHA-256\", bytes);\n\treturn Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction emptyImportResult(): ImportResult {\n\treturn {\n\t\tsuccess: true,\n\t\timported: 0,\n\t\tskipped: 0,\n\t\terrors: [],\n\t\tbyCollection: {},\n\t};\n}\n\n/** Import a bounded WXR post chunk using taxonomy rows prepared in the prior phase. */\nasync function runContentChunk(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\tconfig: ImportConfig,\n\temdash: EmDashHandlers,\n\tmanifest: EmDashManifest,\n\tattachmentMap: Map<string, string>,\n\tauthorDisplayNames: Map<string, string>,\n\tcursor: WxrChunkCursor | undefined,\n\tincomingChunk: WxrChunkState | undefined,\n\tsource: string,\n): Promise<WxrChunkResponse | Response> {\n\tconst offset = cursor?.offset ?? 0;\n\tif (offset > wxr.posts.length || (offset > 0 && offset % WXR_CONTENT_CHUNK_SIZE !== 0)) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import cursor offset\", 400);\n\t}\n\tconst posts = wxr.posts.slice(offset, offset + WXR_CONTENT_CHUNK_SIZE);\n\tconst taxonomyPlan = await loadTaxonomyPlanFromDb(emdash.db);\n\n\t// Seed translation-group state from earlier chunks so a translation that\n\t// appears on chunk N can link to its sibling imported on chunk N-1.\n\tconst translationGroupMap = new Map<string, string>(\n\t\tObject.entries(incomingChunk?.translationGroups ?? {}),\n\t);\n\t// Likewise for bylines: an author without a user mapping is matched only\n\t// through this map, so a fresh one per chunk gives them a new byline each time.\n\tconst bylineCache = new Map<string, string>(Object.entries(incomingChunk?.bylines ?? {}));\n\n\tconst result = await importContent(\n\t\tposts,\n\t\tconfig,\n\t\temdash,\n\t\tmanifest,\n\t\tattachmentMap,\n\t\tconfig.locale,\n\t\tauthorDisplayNames,\n\t\ttaxonomyPlan,\n\t\ttranslationGroupMap,\n\t\twxr.site.link,\n\t\tbylineCache,\n\t);\n\n\tconst nextOffset = offset + posts.length;\n\tconst done = nextOffset >= wxr.posts.length;\n\n\treturn {\n\t\tsuccess: result.errors.length === 0,\n\t\tresult,\n\t\tdone,\n\t\tcursor: { offset: nextOffset, source, taxonomiesReady: true },\n\t\tchunk: {\n\t\t\ttranslationGroups: Object.fromEntries(translationGroupMap),\n\t\t\tbylines: Object.fromEntries(bylineCache),\n\t\t},\n\t};\n}\n\nasync function prepareTaxonomies(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\temdash: EmDashHandlers,\n\tlocale: string | undefined,\n): Promise<TaxonomyImportPlan> {\n\tconst taxonomyPlan = await preImportWxrTaxonomies(\n\t\temdash.db,\n\t\twxr.posts,\n\t\twxr.categories,\n\t\twxr.tags,\n\t\twxr.terms,\n\t\tlocale,\n\t);\n\tconst postLocales = new Set<string>();\n\tfor (const post of wxr.posts) {\n\t\tif (post.locale) postLocales.add(post.locale);\n\t}\n\tif (postLocales.size > 0) {\n\t\tawait mirrorTermsToLocales(emdash.db, taxonomyPlan, postLocales, locale);\n\t}\n\treturn taxonomyPlan;\n}\n\nexport async function importContent(\n\tposts: WxrPost[],\n\tconfig: ImportConfig,\n\temdash: EmDashHandlers,\n\tmanifest: EmDashManifest,\n\tattachmentMap: Map<string, string>,\n\tlocale: string | undefined,\n\tauthorDisplayNames: Map<string, string> | undefined,\n\ttaxonomyPlan: TaxonomyImportPlan,\n\ttranslationGroupMap = new Map<string, string>(),\n\tsiteUrl = \"\",\n\tbylineCache = new Map<string, string>(),\n): Promise<ImportResult> {\n\tconst result: ImportResult = {\n\t\tsuccess: true,\n\t\timported: 0,\n\t\tskipped: 0,\n\t\terrors: [],\n\t\tbyCollection: {},\n\t\ttaxonomies: {\n\t\t\ttermsCreated: taxonomyPlan.termsCreated,\n\t\t\ttermsReused: taxonomyPlan.termsReused,\n\t\t\tassignments: 0,\n\t\t\tmissingTaxonomies: taxonomyPlan.missingTaxonomies,\n\t\t},\n\t};\n\n\t// Create content repository for checking existing items\n\tconst contentRepo = new ContentRepository(emdash.db);\n\tconst bylineRepo = new BylineRepository(emdash.db);\n\n\tfor (const post of posts) {\n\t\tconst postType = post.postType || \"post\";\n\t\tconst mapping = config.postTypeMappings[postType];\n\n\t\t// Not part of the import: internal post types, or ones left disabled.\n\t\tif (!mapping || !mapping.enabled) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Defensive: mapping.collection is already sanitized by prepare, but the user\n\t\t// could manually edit the import config between prepare and execute.\n\t\tconst collection = sanitizeSlug(mapping.collection);\n\n\t\t// Check if collection exists in manifest\n\t\tif (!manifest?.collections[collection]) {\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\terror: `Collection \"${collection}\" does not exist`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// Convert content to Portable Text\n\t\t\tconst content = post.content ? gutenbergToPortableText(post.content) : [];\n\t\t\tif (siteUrl) relativizeContentLinks(content, siteUrl);\n\n\t\t\tconst slug = wxrPostSlug(post);\n\n\t\t\t// Per-post locale: prefer the value extracted from WPML/Polylang\n\t\t\t// metadata; fall back to the upload-wide locale. Two translations\n\t\t\t// sharing `post_name` (e.g. /en/hello + /ar/hello) collide on the\n\t\t\t// `UNIQUE(slug, locale)` constraint when they share a locale, so\n\t\t\t// honouring the per-post value is what makes multilingual imports\n\t\t\t// land correctly. See issue #1080.\n\t\t\tconst postLocale = post.locale ?? locale;\n\n\t\t\t// Check if already exists (idempotency). Match against the\n\t\t\t// per-post locale so the same slug in different locales doesn't\n\t\t\t// false-positive as duplicate.\n\t\t\tif (config.skipExisting) {\n\t\t\t\tconst existing = await contentRepo.findBySlug(collection, slug, postLocale);\n\t\t\t\tif (existing) {\n\t\t\t\t\t// Record the translation group mapping so later\n\t\t\t\t\t// translations in this WXR can link to the existing\n\t\t\t\t\t// item. We deliberately trust the WXR's grouping over\n\t\t\t\t\t// the existing row's `translation_group`: a singleton\n\t\t\t\t\t// existing row gets folded into the WXR's group when\n\t\t\t\t\t// `handleContentCreate` resolves the new translation's\n\t\t\t\t\t// `translationOf`. Pre-existing translations that\n\t\t\t\t\t// already belong to a different group are left alone --\n\t\t\t\t\t// the user is responsible for reconciling those through\n\t\t\t\t\t// the admin if they don't match the WXR.\n\t\t\t\t\tif (post.translationGroup) {\n\t\t\t\t\t\ttranslationGroupMap.set(post.translationGroup, existing.id);\n\t\t\t\t\t}\n\t\t\t\t\tresult.skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Resolve translation group: if this post belongs to a group and\n\t\t\t// we've already imported one of its translations, link to it.\n\t\t\tlet translationOf: string | undefined;\n\t\t\tif (post.translationGroup) {\n\t\t\t\ttranslationOf = translationGroupMap.get(post.translationGroup);\n\t\t\t}\n\n\t\t\tconst passwordProtected = Boolean(post.postPassword);\n\t\t\tconst status = passwordProtected ? \"draft\" : mapStatus(post.status);\n\n\t\t\t// Build data object with required fields\n\t\t\tconst data: Record<string, unknown> = {\n\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\tcontent,\n\t\t\t\texcerpt: post.excerpt || undefined,\n\t\t\t};\n\n\t\t\t// Only add featured_image if the collection has this field and we have a value\n\t\t\tconst collectionSchema = manifest.collections[collection];\n\t\t\tconst hasFeaturedImageField = collectionSchema?.fields\n\t\t\t\t? \"featured_image\" in collectionSchema.fields\n\t\t\t\t: false;\n\t\t\tif (hasFeaturedImageField) {\n\t\t\t\tconst thumbnailId = post.meta.get(\"_thumbnail_id\");\n\t\t\t\tconst featuredImage = thumbnailId ? attachmentMap.get(String(thumbnailId)) : undefined;\n\t\t\t\tif (featuredImage) {\n\t\t\t\t\tdata.featured_image = featuredImage;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Resolve author ID from mappings\n\t\t\tlet authorId: string | undefined;\n\t\t\tif (config.authorMappings && post.creator) {\n\t\t\t\tconst mappedUserId = config.authorMappings[post.creator];\n\t\t\t\tif (mappedUserId !== undefined && mappedUserId !== null) {\n\t\t\t\t\tauthorId = mappedUserId;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bylineId = await resolveImportByline(\n\t\t\t\tpost.creator,\n\t\t\t\tauthorDisplayNames?.get(post.creator ?? \"\") ?? post.creator,\n\t\t\t\tauthorId,\n\t\t\t\tbylineRepo,\n\t\t\t\tbylineCache,\n\t\t\t);\n\n\t\t\t// Preserve original WordPress dates using the shared WXR date parser.\n\t\t\t// Fallback chain: postDateGmt (UTC) → pubDate (RFC 2822) → postDate (site-local).\n\t\t\tconst parsedDate = parseWxrDate(post.postDateGmt, post.pubDate, post.postDate);\n\t\t\tconst createdAt = parsedDate ? parsedDate.toISOString() : undefined;\n\t\t\tconst futureDated =\n\t\t\t\tpost.status === \"future\" && createdAt !== undefined && Date.parse(createdAt) > Date.now();\n\t\t\tconst scheduledAt = futureDated && !passwordProtected ? createdAt : undefined;\n\n\t\t\t// Create the content item\n\t\t\tconst createResult = await emdash.handleContentCreate(collection, {\n\t\t\t\tdata,\n\t\t\t\tslug,\n\t\t\t\tstatus,\n\t\t\t\tauthorId,\n\t\t\t\tbylines: bylineId ? [{ bylineId }] : undefined,\n\t\t\t\tlocale: postLocale,\n\t\t\t\ttranslationOf,\n\t\t\t\tcreatedAt,\n\t\t\t\t// Future-dated posts get their publication date when they are published.\n\t\t\t\tpublishedAt: futureDated ? undefined : createdAt,\n\t\t\t});\n\n\t\t\tif (createResult.success) {\n\t\t\t\tresult.imported++;\n\t\t\t\tresult.byCollection[collection] = (result.byCollection[collection] || 0) + 1;\n\n\t\t\t\t// `handleContentCreate` returns `data: { item, _rev? }` on\n\t\t\t\t// success (see `ApiResult<ContentResponse>` in\n\t\t\t\t// `api/handlers/content.ts`). `HandlerResponse.data` is\n\t\t\t\t// typed as `unknown` to avoid coupling the route surface to\n\t\t\t\t// internal handler types, so we narrow here.\n\t\t\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- handler contract documented at handleContentCreate\n\t\t\t\tconst createdItem = (createResult.data as { item: { id: string } } | undefined)?.item;\n\n\t\t\t\t// Track translation group: the first imported post in a group\n\t\t\t\t// becomes the anchor that later translations link to.\n\t\t\t\tif (\n\t\t\t\t\tcreatedItem &&\n\t\t\t\t\tpost.translationGroup &&\n\t\t\t\t\t!translationGroupMap.has(post.translationGroup)\n\t\t\t\t) {\n\t\t\t\t\ttranslationGroupMap.set(post.translationGroup, createdItem.id);\n\t\t\t\t}\n\n\t\t\t\tif (createdItem && passwordProtected) {\n\t\t\t\t\t(result.passwordProtected ??= []).push({\n\t\t\t\t\t\tid: createdItem.id,\n\t\t\t\t\t\tcollection,\n\t\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Attach taxonomy assignments parsed from the WXR's per-item\n\t\t\t\t// <category> elements.\n\t\t\t\t//\n\t\t\t\t// Anchors (no `translationOf`) get an additive attach -- the\n\t\t\t\t// row is fresh, no inherited pivots to consider.\n\t\t\t\t//\n\t\t\t\t// Translations replace only taxonomies they explicitly carry.\n\t\t\t\t// Since assignments belong to the content translation_group,\n\t\t\t\t// that replacement is reflected in every sibling locale.\n\t\t\t\tif (createdItem) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst written = translationOf\n\t\t\t\t\t\t\t? await setPostTermAssignmentsReplacing(\n\t\t\t\t\t\t\t\t\temdash.db,\n\t\t\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\t\t\tcreatedItem.id,\n\t\t\t\t\t\t\t\t\tpost,\n\t\t\t\t\t\t\t\t\ttaxonomyPlan,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: await attachPostTaxonomies(\n\t\t\t\t\t\t\t\t\temdash.db,\n\t\t\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\t\t\tcreatedItem.id,\n\t\t\t\t\t\t\t\t\tpost,\n\t\t\t\t\t\t\t\t\ttaxonomyPlan,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tif (result.taxonomies) {\n\t\t\t\t\t\t\tresult.taxonomies.assignments += written;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (taxError) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`Failed to attach taxonomies for \"${post.title || \"Untitled\"}\":`,\n\t\t\t\t\t\t\ttaxError,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresult.errors.push({\n\t\t\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\t\t\terror:\n\t\t\t\t\t\t\t\ttaxError instanceof Error && taxError.message\n\t\t\t\t\t\t\t\t\t? `Imported but failed to attach taxonomies: ${taxError.message}`\n\t\t\t\t\t\t\t\t\t: \"Imported but failed to attach taxonomies\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (createdItem && scheduledAt) {\n\t\t\t\t\tconst scheduled = await emdash.handleContentSchedule(\n\t\t\t\t\t\tcollection,\n\t\t\t\t\t\tcreatedItem.id,\n\t\t\t\t\t\tscheduledAt,\n\t\t\t\t\t);\n\t\t\t\t\tif (!scheduled.success) {\n\t\t\t\t\t\tresult.errors.push({\n\t\t\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\t\t\terror: `Imported as draft but failed to schedule: ${scheduled.error?.message ?? \"Unknown error\"}`,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult.errors.push({\n\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\terror:\n\t\t\t\t\t\ttypeof createResult.error === \"object\" && createResult.error !== null\n\t\t\t\t\t\t\t? (createResult.error as { message?: string }).message || \"Unknown error\"\n\t\t\t\t\t\t\t: String(createResult.error),\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(`Import error for \"${post.title || \"Untitled\"}\":`, error);\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\terror: error instanceof Error && error.message ? error.message : \"Failed to import item\",\n\t\t\t});\n\t\t}\n\t}\n\n\tresult.success = result.errors.length === 0;\n\treturn result;\n}\n\n/** The slug the content import gives a post: its post name, or one made from its title. */\nfunction wxrPostSlug(post: WxrPost): string {\n\treturn post.postName || slugify(post.title || `post-${post.id || Date.now()}`);\n}\n\n/**\n * Import the export's menus once its content is in, linking their items to the\n * entries the content import created.\n */\nasync function importWxrMenus(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\tconfig: ImportConfig,\n\tdb: EmDashHandlers[\"db\"],\n\tmanifest: EmDashManifest,\n\tresult: ImportResult,\n): Promise<void> {\n\tif (config.importMenus === false || wxr.navMenus.length === 0) return;\n\n\tlet menuResult: Awaited<ReturnType<typeof importMenusFromWxr>>;\n\ttry {\n\t\tmenuResult = await importMenusFromWxr(\n\t\t\twxr.navMenus,\n\t\t\tdb,\n\t\t\tawait findWxrMenuTargets(wxr, config, db, manifest),\n\t\t\tresolveContentCreateLocale(config.locale),\n\t\t\twxrMenuArchives(config, manifest),\n\t\t);\n\t} catch (error) {\n\t\t// The content is in by now, so report the failure with the rest of the result\n\t\tconsole.error(\"[WXR_IMPORT_MENUS]\", error);\n\t\tresult.errors.push({ title: \"Menus\", error: \"Failed to import menus\" });\n\t\tresult.success = false;\n\t\treturn;\n\t}\n\tresult.menus = {\n\t\tcreated: menuResult.menusCreated,\n\t\titems: menuResult.itemsCreated,\n\t\tskipped: menuResult.menusSkipped,\n\t\titemsSkipped: menuResult.itemsSkipped,\n\t};\n\tfor (const menuError of menuResult.errors) {\n\t\t// The detail can carry database and adapter messages, so it stays in the log\n\t\tconsole.error(\"[WXR_IMPORT_MENUS]\", menuError.menu, menuError.error);\n\t\tresult.errors.push({ title: `Menu: ${menuError.menu}`, error: \"Failed to import menu\" });\n\t}\n\tif (menuResult.errors.length > 0) result.success = false;\n}\n\n/**\n * Find the entries that menu items link to: the ones the content import made\n * from those posts, looked up by the collection, slug and locale it gave them.\n * This also finds entries an earlier import created and this one skipped.\n *\n * Posts that share a slug in a collection and locale are left out: the content\n * import creates the first and skips the others, so the one entry with that\n * slug can't be matched to the right post.\n */\nasync function findWxrMenuTargets(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\tconfig: ImportConfig,\n\tdb: EmDashHandlers[\"db\"],\n\tmanifest: EmDashManifest,\n): Promise<Map<number, WxrMenuTarget>> {\n\tconst linked = new Set<number>();\n\tfor (const menu of wxr.navMenus) {\n\t\tfor (const item of menu.items) {\n\t\t\tif (item.type === \"post_type\" && item.objectId) linked.add(item.objectId);\n\t\t}\n\t}\n\n\t// Every post the content import takes, by collection and locale, then by slug\n\tconst groups = new Map<\n\t\tstring,\n\t\t{ collection: string; locale: string; postsBySlug: Map<string, WxrPost[]> }\n\t>();\n\tfor (const post of wxr.posts) {\n\t\tconst mapping = config.postTypeMappings[post.postType || \"post\"];\n\t\tif (!mapping?.enabled) continue;\n\t\tconst collection = sanitizeSlug(mapping.collection);\n\t\tif (!manifest.collections[collection]) continue;\n\t\tlet locale: string;\n\t\ttry {\n\t\t\tlocale = resolveContentCreateLocale(post.locale ?? config.locale);\n\t\t} catch {\n\t\t\t// The content import couldn't create the entry in this locale either\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = `${collection}\\u0000${locale}`;\n\t\tlet group = groups.get(key);\n\t\tif (!group) {\n\t\t\tgroup = { collection, locale, postsBySlug: new Map() };\n\t\t\tgroups.set(key, group);\n\t\t}\n\t\tconst slug = wxrPostSlug(post);\n\t\tconst posts = group.postsBySlug.get(slug);\n\t\tif (posts) posts.push(post);\n\t\telse group.postsBySlug.set(slug, [post]);\n\t}\n\n\tconst contentRepo = new ContentRepository(db);\n\tconst targets = new Map<number, WxrMenuTarget>();\n\tfor (const { collection, locale, postsBySlug } of groups.values()) {\n\t\t// The linked posts that have their slug to themselves\n\t\tconst linkedBySlug = new Map<string, { id: number; title: string }>();\n\t\tfor (const [slug, [post, ...others]] of postsBySlug) {\n\t\t\tif (post?.id && others.length === 0 && linked.has(post.id)) {\n\t\t\t\tlinkedBySlug.set(slug, { id: post.id, title: post.title ?? \"\" });\n\t\t\t}\n\t\t}\n\t\tif (linkedBySlug.size === 0) continue;\n\t\tconst entries = await contentRepo.findManyBySlugsInLocale(\n\t\t\tcollection,\n\t\t\t[...linkedBySlug.keys()],\n\t\t\tlocale,\n\t\t);\n\t\tfor (const [slug, post] of linkedBySlug) {\n\t\t\tconst entry = entries.get(slug);\n\t\t\tif (!entry) continue;\n\t\t\ttargets.set(post.id, {\n\t\t\t\tcollection,\n\t\t\t\ttranslationGroup: entry.translationGroup ?? entry.id,\n\t\t\t\tlocale: entry.locale ?? locale,\n\t\t\t\ttitle: typeof entry.data.title === \"string\" ? entry.data.title : post.title,\n\t\t\t});\n\t\t}\n\t}\n\treturn targets;\n}\n\n/**\n * The collections that menu items for post type archives link to: each imported\n * post type's collection, by WordPress post type.\n */\nfunction wxrMenuArchives(\n\tconfig: ImportConfig,\n\tmanifest: EmDashManifest,\n): Map<string, WxrMenuArchive> {\n\tconst archives = new Map<string, WxrMenuArchive>();\n\tfor (const [postType, mapping] of Object.entries(config.postTypeMappings)) {\n\t\tif (!mapping.enabled) continue;\n\t\tconst collection = sanitizeSlug(mapping.collection);\n\t\tconst definition = manifest.collections[collection];\n\t\tif (definition) archives.set(postType, { collection, label: definition.label });\n\t}\n\treturn archives;\n}\n\nfunction mapStatus(wpStatus: string | undefined): string {\n\tswitch (wpStatus) {\n\t\tcase \"publish\":\n\t\t\treturn \"published\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"draft\";\n\t\tcase \"private\":\n\t\t\treturn \"draft\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,MAAa,YAAY;;AAGzB,MAAM,yBAAyB;AAqF/B,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,QAAQ,oBACZ,QAAO,SAAS,kBAAkB,yBAAyB,IAAI;AAGhE,KAAI;EACH,MAAM,iBAAiB,MAAM,OAAO,aAAa;EAEjD,MAAM,WAAW,MAAM,QAAQ,UAAU;EACzC,MAAM,YAAY,SAAS,IAAI,OAAO;EACtC,MAAM,OAAO,qBAAqB,OAAO,YAAY;EACrD,MAAM,cAAc,SAAS,IAAI,SAAS;EAC1C,MAAM,aAAa,OAAO,gBAAgB,WAAW,cAAc;AAEnE,MAAI,CAAC,KACJ,QAAO,SAAS,oBAAoB,oBAAoB,IAAI;AAG7D,MAAI,CAAC,WACJ,QAAO,SAAS,oBAAoB,sBAAsB,IAAI;EAG/D,MAAM,eAAe,eAAe,YAAY,SAAS;AACzD,MAAI,cAAc,aAAc,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,MAAM,YAAY,wBACjC,YACA,CAAC,GAAG,aAAa,MAAM,CAAC,EACxB,OACA;AACD,OAAK,MAAM,CAAC,MAAM,SAAS,cAAc;GACxC,MAAM,QAAQ,QAAQ,IAAI,KAAK;AAC/B,OAAI,CAAC,MAAO;AACZ,WAAQ,IAAI,KAAK,IAAI;IACpB;IACA,kBAAkB,MAAM,oBAAoB,MAAM;IAClD,QAAQ,MAAM,UAAU;IACxB,OAAO,OAAO,MAAM,KAAK,UAAU,WAAW,MAAM,KAAK,QAAQ,KAAK;IACtE,CAAC;;;AAGJ,QAAO;;;;;;AAOR,SAAS,gBACR,QACA,UAC8B;CAC9B,MAAM,2BAAW,IAAI,KAA6B;AAClD,MAAK,MAAM,CAAC,UAAU,YAAY,OAAO,QAAQ,OAAO,iBAAiB,EAAE;AAC1E,MAAI,CAAC,QAAQ,QAAS;EACtB,MAAM,aAAaA,uBAAa,QAAQ,WAAW;EACnD,MAAM,aAAa,SAAS,YAAY;AACxC,MAAI,WAAY,UAAS,IAAI,UAAU;GAAE;GAAY,OAAO,WAAW;GAAO,CAAC;;AAEhF,QAAO;;AAGR,SAAS,UAAU,UAAsC;AACxD,SAAQ,UAAR;EACC,KAAK,UACJ,QAAO;EACR,KAAK,QACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,QACC,QAAO"}
1
+ {"version":3,"file":"execute.mjs","names":["sanitizeSlug"],"sources":["../../../../../../src/astro/routes/api/import/wordpress/execute.ts"],"sourcesContent":["/**\n * WordPress WXR execute import endpoint\n *\n * POST /_emdash/api/import/wordpress/execute\n *\n * Accepts WXR file and import configuration, imports content into the database.\n */\n\nimport { gutenbergToPortableText } from \"@emdash-cms/gutenberg-to-portable-text\";\nimport type { APIRoute } from \"astro\";\nimport {\n\tparseWxrString,\n\tContentRepository,\n\timportReusableBlocksAsSections,\n\ttype WxrPost,\n\tparseWxrDate,\n} from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { wxrChunkCursor, wxrChunkState, wxrImportConfig } from \"#api/schemas.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\nimport { importMenusFromWxr, type WxrMenuArchive, type WxrMenuTarget } from \"#import/menus.js\";\nimport { relativizeContentLinks, resolveImportByline } from \"#import/utils.js\";\nimport {\n\tattachPostTaxonomies,\n\tisWxrTaxonomyConflictError,\n\tloadTaxonomyPlanFromDb,\n\tmirrorTermsToLocales,\n\tpreImportWxrTaxonomies,\n\tsetPostTermAssignmentsReplacing,\n\ttype TaxonomyImportPlan,\n} from \"#import/wxr-taxonomies.js\";\nimport type { EmDashHandlers, EmDashManifest } from \"#types\";\nimport { slugify } from \"#utils/slugify.js\";\n\nimport { resolveContentCreateLocale } from \"../../../../../i18n/config.js\";\nimport { sanitizeSlug } from \"./analyze.js\";\n\nexport const prerender = false;\n\n/** Posts processed per Worker invocation in chunked WXR imports. */\nconst WXR_CONTENT_CHUNK_SIZE = 30;\n\n/** Phase/cursor payload for chunked WXR imports. */\ninterface WxrChunkCursor {\n\toffset: number;\n\tsource: string;\n\ttaxonomiesReady: true;\n}\n\n/** Cross-chunk state carried by the client. */\ninterface WxrChunkState {\n\ttranslationGroups: Record<string, string>;\n\tbylines?: Record<string, string>;\n}\n\n/** Chunked response shape mirrors the wordpress-plugin execute endpoint. */\ninterface WxrChunkResponse {\n\tsuccess: boolean;\n\tresult: ImportResult;\n\tdone: boolean;\n\tcursor?: WxrChunkCursor;\n\tchunk?: WxrChunkState;\n}\n\nexport interface ImportConfig {\n\t/** Map WordPress post types to EmDash collections */\n\tpostTypeMappings: Record<\n\t\tstring,\n\t\t{\n\t\t\tcollection: string;\n\t\t\tenabled: boolean;\n\t\t}\n\t>;\n\t/** Whether to skip items that already exist (by slug) */\n\tskipExisting: boolean;\n\t/** Whether to import reusable blocks (wp_block) as sections */\n\timportSections?: boolean;\n\t/** Author mappings (WP author login -> EmDash user ID) */\n\tauthorMappings?: Record<string, string | null>;\n\t/** BCP 47 locale for all imported items. When omitted, defaults to defaultLocale. */\n\tlocale?: string;\n\t/** Whether to import the export's menus. Defaults to true. */\n\timportMenus?: boolean;\n}\n\nexport interface ImportResult {\n\tsuccess: boolean;\n\timported: number;\n\t/** Entries not imported because the slug already exists in the collection and locale. */\n\tskipped: number;\n\terrors: Array<{ title: string; error: string }>;\n\tbyCollection: Record<string, number>;\n\t/** Entries imported as drafts because they had a password in WordPress */\n\tpasswordProtected?: Array<{ id: string; collection: string; title: string }>;\n\t/** Sections import results (if enabled) */\n\tsections?: {\n\t\tcreated: number;\n\t\tskipped: number;\n\t};\n\t/** Menu import results (if the export has menus) */\n\tmenus?: {\n\t\tcreated: number;\n\t\titems: number;\n\t\t/** Menus left as they were because the site has one with the same name in that locale */\n\t\tskipped: number;\n\t\t/** Items left out because what they link to wasn't imported */\n\t\titemsSkipped: number;\n\t};\n\t/** Taxonomy import results (categories, tags, custom taxonomies). */\n\ttaxonomies?: {\n\t\t/** Terms newly created during this import, keyed by taxonomy name. */\n\t\ttermsCreated: Record<string, number>;\n\t\t/** Existing terms that were re-used, keyed by taxonomy name. */\n\t\ttermsReused: Record<string, number>;\n\t\t/** Total pivot rows (post <-> term) written to `content_taxonomies`. */\n\t\tassignments: number;\n\t\t/**\n\t\t * Custom taxonomy names from the WXR file that had no matching EmDash\n\t\t * definition and were therefore skipped. Lets the admin UI surface a\n\t\t * \"create taxonomy X first\" hint without re-running the import.\n\t\t */\n\t\tmissingTaxonomies: string[];\n\t};\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\tif (!emdash?.handleContentCreate) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash not configured\", 500);\n\t}\n\n\ttry {\n\t\tconst emdashManifest = await emdash.getManifest();\n\n\t\tconst formData = await request.formData();\n\t\tconst fileEntry = formData.get(\"file\");\n\t\tconst file = fileEntry instanceof File ? fileEntry : null;\n\t\tconst configEntry = formData.get(\"config\");\n\t\tconst configJson = typeof configEntry === \"string\" ? configEntry : null;\n\n\t\tif (!file) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"No file provided\", 400);\n\t\t}\n\n\t\tif (!configJson) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"No config provided\", 400);\n\t\t}\n\n\t\tconst parsedConfig = parseJsonField(configJson, \"config\");\n\t\tif (\"response\" in parsedConfig) return parsedConfig.response;\n\t\tconst configResult = wxrImportConfig.safeParse(parsedConfig.value);\n\t\tif (!configResult.success) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import config\", 400);\n\t\t}\n\t\tconst config: ImportConfig = configResult.data;\n\n\t\tconst phaseEntry = formData.get(\"phase\");\n\t\tif (\n\t\t\tphaseEntry !== null &&\n\t\t\tphaseEntry !== \"taxonomy\" &&\n\t\t\tphaseEntry !== \"content\" &&\n\t\t\tphaseEntry !== \"finalize\"\n\t\t) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import phase\", 400);\n\t\t}\n\t\tconst phase = phaseEntry;\n\n\t\tconst cursorEntry = formData.get(\"cursor\");\n\t\tlet cursor: WxrChunkCursor | undefined;\n\t\tif (typeof cursorEntry === \"string\" && cursorEntry.length > 0) {\n\t\t\tconst parsedCursor = parseJsonField(cursorEntry, \"cursor\");\n\t\t\tif (\"response\" in parsedCursor) return parsedCursor.response;\n\t\t\tconst cursorResult = wxrChunkCursor.safeParse(parsedCursor.value);\n\t\t\tif (!cursorResult.success) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import cursor\", 400);\n\t\t\t}\n\t\t\tcursor = cursorResult.data;\n\t\t}\n\n\t\tconst chunkEntry = formData.get(\"chunk\");\n\t\tlet incomingChunk: WxrChunkState | undefined;\n\t\tif (typeof chunkEntry === \"string\" && chunkEntry.length > 0) {\n\t\t\tconst parsedChunk = parseJsonField(chunkEntry, \"chunk\");\n\t\t\tif (\"response\" in parsedChunk) return parsedChunk.response;\n\t\t\tconst chunkResult = wxrChunkState.safeParse(parsedChunk.value);\n\t\t\tif (!chunkResult.success) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import chunk state\", 400);\n\t\t\t}\n\t\t\tincomingChunk = chunkResult.data;\n\t\t}\n\n\t\t// Parse WXR\n\t\tconst text = await file.text();\n\t\tconst wxr = await parseWxrString(text);\n\t\tconst source = await importFingerprint(text, configJson);\n\n\t\tif (cursor && cursor.source !== source) {\n\t\t\treturn apiError(\n\t\t\t\t\"WXR_IMPORT_SOURCE_CHANGED\",\n\t\t\t\t\"The WXR file or import configuration changed after this import started\",\n\t\t\t\t409,\n\t\t\t);\n\t\t}\n\n\t\t// Build attachment ID -> URL map for featured images\n\t\tconst attachmentMap = new Map<string, string>();\n\t\tfor (const att of wxr.attachments) {\n\t\t\tif (att.id && att.url) {\n\t\t\t\tattachmentMap.set(String(att.id), att.url);\n\t\t\t}\n\t\t}\n\n\t\t// Build author login -> display name map\n\t\tconst authorDisplayNames = new Map<string, string>();\n\t\tfor (const author of wxr.authors) {\n\t\t\tif (!author.login) continue;\n\t\t\tauthorDisplayNames.set(author.login, author.displayName || author.login);\n\t\t}\n\n\t\tif (phase === \"content\") {\n\t\t\tif (!cursor?.taxonomiesReady) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Taxonomy preparation is not complete\", 400);\n\t\t\t}\n\t\t\tconst chunkResponse = await runContentChunk(\n\t\t\t\twxr,\n\t\t\t\tconfig,\n\t\t\t\temdash,\n\t\t\t\temdashManifest,\n\t\t\t\tattachmentMap,\n\t\t\t\tauthorDisplayNames,\n\t\t\t\tcursor,\n\t\t\t\tincomingChunk,\n\t\t\t\tsource,\n\t\t\t);\n\t\t\tif (chunkResponse instanceof Response) return chunkResponse;\n\t\t\treturn apiSuccess(chunkResponse);\n\t\t}\n\n\t\tif (phase === \"taxonomy\") {\n\t\t\tif (cursor || incomingChunk) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Taxonomy preparation cannot be resumed\", 400);\n\t\t\t}\n\t\t\tlet taxonomyPlan: TaxonomyImportPlan;\n\t\t\ttry {\n\t\t\t\ttaxonomyPlan = await prepareTaxonomies(wxr, emdash, config.locale);\n\t\t\t} catch (error) {\n\t\t\t\tif (isWxrTaxonomyConflictError(error)) {\n\t\t\t\t\tconsole.error(\"[WXR_IMPORT_TAXONOMY_CONFLICT]\", error);\n\t\t\t\t\treturn apiError(\"WXR_IMPORT_TAXONOMY_CONFLICT\", error.publicMessage, 409);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tconst result = emptyImportResult();\n\t\t\tresult.taxonomies = {\n\t\t\t\ttermsCreated: taxonomyPlan.termsCreated,\n\t\t\t\ttermsReused: taxonomyPlan.termsReused,\n\t\t\t\tassignments: 0,\n\t\t\t\tmissingTaxonomies: taxonomyPlan.missingTaxonomies,\n\t\t\t};\n\t\t\treturn apiSuccess({\n\t\t\t\tsuccess: true,\n\t\t\t\tresult,\n\t\t\t\tdone: true,\n\t\t\t\tcursor: { offset: 0, source, taxonomiesReady: true as const },\n\t\t\t\tchunk: { translationGroups: {} },\n\t\t\t});\n\t\t}\n\n\t\tif (phase === \"finalize\") {\n\t\t\tif (!cursor || cursor.offset !== wxr.posts.length) {\n\t\t\t\treturn apiError(\"VALIDATION_ERROR\", \"Content import is not complete\", 400);\n\t\t\t}\n\t\t\tconst result = emptyImportResult();\n\t\t\tif (config.importSections !== false) {\n\t\t\t\tconst sectionsResult = await importReusableBlocksAsSections(wxr.posts, emdash.db);\n\t\t\t\tresult.sections = {\n\t\t\t\t\tcreated: sectionsResult.sectionsCreated,\n\t\t\t\t\tskipped: sectionsResult.sectionsSkipped,\n\t\t\t\t};\n\t\t\t\tresult.errors.push(...sectionsResult.errors);\n\t\t\t\tresult.success = result.errors.length === 0;\n\t\t\t}\n\t\t\tawait importWxrMenus(wxr, config, emdash.db, emdashManifest, result);\n\t\t\treturn apiSuccess({ success: result.success, result, done: true });\n\t\t}\n\n\t\tif (wxr.posts.length > WXR_CONTENT_CHUNK_SIZE) {\n\t\t\treturn apiError(\n\t\t\t\t\"WXR_IMPORT_TOO_LARGE\",\n\t\t\t\t`This WXR contains ${wxr.posts.length} posts, which exceeds the ${WXR_CONTENT_CHUNK_SIZE}-post limit for a single import request. ` +\n\t\t\t\t\t`Run the import in chunked mode or split the file into smaller exports.`,\n\t\t\t\t413,\n\t\t\t);\n\t\t}\n\n\t\t// Pre-create taxonomy terms (categories, tags, custom taxonomies) so\n\t\t// per-post assignments can resolve to existing rows. Done before any\n\t\t// content insert because WXR exports list terms at the top of the\n\t\t// file but per-item assignments only reference them by slug.\n\t\tconst taxonomyPlan = await preImportWxrTaxonomies(\n\t\t\temdash.db,\n\t\t\twxr.posts,\n\t\t\twxr.categories,\n\t\t\twxr.tags,\n\t\t\twxr.terms,\n\t\t\tconfig.locale,\n\t\t);\n\n\t\t// Multilingual imports (WPML / Polylang -- see #1080) need a term\n\t\t// row at each per-post locale, all sharing the canonical term's\n\t\t// `translation_group`. Without this, `getTermsForEntry(..., locale)`\n\t\t// on non-canonical translations comes back empty.\n\t\t//\n\t\t// The mirror raises `WxrTaxonomyConflictError` with an operator-\n\t\t// actionable message when an existing locale row has an\n\t\t// incompatible group. Surface its `publicMessage` directly so the\n\t\t// admin UI can tell the user which (taxonomy, slug, locale) needs\n\t\t// reconciliation. Other errors (DB connectivity, unexpected\n\t\t// repository failures) re-throw to the outer catch where\n\t\t// `handleError` masks them with the generic \"Failed to import\n\t\t// content\" -- exposing raw DB errors to clients would leak schema\n\t\t// names and bypass the AGENTS.md \"never expose error.message\" rule.\n\t\tconst postLocales = new Set<string>();\n\t\tfor (const post of wxr.posts) {\n\t\t\tif (post.locale) postLocales.add(post.locale);\n\t\t}\n\t\tif (postLocales.size > 0) {\n\t\t\ttry {\n\t\t\t\tawait mirrorTermsToLocales(emdash.db, taxonomyPlan, postLocales, config.locale);\n\t\t\t} catch (mirrorError) {\n\t\t\t\tif (isWxrTaxonomyConflictError(mirrorError)) {\n\t\t\t\t\tconsole.error(\"[WXR_IMPORT_TAXONOMY_CONFLICT]\", mirrorError);\n\t\t\t\t\treturn apiError(\"WXR_IMPORT_TAXONOMY_CONFLICT\", mirrorError.publicMessage, 409);\n\t\t\t\t}\n\t\t\t\tthrow mirrorError;\n\t\t\t}\n\t\t}\n\n\t\t// Import content (locale from config scopes all items)\n\t\tconst result = await importContent(\n\t\t\twxr.posts,\n\t\t\tconfig,\n\t\t\temdash,\n\t\t\temdashManifest,\n\t\t\tattachmentMap,\n\t\t\tconfig.locale,\n\t\t\tauthorDisplayNames,\n\t\t\ttaxonomyPlan,\n\t\t\tnew Map(),\n\t\t\twxr.site.link,\n\t\t);\n\n\t\t// Import reusable blocks as sections (if enabled)\n\t\tif (config.importSections !== false) {\n\t\t\tconst sectionsResult = await importReusableBlocksAsSections(wxr.posts, emdash.db);\n\t\t\tresult.sections = {\n\t\t\t\tcreated: sectionsResult.sectionsCreated,\n\t\t\t\tskipped: sectionsResult.sectionsSkipped,\n\t\t\t};\n\t\t\t// Add section errors to main errors array\n\t\t\tresult.errors.push(...sectionsResult.errors);\n\t\t\tif (sectionsResult.errors.length > 0) {\n\t\t\t\tresult.success = false;\n\t\t\t}\n\t\t}\n\n\t\tawait importWxrMenus(wxr, config, emdash.db, emdashManifest, result);\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to import content\", \"WXR_IMPORT_ERROR\");\n\t}\n};\n\nfunction parseJsonField(\n\tvalue: string,\n\tfieldName: string,\n): { value: unknown } | { response: Response } {\n\ttry {\n\t\treturn { value: JSON.parse(value) };\n\t} catch {\n\t\treturn { response: apiError(\"VALIDATION_ERROR\", `Invalid JSON in ${fieldName}`, 400) };\n\t}\n}\n\nasync function importFingerprint(text: string, configJson: string): Promise<string> {\n\tconst bytes = new TextEncoder().encode(`${configJson}\\u0000${text}`);\n\tconst digest = await crypto.subtle.digest(\"SHA-256\", bytes);\n\treturn Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction emptyImportResult(): ImportResult {\n\treturn {\n\t\tsuccess: true,\n\t\timported: 0,\n\t\tskipped: 0,\n\t\terrors: [],\n\t\tbyCollection: {},\n\t};\n}\n\n/** Import a bounded WXR post chunk using taxonomy rows prepared in the prior phase. */\nasync function runContentChunk(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\tconfig: ImportConfig,\n\temdash: EmDashHandlers,\n\tmanifest: EmDashManifest,\n\tattachmentMap: Map<string, string>,\n\tauthorDisplayNames: Map<string, string>,\n\tcursor: WxrChunkCursor | undefined,\n\tincomingChunk: WxrChunkState | undefined,\n\tsource: string,\n): Promise<WxrChunkResponse | Response> {\n\tconst offset = cursor?.offset ?? 0;\n\tif (offset > wxr.posts.length || (offset > 0 && offset % WXR_CONTENT_CHUNK_SIZE !== 0)) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Invalid import cursor offset\", 400);\n\t}\n\tconst posts = wxr.posts.slice(offset, offset + WXR_CONTENT_CHUNK_SIZE);\n\tconst taxonomyPlan = await loadTaxonomyPlanFromDb(emdash.db);\n\n\t// Seed translation-group state from earlier chunks so a translation that\n\t// appears on chunk N can link to its sibling imported on chunk N-1.\n\tconst translationGroupMap = new Map<string, string>(\n\t\tObject.entries(incomingChunk?.translationGroups ?? {}),\n\t);\n\t// Likewise for bylines: an author without a user mapping is matched only\n\t// through this map, so a fresh one per chunk gives them a new byline each time.\n\tconst bylineCache = new Map<string, string>(Object.entries(incomingChunk?.bylines ?? {}));\n\n\tconst result = await importContent(\n\t\tposts,\n\t\tconfig,\n\t\temdash,\n\t\tmanifest,\n\t\tattachmentMap,\n\t\tconfig.locale,\n\t\tauthorDisplayNames,\n\t\ttaxonomyPlan,\n\t\ttranslationGroupMap,\n\t\twxr.site.link,\n\t\tbylineCache,\n\t);\n\n\tconst nextOffset = offset + posts.length;\n\tconst done = nextOffset >= wxr.posts.length;\n\n\treturn {\n\t\tsuccess: result.errors.length === 0,\n\t\tresult,\n\t\tdone,\n\t\tcursor: { offset: nextOffset, source, taxonomiesReady: true },\n\t\tchunk: {\n\t\t\ttranslationGroups: Object.fromEntries(translationGroupMap),\n\t\t\tbylines: Object.fromEntries(bylineCache),\n\t\t},\n\t};\n}\n\nasync function prepareTaxonomies(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\temdash: EmDashHandlers,\n\tlocale: string | undefined,\n): Promise<TaxonomyImportPlan> {\n\tconst taxonomyPlan = await preImportWxrTaxonomies(\n\t\temdash.db,\n\t\twxr.posts,\n\t\twxr.categories,\n\t\twxr.tags,\n\t\twxr.terms,\n\t\tlocale,\n\t);\n\tconst postLocales = new Set<string>();\n\tfor (const post of wxr.posts) {\n\t\tif (post.locale) postLocales.add(post.locale);\n\t}\n\tif (postLocales.size > 0) {\n\t\tawait mirrorTermsToLocales(emdash.db, taxonomyPlan, postLocales, locale);\n\t}\n\treturn taxonomyPlan;\n}\n\nexport async function importContent(\n\tposts: WxrPost[],\n\tconfig: ImportConfig,\n\temdash: EmDashHandlers,\n\tmanifest: EmDashManifest,\n\tattachmentMap: Map<string, string>,\n\tlocale: string | undefined,\n\tauthorDisplayNames: Map<string, string> | undefined,\n\ttaxonomyPlan: TaxonomyImportPlan,\n\ttranslationGroupMap = new Map<string, string>(),\n\tsiteUrl = \"\",\n\tbylineCache = new Map<string, string>(),\n): Promise<ImportResult> {\n\tconst result: ImportResult = {\n\t\tsuccess: true,\n\t\timported: 0,\n\t\tskipped: 0,\n\t\terrors: [],\n\t\tbyCollection: {},\n\t\ttaxonomies: {\n\t\t\ttermsCreated: taxonomyPlan.termsCreated,\n\t\t\ttermsReused: taxonomyPlan.termsReused,\n\t\t\tassignments: 0,\n\t\t\tmissingTaxonomies: taxonomyPlan.missingTaxonomies,\n\t\t},\n\t};\n\n\t// Create content repository for checking existing items\n\tconst contentRepo = new ContentRepository(emdash.db);\n\tconst bylineRepo = new BylineRepository(emdash.db);\n\n\tfor (const post of posts) {\n\t\tconst postType = post.postType || \"post\";\n\t\tconst mapping = config.postTypeMappings[postType];\n\n\t\t// Not part of the import: internal post types, or ones left disabled.\n\t\tif (!mapping || !mapping.enabled) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Defensive: mapping.collection is already sanitized by prepare, but the user\n\t\t// could manually edit the import config between prepare and execute.\n\t\tconst collection = sanitizeSlug(mapping.collection);\n\n\t\t// Check if collection exists in manifest\n\t\tif (!manifest?.collections[collection]) {\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\terror: `Collection \"${collection}\" does not exist`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// Convert content to Portable Text\n\t\t\tconst content = post.content ? gutenbergToPortableText(post.content) : [];\n\t\t\tif (siteUrl) relativizeContentLinks(content, siteUrl);\n\n\t\t\tconst slug = wxrPostSlug(post);\n\n\t\t\t// Per-post locale: prefer the value extracted from WPML/Polylang\n\t\t\t// metadata; fall back to the upload-wide locale. Two translations\n\t\t\t// sharing `post_name` (e.g. /en/hello + /ar/hello) collide on the\n\t\t\t// `UNIQUE(slug, locale)` constraint when they share a locale, so\n\t\t\t// honouring the per-post value is what makes multilingual imports\n\t\t\t// land correctly. See issue #1080.\n\t\t\tconst postLocale = post.locale ?? locale;\n\n\t\t\t// Check if already exists (idempotency). Match against the\n\t\t\t// per-post locale so the same slug in different locales doesn't\n\t\t\t// false-positive as duplicate.\n\t\t\tif (config.skipExisting) {\n\t\t\t\tconst existing = await contentRepo.findBySlug(collection, slug, postLocale);\n\t\t\t\tif (existing) {\n\t\t\t\t\t// Record the translation group mapping so later\n\t\t\t\t\t// translations in this WXR can link to the existing\n\t\t\t\t\t// item. We deliberately trust the WXR's grouping over\n\t\t\t\t\t// the existing row's `translation_group`: a singleton\n\t\t\t\t\t// existing row gets folded into the WXR's group when\n\t\t\t\t\t// `handleContentCreate` resolves the new translation's\n\t\t\t\t\t// `translationOf`. Pre-existing translations that\n\t\t\t\t\t// already belong to a different group are left alone --\n\t\t\t\t\t// the user is responsible for reconciling those through\n\t\t\t\t\t// the admin if they don't match the WXR.\n\t\t\t\t\tif (post.translationGroup) {\n\t\t\t\t\t\ttranslationGroupMap.set(post.translationGroup, existing.id);\n\t\t\t\t\t}\n\t\t\t\t\tresult.skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Resolve translation group: if this post belongs to a group and\n\t\t\t// we've already imported one of its translations, link to it.\n\t\t\tlet translationOf: string | undefined;\n\t\t\tif (post.translationGroup) {\n\t\t\t\ttranslationOf = translationGroupMap.get(post.translationGroup);\n\t\t\t}\n\n\t\t\tconst passwordProtected = Boolean(post.postPassword);\n\t\t\tconst status = passwordProtected ? \"draft\" : mapStatus(post.status);\n\n\t\t\t// Build data object with required fields\n\t\t\tconst data: Record<string, unknown> = {\n\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\tcontent,\n\t\t\t\texcerpt: post.excerpt || undefined,\n\t\t\t};\n\n\t\t\t// Only add featured_image if the collection has this field and we have a value\n\t\t\tconst collectionSchema = manifest.collections[collection];\n\t\t\tconst hasFeaturedImageField = collectionSchema?.fields\n\t\t\t\t? \"featured_image\" in collectionSchema.fields\n\t\t\t\t: false;\n\t\t\tif (hasFeaturedImageField) {\n\t\t\t\tconst thumbnailId = post.meta.get(\"_thumbnail_id\");\n\t\t\t\tconst featuredImage = thumbnailId ? attachmentMap.get(String(thumbnailId)) : undefined;\n\t\t\t\tif (featuredImage) {\n\t\t\t\t\tdata.featured_image = featuredImage;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Resolve author ID from mappings\n\t\t\tlet authorId: string | undefined;\n\t\t\tif (config.authorMappings && post.creator) {\n\t\t\t\tconst mappedUserId = config.authorMappings[post.creator];\n\t\t\t\tif (mappedUserId !== undefined && mappedUserId !== null) {\n\t\t\t\t\tauthorId = mappedUserId;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bylineId = await resolveImportByline(\n\t\t\t\tpost.creator,\n\t\t\t\tauthorDisplayNames?.get(post.creator ?? \"\") ?? post.creator,\n\t\t\t\tauthorId,\n\t\t\t\tbylineRepo,\n\t\t\t\tbylineCache,\n\t\t\t);\n\n\t\t\t// Preserve original WordPress dates using the shared WXR date parser.\n\t\t\t// Fallback chain: postDateGmt (UTC) → pubDate (RFC 2822) → postDate (site-local).\n\t\t\tconst parsedDate = parseWxrDate(post.postDateGmt, post.pubDate, post.postDate);\n\t\t\tconst createdAt = parsedDate ? parsedDate.toISOString() : undefined;\n\t\t\tconst futureDated =\n\t\t\t\tpost.status === \"future\" && createdAt !== undefined && Date.parse(createdAt) > Date.now();\n\t\t\tconst scheduledAt = futureDated && !passwordProtected ? createdAt : undefined;\n\n\t\t\t// Create the content item\n\t\t\tconst createResult = await emdash.handleContentCreate(collection, {\n\t\t\t\tdata,\n\t\t\t\tslug,\n\t\t\t\tstatus,\n\t\t\t\tauthorId,\n\t\t\t\tbylines: bylineId ? [{ bylineId }] : undefined,\n\t\t\t\tlocale: postLocale,\n\t\t\t\ttranslationOf,\n\t\t\t\tcreatedAt,\n\t\t\t\t// Future-dated posts get their publication date when they are published.\n\t\t\t\tpublishedAt: futureDated ? undefined : createdAt,\n\t\t\t});\n\n\t\t\tif (createResult.success) {\n\t\t\t\tresult.imported++;\n\t\t\t\tresult.byCollection[collection] = (result.byCollection[collection] || 0) + 1;\n\n\t\t\t\t// `handleContentCreate` returns `data: { item, _rev? }` on\n\t\t\t\t// success (see `ApiResult<ContentResponse>` in\n\t\t\t\t// `api/handlers/content.ts`). `HandlerResponse.data` is\n\t\t\t\t// typed as `unknown` to avoid coupling the route surface to\n\t\t\t\t// internal handler types, so we narrow here.\n\t\t\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- handler contract documented at handleContentCreate\n\t\t\t\tconst createdItem = (createResult.data as { item: { id: string } } | undefined)?.item;\n\n\t\t\t\t// Track translation group: the first imported post in a group\n\t\t\t\t// becomes the anchor that later translations link to.\n\t\t\t\tif (\n\t\t\t\t\tcreatedItem &&\n\t\t\t\t\tpost.translationGroup &&\n\t\t\t\t\t!translationGroupMap.has(post.translationGroup)\n\t\t\t\t) {\n\t\t\t\t\ttranslationGroupMap.set(post.translationGroup, createdItem.id);\n\t\t\t\t}\n\n\t\t\t\tif (createdItem && passwordProtected) {\n\t\t\t\t\t(result.passwordProtected ??= []).push({\n\t\t\t\t\t\tid: createdItem.id,\n\t\t\t\t\t\tcollection,\n\t\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Attach taxonomy assignments parsed from the WXR's per-item\n\t\t\t\t// <category> elements.\n\t\t\t\t//\n\t\t\t\t// Anchors (no `translationOf`) get an additive attach -- the\n\t\t\t\t// row is fresh, no inherited pivots to consider.\n\t\t\t\t//\n\t\t\t\t// Translations replace only taxonomies they explicitly carry.\n\t\t\t\t// Since assignments belong to the content translation_group,\n\t\t\t\t// that replacement is reflected in every sibling locale.\n\t\t\t\tif (createdItem) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst written = translationOf\n\t\t\t\t\t\t\t? await setPostTermAssignmentsReplacing(\n\t\t\t\t\t\t\t\t\temdash.db,\n\t\t\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\t\t\tcreatedItem.id,\n\t\t\t\t\t\t\t\t\tpost,\n\t\t\t\t\t\t\t\t\ttaxonomyPlan,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: await attachPostTaxonomies(\n\t\t\t\t\t\t\t\t\temdash.db,\n\t\t\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\t\t\tcreatedItem.id,\n\t\t\t\t\t\t\t\t\tpost,\n\t\t\t\t\t\t\t\t\ttaxonomyPlan,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\tif (result.taxonomies) {\n\t\t\t\t\t\t\tresult.taxonomies.assignments += written;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (taxError) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`Failed to attach taxonomies for \"${post.title || \"Untitled\"}\":`,\n\t\t\t\t\t\t\ttaxError,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresult.errors.push({\n\t\t\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\t\t\terror:\n\t\t\t\t\t\t\t\ttaxError instanceof Error && taxError.message\n\t\t\t\t\t\t\t\t\t? `Imported but failed to attach taxonomies: ${taxError.message}`\n\t\t\t\t\t\t\t\t\t: \"Imported but failed to attach taxonomies\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (createdItem && scheduledAt) {\n\t\t\t\t\tconst scheduled = await emdash.handleContentSchedule(\n\t\t\t\t\t\tcollection,\n\t\t\t\t\t\tcreatedItem.id,\n\t\t\t\t\t\tscheduledAt,\n\t\t\t\t\t);\n\t\t\t\t\tif (!scheduled.success) {\n\t\t\t\t\t\tresult.errors.push({\n\t\t\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\t\t\terror: `Imported as draft but failed to schedule: ${scheduled.error?.message ?? \"Unknown error\"}`,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult.errors.push({\n\t\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\t\terror: createResult.error.message || \"Unknown error\",\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(`Import error for \"${post.title || \"Untitled\"}\":`, error);\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: post.title || \"Untitled\",\n\t\t\t\terror: error instanceof Error && error.message ? error.message : \"Failed to import item\",\n\t\t\t});\n\t\t}\n\t}\n\n\tresult.success = result.errors.length === 0;\n\treturn result;\n}\n\n/** The slug the content import gives a post: its post name, or one made from its title. */\nfunction wxrPostSlug(post: WxrPost): string {\n\treturn post.postName || slugify(post.title || `post-${post.id || Date.now()}`);\n}\n\n/**\n * Import the export's menus once its content is in, linking their items to the\n * entries the content import created.\n */\nasync function importWxrMenus(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\tconfig: ImportConfig,\n\tdb: EmDashHandlers[\"db\"],\n\tmanifest: EmDashManifest,\n\tresult: ImportResult,\n): Promise<void> {\n\tif (config.importMenus === false || wxr.navMenus.length === 0) return;\n\n\tlet menuResult: Awaited<ReturnType<typeof importMenusFromWxr>>;\n\ttry {\n\t\tmenuResult = await importMenusFromWxr(\n\t\t\twxr.navMenus,\n\t\t\tdb,\n\t\t\tawait findWxrMenuTargets(wxr, config, db, manifest),\n\t\t\tresolveContentCreateLocale(config.locale),\n\t\t\twxrMenuArchives(config, manifest),\n\t\t);\n\t} catch (error) {\n\t\t// The content is in by now, so report the failure with the rest of the result\n\t\tconsole.error(\"[WXR_IMPORT_MENUS]\", error);\n\t\tresult.errors.push({ title: \"Menus\", error: \"Failed to import menus\" });\n\t\tresult.success = false;\n\t\treturn;\n\t}\n\tresult.menus = {\n\t\tcreated: menuResult.menusCreated,\n\t\titems: menuResult.itemsCreated,\n\t\tskipped: menuResult.menusSkipped,\n\t\titemsSkipped: menuResult.itemsSkipped,\n\t};\n\tfor (const menuError of menuResult.errors) {\n\t\t// The detail can carry database and adapter messages, so it stays in the log\n\t\tconsole.error(\"[WXR_IMPORT_MENUS]\", menuError.menu, menuError.error);\n\t\tresult.errors.push({ title: `Menu: ${menuError.menu}`, error: \"Failed to import menu\" });\n\t}\n\tif (menuResult.errors.length > 0) result.success = false;\n}\n\n/**\n * Find the entries that menu items link to: the ones the content import made\n * from those posts, looked up by the collection, slug and locale it gave them.\n * This also finds entries an earlier import created and this one skipped.\n *\n * Posts that share a slug in a collection and locale are left out: the content\n * import creates the first and skips the others, so the one entry with that\n * slug can't be matched to the right post.\n */\nasync function findWxrMenuTargets(\n\twxr: Awaited<ReturnType<typeof parseWxrString>>,\n\tconfig: ImportConfig,\n\tdb: EmDashHandlers[\"db\"],\n\tmanifest: EmDashManifest,\n): Promise<Map<number, WxrMenuTarget>> {\n\tconst linked = new Set<number>();\n\tfor (const menu of wxr.navMenus) {\n\t\tfor (const item of menu.items) {\n\t\t\tif (item.type === \"post_type\" && item.objectId) linked.add(item.objectId);\n\t\t}\n\t}\n\n\t// Every post the content import takes, by collection and locale, then by slug\n\tconst groups = new Map<\n\t\tstring,\n\t\t{ collection: string; locale: string; postsBySlug: Map<string, WxrPost[]> }\n\t>();\n\tfor (const post of wxr.posts) {\n\t\tconst mapping = config.postTypeMappings[post.postType || \"post\"];\n\t\tif (!mapping?.enabled) continue;\n\t\tconst collection = sanitizeSlug(mapping.collection);\n\t\tif (!manifest.collections[collection]) continue;\n\t\tlet locale: string;\n\t\ttry {\n\t\t\tlocale = resolveContentCreateLocale(post.locale ?? config.locale);\n\t\t} catch {\n\t\t\t// The content import couldn't create the entry in this locale either\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = `${collection}\\u0000${locale}`;\n\t\tlet group = groups.get(key);\n\t\tif (!group) {\n\t\t\tgroup = { collection, locale, postsBySlug: new Map() };\n\t\t\tgroups.set(key, group);\n\t\t}\n\t\tconst slug = wxrPostSlug(post);\n\t\tconst posts = group.postsBySlug.get(slug);\n\t\tif (posts) posts.push(post);\n\t\telse group.postsBySlug.set(slug, [post]);\n\t}\n\n\tconst contentRepo = new ContentRepository(db);\n\tconst targets = new Map<number, WxrMenuTarget>();\n\tfor (const { collection, locale, postsBySlug } of groups.values()) {\n\t\t// The linked posts that have their slug to themselves\n\t\tconst linkedBySlug = new Map<string, { id: number; title: string }>();\n\t\tfor (const [slug, [post, ...others]] of postsBySlug) {\n\t\t\tif (post?.id && others.length === 0 && linked.has(post.id)) {\n\t\t\t\tlinkedBySlug.set(slug, { id: post.id, title: post.title ?? \"\" });\n\t\t\t}\n\t\t}\n\t\tif (linkedBySlug.size === 0) continue;\n\t\tconst entries = await contentRepo.findManyBySlugsInLocale(\n\t\t\tcollection,\n\t\t\t[...linkedBySlug.keys()],\n\t\t\tlocale,\n\t\t);\n\t\tfor (const [slug, post] of linkedBySlug) {\n\t\t\tconst entry = entries.get(slug);\n\t\t\tif (!entry) continue;\n\t\t\ttargets.set(post.id, {\n\t\t\t\tcollection,\n\t\t\t\ttranslationGroup: entry.translationGroup ?? entry.id,\n\t\t\t\tlocale: entry.locale ?? locale,\n\t\t\t\ttitle: typeof entry.data.title === \"string\" ? entry.data.title : post.title,\n\t\t\t});\n\t\t}\n\t}\n\treturn targets;\n}\n\n/**\n * The collections that menu items for post type archives link to: each imported\n * post type's collection, by WordPress post type.\n */\nfunction wxrMenuArchives(\n\tconfig: ImportConfig,\n\tmanifest: EmDashManifest,\n): Map<string, WxrMenuArchive> {\n\tconst archives = new Map<string, WxrMenuArchive>();\n\tfor (const [postType, mapping] of Object.entries(config.postTypeMappings)) {\n\t\tif (!mapping.enabled) continue;\n\t\tconst collection = sanitizeSlug(mapping.collection);\n\t\tconst definition = manifest.collections[collection];\n\t\tif (definition) archives.set(postType, { collection, label: definition.label });\n\t}\n\treturn archives;\n}\n\nfunction mapStatus(wpStatus: string | undefined): string {\n\tswitch (wpStatus) {\n\t\tcase \"publish\":\n\t\t\treturn \"published\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"draft\";\n\t\tcase \"private\":\n\t\t\treturn \"draft\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,MAAa,YAAY;;AAGzB,MAAM,yBAAyB;AAqF/B,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,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O;EACR,QACC,QAAO"}
@@ -1,18 +1,18 @@
1
- import "../../../../../parse-Clt6wmpy.mjs";
2
- import "../../../../../types-CG1dR_Cm.mjs";
3
- import "../../../../../types-CImd8MBY.mjs";
4
- import "../../../../../options-BJZMHnpx.mjs";
5
- import "../../../../../rooms-CyXG83RZ.mjs";
6
- import "../../../../../config-B4F2ttAZ.mjs";
7
- import "../../../../../runner-CAHS_KER.mjs";
8
- import "../../../../../storage-query-BDUX3Cef.mjs";
9
- import "../../../../../media-C5fg1Xte.mjs";
10
- import "../../../../../utils-Cpo0_V09.mjs";
11
- import "../../../../../types-iOnPkHRk.mjs";
12
- import "../../../../../index-BauU0yTw.mjs";
13
- import "../../../../../types-DwZgl0Zn.mjs";
14
- import "../../../../../hreflang-Ds0WbBOu.mjs";
15
- import "../../../../../validate-DBfkJa3O.mjs";
1
+ import "../../../../../parse-CBM779p-.mjs";
2
+ import "../../../../../types-8q-gxKfV.mjs";
3
+ import "../../../../../types-YTpIfKXX.mjs";
4
+ import "../../../../../options-CbSYZAwr.mjs";
5
+ import "../../../../../rooms-B2P1xIS_.mjs";
6
+ import "../../../../../config-B27hvMjf.mjs";
7
+ import "../../../../../runner-C6gBIcTD.mjs";
8
+ import "../../../../../storage-query-DdKo8oes.mjs";
9
+ import "../../../../../media-DRDkfiDv.mjs";
10
+ import "../../../../../utils-0R0olFJs.mjs";
11
+ import "../../../../../types-CbfB5YfA.mjs";
12
+ import "../../../../../index-CzbH8FX2.mjs";
13
+ import "../../../../../types-VMZCO8hc.mjs";
14
+ import "../../../../../hreflang-B1E64c5R.mjs";
15
+ import "../../../../../validate-CYHbSQ-M.mjs";
16
16
  import { EmDashHandlers } from "../../../../types.mjs";
17
17
  import { AttachmentInfo } from "./analyze.mjs";
18
18
  import { APIRoute } from "astro";
@@ -1 +1 @@
1
- {"version":3,"file":"media.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/media.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cA2Ba,SAAA;;UAGI,mBAAA;EAChB,IAAA;EACA,OAAA;EACA,KAAA;EACA,QAAA;EACA,MAAA;EACA,KAAA;AAAA;;UAIgB,iBAAA;EAChB,IAAA;EAXgB;EAahB,QAAA,EAAU,KAAA;IACT,IAAA;IACA,WAAA;IACA,MAAA;IACA,OAAA;EAAA;EAbD;EAgBA,MAAA,EAAQ,KAAA;IACP,IAAA;IACA,WAAA;IACA,KAAA;EAAA;EAbgC;EAgBjC,MAAA,EAAQ,MAAA;AAAA;AAAA,cAGI,IAAA,EAAM,QAAA;AAAA,iBAuEG,uBAAA,CACrB,WAAA,EAAa,cAAA,IACb,EAAA,EAAI,WAAA,CAAY,cAAA,SAChB,OAAA,EAAS,WAAA,CAAY,cAAA,cACrB,UAAA,GAAa,QAAA,EAAU,mBAAA,WACvB,iBAAA,aACE,OAAA,CAAQ,iBAAA"}
1
+ {"version":3,"file":"media.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/media.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cA2Ba,SAAA;;UAGI,mBAAA;EAChB,IAAA;EACA,OAAA;EACA,KAAA;EACA,QAAA;EACA,MAAA;EACA,KAAA;AAAA;;UAIgB,iBAAA;EAChB,IAAA;EAXgB;EAahB,QAAA,EAAU,KAAA;IACT,IAAA;IACA,WAAA;IACA,MAAA;IACA,OAAA;EAAA;EAbD;EAgBA,MAAA,EAAQ,KAAA;IACP,IAAA;IACA,WAAA;IACA,KAAA;EAAA;EAbgC;EAgBjC,MAAA,EAAQ,MAAA;AAAA;AAAA,cAGI,IAAA,EAAM,QAAA;AAAA,iBAwEG,uBAAA,CACrB,WAAA,EAAa,cAAA,IACb,EAAA,EAAI,WAAA,CAAY,cAAA,SAChB,OAAA,EAAS,WAAA,CAAY,cAAA,cACrB,UAAA,GAAa,QAAA,EAAU,mBAAA,WACvB,iBAAA,aACE,OAAA,CAAQ,iBAAA"}
@@ -1,10 +1,10 @@
1
1
  import "../../../../../dist-kxThYgdL.mjs";
2
- import { t as enrichImageMetadata } from "../../../../../enrich-BReo_COC.mjs";
3
- import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-DcDNU7hZ.mjs";
4
- import { a as ssrfSafeFetch, s as validateExternalUrl, t as SsrfError } from "../../../../../ssrf-Lj1KZxYt.mjs";
5
- import { n as parseBody, t as isParseError } from "../../../../../parse-B1E5cdyD.mjs";
6
- import { h as wpMediaImportBody } from "../../../../../rooms-CSNLTJsG.mjs";
7
- import { o as requirePerm } from "../../../../../authorize-B-4ogCQG.mjs";
2
+ import { t as enrichImageMetadata } from "../../../../../enrich-C4vKniyi.mjs";
3
+ import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-0Y0dFPxm.mjs";
4
+ import { a as ssrfSafeFetch, s as validateExternalUrl, t as SsrfError } from "../../../../../ssrf-Em0CeaaN.mjs";
5
+ import { n as parseBody, t as isParseError } from "../../../../../parse-BTfkfMuL.mjs";
6
+ import { h as wpMediaImportBody } from "../../../../../rooms-AcO0YNUt.mjs";
7
+ import { o as requirePerm } from "../../../../../authorize-6a0h5NN5.mjs";
8
8
  import { ulid } from "ulidx";
9
9
  import * as path from "node:path";
10
10
  import mime from "mime/lite";
@@ -27,6 +27,7 @@ const POST = async ({ request, locals }) => {
27
27
  if (denied) return denied;
28
28
  if (!emdash?.storage) return apiError("NO_STORAGE", "Storage not configured. Media import requires storage.", 501);
29
29
  if (!emdash?.db) return apiError("NO_DB", "Database not initialized", 500);
30
+ const { storage } = emdash;
30
31
  try {
31
32
  const body = await parseBody(request, wpMediaImportBody);
32
33
  if (isParseError(body)) return body;
@@ -37,7 +38,7 @@ const POST = async ({ request, locals }) => {
37
38
  const sendProgress = (progress) => {
38
39
  controller.enqueue(encoder.encode(JSON.stringify(progress) + "\n"));
39
40
  };
40
- const result = await importMediaWithProgress(attachments, emdash.db, emdash.storage, sendProgress, emdash.config?.imagePlaceholders ?? true);
41
+ const result = await importMediaWithProgress(attachments, emdash.db, storage, sendProgress, emdash.config?.imagePlaceholders ?? true);
41
42
  controller.enqueue(encoder.encode(JSON.stringify({
42
43
  ...result,
43
44
  type: "result"
@@ -53,7 +54,7 @@ const POST = async ({ request, locals }) => {
53
54
  }
54
55
  });
55
56
  }
56
- return apiSuccess(await importMediaWithProgress(attachments, emdash.db, emdash.storage, () => {}, emdash.config?.imagePlaceholders ?? true));
57
+ return apiSuccess(await importMediaWithProgress(attachments, emdash.db, storage, () => {}, emdash.config?.imagePlaceholders ?? true));
57
58
  } catch (error) {
58
59
  return handleError(error, "Failed to import media", "IMPORT_ERROR");
59
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"media.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/media.ts"],"sourcesContent":["/**\n * WordPress media import endpoint\n *\n * POST /_emdash/api/import/wordpress/media\n *\n * Downloads media attachments from WordPress URLs and uploads to EmDash storage.\n * Streams progress updates as newline-delimited JSON (NDJSON).\n * Each line is either a progress update or the final result.\n */\n\nimport * as path from \"node:path\";\n\nimport type { APIRoute } from \"astro\";\nimport { MediaRepository, computeContentHash } from \"emdash\";\nimport mime from \"mime/lite\";\nimport { ulid } from \"ulidx\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpMediaImportBody } from \"#api/schemas.js\";\nimport { validateExternalUrl, ssrfSafeFetch, SsrfError } from \"#import/ssrf.js\";\nimport { enrichImageMetadata } from \"#media/enrich.js\";\nimport type { EmDashHandlers } from \"#types\";\n\nimport type { AttachmentInfo } from \"./analyze.js\";\n\nexport const prerender = false;\n\n/** Progress update sent during streaming */\nexport interface MediaImportProgress {\n\ttype: \"progress\";\n\tcurrent: number;\n\ttotal: number;\n\tfilename?: string;\n\tstatus: \"downloading\" | \"uploading\" | \"done\" | \"skipped\" | \"failed\";\n\terror?: string;\n}\n\n/** Final result sent at end of stream */\nexport interface MediaImportResult {\n\ttype?: \"result\";\n\t/** Successfully imported items */\n\timported: Array<{\n\t\twpId?: number;\n\t\toriginalUrl: string;\n\t\tnewUrl: string;\n\t\tmediaId: string;\n\t}>;\n\t/** Failed items */\n\tfailed: Array<{\n\t\twpId?: number;\n\t\toriginalUrl: string;\n\t\terror: string;\n\t}>;\n\t/** Map of old URLs to new URLs (for content rewriting) */\n\turlMap: Record<string, string>;\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\tif (!emdash?.storage) {\n\t\treturn apiError(\"NO_STORAGE\", \"Storage not configured. Media import requires storage.\", 501);\n\t}\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NO_DB\", \"Database not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst body = await parseBody(request, wpMediaImportBody);\n\t\tif (isParseError(body)) return body;\n\n\t\tconst attachments = body.attachments as AttachmentInfo[];\n\n\t\t// Check if streaming is requested (default: true)\n\t\tconst shouldStream = body.stream !== false;\n\n\t\tif (shouldStream) {\n\t\t\t// Stream progress updates as NDJSON\n\t\t\tconst stream = new ReadableStream({\n\t\t\t\tasync start(controller) {\n\t\t\t\t\tconst encoder = new TextEncoder();\n\t\t\t\t\tconst sendProgress = (progress: MediaImportProgress) => {\n\t\t\t\t\t\tcontroller.enqueue(encoder.encode(JSON.stringify(progress) + \"\\n\"));\n\t\t\t\t\t};\n\n\t\t\t\t\tconst result = await importMediaWithProgress(\n\t\t\t\t\t\tattachments,\n\t\t\t\t\t\temdash.db,\n\t\t\t\t\t\temdash.storage,\n\t\t\t\t\t\tsendProgress,\n\t\t\t\t\t\temdash.config?.imagePlaceholders ?? true,\n\t\t\t\t\t);\n\n\t\t\t\t\t// Send final result\n\t\t\t\t\tcontroller.enqueue(encoder.encode(JSON.stringify({ ...result, type: \"result\" }) + \"\\n\"));\n\t\t\t\t\tcontroller.close();\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn new Response(stream, {\n\t\t\t\tstatus: 200,\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\": \"application/x-ndjson\",\n\t\t\t\t\t\"Cache-Control\": \"private, no-store\",\n\t\t\t\t\t\"Transfer-Encoding\": \"chunked\",\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Non-streaming mode\n\t\tconst result = await importMediaWithProgress(\n\t\t\tattachments,\n\t\t\temdash.db,\n\t\t\temdash.storage,\n\t\t\t() => {}, // No-op progress callback\n\t\t\temdash.config?.imagePlaceholders ?? true,\n\t\t);\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to import media\", \"IMPORT_ERROR\");\n\t}\n};\n\nexport async function importMediaWithProgress(\n\tattachments: AttachmentInfo[],\n\tdb: NonNullable<EmDashHandlers[\"db\"]>,\n\tstorage: NonNullable<EmDashHandlers[\"storage\"]>,\n\tonProgress: (progress: MediaImportProgress) => void,\n\timagePlaceholders = true,\n): Promise<MediaImportResult> {\n\tconst repo = new MediaRepository(db);\n\tconst total = attachments.length;\n\n\tconst result: MediaImportResult = {\n\t\timported: [],\n\t\tfailed: [],\n\t\turlMap: {},\n\t};\n\n\tfor (let i = 0; i < attachments.length; i++) {\n\t\tconst attachment = attachments[i];\n\t\tconst current = i + 1;\n\t\tconst filename = attachment.filename || `file-${attachment.id}`;\n\n\t\tif (!attachment.url) {\n\t\t\tresult.failed.push({\n\t\t\t\twpId: attachment.id,\n\t\t\t\toriginalUrl: \"\",\n\t\t\t\terror: \"No URL provided\",\n\t\t\t});\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: \"No URL provided\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// SSRF: validate URL before fetching\n\t\t\ttry {\n\t\t\t\tvalidateExternalUrl(attachment.url);\n\t\t\t} catch (e) {\n\t\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\t\tresult.failed.push({\n\t\t\t\t\twpId: attachment.id,\n\t\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\t\terror: `Blocked: ${msg}`,\n\t\t\t\t});\n\t\t\t\tonProgress({\n\t\t\t\t\ttype: \"progress\",\n\t\t\t\t\tcurrent,\n\t\t\t\t\ttotal,\n\t\t\t\t\tfilename,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\terror: `Blocked: ${msg}`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Report downloading\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"downloading\",\n\t\t\t});\n\n\t\t\t// Download from WordPress (ssrfSafeFetch re-validates redirect targets)\n\t\t\tconst response = await ssrfSafeFetch(attachment.url, {\n\t\t\t\theaders: {\n\t\t\t\t\t\"User-Agent\": \"EmDash-Importer/1.0\",\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (!response.ok) {\n\t\t\t\tresult.failed.push({\n\t\t\t\t\twpId: attachment.id,\n\t\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\t\terror: `HTTP ${response.status}: ${response.statusText}`,\n\t\t\t\t});\n\t\t\t\tonProgress({\n\t\t\t\t\ttype: \"progress\",\n\t\t\t\t\tcurrent,\n\t\t\t\t\ttotal,\n\t\t\t\t\tfilename,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\terror: `HTTP ${response.status}`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get content type from response or guess from filename\n\t\t\tconst contentType =\n\t\t\t\tresponse.headers.get(\"content-type\") || attachment.mimeType || \"application/octet-stream\";\n\n\t\t\t// Get the file data\n\t\t\tconst buffer = await response.arrayBuffer();\n\t\t\tconst size = buffer.byteLength;\n\n\t\t\t// Compute content hash for deduplication\n\t\t\tconst contentHash = await computeContentHash(buffer);\n\n\t\t\t// Check if we already have this exact content\n\t\t\tconst existing = await repo.findByContentHash(contentHash);\n\t\t\tif (existing) {\n\t\t\t\t// Same content already exists - reuse it\n\t\t\t\tconst existingUrl = `/_emdash/api/media/file/${existing.storageKey}`;\n\t\t\t\tresult.urlMap[attachment.url] = existingUrl;\n\t\t\t\tresult.imported.push({\n\t\t\t\t\twpId: attachment.id,\n\t\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\t\tnewUrl: existingUrl,\n\t\t\t\t\tmediaId: existing.id,\n\t\t\t\t});\n\t\t\t\tonProgress({\n\t\t\t\t\ttype: \"progress\",\n\t\t\t\t\tcurrent,\n\t\t\t\t\ttotal,\n\t\t\t\t\tfilename,\n\t\t\t\t\tstatus: \"skipped\",\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Report uploading\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"uploading\",\n\t\t\t});\n\n\t\t\t// Generate storage key\n\t\t\tconst id = ulid();\n\t\t\tconst ext = attachment.filename\n\t\t\t\t? path.extname(attachment.filename)\n\t\t\t\t: getExtensionFromMimeType(contentType);\n\t\t\tconst storageKey = `${id}${ext}`;\n\n\t\t\t// Upload to storage\n\t\t\tawait storage.upload({\n\t\t\t\tkey: storageKey,\n\t\t\t\tbody: new Uint8Array(buffer),\n\t\t\t\tcontentType,\n\t\t\t});\n\n\t\t\t// Derive dimensions + LQIP placeholders (no-op for non-images).\n\t\t\tconst enriched = await enrichImageMetadata(new Uint8Array(buffer), contentType, {\n\t\t\t\tplaceholders: imagePlaceholders,\n\t\t\t});\n\n\t\t\t// Create media record with content hash\n\t\t\tconst mediaItem = await repo.create({\n\t\t\t\tfilename: attachment.filename || `media-${attachment.id}${ext}`,\n\t\t\t\tmimeType: contentType,\n\t\t\t\tsize,\n\t\t\t\tstorageKey,\n\t\t\t\tcontentHash,\n\t\t\t\twidth: enriched.width,\n\t\t\t\theight: enriched.height,\n\t\t\t\tblurhash: enriched.blurhash,\n\t\t\t\tdominantColor: enriched.dominantColor,\n\t\t\t});\n\n\t\t\t// Build the new URL\n\t\t\tconst newUrl = `/_emdash/api/media/file/${storageKey}`;\n\n\t\t\tresult.imported.push({\n\t\t\t\twpId: attachment.id,\n\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\tnewUrl,\n\t\t\t\tmediaId: mediaItem.id,\n\t\t\t});\n\n\t\t\t// Add to URL map\n\t\t\tresult.urlMap[attachment.url] = newUrl;\n\n\t\t\t// Report done\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"done\",\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error(`Media import error for \"${filename}\":`, error);\n\t\t\tconst errorMsg = \"Failed to import media\";\n\t\t\tresult.failed.push({\n\t\t\t\twpId: attachment.id,\n\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\terror: errorMsg,\n\t\t\t});\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: errorMsg,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction getExtensionFromMimeType(mimeType: string): string {\n\tconst ext = mime.getExtension(mimeType);\n\treturn ext ? `.${ext}` : \"\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,YAAY;AAgCzB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AA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Q"}
1
+ {"version":3,"file":"media.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/media.ts"],"sourcesContent":["/**\n * WordPress media import endpoint\n *\n * POST /_emdash/api/import/wordpress/media\n *\n * Downloads media attachments from WordPress URLs and uploads to EmDash storage.\n * Streams progress updates as newline-delimited JSON (NDJSON).\n * Each line is either a progress update or the final result.\n */\n\nimport * as path from \"node:path\";\n\nimport type { APIRoute } from \"astro\";\nimport { MediaRepository, computeContentHash } from \"emdash\";\nimport mime from \"mime/lite\";\nimport { ulid } from \"ulidx\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpMediaImportBody } from \"#api/schemas.js\";\nimport { validateExternalUrl, ssrfSafeFetch, SsrfError } from \"#import/ssrf.js\";\nimport { enrichImageMetadata } from \"#media/enrich.js\";\nimport type { EmDashHandlers } from \"#types\";\n\nimport type { AttachmentInfo } from \"./analyze.js\";\n\nexport const prerender = false;\n\n/** Progress update sent during streaming */\nexport interface MediaImportProgress {\n\ttype: \"progress\";\n\tcurrent: number;\n\ttotal: number;\n\tfilename?: string;\n\tstatus: \"downloading\" | \"uploading\" | \"done\" | \"skipped\" | \"failed\";\n\terror?: string;\n}\n\n/** Final result sent at end of stream */\nexport interface MediaImportResult {\n\ttype?: \"result\";\n\t/** Successfully imported items */\n\timported: Array<{\n\t\twpId?: number;\n\t\toriginalUrl: string;\n\t\tnewUrl: string;\n\t\tmediaId: string;\n\t}>;\n\t/** Failed items */\n\tfailed: Array<{\n\t\twpId?: number;\n\t\toriginalUrl: string;\n\t\terror: string;\n\t}>;\n\t/** Map of old URLs to new URLs (for content rewriting) */\n\turlMap: Record<string, string>;\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\tif (!emdash?.storage) {\n\t\treturn apiError(\"NO_STORAGE\", \"Storage not configured. Media import requires storage.\", 501);\n\t}\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NO_DB\", \"Database not initialized\", 500);\n\t}\n\tconst { storage } = emdash;\n\n\ttry {\n\t\tconst body = await parseBody(request, wpMediaImportBody);\n\t\tif (isParseError(body)) return body;\n\n\t\tconst attachments = body.attachments as AttachmentInfo[];\n\n\t\t// Check if streaming is requested (default: true)\n\t\tconst shouldStream = body.stream !== false;\n\n\t\tif (shouldStream) {\n\t\t\t// Stream progress updates as NDJSON\n\t\t\tconst stream = new ReadableStream({\n\t\t\t\tasync start(controller) {\n\t\t\t\t\tconst encoder = new TextEncoder();\n\t\t\t\t\tconst sendProgress = (progress: MediaImportProgress) => {\n\t\t\t\t\t\tcontroller.enqueue(encoder.encode(JSON.stringify(progress) + \"\\n\"));\n\t\t\t\t\t};\n\n\t\t\t\t\tconst result = await importMediaWithProgress(\n\t\t\t\t\t\tattachments,\n\t\t\t\t\t\temdash.db,\n\t\t\t\t\t\tstorage,\n\t\t\t\t\t\tsendProgress,\n\t\t\t\t\t\temdash.config?.imagePlaceholders ?? true,\n\t\t\t\t\t);\n\n\t\t\t\t\t// Send final result\n\t\t\t\t\tcontroller.enqueue(encoder.encode(JSON.stringify({ ...result, type: \"result\" }) + \"\\n\"));\n\t\t\t\t\tcontroller.close();\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn new Response(stream, {\n\t\t\t\tstatus: 200,\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\": \"application/x-ndjson\",\n\t\t\t\t\t\"Cache-Control\": \"private, no-store\",\n\t\t\t\t\t\"Transfer-Encoding\": \"chunked\",\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Non-streaming mode\n\t\tconst result = await importMediaWithProgress(\n\t\t\tattachments,\n\t\t\temdash.db,\n\t\t\tstorage,\n\t\t\t() => {}, // No-op progress callback\n\t\t\temdash.config?.imagePlaceholders ?? true,\n\t\t);\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to import media\", \"IMPORT_ERROR\");\n\t}\n};\n\nexport async function importMediaWithProgress(\n\tattachments: AttachmentInfo[],\n\tdb: NonNullable<EmDashHandlers[\"db\"]>,\n\tstorage: NonNullable<EmDashHandlers[\"storage\"]>,\n\tonProgress: (progress: MediaImportProgress) => void,\n\timagePlaceholders = true,\n): Promise<MediaImportResult> {\n\tconst repo = new MediaRepository(db);\n\tconst total = attachments.length;\n\n\tconst result: MediaImportResult = {\n\t\timported: [],\n\t\tfailed: [],\n\t\turlMap: {},\n\t};\n\n\tfor (let i = 0; i < attachments.length; i++) {\n\t\tconst attachment = attachments[i];\n\t\tconst current = i + 1;\n\t\tconst filename = attachment.filename || `file-${attachment.id}`;\n\n\t\tif (!attachment.url) {\n\t\t\tresult.failed.push({\n\t\t\t\twpId: attachment.id,\n\t\t\t\toriginalUrl: \"\",\n\t\t\t\terror: \"No URL provided\",\n\t\t\t});\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: \"No URL provided\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// SSRF: validate URL before fetching\n\t\t\ttry {\n\t\t\t\tvalidateExternalUrl(attachment.url);\n\t\t\t} catch (e) {\n\t\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\t\tresult.failed.push({\n\t\t\t\t\twpId: attachment.id,\n\t\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\t\terror: `Blocked: ${msg}`,\n\t\t\t\t});\n\t\t\t\tonProgress({\n\t\t\t\t\ttype: \"progress\",\n\t\t\t\t\tcurrent,\n\t\t\t\t\ttotal,\n\t\t\t\t\tfilename,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\terror: `Blocked: ${msg}`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Report downloading\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"downloading\",\n\t\t\t});\n\n\t\t\t// Download from WordPress (ssrfSafeFetch re-validates redirect targets)\n\t\t\tconst response = await ssrfSafeFetch(attachment.url, {\n\t\t\t\theaders: {\n\t\t\t\t\t\"User-Agent\": \"EmDash-Importer/1.0\",\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (!response.ok) {\n\t\t\t\tresult.failed.push({\n\t\t\t\t\twpId: attachment.id,\n\t\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\t\terror: `HTTP ${response.status}: ${response.statusText}`,\n\t\t\t\t});\n\t\t\t\tonProgress({\n\t\t\t\t\ttype: \"progress\",\n\t\t\t\t\tcurrent,\n\t\t\t\t\ttotal,\n\t\t\t\t\tfilename,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\terror: `HTTP ${response.status}`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get content type from response or guess from filename\n\t\t\tconst contentType =\n\t\t\t\tresponse.headers.get(\"content-type\") || attachment.mimeType || \"application/octet-stream\";\n\n\t\t\t// Get the file data\n\t\t\tconst buffer = await response.arrayBuffer();\n\t\t\tconst size = buffer.byteLength;\n\n\t\t\t// Compute content hash for deduplication\n\t\t\tconst contentHash = await computeContentHash(buffer);\n\n\t\t\t// Check if we already have this exact content\n\t\t\tconst existing = await repo.findByContentHash(contentHash);\n\t\t\tif (existing) {\n\t\t\t\t// Same content already exists - reuse it\n\t\t\t\tconst existingUrl = `/_emdash/api/media/file/${existing.storageKey}`;\n\t\t\t\tresult.urlMap[attachment.url] = existingUrl;\n\t\t\t\tresult.imported.push({\n\t\t\t\t\twpId: attachment.id,\n\t\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\t\tnewUrl: existingUrl,\n\t\t\t\t\tmediaId: existing.id,\n\t\t\t\t});\n\t\t\t\tonProgress({\n\t\t\t\t\ttype: \"progress\",\n\t\t\t\t\tcurrent,\n\t\t\t\t\ttotal,\n\t\t\t\t\tfilename,\n\t\t\t\t\tstatus: \"skipped\",\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Report uploading\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"uploading\",\n\t\t\t});\n\n\t\t\t// Generate storage key\n\t\t\tconst id = ulid();\n\t\t\tconst ext = attachment.filename\n\t\t\t\t? path.extname(attachment.filename)\n\t\t\t\t: getExtensionFromMimeType(contentType);\n\t\t\tconst storageKey = `${id}${ext}`;\n\n\t\t\t// Upload to storage\n\t\t\tawait storage.upload({\n\t\t\t\tkey: storageKey,\n\t\t\t\tbody: new Uint8Array(buffer),\n\t\t\t\tcontentType,\n\t\t\t});\n\n\t\t\t// Derive dimensions + LQIP placeholders (no-op for non-images).\n\t\t\tconst enriched = await enrichImageMetadata(new Uint8Array(buffer), contentType, {\n\t\t\t\tplaceholders: imagePlaceholders,\n\t\t\t});\n\n\t\t\t// Create media record with content hash\n\t\t\tconst mediaItem = await repo.create({\n\t\t\t\tfilename: attachment.filename || `media-${attachment.id}${ext}`,\n\t\t\t\tmimeType: contentType,\n\t\t\t\tsize,\n\t\t\t\tstorageKey,\n\t\t\t\tcontentHash,\n\t\t\t\twidth: enriched.width,\n\t\t\t\theight: enriched.height,\n\t\t\t\tblurhash: enriched.blurhash,\n\t\t\t\tdominantColor: enriched.dominantColor,\n\t\t\t});\n\n\t\t\t// Build the new URL\n\t\t\tconst newUrl = `/_emdash/api/media/file/${storageKey}`;\n\n\t\t\tresult.imported.push({\n\t\t\t\twpId: attachment.id,\n\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\tnewUrl,\n\t\t\t\tmediaId: mediaItem.id,\n\t\t\t});\n\n\t\t\t// Add to URL map\n\t\t\tresult.urlMap[attachment.url] = newUrl;\n\n\t\t\t// Report done\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"done\",\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error(`Media import error for \"${filename}\":`, error);\n\t\t\tconst errorMsg = \"Failed to import media\";\n\t\t\tresult.failed.push({\n\t\t\t\twpId: attachment.id,\n\t\t\t\toriginalUrl: attachment.url,\n\t\t\t\terror: errorMsg,\n\t\t\t});\n\t\t\tonProgress({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tcurrent,\n\t\t\t\ttotal,\n\t\t\t\tfilename,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: errorMsg,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction getExtensionFromMimeType(mimeType: string): string {\n\tconst ext = mime.getExtension(mimeType);\n\treturn ext ? `.${ext}` : \"\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,YAAY;AAgCzB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,QAAQ,QACZ,QAAO,SAAS,cAAc,0DAA0D,IAAI;AAG7F,KAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,SAAS,4BAA4B,IAAI;CAE1D,MAAM,EAAE,YAAY;AAEpB,KAAI;EACH,MAAM,OAAO,MAAM,UAAU,SAAS,kBAAkB;AACxD,MAAI,aAAa,KAAK,CAAE,QAAO;EAE/B,MAAM,cAAc,KAAK;AAKzB,MAFqB,KAAK,WAAW,OAEnB;GAEjB,MAAM,SAAS,IAAI,eAAe,EACjC,MAAM,MAAM,YA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;IACpB,KAAK;IACL,MAAM,IAAI,WAAW,OAAO;IAC5B;IACA,CAAC;GAGF,MAAM,WAAW,MAAM,oBAAoB,IAAI,WAAW,OAAO,EAAE,aAAa,EAC/E,cAAc,mBACd,CAAC;GAGF,MAAM,YAAY,MAAM,KAAK,OAAO;IACnC,UAAU,WAAW,YAAY,SAAS,WAAW,KAAK;IAC1D,UAAU;IACV;IACA;IACA;IACA,OAAO,SAAS;IAChB,QAAQ,SAAS;IACjB,UAAU,SAAS;IACnB,eAAe,SAAS;IACxB,CAAC;GAGF,MAAM,SAAS,2BAA2B;AAE1C,UAAO,SAAS,KAAK;IACpB,MAAM,WAAW;IACjB,aAAa,WAAW;IACxB;IACA,SAAS,UAAU;IACnB,CAAC;AAGF,UAAO,OAAO,WAAW,OAAO;AAGhC,cAAW;IACV,MAAM;IACN;IACA;IACA;IACA,QAAQ;IACR,CAAC;WACM,OAAO;AACf,WAAQ,MAAM,2BAA2B,SAAS,KAAK,MAAM;GAC7D,MAAM,WAAW;AACjB,UAAO,OAAO,KAAK;IAClB,MAAM,WAAW;IACjB,aAAa,WAAW;IACxB,OAAO;IACP,CAAC;AACF,cAAW;IACV,MAAM;IACN;IACA;IACA;IACA,QAAQ;IACR,OAAO;IACP,CAAC;;;AAIJ,QAAO;;AAGR,SAAS,yBAAyB,UAA0B;CAC3D,MAAM,MAAM,KAAK,aAAa,SAAS;AACvC,QAAO,MAAM,IAAI,QAAQ"}
@@ -1,9 +1,9 @@
1
1
  import { n as FIELD_TYPES } from "../../../../../types-BmBK2cqf.mjs";
2
- import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-DcDNU7hZ.mjs";
3
- import { n as parseBody, t as isParseError } from "../../../../../parse-B1E5cdyD.mjs";
4
- import { v as wpPrepareBody } from "../../../../../rooms-CSNLTJsG.mjs";
5
- import { y as sanitizeCollectionSlug } from "../../../../../utils-DMDmdhU3.mjs";
6
- import { o as requirePerm } from "../../../../../authorize-B-4ogCQG.mjs";
2
+ import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-0Y0dFPxm.mjs";
3
+ import { n as parseBody, t as isParseError } from "../../../../../parse-BTfkfMuL.mjs";
4
+ import { v as wpPrepareBody } from "../../../../../rooms-AcO0YNUt.mjs";
5
+ import { y as sanitizeCollectionSlug } from "../../../../../utils-DIfKXQ5o.mjs";
6
+ import { o as requirePerm } from "../../../../../authorize-6a0h5NN5.mjs";
7
7
  import { capitalize, singularize } from "./analyze.mjs";
8
8
 
9
9
  //#region src/astro/routes/api/import/wordpress/prepare.ts
@@ -28,7 +28,7 @@ const POST = async ({ request, locals }) => {
28
28
  }
29
29
  };
30
30
  async function prepareImport(db, request) {
31
- const { SchemaRegistry } = await import("../../../../../registry-CDzYrAFY.mjs").then((n) => n.r);
31
+ const { SchemaRegistry } = await import("../../../../../registry-CSLrHSx1.mjs").then((n) => n.r);
32
32
  const registry = new SchemaRegistry(db);
33
33
  const result = {
34
34
  success: true,
@@ -94,7 +94,7 @@ async function prepareImport(db, request) {
94
94
  "post",
95
95
  "page"
96
96
  ].includes(collectionSlug)) {
97
- const { FTSManager } = await import("../../../../../fts-manager-B3iLXCGz.mjs").then((n) => n.n);
97
+ const { FTSManager } = await import("../../../../../fts-manager-m8GPxogO.mjs").then((n) => n.n);
98
98
  const ftsManager = new FTSManager(db);
99
99
  if ((await ftsManager.getSearchableFields(collectionSlug)).length > 0) try {
100
100
  await ftsManager.enableSearch(collectionSlug);
@@ -1,19 +1,19 @@
1
- import "../../../../../parse-Clt6wmpy.mjs";
2
- import "../../../../../types-CG1dR_Cm.mjs";
3
- import "../../../../../types-CImd8MBY.mjs";
4
- import "../../../../../options-BJZMHnpx.mjs";
5
- import "../../../../../rooms-CyXG83RZ.mjs";
6
- import { f as MediaProvider } from "../../../../../placeholder-B0vI-EQ9.mjs";
7
- import { Si as markContentMediaUsageCollectionStaleSafely } from "../../../../../config-B4F2ttAZ.mjs";
8
- import "../../../../../runner-CAHS_KER.mjs";
9
- import "../../../../../storage-query-BDUX3Cef.mjs";
10
- import "../../../../../media-C5fg1Xte.mjs";
11
- import "../../../../../utils-Cpo0_V09.mjs";
12
- import "../../../../../types-iOnPkHRk.mjs";
13
- import "../../../../../index-BauU0yTw.mjs";
14
- import "../../../../../types-DwZgl0Zn.mjs";
15
- import "../../../../../hreflang-Ds0WbBOu.mjs";
16
- import "../../../../../validate-DBfkJa3O.mjs";
1
+ import "../../../../../parse-CBM779p-.mjs";
2
+ import "../../../../../types-8q-gxKfV.mjs";
3
+ import "../../../../../types-YTpIfKXX.mjs";
4
+ import "../../../../../options-CbSYZAwr.mjs";
5
+ import "../../../../../rooms-B2P1xIS_.mjs";
6
+ import { wi as markContentMediaUsageCollectionStaleSafely } from "../../../../../config-B27hvMjf.mjs";
7
+ import "../../../../../runner-C6gBIcTD.mjs";
8
+ import "../../../../../storage-query-DdKo8oes.mjs";
9
+ import "../../../../../media-DRDkfiDv.mjs";
10
+ import "../../../../../utils-0R0olFJs.mjs";
11
+ import { f as MediaProvider } from "../../../../../placeholder-PFMxMYTa.mjs";
12
+ import "../../../../../types-CbfB5YfA.mjs";
13
+ import "../../../../../index-CzbH8FX2.mjs";
14
+ import "../../../../../types-VMZCO8hc.mjs";
15
+ import "../../../../../hreflang-B1E64c5R.mjs";
16
+ import "../../../../../validate-CYHbSQ-M.mjs";
17
17
  import { EmDashHandlers } from "../../../../types.mjs";
18
18
  import { APIRoute } from "astro";
19
19
 
@@ -1,10 +1,10 @@
1
1
  import { t as validateIdentifier } from "../../../../../validate-DANX1-Qi.mjs";
2
2
  import { n as normalizeMediaValue } from "../../../../../normalize-qcU0SKGf.mjs";
3
- import { W as markContentMediaUsageCollectionStaleSafely } from "../../../../../registry-CDzYrAFY.mjs";
4
- import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-DcDNU7hZ.mjs";
5
- import { n as parseBody, t as isParseError } from "../../../../../parse-B1E5cdyD.mjs";
6
- import { y as wpRewriteUrlsBody } from "../../../../../rooms-CSNLTJsG.mjs";
7
- import { o as requirePerm } from "../../../../../authorize-B-4ogCQG.mjs";
3
+ import { W as markContentMediaUsageCollectionStaleSafely } from "../../../../../registry-CSLrHSx1.mjs";
4
+ import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-0Y0dFPxm.mjs";
5
+ import { n as parseBody, t as isParseError } from "../../../../../parse-BTfkfMuL.mjs";
6
+ import { y as wpRewriteUrlsBody } from "../../../../../rooms-AcO0YNUt.mjs";
7
+ import { o as requirePerm } from "../../../../../authorize-6a0h5NN5.mjs";
8
8
  import { buildBaseUrlMap, extractMediaUrl, findMatchingUrl, rewritePortableTextUrls, rewriteStringUrls } from "./rewrite-url-helpers.mjs";
9
9
  import { sql } from "kysely";
10
10
 
@@ -31,7 +31,7 @@ const POST = async ({ request, locals }) => {
31
31
  }
32
32
  };
33
33
  async function rewriteUrls(db, urlMap, getProvider, collections, markUsageCollectionStale = markContentMediaUsageCollectionStaleSafely) {
34
- const { SchemaRegistry } = await import("../../../../../registry-CDzYrAFY.mjs").then((n) => n.r);
34
+ const { SchemaRegistry } = await import("../../../../../registry-CSLrHSx1.mjs").then((n) => n.r);
35
35
  const registry = new SchemaRegistry(db);
36
36
  const result = {
37
37
  updated: 0,
@@ -1,4 +1,4 @@
1
- import { o as ImportAnalysis } from "../../../../../types-DwZgl0Zn.mjs";
1
+ import { o as ImportAnalysis } from "../../../../../types-VMZCO8hc.mjs";
2
2
  import { APIRoute } from "astro";
3
3
 
4
4
  //#region src/astro/routes/api/import/wordpress-plugin/analyze.d.ts
@@ -1,9 +1,9 @@
1
- import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-DcDNU7hZ.mjs";
2
- import { r as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-Lj1KZxYt.mjs";
3
- import { n as parseBody, t as isParseError } from "../../../../../parse-B1E5cdyD.mjs";
4
- import { g as wpPluginAnalyzeBody } from "../../../../../rooms-CSNLTJsG.mjs";
5
- import { a as getSource, t as SiteChallengeError } from "../../../../../registry-mZi_lxtT.mjs";
6
- import { o as requirePerm } from "../../../../../authorize-B-4ogCQG.mjs";
1
+ import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-0Y0dFPxm.mjs";
2
+ import { r as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-Em0CeaaN.mjs";
3
+ import { n as parseBody, t as isParseError } from "../../../../../parse-BTfkfMuL.mjs";
4
+ import { g as wpPluginAnalyzeBody } from "../../../../../rooms-AcO0YNUt.mjs";
5
+ import { a as getSource, t as SiteChallengeError } from "../../../../../registry-2vAYgqCz.mjs";
6
+ import { o as requirePerm } from "../../../../../authorize-6a0h5NN5.mjs";
7
7
  import { SchemaRegistry } from "emdash";
8
8
 
9
9
  //#region src/astro/routes/api/import/wordpress-plugin/analyze.ts
@@ -1,20 +1,20 @@
1
- import "../../../../../parse-Clt6wmpy.mjs";
2
- import "../../../../../types-CG1dR_Cm.mjs";
3
- import "../../../../../types-CImd8MBY.mjs";
4
- import "../../../../../options-BJZMHnpx.mjs";
5
- import "../../../../../rooms-CyXG83RZ.mjs";
6
- import "../../../../../config-B4F2ttAZ.mjs";
7
- import "../../../../../runner-CAHS_KER.mjs";
8
- import "../../../../../storage-query-BDUX3Cef.mjs";
9
- import "../../../../../media-C5fg1Xte.mjs";
10
- import "../../../../../utils-Cpo0_V09.mjs";
11
- import "../../../../../types-iOnPkHRk.mjs";
12
- import { t as fetchPluginTaxonomies } from "../../../../../index-BauU0yTw.mjs";
13
- import { p as NormalizedItem, s as ImportConfig, u as ImportResult } from "../../../../../types-DwZgl0Zn.mjs";
14
- import "../../../../../hreflang-Ds0WbBOu.mjs";
15
- import "../../../../../validate-DBfkJa3O.mjs";
1
+ import "../../../../../parse-CBM779p-.mjs";
2
+ import "../../../../../types-8q-gxKfV.mjs";
3
+ import "../../../../../types-YTpIfKXX.mjs";
4
+ import "../../../../../options-CbSYZAwr.mjs";
5
+ import "../../../../../rooms-B2P1xIS_.mjs";
6
+ import "../../../../../config-B27hvMjf.mjs";
7
+ import "../../../../../runner-C6gBIcTD.mjs";
8
+ import "../../../../../storage-query-DdKo8oes.mjs";
9
+ import "../../../../../media-DRDkfiDv.mjs";
10
+ import "../../../../../utils-0R0olFJs.mjs";
11
+ import "../../../../../types-CbfB5YfA.mjs";
12
+ import { t as fetchPluginTaxonomies } from "../../../../../index-CzbH8FX2.mjs";
13
+ import { p as NormalizedItem, s as ImportConfig, u as ImportResult } from "../../../../../types-VMZCO8hc.mjs";
14
+ import "../../../../../hreflang-B1E64c5R.mjs";
15
+ import "../../../../../validate-CYHbSQ-M.mjs";
16
16
  import { EmDashHandlers, EmDashManifest } from "../../../../types.mjs";
17
- import { t as TaxonomyImportPlan } from "../../../../../wxr-taxonomies-CyP2k4-Q.mjs";
17
+ import { t as TaxonomyImportPlan } from "../../../../../wxr-taxonomies-uZgPVgPe.mjs";
18
18
  import { APIRoute } from "astro";
19
19
 
20
20
  //#region src/astro/routes/api/import/wordpress-plugin/execute.d.ts
@@ -1,18 +1,18 @@
1
1
  import { t as OptionsRepository } from "../../../../../options-CMocxAku.mjs";
2
- import { f as invalidateCommentObjectCache } from "../../../../../object-cache-DeATK4vw.mjs";
2
+ import { f as invalidateCommentObjectCache } from "../../../../../object-cache-I4Re7BOR.mjs";
3
3
  import { n as slugify } from "../../../../../slugify-sxuydlHd.mjs";
4
- import { t as BylineRepository } from "../../../../../byline--sweE_MZ.mjs";
4
+ import { t as BylineRepository } from "../../../../../byline-BufjxQyd.mjs";
5
5
  import "../../../../../dist-kxThYgdL.mjs";
6
- import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-DcDNU7hZ.mjs";
7
- import { c as invalidateSiteSettingsCache } from "../../../../../settings-BTkGl-bX.mjs";
8
- import { t as handleTaxonomyCreate } from "../../../../../taxonomies-ClkYcmcH.mjs";
9
- import { r as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-Lj1KZxYt.mjs";
10
- import { n as parseBody, t as isParseError } from "../../../../../parse-B1E5cdyD.mjs";
11
- import { _ as wpPluginExecuteBody } from "../../../../../rooms-CSNLTJsG.mjs";
12
- import { b as sanitizeFieldSlug, v as resolveImportByline, y as sanitizeCollectionSlug } from "../../../../../utils-DMDmdhU3.mjs";
13
- import { a as preImportWxrTaxonomies, r as loadTaxonomyPlanFromDb, s as importMenusFromPlugin, t as attachPostTaxonomies } from "../../../../../wxr-taxonomies-B0U2fJgs.mjs";
14
- import { a as getSource, d as fetchPluginCommentsPage, f as fetchPluginContentPage, h as fetchPluginTaxonomies, m as fetchPluginOptions, p as fetchPluginMenus, t as SiteChallengeError, u as fetchPluginComments } from "../../../../../registry-mZi_lxtT.mjs";
15
- import { o as requirePerm } from "../../../../../authorize-B-4ogCQG.mjs";
6
+ import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-0Y0dFPxm.mjs";
7
+ import { c as invalidateSiteSettingsCache } from "../../../../../settings-BApLX_aS.mjs";
8
+ import { t as handleTaxonomyCreate } from "../../../../../taxonomies-D5bavOHA.mjs";
9
+ import { r as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-Em0CeaaN.mjs";
10
+ import { n as parseBody, t as isParseError } from "../../../../../parse-BTfkfMuL.mjs";
11
+ import { _ as wpPluginExecuteBody } from "../../../../../rooms-AcO0YNUt.mjs";
12
+ import { b as sanitizeFieldSlug, v as resolveImportByline, y as sanitizeCollectionSlug } from "../../../../../utils-DIfKXQ5o.mjs";
13
+ import { a as preImportWxrTaxonomies, r as loadTaxonomyPlanFromDb, s as importMenusFromPlugin, t as attachPostTaxonomies } from "../../../../../wxr-taxonomies-fliLjgKD.mjs";
14
+ import { a as getSource, d as fetchPluginCommentsPage, f as fetchPluginContentPage, h as fetchPluginTaxonomies, m as fetchPluginOptions, p as fetchPluginMenus, t as SiteChallengeError, u as fetchPluginComments } from "../../../../../registry-2vAYgqCz.mjs";
15
+ import { o as requirePerm } from "../../../../../authorize-6a0h5NN5.mjs";
16
16
  import { importMediaWithProgress } from "../wordpress/media.mjs";
17
17
  import { ulid } from "ulidx";
18
18
  import { ContentRepository, SchemaRegistry } from "emdash";
@@ -843,7 +843,7 @@ async function importContent(items, config, emdash, manifest, taxonomyPlan, seed
843
843
  }
844
844
  } else result.errors.push({
845
845
  title: item.title || "Untitled",
846
- error: typeof createResult.error === "object" && createResult.error !== null ? createResult.error.message || "Unknown error" : String(createResult.error)
846
+ error: createResult.error.message || "Unknown error"
847
847
  });
848
848
  } catch (error) {
849
849
  console.error(`Import error for "${item.title || "Untitled"}":`, error);