dineway 0.1.49 → 0.2.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 (418) hide show
  1. package/dist/{activity-events-CwM7yxPW.mjs → activity-events-y6eT8UW6.mjs} +6 -38
  2. package/dist/actor-CrObAPV0.mjs +37 -0
  3. package/dist/after-BfniwgIf.mjs +9 -0
  4. package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins-_oeyP6x-.mjs} +1 -1
  5. package/dist/api/route-utils.d.mts +10 -10
  6. package/dist/api/route-utils.mjs +16 -13
  7. package/dist/api/schemas/index.d.mts +2 -2
  8. package/dist/api/schemas/index.mjs +5 -4
  9. package/dist/{api-BMIxRIEN.mjs → api-ByrU2q-Z.mjs} +60 -36
  10. package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-CjVMQT-X.mjs} +6 -2
  11. package/dist/{apply-D_RlTYtC.mjs → apply-bZswmZPm.mjs} +117 -77
  12. package/dist/astro/image-endpoint.d.mts +7 -0
  13. package/dist/astro/image-endpoint.mjs +54 -0
  14. package/dist/astro/index.d.mts +35 -11
  15. package/dist/astro/index.mjs +157 -23
  16. package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
  17. package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
  18. package/dist/astro/middleware/auth.d.mts +10 -10
  19. package/dist/astro/middleware/auth.mjs +42 -24
  20. package/dist/astro/middleware/redirect.mjs +13 -4
  21. package/dist/astro/middleware/request-context.mjs +8 -5
  22. package/dist/astro/middleware/seed.d.mts +1 -1
  23. package/dist/astro/middleware/seed.mjs +2 -2
  24. package/dist/astro/middleware/setup.mjs +1 -1
  25. package/dist/astro/middleware.mjs +333 -192
  26. package/dist/astro/routes/admin.astro +6 -1
  27. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
  28. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
  29. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  30. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  31. package/dist/astro/routes/api/admin/briefing.mjs +21 -17
  32. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  33. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
  34. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
  35. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
  36. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
  37. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
  38. package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
  39. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -12
  40. package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -5
  41. package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -9
  42. package/dist/astro/routes/api/admin/comments/counts.mjs +6 -5
  43. package/dist/astro/routes/api/admin/comments/index.mjs +11 -9
  44. package/dist/astro/routes/api/admin/context/_id_/history.mjs +26 -24
  45. package/dist/astro/routes/api/admin/context/_id_/index.mjs +26 -24
  46. package/dist/astro/routes/api/admin/context/_id_/review.mjs +31 -28
  47. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +31 -28
  48. package/dist/astro/routes/api/admin/context/diff.mjs +30 -27
  49. package/dist/astro/routes/api/admin/context/index.mjs +31 -28
  50. package/dist/astro/routes/api/admin/context/stale.mjs +30 -27
  51. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +26 -24
  52. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +30 -27
  53. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +30 -27
  54. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +27 -25
  55. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  56. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  57. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  58. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +55 -51
  59. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +55 -51
  60. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
  61. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +53 -49
  62. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +52 -48
  63. package/dist/astro/routes/api/admin/plugins/index.mjs +47 -43
  64. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  65. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -42
  66. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +52 -48
  67. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -42
  68. package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -42
  69. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
  70. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +31 -27
  71. package/dist/astro/routes/api/admin/review-requests/index.mjs +10 -9
  72. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -42
  73. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  74. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -42
  75. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  76. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  77. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
  78. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
  79. package/dist/astro/routes/api/admin/users/index.mjs +7 -6
  80. package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
  81. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  82. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
  83. package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
  84. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
  85. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  86. package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
  87. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  88. package/dist/astro/routes/api/auth/me.mjs +9 -8
  89. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  90. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  91. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  92. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
  93. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  94. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
  95. package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
  96. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
  97. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
  98. package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
  99. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  100. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
  101. package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
  102. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  103. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -13
  104. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
  105. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
  106. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  107. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
  108. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
  109. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
  110. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
  111. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +10 -9
  112. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
  113. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  114. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -9
  115. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -14
  116. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  117. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
  118. package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -9
  119. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  120. package/dist/astro/routes/api/content/_collection_/index.mjs +10 -9
  121. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
  122. package/dist/astro/routes/api/dashboard.mjs +9 -8
  123. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  124. package/dist/astro/routes/api/health.mjs +1 -1
  125. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  126. package/dist/astro/routes/api/import/probe.mjs +22 -10
  127. package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
  128. package/dist/astro/routes/api/import/wordpress/execute.d.mts +19 -1
  129. package/dist/astro/routes/api/import/wordpress/execute.mjs +84 -37
  130. package/dist/astro/routes/api/import/wordpress/media.d.mts +13 -1
  131. package/dist/astro/routes/api/import/wordpress/media.mjs +19 -13
  132. package/dist/astro/routes/api/import/wordpress/prepare.mjs +35 -32
  133. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +18 -1
  134. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +120 -100
  135. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  136. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -12
  137. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +56 -2
  138. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +283 -55
  139. package/dist/astro/routes/api/manifest.mjs +14 -5
  140. package/dist/astro/routes/api/mcp.mjs +265 -69
  141. package/dist/astro/routes/api/media/_id_/confirm.mjs +38 -10
  142. package/dist/astro/routes/api/media/_id_.mjs +11 -7
  143. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  144. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  145. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  146. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  147. package/dist/astro/routes/api/media/upload-url.mjs +11 -10
  148. package/dist/astro/routes/api/media.mjs +27 -34
  149. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +31 -28
  150. package/dist/astro/routes/api/menus/_name_/items.mjs +31 -28
  151. package/dist/astro/routes/api/menus/_name_/reorder.mjs +31 -28
  152. package/dist/astro/routes/api/menus/_name_/translations.mjs +31 -28
  153. package/dist/astro/routes/api/menus/_name_.mjs +31 -28
  154. package/dist/astro/routes/api/menus/index.mjs +31 -28
  155. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  156. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  157. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  158. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  159. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  160. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  161. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  162. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  163. package/dist/astro/routes/api/openapi.json.mjs +4 -3
  164. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +30 -30
  165. package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
  166. package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
  167. package/dist/astro/routes/api/redirects/_id_.mjs +32 -29
  168. package/dist/astro/routes/api/redirects/index.mjs +32 -29
  169. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  170. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  171. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -43
  172. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +47 -43
  173. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +47 -43
  174. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -43
  175. package/dist/astro/routes/api/schema/collections/index.mjs +47 -43
  176. package/dist/astro/routes/api/schema/index.mjs +13 -14
  177. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -42
  178. package/dist/astro/routes/api/schema/orphans/index.mjs +46 -42
  179. package/dist/astro/routes/api/search/enable.mjs +11 -10
  180. package/dist/astro/routes/api/search/index.mjs +10 -9
  181. package/dist/astro/routes/api/search/rebuild.mjs +11 -10
  182. package/dist/astro/routes/api/search/stats.mjs +6 -6
  183. package/dist/astro/routes/api/search/suggest.mjs +10 -9
  184. package/dist/astro/routes/api/sections/_slug_.mjs +31 -28
  185. package/dist/astro/routes/api/sections/index.mjs +31 -28
  186. package/dist/astro/routes/api/settings/email.mjs +4 -4
  187. package/dist/astro/routes/api/settings.mjs +31 -28
  188. package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
  189. package/dist/astro/routes/api/setup/admin.mjs +12 -11
  190. package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -25
  191. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  192. package/dist/astro/routes/api/setup/index.mjs +29 -25
  193. package/dist/astro/routes/api/setup/status.mjs +3 -3
  194. package/dist/astro/routes/api/snapshot.mjs +8 -7
  195. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +34 -31
  196. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +34 -31
  197. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +34 -31
  198. package/dist/astro/routes/api/taxonomies/index.mjs +34 -31
  199. package/dist/astro/routes/api/themes/preview.mjs +5 -5
  200. package/dist/astro/routes/api/typegen.mjs +4 -4
  201. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  202. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  203. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  204. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +30 -27
  205. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +31 -28
  206. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +31 -28
  207. package/dist/astro/routes/api/widget-areas/_name_.mjs +28 -26
  208. package/dist/astro/routes/api/widget-areas/index.mjs +31 -28
  209. package/dist/astro/routes/api/widget-components.mjs +2 -2
  210. package/dist/astro/routes/robots.txt.mjs +8 -7
  211. package/dist/astro/routes/sitemap-_collection_.xml.mjs +23 -14
  212. package/dist/astro/routes/sitemap.xml.mjs +9 -8
  213. package/dist/astro/session-driver.d.mts +1 -1
  214. package/dist/astro/session-driver.mjs +2 -2
  215. package/dist/astro/types.d.mts +21 -13
  216. package/dist/{audit-BeNsSyfU.mjs → audit-ByVKIwWF.mjs} +1 -1
  217. package/dist/auth/providers/github.d.mts +1 -1
  218. package/dist/auth/providers/google.d.mts +1 -1
  219. package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-CqeUmQsv.mjs} +1 -1
  220. package/dist/{authorize-BLO0m7fW.mjs → authorize-CcBxcHtz.mjs} +1 -1
  221. package/dist/{briefing-DJX6irto.mjs → briefing-BJaJI8dm.mjs} +2 -1
  222. package/dist/{briefing-CkTee1ex.mjs → briefing-CawZ59CY.mjs} +90 -28
  223. package/dist/bundle-7C_DpkEq.mjs +602 -0
  224. package/dist/{byline-BVC1lV6G.mjs → byline-e51-fWRs.mjs} +30 -62
  225. package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-CUvbslGc.d.mts} +80 -37
  226. package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-D-N5qVIG.mjs} +1 -1
  227. package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-DOJO16Gm.mjs} +3 -3
  228. package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-87nNnYl4.mjs} +2 -2
  229. package/dist/{bylines-LN9XISRo.mjs → bylines-CMQNCNFh.mjs} +9 -3
  230. package/dist/{bylines-DwokOFj6.mjs → bylines-y4LO-dTj.mjs} +5 -5
  231. package/dist/{cache-Bac05gBd.mjs → cache-C-FNTFYK.mjs} +2 -2
  232. package/dist/{chunks-CuUt7K50.mjs → chunks-CxBt-GxR.mjs} +1 -1
  233. package/dist/cli/index.mjs +94 -659
  234. package/dist/client/external-auth-headers.d.mts +1 -1
  235. package/dist/client/index.d.mts +1 -1
  236. package/dist/client/index.mjs +2 -1
  237. package/dist/{comment-Beue8-15.mjs → comment-DlA4iChg.mjs} +13 -3
  238. package/dist/comment-reaction-DfFao1ST.mjs +58 -0
  239. package/dist/{comments-DcjFIfqX.mjs → comments-DApFGMsP.mjs} +1 -1
  240. package/dist/{content-CBxYGWfL.mjs → content-Bh4BDjv8.mjs} +51 -34
  241. package/dist/content-refresh-CgutSUfO.mjs +1576 -0
  242. package/dist/{context-CQVNZaR8.mjs → context-C5W3G18y.mjs} +111 -50
  243. package/dist/{context-Df1xVYyr.mjs → context-CK4ym2Sf.mjs} +2 -2
  244. package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-MASyGgWf.mjs} +2 -1
  245. package/dist/{cron-DxCAU_Sn.mjs → cron-cKcNTix_.mjs} +7 -3
  246. package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-DQkVT7Ei.mjs} +4 -4
  247. package/dist/db/index.d.mts +3 -3
  248. package/dist/db/index.mjs +1 -1
  249. package/dist/db/libsql.d.mts +1 -1
  250. package/dist/db/postgres.d.mts +1 -1
  251. package/dist/db/sqlite.d.mts +1 -1
  252. package/dist/{device-flow-BZVGftqi.mjs → device-flow-BnqRH-T9.mjs} +5 -5
  253. package/dist/{placeholder-d54Qr_7n.mjs → enrich-DIFIFA8O.mjs} +36 -9
  254. package/dist/{error-DCSuUAZW.mjs → error-CytFlgcd.mjs} +5 -0
  255. package/dist/field-defs-cache-DRNdhBJv.mjs +49 -0
  256. package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-Crzypjqu.mjs} +1 -1
  257. package/dist/hitl-Hw1RmWOq.mjs +677 -0
  258. package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-B4Vbcmaq.mjs} +2 -2
  259. package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-hEVzvP8l.mjs} +5 -4
  260. package/dist/import-Bh9biJfx.mjs +1354 -0
  261. package/dist/{index-CZiWCQDp.d.mts → index-D4y6NGiy.d.mts} +75 -3
  262. package/dist/index.d.mts +17 -16
  263. package/dist/index.mjs +80 -68
  264. package/dist/{jsonld-DZ67souc.d.mts → jsonld-Dq0gsnOH.d.mts} +8 -4
  265. package/dist/{load-D9OiGr2m.mjs → load-DmYeniXl.mjs} +1 -1
  266. package/dist/{loader--GOYux8M.mjs → loader-CjWqjweO.mjs} +117 -31
  267. package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-BxVPYMJR.mjs} +34 -1
  268. package/dist/mcp-reviewed-executor-TwVbMzG6.mjs +555 -0
  269. package/dist/media/image-endpoint.d.mts +32 -0
  270. package/dist/media/image-endpoint.mjs +111 -0
  271. package/dist/media/index.d.mts +27 -2
  272. package/dist/media/index.mjs +5 -3
  273. package/dist/media/local-runtime.d.mts +16 -11
  274. package/dist/media/local-runtime.mjs +9 -7
  275. package/dist/{media-CbKyYukG.mjs → media-DMj0grzC.mjs} +3 -1
  276. package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-BlVCSzHx.mjs} +1 -1
  277. package/dist/media-url-lEKSrpr9.mjs +20 -0
  278. package/dist/{menus-BZbXf-ej.mjs → menus-TaW1gKnk.mjs} +19 -5
  279. package/dist/{menus-C7F0sCrC.mjs → menus-xvsnVZXw.mjs} +80 -15
  280. package/dist/{normalize-ByemhhfW.mjs → normalize-5ek_z7de.mjs} +8 -1
  281. package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-DiaGvRVz.mjs} +5 -5
  282. package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dl9E8dEM.mjs} +2 -2
  283. package/dist/object-cache/memory.d.mts +14 -0
  284. package/dist/object-cache/memory.mjs +55 -0
  285. package/dist/object-cache-D51qOseS.mjs +419 -0
  286. package/dist/page/index.d.mts +4 -3
  287. package/dist/page/index.mjs +2 -2
  288. package/dist/{parse-CneSgl7-.mjs → parse-CbymENaR.mjs} +1 -1
  289. package/dist/{parser-DxfsARXL.mjs → parser-C1nYd-81.mjs} +151 -9
  290. package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-uvNRZBX9.d.mts} +12 -4
  291. package/dist/plugin-utils.d.mts +9 -9
  292. package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
  293. package/dist/plugins/adapt-sandbox-entry.mjs +11 -2
  294. package/dist/{plugins-DzfqRREq.mjs → plugins-BolVa-tl.mjs} +831 -63
  295. package/dist/{transport-LSdZVXHF.mjs → portable-text-dA_UlJwW.mjs} +1 -134
  296. package/dist/{preview-C-3YTX2U.mjs → preview-vSVg6fwG.mjs} +4 -3
  297. package/dist/process-cache-7xgAO9JY.mjs +106 -0
  298. package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-MD8zAbnH.d.mts} +1 -1
  299. package/dist/{public-url-B4xV4rGa.d.mts → public-url-gsp3oUbu.d.mts} +1 -1
  300. package/dist/{query-Ds0EnMFX.mjs → query-CfRCdaL3.mjs} +281 -76
  301. package/dist/{query-CZ3TH_Uu.mjs → query-jaAmw8E1.mjs} +11 -6
  302. package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-ZLdyWoZF.mjs} +2 -2
  303. package/dist/{redirect-CEACczxo.mjs → redirect-BAjt4Z6b.mjs} +2 -2
  304. package/dist/{redirects-DYj1yPxs.mjs → redirects-BTdwpQtE.mjs} +47 -24
  305. package/dist/{redirects-ocRJmQHP.mjs → redirects-CA-xylPG.mjs} +19 -11
  306. package/dist/{registry-D7HACema.mjs → registry-CtyVedcN.mjs} +130 -77
  307. package/dist/request-context.d.mts +2 -0
  308. package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CUypToDJ.mjs} +1 -1
  309. package/dist/{review-requests-Qum4713s.mjs → review-requests-C9Ff11Vq.mjs} +1 -1
  310. package/dist/{review-requests-BW2NxY-l.mjs → review-requests-DUyEmtmG.mjs} +1 -1
  311. package/dist/{runner-09sTqtv0.d.mts → runner-1tC2tIRV.d.mts} +1 -1
  312. package/dist/runner-DB7CRfOF.mjs +6740 -0
  313. package/dist/{runtime-C4-2lSFg.d.mts → runtime-BOeiQsCv.d.mts} +1952 -1489
  314. package/dist/runtime.d.mts +10 -10
  315. package/dist/runtime.mjs +3 -3
  316. package/dist/schema-DXdYj4R3.mjs +8 -0
  317. package/dist/{search-Gdrqj582.mjs → search-DSaLgEFI.mjs} +5 -3
  318. package/dist/{secrets-CeGpBFV2.mjs → secrets-CDZo2k8L.mjs} +14 -11
  319. package/dist/{sections-BOjU13Y-.mjs → sections-PVVXHGfp.mjs} +2 -2
  320. package/dist/seed/index.d.mts +2 -2
  321. package/dist/seed/index.mjs +21 -18
  322. package/dist/seo/index.d.mts +1 -1
  323. package/dist/seo/index.mjs +3 -12
  324. package/dist/{seo-CLj8lS7Q.mjs → seo-CQG3GCHQ.mjs} +5 -2
  325. package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-C1EnikHB.mjs} +11 -3
  326. package/dist/{seo-5lJOtB5J.mjs → seo-qa7Dn0jK.mjs} +22 -4
  327. package/dist/{service-jGlhrICs.mjs → service-DiN4ZuPp.mjs} +2 -2
  328. package/dist/session-user-CAKImna3.mjs +22 -0
  329. package/dist/{settings-CUXOxzsT.mjs → settings-BbqgHWpU.mjs} +28 -55
  330. package/dist/{settings-DlBsT2VS.mjs → settings-i4VPP8bT.mjs} +2 -2
  331. package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-B8fl-mjV.mjs} +1 -1
  332. package/dist/{site-activity-DONFrMBJ.mjs → site-activity-Dy3FROs0.mjs} +1 -1
  333. package/dist/{site-context-C8Az_P_I.mjs → site-context-DQiL8Fl5.mjs} +23 -652
  334. package/dist/{site-url-DIMD68go.mjs → site-url-BML3GQYm.mjs} +1 -1
  335. package/dist/status-DANd8ERo.mjs +21 -0
  336. package/dist/storage/local.d.mts +1 -1
  337. package/dist/storage/local.mjs +1 -1
  338. package/dist/storage/s3.d.mts +1 -1
  339. package/dist/storage/s3.mjs +1 -1
  340. package/dist/{taxonomies-D9Sw4wWM.mjs → taxonomies-9s-v03H-.mjs} +36 -29
  341. package/dist/taxonomies-DRiixp_E.mjs +443 -0
  342. package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-Dvsw6BOs.mjs} +44 -9
  343. package/dist/transport-BNmCqLu7.mjs +134 -0
  344. package/dist/types-4garmdWa.mjs +66 -0
  345. package/dist/{types-DSPGWjxO.d.mts → types-C8XW6L19.d.mts} +225 -4
  346. package/dist/{types-GaCtZ1k9.d.mts → types-CDpH6MA4.d.mts} +18 -0
  347. package/dist/{types-DRIKLmJI.d.mts → types-C_ly5eTp.d.mts} +17 -2
  348. package/dist/types-DF7ZuGGk.d.mts +118 -0
  349. package/dist/types-DU0bU2Wu.d.mts +2392 -0
  350. package/dist/{types-CwawBUTa.d.mts → types-DW_-sFyz.d.mts} +2 -1
  351. package/dist/{types-CSgR9nQB.mjs → types-Dq1qT19x.mjs} +1 -1
  352. package/dist/ui/server-runtime.d.mts +15 -15
  353. package/dist/ui/server-runtime.mjs +24 -20
  354. package/dist/url-Cac7a9QZ.mjs +33 -0
  355. package/dist/{user-DTLoZs16.mjs → user-BIZPzCb9.mjs} +2 -2
  356. package/dist/{utils-B8hBJ9Oz.mjs → utils-CMDhr5Xd.mjs} +129 -7
  357. package/dist/{validate-DzjCdy6v.d.mts → validate-CZvb-BKB.d.mts} +10 -7
  358. package/dist/{validate-DWmPO6oj.mjs → validate-DNs0pTSc.mjs} +11 -6
  359. package/dist/version-BTvfRGc6.mjs +6 -0
  360. package/dist/{widgets-BpJ8EpPd.mjs → widgets-f0ibZUIq.mjs} +46 -43
  361. package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-BhHJX8XE.mjs} +1 -1
  362. package/dist/{zod-generator-K91-g665.mjs → zod-generator-B7TMjyFJ.mjs} +41 -13
  363. package/package.json +30 -8
  364. package/src/components/Block.astro +50 -0
  365. package/src/components/Comments.astro +143 -1
  366. package/src/components/DinewayHead.astro +19 -2
  367. package/src/components/DinewayImage.astro +66 -33
  368. package/src/components/DinewayMedia.astro +1 -2
  369. package/src/components/Image.astro +85 -40
  370. package/src/components/InlinePortableTextEditor.tsx +12 -2
  371. package/src/components/JsonLdScript.astro +9 -0
  372. package/src/components/LiveSearch.astro +40 -4
  373. package/src/components/index.ts +4 -0
  374. package/src/components/live-search-routing.ts +30 -0
  375. package/src/components/portable-text-text-align.ts +15 -0
  376. package/src/ui.ts +2 -0
  377. package/dist/entity-aliases-4y93Yjuc.mjs +0 -51
  378. package/dist/import-4YBXbDkI.mjs +0 -684
  379. package/dist/runner-DzIpHGND.mjs +0 -2836
  380. package/dist/schema-Bsi-VpYv.mjs +0 -8
  381. package/dist/taxonomies-CZ-_DitR.mjs +0 -327
  382. package/dist/types-CuJOqHfM.d.mts +0 -758
  383. package/dist/version-C4gfn0PJ.mjs +0 -6
  384. /package/dist/{adapters-OQCImOL7.d.mts → adapters-NVSs4UH7.d.mts} +0 -0
  385. /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-2r7OWi_I.mjs} +0 -0
  386. /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-Bjlepa2E.mjs} +0 -0
  387. /package/dist/{components--pg6zBvu.mjs → components-Bclf98Be.mjs} +0 -0
  388. /package/dist/{context-types-r8oFvyOq.mjs → context-types-DqTo6C79.mjs} +0 -0
  389. /package/dist/{default-B6iaLvP7.mjs → default--K40jqm0.mjs} +0 -0
  390. /package/dist/{email-console-BOVqIYpB.mjs → email-console-ChgKFO8-.mjs} +0 -0
  391. /package/dist/{escape-BDgouFFY.mjs → escape-Bd4P_xKg.mjs} +0 -0
  392. /package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-BMsUnIAw.mjs} +0 -0
  393. /package/dist/{mime-CbKsKDCB.mjs → mime-CA7Lgovc.mjs} +0 -0
  394. /package/dist/{mode-CZqCF9dZ.mjs → mode-C4CIyjtR.mjs} +0 -0
  395. /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CNoXafF7.mjs} +0 -0
  396. /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-Ygw4bNyt.mjs} +0 -0
  397. /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
  398. /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-BUwu8BA3.mjs} +0 -0
  399. /package/dist/{patterns-DKAX6oqN.mjs → patterns-BhAvqO0S.mjs} +0 -0
  400. /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-D0w9dqjm.mjs} +0 -0
  401. /package/dist/{public-url-B_m9IwdV.mjs → public-url-BEz_sM9n.mjs} +0 -0
  402. /package/dist/{redirect-BjIBtDWY.mjs → redirect-wphRBv4y.mjs} +0 -0
  403. /package/dist/{request-cache-ho99schz.mjs → request-cache-D9GQBxMP.mjs} +0 -0
  404. /package/dist/{resolve-DTuDyYKs.mjs → resolve-Cb6Dbz-C.mjs} +0 -0
  405. /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-CoyjILvW.mjs} +0 -0
  406. /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-C3mqXg4C.mjs} +0 -0
  407. /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
  408. /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-DWe8jwAp.mjs} +0 -0
  409. /package/dist/{tokens-SLmgowfd.mjs → tokens-1RK1n6ED.mjs} +0 -0
  410. /package/dist/{transaction-CFLhEOuH.mjs → transaction-C2EOMTJA.mjs} +0 -0
  411. /package/dist/{transport-BnsNxh2l.d.mts → transport-CcJu3Co8.d.mts} +0 -0
  412. /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-DTXQ2IMv.mjs} +0 -0
  413. /package/dist/{types-CJ8DkL0q.mjs → types-B3t5cxhU.mjs} +0 -0
  414. /package/dist/{types-nP9vGUFq.d.mts → types-C46EvNdc.d.mts} +0 -0
  415. /package/dist/{types-Cg276-3z.mjs → types-C5CVgwsV.mjs} +0 -0
  416. /package/dist/{types-DZpT-PnG.d.mts → types-POH8PQZh.d.mts} +0 -0
  417. /package/dist/{types-Dryvv7LH.d.mts → types-Rc3gQqqw.d.mts} +0 -0
  418. /package/dist/{url-w7Mp5qAD.mjs → url-CpyFDFpO.mjs} +0 -0
@@ -1,684 +0,0 @@
1
- import { n as slugify } from "./slugify-BqebcqBg.mjs";
2
- import { n as parseWxrString } from "./parser-DxfsARXL.mjs";
3
- import { a as validateExternalUrl, n as resolveAndValidateExternalUrl, r as ssrfSafeFetch } from "./ssrf-DiKqWd3N.mjs";
4
- import { a as getFilenameFromUrl, c as isInternalMetaKey, d as mapPostTypeToCollection, f as mapWpStatus, i as checkSchemaCompatibility, l as isInternalPostType, n as FEATURED_IMAGE_FIELD, o as guessMimeType, p as normalizeUrl$1, r as buildAttachmentMap, s as inferMetaType, t as BASE_REQUIRED_FIELDS, u as mapMetaKeyToField } from "./utils-B8hBJ9Oz.mjs";
5
- import { ulid } from "ulidx";
6
- import { gutenbergToPortableText } from "@dineway-ai/gutenberg-to-portable-text";
7
-
8
- //#region src/import/sections.ts
9
- /**
10
- * Import reusable blocks (wp_block post type) from WXR as sections
11
- *
12
- * @param posts - All posts from WXR (will filter to wp_block)
13
- * @param db - Database connection
14
- * @returns Import result with counts
15
- */
16
- async function importReusableBlocksAsSections(posts, db) {
17
- const result = {
18
- sectionsCreated: 0,
19
- sectionsSkipped: 0,
20
- errors: []
21
- };
22
- const reusableBlocks = posts.filter((post) => post.postType === "wp_block");
23
- if (reusableBlocks.length === 0) return result;
24
- for (const block of reusableBlocks) try {
25
- const slug = block.postName || slugify(block.title || `block-${block.id || Date.now()}`);
26
- if (await db.selectFrom("_dineway_sections").select("id").where("slug", "=", slug).executeTakeFirst()) {
27
- result.sectionsSkipped++;
28
- continue;
29
- }
30
- const content = block.content ? gutenbergToPortableText(block.content) : [];
31
- const id = ulid();
32
- const now = (/* @__PURE__ */ new Date()).toISOString();
33
- await db.insertInto("_dineway_sections").values({
34
- id,
35
- slug,
36
- title: block.title || "Untitled Block",
37
- description: null,
38
- keywords: null,
39
- content: JSON.stringify(content),
40
- preview_media_id: null,
41
- source: "import",
42
- theme_id: null,
43
- created_at: now,
44
- updated_at: now
45
- }).execute();
46
- result.sectionsCreated++;
47
- } catch (error) {
48
- result.errors.push({
49
- title: block.title || "Untitled Block",
50
- error: error instanceof Error ? error.message : String(error)
51
- });
52
- }
53
- return result;
54
- }
55
-
56
- //#endregion
57
- //#region src/import/registry.ts
58
- /**
59
- * Import source registry
60
- *
61
- * Manages available import sources and provides URL probing.
62
- */
63
- const TRAILING_SLASHES_PATTERN = /\/+$/;
64
- /** Registered import sources */
65
- const sources = /* @__PURE__ */ new Map();
66
- /**
67
- * Register an import source
68
- */
69
- function registerSource(source) {
70
- sources.set(source.id, source);
71
- }
72
- /**
73
- * Get a source by ID
74
- */
75
- function getSource(id) {
76
- return sources.get(id);
77
- }
78
- /**
79
- * Get all registered sources
80
- */
81
- function getAllSources() {
82
- return [...sources.values()];
83
- }
84
- /**
85
- * Get sources that can handle file uploads
86
- */
87
- function getFileSources() {
88
- return getAllSources().filter((s) => s.requiresFile);
89
- }
90
- /**
91
- * Get sources that can probe URLs
92
- */
93
- function getUrlSources() {
94
- return getAllSources().filter((s) => s.canProbe);
95
- }
96
- /**
97
- * Probe a URL against all registered sources
98
- *
99
- * Returns probe results sorted by confidence (definite > likely > possible)
100
- */
101
- async function probeUrl(url) {
102
- let normalizedUrl = url.trim();
103
- if (!normalizedUrl.startsWith("http")) normalizedUrl = `https://${normalizedUrl}`;
104
- normalizedUrl = normalizedUrl.replace(TRAILING_SLASHES_PATTERN, "");
105
- await resolveAndValidateExternalUrl(normalizedUrl);
106
- const results = [];
107
- const probePromises = getUrlSources().map(async (source) => {
108
- try {
109
- const result = await source.probe?.(normalizedUrl);
110
- if (result) return result;
111
- } catch (error) {
112
- console.debug(`Probe failed for ${source.id}:`, error);
113
- }
114
- return null;
115
- });
116
- const probeResults = await Promise.allSettled(probePromises);
117
- for (const result of probeResults) if (result.status === "fulfilled" && result.value) results.push(result.value);
118
- const confidenceOrder = {
119
- definite: 0,
120
- likely: 1,
121
- possible: 2
122
- };
123
- results.sort((a, b) => confidenceOrder[a.confidence] - confidenceOrder[b.confidence]);
124
- return {
125
- url: normalizedUrl,
126
- isWordPress: results.length > 0,
127
- bestMatch: results[0] ?? null,
128
- allMatches: results
129
- };
130
- }
131
- /**
132
- * Clear all registered sources (useful for testing)
133
- */
134
- function clearSources() {
135
- sources.clear();
136
- }
137
-
138
- //#endregion
139
- //#region src/import/sources/wxr.ts
140
- /**
141
- * WXR (WordPress eXtended RSS) import source
142
- *
143
- * Handles WordPress export file uploads (.xml).
144
- * This wraps the existing WXR parsing and analysis logic.
145
- */
146
- const wxrSource = {
147
- id: "wxr",
148
- name: "WordPress Export File",
149
- description: "Upload a WordPress export file (.xml)",
150
- icon: "upload",
151
- requiresFile: true,
152
- canProbe: false,
153
- async analyze(input, context) {
154
- if (input.type !== "file") throw new Error("WXR source requires a file input");
155
- return analyzeWxrData(await parseWxrString(await input.file.text()), context.getExistingCollections ? await context.getExistingCollections() : /* @__PURE__ */ new Map());
156
- },
157
- async *fetchContent(input, options) {
158
- if (input.type !== "file") throw new Error("WXR source requires a file input");
159
- const wxr = await parseWxrString(await input.file.text());
160
- const attachmentMap = buildAttachmentMap(wxr.attachments);
161
- let count = 0;
162
- for (const post of wxr.posts) {
163
- const postType = post.postType || "post";
164
- if (!options.postTypes.includes(postType)) continue;
165
- if (isInternalPostType(postType)) continue;
166
- if (!options.includeDrafts && post.status !== "publish") continue;
167
- yield wxrPostToNormalizedItem(post, attachmentMap);
168
- count++;
169
- if (options.limit && count >= options.limit) break;
170
- }
171
- }
172
- };
173
- /**
174
- * Analyze WXR data and return normalized ImportAnalysis
175
- */
176
- function analyzeWxrData(wxr, existingCollections) {
177
- const postTypeCounts = /* @__PURE__ */ new Map();
178
- const postTypesWithThumbnails = /* @__PURE__ */ new Set();
179
- const metaKeys = /* @__PURE__ */ new Map();
180
- const authorPostCounts = /* @__PURE__ */ new Map();
181
- for (const post of wxr.posts) {
182
- const type = post.postType || "post";
183
- postTypeCounts.set(type, (postTypeCounts.get(type) || 0) + 1);
184
- if (post.creator) authorPostCounts.set(post.creator, (authorPostCounts.get(post.creator) || 0) + 1);
185
- if (post.meta.has("_thumbnail_id")) postTypesWithThumbnails.add(type);
186
- for (const [key, value] of post.meta) {
187
- const existing = metaKeys.get(key);
188
- if (existing) {
189
- existing.count++;
190
- if (existing.samples.length < 3 && value) existing.samples.push(value.slice(0, 100));
191
- } else metaKeys.set(key, {
192
- count: 1,
193
- samples: value ? [value.slice(0, 100)] : [],
194
- isInternal: isInternalMetaKey(key)
195
- });
196
- }
197
- }
198
- const customFields = [...metaKeys.entries()].filter(([_, info]) => !info.isInternal).map(([key, info]) => ({
199
- key,
200
- count: info.count,
201
- samples: info.samples,
202
- suggestedField: mapMetaKeyToField(key),
203
- suggestedType: inferMetaType(key, info.samples[0]),
204
- isInternal: info.isInternal
205
- })).toSorted((a, b) => b.count - a.count);
206
- const postTypes = [...postTypeCounts.entries()].filter(([type]) => !isInternalPostType(type)).map(([name, count]) => {
207
- const suggestedCollection = mapPostTypeToCollection(name);
208
- const existingCollection = existingCollections.get(suggestedCollection);
209
- const requiredFields = [...BASE_REQUIRED_FIELDS];
210
- if (postTypesWithThumbnails.has(name)) requiredFields.push(FEATURED_IMAGE_FIELD);
211
- return {
212
- name,
213
- count,
214
- suggestedCollection,
215
- requiredFields,
216
- schemaStatus: checkSchemaCompatibility(requiredFields, existingCollection)
217
- };
218
- }).toSorted((a, b) => b.count - a.count);
219
- const attachmentItems = wxr.attachments.map((att) => {
220
- const filename = att.url ? getFilenameFromUrl(att.url) : void 0;
221
- const mimeType = filename ? guessMimeType(filename) : void 0;
222
- return {
223
- id: att.id,
224
- title: att.title,
225
- url: att.url,
226
- filename,
227
- mimeType
228
- };
229
- });
230
- const navMenus = wxr.navMenus.map((menu) => ({
231
- name: menu.name,
232
- label: menu.label,
233
- itemCount: menu.items.length
234
- }));
235
- const taxonomyMap = /* @__PURE__ */ new Map();
236
- for (const term of wxr.terms) {
237
- if (term.taxonomy === "category" || term.taxonomy === "post_tag" || term.taxonomy === "nav_menu") continue;
238
- const existing = taxonomyMap.get(term.taxonomy);
239
- if (existing) {
240
- existing.count++;
241
- if (existing.samples.length < 3) existing.samples.push(term.name);
242
- } else taxonomyMap.set(term.taxonomy, {
243
- count: 1,
244
- samples: [term.name]
245
- });
246
- }
247
- const customTaxonomies = Array.from(taxonomyMap.entries(), ([slug, info]) => ({
248
- slug,
249
- termCount: info.count,
250
- sampleTerms: info.samples
251
- })).toSorted((a, b) => b.termCount - a.termCount);
252
- const reusableBlocks = wxr.posts.filter((post) => post.postType === "wp_block").map((post) => ({
253
- id: post.id || 0,
254
- title: post.title || "Untitled Block",
255
- slug: post.postName || slugify(post.title || `block-${post.id || Date.now()}`)
256
- }));
257
- return {
258
- sourceId: "wxr",
259
- site: {
260
- title: wxr.site.title || "WordPress Site",
261
- url: wxr.site.link || ""
262
- },
263
- postTypes,
264
- attachments: {
265
- count: wxr.attachments.length,
266
- items: attachmentItems
267
- },
268
- categories: wxr.categories.length,
269
- tags: wxr.tags.length,
270
- authors: wxr.authors.map((a) => ({
271
- id: a.id,
272
- login: a.login,
273
- email: a.email,
274
- displayName: a.displayName || a.login || "Unknown",
275
- postCount: a.login ? authorPostCounts.get(a.login) || 0 : 0
276
- })),
277
- navMenus: navMenus.length > 0 ? navMenus : void 0,
278
- customTaxonomies: customTaxonomies.length > 0 ? customTaxonomies : void 0,
279
- reusableBlocks: reusableBlocks.length > 0 ? reusableBlocks : void 0,
280
- customFields
281
- };
282
- }
283
- /**
284
- * Convert a WXR post to a normalized item
285
- */
286
- function wxrPostToNormalizedItem(post, attachmentMap) {
287
- const content = post.content ? gutenbergToPortableText(post.content) : [];
288
- const thumbnailId = post.meta.get("_thumbnail_id");
289
- const featuredImage = thumbnailId ? attachmentMap.get(String(thumbnailId)) : void 0;
290
- let customTaxonomies;
291
- if (post.customTaxonomies && post.customTaxonomies.size > 0) customTaxonomies = Object.fromEntries(post.customTaxonomies);
292
- return {
293
- sourceId: post.id || 0,
294
- postType: post.postType || "post",
295
- status: mapWpStatus(post.status),
296
- slug: post.postName || slugify(post.title || `post-${post.id || Date.now()}`),
297
- title: post.title || "Untitled",
298
- content,
299
- excerpt: post.excerpt,
300
- date: parseWxrDate(post.postDateGmt, post.pubDate, post.postDate) ?? /* @__PURE__ */ new Date(),
301
- modified: parseWxrDate(post.postModifiedGmt, void 0, post.postModified),
302
- author: post.creator,
303
- categories: post.categories,
304
- tags: post.tags,
305
- meta: Object.fromEntries(post.meta),
306
- featuredImage,
307
- parentId: post.postParent && post.postParent !== 0 ? post.postParent : void 0,
308
- menuOrder: post.menuOrder,
309
- customTaxonomies
310
- };
311
- }
312
- /**
313
- * WordPress uses "0000-00-00 00:00:00" as a sentinel for missing GMT dates
314
- * (e.g. unpublished drafts). This must be treated as absent.
315
- */
316
- const WXR_ZERO_DATE = "0000-00-00 00:00:00";
317
- /**
318
- * Parse a WXR date with the correct fallback chain:
319
- * 1. GMT date (always UTC, most reliable)
320
- * 2. pubDate (RFC 2822, includes timezone offset)
321
- * 3. Site-local date (MySQL datetime without timezone, imprecise but best available)
322
- *
323
- * Returns undefined when none of the inputs yield a valid date.
324
- * Callers that need a guaranteed Date should use `?? new Date()`.
325
- */
326
- function parseWxrDate(gmtDate, pubDate, localDate) {
327
- if (gmtDate && gmtDate !== WXR_ZERO_DATE) return /* @__PURE__ */ new Date(gmtDate.replace(" ", "T") + "Z");
328
- if (pubDate) {
329
- const d = new Date(pubDate);
330
- if (!isNaN(d.getTime())) return d;
331
- }
332
- if (localDate) {
333
- const d = new Date(localDate.replace(" ", "T"));
334
- if (!isNaN(d.getTime())) return d;
335
- }
336
- }
337
-
338
- //#endregion
339
- //#region src/import/sources/wordpress-rest.ts
340
- /**
341
- * WordPress REST API probe
342
- *
343
- * Probes self-hosted WordPress sites to detect capabilities.
344
- * This source is probe-only - it tells users what's available
345
- * and suggests next steps (usually: upload WXR file).
346
- */
347
- const TRAILING_SLASHES = /\/+$/;
348
- const WP_JSON_SUFFIX = /\/wp-json\/?$/;
349
- const wordpressRestSource = {
350
- id: "wordpress-rest",
351
- name: "WordPress Site",
352
- description: "Connect to a self-hosted WordPress site",
353
- icon: "globe",
354
- requiresFile: false,
355
- canProbe: true,
356
- async probe(url) {
357
- try {
358
- const siteUrl = normalizeUrl(url);
359
- validateExternalUrl(siteUrl);
360
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/`, {
361
- headers: { Accept: "application/json" },
362
- signal: AbortSignal.timeout(1e4)
363
- });
364
- if (!response.ok) {
365
- if (!(await ssrfSafeFetch(`${siteUrl}/?rest_route=/`, {
366
- headers: { Accept: "application/json" },
367
- signal: AbortSignal.timeout(1e4)
368
- })).ok) return null;
369
- }
370
- const data = await response.json();
371
- if (!data.namespaces?.includes("wp/v2")) return null;
372
- const preview = await getPublicContentCounts(siteUrl);
373
- const hasAppPasswords = !!data.authentication?.["application-passwords"];
374
- return {
375
- sourceId: "wordpress-rest",
376
- confidence: "definite",
377
- detected: {
378
- platform: "wordpress",
379
- siteTitle: data.name,
380
- siteUrl: data.url || data.home || siteUrl
381
- },
382
- capabilities: {
383
- publicContent: true,
384
- privateContent: false,
385
- customPostTypes: false,
386
- allMeta: false,
387
- mediaStream: true
388
- },
389
- auth: hasAppPasswords ? {
390
- type: "password",
391
- instructions: "To import drafts and private content, create an Application Password in WordPress → Users → Your Profile → Application Passwords"
392
- } : void 0,
393
- preview,
394
- suggestedAction: {
395
- type: "upload",
396
- instructions: "For a complete import including drafts, custom post types, and all metadata, export your content from WordPress (Tools → Export) and upload the file here."
397
- }
398
- };
399
- } catch {
400
- return null;
401
- }
402
- },
403
- async analyze(_input, _context) {
404
- throw new Error("Direct REST API import not implemented. Please upload a WXR export file.");
405
- },
406
- async *fetchContent(_input, _options) {
407
- throw new Error("Direct REST API import not implemented. Please upload a WXR export file.");
408
- }
409
- };
410
- /**
411
- * Normalize a URL for API requests
412
- */
413
- function normalizeUrl(url) {
414
- let normalized = url.trim();
415
- if (!normalized.startsWith("http")) normalized = `https://${normalized}`;
416
- normalized = normalized.replace(TRAILING_SLASHES, "");
417
- normalized = normalized.replace(WP_JSON_SUFFIX, "");
418
- return normalized;
419
- }
420
- /**
421
- * Get public content counts from REST API
422
- */
423
- async function getPublicContentCounts(siteUrl) {
424
- const result = {};
425
- try {
426
- const [postsRes, pagesRes, mediaRes] = await Promise.allSettled([
427
- ssrfSafeFetch(`${siteUrl}/wp-json/wp/v2/posts?per_page=1`, { signal: AbortSignal.timeout(5e3) }),
428
- ssrfSafeFetch(`${siteUrl}/wp-json/wp/v2/pages?per_page=1`, { signal: AbortSignal.timeout(5e3) }),
429
- ssrfSafeFetch(`${siteUrl}/wp-json/wp/v2/media?per_page=1`, { signal: AbortSignal.timeout(5e3) })
430
- ]);
431
- if (postsRes.status === "fulfilled" && postsRes.value.ok) {
432
- const total = postsRes.value.headers.get("X-WP-Total");
433
- if (total) result.posts = parseInt(total, 10);
434
- }
435
- if (pagesRes.status === "fulfilled" && pagesRes.value.ok) {
436
- const total = pagesRes.value.headers.get("X-WP-Total");
437
- if (total) result.pages = parseInt(total, 10);
438
- }
439
- if (mediaRes.status === "fulfilled" && mediaRes.value.ok) {
440
- const total = mediaRes.value.headers.get("X-WP-Total");
441
- if (total) result.media = parseInt(total, 10);
442
- }
443
- } catch {}
444
- return result;
445
- }
446
-
447
- //#endregion
448
- //#region src/import/sources/wordpress-plugin.ts
449
- /**
450
- * WordPress Plugin (Dineway Exporter) import source
451
- *
452
- * Connects to self-hosted WordPress sites running the Dineway Exporter plugin.
453
- * Provides full access to all content including drafts, custom post types, and ACF fields.
454
- */
455
- const wordpressPluginSource = {
456
- id: "wordpress-plugin",
457
- name: "WordPress (Dineway Exporter)",
458
- description: "Import from WordPress sites with the Dineway Exporter plugin installed",
459
- icon: "plug",
460
- requiresFile: false,
461
- canProbe: true,
462
- async probe(url) {
463
- try {
464
- const siteUrl = normalizeUrl$1(url);
465
- validateExternalUrl(siteUrl);
466
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/dineway/v1/probe`, {
467
- headers: { Accept: "application/json" },
468
- signal: AbortSignal.timeout(1e4)
469
- });
470
- if (!response.ok) return null;
471
- const data = await response.json();
472
- if (!data.dineway_exporter) return null;
473
- return {
474
- sourceId: "wordpress-plugin",
475
- confidence: "definite",
476
- detected: {
477
- platform: "wordpress",
478
- version: data.wordpress_version,
479
- siteTitle: data.site.title,
480
- siteUrl: data.site.url
481
- },
482
- capabilities: {
483
- publicContent: true,
484
- privateContent: true,
485
- customPostTypes: true,
486
- allMeta: true,
487
- mediaStream: true
488
- },
489
- auth: data.capabilities.application_passwords ? {
490
- type: "password",
491
- instructions: data.auth_instructions.instructions
492
- } : void 0,
493
- preview: {
494
- posts: data.post_types.find((p) => p.name === "post")?.count,
495
- pages: data.post_types.find((p) => p.name === "page")?.count,
496
- media: data.media_count
497
- },
498
- suggestedAction: { type: "proceed" },
499
- i18n: pluginI18nToDetection(data.i18n)
500
- };
501
- } catch {
502
- return null;
503
- }
504
- },
505
- async analyze(input, context) {
506
- const { siteUrl, headers } = getRequestConfig(input);
507
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/dineway/v1/analyze`, {
508
- headers,
509
- signal: AbortSignal.timeout(3e4)
510
- });
511
- if (!response.ok) {
512
- const error = await response.json().catch(() => ({}));
513
- throw new Error(error.message || `Failed to analyze site: ${response.statusText}`);
514
- }
515
- const data = await response.json();
516
- const existingCollections = context.getExistingCollections ? await context.getExistingCollections() : /* @__PURE__ */ new Map();
517
- const postTypes = data.post_types.filter((pt) => pt.total > 0).map((pt) => {
518
- const suggestedCollection = mapPostTypeToCollection(pt.name);
519
- const existingCollection = existingCollections.get(suggestedCollection);
520
- const requiredFields = pt.supports && "thumbnail" in pt.supports ? [...BASE_REQUIRED_FIELDS, FEATURED_IMAGE_FIELD] : [...BASE_REQUIRED_FIELDS];
521
- return {
522
- name: pt.name,
523
- count: pt.total,
524
- suggestedCollection,
525
- requiredFields,
526
- schemaStatus: checkSchemaCompatibility(requiredFields, existingCollection)
527
- };
528
- });
529
- const attachments = [];
530
- if (data.attachments.count > 0) try {
531
- const mediaResponse = await ssrfSafeFetch(`${siteUrl}/wp-json/dineway/v1/media?per_page=500`, {
532
- headers,
533
- signal: AbortSignal.timeout(3e4)
534
- });
535
- if (mediaResponse.ok) {
536
- const mediaData = await mediaResponse.json();
537
- for (const item of mediaData.items) attachments.push({
538
- id: item.id,
539
- url: item.url,
540
- filename: item.filename,
541
- mimeType: item.mime_type,
542
- title: item.title,
543
- alt: item.alt,
544
- caption: item.caption,
545
- width: item.width,
546
- height: item.height
547
- });
548
- }
549
- } catch (e) {
550
- console.warn("Failed to fetch media list:", e);
551
- }
552
- const categoryTaxonomy = data.taxonomies.find((t) => t.name === "category");
553
- const tagTaxonomy = data.taxonomies.find((t) => t.name === "post_tag");
554
- return {
555
- sourceId: "wordpress-plugin",
556
- site: {
557
- title: data.site.title,
558
- url: data.site.url
559
- },
560
- postTypes,
561
- attachments: {
562
- count: data.attachments.count,
563
- items: attachments
564
- },
565
- categories: categoryTaxonomy?.term_count ?? 0,
566
- tags: tagTaxonomy?.term_count ?? 0,
567
- authors: data.authors.map((a) => ({
568
- id: a.id,
569
- login: a.login,
570
- email: a.email,
571
- displayName: a.display_name,
572
- postCount: a.post_count
573
- })),
574
- i18n: pluginI18nToDetection(data.i18n)
575
- };
576
- },
577
- async *fetchContent(input, options) {
578
- const { siteUrl, headers } = getRequestConfig(input);
579
- for (const postType of options.postTypes) {
580
- let page = 1;
581
- let totalPages = 1;
582
- let yielded = 0;
583
- while (page <= totalPages) {
584
- const response = await ssrfSafeFetch(`${siteUrl}/wp-json/dineway/v1/content?post_type=${postType}&status=${options.includeDrafts ? "any" : "publish"}&per_page=100&page=${page}`, {
585
- headers,
586
- signal: AbortSignal.timeout(6e4)
587
- });
588
- if (!response.ok) throw new Error(`Failed to fetch ${postType}: ${response.statusText}`);
589
- const data = await response.json();
590
- totalPages = data.pages;
591
- for (const post of data.items) {
592
- yield pluginPostToNormalizedItem(post);
593
- yielded++;
594
- if (options.limit && yielded >= options.limit) return;
595
- }
596
- page++;
597
- }
598
- }
599
- },
600
- async fetchMedia(url, _input) {
601
- validateExternalUrl(url);
602
- const response = await ssrfSafeFetch(url);
603
- if (!response.ok) throw new Error(`Failed to fetch media: ${response.statusText}`);
604
- return response.blob();
605
- }
606
- };
607
- /**
608
- * Convert plugin i18n info to the shared I18nDetection type.
609
- * Returns undefined when no multilingual plugin is detected.
610
- */
611
- function pluginI18nToDetection(i18n) {
612
- if (!i18n) return void 0;
613
- return {
614
- plugin: i18n.plugin,
615
- defaultLocale: i18n.default_locale,
616
- locales: i18n.locales
617
- };
618
- }
619
- /**
620
- * Get request configuration from input
621
- */
622
- function getRequestConfig(input) {
623
- if (input.type === "url") {
624
- const siteUrl = normalizeUrl$1(input.url);
625
- validateExternalUrl(siteUrl);
626
- const headers = { Accept: "application/json" };
627
- if (input.token) headers["Authorization"] = `Basic ${input.token}`;
628
- return {
629
- siteUrl,
630
- headers
631
- };
632
- }
633
- if (input.type === "oauth") {
634
- const oauthSiteUrl = normalizeUrl$1(input.url);
635
- validateExternalUrl(oauthSiteUrl);
636
- return {
637
- siteUrl: oauthSiteUrl,
638
- headers: {
639
- Accept: "application/json",
640
- Authorization: `Bearer ${input.accessToken}`
641
- }
642
- };
643
- }
644
- throw new Error("WordPress plugin source requires URL or OAuth input");
645
- }
646
- /**
647
- * Convert plugin post to normalized item
648
- */
649
- function pluginPostToNormalizedItem(post) {
650
- const content = post.content ? gutenbergToPortableText(post.content) : [];
651
- const categories = post.taxonomies?.category?.map((c) => c.slug) ?? post.taxonomies?.categories?.map((c) => c.slug) ?? [];
652
- const tags = post.taxonomies?.post_tag?.map((t) => t.slug) ?? post.taxonomies?.tags?.map((t) => t.slug) ?? [];
653
- const meta = { ...post.meta };
654
- if (post.acf) meta._acf = post.acf;
655
- if (post.yoast) meta._yoast = post.yoast;
656
- if (post.rankmath) meta._rankmath = post.rankmath;
657
- return {
658
- sourceId: post.id,
659
- postType: post.post_type,
660
- status: mapWpStatus(post.status),
661
- slug: post.slug,
662
- title: post.title,
663
- content,
664
- excerpt: post.excerpt || void 0,
665
- date: new Date(post.date_gmt || post.date),
666
- modified: post.modified_gmt ? new Date(post.modified_gmt) : new Date(post.modified),
667
- author: post.author?.login,
668
- categories,
669
- tags,
670
- meta,
671
- featuredImage: post.featured_image?.url,
672
- locale: post.locale,
673
- translationGroup: post.translation_group
674
- };
675
- }
676
-
677
- //#endregion
678
- //#region src/import/index.ts
679
- registerSource(wordpressPluginSource);
680
- registerSource(wordpressRestSource);
681
- registerSource(wxrSource);
682
-
683
- //#endregion
684
- export { getAllSources as a, getUrlSources as c, importReusableBlocksAsSections as d, clearSources as i, probeUrl as l, parseWxrDate as n, getFileSources as o, wxrSource as r, getSource as s, wordpressRestSource as t, registerSource as u };