emdash 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapters-DAAjOID4.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
- package/dist/{adapters-DAAjOID4.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-BMfveMoB.mjs → api-BFURZn1i.mjs} +104 -38
- 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--IVNSdXn.mjs → apply-Bu-8nYHL.mjs} +113 -76
- package/dist/apply-Bu-8nYHL.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -11
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +13 -5
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -9
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +52 -12
- 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 -9
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +125 -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 +38 -37
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +38 -37
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +37 -36
- 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 +37 -36
- 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 -40
- 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 -9
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +28 -25
- 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 +14 -12
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-BZnOGJFo.mjs → authorize-Dz88F_Fw.mjs} +2 -2
- package/dist/{authorize-BZnOGJFo.mjs.map → authorize-Dz88F_Fw.mjs.map} +1 -1
- package/dist/{byline-LL8lyqdb.mjs → byline-Bm8ZgUP9.mjs} +6 -6
- package/dist/{byline-LL8lyqdb.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-KD3JFRuH.d.mts → byline-fields-Cgrt9-aL.d.mts} +18 -3
- package/dist/{byline-fields-KD3JFRuH.d.mts.map → byline-fields-Cgrt9-aL.d.mts.map} +1 -1
- package/dist/{bylines-BmJ7Vg7J.mjs → bylines-6tm9mgQb.mjs} +4 -4
- package/dist/{bylines-BmJ7Vg7J.mjs.map → bylines-6tm9mgQb.mjs.map} +1 -1
- package/dist/{bylines-DE47vP8d.mjs → bylines-Woq87129.mjs} +6 -6
- package/dist/{bylines-DE47vP8d.mjs.map → bylines-Woq87129.mjs.map} +1 -1
- package/dist/{cache-D9jF5bYw.mjs → cache-CEBAZjir.mjs} +2 -2
- package/dist/{cache-D9jF5bYw.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-OCG163rN.mjs → chunks-B2isWQhr.mjs} +2 -2
- package/dist/{chunks-OCG163rN.mjs.map → chunks-B2isWQhr.mjs.map} +1 -1
- package/dist/cli/index.mjs +23 -22
- 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-D9BLDpZI.mjs → comment-CzeatwBV.mjs} +3 -3
- package/dist/{comment-D9BLDpZI.mjs.map → comment-CzeatwBV.mjs.map} +1 -1
- package/dist/{comment-reaction-Drl9SkNu.mjs → comment-reaction-Cj9QJY7I.mjs} +2 -2
- package/dist/{comment-reaction-Drl9SkNu.mjs.map → comment-reaction-Cj9QJY7I.mjs.map} +1 -1
- package/dist/{comments-BjJ9SKGU.mjs → comments-BLE-jv5k.mjs} +3 -3
- package/dist/{comments-BjJ9SKGU.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-ncUWWjna.mjs → content-DhgEth4k.mjs} +4 -4
- package/dist/{content-ncUWWjna.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-C_g-iJVA.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-CotyqQrW.mjs → dashboard-EvEKF5en.mjs} +4 -4
- package/dist/{dashboard-CotyqQrW.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-rVGiqWDt.mjs → error-CkAseSqZ.mjs} +2 -2
- package/dist/{error-rVGiqWDt.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-ljXzJCfc.mjs → field-defs-cache-WUI88LX5.mjs} +2 -2
- package/dist/{field-defs-cache-ljXzJCfc.mjs.map → field-defs-cache-WUI88LX5.mjs.map} +1 -1
- package/dist/{fts-manager-BbCCbEKA.mjs → fts-manager-BbFaF_V8.mjs} +2 -2
- package/dist/{fts-manager-BbCCbEKA.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-BRNabKrx.d.mts → index-B9sIxwe4.d.mts} +2420 -2379
- package/dist/index-B9sIxwe4.d.mts.map +1 -0
- package/dist/{index-Dt0OKJB4.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 -17
- package/dist/index.mjs +54 -53
- package/dist/{load-DMjXghbZ.mjs → load-Djn3HWQS.mjs} +2 -2
- package/dist/{load-DMjXghbZ.mjs.map → load-Djn3HWQS.mjs.map} +1 -1
- package/dist/{loader-BA_zhkS_.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 -11
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +5 -5
- package/dist/{media-C5t_eCnk.mjs → media-BrXIaMFN.mjs} +2 -2
- package/dist/{media-C5t_eCnk.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-CBb6UrMU.mjs → menus-Cfivc2Ad.mjs} +3 -3
- package/dist/{menus-CBb6UrMU.mjs.map → menus-Cfivc2Ad.mjs.map} +1 -1
- package/dist/{menus-CYH09a41.mjs → menus-CsZ2ZEK2.mjs} +16 -12
- package/dist/{menus-CYH09a41.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-BwAdS7FZ.mjs → parse-GmjecGct.mjs} +2 -2
- package/dist/{parse-BwAdS7FZ.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 -9
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- 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-BpQb-blG.mjs → query-ByGq6ver.mjs} +14 -14
- package/dist/{query-BpQb-blG.mjs.map → query-ByGq6ver.mjs.map} +1 -1
- package/dist/{rate-limit-Dap6HMNM.mjs → rate-limit-C_Lf63Dd.mjs} +2 -2
- package/dist/{rate-limit-Dap6HMNM.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-_M0trWoo.mjs → redirect-IyfNirgS.mjs} +2 -2
- package/dist/{redirect-_M0trWoo.mjs.map → redirect-IyfNirgS.mjs.map} +1 -1
- package/dist/{redirects-w0V9vj_j.mjs → redirects-Bs1g42Ri.mjs} +4 -4
- package/dist/{redirects-w0V9vj_j.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-g8yYt4cC.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-DPdt_Wpa.mjs → runner-K8XK101B.mjs} +351 -199
- package/dist/runner-K8XK101B.mjs.map +1 -0
- package/dist/runtime.d.mts +11 -10
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +2 -2
- package/dist/scheduled-publish-Drffrf2a.d.mts +11 -0
- package/dist/scheduled-publish-Drffrf2a.d.mts.map +1 -0
- package/dist/{schema-DoLd3j2e.mjs → schema-Blhoxp3P.mjs} +5 -5
- package/dist/{schema-DoLd3j2e.mjs.map → schema-Blhoxp3P.mjs.map} +1 -1
- package/dist/{search-BR0ZeZmh.mjs → search-DZN2HZ-V.mjs} +6 -4
- package/dist/search-DZN2HZ-V.mjs.map +1 -0
- 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-5J2YJPqJ.mjs → sections-CpF5SaGr.mjs} +3 -3
- package/dist/{sections-5J2YJPqJ.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-DKeXHkzE.mjs → seo-DXu2UQnC.mjs} +3 -3
- package/dist/{seo-DKeXHkzE.mjs.map → seo-DXu2UQnC.mjs.map} +1 -1
- package/dist/{service-BbO2s8gT.mjs → service-DQmiBMzt.mjs} +3 -3
- package/dist/{service-BbO2s8gT.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-BMNr9Dmi.mjs → settings-rZyHEcNT.mjs} +3 -3
- package/dist/{settings-BMNr9Dmi.mjs.map → settings-rZyHEcNT.mjs.map} +1 -1
- package/dist/{settings-DJeki-97.mjs → settings-zhmdKyJQ.mjs} +5 -5
- package/dist/{settings-DJeki-97.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-CM_fUqLU.mjs → taxonomies-BGBd16Eu.mjs} +4 -4
- package/dist/{taxonomies-CM_fUqLU.mjs.map → taxonomies-BGBd16Eu.mjs.map} +1 -1
- package/dist/{taxonomies-D13i2ctt.mjs → taxonomies-Cnb4F-Pb.mjs} +7 -7
- package/dist/{taxonomies-D13i2ctt.mjs.map → taxonomies-Cnb4F-Pb.mjs.map} +1 -1
- package/dist/{taxonomy-BU0LjdVb.mjs → taxonomy-BxGxZZdu.mjs} +4 -4
- package/dist/{taxonomy-BU0LjdVb.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-BZ-03aFT.d.mts → transport-BMDWHSgZ.d.mts} +1 -1
- package/dist/{transport-BZ-03aFT.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-BWqGVhFn.d.mts → types-CgvhU-hF.d.mts} +1 -1
- package/dist/{types-BWqGVhFn.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
- package/dist/{types-fS7-VTdR.d.mts → types-ClUkdbWb.d.mts} +1 -1
- package/dist/{types-fS7-VTdR.d.mts.map → types-ClUkdbWb.d.mts.map} +1 -1
- package/dist/{types-CZgK3EMW.mjs → types-CuW0zWDA.mjs} +2 -2
- package/dist/{types-CZgK3EMW.mjs.map → types-CuW0zWDA.mjs.map} +1 -1
- package/dist/{types-BG8_XTLj.d.mts → types-DmHk7vAt.d.mts} +1 -1
- package/dist/{types-BG8_XTLj.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-DrYMm9s5.d.mts → types-ea9sAPck.d.mts} +1 -1
- package/dist/{types-DrYMm9s5.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-CUsXGRVj.d.mts → types-vgEWF18A.d.mts} +19 -1
- package/dist/{types-CUsXGRVj.d.mts.map → types-vgEWF18A.d.mts.map} +1 -1
- package/dist/{user-DkG2jKCp.mjs → user-BjAOvU3Z.mjs} +3 -3
- package/dist/{user-DkG2jKCp.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-CuJ1Ps9j.mjs → validate-CWSnKVIJ.mjs} +2 -2
- package/dist/{validate-CuJ1Ps9j.mjs.map → validate-CWSnKVIJ.mjs.map} +1 -1
- package/dist/{validate-CG0V0wNR.d.mts → validate-Z1b86_3B.d.mts} +11 -6
- package/dist/{validate-CG0V0wNR.d.mts.map → validate-Z1b86_3B.d.mts.map} +1 -1
- package/dist/{validation-CwUfTdGF.mjs → validation-c8WjhH8z.mjs} +8 -5
- package/dist/{validation-CwUfTdGF.mjs.map → validation-c8WjhH8z.mjs.map} +1 -1
- package/dist/version-CaccU7DM.mjs +7 -0
- package/dist/{version-BoNBItP_.mjs.map → version-CaccU7DM.mjs.map} +1 -1
- package/dist/{widgets-BfOZ-ajY.mjs → widgets-hWcIicX8.mjs} +3 -3
- package/dist/{widgets-BfOZ-ajY.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-gFsRuNNy.mjs → zod-generator-CacrR-i8.mjs} +2 -2
- package/dist/{zod-generator-gFsRuNNy.mjs.map → zod-generator-CacrR-i8.mjs.map} +1 -1
- package/package.json +6 -6
- package/src/api/handlers/content.ts +69 -23
- package/src/api/handlers/plugins.ts +77 -10
- package/src/api/schemas/import.ts +19 -0
- package/src/astro/integration/runtime.ts +3 -6
- package/src/astro/integration/vite-config.ts +19 -1
- package/src/astro/middleware/auth.ts +10 -3
- package/src/astro/middleware/csp.ts +54 -3
- package/src/astro/middleware.ts +1 -0
- package/src/astro/routes/admin.astro +9 -0
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +6 -1
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +6 -1
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +1 -0
- package/src/astro/routes/api/admin/plugins/index.ts +1 -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/manifest.ts +20 -1
- package/src/astro/routes/api/setup/dev-bypass.ts +7 -2
- package/src/astro/types.ts +4 -0
- package/src/cli/commands/seed.ts +1 -1
- package/src/components/EmDashImage.astro +59 -23
- package/src/components/Image.astro +36 -35
- package/src/components/LiveSearch.astro +40 -4
- package/src/components/live-search-routing.ts +30 -0
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +23 -18
- package/src/database/migrations/048_restore_content_taxonomies_term_index.ts +32 -0
- 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 +6 -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/search/query.ts +3 -0
- package/src/search/types.ts +2 -0
- package/src/seed/apply.ts +158 -101
- package/src/seed/types.ts +6 -1
- package/dist/api-BMfveMoB.mjs.map +0 -1
- package/dist/apply--IVNSdXn.mjs.map +0 -1
- package/dist/byline-fields-eyJMblSr.mjs.map +0 -1
- package/dist/context-C_g-iJVA.mjs.map +0 -1
- package/dist/import-Bb1T9WJS.mjs.map +0 -1
- package/dist/index-BRNabKrx.d.mts.map +0 -1
- package/dist/index-Dt0OKJB4.d.mts.map +0 -1
- package/dist/loader-BA_zhkS_.mjs.map +0 -1
- package/dist/object-cache-CHbHv83-.mjs.map +0 -1
- package/dist/registry-g8yYt4cC.mjs.map +0 -1
- package/dist/runner-DPdt_Wpa.mjs.map +0 -1
- package/dist/search-BR0ZeZmh.mjs.map +0 -1
- package/dist/types-xIfVRNLp.d.mts.map +0 -1
- package/dist/utils-B7A57fm9.mjs.map +0 -1
- package/dist/version-BoNBItP_.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,28 +1,75 @@
|
|
|
1
1
|
import "../../../../../dialect-helpers-DRI5pyY3.mjs";
|
|
2
2
|
import "../../../../../after-B1IIdH3Y.mjs";
|
|
3
|
-
import "../../../../../object-cache-
|
|
3
|
+
import "../../../../../object-cache-Bok5j2ae.mjs";
|
|
4
4
|
import { n as slugify } from "../../../../../slugify-Cce3dTdg.mjs";
|
|
5
5
|
import "../../../../../base64-CmWvODNW.mjs";
|
|
6
|
-
import "../../../../../types-
|
|
6
|
+
import "../../../../../types-CuW0zWDA.mjs";
|
|
7
|
+
import "../../../../../media-BrXIaMFN.mjs";
|
|
8
|
+
import "../../../../../taxonomy-BxGxZZdu.mjs";
|
|
9
|
+
import "../../../../../options-DTTML-Tx.mjs";
|
|
7
10
|
import "../../../../../request-cache-KCNHp_RJ.mjs";
|
|
8
11
|
import "../../../../../byline-registry-BOjqDOim.mjs";
|
|
9
|
-
import "../../../../../field-defs-cache-
|
|
10
|
-
import { t as BylineRepository } from "../../../../../byline-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import "../../../../../
|
|
15
|
-
import
|
|
16
|
-
import "../../../../../
|
|
12
|
+
import "../../../../../field-defs-cache-WUI88LX5.mjs";
|
|
13
|
+
import { t as BylineRepository } from "../../../../../byline-Bm8ZgUP9.mjs";
|
|
14
|
+
import "../../../../../enrich-BQ0mxJRs.mjs";
|
|
15
|
+
import "../../../../../loader-CB6YHeul.mjs";
|
|
16
|
+
import "../../../../../settings-zhmdKyJQ.mjs";
|
|
17
|
+
import "../../../../../resolve-DR3wqMTy.mjs";
|
|
18
|
+
import "../../../../../taxonomies-Cnb4F-Pb.mjs";
|
|
19
|
+
import { t as handleTaxonomyCreate } from "../../../../../taxonomies-BGBd16Eu.mjs";
|
|
20
|
+
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-1g7usGBg.mjs";
|
|
21
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-CkAseSqZ.mjs";
|
|
22
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-GmjecGct.mjs";
|
|
23
|
+
import "../../../../../redirects-DXEXBAII.mjs";
|
|
24
|
+
import { h as wpPluginExecuteBody } from "../../../../../byline-fields-2Lp5Hbgf.mjs";
|
|
25
|
+
import "../../../../../status-CqJQX1QN.mjs";
|
|
17
26
|
import "../../../../../api/schemas/index.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import "../../../../../ssrf-
|
|
20
|
-
import {
|
|
21
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
27
|
+
import { _ as importSiteSettings, a as fetchPluginOptions, i as fetchPluginMenus, n as fetchPluginCommentsPage, o as fetchPluginTaxonomies, p as getSource, r as fetchPluginContentPage, t as fetchPluginComments, v as parseSiteSettingsFromPlugin, x as importMenusFromPlugin, y as importCommentsFromPlugin } from "../../../../../import-fYLf14Co.mjs";
|
|
28
|
+
import "../../../../../ssrf-CmuGgCq3.mjs";
|
|
29
|
+
import { _ as sanitizeFieldSlug, g as resolveImportByline } from "../../../../../utils-BJXElxdw.mjs";
|
|
30
|
+
import { n as requirePerm } from "../../../../../authorize-Dz88F_Fw.mjs";
|
|
31
|
+
import { a as preImportWxrTaxonomies, r as loadTaxonomyPlanFromDb, t as attachPostTaxonomies } from "../../../../../wxr-taxonomies-BC3OYpvx.mjs";
|
|
32
|
+
import { importMediaWithProgress } from "../wordpress/media.mjs";
|
|
22
33
|
import { ContentRepository, SchemaRegistry } from "emdash";
|
|
23
34
|
|
|
24
35
|
//#region src/astro/routes/api/import/wordpress-plugin/execute.ts
|
|
25
36
|
const prerender = false;
|
|
37
|
+
/** Posts per content chunk. 50 posts ≈ a few hundred D1 ops per invocation. */
|
|
38
|
+
const CONTENT_CHUNK_SIZE = 50;
|
|
39
|
+
function emptyImportResult() {
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
imported: 0,
|
|
43
|
+
skipped: 0,
|
|
44
|
+
errors: [],
|
|
45
|
+
byCollection: {}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function parseIdMap(idMap) {
|
|
49
|
+
const contentIdMap = /* @__PURE__ */ new Map();
|
|
50
|
+
const collectionByWpId = /* @__PURE__ */ new Map();
|
|
51
|
+
for (const [key, value] of Object.entries(idMap ?? {})) {
|
|
52
|
+
const wpId = Number(key);
|
|
53
|
+
if (!Number.isFinite(wpId)) continue;
|
|
54
|
+
contentIdMap.set(wpId, value.id);
|
|
55
|
+
collectionByWpId.set(wpId, value.collection);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
contentIdMap,
|
|
59
|
+
collectionByWpId
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function serializeIdMap(contentIdMap, collectionByWpId) {
|
|
63
|
+
const out = {};
|
|
64
|
+
for (const [wpId, id] of contentIdMap) {
|
|
65
|
+
const collection = collectionByWpId.get(wpId);
|
|
66
|
+
if (collection) out[String(wpId)] = {
|
|
67
|
+
id,
|
|
68
|
+
collection
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
26
73
|
const POST = async ({ request, locals }) => {
|
|
27
74
|
const { emdash, user } = locals;
|
|
28
75
|
const denied = requirePerm(user, "import:execute");
|
|
@@ -44,14 +91,47 @@ const POST = async ({ request, locals }) => {
|
|
|
44
91
|
if (postTypes.length === 0) return apiError("VALIDATION_ERROR", "No post types selected for import", 400);
|
|
45
92
|
console.log("[WP Plugin Import] Starting import for:", body.url);
|
|
46
93
|
console.log("[WP Plugin Import] Post types:", postTypes);
|
|
47
|
-
|
|
94
|
+
if (body.phase) return apiSuccess(await runImportPhase(emdash, body, config, postTypes, emdashManifest));
|
|
95
|
+
let taxonomyPlan;
|
|
96
|
+
let taxonomyDefsCreated = [];
|
|
97
|
+
try {
|
|
98
|
+
const built = await buildTaxonomyPlan(emdash, body.url, body.token, config);
|
|
99
|
+
taxonomyPlan = built.plan;
|
|
100
|
+
taxonomyDefsCreated = built.defsCreated;
|
|
101
|
+
} catch (e) {
|
|
102
|
+
console.warn("[WP Plugin Import] Taxonomy pre-import failed:", e);
|
|
103
|
+
}
|
|
104
|
+
const { result, contentIdMap, collectionByWpId } = await importContent(source.fetchContent({
|
|
48
105
|
type: "url",
|
|
49
106
|
url: body.url,
|
|
50
107
|
token: body.token
|
|
51
108
|
}, {
|
|
52
109
|
postTypes,
|
|
53
110
|
includeDrafts: true
|
|
54
|
-
}), config, emdash, emdashManifest);
|
|
111
|
+
}), config, emdash, emdashManifest, taxonomyPlan);
|
|
112
|
+
if (config.importMenus !== false) await importMenusInto(result, emdash, body.url, body.token, contentIdMap);
|
|
113
|
+
try {
|
|
114
|
+
const comments = await fetchPluginComments(body.url, body.token);
|
|
115
|
+
if (comments.length > 0) {
|
|
116
|
+
const commentsResult = await importCommentsFromPlugin(comments, emdash.db, contentIdMap, collectionByWpId);
|
|
117
|
+
result.comments = {
|
|
118
|
+
imported: commentsResult.imported,
|
|
119
|
+
skipped: commentsResult.skipped
|
|
120
|
+
};
|
|
121
|
+
for (const commentError of commentsResult.errors) result.errors.push({
|
|
122
|
+
title: `Comment: ${commentError.comment}`,
|
|
123
|
+
error: commentError.error
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
} catch (e) {
|
|
127
|
+
console.warn("[WP Plugin Import] Comment import failed:", e);
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
result.siteSettings = await applySiteSettings(emdash, body.url, body.token, config);
|
|
131
|
+
} catch (e) {
|
|
132
|
+
console.warn("[WP Plugin Import] Site settings import failed:", e);
|
|
133
|
+
}
|
|
134
|
+
if (taxonomyDefsCreated.length > 0) result.taxonomiesCreated = taxonomyDefsCreated;
|
|
55
135
|
console.log("[WP Plugin Import] Import result:", JSON.stringify(result, null, 2));
|
|
56
136
|
return apiSuccess({
|
|
57
137
|
success: true,
|
|
@@ -61,6 +141,158 @@ const POST = async ({ request, locals }) => {
|
|
|
61
141
|
return handleError(error, "Failed to import from WordPress", "WP_PLUGIN_IMPORT_ERROR");
|
|
62
142
|
}
|
|
63
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* Import navigation menus into `result`, resolving item references through
|
|
146
|
+
* the WP-post-ID -> EmDash-ID map collected during the content pass.
|
|
147
|
+
* Non-fatal: older plugin versions have no /menus endpoint.
|
|
148
|
+
*/
|
|
149
|
+
async function importMenusInto(result, emdash, url, token, contentIdMap) {
|
|
150
|
+
try {
|
|
151
|
+
const menus = await fetchPluginMenus(url, token);
|
|
152
|
+
if (menus.length > 0) {
|
|
153
|
+
const menuResult = await importMenusFromPlugin(menus, emdash.db, contentIdMap);
|
|
154
|
+
result.menus = {
|
|
155
|
+
created: menuResult.menusCreated,
|
|
156
|
+
items: menuResult.itemsCreated
|
|
157
|
+
};
|
|
158
|
+
for (const menuError of menuResult.errors) result.errors.push({
|
|
159
|
+
title: `Menu: ${menuError.menu}`,
|
|
160
|
+
error: menuError.error
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.warn("[WP Plugin Import] Menu import failed:", e);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** Dispatch one chunk of work for the requested phase. */
|
|
168
|
+
async function runImportPhase(emdash, body, config, postTypes, manifest) {
|
|
169
|
+
switch (body.phase) {
|
|
170
|
+
case "content": return runContentChunk(emdash, body, config, postTypes, manifest);
|
|
171
|
+
case "comments": return runCommentsChunk(emdash, body);
|
|
172
|
+
case "finalize": return runFinalizePhase(emdash, body, config);
|
|
173
|
+
case void 0: throw new Error("runImportPhase called without a phase");
|
|
174
|
+
default:
|
|
175
|
+
body.phase;
|
|
176
|
+
throw new Error("Unknown import phase");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Import one page of one post type. The first chunk additionally runs the
|
|
181
|
+
* taxonomy setup (def + term creation); later chunks only reload the
|
|
182
|
+
* lookup maps from the database.
|
|
183
|
+
*/
|
|
184
|
+
async function runContentChunk(emdash, body, config, postTypes, manifest) {
|
|
185
|
+
const cursor = body.cursor ?? {
|
|
186
|
+
postTypeIndex: 0,
|
|
187
|
+
page: 1
|
|
188
|
+
};
|
|
189
|
+
const postType = postTypes[cursor.postTypeIndex];
|
|
190
|
+
if (!postType) return {
|
|
191
|
+
success: true,
|
|
192
|
+
result: emptyImportResult(),
|
|
193
|
+
done: true
|
|
194
|
+
};
|
|
195
|
+
const isFirstChunk = cursor.postTypeIndex === 0 && cursor.page === 1;
|
|
196
|
+
let taxonomyPlan;
|
|
197
|
+
let taxonomyDefsCreated = [];
|
|
198
|
+
try {
|
|
199
|
+
if (isFirstChunk) {
|
|
200
|
+
const built = await buildTaxonomyPlan(emdash, body.url, body.token, config);
|
|
201
|
+
taxonomyPlan = built.plan;
|
|
202
|
+
taxonomyDefsCreated = built.defsCreated;
|
|
203
|
+
} else taxonomyPlan = await loadTaxonomyPlanFromDb(emdash.db);
|
|
204
|
+
} catch (e) {
|
|
205
|
+
console.warn("[WP Plugin Import] Taxonomy pre-import failed:", e);
|
|
206
|
+
}
|
|
207
|
+
const page = await fetchPluginContentPage({
|
|
208
|
+
siteUrl: body.url,
|
|
209
|
+
token: body.token,
|
|
210
|
+
postType,
|
|
211
|
+
page: cursor.page,
|
|
212
|
+
perPage: CONTENT_CHUNK_SIZE,
|
|
213
|
+
includeDrafts: true
|
|
214
|
+
});
|
|
215
|
+
const translationGroupMap = new Map(Object.entries(body.translationGroups ?? {}));
|
|
216
|
+
const { result, contentIdMap, collectionByWpId } = await importContent(page.items, config, emdash, manifest, taxonomyPlan, translationGroupMap);
|
|
217
|
+
if (taxonomyDefsCreated.length > 0) result.taxonomiesCreated = taxonomyDefsCreated;
|
|
218
|
+
let next;
|
|
219
|
+
if (cursor.page < page.totalPages) next = {
|
|
220
|
+
postTypeIndex: cursor.postTypeIndex,
|
|
221
|
+
page: cursor.page + 1
|
|
222
|
+
};
|
|
223
|
+
else if (cursor.postTypeIndex + 1 < postTypes.length) next = {
|
|
224
|
+
postTypeIndex: cursor.postTypeIndex + 1,
|
|
225
|
+
page: 1
|
|
226
|
+
};
|
|
227
|
+
return {
|
|
228
|
+
success: true,
|
|
229
|
+
result,
|
|
230
|
+
done: next === void 0,
|
|
231
|
+
cursor: next,
|
|
232
|
+
chunk: {
|
|
233
|
+
idMap: serializeIdMap(contentIdMap, collectionByWpId),
|
|
234
|
+
translationGroups: Object.fromEntries(translationGroupMap)
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Import one page of comments (500 per page, ordered by WP comment ID so
|
|
240
|
+
* parents precede children across pages). Requires the accumulated idMap
|
|
241
|
+
* from the content phase; threading roots accumulate in `commentRoots`.
|
|
242
|
+
*/
|
|
243
|
+
async function runCommentsChunk(emdash, body) {
|
|
244
|
+
const page = body.cursor?.page ?? 1;
|
|
245
|
+
const result = emptyImportResult();
|
|
246
|
+
const { contentIdMap, collectionByWpId } = parseIdMap(body.idMap);
|
|
247
|
+
const rootIds = /* @__PURE__ */ new Map();
|
|
248
|
+
for (const [key, value] of Object.entries(body.commentRoots ?? {})) {
|
|
249
|
+
const wpId = Number(key);
|
|
250
|
+
if (Number.isFinite(wpId)) rootIds.set(wpId, value);
|
|
251
|
+
}
|
|
252
|
+
const { items, totalPages } = await fetchPluginCommentsPage(body.url, body.token, page);
|
|
253
|
+
if (items.length > 0) {
|
|
254
|
+
const commentsResult = await importCommentsFromPlugin(items, emdash.db, contentIdMap, collectionByWpId, rootIds);
|
|
255
|
+
result.comments = {
|
|
256
|
+
imported: commentsResult.imported,
|
|
257
|
+
skipped: commentsResult.skipped
|
|
258
|
+
};
|
|
259
|
+
for (const commentError of commentsResult.errors) result.errors.push({
|
|
260
|
+
title: `Comment: ${commentError.comment}`,
|
|
261
|
+
error: commentError.error
|
|
262
|
+
});
|
|
263
|
+
result.success = result.errors.length === 0;
|
|
264
|
+
}
|
|
265
|
+
const done = page >= totalPages;
|
|
266
|
+
const commentRoots = {};
|
|
267
|
+
for (const [wpId, id] of rootIds) commentRoots[String(wpId)] = id;
|
|
268
|
+
return {
|
|
269
|
+
success: true,
|
|
270
|
+
result,
|
|
271
|
+
done,
|
|
272
|
+
cursor: done ? void 0 : {
|
|
273
|
+
postTypeIndex: 0,
|
|
274
|
+
page: page + 1
|
|
275
|
+
},
|
|
276
|
+
chunk: { commentRoots }
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/** Menus + site identity — small, runs as a single closing chunk. */
|
|
280
|
+
async function runFinalizePhase(emdash, body, config) {
|
|
281
|
+
const result = emptyImportResult();
|
|
282
|
+
const { contentIdMap } = parseIdMap(body.idMap);
|
|
283
|
+
if (config.importMenus !== false) await importMenusInto(result, emdash, body.url, body.token, contentIdMap);
|
|
284
|
+
try {
|
|
285
|
+
result.siteSettings = await applySiteSettings(emdash, body.url, body.token, config);
|
|
286
|
+
} catch (e) {
|
|
287
|
+
console.warn("[WP Plugin Import] Site settings import failed:", e);
|
|
288
|
+
}
|
|
289
|
+
result.success = result.errors.length === 0;
|
|
290
|
+
return {
|
|
291
|
+
success: true,
|
|
292
|
+
result,
|
|
293
|
+
done: true
|
|
294
|
+
};
|
|
295
|
+
}
|
|
64
296
|
/** Fields that should be auto-created if they don't exist */
|
|
65
297
|
const IMPORT_FIELDS = [
|
|
66
298
|
{
|
|
@@ -86,9 +318,205 @@ const IMPORT_FIELDS = [
|
|
|
86
318
|
label: "Featured Image",
|
|
87
319
|
type: "image",
|
|
88
320
|
check: (item) => !!item.featuredImage
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
slug: "seo_title",
|
|
324
|
+
label: "SEO Title",
|
|
325
|
+
type: "string",
|
|
326
|
+
check: (item) => !!extractSeo(item).title
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
slug: "seo_description",
|
|
330
|
+
label: "SEO Description",
|
|
331
|
+
type: "text",
|
|
332
|
+
check: (item) => !!extractSeo(item).description
|
|
89
333
|
}
|
|
90
334
|
];
|
|
91
|
-
|
|
335
|
+
const SEO_FIELD_SLUGS = new Set(["seo_title", "seo_description"]);
|
|
336
|
+
/**
|
|
337
|
+
* Coerce a WordPress meta value to an EmDash field type. WP postmeta is
|
|
338
|
+
* stringly typed and inconsistent across posts (the same key can hold
|
|
339
|
+
* "5", 5, "", or false). Returns `undefined` when the value can't
|
|
340
|
+
* reasonably represent the target type — the caller drops it.
|
|
341
|
+
*/
|
|
342
|
+
function coerceToFieldType(value, fieldType) {
|
|
343
|
+
switch (fieldType) {
|
|
344
|
+
case "integer": {
|
|
345
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
346
|
+
return Number.isInteger(n) ? n : void 0;
|
|
347
|
+
}
|
|
348
|
+
case "number": {
|
|
349
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
350
|
+
return Number.isFinite(n) ? n : void 0;
|
|
351
|
+
}
|
|
352
|
+
case "boolean":
|
|
353
|
+
if (typeof value === "boolean") return value;
|
|
354
|
+
if (value === 1 || value === "1" || value === "true" || value === "yes") return true;
|
|
355
|
+
if (value === 0 || value === "0" || value === "false" || value === "no") return false;
|
|
356
|
+
return;
|
|
357
|
+
case "datetime": {
|
|
358
|
+
if (typeof value !== "string" && typeof value !== "number") return void 0;
|
|
359
|
+
const d = new Date(value);
|
|
360
|
+
return Number.isNaN(d.getTime()) ? void 0 : d.toISOString();
|
|
361
|
+
}
|
|
362
|
+
case "json": return value;
|
|
363
|
+
case "string":
|
|
364
|
+
case "text":
|
|
365
|
+
case "url":
|
|
366
|
+
case "select":
|
|
367
|
+
case "slug":
|
|
368
|
+
case "reference":
|
|
369
|
+
if (typeof value === "string") return value;
|
|
370
|
+
if (typeof value === "number") return String(value);
|
|
371
|
+
return;
|
|
372
|
+
default: return typeof value === "object" ? value : void 0;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Pull the per-post SEO title/description out of the Yoast / Rank Math
|
|
377
|
+
* blobs the plugin source stashes in `item.meta`. Empty strings mean "not
|
|
378
|
+
* overridden for this post" (the plugin exports the raw meta values) and
|
|
379
|
+
* are treated as absent.
|
|
380
|
+
*/
|
|
381
|
+
function pickSeoValue(blob, key) {
|
|
382
|
+
if (typeof blob !== "object" || blob === null) return void 0;
|
|
383
|
+
const value = blob[key];
|
|
384
|
+
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
385
|
+
}
|
|
386
|
+
function extractSeo(item) {
|
|
387
|
+
const yoast = item.meta?._yoast;
|
|
388
|
+
const rankmath = item.meta?._rankmath;
|
|
389
|
+
return {
|
|
390
|
+
title: pickSeoValue(yoast, "title") ?? pickSeoValue(rankmath, "title"),
|
|
391
|
+
description: pickSeoValue(yoast, "description") ?? pickSeoValue(rankmath, "description")
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Fetch the site's taxonomies from the plugin API and pre-create all terms,
|
|
396
|
+
* reusing the WXR taxonomy machinery (same def-lookup, idempotency, and
|
|
397
|
+
* collection-filter semantics).
|
|
398
|
+
*/
|
|
399
|
+
/** WP built-in taxonomies that either map to seeded defs or are not content taxonomies. */
|
|
400
|
+
const BUILTIN_TAXONOMIES = new Set([
|
|
401
|
+
"category",
|
|
402
|
+
"post_tag",
|
|
403
|
+
"nav_menu",
|
|
404
|
+
"post_format"
|
|
405
|
+
]);
|
|
406
|
+
/** Mirrors NAME_PATTERN in the taxonomy handler -- names that fail stay in missingTaxonomies. */
|
|
407
|
+
const TAXONOMY_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
408
|
+
/**
|
|
409
|
+
* Create EmDash taxonomy defs for custom WP taxonomies (e.g. CPT taxonomies
|
|
410
|
+
* like `company` or `plattform`) that don't exist yet, scoped to the
|
|
411
|
+
* collections the enabled post-type mappings target. Returns the names of
|
|
412
|
+
* the defs created. Runs before term pre-import so the terms and per-post
|
|
413
|
+
* assignments flow through the existing machinery instead of being dropped
|
|
414
|
+
* as `missingTaxonomies`.
|
|
415
|
+
*/
|
|
416
|
+
async function ensureCustomTaxonomyDefs(db, taxonomies, config) {
|
|
417
|
+
const created = [];
|
|
418
|
+
for (const taxonomy of taxonomies) {
|
|
419
|
+
if (BUILTIN_TAXONOMIES.has(taxonomy.name)) continue;
|
|
420
|
+
if (taxonomy.terms.length === 0) continue;
|
|
421
|
+
if (!TAXONOMY_NAME_PATTERN.test(taxonomy.name)) continue;
|
|
422
|
+
if (await db.selectFrom("_emdash_taxonomy_defs").select("id").where("name", "=", taxonomy.name).executeTakeFirst()) continue;
|
|
423
|
+
const collections = (taxonomy.post_types ?? []).map((postType) => config.postTypeMappings[postType]).filter((mapping) => mapping?.enabled).map((mapping) => mapping.collection);
|
|
424
|
+
const result = await handleTaxonomyCreate(db, {
|
|
425
|
+
name: taxonomy.name,
|
|
426
|
+
label: taxonomy.label,
|
|
427
|
+
labelSingular: taxonomy.label_singular,
|
|
428
|
+
hierarchical: taxonomy.hierarchical,
|
|
429
|
+
collections: [...new Set(collections)]
|
|
430
|
+
});
|
|
431
|
+
if (result.success) created.push(taxonomy.name);
|
|
432
|
+
else console.warn(`[WP Plugin Import] Could not create taxonomy '${taxonomy.name}':`, result.error.message);
|
|
433
|
+
}
|
|
434
|
+
return created;
|
|
435
|
+
}
|
|
436
|
+
async function buildTaxonomyPlan(emdash, url, token, config) {
|
|
437
|
+
const taxonomies = await fetchPluginTaxonomies(url, token);
|
|
438
|
+
const defsCreated = await ensureCustomTaxonomyDefs(emdash.db, taxonomies, config);
|
|
439
|
+
const categories = [];
|
|
440
|
+
const tags = [];
|
|
441
|
+
const terms = [];
|
|
442
|
+
for (const taxonomy of taxonomies) for (const term of taxonomy.terms) if (taxonomy.name === "category") categories.push({
|
|
443
|
+
nicename: term.slug,
|
|
444
|
+
name: term.name,
|
|
445
|
+
description: term.description
|
|
446
|
+
});
|
|
447
|
+
else if (taxonomy.name === "post_tag") tags.push({
|
|
448
|
+
slug: term.slug,
|
|
449
|
+
name: term.name,
|
|
450
|
+
description: term.description
|
|
451
|
+
});
|
|
452
|
+
else if (taxonomy.name !== "nav_menu" && taxonomy.name !== "post_format") terms.push({
|
|
453
|
+
id: term.id,
|
|
454
|
+
taxonomy: taxonomy.name,
|
|
455
|
+
slug: term.slug,
|
|
456
|
+
name: term.name,
|
|
457
|
+
description: term.description
|
|
458
|
+
});
|
|
459
|
+
return {
|
|
460
|
+
plan: await preImportWxrTaxonomies(emdash.db, [], categories, tags, terms, void 0),
|
|
461
|
+
defsCreated
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Fetch the source site's options and apply its identity (title, tagline,
|
|
466
|
+
* logo, favicon) as EmDash site settings, overwriting seed placeholders.
|
|
467
|
+
* Logo/favicon files are side-loaded into media storage first; the later
|
|
468
|
+
* full media pass dedupes them by content hash.
|
|
469
|
+
*
|
|
470
|
+
* Returns the list of applied setting keys.
|
|
471
|
+
*/
|
|
472
|
+
async function applySiteSettings(emdash, url, token, config) {
|
|
473
|
+
const wantTitle = config.importSiteTitle !== false;
|
|
474
|
+
const wantLogo = config.importLogo !== false;
|
|
475
|
+
if (!wantTitle && !wantLogo) return [];
|
|
476
|
+
const parsed = parseSiteSettingsFromPlugin(await fetchPluginOptions(url, token));
|
|
477
|
+
if (!wantTitle) {
|
|
478
|
+
delete parsed.title;
|
|
479
|
+
delete parsed.tagline;
|
|
480
|
+
}
|
|
481
|
+
if (!wantLogo) {
|
|
482
|
+
delete parsed.logo;
|
|
483
|
+
delete parsed.favicon;
|
|
484
|
+
}
|
|
485
|
+
const media = {};
|
|
486
|
+
if (emdash.storage && (parsed.logo?.url || parsed.favicon?.url)) {
|
|
487
|
+
const attachments = [];
|
|
488
|
+
if (parsed.logo?.url) attachments.push({
|
|
489
|
+
id: parsed.logo.id,
|
|
490
|
+
url: parsed.logo.url
|
|
491
|
+
});
|
|
492
|
+
if (parsed.favicon?.url && parsed.favicon.url !== parsed.logo?.url) attachments.push({
|
|
493
|
+
id: parsed.favicon.id,
|
|
494
|
+
url: parsed.favicon.url
|
|
495
|
+
});
|
|
496
|
+
const mediaResult = await importMediaWithProgress(attachments, emdash.db, emdash.storage, () => {});
|
|
497
|
+
for (const item of mediaResult.imported) {
|
|
498
|
+
if (item.originalUrl === parsed.logo?.url) media.logoMediaId = item.mediaId;
|
|
499
|
+
if (item.originalUrl === parsed.favicon?.url) media.faviconMediaId = item.mediaId;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
const settingsResult = await importSiteSettings(parsed, emdash.db, true, media);
|
|
503
|
+
for (const settingError of settingsResult.errors) console.warn(`[WP Plugin Import] Site setting "${settingError.setting}" failed:`, settingError.error);
|
|
504
|
+
return settingsResult.applied;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Adapt a NormalizedItem's taxonomy assignments to the WxrPost shape the
|
|
508
|
+
* shared attach helper consumes.
|
|
509
|
+
*/
|
|
510
|
+
function toWxrAssignments(item) {
|
|
511
|
+
return {
|
|
512
|
+
categories: item.categories ?? [],
|
|
513
|
+
tags: item.tags ?? [],
|
|
514
|
+
customTaxonomies: item.customTaxonomies ? new Map(Object.entries(item.customTaxonomies)) : void 0,
|
|
515
|
+
meta: /* @__PURE__ */ new Map()
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
/** Exported for tests (field auto-creation regression coverage). */
|
|
519
|
+
async function importContent(items, config, emdash, manifest, taxonomyPlan, seedTranslationGroups) {
|
|
92
520
|
const result = {
|
|
93
521
|
success: true,
|
|
94
522
|
imported: 0,
|
|
@@ -96,12 +524,15 @@ async function importContent(items, config, emdash, manifest) {
|
|
|
96
524
|
errors: [],
|
|
97
525
|
byCollection: {}
|
|
98
526
|
};
|
|
527
|
+
const contentIdMap = /* @__PURE__ */ new Map();
|
|
528
|
+
const collectionByWpId = /* @__PURE__ */ new Map();
|
|
99
529
|
const contentRepo = new ContentRepository(emdash.db);
|
|
100
530
|
const bylineRepo = new BylineRepository(emdash.db);
|
|
101
531
|
const bylineCache = /* @__PURE__ */ new Map();
|
|
102
532
|
const schemaRegistry = new SchemaRegistry(emdash.db);
|
|
103
|
-
const
|
|
104
|
-
const
|
|
533
|
+
const ensuredFields = /* @__PURE__ */ new Set();
|
|
534
|
+
const fieldTypesByCollection = /* @__PURE__ */ new Map();
|
|
535
|
+
const translationGroupMap = seedTranslationGroups ?? /* @__PURE__ */ new Map();
|
|
105
536
|
for await (const item of items) {
|
|
106
537
|
console.log("[WP Plugin Import] Processing item:", {
|
|
107
538
|
sourceId: item.sourceId,
|
|
@@ -127,29 +558,43 @@ async function importContent(items, config, emdash, manifest) {
|
|
|
127
558
|
continue;
|
|
128
559
|
}
|
|
129
560
|
try {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
561
|
+
for (const field of IMPORT_FIELDS) {
|
|
562
|
+
if (config.importSeo === false && SEO_FIELD_SLUGS.has(field.slug)) continue;
|
|
563
|
+
const ensureKey = `${collection}:${field.slug}`;
|
|
564
|
+
if (ensuredFields.has(ensureKey) || !field.check(item)) continue;
|
|
565
|
+
ensuredFields.add(ensureKey);
|
|
566
|
+
if (!await schemaRegistry.getField(collection, field.slug)) {
|
|
567
|
+
console.log(`[WP Plugin Import] Creating missing field "${field.slug}" in collection "${collection}"`);
|
|
568
|
+
try {
|
|
569
|
+
await schemaRegistry.createField(collection, {
|
|
570
|
+
slug: field.slug,
|
|
571
|
+
label: field.label,
|
|
572
|
+
type: field.type,
|
|
573
|
+
required: false
|
|
574
|
+
});
|
|
575
|
+
fieldTypesByCollection.get(collection)?.set(field.slug, field.type);
|
|
576
|
+
} catch (e) {
|
|
577
|
+
console.log(`[WP Plugin Import] Field "${field.slug}" creation skipped:`, e instanceof Error ? e.message : e);
|
|
144
578
|
}
|
|
145
579
|
}
|
|
146
|
-
|
|
580
|
+
}
|
|
581
|
+
let fieldTypes = fieldTypesByCollection.get(collection);
|
|
582
|
+
if (!fieldTypes) {
|
|
583
|
+
fieldTypes = /* @__PURE__ */ new Map();
|
|
584
|
+
const collectionDef = await schemaRegistry.getCollection(collection);
|
|
585
|
+
if (collectionDef) for (const field of await schemaRegistry.listFields(collectionDef.id)) fieldTypes.set(field.slug, field.type);
|
|
586
|
+
fieldTypesByCollection.set(collection, fieldTypes);
|
|
147
587
|
}
|
|
148
588
|
const slug = item.slug || slugify(item.title || `post-${item.sourceId}`);
|
|
149
589
|
if (config.skipExisting) {
|
|
150
590
|
const existing = await contentRepo.findBySlug(collection, slug, item.locale);
|
|
151
591
|
if (existing) {
|
|
152
592
|
if (item.translationGroup) translationGroupMap.set(item.translationGroup, existing.id);
|
|
593
|
+
const wpId = Number(item.sourceId);
|
|
594
|
+
if (Number.isFinite(wpId)) {
|
|
595
|
+
contentIdMap.set(wpId, existing.id);
|
|
596
|
+
collectionByWpId.set(wpId, collection);
|
|
597
|
+
}
|
|
153
598
|
result.skipped++;
|
|
154
599
|
continue;
|
|
155
600
|
}
|
|
@@ -163,6 +608,25 @@ async function importContent(items, config, emdash, manifest) {
|
|
|
163
608
|
data.featured_image = item.featuredImage;
|
|
164
609
|
console.log("[WP Plugin Import] Adding featured_image:", item.featuredImage);
|
|
165
610
|
}
|
|
611
|
+
if (config.importSeo !== false) {
|
|
612
|
+
const seo = extractSeo(item);
|
|
613
|
+
if (seo.title) data.seo_title = seo.title;
|
|
614
|
+
if (seo.description) data.seo_description = seo.description;
|
|
615
|
+
}
|
|
616
|
+
const assignMetaValue = (key, value) => {
|
|
617
|
+
if (value === null || value === "") return;
|
|
618
|
+
const fieldSlug = sanitizeFieldSlug(key);
|
|
619
|
+
const fieldType = fieldTypes.get(fieldSlug);
|
|
620
|
+
if (!fieldType || fieldSlug in data) return;
|
|
621
|
+
const coerced = coerceToFieldType(value, fieldType);
|
|
622
|
+
if (coerced !== void 0) data[fieldSlug] = coerced;
|
|
623
|
+
};
|
|
624
|
+
const acf = item.meta?._acf;
|
|
625
|
+
if (typeof acf === "object" && acf !== null) for (const [key, value] of Object.entries(acf)) assignMetaValue(key, value);
|
|
626
|
+
if (item.meta) for (const [key, value] of Object.entries(item.meta)) {
|
|
627
|
+
if (key.startsWith("_")) continue;
|
|
628
|
+
assignMetaValue(key, value);
|
|
629
|
+
}
|
|
166
630
|
let authorId;
|
|
167
631
|
if (config.authorMappings && item.author) {
|
|
168
632
|
const mappedUserId = config.authorMappings[item.author];
|
|
@@ -191,10 +655,21 @@ async function importContent(items, config, emdash, manifest) {
|
|
|
191
655
|
if (createResult.success) {
|
|
192
656
|
result.imported++;
|
|
193
657
|
result.byCollection[collection] = (result.byCollection[collection] || 0) + 1;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
658
|
+
const createdId = createResult.data?.item?.id;
|
|
659
|
+
if (createdId) {
|
|
660
|
+
const wpId = Number(item.sourceId);
|
|
661
|
+
if (Number.isFinite(wpId)) {
|
|
662
|
+
contentIdMap.set(wpId, createdId);
|
|
663
|
+
collectionByWpId.set(wpId, collection);
|
|
664
|
+
}
|
|
665
|
+
if (taxonomyPlan) try {
|
|
666
|
+
const attached = await attachPostTaxonomies(emdash.db, collection, createdId, toWxrAssignments(item), taxonomyPlan);
|
|
667
|
+
if (attached > 0) result.taxonomyAssignments = (result.taxonomyAssignments ?? 0) + attached;
|
|
668
|
+
} catch (e) {
|
|
669
|
+
console.warn(`[WP Plugin Import] Taxonomy attach failed for "${slug}":`, e);
|
|
670
|
+
}
|
|
197
671
|
}
|
|
672
|
+
if (item.translationGroup && !translationGroupMap.has(item.translationGroup) && createdId) translationGroupMap.set(item.translationGroup, createdId);
|
|
198
673
|
} else result.errors.push({
|
|
199
674
|
title: item.title || "Untitled",
|
|
200
675
|
error: typeof createResult.error === "object" && createResult.error !== null ? createResult.error.message || "Unknown error" : String(createResult.error)
|
|
@@ -207,8 +682,13 @@ async function importContent(items, config, emdash, manifest) {
|
|
|
207
682
|
});
|
|
208
683
|
}
|
|
209
684
|
}
|
|
685
|
+
if (taxonomyPlan && taxonomyPlan.missingTaxonomies.length > 0) result.missingTaxonomies = taxonomyPlan.missingTaxonomies;
|
|
210
686
|
result.success = result.errors.length === 0;
|
|
211
|
-
return
|
|
687
|
+
return {
|
|
688
|
+
result,
|
|
689
|
+
contentIdMap,
|
|
690
|
+
collectionByWpId
|
|
691
|
+
};
|
|
212
692
|
}
|
|
213
693
|
function mapStatus(wpStatus) {
|
|
214
694
|
switch (wpStatus) {
|
|
@@ -221,5 +701,5 @@ function mapStatus(wpStatus) {
|
|
|
221
701
|
}
|
|
222
702
|
|
|
223
703
|
//#endregion
|
|
224
|
-
export { POST, prerender };
|
|
704
|
+
export { POST, coerceToFieldType, ensureCustomTaxonomyDefs, importContent, prerender };
|
|
225
705
|
//# sourceMappingURL=execute.mjs.map
|