emdash 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-BFURZn1i.mjs} +33 -23
- package/dist/api-BFURZn1i.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-Bu-8nYHL.mjs} +111 -74
- package/dist/apply-Bu-8nYHL.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_.mjs +4 -4
- 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-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/{byline-fields-CtQ6blXd.d.mts → byline-fields-Cgrt9-aL.d.mts} +49 -34
- package/dist/{byline-fields-CtQ6blXd.d.mts.map → byline-fields-Cgrt9-aL.d.mts.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-Woq87129.mjs} +6 -6
- package/dist/{bylines-CiqgTHWF.mjs.map → bylines-Woq87129.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-CA4uKwzH.mjs +1531 -0
- package/dist/content-refresh-CA4uKwzH.mjs.map +1 -0
- package/dist/{context-CzUU_WzL.mjs → context-CUsR9dXL.mjs} +76 -54
- package/dist/context-CUsR9dXL.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-CsZ2ZEK2.mjs} +16 -12
- package/dist/{menus-DzRyC1ID.mjs.map → menus-CsZ2ZEK2.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-ByGq6ver.mjs} +14 -14
- package/dist/{query-B0M-9LYR.mjs.map → query-ByGq6ver.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-B65mUtPa.mjs} +122 -79
- package/dist/registry-B65mUtPa.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-Blhoxp3P.mjs} +5 -5
- package/dist/{schema-BfJ7bIXH.mjs.map → schema-Blhoxp3P.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-BGBd16Eu.mjs} +4 -4
- package/dist/{taxonomies-DChKcVxf.mjs.map → taxonomies-BGBd16Eu.mjs.map} +1 -1
- package/dist/{taxonomies-ckPjz-6d.mjs → taxonomies-Cnb4F-Pb.mjs} +7 -7
- package/dist/{taxonomies-ckPjz-6d.mjs.map → taxonomies-Cnb4F-Pb.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-c8WjhH8z.mjs} +8 -5
- package/dist/{validation-sR26SOwD.mjs.map → validation-c8WjhH8z.mjs.map} +1 -1
- package/dist/version-CaccU7DM.mjs +7 -0
- package/dist/{version-CrqhKGWn.mjs.map → version-CaccU7DM.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-BC3OYpvx.mjs +425 -0
- package/dist/wxr-taxonomies-BC3OYpvx.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/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 +932 -58
- 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 +491 -0
- package/src/media/usage/content-snapshots.ts +435 -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
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { s as invalidateCommentObjectCache } from "./object-cache-Bok5j2ae.mjs";
|
|
1
2
|
import { n as slugify } from "./slugify-Cce3dTdg.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { t as OptionsRepository } from "./options-DTTML-Tx.mjs";
|
|
4
|
+
import { o as invalidateSiteSettingsCache } from "./settings-zhmdKyJQ.mjs";
|
|
5
|
+
import { a as validateExternalUrl, n as resolveAndValidateExternalUrl, r as ssrfSafeFetch } from "./ssrf-1g7usGBg.mjs";
|
|
6
|
+
import { _ as sanitizeFieldSlug, a as getFilenameFromUrl, c as isInternalMetaKey, d as mapMetaKeyToField, f as mapPostTypeToCollection, h as relativizeContentLinks, i as checkSchemaCompatibility, l as isInternalPostType, m as normalizeUrl$1, n as FEATURED_IMAGE_FIELD, o as guessMimeType, p as mapWpStatus, r as buildAttachmentMap, s as inferMetaType, t as BASE_REQUIRED_FIELDS, u as isPluginBookkeepingMeta } from "./utils-BJXElxdw.mjs";
|
|
4
7
|
import { ulid } from "ulidx";
|
|
5
8
|
import sax from "sax";
|
|
6
9
|
import { gutenbergToPortableText } from "@emdash-cms/gutenberg-to-portable-text";
|
|
@@ -844,6 +847,135 @@ function buildNavMenus(navMenuItemPosts, menuTermsBySlug) {
|
|
|
844
847
|
return menus;
|
|
845
848
|
}
|
|
846
849
|
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region src/import/menus.ts
|
|
852
|
+
/**
|
|
853
|
+
* Import navigation menus from Plugin API
|
|
854
|
+
*
|
|
855
|
+
* @param menus - Menus from plugin API
|
|
856
|
+
* @param db - Database connection
|
|
857
|
+
* @param contentIdMap - Map from WP post ID to EmDash content ID
|
|
858
|
+
* @returns Import result with counts and ID mapping
|
|
859
|
+
*/
|
|
860
|
+
async function importMenusFromPlugin(menus, db, contentIdMap) {
|
|
861
|
+
const result = {
|
|
862
|
+
menusCreated: 0,
|
|
863
|
+
itemsCreated: 0,
|
|
864
|
+
menuIdMap: /* @__PURE__ */ new Map(),
|
|
865
|
+
errors: []
|
|
866
|
+
};
|
|
867
|
+
for (const menu of menus) try {
|
|
868
|
+
const existing = await db.selectFrom("_emdash_menus").select("id").where("name", "=", menu.name).executeTakeFirst();
|
|
869
|
+
if (existing) {
|
|
870
|
+
result.menuIdMap.set(menu.name, existing.id);
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
873
|
+
const menuId = ulid();
|
|
874
|
+
await db.insertInto("_emdash_menus").values({
|
|
875
|
+
id: menuId,
|
|
876
|
+
name: menu.name,
|
|
877
|
+
label: menu.label
|
|
878
|
+
}).execute();
|
|
879
|
+
result.menusCreated++;
|
|
880
|
+
result.menuIdMap.set(menu.name, menuId);
|
|
881
|
+
const itemsCreated = await importPluginMenuItems(menu.items, menuId, db, contentIdMap);
|
|
882
|
+
result.itemsCreated += itemsCreated;
|
|
883
|
+
} catch (error) {
|
|
884
|
+
result.errors.push({
|
|
885
|
+
menu: menu.name,
|
|
886
|
+
error: error instanceof Error ? error.message : String(error)
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
return result;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Import menu items from Plugin API format
|
|
893
|
+
*/
|
|
894
|
+
async function importPluginMenuItems(items, menuId, db, contentIdMap) {
|
|
895
|
+
const itemIdMap = /* @__PURE__ */ new Map();
|
|
896
|
+
let count = 0;
|
|
897
|
+
const sortedItems = items.toSorted((a, b) => a.sort_order - b.sort_order);
|
|
898
|
+
for (const item of sortedItems) {
|
|
899
|
+
const itemId = ulid();
|
|
900
|
+
itemIdMap.set(item.id, itemId);
|
|
901
|
+
const { type, collection, referenceId, customUrl } = mapPluginMenuItem(item, contentIdMap);
|
|
902
|
+
await db.insertInto("_emdash_menu_items").values({
|
|
903
|
+
id: itemId,
|
|
904
|
+
menu_id: menuId,
|
|
905
|
+
parent_id: null,
|
|
906
|
+
sort_order: item.sort_order,
|
|
907
|
+
type,
|
|
908
|
+
reference_collection: collection,
|
|
909
|
+
reference_id: referenceId,
|
|
910
|
+
custom_url: customUrl,
|
|
911
|
+
label: item.title,
|
|
912
|
+
title_attr: null,
|
|
913
|
+
target: item.target || null,
|
|
914
|
+
css_classes: item.classes || null
|
|
915
|
+
}).execute();
|
|
916
|
+
count++;
|
|
917
|
+
}
|
|
918
|
+
for (const item of sortedItems) if (item.parent_id) {
|
|
919
|
+
const itemId = itemIdMap.get(item.id);
|
|
920
|
+
const parentId = itemIdMap.get(item.parent_id);
|
|
921
|
+
if (itemId && parentId) await db.updateTable("_emdash_menu_items").set({ parent_id: parentId }).where("id", "=", itemId).execute();
|
|
922
|
+
}
|
|
923
|
+
return count;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Map Plugin menu item to EmDash format
|
|
927
|
+
*/
|
|
928
|
+
function mapPluginMenuItem(item, contentIdMap) {
|
|
929
|
+
switch (item.type) {
|
|
930
|
+
case "custom": return {
|
|
931
|
+
type: "custom",
|
|
932
|
+
collection: null,
|
|
933
|
+
referenceId: null,
|
|
934
|
+
customUrl: item.url || "#"
|
|
935
|
+
};
|
|
936
|
+
case "post_type": {
|
|
937
|
+
const collection = mapObjectToCollection(item.object);
|
|
938
|
+
const referenceId = item.object_id ? contentIdMap.get(item.object_id) || null : null;
|
|
939
|
+
if (!referenceId && item.url) return {
|
|
940
|
+
type: "custom",
|
|
941
|
+
collection: null,
|
|
942
|
+
referenceId: null,
|
|
943
|
+
customUrl: item.url
|
|
944
|
+
};
|
|
945
|
+
return {
|
|
946
|
+
type: collection === "pages" ? "page" : "post",
|
|
947
|
+
collection,
|
|
948
|
+
referenceId,
|
|
949
|
+
customUrl: null
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
case "taxonomy": return {
|
|
953
|
+
type: "custom",
|
|
954
|
+
collection: null,
|
|
955
|
+
referenceId: null,
|
|
956
|
+
customUrl: item.url || "#"
|
|
957
|
+
};
|
|
958
|
+
default: return {
|
|
959
|
+
type: "custom",
|
|
960
|
+
collection: null,
|
|
961
|
+
referenceId: null,
|
|
962
|
+
customUrl: item.url || "#"
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Map WordPress object type to EmDash collection name
|
|
968
|
+
*/
|
|
969
|
+
function mapObjectToCollection(objectType) {
|
|
970
|
+
if (!objectType) return "posts";
|
|
971
|
+
return {
|
|
972
|
+
post: "posts",
|
|
973
|
+
page: "pages",
|
|
974
|
+
product: "products",
|
|
975
|
+
portfolio: "portfolio"
|
|
976
|
+
}[objectType] || objectType;
|
|
977
|
+
}
|
|
978
|
+
|
|
847
979
|
//#endregion
|
|
848
980
|
//#region src/import/sections.ts
|
|
849
981
|
/**
|
|
@@ -893,6 +1025,166 @@ async function importReusableBlocksAsSections(posts, db) {
|
|
|
893
1025
|
return result;
|
|
894
1026
|
}
|
|
895
1027
|
|
|
1028
|
+
//#endregion
|
|
1029
|
+
//#region src/import/comments.ts
|
|
1030
|
+
/**
|
|
1031
|
+
* Import comments from the plugin API.
|
|
1032
|
+
*
|
|
1033
|
+
* Preserves original timestamps and threading. Comments whose post was
|
|
1034
|
+
* not imported (no entry in `contentIdMap`) are skipped. Re-running the
|
|
1035
|
+
* import is idempotent: a comment with the same post, author email, and
|
|
1036
|
+
* timestamp is not created twice.
|
|
1037
|
+
*
|
|
1038
|
+
* @param comments - Comments from the plugin API (all pages, flat)
|
|
1039
|
+
* @param db - Database connection
|
|
1040
|
+
* @param contentIdMap - WP post ID -> EmDash content ID
|
|
1041
|
+
* @param collectionMap - WP post ID -> EmDash collection slug
|
|
1042
|
+
* @param rootIds - Optional pre-seeded WP-comment-ID -> EmDash-root-ID map.
|
|
1043
|
+
* The chunked import passes the map accumulated from earlier pages so a
|
|
1044
|
+
* reply in page N can thread onto a parent imported in page N-1; the
|
|
1045
|
+
* function adds this page's entries to it.
|
|
1046
|
+
*/
|
|
1047
|
+
async function importCommentsFromPlugin(comments, db, contentIdMap, collectionMap, rootIds) {
|
|
1048
|
+
const result = {
|
|
1049
|
+
imported: 0,
|
|
1050
|
+
skipped: 0,
|
|
1051
|
+
errors: []
|
|
1052
|
+
};
|
|
1053
|
+
const commentIdMap = /* @__PURE__ */ new Map();
|
|
1054
|
+
const rootIdMap = rootIds ?? /* @__PURE__ */ new Map();
|
|
1055
|
+
const sorted = comments.toSorted((a, b) => a.id - b.id);
|
|
1056
|
+
for (const comment of sorted) {
|
|
1057
|
+
const label = `${comment.author_name || "Anonymous"} (${comment.date_gmt})`;
|
|
1058
|
+
try {
|
|
1059
|
+
const contentId = contentIdMap.get(comment.post_id);
|
|
1060
|
+
const collection = collectionMap.get(comment.post_id);
|
|
1061
|
+
if (!contentId || !collection) {
|
|
1062
|
+
result.skipped++;
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
const parsed = new Date(comment.date_gmt);
|
|
1066
|
+
const createdAt = Number.isNaN(parsed.getTime()) ? (/* @__PURE__ */ new Date()).toISOString() : parsed.toISOString();
|
|
1067
|
+
const existing = await db.selectFrom("_emdash_comments").select("id").where("content_id", "=", contentId).where("author_email", "=", comment.author_email).where("created_at", "=", createdAt).where("body", "=", comment.body).executeTakeFirst();
|
|
1068
|
+
const parentId = comment.parent_id !== null ? rootIdMap.get(comment.parent_id) ?? null : null;
|
|
1069
|
+
if (existing) {
|
|
1070
|
+
commentIdMap.set(comment.id, existing.id);
|
|
1071
|
+
rootIdMap.set(comment.id, parentId ?? existing.id);
|
|
1072
|
+
result.skipped++;
|
|
1073
|
+
continue;
|
|
1074
|
+
}
|
|
1075
|
+
const id = ulid();
|
|
1076
|
+
await db.insertInto("_emdash_comments").values({
|
|
1077
|
+
id,
|
|
1078
|
+
collection,
|
|
1079
|
+
content_id: contentId,
|
|
1080
|
+
parent_id: parentId,
|
|
1081
|
+
author_name: comment.author_name || "Anonymous",
|
|
1082
|
+
author_email: comment.author_email,
|
|
1083
|
+
author_user_id: null,
|
|
1084
|
+
body: comment.body,
|
|
1085
|
+
status: comment.status,
|
|
1086
|
+
ip_hash: null,
|
|
1087
|
+
user_agent: null,
|
|
1088
|
+
moderation_metadata: null,
|
|
1089
|
+
created_at: createdAt,
|
|
1090
|
+
updated_at: createdAt
|
|
1091
|
+
}).execute();
|
|
1092
|
+
commentIdMap.set(comment.id, id);
|
|
1093
|
+
rootIdMap.set(comment.id, parentId ?? id);
|
|
1094
|
+
result.imported++;
|
|
1095
|
+
} catch (error) {
|
|
1096
|
+
result.errors.push({
|
|
1097
|
+
comment: label,
|
|
1098
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if (result.imported > 0) invalidateCommentObjectCache();
|
|
1103
|
+
return result;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
//#endregion
|
|
1107
|
+
//#region src/import/settings.ts
|
|
1108
|
+
/** Options key prefix used by the site settings module (`settings/index.ts`). */
|
|
1109
|
+
const SETTINGS_PREFIX = "site:";
|
|
1110
|
+
/**
|
|
1111
|
+
* Import site settings from analysis into EmDash site settings.
|
|
1112
|
+
*
|
|
1113
|
+
* Writes the `site:*` options consumed by `getSiteSettings()` and
|
|
1114
|
+
* invalidates the settings cache. Logo/favicon are only applied when
|
|
1115
|
+
* the caller resolved them to EmDash media IDs.
|
|
1116
|
+
*
|
|
1117
|
+
* @param settings - Site settings analysis
|
|
1118
|
+
* @param db - Database connection
|
|
1119
|
+
* @param overwrite - Whether to overwrite existing settings (a fresh
|
|
1120
|
+
* site's seed already sets title/tagline, so migrations pass true)
|
|
1121
|
+
* @param media - Resolved media IDs for logo/favicon
|
|
1122
|
+
*/
|
|
1123
|
+
async function importSiteSettings(settings, db, overwrite = false, media = {}) {
|
|
1124
|
+
const result = {
|
|
1125
|
+
applied: [],
|
|
1126
|
+
skipped: [],
|
|
1127
|
+
errors: []
|
|
1128
|
+
};
|
|
1129
|
+
const updates = [];
|
|
1130
|
+
if (settings.title) updates.push({
|
|
1131
|
+
setting: "title",
|
|
1132
|
+
value: settings.title
|
|
1133
|
+
});
|
|
1134
|
+
if (settings.tagline) updates.push({
|
|
1135
|
+
setting: "tagline",
|
|
1136
|
+
value: settings.tagline
|
|
1137
|
+
});
|
|
1138
|
+
if (media.logoMediaId) updates.push({
|
|
1139
|
+
setting: "logo",
|
|
1140
|
+
value: { mediaId: media.logoMediaId }
|
|
1141
|
+
});
|
|
1142
|
+
if (media.faviconMediaId) updates.push({
|
|
1143
|
+
setting: "favicon",
|
|
1144
|
+
value: { mediaId: media.faviconMediaId }
|
|
1145
|
+
});
|
|
1146
|
+
if (updates.length === 0) return result;
|
|
1147
|
+
const options = new OptionsRepository(db);
|
|
1148
|
+
try {
|
|
1149
|
+
for (const { setting, value } of updates) try {
|
|
1150
|
+
const key = `${SETTINGS_PREFIX}${setting}`;
|
|
1151
|
+
if (!overwrite) {
|
|
1152
|
+
if (await options.get(key) !== null) {
|
|
1153
|
+
result.skipped.push(setting);
|
|
1154
|
+
continue;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
await options.set(key, value);
|
|
1158
|
+
result.applied.push(setting);
|
|
1159
|
+
} catch (error) {
|
|
1160
|
+
result.errors.push({
|
|
1161
|
+
setting,
|
|
1162
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
} finally {
|
|
1166
|
+
if (result.applied.length > 0) invalidateSiteSettingsCache();
|
|
1167
|
+
}
|
|
1168
|
+
return result;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Parse site settings from WordPress plugin options response
|
|
1172
|
+
*/
|
|
1173
|
+
function parseSiteSettingsFromPlugin(options) {
|
|
1174
|
+
const settings = {};
|
|
1175
|
+
if (typeof options.blogname === "string" && options.blogname.trim() !== "") settings.title = options.blogname;
|
|
1176
|
+
if (typeof options.blogdescription === "string" && options.blogdescription.trim() !== "") settings.tagline = options.blogdescription;
|
|
1177
|
+
if (typeof options.custom_logo_url === "string" && options.custom_logo_url !== "") settings.logo = {
|
|
1178
|
+
url: options.custom_logo_url,
|
|
1179
|
+
id: typeof options.custom_logo === "number" ? options.custom_logo : void 0
|
|
1180
|
+
};
|
|
1181
|
+
if (typeof options.site_icon_url === "string" && options.site_icon_url !== "") settings.favicon = {
|
|
1182
|
+
url: options.site_icon_url,
|
|
1183
|
+
id: typeof options.site_icon === "number" ? options.site_icon : void 0
|
|
1184
|
+
};
|
|
1185
|
+
return settings;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
896
1188
|
//#endregion
|
|
897
1189
|
//#region src/import/registry.ts
|
|
898
1190
|
/**
|
|
@@ -1004,7 +1296,7 @@ const wxrSource = {
|
|
|
1004
1296
|
if (!options.postTypes.includes(postType)) continue;
|
|
1005
1297
|
if (isInternalPostType(postType)) continue;
|
|
1006
1298
|
if (!options.includeDrafts && post.status !== "publish") continue;
|
|
1007
|
-
yield wxrPostToNormalizedItem(post, attachmentMap);
|
|
1299
|
+
yield wxrPostToNormalizedItem(post, attachmentMap, wxr.site.link || "");
|
|
1008
1300
|
count++;
|
|
1009
1301
|
if (options.limit && count >= options.limit) break;
|
|
1010
1302
|
}
|
|
@@ -1123,8 +1415,9 @@ function analyzeWxrData(wxr, existingCollections) {
|
|
|
1123
1415
|
/**
|
|
1124
1416
|
* Convert a WXR post to a normalized item
|
|
1125
1417
|
*/
|
|
1126
|
-
function wxrPostToNormalizedItem(post, attachmentMap) {
|
|
1418
|
+
function wxrPostToNormalizedItem(post, attachmentMap, siteUrl) {
|
|
1127
1419
|
const content = post.content ? gutenbergToPortableText(post.content) : [];
|
|
1420
|
+
if (siteUrl) relativizeContentLinks(content, siteUrl);
|
|
1128
1421
|
const thumbnailId = post.meta.get("_thumbnail_id");
|
|
1129
1422
|
const featuredImage = thumbnailId ? attachmentMap.get(String(thumbnailId)) : void 0;
|
|
1130
1423
|
let customTaxonomies;
|
|
@@ -1297,6 +1590,44 @@ async function getPublicContentCounts(siteUrl) {
|
|
|
1297
1590
|
* Connects to self-hosted WordPress sites running the EmDash Exporter plugin.
|
|
1298
1591
|
* Provides full access to all content including drafts, custom post types, and ACF fields.
|
|
1299
1592
|
*/
|
|
1593
|
+
/**
|
|
1594
|
+
* Build the REST API URL for a plugin endpoint.
|
|
1595
|
+
*
|
|
1596
|
+
* `restRoute: false` uses the pretty form (`/wp-json/emdash/v1/...`),
|
|
1597
|
+
* `restRoute: true` uses the `?rest_route=` form that works on sites with
|
|
1598
|
+
* plain permalinks (where `/wp-json/` doesn't exist).
|
|
1599
|
+
*/
|
|
1600
|
+
function pluginApiUrl(siteUrl, path, params = {}, restRoute = false) {
|
|
1601
|
+
if (restRoute) {
|
|
1602
|
+
const url = new URL(siteUrl + "/");
|
|
1603
|
+
url.searchParams.set("rest_route", `/emdash/v1/${path}`);
|
|
1604
|
+
for (const [key, value] of Object.entries(params)) url.searchParams.set(key, value);
|
|
1605
|
+
return url.toString();
|
|
1606
|
+
}
|
|
1607
|
+
const url = new URL(`${siteUrl}/wp-json/emdash/v1/${path}`);
|
|
1608
|
+
for (const [key, value] of Object.entries(params)) url.searchParams.set(key, value);
|
|
1609
|
+
return url.toString();
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Fetch a plugin API endpoint, falling back to the `?rest_route=` form when
|
|
1613
|
+
* the pretty `/wp-json/` route 404s or is unreachable. Sites with "Plain"
|
|
1614
|
+
* permalinks have no `/wp-json/` rewrite, so without this fallback they
|
|
1615
|
+
* always fail with a misleading 404.
|
|
1616
|
+
*/
|
|
1617
|
+
async function fetchPluginApi(siteUrl, path, params, headers, timeoutMs) {
|
|
1618
|
+
let pretty = null;
|
|
1619
|
+
try {
|
|
1620
|
+
pretty = await ssrfSafeFetch(pluginApiUrl(siteUrl, path, params), {
|
|
1621
|
+
headers,
|
|
1622
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
1623
|
+
});
|
|
1624
|
+
} catch {}
|
|
1625
|
+
if (pretty && pretty.status !== 404) return pretty;
|
|
1626
|
+
return ssrfSafeFetch(pluginApiUrl(siteUrl, path, params, true), {
|
|
1627
|
+
headers,
|
|
1628
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
1629
|
+
});
|
|
1630
|
+
}
|
|
1300
1631
|
const wordpressPluginSource = {
|
|
1301
1632
|
id: "wordpress-plugin",
|
|
1302
1633
|
name: "WordPress (EmDash Exporter)",
|
|
@@ -1308,10 +1639,7 @@ const wordpressPluginSource = {
|
|
|
1308
1639
|
try {
|
|
1309
1640
|
const siteUrl = normalizeUrl$1(url);
|
|
1310
1641
|
validateExternalUrl(siteUrl);
|
|
1311
|
-
const response = await
|
|
1312
|
-
headers: { Accept: "application/json" },
|
|
1313
|
-
signal: AbortSignal.timeout(1e4)
|
|
1314
|
-
});
|
|
1642
|
+
const response = await fetchPluginApi(siteUrl, "probe", {}, { Accept: "application/json" }, 1e4);
|
|
1315
1643
|
if (!response.ok) return null;
|
|
1316
1644
|
const data = await response.json();
|
|
1317
1645
|
if (!data.emdash_exporter) return null;
|
|
@@ -1349,10 +1677,7 @@ const wordpressPluginSource = {
|
|
|
1349
1677
|
},
|
|
1350
1678
|
async analyze(input, context) {
|
|
1351
1679
|
const { siteUrl, headers } = getRequestConfig(input);
|
|
1352
|
-
const response = await
|
|
1353
|
-
headers,
|
|
1354
|
-
signal: AbortSignal.timeout(3e4)
|
|
1355
|
-
});
|
|
1680
|
+
const response = await fetchPluginApi(siteUrl, "analyze", {}, headers, 3e4);
|
|
1356
1681
|
if (!response.ok) {
|
|
1357
1682
|
const body = await response.json().catch(() => void 0);
|
|
1358
1683
|
const message = typeof body === "object" && body !== null && "message" in body && typeof body.message === "string" ? body.message : "";
|
|
@@ -1364,6 +1689,19 @@ const wordpressPluginSource = {
|
|
|
1364
1689
|
const suggestedCollection = mapPostTypeToCollection(pt.name);
|
|
1365
1690
|
const existingCollection = existingCollections.get(suggestedCollection);
|
|
1366
1691
|
const requiredFields = pt.supports && "thumbnail" in pt.supports ? [...BASE_REQUIRED_FIELDS, FEATURED_IMAGE_FIELD] : [...BASE_REQUIRED_FIELDS];
|
|
1692
|
+
const knownSlugs = new Set(requiredFields.map((f) => f.slug));
|
|
1693
|
+
for (const customField of pt.custom_fields ?? []) {
|
|
1694
|
+
if (isPluginBookkeepingMeta(customField.key)) continue;
|
|
1695
|
+
const slug = sanitizeFieldSlug(customField.key);
|
|
1696
|
+
if (knownSlugs.has(slug)) continue;
|
|
1697
|
+
knownSlugs.add(slug);
|
|
1698
|
+
requiredFields.push({
|
|
1699
|
+
slug,
|
|
1700
|
+
label: fieldLabelFromKey(customField.key),
|
|
1701
|
+
type: mapInferredFieldType(customField.inferred_type),
|
|
1702
|
+
required: false
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1367
1705
|
return {
|
|
1368
1706
|
name: pt.name,
|
|
1369
1707
|
count: pt.total,
|
|
@@ -1374,12 +1712,16 @@ const wordpressPluginSource = {
|
|
|
1374
1712
|
});
|
|
1375
1713
|
const attachments = [];
|
|
1376
1714
|
if (data.attachments.count > 0) try {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1715
|
+
let page = 1;
|
|
1716
|
+
let totalPages = 1;
|
|
1717
|
+
while (page <= totalPages) {
|
|
1718
|
+
const mediaResponse = await fetchPluginApi(siteUrl, "media", {
|
|
1719
|
+
per_page: "500",
|
|
1720
|
+
page: String(page)
|
|
1721
|
+
}, headers, 3e4);
|
|
1722
|
+
if (!mediaResponse.ok) break;
|
|
1382
1723
|
const mediaData = await mediaResponse.json();
|
|
1724
|
+
totalPages = mediaData.pages;
|
|
1383
1725
|
for (const item of mediaData.items) attachments.push({
|
|
1384
1726
|
id: item.id,
|
|
1385
1727
|
url: item.url,
|
|
@@ -1391,6 +1733,7 @@ const wordpressPluginSource = {
|
|
|
1391
1733
|
width: item.width,
|
|
1392
1734
|
height: item.height
|
|
1393
1735
|
});
|
|
1736
|
+
page++;
|
|
1394
1737
|
}
|
|
1395
1738
|
} catch (e) {
|
|
1396
1739
|
console.warn("Failed to fetch media list:", e);
|
|
@@ -1427,15 +1770,17 @@ const wordpressPluginSource = {
|
|
|
1427
1770
|
let totalPages = 1;
|
|
1428
1771
|
let yielded = 0;
|
|
1429
1772
|
while (page <= totalPages) {
|
|
1430
|
-
const response = await
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1773
|
+
const response = await fetchPluginApi(siteUrl, "content", {
|
|
1774
|
+
post_type: postType,
|
|
1775
|
+
status: options.includeDrafts ? "any" : "publish",
|
|
1776
|
+
per_page: "100",
|
|
1777
|
+
page: String(page)
|
|
1778
|
+
}, headers, 6e4);
|
|
1434
1779
|
if (!response.ok) throw new Error(`Failed to fetch ${postType}: ${response.statusText}`);
|
|
1435
1780
|
const data = await response.json();
|
|
1436
1781
|
totalPages = data.pages;
|
|
1437
1782
|
for (const post of data.items) {
|
|
1438
|
-
yield pluginPostToNormalizedItem(post);
|
|
1783
|
+
yield pluginPostToNormalizedItem(post, siteUrl);
|
|
1439
1784
|
yielded++;
|
|
1440
1785
|
if (options.limit && yielded >= options.limit) return;
|
|
1441
1786
|
}
|
|
@@ -1451,6 +1796,54 @@ const wordpressPluginSource = {
|
|
|
1451
1796
|
}
|
|
1452
1797
|
};
|
|
1453
1798
|
/**
|
|
1799
|
+
* Fetch a single page of content for one post type. This is the unit of
|
|
1800
|
+
* work for the chunked import: one Worker invocation imports one page,
|
|
1801
|
+
* keeping each request far below Cloudflare's CPU and subrequest limits
|
|
1802
|
+
* (see issue #475).
|
|
1803
|
+
*/
|
|
1804
|
+
async function fetchPluginContentPage(options) {
|
|
1805
|
+
const { siteUrl, headers } = getRequestConfig({
|
|
1806
|
+
type: "url",
|
|
1807
|
+
url: options.siteUrl,
|
|
1808
|
+
token: options.token
|
|
1809
|
+
});
|
|
1810
|
+
const response = await fetchPluginApi(siteUrl, "content", {
|
|
1811
|
+
post_type: options.postType,
|
|
1812
|
+
status: options.includeDrafts ? "any" : "publish",
|
|
1813
|
+
per_page: String(options.perPage),
|
|
1814
|
+
page: String(options.page)
|
|
1815
|
+
}, headers, 6e4);
|
|
1816
|
+
if (!response.ok) throw new Error(`Failed to fetch ${options.postType}: ${response.statusText}`);
|
|
1817
|
+
const data = await response.json();
|
|
1818
|
+
return {
|
|
1819
|
+
items: data.items.map((post) => pluginPostToNormalizedItem(post, siteUrl)),
|
|
1820
|
+
totalPages: data.pages
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
/** Plugin `inferred_type` values that are valid EmDash field types as-is */
|
|
1824
|
+
const VALID_INFERRED_TYPES = new Set([
|
|
1825
|
+
"string",
|
|
1826
|
+
"text",
|
|
1827
|
+
"number",
|
|
1828
|
+
"integer",
|
|
1829
|
+
"boolean",
|
|
1830
|
+
"datetime",
|
|
1831
|
+
"json",
|
|
1832
|
+
"reference"
|
|
1833
|
+
]);
|
|
1834
|
+
/**
|
|
1835
|
+
* Map the plugin's inferred custom-field type to an EmDash field type.
|
|
1836
|
+
* Unknown values fall back to string (always safe for TEXT storage).
|
|
1837
|
+
*/
|
|
1838
|
+
function mapInferredFieldType(inferredType) {
|
|
1839
|
+
return VALID_INFERRED_TYPES.has(inferredType) ? inferredType : "string";
|
|
1840
|
+
}
|
|
1841
|
+
const FIELD_KEY_SEPARATORS = /[_-]+/;
|
|
1842
|
+
/** Derive a human label from a meta key: "event_start-date" -> "Event Start Date" */
|
|
1843
|
+
function fieldLabelFromKey(key) {
|
|
1844
|
+
return key.split(FIELD_KEY_SEPARATORS).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
1845
|
+
}
|
|
1846
|
+
/**
|
|
1454
1847
|
* Convert plugin i18n info to the shared I18nDetection type.
|
|
1455
1848
|
* Returns undefined when no multilingual plugin is detected.
|
|
1456
1849
|
*/
|
|
@@ -1492,10 +1885,21 @@ function getRequestConfig(input) {
|
|
|
1492
1885
|
/**
|
|
1493
1886
|
* Convert plugin post to normalized item
|
|
1494
1887
|
*/
|
|
1495
|
-
function pluginPostToNormalizedItem(post) {
|
|
1888
|
+
function pluginPostToNormalizedItem(post, siteUrl) {
|
|
1496
1889
|
const content = post.content ? gutenbergToPortableText(post.content) : [];
|
|
1890
|
+
relativizeContentLinks(content, siteUrl);
|
|
1497
1891
|
const categories = post.taxonomies?.category?.map((c) => c.slug) ?? post.taxonomies?.categories?.map((c) => c.slug) ?? [];
|
|
1498
1892
|
const tags = post.taxonomies?.post_tag?.map((t) => t.slug) ?? post.taxonomies?.tags?.map((t) => t.slug) ?? [];
|
|
1893
|
+
const customTaxonomies = {};
|
|
1894
|
+
for (const [name, terms] of Object.entries(post.taxonomies ?? {})) {
|
|
1895
|
+
if ([
|
|
1896
|
+
"category",
|
|
1897
|
+
"categories",
|
|
1898
|
+
"post_tag",
|
|
1899
|
+
"tags"
|
|
1900
|
+
].includes(name)) continue;
|
|
1901
|
+
if (Array.isArray(terms) && terms.length > 0) customTaxonomies[name] = terms.map((t) => t.slug);
|
|
1902
|
+
}
|
|
1499
1903
|
const meta = { ...post.meta };
|
|
1500
1904
|
if (post.acf) meta._acf = post.acf;
|
|
1501
1905
|
if (post.yoast) meta._yoast = post.yoast;
|
|
@@ -1513,12 +1917,97 @@ function pluginPostToNormalizedItem(post) {
|
|
|
1513
1917
|
author: post.author?.login,
|
|
1514
1918
|
categories,
|
|
1515
1919
|
tags,
|
|
1920
|
+
customTaxonomies: Object.keys(customTaxonomies).length > 0 ? customTaxonomies : void 0,
|
|
1516
1921
|
meta,
|
|
1517
1922
|
featuredImage: post.featured_image?.url,
|
|
1518
1923
|
locale: post.locale,
|
|
1519
1924
|
translationGroup: post.translation_group
|
|
1520
1925
|
};
|
|
1521
1926
|
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Fetch taxonomies from plugin API
|
|
1929
|
+
*/
|
|
1930
|
+
async function fetchPluginTaxonomies(siteUrl, authToken) {
|
|
1931
|
+
const normalizedSiteUrl = normalizeUrl$1(siteUrl);
|
|
1932
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
1933
|
+
const response = await fetchPluginApi(normalizedSiteUrl, "taxonomies", {}, {
|
|
1934
|
+
Accept: "application/json",
|
|
1935
|
+
Authorization: `Basic ${authToken}`
|
|
1936
|
+
}, 3e4);
|
|
1937
|
+
if (!response.ok) throw new Error(`Failed to fetch taxonomies: ${response.statusText}`);
|
|
1938
|
+
return response.json();
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Fetch navigation menus from plugin API (added in emdash-exporter 1.1.0).
|
|
1942
|
+
* Returns an empty array when the endpoint doesn't exist (older plugin).
|
|
1943
|
+
*/
|
|
1944
|
+
async function fetchPluginMenus(siteUrl, authToken) {
|
|
1945
|
+
const normalizedSiteUrl = normalizeUrl$1(siteUrl);
|
|
1946
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
1947
|
+
const response = await fetchPluginApi(normalizedSiteUrl, "menus", {}, {
|
|
1948
|
+
Accept: "application/json",
|
|
1949
|
+
Authorization: `Basic ${authToken}`
|
|
1950
|
+
}, 3e4);
|
|
1951
|
+
if (response.status === 404) return [];
|
|
1952
|
+
if (!response.ok) throw new Error(`Failed to fetch menus: ${response.statusText}`);
|
|
1953
|
+
return response.json();
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Fetch site options from plugin API (title, tagline, logo, favicon, ...)
|
|
1957
|
+
*/
|
|
1958
|
+
async function fetchPluginOptions(siteUrl, authToken) {
|
|
1959
|
+
const normalizedSiteUrl = normalizeUrl$1(siteUrl);
|
|
1960
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
1961
|
+
const response = await fetchPluginApi(normalizedSiteUrl, "options", {}, {
|
|
1962
|
+
Accept: "application/json",
|
|
1963
|
+
Authorization: `Basic ${authToken}`
|
|
1964
|
+
}, 3e4);
|
|
1965
|
+
if (!response.ok) throw new Error(`Failed to fetch options: ${response.statusText}`);
|
|
1966
|
+
return response.json();
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Fetch a single page of comments from the plugin API (added in
|
|
1970
|
+
* emdash-exporter 1.2.0). The exporter orders by comment ID ascending, so
|
|
1971
|
+
* parents always appear before their children across pages. Returns
|
|
1972
|
+
* `totalPages: 0` when the endpoint doesn't exist (older plugin).
|
|
1973
|
+
*/
|
|
1974
|
+
async function fetchPluginCommentsPage(siteUrl, authToken, page) {
|
|
1975
|
+
const normalizedSiteUrl = normalizeUrl$1(siteUrl);
|
|
1976
|
+
validateExternalUrl(normalizedSiteUrl);
|
|
1977
|
+
const response = await fetchPluginApi(normalizedSiteUrl, "comments", {
|
|
1978
|
+
per_page: "500",
|
|
1979
|
+
page: String(page)
|
|
1980
|
+
}, {
|
|
1981
|
+
Accept: "application/json",
|
|
1982
|
+
Authorization: `Basic ${authToken}`
|
|
1983
|
+
}, 3e4);
|
|
1984
|
+
if (response.status === 404) return {
|
|
1985
|
+
items: [],
|
|
1986
|
+
totalPages: 0
|
|
1987
|
+
};
|
|
1988
|
+
if (!response.ok) throw new Error(`Failed to fetch comments: ${response.statusText}`);
|
|
1989
|
+
const data = await response.json();
|
|
1990
|
+
return {
|
|
1991
|
+
items: data.items,
|
|
1992
|
+
totalPages: data.pages
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Fetch all comments from plugin API, paginating through every page.
|
|
1997
|
+
* Returns an empty array when the endpoint doesn't exist (older plugin).
|
|
1998
|
+
*/
|
|
1999
|
+
async function fetchPluginComments(siteUrl, authToken) {
|
|
2000
|
+
const comments = [];
|
|
2001
|
+
let page = 1;
|
|
2002
|
+
let totalPages = 1;
|
|
2003
|
+
while (page <= totalPages) {
|
|
2004
|
+
const result = await fetchPluginCommentsPage(siteUrl, authToken, page);
|
|
2005
|
+
totalPages = result.totalPages;
|
|
2006
|
+
comments.push(...result.items);
|
|
2007
|
+
page++;
|
|
2008
|
+
}
|
|
2009
|
+
return comments;
|
|
2010
|
+
}
|
|
1522
2011
|
|
|
1523
2012
|
//#endregion
|
|
1524
2013
|
//#region src/import/index.ts
|
|
@@ -1527,5 +2016,5 @@ registerSource(wordpressRestSource);
|
|
|
1527
2016
|
registerSource(wxrSource);
|
|
1528
2017
|
|
|
1529
2018
|
//#endregion
|
|
1530
|
-
export {
|
|
1531
|
-
//# sourceMappingURL=import-
|
|
2019
|
+
export { parseWxrString as C, parseWxr as S, importSiteSettings as _, fetchPluginOptions as a, importReusableBlocksAsSections as b, parseWxrDate as c, getAllSources as d, getFileSources as f, registerSource as g, probeUrl as h, fetchPluginMenus as i, wxrSource as l, getUrlSources as m, fetchPluginCommentsPage as n, fetchPluginTaxonomies as o, getSource as p, fetchPluginContentPage as r, wordpressRestSource as s, fetchPluginComments as t, clearSources as u, parseSiteSettingsFromPlugin as v, importMenusFromPlugin as x, importCommentsFromPlugin as y };
|
|
2020
|
+
//# sourceMappingURL=import-fYLf14Co.mjs.map
|