emdash 0.27.0 → 0.28.1
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.
- package/dist/{adapters-u037EnTR.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
- package/dist/{adapters-u037EnTR.d.mts.map → adapters-hUy8vOB-.d.mts.map} +1 -1
- package/dist/{allowed-origins-D5FxMUo8.mjs → allowed-origins-CRsJ6BPM.mjs} +2 -2
- package/dist/{allowed-origins-D5FxMUo8.mjs.map → allowed-origins-CRsJ6BPM.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +17 -16
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +3 -3
- package/dist/{api-80kycR9o.mjs → api-DxFSorgk.mjs} +33 -23
- package/dist/api-DxFSorgk.mjs.map +1 -0
- package/dist/{api-tokens-D6ppjIVi.mjs → api-tokens-DvqeZmVq.mjs} +2 -2
- package/dist/{api-tokens-D6ppjIVi.mjs.map → api-tokens-DvqeZmVq.mjs.map} +1 -1
- package/dist/{apply-DSypk6Iu.mjs → apply-CDJqIjPU.mjs} +111 -74
- package/dist/apply-CDJqIjPU.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.mjs +3 -3
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +50 -11
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +2 -2
- package/dist/astro/middleware.mjs +124 -71
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +8 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +8 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +8 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +14 -14
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +14 -14
- package/dist/astro/routes/api/admin/bylines/index.mjs +14 -14
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +37 -36
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +37 -36
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +37 -36
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +37 -36
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +36 -35
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +36 -35
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
- package/dist/astro/routes/api/auth/logout.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +7 -7
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/index.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- package/dist/astro/routes/api/dev/emails.mjs +3 -3
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +19 -11
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -41
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +12 -407
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +19 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +97 -79
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -11
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +40 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +519 -39
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +39 -39
- package/dist/astro/routes/api/media/_id_/confirm.mjs +7 -7
- package/dist/astro/routes/api/media/_id_.mjs +7 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
- package/dist/astro/routes/api/media/providers/index.mjs +3 -3
- package/dist/astro/routes/api/media/upload-url.mjs +8 -8
- package/dist/astro/routes/api/media.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/items.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/translations.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_.mjs +9 -9
- package/dist/astro/routes/api/menus/index.mjs +9 -9
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +4 -4
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +6 -14
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +9 -9
- package/dist/astro/routes/api/redirects/404s/summary.mjs +9 -9
- package/dist/astro/routes/api/redirects/_id_.mjs +10 -10
- package/dist/astro/routes/api/redirects/index.mjs +10 -10
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +7 -6
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +36 -35
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +36 -35
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +10 -10
- package/dist/astro/routes/api/search/index.mjs +9 -9
- package/dist/astro/routes/api/search/rebuild.mjs +10 -10
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +9 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +9 -9
- package/dist/astro/routes/api/sections/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +12 -12
- package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
- package/dist/astro/routes/api/setup/admin.mjs +10 -10
- package/dist/astro/routes/api/setup/dev-bypass.mjs +25 -24
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +26 -25
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +4 -4
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/index.mjs +13 -13
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +5 -5
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -9
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/types.d.mts +13 -13
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-C3a_zGsM.mjs → authorize-Dz88F_Fw.mjs} +2 -2
- package/dist/{authorize-C3a_zGsM.mjs.map → authorize-Dz88F_Fw.mjs.map} +1 -1
- package/dist/{byline-DEKSVPTy.mjs → byline-Bm8ZgUP9.mjs} +6 -6
- package/dist/{byline-DEKSVPTy.mjs.map → byline-Bm8ZgUP9.mjs.map} +1 -1
- package/dist/{byline-fields-eyJMblSr.mjs → byline-fields-2Lp5Hbgf.mjs} +18 -3
- package/dist/byline-fields-2Lp5Hbgf.mjs.map +1 -0
- package/dist/{byline-fields-CtQ6blXd.d.mts → byline-fields-CHE8UStY.d.mts} +47 -32
- package/dist/{byline-fields-CtQ6blXd.d.mts.map → byline-fields-CHE8UStY.d.mts.map} +1 -1
- package/dist/{byline-fields-DaMKzkhO.mjs → byline-fields-CIx_GuN4.mjs} +1 -1
- package/dist/{byline-fields-DaMKzkhO.mjs.map → byline-fields-CIx_GuN4.mjs.map} +1 -1
- package/dist/{bylines-Ds4-otXl.mjs → bylines-6tm9mgQb.mjs} +4 -4
- package/dist/{bylines-Ds4-otXl.mjs.map → bylines-6tm9mgQb.mjs.map} +1 -1
- package/dist/{bylines-CiqgTHWF.mjs → bylines-CAZxGSrm.mjs} +6 -6
- package/dist/{bylines-CiqgTHWF.mjs.map → bylines-CAZxGSrm.mjs.map} +1 -1
- package/dist/{cache-Ciu3e3AF.mjs → cache-CEBAZjir.mjs} +2 -2
- package/dist/{cache-Ciu3e3AF.mjs.map → cache-CEBAZjir.mjs.map} +1 -1
- package/dist/{challenge-store-LhiqMccz.mjs → challenge-store-anhwVER0.mjs} +1 -1
- package/dist/{challenge-store-LhiqMccz.mjs.map → challenge-store-anhwVER0.mjs.map} +1 -1
- package/dist/{chunks-CZFiauig.mjs → chunks-B2isWQhr.mjs} +2 -2
- package/dist/{chunks-CZFiauig.mjs.map → chunks-B2isWQhr.mjs.map} +1 -1
- package/dist/cli/index.mjs +22 -21
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -2
- package/dist/{comment-CH1IrFFs.mjs → comment-CzeatwBV.mjs} +3 -3
- package/dist/{comment-CH1IrFFs.mjs.map → comment-CzeatwBV.mjs.map} +1 -1
- package/dist/{comment-reaction-kruNY-kP.mjs → comment-reaction-Cj9QJY7I.mjs} +2 -2
- package/dist/{comment-reaction-kruNY-kP.mjs.map → comment-reaction-Cj9QJY7I.mjs.map} +1 -1
- package/dist/{comments-BUJyXbgq.mjs → comments-BLE-jv5k.mjs} +3 -3
- package/dist/{comments-BUJyXbgq.mjs.map → comments-BLE-jv5k.mjs.map} +1 -1
- package/dist/{components-CYt4uVK9.mjs → components-B_sATNUc.mjs} +1 -1
- package/dist/{components-CYt4uVK9.mjs.map → components-B_sATNUc.mjs.map} +1 -1
- package/dist/{content-RmfHoWqK.mjs → content-DhgEth4k.mjs} +4 -4
- package/dist/{content-RmfHoWqK.mjs.map → content-DhgEth4k.mjs.map} +1 -1
- package/dist/content-refresh-Br4gMzh8.mjs +1537 -0
- package/dist/content-refresh-Br4gMzh8.mjs.map +1 -0
- package/dist/{context-CzUU_WzL.mjs → context-BRIpHARC.mjs} +76 -54
- package/dist/context-BRIpHARC.mjs.map +1 -0
- package/dist/{cron-C5LVoNmP.mjs → cron-v4FTEFR_.mjs} +1 -1
- package/dist/{cron-C5LVoNmP.mjs.map → cron-v4FTEFR_.mjs.map} +1 -1
- package/dist/{dashboard-CVyGhift.mjs → dashboard-EvEKF5en.mjs} +4 -4
- package/dist/{dashboard-CVyGhift.mjs.map → dashboard-EvEKF5en.mjs.map} +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{default-CeRG-Ot4.mjs → default-CM_D83Mg.mjs} +1 -1
- package/dist/{default-CeRG-Ot4.mjs.map → default-CM_D83Mg.mjs.map} +1 -1
- package/dist/{device-flow-DENDCQ9F.mjs → device-flow-CfGP18Uw.mjs} +4 -4
- package/dist/{device-flow-DENDCQ9F.mjs.map → device-flow-CfGP18Uw.mjs.map} +1 -1
- package/dist/{email-console-DJP32ucW.mjs → email-console-CIf4Lfvv.mjs} +1 -1
- package/dist/{email-console-DJP32ucW.mjs.map → email-console-CIf4Lfvv.mjs.map} +1 -1
- package/dist/{error-BHkLZk-w.mjs → error-CkAseSqZ.mjs} +2 -2
- package/dist/{error-BHkLZk-w.mjs.map → error-CkAseSqZ.mjs.map} +1 -1
- package/dist/{escape-Bjio4ZsM.mjs → escape-DqD0aCKu.mjs} +1 -1
- package/dist/{escape-Bjio4ZsM.mjs.map → escape-DqD0aCKu.mjs.map} +1 -1
- package/dist/{field-defs-cache-BA-8ZPiT.mjs → field-defs-cache-WUI88LX5.mjs} +2 -2
- package/dist/{field-defs-cache-BA-8ZPiT.mjs.map → field-defs-cache-WUI88LX5.mjs.map} +1 -1
- package/dist/{fts-manager-Db9jGavf.mjs → fts-manager-BbFaF_V8.mjs} +2 -2
- package/dist/{fts-manager-Db9jGavf.mjs.map → fts-manager-BbFaF_V8.mjs.map} +1 -1
- package/dist/{import-Bb1T9WJS.mjs → import-fYLf14Co.mjs} +514 -25
- package/dist/import-fYLf14Co.mjs.map +1 -0
- package/dist/{index-CDZZjrLT.d.mts → index-B9sIxwe4.d.mts} +21 -22
- package/dist/{index-CDZZjrLT.d.mts.map → index-B9sIxwe4.d.mts.map} +1 -1
- package/dist/{index-DGIjmUXQ.d.mts → index-Bm-Gy8Mh.d.mts} +25 -4
- package/dist/index-Bm-Gy8Mh.d.mts.map +1 -0
- package/dist/index.d.mts +18 -18
- package/dist/index.mjs +54 -53
- package/dist/{load-DpHICVPh.mjs → load-Djn3HWQS.mjs} +2 -2
- package/dist/{load-DpHICVPh.mjs.map → load-Djn3HWQS.mjs.map} +1 -1
- package/dist/{loader-4K37qA-y.mjs → loader-CB6YHeul.mjs} +6 -5
- package/dist/loader-CB6YHeul.mjs.map +1 -0
- package/dist/{manifest-schema-kPGX7VS-.mjs → manifest-schema-BHlgZM1W.mjs} +1 -1
- package/dist/{manifest-schema-kPGX7VS-.mjs.map → manifest-schema-BHlgZM1W.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +5 -5
- package/dist/{media-C0nRRfs1.mjs → media-BrXIaMFN.mjs} +2 -2
- package/dist/{media-C0nRRfs1.mjs.map → media-BrXIaMFN.mjs.map} +1 -1
- package/dist/{media-allowlist-Du8t1u6a.mjs → media-allowlist-CRHEeJ_i.mjs} +1 -1
- package/dist/{media-allowlist-Du8t1u6a.mjs.map → media-allowlist-CRHEeJ_i.mjs.map} +1 -1
- package/dist/{media-url-O4rm9-SQ.mjs → media-url-CKi5XSw4.mjs} +1 -1
- package/dist/{media-url-O4rm9-SQ.mjs.map → media-url-CKi5XSw4.mjs.map} +1 -1
- package/dist/{menus-SL2K0xq2.mjs → menus-Cfivc2Ad.mjs} +3 -3
- package/dist/{menus-SL2K0xq2.mjs.map → menus-Cfivc2Ad.mjs.map} +1 -1
- package/dist/{menus-DzRyC1ID.mjs → menus-b2T4clbO.mjs} +16 -12
- package/dist/{menus-DzRyC1ID.mjs.map → menus-b2T4clbO.mjs.map} +1 -1
- package/dist/{mode-BB0F8xTC.mjs → mode-BM9QgEmt.mjs} +1 -1
- package/dist/{mode-BB0F8xTC.mjs.map → mode-BM9QgEmt.mjs.map} +1 -1
- package/dist/{oauth-authorization-CsvzIp_F.mjs → oauth-authorization-CXWkIGT4.mjs} +4 -4
- package/dist/{oauth-authorization-CsvzIp_F.mjs.map → oauth-authorization-CXWkIGT4.mjs.map} +1 -1
- package/dist/{oauth-clients-C9SYwEbZ.mjs → oauth-clients-BmTI5rsl.mjs} +1 -1
- package/dist/{oauth-clients-C9SYwEbZ.mjs.map → oauth-clients-BmTI5rsl.mjs.map} +1 -1
- package/dist/{oauth-state-store---zrApfB.mjs → oauth-state-store-YLFLcH5F.mjs} +1 -1
- package/dist/{oauth-state-store---zrApfB.mjs.map → oauth-state-store-YLFLcH5F.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-SHsWRlG9.mjs → oauth-user-lookup-Bsc_GsX-.mjs} +1 -1
- package/dist/{oauth-user-lookup-SHsWRlG9.mjs.map → oauth-user-lookup-Bsc_GsX-.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-CHbHv83-.mjs → object-cache-Bok5j2ae.mjs} +43 -3
- package/dist/object-cache-Bok5j2ae.mjs.map +1 -0
- package/dist/{options-41nCWqi9.d.mts → options-iMpRRxIe.d.mts} +3 -3
- package/dist/{options-41nCWqi9.d.mts.map → options-iMpRRxIe.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-CqyZj3Hp.mjs → parse-GmjecGct.mjs} +2 -2
- package/dist/{parse-CqyZj3Hp.mjs.map → parse-GmjecGct.mjs.map} +1 -1
- package/dist/{passkey-config-C0YfSBko.mjs → passkey-config-De0ahnRg.mjs} +1 -1
- package/dist/{passkey-config-C0YfSBko.mjs.map → passkey-config-De0ahnRg.mjs.map} +1 -1
- package/dist/{placeholder-Cuce9U-m.d.mts → placeholder-BSKwzRe4.d.mts} +1 -1
- package/dist/{placeholder-Cuce9U-m.d.mts.map → placeholder-BSKwzRe4.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{portable-text-BICg8bTk.mjs → portable-text-cCa0cGV6.mjs} +1 -1
- package/dist/{portable-text-BICg8bTk.mjs.map → portable-text-cCa0cGV6.mjs.map} +1 -1
- package/dist/{preview-DKGCt2_p.mjs → preview-SSXNVPAC.mjs} +2 -2
- package/dist/{preview-DKGCt2_p.mjs.map → preview-SSXNVPAC.mjs.map} +1 -1
- package/dist/{public-url-CTVqgMmg.mjs → public-url-Danv47cS.mjs} +1 -1
- package/dist/{public-url-CTVqgMmg.mjs.map → public-url-Danv47cS.mjs.map} +1 -1
- package/dist/{query-B0M-9LYR.mjs → query-1Cp6U9oo.mjs} +14 -14
- package/dist/{query-B0M-9LYR.mjs.map → query-1Cp6U9oo.mjs.map} +1 -1
- package/dist/{rate-limit-BwoUdIpC.mjs → rate-limit-C_Lf63Dd.mjs} +2 -2
- package/dist/{rate-limit-BwoUdIpC.mjs.map → rate-limit-C_Lf63Dd.mjs.map} +1 -1
- package/dist/{redirect-CS-PHtNh.mjs → redirect-CoW3G-0U.mjs} +1 -1
- package/dist/{redirect-CS-PHtNh.mjs.map → redirect-CoW3G-0U.mjs.map} +1 -1
- package/dist/{redirect-lMOzG04S.mjs → redirect-IyfNirgS.mjs} +2 -2
- package/dist/{redirect-lMOzG04S.mjs.map → redirect-IyfNirgS.mjs.map} +1 -1
- package/dist/{redirects-9218MmYl.mjs → redirects-Bs1g42Ri.mjs} +4 -4
- package/dist/{redirects-9218MmYl.mjs.map → redirects-Bs1g42Ri.mjs.map} +1 -1
- package/dist/{redirects-Dcbuisoj.mjs → redirects-DXEXBAII.mjs} +2 -2
- package/dist/{redirects-Dcbuisoj.mjs.map → redirects-DXEXBAII.mjs.map} +1 -1
- package/dist/{registry-DP-iEtdR.mjs → registry-B57vp_X9.mjs} +122 -79
- package/dist/registry-B57vp_X9.mjs.map +1 -0
- package/dist/{request-meta-CmS1tDFf.mjs → request-meta-DbvXaAvU.mjs} +2 -2
- package/dist/{request-meta-CmS1tDFf.mjs.map → request-meta-DbvXaAvU.mjs.map} +1 -1
- package/dist/{resolve-C7I0qiR0.mjs → resolve-DR3wqMTy.mjs} +1 -1
- package/dist/{resolve-C7I0qiR0.mjs.map → resolve-DR3wqMTy.mjs.map} +1 -1
- package/dist/{runner-BbR3DfrL.d.mts → runner-DvFWoz8-.d.mts} +2 -2
- package/dist/{runner-BbR3DfrL.d.mts.map → runner-DvFWoz8-.d.mts.map} +1 -1
- package/dist/{runner-CFngB4WZ.mjs → runner-K8XK101B.mjs} +309 -190
- package/dist/runner-K8XK101B.mjs.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +2 -2
- package/dist/{scheduled-publish-BMljtY5G.d.mts → scheduled-publish-Drffrf2a.d.mts} +1 -1
- package/dist/scheduled-publish-Drffrf2a.d.mts.map +1 -0
- package/dist/{schema-BfJ7bIXH.mjs → schema-CX9cfNkZ.mjs} +5 -5
- package/dist/{schema-BfJ7bIXH.mjs.map → schema-CX9cfNkZ.mjs.map} +1 -1
- package/dist/{search-C7t3PH1J.mjs → search-DZN2HZ-V.mjs} +4 -4
- package/dist/{search-C7t3PH1J.mjs.map → search-DZN2HZ-V.mjs.map} +1 -1
- package/dist/{secrets-BSf9pRRY.mjs → secrets-kp760LlD.mjs} +2 -2
- package/dist/{secrets-BSf9pRRY.mjs.map → secrets-kp760LlD.mjs.map} +1 -1
- package/dist/{sections-Dm0CVX23.mjs → sections-CpF5SaGr.mjs} +3 -3
- package/dist/{sections-Dm0CVX23.mjs.map → sections-CpF5SaGr.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +19 -18
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-BkhuuaaE.mjs → seo-89-53DDs.mjs} +1 -1
- package/dist/{seo-BkhuuaaE.mjs.map → seo-89-53DDs.mjs.map} +1 -1
- package/dist/{seo-Dd3tbY_k.mjs → seo-DXu2UQnC.mjs} +3 -3
- package/dist/{seo-Dd3tbY_k.mjs.map → seo-DXu2UQnC.mjs.map} +1 -1
- package/dist/{service-CTrqp_Jy.mjs → service-DQmiBMzt.mjs} +3 -3
- package/dist/{service-CTrqp_Jy.mjs.map → service-DQmiBMzt.mjs.map} +1 -1
- package/dist/{session-user-B8aLtKAH.mjs → session-user-Cascbax7.mjs} +1 -1
- package/dist/{session-user-B8aLtKAH.mjs.map → session-user-Cascbax7.mjs.map} +1 -1
- package/dist/{settings-CZ7ZP9cW.mjs → settings-rZyHEcNT.mjs} +3 -3
- package/dist/{settings-CZ7ZP9cW.mjs.map → settings-rZyHEcNT.mjs.map} +1 -1
- package/dist/{settings-BX8cWBus.mjs → settings-zhmdKyJQ.mjs} +5 -5
- package/dist/{settings-BX8cWBus.mjs.map → settings-zhmdKyJQ.mjs.map} +1 -1
- package/dist/{setup-complete-gEiySUc-.mjs → setup-complete-Cb3LRyzy.mjs} +1 -1
- package/dist/{setup-complete-gEiySUc-.mjs.map → setup-complete-Cb3LRyzy.mjs.map} +1 -1
- package/dist/{setup-nonce-DzS50zme.mjs → setup-nonce-Z8x0tHf8.mjs} +1 -1
- package/dist/{setup-nonce-DzS50zme.mjs.map → setup-nonce-Z8x0tHf8.mjs.map} +1 -1
- package/dist/{single-flight-cache-Cdfkic3t.mjs → single-flight-cache-BG3B_GhN.mjs} +1 -1
- package/dist/{single-flight-cache-Cdfkic3t.mjs.map → single-flight-cache-BG3B_GhN.mjs.map} +1 -1
- package/dist/{site-url-BLebyON8.mjs → site-url-BBfDTgZB.mjs} +1 -1
- package/dist/{site-url-BLebyON8.mjs.map → site-url-BBfDTgZB.mjs.map} +1 -1
- package/dist/{ssrf-BRKb343l.mjs → ssrf-1g7usGBg.mjs} +1 -1
- package/dist/{ssrf-BRKb343l.mjs.map → ssrf-1g7usGBg.mjs.map} +1 -1
- package/dist/{status-vUK0SA17.mjs → status-CqJQX1QN.mjs} +1 -1
- package/dist/{status-vUK0SA17.mjs.map → status-CqJQX1QN.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-DChKcVxf.mjs → taxonomies-Bs13SN-F.mjs} +4 -4
- package/dist/{taxonomies-DChKcVxf.mjs.map → taxonomies-Bs13SN-F.mjs.map} +1 -1
- package/dist/{taxonomies-ckPjz-6d.mjs → taxonomies-kH9ABDUF.mjs} +7 -7
- package/dist/{taxonomies-ckPjz-6d.mjs.map → taxonomies-kH9ABDUF.mjs.map} +1 -1
- package/dist/{taxonomy-Cru-he6s.mjs → taxonomy-BxGxZZdu.mjs} +4 -4
- package/dist/{taxonomy-Cru-he6s.mjs.map → taxonomy-BxGxZZdu.mjs.map} +1 -1
- package/dist/{tokens-LeuXF9gG.mjs → tokens-BGT0TUUo.mjs} +1 -1
- package/dist/{tokens-LeuXF9gG.mjs.map → tokens-BGT0TUUo.mjs.map} +1 -1
- package/dist/{transport-Blrl2k_o.d.mts → transport-BMDWHSgZ.d.mts} +1 -1
- package/dist/{transport-Blrl2k_o.d.mts.map → transport-BMDWHSgZ.d.mts.map} +1 -1
- package/dist/{transport-_2nBz7e9.mjs → transport-DPefPMcz.mjs} +1 -1
- package/dist/{transport-_2nBz7e9.mjs.map → transport-DPefPMcz.mjs.map} +1 -1
- package/dist/{trusted-proxy-DZY5WCn2.mjs → trusted-proxy-VTPRiX2s.mjs} +1 -1
- package/dist/{trusted-proxy-DZY5WCn2.mjs.map → trusted-proxy-VTPRiX2s.mjs.map} +1 -1
- package/dist/{types-ETmO_jQr.d.mts → types-BcLUUbbR.d.mts} +2 -2
- package/dist/{types-ETmO_jQr.d.mts.map → types-BcLUUbbR.d.mts.map} +1 -1
- package/dist/{types-BYnDBVwe.d.mts → types-CGbYowGQ.d.mts} +2 -2
- package/dist/{types-BYnDBVwe.d.mts.map → types-CGbYowGQ.d.mts.map} +1 -1
- package/dist/{types-CvuKO5Pn.d.mts → types-CgvhU-hF.d.mts} +1 -1
- package/dist/{types-CvuKO5Pn.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
- package/dist/{types-Y09-wtyU.d.mts → types-ClUkdbWb.d.mts} +1 -1
- package/dist/{types-Y09-wtyU.d.mts.map → types-ClUkdbWb.d.mts.map} +1 -1
- package/dist/{types-DU4TSFS5.mjs → types-CuW0zWDA.mjs} +2 -2
- package/dist/{types-DU4TSFS5.mjs.map → types-CuW0zWDA.mjs.map} +1 -1
- package/dist/{types-BkZ8DUEI.d.mts → types-DmHk7vAt.d.mts} +1 -1
- package/dist/{types-BkZ8DUEI.d.mts.map → types-DmHk7vAt.d.mts.map} +1 -1
- package/dist/{types-CQAugunJ.mjs → types-Jo3UYd6b.mjs} +1 -1
- package/dist/{types-CQAugunJ.mjs.map → types-Jo3UYd6b.mjs.map} +1 -1
- package/dist/{types-xIfVRNLp.d.mts → types-_HFLRzTn.d.mts} +22 -1
- package/dist/types-_HFLRzTn.d.mts.map +1 -0
- package/dist/{types-ByChcBgE.d.mts → types-ea9sAPck.d.mts} +1 -1
- package/dist/{types-ByChcBgE.d.mts.map → types-ea9sAPck.d.mts.map} +1 -1
- package/dist/{types-CNlaBFzx.d.mts → types-g_aFIdW0.d.mts} +1 -1
- package/dist/{types-CNlaBFzx.d.mts.map → types-g_aFIdW0.d.mts.map} +1 -1
- package/dist/{types-Dbqff978.d.mts → types-vgEWF18A.d.mts} +19 -1
- package/dist/{types-Dbqff978.d.mts.map → types-vgEWF18A.d.mts.map} +1 -1
- package/dist/{user-DgGbKL9s.mjs → user-BjAOvU3Z.mjs} +3 -3
- package/dist/{user-DgGbKL9s.mjs.map → user-BjAOvU3Z.mjs.map} +1 -1
- package/dist/{utils-B7A57fm9.mjs → utils-BJXElxdw.mjs} +156 -7
- package/dist/utils-BJXElxdw.mjs.map +1 -0
- package/dist/{validate-CRkcYZAR.mjs → validate-CWSnKVIJ.mjs} +2 -2
- package/dist/{validate-CRkcYZAR.mjs.map → validate-CWSnKVIJ.mjs.map} +1 -1
- package/dist/{validate-9ECmtEpJ.d.mts → validate-Z1b86_3B.d.mts} +5 -5
- package/dist/{validate-9ECmtEpJ.d.mts.map → validate-Z1b86_3B.d.mts.map} +1 -1
- package/dist/{validation-sR26SOwD.mjs → validation-0l8-RYj4.mjs} +8 -5
- package/dist/{validation-sR26SOwD.mjs.map → validation-0l8-RYj4.mjs.map} +1 -1
- package/dist/version-qmeO1XZY.mjs +7 -0
- package/dist/{version-CrqhKGWn.mjs.map → version-qmeO1XZY.mjs.map} +1 -1
- package/dist/{widgets-DRgtn7Cl.mjs → widgets-hWcIicX8.mjs} +3 -3
- package/dist/{widgets-DRgtn7Cl.mjs.map → widgets-hWcIicX8.mjs.map} +1 -1
- package/dist/wxr-taxonomies-0_uxSrmf.d.mts +34 -0
- package/dist/wxr-taxonomies-0_uxSrmf.d.mts.map +1 -0
- package/dist/wxr-taxonomies-CNFcsNCr.mjs +425 -0
- package/dist/wxr-taxonomies-CNFcsNCr.mjs.map +1 -0
- package/dist/{zod-generator-C5JaV--i.mjs → zod-generator-CacrR-i8.mjs} +2 -2
- package/dist/{zod-generator-C5JaV--i.mjs.map → zod-generator-CacrR-i8.mjs.map} +1 -1
- package/package.json +7 -7
- package/src/api/handlers/content.ts +10 -7
- package/src/api/schemas/import.ts +19 -0
- package/src/astro/integration/runtime.ts +3 -6
- package/src/astro/middleware/auth.ts +9 -3
- package/src/astro/middleware/csp.ts +54 -3
- package/src/astro/routes/admin.astro +9 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +122 -98
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +794 -44
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +17 -15
- package/src/components/EmDashImage.astro +59 -23
- package/src/components/Image.astro +36 -35
- package/src/database/migrations/049_taxonomies_name_locale_index.ts +42 -0
- package/src/database/migrations/050_media_usage_index_status.ts +142 -0
- package/src/database/migrations/runner.ts +4 -0
- package/src/database/repositories/media-usage.ts +955 -59
- package/src/database/types.ts +22 -0
- package/src/emdash-runtime.ts +123 -3
- package/src/import/comments.ts +159 -0
- package/src/import/index.ts +8 -1
- package/src/import/settings.ts +65 -189
- package/src/import/sources/wordpress-plugin.ts +338 -42
- package/src/import/sources/wxr.ts +4 -1
- package/src/import/types.ts +12 -0
- package/src/import/utils.ts +207 -0
- package/src/import/wxr-taxonomies.ts +39 -0
- package/src/loader.ts +13 -2
- package/src/media/usage/content-fields.ts +119 -0
- package/src/media/usage/content-refresh.ts +524 -0
- package/src/media/usage/content-repair.ts +675 -0
- package/src/media/usage/content-snapshots.ts +439 -0
- package/src/media/usage/extractor.ts +4 -4
- package/src/media/usage/source-key.ts +22 -0
- package/src/menus/index.ts +17 -1
- package/src/object-cache/index.ts +82 -7
- package/src/plugins/context.ts +100 -71
- package/src/schema/registry.ts +240 -154
- package/src/seed/apply.ts +156 -99
- package/dist/api-80kycR9o.mjs.map +0 -1
- package/dist/apply-DSypk6Iu.mjs.map +0 -1
- package/dist/byline-fields-eyJMblSr.mjs.map +0 -1
- package/dist/context-CzUU_WzL.mjs.map +0 -1
- package/dist/import-Bb1T9WJS.mjs.map +0 -1
- package/dist/index-DGIjmUXQ.d.mts.map +0 -1
- package/dist/loader-4K37qA-y.mjs.map +0 -1
- package/dist/object-cache-CHbHv83-.mjs.map +0 -1
- package/dist/registry-DP-iEtdR.mjs.map +0 -1
- package/dist/runner-CFngB4WZ.mjs.map +0 -1
- package/dist/scheduled-publish-BMljtY5G.d.mts.map +0 -1
- package/dist/types-xIfVRNLp.d.mts.map +0 -1
- package/dist/utils-B7A57fm9.mjs.map +0 -1
- package/dist/version-CrqhKGWn.mjs +0 -7
- /package/dist/{api-tokens-B4BQybOp.mjs → api-tokens-DsvvCtdh.mjs} +0 -0
- /package/dist/{ssrf-CcX9zvMK.mjs → ssrf-CmuGgCq3.mjs} +0 -0
- /package/dist/{types-BvbeGEtr.mjs → types-DROWRxYV.mjs} +0 -0
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import { gutenbergToPortableText } from "@emdash-cms/gutenberg-to-portable-text";
|
|
9
9
|
|
|
10
10
|
import { encodeBase64 } from "../../utils/base64.js";
|
|
11
|
+
import type { PluginComment } from "../comments.js";
|
|
12
|
+
import type { PluginMenu } from "../menus.js";
|
|
11
13
|
import { ssrfSafeFetch, validateExternalUrl } from "../ssrf.js";
|
|
12
14
|
import type {
|
|
13
15
|
ImportSource,
|
|
@@ -28,6 +30,9 @@ import {
|
|
|
28
30
|
mapWpStatus,
|
|
29
31
|
normalizeUrl,
|
|
30
32
|
checkSchemaCompatibility,
|
|
33
|
+
isPluginBookkeepingMeta,
|
|
34
|
+
relativizeContentLinks,
|
|
35
|
+
sanitizeFieldSlug,
|
|
31
36
|
} from "../utils.js";
|
|
32
37
|
|
|
33
38
|
// =============================================================================
|
|
@@ -216,6 +221,67 @@ interface PluginMediaItem {
|
|
|
216
221
|
/** Pattern to remove spaces from application passwords */
|
|
217
222
|
const SPACE_PATTERN = /\s/g;
|
|
218
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Build the REST API URL for a plugin endpoint.
|
|
226
|
+
*
|
|
227
|
+
* `restRoute: false` uses the pretty form (`/wp-json/emdash/v1/...`),
|
|
228
|
+
* `restRoute: true` uses the `?rest_route=` form that works on sites with
|
|
229
|
+
* plain permalinks (where `/wp-json/` doesn't exist).
|
|
230
|
+
*/
|
|
231
|
+
function pluginApiUrl(
|
|
232
|
+
siteUrl: string,
|
|
233
|
+
path: string,
|
|
234
|
+
params: Record<string, string> = {},
|
|
235
|
+
restRoute = false,
|
|
236
|
+
): string {
|
|
237
|
+
if (restRoute) {
|
|
238
|
+
const url = new URL(siteUrl + "/");
|
|
239
|
+
url.searchParams.set("rest_route", `/emdash/v1/${path}`);
|
|
240
|
+
for (const [key, value] of Object.entries(params)) {
|
|
241
|
+
url.searchParams.set(key, value);
|
|
242
|
+
}
|
|
243
|
+
return url.toString();
|
|
244
|
+
}
|
|
245
|
+
const url = new URL(`${siteUrl}/wp-json/emdash/v1/${path}`);
|
|
246
|
+
for (const [key, value] of Object.entries(params)) {
|
|
247
|
+
url.searchParams.set(key, value);
|
|
248
|
+
}
|
|
249
|
+
return url.toString();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Fetch a plugin API endpoint, falling back to the `?rest_route=` form when
|
|
254
|
+
* the pretty `/wp-json/` route 404s or is unreachable. Sites with "Plain"
|
|
255
|
+
* permalinks have no `/wp-json/` rewrite, so without this fallback they
|
|
256
|
+
* always fail with a misleading 404.
|
|
257
|
+
*/
|
|
258
|
+
async function fetchPluginApi(
|
|
259
|
+
siteUrl: string,
|
|
260
|
+
path: string,
|
|
261
|
+
params: Record<string, string>,
|
|
262
|
+
headers: HeadersInit,
|
|
263
|
+
timeoutMs: number,
|
|
264
|
+
): Promise<Response> {
|
|
265
|
+
let pretty: Response | null = null;
|
|
266
|
+
try {
|
|
267
|
+
pretty = await ssrfSafeFetch(pluginApiUrl(siteUrl, path, params), {
|
|
268
|
+
headers,
|
|
269
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
270
|
+
});
|
|
271
|
+
} catch {
|
|
272
|
+
// Network-level failure -- try the rest_route form before giving up.
|
|
273
|
+
}
|
|
274
|
+
// Any response other than 404 (including 401/403/500) is authoritative:
|
|
275
|
+
// the route exists, so don't mask the real error with a fallback attempt.
|
|
276
|
+
if (pretty && pretty.status !== 404) {
|
|
277
|
+
return pretty;
|
|
278
|
+
}
|
|
279
|
+
return ssrfSafeFetch(pluginApiUrl(siteUrl, path, params, true), {
|
|
280
|
+
headers,
|
|
281
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
|
|
219
285
|
// =============================================================================
|
|
220
286
|
// Import Source
|
|
221
287
|
// =============================================================================
|
|
@@ -235,12 +301,13 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
235
301
|
// SSRF protection: validate URL before any outbound requests
|
|
236
302
|
validateExternalUrl(siteUrl);
|
|
237
303
|
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
304
|
+
const response = await fetchPluginApi(
|
|
305
|
+
siteUrl,
|
|
306
|
+
"probe",
|
|
307
|
+
{},
|
|
308
|
+
{ Accept: "application/json" },
|
|
309
|
+
10000,
|
|
310
|
+
);
|
|
244
311
|
|
|
245
312
|
if (!response.ok) {
|
|
246
313
|
return null;
|
|
@@ -293,10 +360,7 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
293
360
|
async analyze(input: SourceInput, context: ImportContext): Promise<ImportAnalysis> {
|
|
294
361
|
const { siteUrl, headers } = getRequestConfig(input);
|
|
295
362
|
|
|
296
|
-
const response = await
|
|
297
|
-
headers,
|
|
298
|
-
signal: AbortSignal.timeout(30000),
|
|
299
|
-
});
|
|
363
|
+
const response = await fetchPluginApi(siteUrl, "analyze", {}, headers, 30000);
|
|
300
364
|
|
|
301
365
|
if (!response.ok) {
|
|
302
366
|
const body: unknown = await response.json().catch(() => undefined);
|
|
@@ -330,6 +394,23 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
330
394
|
? [...BASE_REQUIRED_FIELDS, FEATURED_IMAGE_FIELD]
|
|
331
395
|
: [...BASE_REQUIRED_FIELDS];
|
|
332
396
|
|
|
397
|
+
// Surface the post type's custom fields (ACF and plain meta) so
|
|
398
|
+
// the prepare step creates them — without this, execute() has no
|
|
399
|
+
// matching schema fields and silently drops the values.
|
|
400
|
+
const knownSlugs = new Set(requiredFields.map((f) => f.slug));
|
|
401
|
+
for (const customField of pt.custom_fields ?? []) {
|
|
402
|
+
if (isPluginBookkeepingMeta(customField.key)) continue;
|
|
403
|
+
const slug = sanitizeFieldSlug(customField.key);
|
|
404
|
+
if (knownSlugs.has(slug)) continue;
|
|
405
|
+
knownSlugs.add(slug);
|
|
406
|
+
requiredFields.push({
|
|
407
|
+
slug,
|
|
408
|
+
label: fieldLabelFromKey(customField.key),
|
|
409
|
+
type: mapInferredFieldType(customField.inferred_type),
|
|
410
|
+
required: false,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
333
414
|
return {
|
|
334
415
|
name: pt.name,
|
|
335
416
|
count: pt.total,
|
|
@@ -339,20 +420,24 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
339
420
|
};
|
|
340
421
|
});
|
|
341
422
|
|
|
342
|
-
// Fetch media list
|
|
423
|
+
// Fetch the full media list, paginated. Stopping after the first page
|
|
424
|
+
// silently capped imports at 500 attachments (wp-emdash #1).
|
|
343
425
|
const attachments: AttachmentInfo[] = [];
|
|
344
426
|
if (data.attachments.count > 0) {
|
|
345
427
|
try {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
428
|
+
let page = 1;
|
|
429
|
+
let totalPages = 1;
|
|
430
|
+
while (page <= totalPages) {
|
|
431
|
+
const mediaResponse = await fetchPluginApi(
|
|
432
|
+
siteUrl,
|
|
433
|
+
"media",
|
|
434
|
+
{ per_page: "500", page: String(page) },
|
|
350
435
|
headers,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (mediaResponse.ok) {
|
|
436
|
+
30000,
|
|
437
|
+
);
|
|
438
|
+
if (!mediaResponse.ok) break;
|
|
355
439
|
const mediaData: PluginMediaResponse = await mediaResponse.json();
|
|
440
|
+
totalPages = mediaData.pages;
|
|
356
441
|
for (const item of mediaData.items) {
|
|
357
442
|
attachments.push({
|
|
358
443
|
id: item.id,
|
|
@@ -366,6 +451,7 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
366
451
|
height: item.height,
|
|
367
452
|
});
|
|
368
453
|
}
|
|
454
|
+
page++;
|
|
369
455
|
}
|
|
370
456
|
} catch (e) {
|
|
371
457
|
console.warn("Failed to fetch media list:", e);
|
|
@@ -410,12 +496,13 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
410
496
|
|
|
411
497
|
while (page <= totalPages) {
|
|
412
498
|
const status = options.includeDrafts ? "any" : "publish";
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
499
|
+
const response = await fetchPluginApi(
|
|
500
|
+
siteUrl,
|
|
501
|
+
"content",
|
|
502
|
+
{ post_type: postType, status, per_page: "100", page: String(page) },
|
|
416
503
|
headers,
|
|
417
|
-
|
|
418
|
-
|
|
504
|
+
60000,
|
|
505
|
+
);
|
|
419
506
|
|
|
420
507
|
if (!response.ok) {
|
|
421
508
|
throw new Error(`Failed to fetch ${postType}: ${response.statusText}`);
|
|
@@ -425,7 +512,7 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
425
512
|
totalPages = data.pages;
|
|
426
513
|
|
|
427
514
|
for (const post of data.items) {
|
|
428
|
-
yield pluginPostToNormalizedItem(post);
|
|
515
|
+
yield pluginPostToNormalizedItem(post, siteUrl);
|
|
429
516
|
yielded++;
|
|
430
517
|
|
|
431
518
|
if (options.limit && yielded >= options.limit) {
|
|
@@ -451,10 +538,85 @@ export const wordpressPluginSource: ImportSource = {
|
|
|
451
538
|
},
|
|
452
539
|
};
|
|
453
540
|
|
|
541
|
+
/**
|
|
542
|
+
* Fetch a single page of content for one post type. This is the unit of
|
|
543
|
+
* work for the chunked import: one Worker invocation imports one page,
|
|
544
|
+
* keeping each request far below Cloudflare's CPU and subrequest limits
|
|
545
|
+
* (see issue #475).
|
|
546
|
+
*/
|
|
547
|
+
export async function fetchPluginContentPage(options: {
|
|
548
|
+
siteUrl: string;
|
|
549
|
+
token: string;
|
|
550
|
+
postType: string;
|
|
551
|
+
page: number;
|
|
552
|
+
perPage: number;
|
|
553
|
+
includeDrafts: boolean;
|
|
554
|
+
}): Promise<{ items: NormalizedItem[]; totalPages: number }> {
|
|
555
|
+
const { siteUrl, headers } = getRequestConfig({
|
|
556
|
+
type: "url",
|
|
557
|
+
url: options.siteUrl,
|
|
558
|
+
token: options.token,
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
const response = await fetchPluginApi(
|
|
562
|
+
siteUrl,
|
|
563
|
+
"content",
|
|
564
|
+
{
|
|
565
|
+
post_type: options.postType,
|
|
566
|
+
status: options.includeDrafts ? "any" : "publish",
|
|
567
|
+
per_page: String(options.perPage),
|
|
568
|
+
page: String(options.page),
|
|
569
|
+
},
|
|
570
|
+
headers,
|
|
571
|
+
60000,
|
|
572
|
+
);
|
|
573
|
+
|
|
574
|
+
if (!response.ok) {
|
|
575
|
+
throw new Error(`Failed to fetch ${options.postType}: ${response.statusText}`);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
const data: PluginContentResponse = await response.json();
|
|
579
|
+
return {
|
|
580
|
+
items: data.items.map((post) => pluginPostToNormalizedItem(post, siteUrl)),
|
|
581
|
+
totalPages: data.pages,
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
454
585
|
// =============================================================================
|
|
455
586
|
// Helper Functions
|
|
456
587
|
// =============================================================================
|
|
457
588
|
|
|
589
|
+
/** Plugin `inferred_type` values that are valid EmDash field types as-is */
|
|
590
|
+
const VALID_INFERRED_TYPES = new Set([
|
|
591
|
+
"string",
|
|
592
|
+
"text",
|
|
593
|
+
"number",
|
|
594
|
+
"integer",
|
|
595
|
+
"boolean",
|
|
596
|
+
"datetime",
|
|
597
|
+
"json",
|
|
598
|
+
"reference",
|
|
599
|
+
]);
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Map the plugin's inferred custom-field type to an EmDash field type.
|
|
603
|
+
* Unknown values fall back to string (always safe for TEXT storage).
|
|
604
|
+
*/
|
|
605
|
+
function mapInferredFieldType(inferredType: string): string {
|
|
606
|
+
return VALID_INFERRED_TYPES.has(inferredType) ? inferredType : "string";
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const FIELD_KEY_SEPARATORS = /[_-]+/;
|
|
610
|
+
|
|
611
|
+
/** Derive a human label from a meta key: "event_start-date" -> "Event Start Date" */
|
|
612
|
+
function fieldLabelFromKey(key: string): string {
|
|
613
|
+
return key
|
|
614
|
+
.split(FIELD_KEY_SEPARATORS)
|
|
615
|
+
.filter(Boolean)
|
|
616
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
617
|
+
.join(" ");
|
|
618
|
+
}
|
|
619
|
+
|
|
458
620
|
/**
|
|
459
621
|
* Convert plugin i18n info to the shared I18nDetection type.
|
|
460
622
|
* Returns undefined when no multilingual plugin is detected.
|
|
@@ -513,8 +675,9 @@ function getRequestConfig(input: SourceInput): {
|
|
|
513
675
|
/**
|
|
514
676
|
* Convert plugin post to normalized item
|
|
515
677
|
*/
|
|
516
|
-
function pluginPostToNormalizedItem(post: PluginPost): NormalizedItem {
|
|
678
|
+
function pluginPostToNormalizedItem(post: PluginPost, siteUrl: string): NormalizedItem {
|
|
517
679
|
const content = post.content ? gutenbergToPortableText(post.content) : [];
|
|
680
|
+
relativizeContentLinks(content, siteUrl);
|
|
518
681
|
|
|
519
682
|
// Extract categories and tags from taxonomies
|
|
520
683
|
const categories =
|
|
@@ -526,6 +689,15 @@ function pluginPostToNormalizedItem(post: PluginPost): NormalizedItem {
|
|
|
526
689
|
post.taxonomies?.tags?.map((t) => t.slug) ??
|
|
527
690
|
[];
|
|
528
691
|
|
|
692
|
+
// Everything else is a custom taxonomy assignment (genre, product_cat, ...)
|
|
693
|
+
const customTaxonomies: Record<string, string[]> = {};
|
|
694
|
+
for (const [name, terms] of Object.entries(post.taxonomies ?? {})) {
|
|
695
|
+
if (["category", "categories", "post_tag", "tags"].includes(name)) continue;
|
|
696
|
+
if (Array.isArray(terms) && terms.length > 0) {
|
|
697
|
+
customTaxonomies[name] = terms.map((t) => t.slug);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
529
701
|
// Build meta from various sources
|
|
530
702
|
const meta: Record<string, unknown> = { ...post.meta };
|
|
531
703
|
|
|
@@ -555,6 +727,7 @@ function pluginPostToNormalizedItem(post: PluginPost): NormalizedItem {
|
|
|
555
727
|
author: post.author?.login,
|
|
556
728
|
categories,
|
|
557
729
|
tags,
|
|
730
|
+
customTaxonomies: Object.keys(customTaxonomies).length > 0 ? customTaxonomies : undefined,
|
|
558
731
|
meta,
|
|
559
732
|
featuredImage: post.featured_image?.url,
|
|
560
733
|
locale: post.locale,
|
|
@@ -589,14 +762,13 @@ export async function fetchPluginMedia(
|
|
|
589
762
|
// SSRF protection: validate URL before any outbound requests
|
|
590
763
|
validateExternalUrl(normalizedSiteUrl);
|
|
591
764
|
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
});
|
|
765
|
+
const response = await fetchPluginApi(
|
|
766
|
+
normalizedSiteUrl,
|
|
767
|
+
"media",
|
|
768
|
+
{ per_page: String(perPage), page: String(page) },
|
|
769
|
+
{ Accept: "application/json", Authorization: `Basic ${authToken}` },
|
|
770
|
+
30000,
|
|
771
|
+
);
|
|
600
772
|
|
|
601
773
|
if (!response.ok) {
|
|
602
774
|
throw new Error(`Failed to fetch media: ${response.statusText}`);
|
|
@@ -615,7 +787,11 @@ export async function fetchPluginTaxonomies(
|
|
|
615
787
|
Array<{
|
|
616
788
|
name: string;
|
|
617
789
|
label: string;
|
|
790
|
+
/** Singular label (added in emdash-exporter 1.2.0) */
|
|
791
|
+
label_singular?: string;
|
|
618
792
|
hierarchical: boolean;
|
|
793
|
+
/** WP post types this taxonomy is registered for (added in emdash-exporter 1.2.0) */
|
|
794
|
+
post_types?: string[];
|
|
619
795
|
terms: Array<{
|
|
620
796
|
id: number;
|
|
621
797
|
name: string;
|
|
@@ -631,14 +807,13 @@ export async function fetchPluginTaxonomies(
|
|
|
631
807
|
// SSRF protection: validate URL before any outbound requests
|
|
632
808
|
validateExternalUrl(normalizedSiteUrl);
|
|
633
809
|
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
});
|
|
810
|
+
const response = await fetchPluginApi(
|
|
811
|
+
normalizedSiteUrl,
|
|
812
|
+
"taxonomies",
|
|
813
|
+
{},
|
|
814
|
+
{ Accept: "application/json", Authorization: `Basic ${authToken}` },
|
|
815
|
+
30000,
|
|
816
|
+
);
|
|
642
817
|
|
|
643
818
|
if (!response.ok) {
|
|
644
819
|
throw new Error(`Failed to fetch taxonomies: ${response.statusText}`);
|
|
@@ -646,3 +821,124 @@ export async function fetchPluginTaxonomies(
|
|
|
646
821
|
|
|
647
822
|
return response.json();
|
|
648
823
|
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Fetch navigation menus from plugin API (added in emdash-exporter 1.1.0).
|
|
827
|
+
* Returns an empty array when the endpoint doesn't exist (older plugin).
|
|
828
|
+
*/
|
|
829
|
+
export async function fetchPluginMenus(siteUrl: string, authToken: string): Promise<PluginMenu[]> {
|
|
830
|
+
const normalizedSiteUrl = normalizeUrl(siteUrl);
|
|
831
|
+
|
|
832
|
+
// SSRF protection: validate URL before any outbound requests
|
|
833
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
834
|
+
|
|
835
|
+
const response = await fetchPluginApi(
|
|
836
|
+
normalizedSiteUrl,
|
|
837
|
+
"menus",
|
|
838
|
+
{},
|
|
839
|
+
{ Accept: "application/json", Authorization: `Basic ${authToken}` },
|
|
840
|
+
30000,
|
|
841
|
+
);
|
|
842
|
+
|
|
843
|
+
if (response.status === 404) {
|
|
844
|
+
return [];
|
|
845
|
+
}
|
|
846
|
+
if (!response.ok) {
|
|
847
|
+
throw new Error(`Failed to fetch menus: ${response.statusText}`);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
return response.json();
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Fetch site options from plugin API (title, tagline, logo, favicon, ...)
|
|
855
|
+
*/
|
|
856
|
+
export async function fetchPluginOptions(
|
|
857
|
+
siteUrl: string,
|
|
858
|
+
authToken: string,
|
|
859
|
+
): Promise<Record<string, unknown>> {
|
|
860
|
+
const normalizedSiteUrl = normalizeUrl(siteUrl);
|
|
861
|
+
|
|
862
|
+
// SSRF protection: validate URL before any outbound requests
|
|
863
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
864
|
+
|
|
865
|
+
const response = await fetchPluginApi(
|
|
866
|
+
normalizedSiteUrl,
|
|
867
|
+
"options",
|
|
868
|
+
{},
|
|
869
|
+
{ Accept: "application/json", Authorization: `Basic ${authToken}` },
|
|
870
|
+
30000,
|
|
871
|
+
);
|
|
872
|
+
|
|
873
|
+
if (!response.ok) {
|
|
874
|
+
throw new Error(`Failed to fetch options: ${response.statusText}`);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
return response.json();
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/** Comments response from /emdash/v1/comments */
|
|
881
|
+
interface PluginCommentsResponse {
|
|
882
|
+
items: PluginComment[];
|
|
883
|
+
total: number;
|
|
884
|
+
pages: number;
|
|
885
|
+
page: number;
|
|
886
|
+
per_page: number;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Fetch a single page of comments from the plugin API (added in
|
|
891
|
+
* emdash-exporter 1.2.0). The exporter orders by comment ID ascending, so
|
|
892
|
+
* parents always appear before their children across pages. Returns
|
|
893
|
+
* `totalPages: 0` when the endpoint doesn't exist (older plugin).
|
|
894
|
+
*/
|
|
895
|
+
export async function fetchPluginCommentsPage(
|
|
896
|
+
siteUrl: string,
|
|
897
|
+
authToken: string,
|
|
898
|
+
page: number,
|
|
899
|
+
): Promise<{ items: PluginComment[]; totalPages: number }> {
|
|
900
|
+
const normalizedSiteUrl = normalizeUrl(siteUrl);
|
|
901
|
+
|
|
902
|
+
// SSRF protection: validate URL before any outbound requests
|
|
903
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
904
|
+
|
|
905
|
+
const response = await fetchPluginApi(
|
|
906
|
+
normalizedSiteUrl,
|
|
907
|
+
"comments",
|
|
908
|
+
{ per_page: "500", page: String(page) },
|
|
909
|
+
{ Accept: "application/json", Authorization: `Basic ${authToken}` },
|
|
910
|
+
30000,
|
|
911
|
+
);
|
|
912
|
+
|
|
913
|
+
if (response.status === 404) {
|
|
914
|
+
return { items: [], totalPages: 0 };
|
|
915
|
+
}
|
|
916
|
+
if (!response.ok) {
|
|
917
|
+
throw new Error(`Failed to fetch comments: ${response.statusText}`);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
const data: PluginCommentsResponse = await response.json();
|
|
921
|
+
return { items: data.items, totalPages: data.pages };
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Fetch all comments from plugin API, paginating through every page.
|
|
926
|
+
* Returns an empty array when the endpoint doesn't exist (older plugin).
|
|
927
|
+
*/
|
|
928
|
+
export async function fetchPluginComments(
|
|
929
|
+
siteUrl: string,
|
|
930
|
+
authToken: string,
|
|
931
|
+
): Promise<PluginComment[]> {
|
|
932
|
+
const comments: PluginComment[] = [];
|
|
933
|
+
let page = 1;
|
|
934
|
+
let totalPages = 1;
|
|
935
|
+
|
|
936
|
+
while (page <= totalPages) {
|
|
937
|
+
const result = await fetchPluginCommentsPage(siteUrl, authToken, page);
|
|
938
|
+
totalPages = result.totalPages;
|
|
939
|
+
comments.push(...result.items);
|
|
940
|
+
page++;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
return comments;
|
|
944
|
+
}
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
getFilenameFromUrl,
|
|
36
36
|
guessMimeType,
|
|
37
37
|
checkSchemaCompatibility,
|
|
38
|
+
relativizeContentLinks,
|
|
38
39
|
} from "../utils.js";
|
|
39
40
|
|
|
40
41
|
export const wxrSource: ImportSource = {
|
|
@@ -92,7 +93,7 @@ export const wxrSource: ImportSource = {
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
// Convert to normalized item
|
|
95
|
-
yield wxrPostToNormalizedItem(post, attachmentMap);
|
|
96
|
+
yield wxrPostToNormalizedItem(post, attachmentMap, wxr.site.link || "");
|
|
96
97
|
|
|
97
98
|
count++;
|
|
98
99
|
if (options.limit && count >= options.limit) {
|
|
@@ -281,8 +282,10 @@ function analyzeWxrData(
|
|
|
281
282
|
function wxrPostToNormalizedItem(
|
|
282
283
|
post: WxrPost,
|
|
283
284
|
attachmentMap: Map<string, string>,
|
|
285
|
+
siteUrl: string,
|
|
284
286
|
): NormalizedItem {
|
|
285
287
|
const content = post.content ? gutenbergToPortableText(post.content) : [];
|
|
288
|
+
if (siteUrl) relativizeContentLinks(content, siteUrl);
|
|
286
289
|
|
|
287
290
|
// Resolve featured image: _thumbnail_id is the attachment ID, look up the URL
|
|
288
291
|
const thumbnailId = post.meta.get("_thumbnail_id");
|
package/src/import/types.ts
CHANGED
|
@@ -353,6 +353,18 @@ export interface ImportResult {
|
|
|
353
353
|
skipped: number;
|
|
354
354
|
errors: Array<{ title: string; error: string }>;
|
|
355
355
|
byCollection: Record<string, number>;
|
|
356
|
+
/** Number of taxonomy term assignments written (plugin import) */
|
|
357
|
+
taxonomyAssignments?: number;
|
|
358
|
+
/** Source taxonomies skipped because no matching EmDash taxonomy def exists */
|
|
359
|
+
missingTaxonomies?: string[];
|
|
360
|
+
/** Custom taxonomy defs auto-created during the import (plugin import) */
|
|
361
|
+
taxonomiesCreated?: string[];
|
|
362
|
+
/** Navigation menu import summary (plugin import) */
|
|
363
|
+
menus?: { created: number; items: number };
|
|
364
|
+
/** Comment import summary (plugin import) */
|
|
365
|
+
comments?: { imported: number; skipped: number };
|
|
366
|
+
/** Site settings applied from the source (plugin import) */
|
|
367
|
+
siteSettings?: string[];
|
|
356
368
|
}
|
|
357
369
|
|
|
358
370
|
// =============================================================================
|