emdash 0.36.0 → 0.37.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-CzL3H752.d.mts → adapters-BDQwg236.d.mts} +4 -2
- package/dist/{adapters-CzL3H752.d.mts.map → adapters-BDQwg236.d.mts.map} +1 -1
- package/dist/{allowed-origins-maylGaHv.mjs → allowed-origins-BGglilcs.mjs} +2 -2
- package/dist/{allowed-origins-maylGaHv.mjs.map → allowed-origins-BGglilcs.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +17 -17
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/api-Dz6rgoa3.mjs +10040 -0
- package/dist/api-Dz6rgoa3.mjs.map +1 -0
- package/dist/{api-tokens-9YrrCoE6.mjs → api-tokens-BSsQACNe.mjs} +2 -2
- package/dist/{api-tokens-9YrrCoE6.mjs.map → api-tokens-BSsQACNe.mjs.map} +1 -1
- package/dist/{apply-B_VMpJ2P.mjs → apply-B4SIOxR1.mjs} +18 -18
- package/dist/{apply-B_VMpJ2P.mjs.map → apply-B4SIOxR1.mjs.map} +1 -1
- package/dist/astro/image-endpoint.mjs +2 -2
- package/dist/astro/image-endpoint.mjs.map +1 -1
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +110 -37
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +6 -6
- package/dist/astro/middleware/media-usage-write-fence.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +3 -3
- package/dist/astro/middleware/request-context.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +10 -10
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +157 -195
- 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 +3 -3
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +3 -3
- 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 +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +3 -3
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +10 -10
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +13 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +13 -13
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +11 -11
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +14 -14
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +13 -13
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +13 -13
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +49 -49
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +49 -49
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +54 -50
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +17 -16
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +93 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -47
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -47
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -47
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- 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 +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +7 -7
- package/dist/astro/routes/api/auth/mode.mjs +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +14 -5
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +13 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +14 -5
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +2 -2
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +11 -11
- 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 +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +22 -22
- package/dist/astro/routes/api/manifest.mjs +3 -3
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +188 -65
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +9 -9
- package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs +91 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs +5 -5
- package/dist/astro/routes/api/media/_id_/usage.mjs +16 -16
- package/dist/astro/routes/api/media/_id_.mjs +15 -15
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -2
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/_id_.mjs +8 -8
- package/dist/astro/routes/api/media/folders/index.mjs +8 -8
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +15 -13
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +47 -24
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +20 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +15 -11
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +15 -11
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +16 -12
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +21 -14
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +15 -11
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
- package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
- package/dist/astro/routes/api/oauth/token.mjs +5 -5
- package/dist/astro/routes/api/openapi.json.mjs +104 -38
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +8 -8
- package/dist/astro/routes/api/redirects/404s/summary.mjs +8 -8
- package/dist/astro/routes/api/redirects/_id_.mjs +9 -9
- package/dist/astro/routes/api/redirects/index.mjs +9 -9
- package/dist/astro/routes/api/relations/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/relations/_id_/translations.mjs +10 -10
- package/dist/astro/routes/api/relations/index.mjs +15 -15
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/index.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/reorder.mjs +47 -47
- package/dist/astro/routes/api/schema/index.mjs +8 -8
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -47
- package/dist/astro/routes/api/schema/orphans/index.mjs +47 -47
- 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 +5 -5
- 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/backups/archives/_name_.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +4 -4
- package/dist/astro/routes/api/settings/backups/export.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/index.mjs +6 -6
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings/email.mjs.map +1 -1
- package/dist/astro/routes/api/settings.d.mts.map +1 -1
- package/dist/astro/routes/api/settings.mjs +18 -14
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- 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 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
- package/dist/astro/routes/api/setup/index.mjs +25 -25
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +19 -15
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +20 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +24 -17
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +19 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +25 -18
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +19 -15
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +4 -4
- package/dist/astro/routes/api/typegen.mjs +4 -4
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -8
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +16 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +14 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -5
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +14 -11
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +5 -5
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +8 -8
- package/dist/astro/routes/sitemap.xml.mjs +6 -6
- package/dist/astro/types.d.mts +32 -17
- 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-ByYs-Uxs.mjs → authorize-Bkf_UHhD.mjs} +2 -2
- package/dist/{authorize-ByYs-Uxs.mjs.map → authorize-Bkf_UHhD.mjs.map} +1 -1
- package/dist/{backup-ChyHfIoX.mjs → backup-rwVAl9NI.mjs} +4 -4
- package/dist/{backup-ChyHfIoX.mjs.map → backup-rwVAl9NI.mjs.map} +1 -1
- package/dist/{bundle-DZFhFurR.mjs → bundle-C8S2Zl6U.mjs} +3 -3
- package/dist/{bundle-DZFhFurR.mjs.map → bundle-C8S2Zl6U.mjs.map} +1 -1
- package/dist/{byline-Cpnwrje1.mjs → byline-DuhF7NWl.mjs} +25 -12
- package/dist/byline-DuhF7NWl.mjs.map +1 -0
- package/dist/{byline-fields-CAyA_Umd.mjs → byline-fields-BovY4KYM.mjs} +1 -1
- package/dist/{byline-fields-CAyA_Umd.mjs.map → byline-fields-BovY4KYM.mjs.map} +1 -1
- package/dist/{bylines-BSo9B9RX.mjs → bylines-CJ5nd6Lw.mjs} +6 -6
- package/dist/{bylines-BSo9B9RX.mjs.map → bylines-CJ5nd6Lw.mjs.map} +1 -1
- package/dist/{bylines-CHjvehVX.mjs → bylines-RwBAeOF1.mjs} +3 -3
- package/dist/{bylines-CHjvehVX.mjs.map → bylines-RwBAeOF1.mjs.map} +1 -1
- package/dist/{cache-5VirJ2Cn.mjs → cache-BF5Kvn59.mjs} +2 -2
- package/dist/{cache-5VirJ2Cn.mjs.map → cache-BF5Kvn59.mjs.map} +1 -1
- package/dist/{challenge-store-D5pSY2S1.mjs → challenge-store-DQN_Yrck.mjs} +5 -3
- package/dist/challenge-store-DQN_Yrck.mjs.map +1 -0
- package/dist/chrome-tags-D8fiZG94.mjs +24 -0
- package/dist/chrome-tags-D8fiZG94.mjs.map +1 -0
- package/dist/{chunks-bNiX6_DR.mjs → chunks-C4szrD8o.mjs} +2 -2
- package/dist/{chunks-bNiX6_DR.mjs.map → chunks-C4szrD8o.mjs.map} +1 -1
- package/dist/cli/index.mjs +26 -26
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.mjs +2 -2
- package/dist/{collection-deletion-m_oi2c0N.mjs → collection-deletion-Bj07NHbj.mjs} +2 -2
- package/dist/{collection-deletion-m_oi2c0N.mjs.map → collection-deletion-Bj07NHbj.mjs.map} +1 -1
- package/dist/{comment-reaction-CRuItEjt.mjs → comment-reaction-BhrvSHml.mjs} +2 -2
- package/dist/{comment-reaction-CRuItEjt.mjs.map → comment-reaction-BhrvSHml.mjs.map} +1 -1
- package/dist/{comment-DhvLEdhQ.mjs → comment-vxOzWbZN.mjs} +2 -2
- package/dist/{comment-DhvLEdhQ.mjs.map → comment-vxOzWbZN.mjs.map} +1 -1
- package/dist/{comments-CLj4bi8I.mjs → comments-Ct4ensnf.mjs} +2 -2
- package/dist/{comments-CLj4bi8I.mjs.map → comments-Ct4ensnf.mjs.map} +1 -1
- package/dist/{components-v4U4DT2y.mjs → components-DJbo1z0S.mjs} +1 -1
- package/dist/{components-v4U4DT2y.mjs.map → components-DJbo1z0S.mjs.map} +1 -1
- package/dist/{config-DrfghTPe.d.mts → config-B9eZ340f.d.mts} +1 -1
- package/dist/{config-DrfghTPe.d.mts.map → config-B9eZ340f.d.mts.map} +1 -1
- package/dist/config-it29yDLA.mjs +1163 -0
- package/dist/config-it29yDLA.mjs.map +1 -0
- package/dist/{content-CP-SeXNa.mjs → content-DjvM0T92.mjs} +84 -44
- package/dist/content-DjvM0T92.mjs.map +1 -0
- package/dist/{content-list-query-BhejKVqb.d.mts → content-list-query-Btqd4uV2.d.mts} +1 -1
- package/dist/{content-list-query-BhejKVqb.d.mts.map → content-list-query-Btqd4uV2.d.mts.map} +1 -1
- package/dist/{content-refresh-DLOfIhYc.mjs → content-refresh-Bwp-8yGy.mjs} +48 -21
- package/dist/content-refresh-Bwp-8yGy.mjs.map +1 -0
- package/dist/{content-repair-BCxzy0r4.mjs → content-repair-Czdp7jz5.mjs} +4 -4
- package/dist/{content-repair-BCxzy0r4.mjs.map → content-repair-Czdp7jz5.mjs.map} +1 -1
- package/dist/{context-BR5hRWiK.mjs → context-CX6gxOLW.mjs} +52 -17
- package/dist/context-CX6gxOLW.mjs.map +1 -0
- package/dist/{cron-CWfWrWKG.mjs → cron-C6o7VppJ.mjs} +1 -1
- package/dist/{cron-CWfWrWKG.mjs.map → cron-C6o7VppJ.mjs.map} +1 -1
- package/dist/{dashboard-CkIV2rnQ.mjs → dashboard-C2kTeeRI.mjs} +4 -4
- package/dist/{dashboard-CkIV2rnQ.mjs.map → dashboard-C2kTeeRI.mjs.map} +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +4 -4
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +4 -4
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/postgres.d.mts.map +1 -1
- package/dist/db/postgres.mjs +19 -3
- package/dist/db/postgres.mjs.map +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +4 -4
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/{default-YMEfcQUx.mjs → default-Clra32mw.mjs} +1 -1
- package/dist/{default-YMEfcQUx.mjs.map → default-Clra32mw.mjs.map} +1 -1
- package/dist/{deferred-tasks-DfqxH5Xf.d.mts → deferred-tasks-CvDETTJO.d.mts} +1 -1
- package/dist/{deferred-tasks-DfqxH5Xf.d.mts.map → deferred-tasks-CvDETTJO.d.mts.map} +1 -1
- package/dist/dev-typegen-DzOPfsNj.mjs +29 -0
- package/dist/dev-typegen-DzOPfsNj.mjs.map +1 -0
- package/dist/{device-flow-CojjSBwb.mjs → device-flow-D2oCWvLJ.mjs} +4 -4
- package/dist/{device-flow-CojjSBwb.mjs.map → device-flow-D2oCWvLJ.mjs.map} +1 -1
- package/dist/{direct-executor-BWeWiRYB.mjs → direct-executor-Bfa5_ToE.mjs} +3 -3
- package/dist/{direct-executor-BWeWiRYB.mjs.map → direct-executor-Bfa5_ToE.mjs.map} +1 -1
- package/dist/{email-console-CEJgR_LB.mjs → email-console-Dzb6uGYa.mjs} +1 -1
- package/dist/{email-console-CEJgR_LB.mjs.map → email-console-Dzb6uGYa.mjs.map} +1 -1
- package/dist/{error-D9w94fjV.mjs → error-DFrQjppn.mjs} +2 -2
- package/dist/{error-D9w94fjV.mjs.map → error-DFrQjppn.mjs.map} +1 -1
- package/dist/{errors-n2j49uNf.mjs → errors-DsVoDUjJ.mjs} +3 -1
- package/dist/errors-DsVoDUjJ.mjs.map +1 -0
- package/dist/{escape-DN4Qmjsl.mjs → escape-HmHTC1Is.mjs} +1 -1
- package/dist/{escape-DN4Qmjsl.mjs.map → escape-HmHTC1Is.mjs.map} +1 -1
- package/dist/{field-defs-cache-Bh4q6oar.mjs → field-defs-cache-BM4SIRqH.mjs} +2 -2
- package/dist/{field-defs-cache-Bh4q6oar.mjs.map → field-defs-cache-BM4SIRqH.mjs.map} +1 -1
- package/dist/{fts-manager-BhOdW0bi.mjs → fts-manager-Do1BlW2r.mjs} +2 -2
- package/dist/{fts-manager-BhOdW0bi.mjs.map → fts-manager-Do1BlW2r.mjs.map} +1 -1
- package/dist/{hash-CTcngWvj.mjs → hash-3JJPlHF2.mjs} +1 -1
- package/dist/{hash-CTcngWvj.mjs.map → hash-3JJPlHF2.mjs.map} +1 -1
- package/dist/hook-result-DCh2WUpe.d.mts +31 -0
- package/dist/hook-result-DCh2WUpe.d.mts.map +1 -0
- package/dist/{hreflang-7pTHsLZJ.d.mts → hreflang-B6hbAuuO.d.mts} +2 -2
- package/dist/{hreflang-7pTHsLZJ.d.mts.map → hreflang-B6hbAuuO.d.mts.map} +1 -1
- package/dist/{hreflang-Huc6O5wa.mjs → hreflang-DQbPZliA.mjs} +6 -6
- package/dist/{hreflang-Huc6O5wa.mjs.map → hreflang-DQbPZliA.mjs.map} +1 -1
- package/dist/{identity-DXmb4aVp.mjs → identity-DksvEazf.mjs} +3 -3
- package/dist/{identity-DXmb4aVp.mjs.map → identity-DksvEazf.mjs.map} +1 -1
- package/dist/{import-C4_O3KXU.mjs → import-CJpaBBBT.mjs} +5 -5
- package/dist/{import-C4_O3KXU.mjs.map → import-CJpaBBBT.mjs.map} +1 -1
- package/dist/{index-DWbJrsAg.d.mts → index-BJNMCWmu.d.mts} +158 -49
- package/dist/index-BJNMCWmu.d.mts.map +1 -0
- package/dist/{index-6bRee8zb.d.mts → index-Du8K7bWa.d.mts} +3 -3
- package/dist/{index-6bRee8zb.d.mts.map → index-Du8K7bWa.d.mts.map} +1 -1
- package/dist/index.d.mts +22 -21
- package/dist/index.mjs +70 -70
- package/dist/{load-Bo7fZAbg.mjs → load-CawHjTOH.mjs} +2 -2
- package/dist/{load-Bo7fZAbg.mjs.map → load-CawHjTOH.mjs.map} +1 -1
- package/dist/{loader-ZsjE4paL.mjs → loader-Z8vl7zTq.mjs} +48 -13
- package/dist/loader-Z8vl7zTq.mjs.map +1 -0
- package/dist/{manifest-builder-QXuqvVMP.mjs → manifest-builder-COtzuca2.mjs} +2 -2
- package/dist/{manifest-builder-QXuqvVMP.mjs.map → manifest-builder-COtzuca2.mjs.map} +1 -1
- package/dist/{manifest-schema-CUYPfCEH.mjs → manifest-schema-BNWwR8Vd.mjs} +5 -5
- package/dist/manifest-schema-BNWwR8Vd.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts +4 -2
- package/dist/media/image-endpoint.d.mts.map +1 -1
- package/dist/media/image-endpoint.mjs +6 -4
- package/dist/media/image-endpoint.mjs.map +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +4 -4
- package/dist/{media-D6SeAfBl.mjs → media-BBm8Wg3f.mjs} +30 -2
- package/dist/media-BBm8Wg3f.mjs.map +1 -0
- package/dist/{media-BjwNuLEu.mjs → media-BHjus86Y.mjs} +35 -5
- package/dist/media-BHjus86Y.mjs.map +1 -0
- package/dist/{media-allowlist-D35v7bmL.mjs → media-allowlist-CoTBWoDp.mjs} +1 -1
- package/dist/{media-allowlist-D35v7bmL.mjs.map → media-allowlist-CoTBWoDp.mjs.map} +1 -1
- package/dist/{media-folders-D-0CmRZj.mjs → media-folders-BGkATs8n.mjs} +1 -1
- package/dist/{media-folders-D-0CmRZj.mjs.map → media-folders-BGkATs8n.mjs.map} +1 -1
- package/dist/{media-upload-C7bLXGcI.mjs → media-upload-BCidR-EY.mjs} +6 -6
- package/dist/{media-upload-C7bLXGcI.mjs.map → media-upload-BCidR-EY.mjs.map} +1 -1
- package/dist/{media-url-DH7giMx_.mjs → media-url-DHoPr0hq.mjs} +1 -1
- package/dist/{media-url-DH7giMx_.mjs.map → media-url-DHoPr0hq.mjs.map} +1 -1
- package/dist/{media-usage-BTRJvS6V.mjs → media-usage-CdY5jhSR.mjs} +8 -8
- package/dist/{media-usage-BTRJvS6V.mjs.map → media-usage-CdY5jhSR.mjs.map} +1 -1
- package/dist/{media-usage-activation-Dx0kPV6b.mjs → media-usage-activation-BgeMtK5C.mjs} +2 -2
- package/dist/{media-usage-activation-Dx0kPV6b.mjs.map → media-usage-activation-BgeMtK5C.mjs.map} +1 -1
- package/dist/{media-usage-work-DWb2XPMI.mjs → media-usage-work-CnGCdHxx.mjs} +4 -4
- package/dist/{media-usage-work-DWb2XPMI.mjs.map → media-usage-work-CnGCdHxx.mjs.map} +1 -1
- package/dist/{media-usage-work-C-fhM30c.mjs → media-usage-work-D6D9sMCA.mjs} +1 -1
- package/dist/{media-usage-work-C-fhM30c.mjs.map → media-usage-work-D6D9sMCA.mjs.map} +1 -1
- package/dist/{media-usage-write-fence-BwoJVRDC.mjs → media-usage-write-fence-hjeD4u7s.mjs} +2 -2
- package/dist/{media-usage-write-fence-BwoJVRDC.mjs.map → media-usage-write-fence-hjeD4u7s.mjs.map} +1 -1
- package/dist/{menus-CNg0QlDt.mjs → menus-6qSwTNxG.mjs} +346 -94
- package/dist/menus-6qSwTNxG.mjs.map +1 -0
- package/dist/{menus-CD7EFLwz.mjs → menus-uvPLXMZf.mjs} +3 -3
- package/dist/{menus-CD7EFLwz.mjs.map → menus-uvPLXMZf.mjs.map} +1 -1
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +3 -3
- package/dist/{mode-DaUM_MB2.mjs → mode-DN_WneRx.mjs} +1 -1
- package/dist/{mode-DaUM_MB2.mjs.map → mode-DN_WneRx.mjs.map} +1 -1
- package/dist/{node-sqlite-compat-Udb4Y-rs.mjs → node-sqlite-compat-BuJXIeMz.mjs} +1 -1
- package/dist/{node-sqlite-compat-Udb4Y-rs.mjs.map → node-sqlite-compat-BuJXIeMz.mjs.map} +1 -1
- package/dist/{normalize-CSxdKBVa.mjs → normalize-C2xNjTSG.mjs} +15 -5
- package/dist/normalize-C2xNjTSG.mjs.map +1 -0
- package/dist/{oauth-authorization-Dpsb-fMJ.mjs → oauth-authorization-Dj6Kwc21.mjs} +4 -4
- package/dist/{oauth-authorization-Dpsb-fMJ.mjs.map → oauth-authorization-Dj6Kwc21.mjs.map} +1 -1
- package/dist/{oauth-clients-Bxnoe_67.mjs → oauth-clients-FD7I0J8m.mjs} +1 -1
- package/dist/{oauth-clients-Bxnoe_67.mjs.map → oauth-clients-FD7I0J8m.mjs.map} +1 -1
- package/dist/{oauth-state-store-0C4s0K6w.mjs → oauth-state-store-DkmDOmHs.mjs} +1 -1
- package/dist/{oauth-state-store-0C4s0K6w.mjs.map → oauth-state-store-DkmDOmHs.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-wlGYSeqX.mjs → oauth-user-lookup-CvIwGpYd.mjs} +1 -1
- package/dist/{oauth-user-lookup-wlGYSeqX.mjs.map → oauth-user-lookup-CvIwGpYd.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-71tPfV4A.mjs → object-cache-DVKnyOfy.mjs} +19 -3
- package/dist/object-cache-DVKnyOfy.mjs.map +1 -0
- package/dist/{options-BhZIeFY1.d.mts → options-CYb4y7hM.d.mts} +24 -11
- package/dist/options-CYb4y7hM.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BRJg1kz8.mjs → parse-Ckpg-Qfp.mjs} +2 -2
- package/dist/{parse-BRJg1kz8.mjs.map → parse-Ckpg-Qfp.mjs.map} +1 -1
- package/dist/{passkey-config-B3P0nHRR.mjs → passkey-config-O_lj3y0k.mjs} +1 -1
- package/dist/{passkey-config-B3P0nHRR.mjs.map → passkey-config-O_lj3y0k.mjs.map} +1 -1
- package/dist/{placeholder-BR4ZhVJl.d.mts → placeholder-4X9BrRrp.d.mts} +1 -1
- package/dist/{placeholder-BR4ZhVJl.d.mts.map → placeholder-4X9BrRrp.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +8 -3
- package/dist/plugin-types.d.mts.map +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/{policy-BVRganJQ.mjs → policy-Dhtwntrt.mjs} +2 -2
- package/dist/{policy-BVRganJQ.mjs.map → policy-Dhtwntrt.mjs.map} +1 -1
- package/dist/{portable-text-C8Tvp4_g.mjs → portable-text-U85hOafW.mjs} +1 -1
- package/dist/{portable-text-C8Tvp4_g.mjs.map → portable-text-U85hOafW.mjs.map} +1 -1
- package/dist/{preview-dn2dUyM0.mjs → preview-B_vJLvf8.mjs} +2 -2
- package/dist/{preview-dn2dUyM0.mjs.map → preview-B_vJLvf8.mjs.map} +1 -1
- package/dist/{protocol-CuBEsqgE.d.mts → protocol-JdD2YhY9.d.mts} +2 -2
- package/dist/{protocol-CuBEsqgE.d.mts.map → protocol-JdD2YhY9.d.mts.map} +1 -1
- package/dist/{public-url-DRz_AinV.mjs → public-url-CarhZJgf.mjs} +1 -1
- package/dist/{public-url-DRz_AinV.mjs.map → public-url-CarhZJgf.mjs.map} +1 -1
- package/dist/{query-D18vTdha.mjs → query-BZKZcG5b.mjs} +14 -14
- package/dist/{query-D18vTdha.mjs.map → query-BZKZcG5b.mjs.map} +1 -1
- package/dist/{query-tZDEdtCN.mjs → query-BndaFxxp.mjs} +4 -4
- package/dist/{query-tZDEdtCN.mjs.map → query-BndaFxxp.mjs.map} +1 -1
- package/dist/{rate-limit-on7KPo-v.mjs → rate-limit-BZmATC6W.mjs} +2 -2
- package/dist/{rate-limit-on7KPo-v.mjs.map → rate-limit-BZmATC6W.mjs.map} +1 -1
- package/dist/{redirect-DrbEmU9a.mjs → redirect-CzqnLxK-.mjs} +1 -1
- package/dist/{redirect-DrbEmU9a.mjs.map → redirect-CzqnLxK-.mjs.map} +1 -1
- package/dist/{redirects-CRIM55KH.mjs → redirects-BLNOWQTn.mjs} +63 -28
- package/dist/redirects-BLNOWQTn.mjs.map +1 -0
- package/dist/{redirects-BahWiu8Z.mjs → redirects-CqzNM0KM.mjs} +2 -2
- package/dist/{redirects-BahWiu8Z.mjs.map → redirects-CqzNM0KM.mjs.map} +1 -1
- package/dist/{registry-Cx-jEJOS.mjs → registry-AZAsRsor.mjs} +27 -9
- package/dist/registry-AZAsRsor.mjs.map +1 -0
- package/dist/{relation-A6wLF_DS.mjs → relation-04DfKRTO.mjs} +2 -2
- package/dist/{relation-A6wLF_DS.mjs.map → relation-04DfKRTO.mjs.map} +1 -1
- package/dist/{relations-BTPM2saV.mjs → relations-C4htk5sb.mjs} +7 -7
- package/dist/relations-C4htk5sb.mjs.map +1 -0
- package/dist/{relations-Cj5hZ6Zg.mjs → relations-CcFwDJdJ.mjs} +4 -4
- package/dist/{relations-Cj5hZ6Zg.mjs.map → relations-CcFwDJdJ.mjs.map} +1 -1
- package/dist/{relations-C7B46bcU.d.mts → relations-DnRK4YIT.d.mts} +175 -41
- package/dist/relations-DnRK4YIT.d.mts.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-DRp5ENd_.mjs → request-meta-DYxLlnmz.mjs} +2 -2
- package/dist/{request-meta-DRp5ENd_.mjs.map → request-meta-DYxLlnmz.mjs.map} +1 -1
- package/dist/{resolve-DxUpTMmE.mjs → resolve-prZ3mP7l.mjs} +1 -1
- package/dist/{resolve-DxUpTMmE.mjs.map → resolve-prZ3mP7l.mjs.map} +1 -1
- package/dist/{runner-77GOZCnH.mjs → runner-BLIDKpmA.mjs} +351 -294
- package/dist/runner-BLIDKpmA.mjs.map +1 -0
- package/dist/{runner-zgqA_CqP.d.mts → runner-YKfIMnaF.d.mts} +3 -2
- package/dist/runner-YKfIMnaF.d.mts.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-BY-oVntF.mjs → schema-CGnBeLiW.mjs} +3 -3
- package/dist/{schema-BY-oVntF.mjs.map → schema-CGnBeLiW.mjs.map} +1 -1
- package/dist/{schema-Cw9kVK0I.mjs → schema-DYr-Vd-L.mjs} +5 -5
- package/dist/{schema-Cw9kVK0I.mjs.map → schema-DYr-Vd-L.mjs.map} +1 -1
- package/dist/{scopes-vMR1uIbt.mjs → scopes-BhWvBavj.mjs} +3 -3
- package/dist/{scopes-vMR1uIbt.mjs.map → scopes-BhWvBavj.mjs.map} +1 -1
- package/dist/{search-CfT3KxO5.mjs → search-C-qDk4kx.mjs} +4 -4
- package/dist/{search-CfT3KxO5.mjs.map → search-C-qDk4kx.mjs.map} +1 -1
- package/dist/{secrets-BH2Qow1-.mjs → secrets-rEtHt-6z.mjs} +1 -1
- package/dist/{secrets-BH2Qow1-.mjs.map → secrets-rEtHt-6z.mjs.map} +1 -1
- package/dist/{sections-DTfjyf1z.mjs → sections-B_nYvlwn.mjs} +2 -2
- package/dist/{sections-DTfjyf1z.mjs.map → sections-B_nYvlwn.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +18 -18
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +13 -13
- package/dist/{seo-Cm-dtvgk.mjs → seo-926NRIgt.mjs} +3 -3
- package/dist/{seo-Cm-dtvgk.mjs.map → seo-926NRIgt.mjs.map} +1 -1
- package/dist/{seo-BSiTIXzd.mjs → seo-CVWkdv6x.mjs} +1 -1
- package/dist/{seo-BSiTIXzd.mjs.map → seo-CVWkdv6x.mjs.map} +1 -1
- package/dist/{service-DYsDHEKe.mjs → service-CJl3ZAYs.mjs} +3 -3
- package/dist/{service-DYsDHEKe.mjs.map → service-CJl3ZAYs.mjs.map} +1 -1
- package/dist/{session-user-CNAfvsdw.mjs → session-user-BlMgqCHS.mjs} +1 -1
- package/dist/{session-user-CNAfvsdw.mjs.map → session-user-BlMgqCHS.mjs.map} +1 -1
- package/dist/{settings-BgN-0DT-.mjs → settings--wobrkkC.mjs} +18 -5
- package/dist/settings--wobrkkC.mjs.map +1 -0
- package/dist/{settings-DjtkUo__.mjs → settings-Cwm6o2jY.mjs} +3 -3
- package/dist/{settings-DjtkUo__.mjs.map → settings-Cwm6o2jY.mjs.map} +1 -1
- package/dist/{setup-complete-CcpXaPU7.mjs → setup-complete-DQbClIN2.mjs} +1 -1
- package/dist/{setup-complete-CcpXaPU7.mjs.map → setup-complete-DQbClIN2.mjs.map} +1 -1
- package/dist/{setup-nonce-Reyw30jg.mjs → setup-nonce-DZCFS2sn.mjs} +1 -1
- package/dist/{setup-nonce-Reyw30jg.mjs.map → setup-nonce-DZCFS2sn.mjs.map} +1 -1
- package/dist/{site-url-Cs_V9n3V.mjs → site-url-BrxA_E9H.mjs} +2 -2
- package/dist/{site-url-Cs_V9n3V.mjs.map → site-url-BrxA_E9H.mjs.map} +1 -1
- package/dist/{snapshot-DSB8P7Lm.mjs → snapshot--OCDTqdb.mjs} +1 -1
- package/dist/{snapshot-DSB8P7Lm.mjs.map → snapshot--OCDTqdb.mjs.map} +1 -1
- package/dist/{ssrf-DqebVE34.mjs → ssrf-5sIM5jzl.mjs} +4 -3
- package/dist/{ssrf-DqebVE34.mjs.map → ssrf-5sIM5jzl.mjs.map} +1 -1
- package/dist/{state-BJfU9Uzw.mjs → state-BpFVsJZB.mjs} +1 -1
- package/dist/{state-BJfU9Uzw.mjs.map → state-BpFVsJZB.mjs.map} +1 -1
- package/dist/{status-DDu8HIQl.mjs → status-B777-dXz.mjs} +1 -1
- package/dist/{status-DDu8HIQl.mjs.map → status-B777-dXz.mjs.map} +1 -1
- package/dist/storage/local.d.mts +2 -1
- package/dist/storage/local.d.mts.map +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/local.mjs.map +1 -1
- package/dist/storage/s3.d.mts +2 -1
- package/dist/storage/s3.d.mts.map +1 -1
- package/dist/storage/s3.mjs +3 -2
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/{target-D0o26Azo.mjs → target-BmR0iTwz.mjs} +1 -1
- package/dist/{target-D0o26Azo.mjs.map → target-BmR0iTwz.mjs.map} +1 -1
- package/dist/{taxonomies-CPGxo-bn.mjs → taxonomies-DkAkMupr.mjs} +16 -13
- package/dist/taxonomies-DkAkMupr.mjs.map +1 -0
- package/dist/{taxonomies-kmyudNGP.mjs → taxonomies-Wfy_Lg12.mjs} +42 -16
- package/dist/taxonomies-Wfy_Lg12.mjs.map +1 -0
- package/dist/{taxonomy-8X09dLN5.mjs → taxonomy-tJepplLL.mjs} +4 -4
- package/dist/{taxonomy-8X09dLN5.mjs.map → taxonomy-tJepplLL.mjs.map} +1 -1
- package/dist/{tokens-gTS-IVUp.mjs → tokens-BCO1oruF.mjs} +1 -1
- package/dist/{tokens-gTS-IVUp.mjs.map → tokens-BCO1oruF.mjs.map} +1 -1
- package/dist/{transport-fX59xaJz.mjs → transport-Dr3qtwXC.mjs} +1 -1
- package/dist/{transport-fX59xaJz.mjs.map → transport-Dr3qtwXC.mjs.map} +1 -1
- package/dist/{transport-_6R1ub7t.d.mts → transport-xh6YKW2G.d.mts} +1 -1
- package/dist/{transport-_6R1ub7t.d.mts.map → transport-xh6YKW2G.d.mts.map} +1 -1
- package/dist/{trusted-proxy-fe6nEgR4.mjs → trusted-proxy-BR5F1Otp.mjs} +1 -1
- package/dist/{trusted-proxy-fe6nEgR4.mjs.map → trusted-proxy-BR5F1Otp.mjs.map} +1 -1
- package/dist/{types-BXUmsINL.mjs → types-3qNFPlci.mjs} +1 -1
- package/dist/{types-BXUmsINL.mjs.map → types-3qNFPlci.mjs.map} +1 -1
- package/dist/{types-Vg6f5i3s.d.mts → types-B6GrPic4.d.mts} +9 -3
- package/dist/{types-Vg6f5i3s.d.mts.map → types-B6GrPic4.d.mts.map} +1 -1
- package/dist/{types-DJQxln7q.d.mts → types-BuHW4xDE.d.mts} +11 -10
- package/dist/types-BuHW4xDE.d.mts.map +1 -0
- package/dist/{types-BzBd3PeX.d.mts → types-C00oyCZp.d.mts} +1 -1
- package/dist/{types-BzBd3PeX.d.mts.map → types-C00oyCZp.d.mts.map} +1 -1
- package/dist/{types-Blb-MRC3.d.mts → types-CDtkNSFQ.d.mts} +1 -1
- package/dist/{types-Blb-MRC3.d.mts.map → types-CDtkNSFQ.d.mts.map} +1 -1
- package/dist/{types-D5VVLr7J.d.mts → types-CPeXo1wF.d.mts} +1 -1
- package/dist/{types-D5VVLr7J.d.mts.map → types-CPeXo1wF.d.mts.map} +1 -1
- package/dist/types-CQPWhPxE.mjs.map +1 -1
- package/dist/{types-D_DWe7k9.d.mts → types-CXFkwEGC.d.mts} +3 -2
- package/dist/types-CXFkwEGC.d.mts.map +1 -0
- package/dist/{types-CLqvnd05.d.mts → types-DczELMop.d.mts} +1 -1
- package/dist/{types-CLqvnd05.d.mts.map → types-DczELMop.d.mts.map} +1 -1
- package/dist/types-DfuTR6dL.mjs +3 -0
- package/dist/{types-DHxzBjbD.d.mts → types-FV23hEoW.d.mts} +1 -1
- package/dist/{types-DHxzBjbD.d.mts.map → types-FV23hEoW.d.mts.map} +1 -1
- package/dist/{types-Br-ERaxh.d.mts → types-xDMtUFnO.d.mts} +1 -1
- package/dist/{types-Br-ERaxh.d.mts.map → types-xDMtUFnO.d.mts.map} +1 -1
- package/dist/{upload-attempts-CNyGSepg.mjs → upload-attempts-BsqoQ1fn.mjs} +1 -1
- package/dist/{upload-attempts-CNyGSepg.mjs.map → upload-attempts-BsqoQ1fn.mjs.map} +1 -1
- package/dist/{url-pattern-K-KdXcSe.mjs → url-pattern-D4c2czpJ.mjs} +1 -1
- package/dist/{url-pattern-K-KdXcSe.mjs.map → url-pattern-D4c2czpJ.mjs.map} +1 -1
- package/dist/{user-CtYY0tp2.mjs → user-BTZ40aq6.mjs} +2 -2
- package/dist/{user-CtYY0tp2.mjs.map → user-BTZ40aq6.mjs.map} +1 -1
- package/dist/{utils-HztC73hq.mjs → utils-BKvNjjhY.mjs} +1 -1
- package/dist/{utils-HztC73hq.mjs.map → utils-BKvNjjhY.mjs.map} +1 -1
- package/dist/{validate-Dd-IUjnZ.mjs → validate-DE_LRwo9.mjs} +2 -2
- package/dist/{validate-Dd-IUjnZ.mjs.map → validate-DE_LRwo9.mjs.map} +1 -1
- package/dist/{validate-DlqdOZXB.d.mts → validate-DUP27OYD.d.mts} +5 -5
- package/dist/{validate-DlqdOZXB.d.mts.map → validate-DUP27OYD.d.mts.map} +1 -1
- package/dist/{validation-D83n7Npi.mjs → validation-BMImFJ11.mjs} +8 -8
- package/dist/{validation-D83n7Npi.mjs.map → validation-BMImFJ11.mjs.map} +1 -1
- package/dist/version-Bii3suaO.mjs +7 -0
- package/dist/{version-ri-sCyAp.mjs.map → version-Bii3suaO.mjs.map} +1 -1
- package/dist/{widgets-CpmZd9Q-.mjs → widgets-D3gJ10xU.mjs} +17 -4
- package/dist/widgets-D3gJ10xU.mjs.map +1 -0
- package/dist/{wxr-taxonomies-BFd0y72_.d.mts → wxr-taxonomies-B2Og_6rU.d.mts} +1 -1
- package/dist/{wxr-taxonomies-BFd0y72_.d.mts.map → wxr-taxonomies-B2Og_6rU.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-Df4vxWcU.mjs → wxr-taxonomies-Cxngsjwo.mjs} +4 -4
- package/dist/{wxr-taxonomies-Df4vxWcU.mjs.map → wxr-taxonomies-Cxngsjwo.mjs.map} +1 -1
- package/dist/{zod-generator-DylzusHh.mjs → zod-generator-BuYSQJB7.mjs} +11 -7
- package/dist/zod-generator-BuYSQJB7.mjs.map +1 -0
- package/package.json +12 -9
- package/src/api/errors.ts +2 -0
- package/src/api/handlers/content.ts +49 -11
- package/src/api/handlers/index.ts +1 -0
- package/src/api/handlers/manifest.ts +161 -12
- package/src/api/handlers/media.ts +30 -0
- package/src/api/handlers/registry.ts +393 -289
- package/src/api/handlers/taxonomies.ts +16 -9
- package/src/api/openapi/document.ts +85 -5
- package/src/api/parse.ts +1 -1
- package/src/api/schemas/auth.ts +4 -4
- package/src/api/schemas/bylines.ts +3 -3
- package/src/api/schemas/comments.ts +1 -1
- package/src/api/schemas/common.ts +3 -2
- package/src/api/schemas/content.ts +78 -22
- package/src/api/schemas/media.ts +52 -0
- package/src/api/schemas/redirects.ts +6 -1
- package/src/api/schemas/schema.ts +4 -0
- package/src/api/schemas/setup.ts +1 -1
- package/src/api/schemas/taxonomies.ts +2 -2
- package/src/api/schemas/users.ts +1 -1
- package/src/api/types.ts +23 -10
- package/src/astro/dev-typegen.ts +35 -0
- package/src/astro/image-endpoint.ts +2 -2
- package/src/astro/integration/dev-typegen.ts +91 -0
- package/src/astro/integration/index.ts +9 -44
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/vite-config.ts +21 -2
- package/src/astro/middleware.ts +5 -0
- package/src/astro/routes/api/admin/api-tokens/index.ts +4 -1
- package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
- package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +3 -7
- package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/verify.ts +60 -0
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +8 -2
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +2 -1
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +6 -2
- package/src/astro/routes/api/manifest.ts +1 -1
- package/src/astro/routes/api/media/[id]/replace.ts +114 -0
- package/src/astro/routes/api/media/file/[...key].ts +4 -1
- package/src/astro/routes/api/media/upload-url.ts +8 -4
- package/src/astro/routes/api/media.ts +54 -8
- package/src/astro/routes/api/menus/[name]/items/[id].ts +7 -2
- package/src/astro/routes/api/menus/[name]/items.ts +4 -1
- package/src/astro/routes/api/menus/[name]/reorder.ts +4 -1
- package/src/astro/routes/api/menus/[name]/translations.ts +4 -1
- package/src/astro/routes/api/menus/[name].ts +7 -2
- package/src/astro/routes/api/menus/index.ts +4 -1
- package/src/astro/routes/api/settings/email.ts +1 -1
- package/src/astro/routes/api/settings.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +7 -2
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name].ts +7 -2
- package/src/astro/routes/api/taxonomies/index.ts +4 -1
- package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name].ts +3 -1
- package/src/astro/routes/api/widget-areas/index.ts +3 -1
- package/src/astro/types.ts +23 -5
- package/src/auth/challenge-store.ts +3 -1
- package/src/aws-sdk.d.ts +1 -0
- package/src/cache/chrome-tags.ts +24 -0
- package/src/components/EmDashImage.astro +2 -1
- package/src/components/EmDashMedia.astro +2 -1
- package/src/components/InlinePortableTextEditor.tsx +6 -1
- package/src/components/widgets/Archives.astro +2 -37
- package/src/content/converters/index.ts +2 -0
- package/src/content/converters/mark-safety.ts +1 -0
- package/src/content/converters/portable-text-identity.ts +139 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +202 -69
- package/src/content/converters/prosemirror-to-portable-text.ts +96 -25
- package/src/content/converters/types.ts +1 -0
- package/src/database/migrations/017_authorization_codes.ts +14 -4
- package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
- package/src/database/migrations/runner.ts +3 -1
- package/src/database/repositories/byline.ts +32 -16
- package/src/database/repositories/content.ts +114 -47
- package/src/database/repositories/media-usage.ts +66 -37
- package/src/database/repositories/media.ts +60 -1
- package/src/database/repositories/plugin-storage.ts +74 -9
- package/src/database/repositories/types.ts +8 -7
- package/src/db/adapters.ts +8 -1
- package/src/db/postgres.ts +23 -0
- package/src/emdash-runtime.ts +80 -150
- package/src/fields/boolean.ts +1 -1
- package/src/fields/datetime.ts +1 -1
- package/src/fields/file.ts +1 -1
- package/src/fields/integer.ts +1 -1
- package/src/fields/json.ts +1 -1
- package/src/fields/multiselect.ts +1 -1
- package/src/fields/number.ts +1 -1
- package/src/fields/portable-text.ts +1 -1
- package/src/fields/richtext.ts +1 -1
- package/src/fields/select.ts +1 -1
- package/src/fields/slug.ts +1 -1
- package/src/fields/text.ts +1 -1
- package/src/fields/textarea.ts +1 -1
- package/src/fields/types.ts +2 -2
- package/src/index.ts +25 -3
- package/src/loader.ts +63 -10
- package/src/mcp/server.ts +228 -24
- package/src/media/image-endpoint.ts +5 -2
- package/src/media/normalize.ts +15 -4
- package/src/media/usage/cleanup.ts +9 -8
- package/src/menus/index.ts +16 -0
- package/src/object-cache/index.ts +44 -2
- package/src/plugin-types.ts +18 -1
- package/src/plugins/hooks.ts +4 -1
- package/src/plugins/index.ts +6 -0
- package/src/plugins/manager.ts +2 -1
- package/src/plugins/manifest-schema.ts +1 -1
- package/src/plugins/routes.ts +3 -1
- package/src/plugins/sandbox/hook-result.ts +52 -0
- package/src/plugins/sandbox/index.ts +10 -0
- package/src/plugins/types.ts +6 -0
- package/src/registry/artifact-checksum.ts +15 -0
- package/src/registry/artifact-verification.ts +85 -0
- package/src/registry/authoritative-records.ts +180 -0
- package/src/registry/record-labels.ts +28 -0
- package/src/schema/registry.ts +26 -3
- package/src/schema/zod-generator.ts +16 -13
- package/src/security/ssrf.ts +5 -2
- package/src/settings/index.ts +16 -0
- package/src/storage/local.ts +1 -0
- package/src/storage/s3.ts +2 -0
- package/src/storage/types.ts +2 -0
- package/src/taxonomies/index.ts +40 -20
- package/src/widgets/archives.ts +67 -0
- package/src/widgets/index.ts +16 -0
- package/dist/api-B0w3uBiG.mjs +0 -2269
- package/dist/api-B0w3uBiG.mjs.map +0 -1
- package/dist/byline-Cpnwrje1.mjs.map +0 -1
- package/dist/challenge-store-D5pSY2S1.mjs.map +0 -1
- package/dist/content-CP-SeXNa.mjs.map +0 -1
- package/dist/content-refresh-DLOfIhYc.mjs.map +0 -1
- package/dist/context-BR5hRWiK.mjs.map +0 -1
- package/dist/errors-n2j49uNf.mjs.map +0 -1
- package/dist/index-DWbJrsAg.d.mts.map +0 -1
- package/dist/loader-ZsjE4paL.mjs.map +0 -1
- package/dist/manifest-schema-CUYPfCEH.mjs.map +0 -1
- package/dist/media-BjwNuLEu.mjs.map +0 -1
- package/dist/media-D6SeAfBl.mjs.map +0 -1
- package/dist/menus-CNg0QlDt.mjs.map +0 -1
- package/dist/normalize-CSxdKBVa.mjs.map +0 -1
- package/dist/object-cache-71tPfV4A.mjs.map +0 -1
- package/dist/options-BhZIeFY1.d.mts.map +0 -1
- package/dist/redirects-CRIM55KH.mjs.map +0 -1
- package/dist/registry-BiO5WwPq.mjs +0 -2716
- package/dist/registry-BiO5WwPq.mjs.map +0 -1
- package/dist/registry-Cx-jEJOS.mjs.map +0 -1
- package/dist/relations-BTPM2saV.mjs.map +0 -1
- package/dist/relations-C7B46bcU.d.mts.map +0 -1
- package/dist/runner-77GOZCnH.mjs.map +0 -1
- package/dist/runner-zgqA_CqP.d.mts.map +0 -1
- package/dist/settings-BgN-0DT-.mjs.map +0 -1
- package/dist/taxonomies-CPGxo-bn.mjs.map +0 -1
- package/dist/taxonomies-kmyudNGP.mjs.map +0 -1
- package/dist/types-D6OcIp2P.mjs +0 -3
- package/dist/types-DJQxln7q.d.mts.map +0 -1
- package/dist/types-D_DWe7k9.d.mts.map +0 -1
- package/dist/version-ri-sCyAp.mjs +0 -7
- package/dist/widgets-CpmZd9Q-.mjs.map +0 -1
- package/dist/zod-generator-DylzusHh.mjs.map +0 -1
- /package/dist/{api-tokens-B5NHLNUN.mjs → api-tokens-BfYts-sq.mjs} +0 -0
- /package/dist/{ssrf-BPKzkm6O.mjs → ssrf-Dg3cIT-b.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as ContentFieldFilters } from "./content-list-query-
|
|
2
|
-
import { l as CustomFieldValue } from "./types-
|
|
1
|
+
import { r as ContentFieldFilters } from "./content-list-query-Btqd4uV2.mjs";
|
|
2
|
+
import { l as CustomFieldValue } from "./types-xDMtUFnO.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/database/repositories/types.d.ts
|
|
5
5
|
interface CreateContentInput {
|
|
@@ -50,13 +50,14 @@ interface BylineSummary {
|
|
|
50
50
|
avatarMediaId: string | null;
|
|
51
51
|
/**
|
|
52
52
|
* The avatar media's storage key, folded in by a LEFT JOIN on the
|
|
53
|
-
* `media` table
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* `
|
|
57
|
-
*
|
|
53
|
+
* `media` table. Populated by the content-credit hydration path
|
|
54
|
+
* (`getContentBylines` / `getContentBylinesMany`, i.e. the
|
|
55
|
+
* `entry.data.bylines` populated by `getEmDashCollection` /
|
|
56
|
+
* `getEmDashEntry`) and by the single-row finders (`findById`,
|
|
57
|
+
* `findBySlug`, `findByUserId`, `findByUserIds`). `findMany` doesn't
|
|
58
|
+
* join media, so it leaves this null.
|
|
58
59
|
*
|
|
59
|
-
* Lets
|
|
60
|
+
* Lets a page build a direct storage URL for an author avatar without a
|
|
60
61
|
* per-byline `MediaRepository.findById`, avoiding an N+1 when many distinct
|
|
61
62
|
* authors appear on one page.
|
|
62
63
|
*
|
|
@@ -72,7 +73,7 @@ interface BylineSummary {
|
|
|
72
73
|
* same media join as `avatarStorageKey`. Lets a renderer paint a blurred
|
|
73
74
|
* placeholder while the full avatar loads, with no extra media lookup.
|
|
74
75
|
* Null when the byline has no avatar, the media row has no blurhash, or the
|
|
75
|
-
* byline
|
|
76
|
+
* byline came from `findMany`, which doesn't join media.
|
|
76
77
|
*/
|
|
77
78
|
avatarBlurhash?: string | null;
|
|
78
79
|
/**
|
|
@@ -255,4 +256,4 @@ declare class EmDashValidationError extends Error {
|
|
|
255
256
|
}
|
|
256
257
|
//#endregion
|
|
257
258
|
export { ContentSeo as a, EmDashValidationError as c, InvalidCursorError as d, UpdateContentInput as f, ContentItem as i, FindManyOptions as l, ContentBylineCredit as n, ContentSeoInput as o, ContentDateField as r, CreateContentInput as s, BylineSummary as t, FindManyResult as u };
|
|
258
|
-
//# sourceMappingURL=types-
|
|
259
|
+
//# sourceMappingURL=types-BuHW4xDE.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BuHW4xDE.d.mts","names":[],"sources":["../src/database/repositories/types.ts"],"mappings":";;;;UAciB,kBAAA;;EAEhB,EAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA,EAAM,MAAA;EACN,MAAA;EACA,QAAA;EACA,eAAA;EACA,MAAA;EACA,aAAA;EACA,WAAA;EAJA;EAMA,SAAA;AAAA;AAAA,UAGgB,kBAAA;EAChB,IAAA,GAAO,MAAA;EACP,MAAA;EACA,IAAA;EACA,WAAA;EACA,WAAA;EACA,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O,CAAA;EACP,UAAA;EAsFiB;;AAGlB;;;EAnFC,KAAA;AAAA;;;;;;;;;cAgBY,kBAAA,SAA2B,KAAA;cAC3B,MAAA;AAAA;AAAA,UAgCI,WAAA;EAChB,EAAA;EACA,IAAA;EACA,IAAA;EACA,MAAA;EACA,IAAA,EAAM,MAAA;EACN,QAAA;EACA,eAAA;EACA,MAAA,GAAS,aAAA;EACT,OAAA,GAAU,mBAAA;EACV,SAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;EACA,cAAA;EACA,eAAA;EACA,OAAA;EACA,MAAA;EACA,gBAAA;;EAEA,GAAA,GAAM,UAAA;;;;;;;;;;;EAWN,QAAA,GAAW,MAAA;AAAA;AAAA,cAGC,qBAAA,SAA8B,KAAA;EAGlC,OAAA;cADP,OAAA,UACO,OAAA;AAAA"}
|
|
@@ -195,4 +195,4 @@ interface ExternalAuthConfig {
|
|
|
195
195
|
}
|
|
196
196
|
//#endregion
|
|
197
197
|
export { AuthResult as a, AuthProviderModule as i, AuthProviderAdminExports as n, AuthRouteDescriptor as o, AuthProviderDescriptor as r, ExternalAuthConfig as s, AuthDescriptor as t };
|
|
198
|
-
//# sourceMappingURL=types-
|
|
198
|
+
//# sourceMappingURL=types-C00oyCZp.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-C00oyCZp.d.mts","names":[],"sources":["../src/auth/types.ts"],"mappings":";;;;;;AAgBA;;;;;;;;;;;;UAAiB,UAAA;EAmBc;EAjB9B,KAAA;EAiB8B;EAf9B,IAAA;EA2BA;EAzBA,IAAA;EA8BM;EA5BN,OAAA;EAqCgB;EAnChB,QAAA,GAAW,MAAA;AAAA;;;;;;;UASK,cAAA;EAkCH;;;;EA7Bb,IAAA;EA6BmE;AAwBpE;;;;EA9CC,UAAA;EAsFuD;;;EAjFvD,MAAA;AAAA;;;;;;;UASgB,kBAAA;EAsEN;;;;;;;EA9DV,YAAA,CAAa,OAAA,EAAS,OAAA,EAAS,MAAA,YAAkB,OAAA,CAAQ,UAAA;AAAA;;;;AAoF1D;;;;;;;;;;;;;;UA5DiB,sBAAA;EAgFsC;EA9EtD,EAAA;EAoFgB;EAjFhB,KAAA;;EAGA,MAAA;EAmFA;;;;;;EA3EA,UAAA;;;;;EAMA,MAAA,GAAS,mBAAA;;;;;;EAOT,YAAA;;;;;;;;EASA,OAAA,GAAU,MAAA;IAEP,OAAA,GAAU,KAAA;IAA0B,aAAA,GAAgB,KAAA;EAAA;AAAA;;;;UAOvC,mBAAA;;EAEhB,OAAA;;EAEA,UAAA;AAAA;;;;;;;UASgB,wBAAA;;;;;;EAMhB,WAAA,GANwC,KAAA,CAMV,aAAA;;;;;;EAO9B,SAAA,GAP2C,KAAA,CAOf,aAAA;;;;;;EAO5B,SAAA,GAPyC,KAAA,CAOb,aAAA;IAAgB,UAAA;EAAA;AAAA;;;;UAM5B,kBAAA;;;;;EAKhB,aAAA;;;;;EAMA,WAAA;;;;;;EAOA,SAAA;;;;;;;;;;;;;;EAeA,WAAA,GAAc,MAAA;AAAA"}
|
|
@@ -72,4 +72,4 @@ interface SiteSettings {
|
|
|
72
72
|
type SiteSettingKey = keyof SiteSettings;
|
|
73
73
|
//#endregion
|
|
74
74
|
export { SiteSettings as i, SeoSettings as n, SiteSettingKey as r, MediaReference as t };
|
|
75
|
-
//# sourceMappingURL=types-
|
|
75
|
+
//# sourceMappingURL=types-CDtkNSFQ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CDtkNSFQ.d.mts","names":[],"sources":["../src/settings/types.ts"],"mappings":";;AAyBA;;;;;;;;;;;;AAcA;;;;;;;;;;;UAdiB,cAAA;EAChB,OAAA;EACA,GAAA;;EAEA,GAAA;EA6BU;EA3BV,WAAA;EAgDiB;EA9CjB,KAAA;EAsBA;EApBA,MAAA;AAAA;;UAIgB,WAAA;EAmBN;EAjBV,cAAA;EAuBA;EArBA,cAAA,GAAiB,cAAA;EAuBjB;EArBA,SAAA;EAyBC;EAvBD,kBAAA;EAyBC;EAvBD,gBAAA;AAAA;;UAIgB,YAAA;EAEhB,KAAA;EACA,OAAA;EACA,IAAA,GAAO,cAAA;EACP,OAAA,GAAU,cAAA;EAGV,GAAA;EAGA,YAAA;EACA,UAAA;EACA,QAAA;EAGA,MAAA;IACC,OAAA;IACA,MAAA;IACA,QAAA;IACA,SAAA;IACA,QAAA;IACA,OAAA;EAAA;EAID,GAAA,GAAM,WAAA;AAAA;;KAIK,cAAA,SAAuB,YAAA"}
|
|
@@ -121,4 +121,4 @@ interface ObjectCacheRuntimeConfig {
|
|
|
121
121
|
type CreateObjectCacheBackendFn = (config: ObjectCacheRuntimeConfig) => ObjectCacheBackend;
|
|
122
122
|
//#endregion
|
|
123
123
|
export { ObjectCacheRuntimeConfig as i, ObjectCacheBackend as n, ObjectCacheDescriptor as r, CreateObjectCacheBackendFn as t };
|
|
124
|
-
//# sourceMappingURL=types-
|
|
124
|
+
//# sourceMappingURL=types-CPeXo1wF.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CPeXo1wF.d.mts","names":[],"sources":["../src/object-cache/types.ts"],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;;UAAiB,kBAAA;EAuBqB;EArBrC,GAAA,CAAI,GAAA,WAAc,OAAA;EAyBc;;;;;;AAUjC;EA3BC,GAAA,CAAI,GAAA,UAAa,KAAA,UAAe,UAAA,YAAsB,OAAA;;EAEtD,MAAA,CAAO,GAAA,WAAc,OAAA;AAAA;;;;;;;AAwFtB;;UA7EiB,qBAAA;EA6EgF;EA3EhG,UAAA;EA2EyC;EAzEzC,MAAA,EAAQ,wBAAA;AAAA;;;;;;;;UAUQ,wBAAA;;;;;;;;;;;EAWhB,UAAA;;;;;;;;;;;;;;;;;;EAkBA,UAAA;;;;;;;EAOA,SAAA;;;;;;;;;;;;;;;EAeA,OAAA;;GAEC,GAAA;AAAA;;;;;;;;KAUU,0BAAA,IAA8B,MAAA,EAAQ,wBAAA,KAA6B,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-CQPWhPxE.mjs","names":[],"sources":["../src/database/repositories/types.ts"],"sourcesContent":["import type { ContentFieldFilters } from \"../../content-list-query.js\";\nimport type { CustomFieldValue } from \"../../schema/types.js\";\nimport { encodeBase64, decodeBase64 } from \"../../utils/base64.js\";\n\n/**\n * Hard cap on cursor length. Cursors we issue are short JSON-in-base64\n * blobs; a real cursor is well under 200 chars. This guards against\n * malicious callers passing megabyte-sized strings to force the base64\n * decoder to allocate (decodeBase64 is O(N) in input size). The MCP and\n * REST schemas also clamp at 2048 — this 4096 cap is a defense-in-depth\n * floor inside the repository helpers.\n */\nconst MAX_CURSOR_LENGTH = 4096;\n\nexport interface CreateContentInput {\n\t/** Explicit content ID for stable seed imports. Omit to generate a ULID. */\n\tid?: string;\n\ttype: string;\n\tslug?: string | null;\n\tdata: Record<string, unknown>;\n\tstatus?: string;\n\tauthorId?: string;\n\tprimaryBylineId?: string | null;\n\tlocale?: string;\n\ttranslationOf?: string;\n\tpublishedAt?: string | null;\n\t/** Override created_at (ISO 8601). Used by importers to preserve original dates. */\n\tcreatedAt?: string | null;\n}\n\nexport interface UpdateContentInput {\n\tdata?: Record<string, unknown>;\n\tstatus?: string;\n\tslug?: string | null;\n\tpublishedAt?: string | null;\n\tscheduledAt?: string | null;\n\tauthorId?: string | null;\n\tprimaryBylineId?: string | null;\n}\n\n/** SEO fields for content items */\nexport interface ContentSeo {\n\ttitle: string | null;\n\tdescription: string | null;\n\timage: string | null;\n\tcanonical: string | null;\n\tnoIndex: boolean;\n}\n\n/** Input for updating SEO fields on content */\nexport interface ContentSeoInput {\n\ttitle?: string | null;\n\tdescription?: string | null;\n\timage?: string | null;\n\tcanonical?: string | null;\n\tnoIndex?: boolean;\n}\n\nexport interface BylineSummary {\n\tid: string;\n\tslug: string;\n\tdisplayName: string;\n\tbio: string | null;\n\tavatarMediaId: string | null;\n\t/**\n\t * The avatar media's storage key, folded in by a LEFT JOIN on the\n\t * `media` table during content byline hydration. Non-null only when the\n\t * byline has an avatar AND was loaded through the content-credit hydration\n\t * path (`getContentBylines` / `getContentBylinesMany`, i.e. the\n\t * `entry.data.bylines` populated by `getEmDashCollection` / `getEmDashEntry`).\n\t * The plain byline finders (`findById`, `findBySlug`, …) leave it null.\n\t *\n\t * Lets list pages build a direct storage URL for an author avatar without a\n\t * per-byline `MediaRepository.findById`, avoiding an N+1 when many distinct\n\t * authors appear on one page.\n\t *\n\t * Optional so adding it is a non-breaking change for existing code that\n\t * constructs a `BylineSummary` literal; the repositories always populate it\n\t * (to `null` when there's no avatar or no media join).\n\t */\n\tavatarStorageKey?: string | null;\n\t/** Avatar media alt text, from the same media join. Null when not joined. */\n\tavatarAlt?: string | null;\n\t/**\n\t * Avatar media blurhash (LQIP placeholder, migration 024), folded in by the\n\t * same media join as `avatarStorageKey`. Lets a renderer paint a blurred\n\t * placeholder while the full avatar loads, with no extra media lookup.\n\t * Null when the byline has no avatar, the media row has no blurhash, or the\n\t * byline was loaded through a finder that doesn't join media.\n\t */\n\tavatarBlurhash?: string | null;\n\t/**\n\t * Avatar media dominant colour (LQIP placeholder, migration 024), from the\n\t * same media join. Null under the same conditions as `avatarBlurhash`.\n\t */\n\tavatarDominantColor?: string | null;\n\twebsiteUrl: string | null;\n\tuserId: string | null;\n\tisGuest: boolean;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\t/**\n\t * Locale this byline row is presented in. Added by migration 040.\n\t * `(slug, locale)` is unique; a single slug can repeat across locales.\n\t */\n\tlocale: string;\n\t/**\n\t * Shared across translations of the same byline. Added by migration 040.\n\t * `_emdash_content_bylines.byline_id` and `ec_*.primary_byline_id` store\n\t * this value, so a credit spans every locale variant of a byline.\n\t * Nullable in storage for backwards compatibility; new rows always\n\t * populate it.\n\t */\n\ttranslationGroup: string | null;\n\t/**\n\t * Custom field values registered via the byline-fields schema (migration\n\t * 041, Discussion #1174). Optional in the TypeScript shape so existing\n\t * object-literal consumers (test fixtures, plugin renderers) stay\n\t * source-compatible; the runtime always returns `{}` when no fields are\n\t * registered. Translatable values reflect this row's locale; non-\n\t * translatable values are shared across every locale variant of the\n\t * byline's `translation_group`.\n\t */\n\tcustomFields?: Record<string, CustomFieldValue>;\n}\n\nexport interface ContentBylineCredit {\n\tbyline: BylineSummary;\n\tsortOrder: number;\n\troleLabel: string | null;\n\t/** Whether this credit was explicitly assigned or inferred from authorId */\n\tsource?: \"explicit\" | \"inferred\";\n}\n\n/** A whitelisted timestamp column a content-list date range can filter on. */\nexport type ContentDateField = \"createdAt\" | \"updatedAt\" | \"publishedAt\";\n\n/**\n * Inclusive date-range filter for a single whitelisted timestamp column.\n * Bounds are compared lexicographically against the stored ISO 8601 strings,\n * which is correct because every timestamp is written via `toISOString()`.\n * Callers wanting an inclusive upper bound should pass an end-of-day value\n * (e.g. `2024-12-31T23:59:59.999Z`); the repository does not widen `to`.\n */\nexport interface ContentDateFilter {\n\tfield: ContentDateField;\n\tfrom?: string;\n\tto?: string;\n}\n\n/**\n * Byline filter for a content list.\n *\n * `mode: \"any\"` matches entries credited to at least one of `bylineIds`;\n * `mode: \"none\"` matches entries with no credit at all.\n *\n * `bylineIds` are `translation_group` values — what\n * `_emdash_content_bylines.byline_id` stores since migration 040 — so a filter\n * matches a byline across every locale variant.\n *\n * By default only explicit credits count. `includeInferred` widens the filter\n * to the byline the list actually renders, which for an entry with no credits\n * is the one linked to its `author_id` (see `hydrateBylinesMany`).\n */\nexport interface ContentBylineFilter {\n\tmode: \"any\" | \"none\";\n\t/** Ignored when `mode` is `\"none\"`. An empty list matches nothing. */\n\tbylineIds?: string[];\n\tincludeInferred?: boolean;\n\t/**\n\t * Locale a credit has to resolve at — the locale the list is scoped to.\n\t * Applies to explicit credits as well as inferred ones, since a byline\n\t * group credited to an entry renders only where it has a row at that\n\t * locale. Defaults to each entry's own locale when the list spans locales.\n\t */\n\tlocale?: string;\n}\n\nexport interface FindManyOptions {\n\twhere?: {\n\t\tstatus?: string;\n\t\tauthorId?: string;\n\t\tlocale?: string;\n\t\t/** Case-insensitive substring to match against `searchColumns`. */\n\t\tq?: string;\n\t\t/**\n\t\t * Columns the `q` substring filter is applied to (OR'd together).\n\t\t * Resolved by the handler from the collection's display fields, slug,\n\t\t * and any field marked searchable. Each name is validated as a SQL\n\t\t * identifier.\n\t\t */\n\t\tsearchColumns?: string[];\n\t\t/**\n\t\t * Serve `q` from the collection's FTS5 index (`_emdash_fts_<slug>`)\n\t\t * instead of an unindexable substring LIKE. Set by the handler only\n\t\t * when the collection has search enabled and the index exists\n\t\t * (SQLite only). The repository combines a token-prefix MATCH with\n\t\t * an index-served slug prefix so slug lookups keep working.\n\t\t */\n\t\tuseFts?: boolean;\n\t\t/** Inclusive date range over a whitelisted timestamp column. */\n\t\tdateFilter?: ContentDateFilter;\n\t\t/** Restrict to entries by their byline credits. */\n\t\tbylineFilter?: ContentBylineFilter;\n\t\t/** AND-combined filters over custom fields explicitly marked as indexed. */\n\t\tfieldFilters?: ContentFieldFilters;\n\t};\n\torderBy?: {\n\t\tfield: string;\n\t\tdirection: \"asc\" | \"desc\";\n\t};\n\t/**\n\t * Extra field slugs allowed as `orderBy` beyond the system columns — the\n\t * collection's configured titleField/dateField. Resolved by the\n\t * handler server-side so `orderBy` stays a closed set per request.\n\t */\n\tsortableExtras?: string[];\n\tlimit?: number;\n\tcursor?: string; // Base64-encoded JSON: {orderValue: string, id: string}\n}\n\nexport interface FindManyResult<T> {\n\titems: T[];\n\tnextCursor?: string; // Base64-encoded JSON: {orderValue: string, id: string}\n\t/**\n\t * Total number of rows matching the where clause (ignoring pagination).\n\t * Optional because not every caller needs it; repositories that compute\n\t * it should set it so the UI can render a stable pagination denominator.\n\t */\n\ttotal?: number;\n}\n\n/** Encode a cursor from order value + id */\nexport function encodeCursor(orderValue: string, id: string): string {\n\treturn encodeBase64(JSON.stringify({ orderValue, id }));\n}\n\n/**\n * Thrown when a pagination cursor cannot be decoded.\n *\n * Repository callers should let this propagate; handler catch blocks\n * map it to a structured `INVALID_CURSOR` error so client pagination\n * bugs surface immediately rather than silently re-fetching the first\n * page.\n */\nexport class InvalidCursorError extends Error {\n\tconstructor(cursor: string) {\n\t\tconst display = cursor.length > 50 ? `${cursor.slice(0, 47)}...` : cursor;\n\t\tsuper(`Invalid pagination cursor: ${display}`);\n\t\tthis.name = \"InvalidCursorError\";\n\t}\n}\n\n/**\n * Decode a cursor to order value + id.\n *\n * Throws `InvalidCursorError` if the cursor is empty, not valid base64,\n * not valid JSON, or doesn't contain string `orderValue` and `id` fields.\n */\nexport function decodeCursor(cursor: string): { orderValue: string; id: string } {\n\tif (!cursor) throw new InvalidCursorError(cursor);\n\tif (cursor.length > MAX_CURSOR_LENGTH) throw new InvalidCursorError(cursor);\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(decodeBase64(cursor));\n\t} catch {\n\t\tthrow new InvalidCursorError(cursor);\n\t}\n\tif (parsed === null || typeof parsed !== \"object\") {\n\t\tthrow new InvalidCursorError(cursor);\n\t}\n\tconst candidate = parsed as { orderValue?: unknown; id?: unknown };\n\tif (typeof candidate.orderValue !== \"string\" || typeof candidate.id !== \"string\") {\n\t\tthrow new InvalidCursorError(cursor);\n\t}\n\treturn { orderValue: candidate.orderValue, id: candidate.id };\n}\n\nexport interface ContentItem {\n\tid: string;\n\ttype: string;\n\tslug: string | null;\n\tstatus: string;\n\tdata: Record<string, unknown>;\n\tauthorId: string | null;\n\tprimaryBylineId: string | null;\n\tbyline?: BylineSummary | null;\n\tbylines?: ContentBylineCredit[];\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tpublishedAt: string | null;\n\tscheduledAt: string | null;\n\tliveRevisionId: string | null;\n\tdraftRevisionId: string | null;\n\tversion: number;\n\tlocale: string | null;\n\ttranslationGroup: string | null;\n\t/** SEO metadata — only populated for collections with `has_seo` enabled */\n\tseo?: ContentSeo;\n\t/**\n\t * For collections that support `revisions`: when a draft revision exists,\n\t * `data` reflects the unsaved draft and `liveData` carries the currently-\n\t * published values. When no draft exists, `liveData` is undefined.\n\t *\n\t * Hydrated by `EmDashRuntime.hydrateDraftData()` — repositories themselves\n\t * never set this field; it's purely a runtime-overlay concept that gives\n\t * agents a clear picture of \"draft vs. live\" without re-fetching the\n\t * revision history.\n\t */\n\tliveData?: Record<string, unknown>;\n}\n\nexport class EmDashValidationError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic details?: unknown,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"EmDashValidationError\";\n\t}\n}\n\nexport class ContentCollectionNotFoundError extends Error {\n\tconstructor(collection: string) {\n\t\tsuper(`Collection '${collection}' not found`);\n\t\tthis.name = \"ContentCollectionNotFoundError\";\n\t}\n}\n\n/**\n * Thrown by `publish()` when called with `requireDue` for a row that is no\n * longer due (its `scheduled_at` was cleared or pushed into the future between\n * selection and publish — e.g. an editor unscheduled it). Lets the scheduled\n * sweep skip the row silently rather than treating it as a publish failure.\n */\nexport class ScheduledNotDueError extends Error {\n\tconstructor(message = \"Content is no longer scheduled to publish\") {\n\t\tsuper(message);\n\t\tthis.name = \"ScheduledNotDueError\";\n\t}\n}\n\nexport class ContentMutationConflictError extends Error {\n\tconstructor(message = \"Content changed while the operation was in progress\") {\n\t\tsuper(message);\n\t\tthis.name = \"ContentMutationConflictError\";\n\t}\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,oBAAoB;;AA6N1B,SAAgB,aAAa,YAAoB,IAAoB;AACpE,QAAO,aAAa,KAAK,UAAU;EAAE;EAAY;EAAI,CAAC,CAAC;;;;;;;;;;AAWxD,IAAa,qBAAb,cAAwC,MAAM;CAC7C,YAAY,QAAgB;EAC3B,MAAM,UAAU,OAAO,SAAS,KAAK,GAAG,OAAO,MAAM,GAAG,GAAG,CAAC,OAAO;AACnE,QAAM,8BAA8B,UAAU;AAC9C,OAAK,OAAO;;;;;;;;;AAUd,SAAgB,aAAa,QAAoD;AAChF,KAAI,CAAC,OAAQ,OAAM,IAAI,mBAAmB,OAAO;AACjD,KAAI,OAAO,SAAS,kBAAmB,OAAM,IAAI,mBAAmB,OAAO;CAC3E,IAAI;AACJ,KAAI;AACH,WAAS,KAAK,MAAM,aAAa,OAAO,CAAC;SAClC;AACP,QAAM,IAAI,mBAAmB,OAAO;;AAErC,KAAI,WAAW,QAAQ,OAAO,WAAW,SACxC,OAAM,IAAI,mBAAmB,OAAO;CAErC,MAAM,YAAY;AAClB,KAAI,OAAO,UAAU,eAAe,YAAY,OAAO,UAAU,OAAO,SACvE,OAAM,IAAI,mBAAmB,OAAO;AAErC,QAAO;EAAE,YAAY,UAAU;EAAY,IAAI,UAAU;EAAI;;AAqC9D,IAAa,wBAAb,cAA2C,MAAM;CAChD,YACC,SACA,AAAO,SACN;AACD,QAAM,QAAQ;EAFP;AAGP,OAAK,OAAO;;;AAId,IAAa,iCAAb,cAAoD,MAAM;CACzD,YAAY,YAAoB;AAC/B,QAAM,eAAe,WAAW,aAAa;AAC7C,OAAK,OAAO;;;;;;;;;AAUd,IAAa,uBAAb,cAA0C,MAAM;CAC/C,YAAY,UAAU,6CAA6C;AAClE,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAId,IAAa,+BAAb,cAAkD,MAAM;CACvD,YAAY,UAAU,uDAAuD;AAC5E,QAAM,QAAQ;AACd,OAAK,OAAO"}
|
|
1
|
+
{"version":3,"file":"types-CQPWhPxE.mjs","names":[],"sources":["../src/database/repositories/types.ts"],"sourcesContent":["import type { ContentFieldFilters } from \"../../content-list-query.js\";\nimport type { CustomFieldValue } from \"../../schema/types.js\";\nimport { encodeBase64, decodeBase64 } from \"../../utils/base64.js\";\n\n/**\n * Hard cap on cursor length. Cursors we issue are short JSON-in-base64\n * blobs; a real cursor is well under 200 chars. This guards against\n * malicious callers passing megabyte-sized strings to force the base64\n * decoder to allocate (decodeBase64 is O(N) in input size). The MCP and\n * REST schemas also clamp at 2048 — this 4096 cap is a defense-in-depth\n * floor inside the repository helpers.\n */\nconst MAX_CURSOR_LENGTH = 4096;\n\nexport interface CreateContentInput {\n\t/** Explicit content ID for stable seed imports. Omit to generate a ULID. */\n\tid?: string;\n\ttype: string;\n\tslug?: string | null;\n\tdata: Record<string, unknown>;\n\tstatus?: string;\n\tauthorId?: string;\n\tprimaryBylineId?: string | null;\n\tlocale?: string;\n\ttranslationOf?: string;\n\tpublishedAt?: string | null;\n\t/** Override created_at (ISO 8601). Used by importers to preserve original dates. */\n\tcreatedAt?: string | null;\n}\n\nexport interface UpdateContentInput {\n\tdata?: Record<string, unknown>;\n\tstatus?: string;\n\tslug?: string | null;\n\tpublishedAt?: string | null;\n\tscheduledAt?: string | null;\n\tauthorId?: string | null;\n\tprimaryBylineId?: string | null;\n}\n\n/** SEO fields for content items */\nexport interface ContentSeo {\n\ttitle: string | null;\n\tdescription: string | null;\n\timage: string | null;\n\tcanonical: string | null;\n\tnoIndex: boolean;\n}\n\n/** Input for updating SEO fields on content */\nexport interface ContentSeoInput {\n\ttitle?: string | null;\n\tdescription?: string | null;\n\timage?: string | null;\n\tcanonical?: string | null;\n\tnoIndex?: boolean;\n}\n\nexport interface BylineSummary {\n\tid: string;\n\tslug: string;\n\tdisplayName: string;\n\tbio: string | null;\n\tavatarMediaId: string | null;\n\t/**\n\t * The avatar media's storage key, folded in by a LEFT JOIN on the\n\t * `media` table. Populated by the content-credit hydration path\n\t * (`getContentBylines` / `getContentBylinesMany`, i.e. the\n\t * `entry.data.bylines` populated by `getEmDashCollection` /\n\t * `getEmDashEntry`) and by the single-row finders (`findById`,\n\t * `findBySlug`, `findByUserId`, `findByUserIds`). `findMany` doesn't\n\t * join media, so it leaves this null.\n\t *\n\t * Lets a page build a direct storage URL for an author avatar without a\n\t * per-byline `MediaRepository.findById`, avoiding an N+1 when many distinct\n\t * authors appear on one page.\n\t *\n\t * Optional so adding it is a non-breaking change for existing code that\n\t * constructs a `BylineSummary` literal; the repositories always populate it\n\t * (to `null` when there's no avatar or no media join).\n\t */\n\tavatarStorageKey?: string | null;\n\t/** Avatar media alt text, from the same media join. Null when not joined. */\n\tavatarAlt?: string | null;\n\t/**\n\t * Avatar media blurhash (LQIP placeholder, migration 024), folded in by the\n\t * same media join as `avatarStorageKey`. Lets a renderer paint a blurred\n\t * placeholder while the full avatar loads, with no extra media lookup.\n\t * Null when the byline has no avatar, the media row has no blurhash, or the\n\t * byline came from `findMany`, which doesn't join media.\n\t */\n\tavatarBlurhash?: string | null;\n\t/**\n\t * Avatar media dominant colour (LQIP placeholder, migration 024), from the\n\t * same media join. Null under the same conditions as `avatarBlurhash`.\n\t */\n\tavatarDominantColor?: string | null;\n\twebsiteUrl: string | null;\n\tuserId: string | null;\n\tisGuest: boolean;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\t/**\n\t * Locale this byline row is presented in. Added by migration 040.\n\t * `(slug, locale)` is unique; a single slug can repeat across locales.\n\t */\n\tlocale: string;\n\t/**\n\t * Shared across translations of the same byline. Added by migration 040.\n\t * `_emdash_content_bylines.byline_id` and `ec_*.primary_byline_id` store\n\t * this value, so a credit spans every locale variant of a byline.\n\t * Nullable in storage for backwards compatibility; new rows always\n\t * populate it.\n\t */\n\ttranslationGroup: string | null;\n\t/**\n\t * Custom field values registered via the byline-fields schema (migration\n\t * 041, Discussion #1174). Optional in the TypeScript shape so existing\n\t * object-literal consumers (test fixtures, plugin renderers) stay\n\t * source-compatible; the runtime always returns `{}` when no fields are\n\t * registered. Translatable values reflect this row's locale; non-\n\t * translatable values are shared across every locale variant of the\n\t * byline's `translation_group`.\n\t */\n\tcustomFields?: Record<string, CustomFieldValue>;\n}\n\nexport interface ContentBylineCredit {\n\tbyline: BylineSummary;\n\tsortOrder: number;\n\troleLabel: string | null;\n\t/** Whether this credit was explicitly assigned or inferred from authorId */\n\tsource?: \"explicit\" | \"inferred\";\n}\n\n/** A whitelisted timestamp column a content-list date range can filter on. */\nexport type ContentDateField = \"createdAt\" | \"updatedAt\" | \"publishedAt\";\n\n/**\n * Inclusive date-range filter for a single whitelisted timestamp column.\n * Bounds are compared lexicographically against the stored ISO 8601 strings,\n * which is correct because every timestamp is written via `toISOString()`.\n * Callers wanting an inclusive upper bound should pass an end-of-day value\n * (e.g. `2024-12-31T23:59:59.999Z`); the repository does not widen `to`.\n */\nexport interface ContentDateFilter {\n\tfield: ContentDateField;\n\tfrom?: string;\n\tto?: string;\n}\n\n/**\n * Byline filter for a content list.\n *\n * `mode: \"any\"` matches entries credited to at least one of `bylineIds`;\n * `mode: \"none\"` matches entries with no credit at all.\n *\n * `bylineIds` are `translation_group` values — what\n * `_emdash_content_bylines.byline_id` stores since migration 040 — so a filter\n * matches a byline across every locale variant.\n *\n * By default only explicit credits count. `includeInferred` widens the filter\n * to the byline the list actually renders, which for an entry with no credits\n * is the one linked to its `author_id` (see `hydrateBylinesMany`).\n */\nexport interface ContentBylineFilter {\n\tmode: \"any\" | \"none\";\n\t/** Ignored when `mode` is `\"none\"`. An empty list matches nothing. */\n\tbylineIds?: string[];\n\tincludeInferred?: boolean;\n\t/**\n\t * Locale a credit has to resolve at — the locale the list is scoped to.\n\t * Applies to explicit credits as well as inferred ones, since a byline\n\t * group credited to an entry renders only where it has a row at that\n\t * locale. Defaults to each entry's own locale when the list spans locales.\n\t */\n\tlocale?: string;\n}\n\nexport interface FindManyOptions {\n\twhere?: {\n\t\tstatus?: string;\n\t\tauthorId?: string;\n\t\tlocale?: string;\n\t\t/** Case-insensitive substring to match against `searchColumns`. */\n\t\tq?: string;\n\t\t/**\n\t\t * Columns the `q` substring filter is applied to (OR'd together).\n\t\t * Resolved by the handler from the collection's display fields, slug,\n\t\t * and any field marked searchable. Each name is validated as a SQL\n\t\t * identifier.\n\t\t */\n\t\tsearchColumns?: string[];\n\t\t/**\n\t\t * Serve `q` from the collection's FTS5 index (`_emdash_fts_<slug>`)\n\t\t * instead of an unindexable substring LIKE. Set by the handler only\n\t\t * when the collection has search enabled and the index exists\n\t\t * (SQLite only). The repository combines a token-prefix MATCH with\n\t\t * an index-served slug prefix so slug lookups keep working.\n\t\t */\n\t\tuseFts?: boolean;\n\t\t/** Inclusive date range over a whitelisted timestamp column. */\n\t\tdateFilter?: ContentDateFilter;\n\t\t/** Restrict to entries by their byline credits. */\n\t\tbylineFilter?: ContentBylineFilter;\n\t\t/** AND-combined filters over custom fields explicitly marked as indexed. */\n\t\tfieldFilters?: ContentFieldFilters;\n\t};\n\torderBy?: {\n\t\tfield: string;\n\t\tdirection: \"asc\" | \"desc\";\n\t};\n\t/**\n\t * Extra field slugs allowed as `orderBy` beyond the system columns — the\n\t * collection's configured titleField/dateField. Resolved by the\n\t * handler server-side so `orderBy` stays a closed set per request.\n\t */\n\tsortableExtras?: string[];\n\tlimit?: number;\n\tcursor?: string; // Base64-encoded JSON: {orderValue: string, id: string}\n}\n\nexport interface FindManyResult<T> {\n\titems: T[];\n\tnextCursor?: string; // Base64-encoded JSON: {orderValue: string, id: string}\n\t/**\n\t * Total number of rows matching the where clause (ignoring pagination).\n\t * Optional because not every caller needs it; repositories that compute\n\t * it should set it so the UI can render a stable pagination denominator.\n\t */\n\ttotal?: number;\n}\n\n/** Encode a cursor from order value + id */\nexport function encodeCursor(orderValue: string, id: string): string {\n\treturn encodeBase64(JSON.stringify({ orderValue, id }));\n}\n\n/**\n * Thrown when a pagination cursor cannot be decoded.\n *\n * Repository callers should let this propagate; handler catch blocks\n * map it to a structured `INVALID_CURSOR` error so client pagination\n * bugs surface immediately rather than silently re-fetching the first\n * page.\n */\nexport class InvalidCursorError extends Error {\n\tconstructor(cursor: string) {\n\t\tconst display = cursor.length > 50 ? `${cursor.slice(0, 47)}...` : cursor;\n\t\tsuper(`Invalid pagination cursor: ${display}`);\n\t\tthis.name = \"InvalidCursorError\";\n\t}\n}\n\n/**\n * Decode a cursor to order value + id.\n *\n * Throws `InvalidCursorError` if the cursor is empty, not valid base64,\n * not valid JSON, or doesn't contain string `orderValue` and `id` fields.\n */\nexport function decodeCursor(cursor: string): { orderValue: string; id: string } {\n\tif (!cursor) throw new InvalidCursorError(cursor);\n\tif (cursor.length > MAX_CURSOR_LENGTH) throw new InvalidCursorError(cursor);\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(decodeBase64(cursor));\n\t} catch {\n\t\tthrow new InvalidCursorError(cursor);\n\t}\n\tif (parsed === null || typeof parsed !== \"object\") {\n\t\tthrow new InvalidCursorError(cursor);\n\t}\n\tconst candidate = parsed as { orderValue?: unknown; id?: unknown };\n\tif (typeof candidate.orderValue !== \"string\" || typeof candidate.id !== \"string\") {\n\t\tthrow new InvalidCursorError(cursor);\n\t}\n\treturn { orderValue: candidate.orderValue, id: candidate.id };\n}\n\nexport interface ContentItem {\n\tid: string;\n\ttype: string;\n\tslug: string | null;\n\tstatus: string;\n\tdata: Record<string, unknown>;\n\tauthorId: string | null;\n\tprimaryBylineId: string | null;\n\tbyline?: BylineSummary | null;\n\tbylines?: ContentBylineCredit[];\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tpublishedAt: string | null;\n\tscheduledAt: string | null;\n\tliveRevisionId: string | null;\n\tdraftRevisionId: string | null;\n\tversion: number;\n\tlocale: string | null;\n\ttranslationGroup: string | null;\n\t/** SEO metadata — only populated for collections with `has_seo` enabled */\n\tseo?: ContentSeo;\n\t/**\n\t * For collections that support `revisions`: when a draft revision exists,\n\t * `data` reflects the unsaved draft and `liveData` carries the currently-\n\t * published values. When no draft exists, `liveData` is undefined.\n\t *\n\t * Hydrated by `EmDashRuntime.hydrateDraftData()` — repositories themselves\n\t * never set this field; it's purely a runtime-overlay concept that gives\n\t * agents a clear picture of \"draft vs. live\" without re-fetching the\n\t * revision history.\n\t */\n\tliveData?: Record<string, unknown>;\n}\n\nexport class EmDashValidationError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic details?: unknown,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"EmDashValidationError\";\n\t}\n}\n\nexport class ContentCollectionNotFoundError extends Error {\n\tconstructor(collection: string) {\n\t\tsuper(`Collection '${collection}' not found`);\n\t\tthis.name = \"ContentCollectionNotFoundError\";\n\t}\n}\n\n/**\n * Thrown by `publish()` when called with `requireDue` for a row that is no\n * longer due (its `scheduled_at` was cleared or pushed into the future between\n * selection and publish — e.g. an editor unscheduled it). Lets the scheduled\n * sweep skip the row silently rather than treating it as a publish failure.\n */\nexport class ScheduledNotDueError extends Error {\n\tconstructor(message = \"Content is no longer scheduled to publish\") {\n\t\tsuper(message);\n\t\tthis.name = \"ScheduledNotDueError\";\n\t}\n}\n\nexport class ContentMutationConflictError extends Error {\n\tconstructor(message = \"Content changed while the operation was in progress\") {\n\t\tsuper(message);\n\t\tthis.name = \"ContentMutationConflictError\";\n\t}\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,oBAAoB;;AA8N1B,SAAgB,aAAa,YAAoB,IAAoB;AACpE,QAAO,aAAa,KAAK,UAAU;EAAE;EAAY;EAAI,CAAC,CAAC;;;;;;;;;;AAWxD,IAAa,qBAAb,cAAwC,MAAM;CAC7C,YAAY,QAAgB;EAC3B,MAAM,UAAU,OAAO,SAAS,KAAK,GAAG,OAAO,MAAM,GAAG,GAAG,CAAC,OAAO;AACnE,QAAM,8BAA8B,UAAU;AAC9C,OAAK,OAAO;;;;;;;;;AAUd,SAAgB,aAAa,QAAoD;AAChF,KAAI,CAAC,OAAQ,OAAM,IAAI,mBAAmB,OAAO;AACjD,KAAI,OAAO,SAAS,kBAAmB,OAAM,IAAI,mBAAmB,OAAO;CAC3E,IAAI;AACJ,KAAI;AACH,WAAS,KAAK,MAAM,aAAa,OAAO,CAAC;SAClC;AACP,QAAM,IAAI,mBAAmB,OAAO;;AAErC,KAAI,WAAW,QAAQ,OAAO,WAAW,SACxC,OAAM,IAAI,mBAAmB,OAAO;CAErC,MAAM,YAAY;AAClB,KAAI,OAAO,UAAU,eAAe,YAAY,OAAO,UAAU,OAAO,SACvE,OAAM,IAAI,mBAAmB,OAAO;AAErC,QAAO;EAAE,YAAY,UAAU;EAAY,IAAI,UAAU;EAAI;;AAqC9D,IAAa,wBAAb,cAA2C,MAAM;CAChD,YACC,SACA,AAAO,SACN;AACD,QAAM,QAAQ;EAFP;AAGP,OAAK,OAAO;;;AAId,IAAa,iCAAb,cAAoD,MAAM;CACzD,YAAY,YAAoB;AAC/B,QAAM,eAAe,WAAW,aAAa;AAC7C,OAAK,OAAO;;;;;;;;;AAUd,IAAa,uBAAb,cAA0C,MAAM;CAC/C,YAAY,UAAU,6CAA6C;AAClE,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAId,IAAa,+BAAb,cAAkD,MAAM;CACvD,YAAY,UAAU,uDAAuD;AAC5E,QAAM,QAAQ;AACd,OAAK,OAAO"}
|
|
@@ -150,7 +150,8 @@ interface Storage {
|
|
|
150
150
|
upload(options: {
|
|
151
151
|
key: string;
|
|
152
152
|
body: Buffer | Uint8Array | ReadableStream<Uint8Array>;
|
|
153
|
-
contentType: string;
|
|
153
|
+
contentType: string; /** Optional HTTP cache policy stored with publicly served objects. */
|
|
154
|
+
cacheControl?: string;
|
|
154
155
|
}): Promise<UploadResult>;
|
|
155
156
|
/**
|
|
156
157
|
* Download a file from storage
|
|
@@ -194,4 +195,4 @@ declare class EmDashStorageError extends Error {
|
|
|
194
195
|
}
|
|
195
196
|
//#endregion
|
|
196
197
|
export { ListOptions as a, S3StorageConfig as c, Storage as d, StorageDescriptor as f, FileInfo as i, SignedUploadOptions as l, DownloadResult as n, ListResult as o, UploadResult as p, EmDashStorageError as r, LocalStorageConfig as s, CreateStorageFn as t, SignedUploadUrl as u };
|
|
197
|
-
//# sourceMappingURL=types-
|
|
198
|
+
//# sourceMappingURL=types-CXFkwEGC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CXFkwEGC.d.mts","names":[],"sources":["../src/storage/types.ts"],"mappings":";;AAUA;;;;;;;;UAAiB,eAAA;EAoBhB;EAl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CAAQ,YAAA;EA2BgB;;;EAtB5B,QAAA,CAAS,GAAA,WAAc,OAAA,CAAQ,cAAA;EA2B/B;;;;EArBA,MAAA,CAAO,GAAA,WAAc,OAAA;EAiCT;;;EA5BZ,MAAA,CAAO,GAAA,WAAc,OAAA;EA4BkB;;;EAvBvC,IAAA,CAAK,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,UAAA;EAyBpC;;;;EAnBD,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAsB,OAAA,CAAQ,eAAA;;;;EAK1D,YAAA,CAAa,GAAA;;;;;EAMb,qBAAA;AAAA;;;;cAMY,kBAAA,SAA2B,KAAA;EAG/B,IAAA;EACS,KAAA;cAFhB,OAAA,UACO,IAAA,UACS,KAAA;AAAA"}
|
|
@@ -360,4 +360,4 @@ interface ImportContext {
|
|
|
360
360
|
}
|
|
361
361
|
//#endregion
|
|
362
362
|
export { UrlInput as S, SourceAuth as _, FileInput as a, SourceProbeResult as b, ImportContext as c, ImportSource as d, NormalizedItem as f, ProbeResult as g, PostTypeMapping as h, FieldCompatibility as i, ImportFieldDef as l, PostTypeAnalysis as m, CollectionSchemaStatus as n, ImportAnalysis as o, OAuthInput as p, FetchOptions as r, ImportConfig as s, AttachmentInfo as t, ImportResult as u, SourceCapabilities as v, SuggestedAction as x, SourceInput as y };
|
|
363
|
-
//# sourceMappingURL=types-
|
|
363
|
+
//# sourceMappingURL=types-DczELMop.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-DczELMop.d.mts","names":[],"sources":["../src/import/types.ts"],"mappings":";;;;UAciB,YAAA;EAChB,EAAA;EACA,KAAA;EACA,KAAA;EACA,WAAA;EACA,SAAA;AAAA;;UAQgB,SAAA;EAChB,IAAA;EACA,IAAA,EAAM,IAAA;AAAA;;UAIU,QAAA;EAChB,IAAA;EACA,GAAA;EAFwB;EAIxB,KAAA;AAAA;;UAIgB,UAAA;EAChB,I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+B,OAAA,CAC9B,GAAA;IAAc,IAAA;IAAc,MAAA,EAAQ,GAAA;MAAc,IAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CAPABILITY_RENAMES, capabilitiesToDeclaredAccess as capabilitiesToDeclaredAccess$1, isDeprecatedCapability, normalizeCapabilities, normalizeCapability } from "@emdash-cms/plugin-types";
|
|
2
|
+
|
|
3
|
+
export { normalizeCapability as a, normalizeCapabilities as i, capabilitiesToDeclaredAccess$1 as n, isDeprecatedCapability as r, CAPABILITY_RENAMES as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-FV23hEoW.d.mts","names":[],"sources":["../src/database/types.ts"],"mappings":";;;UAMiB,aAAA;EAChB,EAAA;EACA,UAAA;EACA,QAAA;EACA,IAAA;EACA,SAAA;EACA,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,uBAAA;EAChB,UAAA;EACA,QAAA;EACA,WAAA;AAAA;AAAA,UAGgB,aAAA;EAChB,EAAA;EACA,IAAA;EACA,IAAA;EACA,KAAA;EACA,SAAA;EACA,IAAA;EACA,MAAA,EAAQ,SAAA;EACR,iBAAA;EAGA,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,oBAAA;EAChB,UAAA;EACA,QAAA;EACA,WAAA;EAIA,MAAA,EAAQ,SAAA;EACR,YAAA,EAAc,SAAA;EACd,UAAA,EAAY,SAAA;EACZ,MAAA,EAAQ,SAAA;EACR,YAAA,EAAc,SAAA;EACd,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,gBAAA;EAChB,EAAA;EACA,IAAA;EACA,KAAA;EACA,cAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA,EAAY,SAAA;EACZ,MAAA,EAAQ,SAAA;EACR,iBAAA;AAAA;AAAA,UAGgB,UAAA;EAChB,EAAA;EACA,QAAA;EACA,SAAA;EACA,IAAA;EACA,KAAA;EACA,MAAA;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AY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,qBAAA;EAChB,SAAA;EACA,QAAA;EA9YA;EAgZA,KAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,0BAAA;EAChB,iBAAA;EACA,QAAA;EA7YgB;EA+YhB,KAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAUI,aAAA;EAChB,EAAA;EACA,IAAA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,WAAA;EACA,MAAA,EAAQ,SAAA;EACR,iBAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAGI,qBAAA;EAChB,EAAA;EAnaA;EAqaA,cAAA;EApac;EAsad,YAAA;EApaA;EAsaA,WAAA;EACA,UAAA,EAAY,SAAA;EACZ,UAAA,EAAY,SAAA;AAAA;AAAA,UAKI,cAAA;EAChB,GAAA;EACA,MAAA;EACA,KAAA;AAAA"}
|
|
@@ -254,4 +254,4 @@ declare const RESERVED_COLLECTION_SLUGS: string[];
|
|
|
254
254
|
type CustomFieldValue = string | boolean | null;
|
|
255
255
|
//#endregion
|
|
256
256
|
export { UpdateCollectionInput as _, CollectionWithFields as a, CreateFieldInput as c, Field as d, FieldType as f, RESERVED_FIELD_SLUGS as g, RESERVED_COLLECTION_SLUGS as h, CollectionSupport as i, CustomFieldValue as l, FieldWidgetOptions as m, CollectionAdminConfig as n, ColumnType as o, FieldValidation as p, CollectionSource as r, CreateCollectionInput as s, Collection as t, FIELD_TYPE_TO_COLUMN as u, UpdateFieldInput as v };
|
|
257
|
-
//# sourceMappingURL=types-
|
|
257
|
+
//# sourceMappingURL=types-xDMtUFnO.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-xDMtUFnO.d.mts","names":[],"sources":["../src/schema/types.ts"],"mappings":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iB,qBAAA;EAChB,IAAA;EACA,KAAA;EACA,aAAA;EACA,WAAA;EACA,IAAA;EACA,KAAA,GAAQ,qBAAA;EACR,QAAA,GAAW,iBAAA;EACX,MAAA,GAAS,gBAAA;EACT,UAAA;EACA,QAAA;EACA,MAAA;EAJA;EAMA,MAAA;EALA;EAOA,SAAA;EACA,eAAA;AAAA;;;;UAMgB,qBAAA;EAChB,KAAA;EACA,aAAA;EACA,WAAA;EACA,IAAA;EACA,KAAA,GAAQ,qBAAA;EACR,QAAA,GAAW,iBAAA;EACX,UAAA;EACA,QAAA;EACA,MAAA;EALA;EAOA,MAAA;EANQ;EAQR,SAAA;EACA,eAAA;EACA,kBAAA;EACA,uBAAA;EACA,wBAAA;EANA;EAQA,UAAA;EALA;EAOA,SAAA;AAAA;;;;UAMgB,gBAAA;EAChB,IAAA;EACA,KAAA;EACA,IAAA,EAAM,SAAA;EACN,QAAA;EACA,MAAA;EACA,YAAA;EACA,UAAA,GAAa,eAAA;EACb,MAAA;EACA,OAAA,GAAU,kBAAA;EACV,SAAA;EARA;EAUA,UAAA;EATM;EAWN,OAAA;EATA;EAWA,YAAA;AAAA;;;;UAMgB,gBAAA;EAChB,KAAA;EAXA;;;;;EAiBA,IAAA,GAAO,SAAA;EACP,QAAA;EACA,MAAA;EACA,YAAA;EACA,UAAA,GAAa,eAAA;EACb,MAAA;EACA,OAAA,GAAU,kBAAA;EACV,SAAA;EAbA;EAeA,UAAA;EATO;EAWP,OAAA;EATA;EAWA,YAAA;AAAA;;;;UAMgB,oBAAA,SAA6B,UAAA;EAC7C,MAAA,EAAQ,KAAA;AAAA;;;;;AADT;;cAUa,oBAAA;;;;cAuBA,yBAAA;;;;;;KA0GD,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-attempts-
|
|
1
|
+
{"version":3,"file":"upload-attempts-BsqoQ1fn.mjs","names":[],"sources":["../src/media/upload-attempts.ts"],"sourcesContent":["import type { MediaRepository } from \"../database/repositories/media.js\";\nimport type { Storage } from \"../storage/types.js\";\n\nexport async function removeUploadAttempt(\n\tstorage: Storage,\n\trepo: MediaRepository,\n\tstorageKey: string,\n\toptions: { allowUntracked?: boolean } = {},\n): Promise<boolean> {\n\ttry {\n\t\tif (!(await repo.claimUploadAttemptForCleanup(storageKey))) {\n\t\t\tconst tracked = await repo.hasUploadAttempt(storageKey);\n\t\t\tif (tracked || !options.allowUntracked) return false;\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup claim failed:\", error);\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tawait storage.delete(storageKey);\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup failed:\", error);\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tawait repo.deleteUploadAttempt(storageKey);\n\t} catch (error) {\n\t\tconsole.error(\"[media] upload cleanup record deletion failed:\", error);\n\t}\n\treturn true;\n}\n"],"mappings":";AAGA,eAAsB,oBACrB,SACA,MACA,YACA,UAAwC,EAAE,EACvB;AACnB,KAAI;AACH,MAAI,CAAE,MAAM,KAAK,6BAA6B,WAAW,EAExD;OADgB,MAAM,KAAK,iBAAiB,WAAW,IACxC,CAAC,QAAQ,eAAgB,QAAO;;UAExC,OAAO;AACf,UAAQ,MAAM,wCAAwC,MAAM;AAC5D,SAAO;;AAGR,KAAI;AACH,QAAM,QAAQ,OAAO,WAAW;UACxB,OAAO;AACf,UAAQ,MAAM,kCAAkC,MAAM;AACtD,SAAO;;AAGR,KAAI;AACH,QAAM,KAAK,oBAAoB,WAAW;UAClC,OAAO;AACf,UAAQ,MAAM,kDAAkD,MAAM;;AAEvE,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-pattern-
|
|
1
|
+
{"version":3,"file":"url-pattern-D4c2czpJ.mjs","names":[],"sources":["../src/schema/url-pattern.ts"],"sourcesContent":["const URL_PARAM_PATTERN = /\\{(\\w+)\\}/g;\nconst REGEX_SPECIAL_CHARACTERS = /[.*+?^${}()|[\\]\\\\]/g;\nconst INVALID_LITERAL_PATTERN = /[{}]/;\n\nfunction escapeRegex(literal: string): string {\n\treturn literal.replace(REGEX_SPECIAL_CHARACTERS, \"\\\\$&\");\n}\n\nexport function compileUrlPattern(pattern: string): { regex: RegExp; paramNames: string[] } {\n\tconst paramNames: string[] = [];\n\tlet regexSource = \"\";\n\tlet previousIndex = 0;\n\n\tfor (const match of pattern.matchAll(URL_PARAM_PATTERN)) {\n\t\tconst matchIndex = match.index;\n\t\tconst literal = pattern.slice(previousIndex, matchIndex);\n\t\tif (INVALID_LITERAL_PATTERN.test(literal)) throw new Error(\"Invalid URL pattern placeholder\");\n\t\tregexSource += escapeRegex(literal);\n\n\t\tconst name = match[1];\n\t\tparamNames.push(name);\n\t\tregexSource += \"([^/]+)\";\n\t\tpreviousIndex = matchIndex + match[0].length;\n\t}\n\n\tconst trailingLiteral = pattern.slice(previousIndex);\n\tif (INVALID_LITERAL_PATTERN.test(trailingLiteral)) {\n\t\tthrow new Error(\"Invalid URL pattern placeholder\");\n\t}\n\tregexSource += escapeRegex(trailingLiteral);\n\n\treturn { regex: new RegExp(`^${regexSource}$`), paramNames };\n}\n"],"mappings":";AAAA,MAAM,oBAAoB;AAC1B,MAAM,2BAA2B;AACjC,MAAM,0BAA0B;AAEhC,SAAS,YAAY,SAAyB;AAC7C,QAAO,QAAQ,QAAQ,0BAA0B,OAAO;;AAGzD,SAAgB,kBAAkB,SAA0D;CAC3F,MAAM,aAAuB,EAAE;CAC/B,IAAI,cAAc;CAClB,IAAI,gBAAgB;AAEpB,MAAK,MAAM,SAAS,QAAQ,SAAS,kBAAkB,EAAE;EACxD,MAAM,aAAa,MAAM;EACzB,MAAM,UAAU,QAAQ,MAAM,eAAe,WAAW;AACxD,MAAI,wBAAwB,KAAK,QAAQ,CAAE,OAAM,IAAI,MAAM,kCAAkC;AAC7F,iBAAe,YAAY,QAAQ;EAEnC,MAAM,OAAO,MAAM;AACnB,aAAW,KAAK,KAAK;AACrB,iBAAe;AACf,kBAAgB,aAAa,MAAM,GAAG;;CAGvC,MAAM,kBAAkB,QAAQ,MAAM,cAAc;AACpD,KAAI,wBAAwB,KAAK,gBAAgB,CAChD,OAAM,IAAI,MAAM,kCAAkC;AAEnD,gBAAe,YAAY,gBAAgB;AAE3C,QAAO;EAAE,OAAO,IAAI,OAAO,IAAI,YAAY,GAAG;EAAE;EAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-
|
|
1
|
+
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-C4szrD8o.mjs";
|
|
2
2
|
import { o as decodeCursor, s as encodeCursor } from "./types-CQPWhPxE.mjs";
|
|
3
3
|
import { ulid } from "ulidx";
|
|
4
4
|
|
|
@@ -168,4 +168,4 @@ var UserRepository = class UserRepository {
|
|
|
168
168
|
|
|
169
169
|
//#endregion
|
|
170
170
|
export { UserRepository as t };
|
|
171
|
-
//# sourceMappingURL=user-
|
|
171
|
+
//# sourceMappingURL=user-BTZ40aq6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-CtYY0tp2.mjs","names":[],"sources":["../src/database/repositories/user.ts"],"sourcesContent":["import type { Kysely, Selectable, Updateable } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { chunks, SQL_BATCH_SIZE } from \"../../utils/chunks.js\";\nimport type { Database, UserTable } from \"../types.js\";\nimport { encodeCursor, decodeCursor, type FindManyResult } from \"./types.js\";\n\ntype UserRow = Selectable<UserTable>;\n\n/**\n * Valid role levels matching the database schema.\n * 10=subscriber, 20=contributor, 30=author, 40=editor, 50=admin\n */\nexport type UserRole = 10 | 20 | 30 | 40 | 50;\n\n/** String role names for convenience APIs */\nexport type UserRoleName = \"subscriber\" | \"contributor\" | \"author\" | \"editor\" | \"admin\";\n\nexport interface User {\n\tid: string;\n\temail: string;\n\tname: string | null;\n\trole: UserRole;\n\tavatarUrl: string | null;\n\temailVerified: boolean;\n\tdata: Record<string, unknown> | null;\n\tcreatedAt: string;\n}\n\nexport interface CreateUserInput {\n\temail: string;\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string;\n\tdata?: Record<string, unknown>;\n}\n\nexport interface UpdateUserInput {\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string | null;\n\tdata?: Record<string, unknown>;\n}\n\n/**\n * User repository for CRUD operations\n */\nexport class UserRepository {\n\tconstructor(private db: Kysely<Database>) {}\n\n\t/**\n\t * Create a new user\n\t */\n\tasync create(input: CreateUserInput): Promise<User> {\n\t\tconst id = ulid();\n\n\t\tconst row: Omit<UserTable, \"created_at\" | \"updated_at\" | \"disabled\"> = {\n\t\t\tid,\n\t\t\temail: input.email.toLowerCase(),\n\t\t\tname: input.name ?? null,\n\t\t\trole: UserRepository.resolveRole(input.role ?? 10),\n\t\t\tavatar_url: input.avatarUrl ?? null,\n\t\t\temail_verified: 0,\n\t\t\tdata: input.data ? JSON.stringify(input.data) : null,\n\t\t};\n\n\t\tawait this.db.insertInto(\"users\").values(row).execute();\n\n\t\tconst user = await this.findById(id);\n\t\tif (!user) {\n\t\t\tthrow new Error(\"Failed to create user\");\n\t\t}\n\t\treturn user;\n\t}\n\n\t/**\n\t * Find user by ID\n\t */\n\tasync findById(id: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"id\", \"=\", id)\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * Batch-resolve users by ID. Returns only the users that exist; missing\n\t * IDs are silently dropped. Chunked at `SQL_BATCH_SIZE` to stay within\n\t * D1's bind-parameter limit.\n\t */\n\tasync findByIds(ids: string[]): Promise<User[]> {\n\t\tconst unique = [...new Set(ids)].filter((id) => id.length > 0);\n\t\tif (unique.length === 0) return [];\n\n\t\tconst out: User[] = [];\n\t\tfor (const batch of chunks(unique, SQL_BATCH_SIZE)) {\n\t\t\tconst rows = await this.db.selectFrom(\"users\").selectAll().where(\"id\", \"in\", batch).execute();\n\t\t\tfor (const row of rows) out.push(this.rowToUser(row));\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t * Find user by email (case-insensitive)\n\t */\n\tasync findByEmail(email: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * List all users with cursor-based pagination\n\t */\n\tasync findMany(\n\t\toptions: {\n\t\t\trole?: UserRole | UserRoleName;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t} = {},\n\t): Promise<FindManyResult<User>> {\n\t\tconst limit = Math.min(Math.max(1, options.limit || 50), 100);\n\n\t\tlet query = this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.orderBy(\"created_at\", \"desc\")\n\t\t\t.orderBy(\"id\", \"desc\")\n\t\t\t.limit(limit + 1);\n\n\t\tif (options.role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(options.role));\n\t\t}\n\n\t\tif (options.cursor) {\n\t\t\tconst decoded = decodeCursor(options.cursor);\n\t\t\tquery = query.where((eb) =>\n\t\t\t\teb.or([\n\t\t\t\t\teb(\"created_at\", \"<\", decoded.orderValue),\n\t\t\t\t\teb.and([eb(\"created_at\", \"=\", decoded.orderValue), eb(\"id\", \"<\", decoded.id)]),\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\tconst rows = await query.execute();\n\t\tconst items = rows.slice(0, limit).map((row) => this.rowToUser(row));\n\t\tconst result: FindManyResult<User> = { items };\n\n\t\tif (rows.length > limit && items.length > 0) {\n\t\t\tconst last = items.at(-1)!;\n\t\t\tresult.nextCursor = encodeCursor(last.createdAt, last.id);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Update a user\n\t */\n\tasync update(id: string, input: UpdateUserInput): Promise<User | null> {\n\t\tconst existing = await this.findById(id);\n\t\tif (!existing) return null;\n\n\t\tconst updates: Updateable<UserTable> = {};\n\t\tif (input.name !== undefined) updates.name = input.name;\n\t\tif (input.role !== undefined) updates.role = UserRepository.resolveRole(input.role);\n\t\tif (input.avatarUrl !== undefined) updates.avatar_url = input.avatarUrl;\n\t\tif (input.data !== undefined) updates.data = JSON.stringify(input.data);\n\n\t\tif (Object.keys(updates).length > 0) {\n\t\t\tawait this.db.updateTable(\"users\").set(updates).where(\"id\", \"=\", id).execute();\n\t\t}\n\n\t\treturn this.findById(id);\n\t}\n\n\t/**\n\t * Delete a user\n\t */\n\tasync delete(id: string): Promise<boolean> {\n\t\tconst result = await this.db.deleteFrom(\"users\").where(\"id\", \"=\", id).executeTakeFirst();\n\n\t\treturn (result.numDeletedRows ?? 0) > 0;\n\t}\n\n\t/**\n\t * Count users\n\t */\n\tasync count(role?: UserRole | UserRoleName): Promise<number> {\n\t\tlet query = this.db.selectFrom(\"users\").select((eb) => eb.fn.count(\"id\").as(\"count\"));\n\n\t\tif (role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(role));\n\t\t}\n\n\t\tconst result = await query.executeTakeFirst();\n\t\treturn Number(result?.count || 0);\n\t}\n\n\t/**\n\t * Check if email exists\n\t */\n\tasync emailExists(email: string): Promise<boolean> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.select(\"id\")\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn !!row;\n\t}\n\n\t/**\n\t * Convert database row to User object\n\t */\n\tprivate rowToUser(row: UserRow): User {\n\t\treturn {\n\t\t\tid: row.id,\n\t\t\temail: row.email,\n\t\t\tname: row.name,\n\t\t\trole: UserRepository.toRole(row.role),\n\t\t\tavatarUrl: row.avatar_url,\n\t\t\temailVerified: row.email_verified === 1,\n\t\t\tdata: row.data ? JSON.parse(row.data) : null,\n\t\t\tcreatedAt: row.created_at,\n\t\t};\n\t}\n\n\t/** Map of role name strings to numeric levels */\n\tprivate static readonly ROLE_NAME_TO_LEVEL: Record<UserRoleName, UserRole> = {\n\t\tsubscriber: 10,\n\t\tcontributor: 20,\n\t\tauthor: 30,\n\t\teditor: 40,\n\t\tadmin: 50,\n\t};\n\n\t/** Valid numeric role levels */\n\tprivate static readonly VALID_LEVELS = new Set<number>([10, 20, 30, 40, 50]);\n\n\t/**\n\t * Resolve a role name or number to a valid numeric UserRole.\n\t * Accepts both string names (\"admin\") and numeric levels (50).\n\t */\n\tstatic resolveRole(role: UserRole | UserRoleName): UserRole {\n\t\tif (typeof role === \"string\") {\n\t\t\tconst level = UserRepository.ROLE_NAME_TO_LEVEL[role];\n\t\t\tif (level === undefined) {\n\t\t\t\tthrow new Error(`Invalid role name: ${role}`);\n\t\t\t}\n\t\t\treturn level;\n\t\t}\n\t\tif (!UserRepository.VALID_LEVELS.has(role)) {\n\t\t\tthrow new Error(`Invalid role level: ${role}`);\n\t\t}\n\t\treturn role;\n\t}\n\n\t/**\n\t * Convert a raw DB integer to a typed UserRole.\n\t * Falls back to subscriber (10) for unknown values.\n\t */\n\tprivate static toRole(level: number): UserRole {\n\t\tif (UserRepository.VALID_LEVELS.has(level)) return level as UserRole;\n\t\treturn 10;\n\t}\n}\n"],"mappings":";;;;;;;;AA+CA,IAAa,iBAAb,MAAa,eAAe;CAC3B,YAAY,AAAQ,IAAsB;EAAtB;;;;;CAKpB,MAAM,OAAO,OAAuC;EACnD,MAAM,KAAK,MAAM;EAEjB,MAAM,MAAiE;GACtE;GACA,OAAO,MAAM,MAAM,aAAa;GAChC,MAAM,MAAM,QAAQ;GACpB,MAAM,eAAe,YAAY,MAAM,QAAQ,GAAG;GAClD,YAAY,MAAM,aAAa;GAC/B,gBAAgB;GAChB,MAAM,MAAM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OAAM,IAAI,MAAM,uBAAuB,OAAO;AAE/C,SAAO;;;;;;CAOR,OAAe,OAAO,OAAyB;AAC9C,MAAI,eAAe,aAAa,IAAI,MAAM,CAAE,QAAO;AACnD,SAAO"}
|
|
1
|
+
{"version":3,"file":"user-BTZ40aq6.mjs","names":[],"sources":["../src/database/repositories/user.ts"],"sourcesContent":["import type { Kysely, Selectable, Updateable } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { chunks, SQL_BATCH_SIZE } from \"../../utils/chunks.js\";\nimport type { Database, UserTable } from \"../types.js\";\nimport { encodeCursor, decodeCursor, type FindManyResult } from \"./types.js\";\n\ntype UserRow = Selectable<UserTable>;\n\n/**\n * Valid role levels matching the database schema.\n * 10=subscriber, 20=contributor, 30=author, 40=editor, 50=admin\n */\nexport type UserRole = 10 | 20 | 30 | 40 | 50;\n\n/** String role names for convenience APIs */\nexport type UserRoleName = \"subscriber\" | \"contributor\" | \"author\" | \"editor\" | \"admin\";\n\nexport interface User {\n\tid: string;\n\temail: string;\n\tname: string | null;\n\trole: UserRole;\n\tavatarUrl: string | null;\n\temailVerified: boolean;\n\tdata: Record<string, unknown> | null;\n\tcreatedAt: string;\n}\n\nexport interface CreateUserInput {\n\temail: string;\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string;\n\tdata?: Record<string, unknown>;\n}\n\nexport interface UpdateUserInput {\n\tname?: string;\n\trole?: UserRole | UserRoleName;\n\tavatarUrl?: string | null;\n\tdata?: Record<string, unknown>;\n}\n\n/**\n * User repository for CRUD operations\n */\nexport class UserRepository {\n\tconstructor(private db: Kysely<Database>) {}\n\n\t/**\n\t * Create a new user\n\t */\n\tasync create(input: CreateUserInput): Promise<User> {\n\t\tconst id = ulid();\n\n\t\tconst row: Omit<UserTable, \"created_at\" | \"updated_at\" | \"disabled\"> = {\n\t\t\tid,\n\t\t\temail: input.email.toLowerCase(),\n\t\t\tname: input.name ?? null,\n\t\t\trole: UserRepository.resolveRole(input.role ?? 10),\n\t\t\tavatar_url: input.avatarUrl ?? null,\n\t\t\temail_verified: 0,\n\t\t\tdata: input.data ? JSON.stringify(input.data) : null,\n\t\t};\n\n\t\tawait this.db.insertInto(\"users\").values(row).execute();\n\n\t\tconst user = await this.findById(id);\n\t\tif (!user) {\n\t\t\tthrow new Error(\"Failed to create user\");\n\t\t}\n\t\treturn user;\n\t}\n\n\t/**\n\t * Find user by ID\n\t */\n\tasync findById(id: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"id\", \"=\", id)\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * Batch-resolve users by ID. Returns only the users that exist; missing\n\t * IDs are silently dropped. Chunked at `SQL_BATCH_SIZE` to stay within\n\t * D1's bind-parameter limit.\n\t */\n\tasync findByIds(ids: string[]): Promise<User[]> {\n\t\tconst unique = [...new Set(ids)].filter((id) => id.length > 0);\n\t\tif (unique.length === 0) return [];\n\n\t\tconst out: User[] = [];\n\t\tfor (const batch of chunks(unique, SQL_BATCH_SIZE)) {\n\t\t\tconst rows = await this.db.selectFrom(\"users\").selectAll().where(\"id\", \"in\", batch).execute();\n\t\t\tfor (const row of rows) out.push(this.rowToUser(row));\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t * Find user by email (case-insensitive)\n\t */\n\tasync findByEmail(email: string): Promise<User | null> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn row ? this.rowToUser(row) : null;\n\t}\n\n\t/**\n\t * List all users with cursor-based pagination\n\t */\n\tasync findMany(\n\t\toptions: {\n\t\t\trole?: UserRole | UserRoleName;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t} = {},\n\t): Promise<FindManyResult<User>> {\n\t\tconst limit = Math.min(Math.max(1, options.limit || 50), 100);\n\n\t\tlet query = this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.selectAll()\n\t\t\t.orderBy(\"created_at\", \"desc\")\n\t\t\t.orderBy(\"id\", \"desc\")\n\t\t\t.limit(limit + 1);\n\n\t\tif (options.role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(options.role));\n\t\t}\n\n\t\tif (options.cursor) {\n\t\t\tconst decoded = decodeCursor(options.cursor);\n\t\t\tquery = query.where((eb) =>\n\t\t\t\teb.or([\n\t\t\t\t\teb(\"created_at\", \"<\", decoded.orderValue),\n\t\t\t\t\teb.and([eb(\"created_at\", \"=\", decoded.orderValue), eb(\"id\", \"<\", decoded.id)]),\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\tconst rows = await query.execute();\n\t\tconst items = rows.slice(0, limit).map((row) => this.rowToUser(row));\n\t\tconst result: FindManyResult<User> = { items };\n\n\t\tif (rows.length > limit && items.length > 0) {\n\t\t\tconst last = items.at(-1)!;\n\t\t\tresult.nextCursor = encodeCursor(last.createdAt, last.id);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Update a user\n\t */\n\tasync update(id: string, input: UpdateUserInput): Promise<User | null> {\n\t\tconst existing = await this.findById(id);\n\t\tif (!existing) return null;\n\n\t\tconst updates: Updateable<UserTable> = {};\n\t\tif (input.name !== undefined) updates.name = input.name;\n\t\tif (input.role !== undefined) updates.role = UserRepository.resolveRole(input.role);\n\t\tif (input.avatarUrl !== undefined) updates.avatar_url = input.avatarUrl;\n\t\tif (input.data !== undefined) updates.data = JSON.stringify(input.data);\n\n\t\tif (Object.keys(updates).length > 0) {\n\t\t\tawait this.db.updateTable(\"users\").set(updates).where(\"id\", \"=\", id).execute();\n\t\t}\n\n\t\treturn this.findById(id);\n\t}\n\n\t/**\n\t * Delete a user\n\t */\n\tasync delete(id: string): Promise<boolean> {\n\t\tconst result = await this.db.deleteFrom(\"users\").where(\"id\", \"=\", id).executeTakeFirst();\n\n\t\treturn (result.numDeletedRows ?? 0) > 0;\n\t}\n\n\t/**\n\t * Count users\n\t */\n\tasync count(role?: UserRole | UserRoleName): Promise<number> {\n\t\tlet query = this.db.selectFrom(\"users\").select((eb) => eb.fn.count(\"id\").as(\"count\"));\n\n\t\tif (role !== undefined) {\n\t\t\tquery = query.where(\"role\", \"=\", UserRepository.resolveRole(role));\n\t\t}\n\n\t\tconst result = await query.executeTakeFirst();\n\t\treturn Number(result?.count || 0);\n\t}\n\n\t/**\n\t * Check if email exists\n\t */\n\tasync emailExists(email: string): Promise<boolean> {\n\t\tconst row = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.select(\"id\")\n\t\t\t.where(\"email\", \"=\", email.toLowerCase())\n\t\t\t.executeTakeFirst();\n\n\t\treturn !!row;\n\t}\n\n\t/**\n\t * Convert database row to User object\n\t */\n\tprivate rowToUser(row: UserRow): User {\n\t\treturn {\n\t\t\tid: row.id,\n\t\t\temail: row.email,\n\t\t\tname: row.name,\n\t\t\trole: UserRepository.toRole(row.role),\n\t\t\tavatarUrl: row.avatar_url,\n\t\t\temailVerified: row.email_verified === 1,\n\t\t\tdata: row.data ? JSON.parse(row.data) : null,\n\t\t\tcreatedAt: row.created_at,\n\t\t};\n\t}\n\n\t/** Map of role name strings to numeric levels */\n\tprivate static readonly ROLE_NAME_TO_LEVEL: Record<UserRoleName, UserRole> = {\n\t\tsubscriber: 10,\n\t\tcontributor: 20,\n\t\tauthor: 30,\n\t\teditor: 40,\n\t\tadmin: 50,\n\t};\n\n\t/** Valid numeric role levels */\n\tprivate static readonly VALID_LEVELS = new Set<number>([10, 20, 30, 40, 50]);\n\n\t/**\n\t * Resolve a role name or number to a valid numeric UserRole.\n\t * Accepts both string names (\"admin\") and numeric levels (50).\n\t */\n\tstatic resolveRole(role: UserRole | UserRoleName): UserRole {\n\t\tif (typeof role === \"string\") {\n\t\t\tconst level = UserRepository.ROLE_NAME_TO_LEVEL[role];\n\t\t\tif (level === undefined) {\n\t\t\t\tthrow new Error(`Invalid role name: ${role}`);\n\t\t\t}\n\t\t\treturn level;\n\t\t}\n\t\tif (!UserRepository.VALID_LEVELS.has(role)) {\n\t\t\tthrow new Error(`Invalid role level: ${role}`);\n\t\t}\n\t\treturn role;\n\t}\n\n\t/**\n\t * Convert a raw DB integer to a typed UserRole.\n\t * Falls back to subscriber (10) for unknown values.\n\t */\n\tprivate static toRole(level: number): UserRole {\n\t\tif (UserRepository.VALID_LEVELS.has(level)) return level as UserRole;\n\t\treturn 10;\n\t}\n}\n"],"mappings":";;;;;;;;AA+CA,IAAa,iBAAb,MAAa,eAAe;CAC3B,YAAY,AAAQ,IAAsB;EAAtB;;;;;CAKpB,MAAM,OAAO,OAAuC;EACnD,MAAM,KAAK,MAAM;EAEjB,MAAM,MAAiE;GACtE;GACA,OAAO,MAAM,MAAM,aAAa;GAChC,MAAM,MAAM,QAAQ;GACpB,MAAM,eAAe,YAAY,MAAM,QAAQ,GAAG;GAClD,YAAY,MAAM,aAAa;GAC/B,gBAAgB;GAChB,MAAM,MAAM,OAAO,KAAK,UAAU,MAAM,KAAK,GAAG;GAChD;AAED,QAAM,KAAK,GAAG,WAAW,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS;EAEvD,MAAM,OAAO,MAAM,KAAK,SAAS,GAAG;AACpC,MAAI,CAAC,KACJ,OAAM,IAAI,MAAM,wBAAwB;AAEzC,SAAO;;;;;CAMR,MAAM,SAAS,IAAkC;EAChD,MAAM,MAAM,MAAM,KAAK,GACrB,WAAW,QAAQ,CACnB,WAAW,CACX,MAAM,MAAM,KAAK,GAAG,CACpB,kBAAkB;AAEpB,SAAO,MAAM,KAAK,UAAU,IAAI,GAAG;;;;;;;CAQpC,MAAM,UAAU,KAAgC;EAC/C,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG,SAAS,EAAE;AAC9D,MAAI,OAAO,WAAW,EAAG,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,MAAM,SAAS,KAAK,MAAM,aAAa,CAAC,CACxC,kBAAkB;;;;;CAQrB,AAAQ,UAAU,KAAoB;AACrC,SAAO;GACN,IAAI,IAAI;GACR,OAAO,IAAI;GACX,MAAM,IAAI;GACV,MAAM,eAAe,OAAO,IAAI,KAAK;GACrC,WAAW,IAAI;GACf,eAAe,IAAI,mBAAmB;GACtC,MAAM,IAAI,OAAO,KAAK,MAAM,IAAI,KAAK,GAAG;GACxC,WAAW,IAAI;GACf;;;CAIF,OAAwB,qBAAqD;EAC5E,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;;CAGD,OAAwB,eAAe,IAAI,IAAY;EAAC;EAAI;EAAI;EAAI;EAAI;EAAG,CAAC;;;;;CAM5E,OAAO,YAAY,MAAyC;AAC3D,MAAI,OAAO,SAAS,UAAU;GAC7B,MAAM,QAAQ,eAAe,mBAAmB;AAChD,OAAI,UAAU,OACb,OAAM,IAAI,MAAM,sBAAsB,OAAO;AAE9C,UAAO;;AAER,MAAI,CAAC,eAAe,aAAa,IAAI,KAAK,CACzC,OAAM,IAAI,MAAM,uBAAuB,OAAO;AAE/C,SAAO;;;;;;CAOR,OAAe,OAAO,OAAyB;AAC9C,MAAI,eAAe,aAAa,IAAI,MAAM,CAAE,QAAO;AACnD,SAAO"}
|
|
@@ -432,4 +432,4 @@ function checkSchemaCompatibility(requiredFields, existingCollection) {
|
|
|
432
432
|
|
|
433
433
|
//#endregion
|
|
434
434
|
export { sanitizeFieldSlug as _, getFilenameFromUrl as a, isInternalMetaKey as c, mapMetaKeyToField as d, mapPostTypeToCollection as f, resolveImportByline as g, relativizeContentLinks as h, checkSchemaCompatibility as i, isInternalPostType as l, normalizeUrl as m, FEATURED_IMAGE_FIELD as n, guessMimeType as o, mapWpStatus as p, buildAttachmentMap as r, inferMetaType as s, BASE_REQUIRED_FIELDS as t, isPluginBookkeepingMeta as u };
|
|
435
|
-
//# sourceMappingURL=utils-
|
|
435
|
+
//# sourceMappingURL=utils-BKvNjjhY.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-HztC73hq.mjs","names":["slugifyFn"],"sources":["../src/import/utils.ts"],"sourcesContent":["/**\n * Shared import utilities\n *\n * Common constants and functions used across all WordPress import sources.\n */\n\nimport type { PortableTextBlock } from \"@emdash-cms/gutenberg-to-portable-text\";\nimport mime from \"mime/lite\";\n\nimport { RESERVED_FIELD_SLUGS } from \"../schema/types.js\";\nimport type { ImportFieldDef, CollectionSchemaStatus } from \"./types.js\";\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** Internal WordPress post types that should be excluded from import */\nexport const INTERNAL_POST_TYPES = [\n\t\"revision\",\n\t\"nav_menu_item\",\n\t\"custom_css\",\n\t\"customize_changeset\",\n\t\"oembed_cache\",\n\t\"wp_global_styles\",\n\t\"wp_navigation\",\n\t\"wp_template\",\n\t\"wp_template_part\",\n\t\"attachment\", // Handled separately as media\n\t\"wp_block\", // Handled separately as sections (reusable blocks)\n];\n\n/** Internal meta key prefixes to filter out */\nexport const INTERNAL_META_PREFIXES = [\"_edit_\", \"_wp_\"];\n\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst TRAILING_SLASHES = /\\/+$/;\nconst WP_JSON_SUFFIX = /\\/wp-json\\/?.*$/;\n\n/** Specific internal meta keys */\nexport const INTERNAL_META_KEYS = [\"_edit_last\", \"_edit_lock\", \"_pingme\", \"_encloseme\"];\n\n/** Base fields required for any WordPress import */\nexport const BASE_REQUIRED_FIELDS: ImportFieldDef[] = [\n\t{ slug: \"title\", label: \"Title\", type: \"string\", required: true, searchable: true },\n\t{ slug: \"content\", label: \"Content\", type: \"portableText\", required: false, searchable: true },\n\t{ slug: \"excerpt\", label: \"Excerpt\", type: \"text\", required: false },\n];\n\n/** Featured image field - only added to post types that have _thumbnail_id */\nexport const FEATURED_IMAGE_FIELD: ImportFieldDef = {\n\tslug: \"featured_image\",\n\tlabel: \"Featured Image\",\n\ttype: \"image\",\n\trequired: false,\n};\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Check if a post type is internal/should be excluded\n */\nexport function isInternalPostType(type: string): boolean {\n\treturn INTERNAL_POST_TYPES.includes(type);\n}\n\n/**\n * Check if a meta key is internal/should be filtered out\n */\nexport function isInternalMetaKey(key: string): boolean {\n\t// Check specific keys\n\tif (INTERNAL_META_KEYS.includes(key)) return true;\n\n\t// Check prefixes\n\tfor (const prefix of INTERNAL_META_PREFIXES) {\n\t\tif (key.startsWith(prefix)) return true;\n\t}\n\n\t// Keep these useful ones\n\tif (key === \"_thumbnail_id\") return false;\n\tif (key.startsWith(\"_yoast_\")) return false;\n\tif (key.startsWith(\"_rank_math_\")) return false;\n\n\t// Other underscore prefixes are usually internal\n\tif (key.startsWith(\"_\")) return true;\n\n\treturn false;\n}\n\n// =============================================================================\n// Status Mapping\n// =============================================================================\n\n/** Valid WordPress statuses */\nexport type WpStatus = \"publish\" | \"draft\" | \"pending\" | \"private\" | \"future\";\n\n/**\n * Map WordPress status to normalized status\n */\nexport function mapWpStatus(status: string | undefined): WpStatus {\n\tswitch (status) {\n\t\tcase \"publish\":\n\t\t\treturn \"publish\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"pending\";\n\t\tcase \"private\":\n\t\t\treturn \"private\";\n\t\tcase \"future\":\n\t\t\treturn \"future\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n\n// =============================================================================\n// Collection Mapping\n// =============================================================================\n\n/** Default mappings from WordPress post types to EmDash collections */\nconst POST_TYPE_TO_COLLECTION: Record<string, string> = {\n\tpost: \"posts\",\n\tpage: \"pages\",\n\tattachment: \"media\",\n\tproduct: \"products\",\n\tportfolio: \"portfolio\",\n\ttestimonial: \"testimonials\",\n\tteam: \"team\",\n\tevent: \"events\",\n\tfaq: \"faqs\",\n};\n\n/**\n * Map WordPress post type to EmDash collection name\n */\nexport function mapPostTypeToCollection(postType: string): string {\n\treturn POST_TYPE_TO_COLLECTION[postType] || postType;\n}\n\n// =============================================================================\n// Meta Key Mapping\n// =============================================================================\n\n/**\n * Map WordPress meta key to EmDash field slug\n */\nexport function mapMetaKeyToField(key: string): string {\n\t// SEO plugins\n\tif (key === \"_yoast_wpseo_title\") return \"seo_title\";\n\tif (key === \"_yoast_wpseo_metadesc\") return \"seo_description\";\n\tif (key === \"_rank_math_title\") return \"seo_title\";\n\tif (key === \"_rank_math_description\") return \"seo_description\";\n\tif (key === \"_thumbnail_id\") return \"featured_image\";\n\n\t// Remove leading underscore\n\tif (key.startsWith(\"_\")) return key.slice(1);\n\n\treturn key;\n}\n\n/**\n * Infer field type from meta key name and sample value\n */\nexport function inferMetaType(\n\tkey: string,\n\tvalue: string | undefined,\n): \"string\" | \"number\" | \"boolean\" | \"date\" | \"json\" {\n\tif (key.endsWith(\"_id\") || key === \"_thumbnail_id\") return \"string\";\n\tif (key.endsWith(\"_date\") || key.endsWith(\"_time\")) return \"date\";\n\tif (key.endsWith(\"_count\") || key.endsWith(\"_number\")) return \"number\";\n\n\tif (!value) return \"string\";\n\n\t// Serialized PHP or JSON\n\tif (value.startsWith(\"a:\") || value.startsWith(\"{\") || value.startsWith(\"[\")) return \"json\";\n\n\t// Number\n\tif (NUMERIC_PATTERN.test(value)) return \"number\";\n\n\t// Boolean\n\tif ([\"0\", \"1\", \"true\", \"false\"].includes(value)) return \"boolean\";\n\n\treturn \"string\";\n}\n\n// =============================================================================\n// Plugin Bookkeeping Meta\n// =============================================================================\n\n/**\n * Meta prefixes written by well-known WordPress plugins as operational\n * bookkeeping (sync state, counters, cache keys) — not content. Without\n * this filter, a mature site's analysis suggests dozens of junk fields\n * per post type and the real content fields drown in them.\n *\n * ponytail: curated list of the plugins we've seen in the wild, not a\n * taxonomy of the WP ecosystem. Unknown plugins' meta still gets through;\n * extend the list as real sites surface new offenders.\n */\nconst PLUGIN_META_PREFIXES = [\n\t\"aawp_\", // AAWP (Amazon affiliate)\n\t\"algolia_\", // Algolia / WP Search with Algolia\n\t\"amazon_polly_\", // Amazon Polly\n\t\"ampforwp_\", // AMP for WP\n\t\"classifai_\", // ClassifAI\n\t\"essb_\", // Easy Social Share Buttons\n\t\"eg_\", // Essential Grid\n\t\"gnpub_\", // Google News publisher tools\n\t\"jetpack_\", // Jetpack\n\t\"mashsb_\", // MashShare\n\t\"monsterinsights_\", // MonsterInsights\n\t\"onesignal_\", // OneSignal push\n\t\"penci_\", // Penci themes\n\t\"perfmatters_\", // Perfmatters\n\t\"pys_\", // PixelYourSite\n\t\"rank_math_\", // Rank Math internals (title/description go through the SEO pass)\n\t\"rp4wp_\", // Related Posts for WP\n\t\"saswp_\", // Schema & Structured Data for WP\n\t\"sbg_\", // Simple Blog Grid\n\t\"snap_\", // SNAP auto-poster\n\t\"spay_\", // Simple Pay\n\t\"tie_\", // TieLabs themes\n\t\"wl_\", // WordLift\n\t\"wpil_\", // Link Whisper\n\t\"wprm_\", // WP Recipe Maker internals\n\t\"wpswa_\", // WP Search with Algolia\n\t\"wpuf_\", // WP User Frontend\n\t\"yarpp_\", // YARPP\n];\n\n/** Exact meta keys that are plugin/core bookkeeping, not content. */\nconst PLUGIN_META_KEYS = new Set([\n\t\"entity_same_as\", // WordLift\n\t\"exclude_from_search\", // search exclusion plugins\n\t\"footnotes\", // Gutenberg core footnotes store\n\t\"inline_featured_image\", // inline featured image plugin\n\t\"os_meta\", // theme option stores\n\t\"thirstydata\", // ThirstyAffiliates\n]);\n\n/**\n * Check whether a meta key is well-known plugin bookkeeping that should\n * not become a content field. Hyphens are normalized to underscores\n * before matching (e.g. `ampforwp-amp-on-off`).\n */\nexport function isPluginBookkeepingMeta(key: string): boolean {\n\tconst normalized = key.replaceAll(\"-\", \"_\");\n\tif (PLUGIN_META_KEYS.has(normalized)) return true;\n\treturn PLUGIN_META_PREFIXES.some((prefix) => normalized.startsWith(prefix));\n}\n\n// =============================================================================\n// Field Slug Sanitization\n// =============================================================================\n\nconst INVALID_FIELD_SLUG_CHARS = /[^a-z0-9_]+/g;\nconst LEADING_NON_ALPHA_CHARS = /^[^a-z]+/;\n\n/**\n * Sanitize a WordPress meta/ACF key into a valid EmDash field slug\n * (`/^[a-z][a-z0-9_]*$/`, max 63 chars, not reserved).\n *\n * Must be applied consistently on both sides of an import: once when\n * creating fields from the analysis, and again when matching incoming\n * meta keys onto schema fields — otherwise keys like `my-field` create\n * `my_field` but never receive values.\n */\nexport function sanitizeFieldSlug(key: string): string {\n\tconst sanitized = key\n\t\t.toLowerCase()\n\t\t.replace(INVALID_FIELD_SLUG_CHARS, \"_\")\n\t\t.replace(LEADING_NON_ALPHA_CHARS, \"\")\n\t\t.slice(0, 63);\n\tif (!sanitized) return \"field\";\n\tif (RESERVED_FIELD_SLUGS.includes(sanitized)) return `wp_${sanitized}`;\n\treturn sanitized;\n}\n\n// =============================================================================\n// Internal Link Relativization\n// =============================================================================\n\nconst REGEX_SPECIALS = /[.*+?^${}()|[\\]\\\\]/g;\nconst LEADING_WWW = /^www\\./;\n\n/**\n * Turn an absolute URL into a root-relative one when it points at the\n * source site (www-insensitive). Returns null when the URL should be\n * left alone: external links, non-http(s) schemes, and `/wp-content/`\n * media files — those stay absolute so the later media pass can match\n * them against its old-URL -> new-URL map.\n */\nfunction relativizeUrl(url: string, sourceHost: string): string | null {\n\tif (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) return null;\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.hostname.replace(LEADING_WWW, \"\") !== sourceHost) return null;\n\t\tif (parsed.pathname.startsWith(\"/wp-content/\")) return null;\n\t\treturn `${parsed.pathname}${parsed.search}${parsed.hash}` || \"/\";\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction relativizeMarkDefs(\n\tmarkDefs: Array<{ _type: string; [key: string]: unknown }> | undefined,\n\tsourceHost: string,\n): void {\n\tfor (const def of markDefs ?? []) {\n\t\tif (def._type === \"link\" && typeof def.href === \"string\") {\n\t\t\tdef.href = relativizeUrl(def.href, sourceHost) ?? def.href;\n\t\t}\n\t}\n}\n\n/**\n * Rewrite internal links in imported content to root-relative URLs, in\n * place. Without this, imported posts keep linking back to the old\n * WordPress domain (e.g. `https://oldsite.com/companies/google/`)\n * instead of staying on the new site.\n *\n * ponytail: path structures are kept as-is (WP permalink /2024/05/slug/\n * stays /2024/05/slug/) — mapping old paths onto the new site's routes\n * is the planned permalink->redirect-map feature.\n */\nexport function relativizeContentLinks(blocks: PortableTextBlock[], siteUrl: string): void {\n\tlet sourceHost: string;\n\ttry {\n\t\tsourceHost = new URL(siteUrl).hostname.replace(LEADING_WWW, \"\");\n\t} catch {\n\t\treturn;\n\t}\n\t// Raw HTML in the wild uses double-quoted, single-quoted, and unquoted\n\t// href values; the backreference \\1 matches the closing quote (or\n\t// nothing, for unquoted). Rewritten links are normalized to href=\"...\".\n\tconst hrefPattern = new RegExp(\n\t\t`href=([\"']?)https?://(?:www\\\\.)?${sourceHost.replace(REGEX_SPECIALS, \"\\\\$&\")}(/[^\"'\\\\s>]*)?\\\\1`,\n\t\t\"gi\",\n\t);\n\n\tfor (const block of blocks) {\n\t\tswitch (block._type) {\n\t\t\tcase \"block\":\n\t\t\t\trelativizeMarkDefs(block.markDefs, sourceHost);\n\t\t\t\tbreak;\n\t\t\tcase \"image\":\n\t\t\t\t// asset.url stays absolute (media pass), only the click-through link\n\t\t\t\tif (block.link) block.link = relativizeUrl(block.link, sourceHost) ?? block.link;\n\t\t\t\tbreak;\n\t\t\tcase \"table\":\n\t\t\t\tfor (const row of block.rows) {\n\t\t\t\t\tfor (const cell of row.cells) relativizeMarkDefs(cell.markDefs, sourceHost);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"columns\":\n\t\t\t\tfor (const column of block.columns) relativizeContentLinks(column.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"cover\":\n\t\t\t\trelativizeContentLinks(block.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"button\":\n\t\t\t\tif (block.url) block.url = relativizeUrl(block.url, sourceHost) ?? block.url;\n\t\t\t\tbreak;\n\t\t\tcase \"buttons\":\n\t\t\t\tfor (const button of block.buttons) {\n\t\t\t\t\tif (button.url) button.url = relativizeUrl(button.url, sourceHost) ?? button.url;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"htmlBlock\":\n\t\t\t\tblock.html = block.html.replace(\n\t\t\t\t\threfPattern,\n\t\t\t\t\t(_m, _quote: string, path: string | undefined) => {\n\t\t\t\t\t\treturn `href=\"${path || \"/\"}\"`;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t// URL-less or media-only blocks: media URLs are the media pass's job\n\t\t\tcase \"code\":\n\t\t\tcase \"embed\":\n\t\t\tcase \"gallery\":\n\t\t\tcase \"break\":\n\t\t\tcase \"file\":\n\t\t\tcase \"pullquote\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tblock satisfies never;\n\t\t}\n\t}\n}\n\n// =============================================================================\n// String Utilities\n// =============================================================================\n\nexport { slugify } from \"../utils/slugify.js\";\n\n/**\n * Normalize URL for API requests\n */\nexport function normalizeUrl(url: string): string {\n\tlet normalized = url.trim();\n\n\t// Add protocol if missing\n\tif (!normalized.startsWith(\"http\")) {\n\t\tnormalized = `https://${normalized}`;\n\t}\n\n\t// Remove trailing slash\n\tnormalized = normalized.replace(TRAILING_SLASHES, \"\");\n\n\t// Remove /wp-json if included\n\tnormalized = normalized.replace(WP_JSON_SUFFIX, \"\");\n\n\treturn normalized;\n}\n\n// =============================================================================\n// File Utilities\n// =============================================================================\n\n/**\n * Extract filename from URL\n */\nexport function getFilenameFromUrl(url: string): string | undefined {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tconst segments = parsed.pathname.split(\"/\").filter(Boolean);\n\t\treturn segments.pop();\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Guess MIME type from filename\n */\nexport function guessMimeType(filename: string): string | undefined {\n\treturn mime.getType(filename) ?? undefined;\n}\n\n// =============================================================================\n// Attachment Map Builder\n// =============================================================================\n\n/**\n * Build a map of attachment IDs to URLs for resolving featured images\n */\nexport function buildAttachmentMap(\n\tattachments: Array<{ id?: number | string; url?: string }>,\n): Map<string, string> {\n\tconst map = new Map<string, string>();\n\tfor (const att of attachments) {\n\t\tif (att.id && att.url) {\n\t\t\tmap.set(String(att.id), att.url);\n\t\t}\n\t}\n\treturn map;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check if two field types are compatible for import\n */\nexport function isTypeCompatible(requiredType: string, existingType: string): boolean {\n\tif (requiredType === existingType) return true;\n\n\tconst compatibleTypes: Record<string, string[]> = {\n\t\tstring: [\"string\", \"text\", \"slug\"],\n\t\ttext: [\"string\", \"text\"],\n\t\tportableText: [\"portableText\", \"json\"],\n\t\tnumber: [\"number\", \"integer\"],\n\t\tinteger: [\"number\", \"integer\"],\n\t};\n\n\tconst compatible = compatibleTypes[requiredType];\n\treturn compatible?.includes(existingType) ?? false;\n}\n\n// =============================================================================\n// Byline Import Utilities\n// =============================================================================\n\nimport type { BylineRepository } from \"../database/repositories/byline.js\";\nimport { slugify as slugifyFn } from \"../utils/slugify.js\";\n\nconst MAX_SLUG_COLLISION_ATTEMPTS = 1000;\n\n/**\n * Find or create a unique byline slug, capped at MAX_SLUG_COLLISION_ATTEMPTS.\n */\nexport async function ensureUniqueBylineSlug(\n\tbylineRepo: BylineRepository,\n\tbaseSlug: string,\n): Promise<string> {\n\tlet candidate = baseSlug;\n\tlet suffix = 2;\n\twhile (await bylineRepo.findBySlug(candidate)) {\n\t\tif (suffix > MAX_SLUG_COLLISION_ATTEMPTS) {\n\t\t\tthrow new Error(\n\t\t\t\t`Byline slug collision limit exceeded for base slug \"${baseSlug}\". ` +\n\t\t\t\t\t`Tried ${MAX_SLUG_COLLISION_ATTEMPTS} variants.`,\n\t\t\t);\n\t\t}\n\t\tcandidate = `${baseSlug}-${suffix}`;\n\t\tsuffix++;\n\t}\n\treturn candidate;\n}\n\n/**\n * Resolve (find-or-create) a byline for an imported WordPress author.\n * Caches results in `cache` keyed by `authorLogin:mappedUserId`.\n */\nexport async function resolveImportByline(\n\tauthorLogin: string | undefined,\n\tdisplayName: string | undefined,\n\tmappedUserId: string | undefined,\n\tbylineRepo: BylineRepository,\n\tcache: Map<string, string>,\n): Promise<string | undefined> {\n\tif (!authorLogin) return undefined;\n\tconst cacheKey = `${authorLogin}:${mappedUserId ?? \"\"}`;\n\tconst cached = cache.get(cacheKey);\n\tif (cached) return cached;\n\n\tif (mappedUserId) {\n\t\tconst existingForUser = await bylineRepo.findByUserId(mappedUserId);\n\t\tif (existingForUser) {\n\t\t\tcache.set(cacheKey, existingForUser.id);\n\t\t\treturn existingForUser.id;\n\t\t}\n\t}\n\n\tconst name = displayName || authorLogin;\n\tconst slugBase = slugifyFn(authorLogin);\n\tconst slug = await ensureUniqueBylineSlug(bylineRepo, slugBase || \"author\");\n\tconst created = await bylineRepo.create({\n\t\tslug,\n\t\tdisplayName: name,\n\t\tuserId: mappedUserId ?? null,\n\t\tisGuest: !mappedUserId,\n\t});\n\n\tcache.set(cacheKey, created.id);\n\treturn created.id;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check schema compatibility between required fields and existing collection\n */\nexport function checkSchemaCompatibility(\n\trequiredFields: ImportFieldDef[],\n\texistingCollection: { slug: string; fields: Map<string, { type: string }> } | undefined,\n): CollectionSchemaStatus {\n\tif (!existingCollection) {\n\t\t// Collection doesn't exist - will need to create it\n\t\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\t\tfor (const field of requiredFields) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\texists: false,\n\t\t\tfieldStatus,\n\t\t\tcanImport: true,\n\t\t};\n\t}\n\n\t// Collection exists - check field compatibility\n\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\tconst incompatibleFields: string[] = [];\n\n\tfor (const field of requiredFields) {\n\t\tconst existingField = existingCollection.fields.get(field.slug);\n\n\t\tif (!existingField) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else if (isTypeCompatible(field.type, existingField.type)) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"compatible\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"type_mismatch\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t\tincompatibleFields.push(field.slug);\n\t\t}\n\t}\n\n\tconst canImport = incompatibleFields.length === 0;\n\tconst reason = canImport\n\t\t? undefined\n\t\t: `Incompatible field types: ${incompatibleFields.join(\", \")}`;\n\n\treturn {\n\t\texists: true,\n\t\tfieldStatus,\n\t\tcanImport,\n\t\treason,\n\t};\n}\n"],"mappings":";;;;;;AAiBA,MAAa,sBAAsB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAGD,MAAa,yBAAyB,CAAC,UAAU,OAAO;AAExD,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;AAGvB,MAAa,qBAAqB;CAAC;CAAc;CAAc;CAAW;CAAa;;AAGvF,MAAa,uBAAyC;CACrD;EAAE,MAAM;EAAS,OAAO;EAAS,MAAM;EAAU,UAAU;EAAM,YAAY;EAAM;CACnF;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAgB,UAAU;EAAO,YAAY;EAAM;CAC9F;EAAE,MAAM;EAAW,OAAO;EAAW,MAAM;EAAQ,UAAU;EAAO;CACpE;;AAGD,MAAa,uBAAu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MAAM,QAAQ;GACzB,QAAQ;GACR,cAAc,cAAc;GAC5B,cAAc,MAAM;GACpB;OACK;AACN,eAAY,MAAM,QAAQ;IACzB,QAAQ;IACR,cAAc,cAAc;IAC5B,cAAc,MAAM;IACpB;AACD,sBAAmB,KAAK,MAAM,KAAK;;;CAIrC,MAAM,YAAY,mBAAmB,WAAW;AAKhD,QAAO;EACN,QAAQ;EACR;EACA;EACA,QARc,YACZ,SACA,6BAA6B,mBAAmB,KAAK,KAAK;EAO5D"}
|
|
1
|
+
{"version":3,"file":"utils-BKvNjjhY.mjs","names":["slugifyFn"],"sources":["../src/import/utils.ts"],"sourcesContent":["/**\n * Shared import utilities\n *\n * Common constants and functions used across all WordPress import sources.\n */\n\nimport type { PortableTextBlock } from \"@emdash-cms/gutenberg-to-portable-text\";\nimport mime from \"mime/lite\";\n\nimport { RESERVED_FIELD_SLUGS } from \"../schema/types.js\";\nimport type { ImportFieldDef, CollectionSchemaStatus } from \"./types.js\";\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** Internal WordPress post types that should be excluded from import */\nexport const INTERNAL_POST_TYPES = [\n\t\"revision\",\n\t\"nav_menu_item\",\n\t\"custom_css\",\n\t\"customize_changeset\",\n\t\"oembed_cache\",\n\t\"wp_global_styles\",\n\t\"wp_navigation\",\n\t\"wp_template\",\n\t\"wp_template_part\",\n\t\"attachment\", // Handled separately as media\n\t\"wp_block\", // Handled separately as sections (reusable blocks)\n];\n\n/** Internal meta key prefixes to filter out */\nexport const INTERNAL_META_PREFIXES = [\"_edit_\", \"_wp_\"];\n\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst TRAILING_SLASHES = /\\/+$/;\nconst WP_JSON_SUFFIX = /\\/wp-json\\/?.*$/;\n\n/** Specific internal meta keys */\nexport const INTERNAL_META_KEYS = [\"_edit_last\", \"_edit_lock\", \"_pingme\", \"_encloseme\"];\n\n/** Base fields required for any WordPress import */\nexport const BASE_REQUIRED_FIELDS: ImportFieldDef[] = [\n\t{ slug: \"title\", label: \"Title\", type: \"string\", required: true, searchable: true },\n\t{ slug: \"content\", label: \"Content\", type: \"portableText\", required: false, searchable: true },\n\t{ slug: \"excerpt\", label: \"Excerpt\", type: \"text\", required: false },\n];\n\n/** Featured image field - only added to post types that have _thumbnail_id */\nexport const FEATURED_IMAGE_FIELD: ImportFieldDef = {\n\tslug: \"featured_image\",\n\tlabel: \"Featured Image\",\n\ttype: \"image\",\n\trequired: false,\n};\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Check if a post type is internal/should be excluded\n */\nexport function isInternalPostType(type: string): boolean {\n\treturn INTERNAL_POST_TYPES.includes(type);\n}\n\n/**\n * Check if a meta key is internal/should be filtered out\n */\nexport function isInternalMetaKey(key: string): boolean {\n\t// Check specific keys\n\tif (INTERNAL_META_KEYS.includes(key)) return true;\n\n\t// Check prefixes\n\tfor (const prefix of INTERNAL_META_PREFIXES) {\n\t\tif (key.startsWith(prefix)) return true;\n\t}\n\n\t// Keep these useful ones\n\tif (key === \"_thumbnail_id\") return false;\n\tif (key.startsWith(\"_yoast_\")) return false;\n\tif (key.startsWith(\"_rank_math_\")) return false;\n\n\t// Other underscore prefixes are usually internal\n\tif (key.startsWith(\"_\")) return true;\n\n\treturn false;\n}\n\n// =============================================================================\n// Status Mapping\n// =============================================================================\n\n/** Valid WordPress statuses */\nexport type WpStatus = \"publish\" | \"draft\" | \"pending\" | \"private\" | \"future\";\n\n/**\n * Map WordPress status to normalized status\n */\nexport function mapWpStatus(status: string | undefined): WpStatus {\n\tswitch (status) {\n\t\tcase \"publish\":\n\t\t\treturn \"publish\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"pending\";\n\t\tcase \"private\":\n\t\t\treturn \"private\";\n\t\tcase \"future\":\n\t\t\treturn \"future\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n\n// =============================================================================\n// Collection Mapping\n// =============================================================================\n\n/** Default mappings from WordPress post types to EmDash collections */\nconst POST_TYPE_TO_COLLECTION: Record<string, string> = {\n\tpost: \"posts\",\n\tpage: \"pages\",\n\tattachment: \"media\",\n\tproduct: \"products\",\n\tportfolio: \"portfolio\",\n\ttestimonial: \"testimonials\",\n\tteam: \"team\",\n\tevent: \"events\",\n\tfaq: \"faqs\",\n};\n\n/**\n * Map WordPress post type to EmDash collection name\n */\nexport function mapPostTypeToCollection(postType: string): string {\n\treturn POST_TYPE_TO_COLLECTION[postType] || postType;\n}\n\n// =============================================================================\n// Meta Key Mapping\n// =============================================================================\n\n/**\n * Map WordPress meta key to EmDash field slug\n */\nexport function mapMetaKeyToField(key: string): string {\n\t// SEO plugins\n\tif (key === \"_yoast_wpseo_title\") return \"seo_title\";\n\tif (key === \"_yoast_wpseo_metadesc\") return \"seo_description\";\n\tif (key === \"_rank_math_title\") return \"seo_title\";\n\tif (key === \"_rank_math_description\") return \"seo_description\";\n\tif (key === \"_thumbnail_id\") return \"featured_image\";\n\n\t// Remove leading underscore\n\tif (key.startsWith(\"_\")) return key.slice(1);\n\n\treturn key;\n}\n\n/**\n * Infer field type from meta key name and sample value\n */\nexport function inferMetaType(\n\tkey: string,\n\tvalue: string | undefined,\n): \"string\" | \"number\" | \"boolean\" | \"date\" | \"json\" {\n\tif (key.endsWith(\"_id\") || key === \"_thumbnail_id\") return \"string\";\n\tif (key.endsWith(\"_date\") || key.endsWith(\"_time\")) return \"date\";\n\tif (key.endsWith(\"_count\") || key.endsWith(\"_number\")) return \"number\";\n\n\tif (!value) return \"string\";\n\n\t// Serialized PHP or JSON\n\tif (value.startsWith(\"a:\") || value.startsWith(\"{\") || value.startsWith(\"[\")) return \"json\";\n\n\t// Number\n\tif (NUMERIC_PATTERN.test(value)) return \"number\";\n\n\t// Boolean\n\tif ([\"0\", \"1\", \"true\", \"false\"].includes(value)) return \"boolean\";\n\n\treturn \"string\";\n}\n\n// =============================================================================\n// Plugin Bookkeeping Meta\n// =============================================================================\n\n/**\n * Meta prefixes written by well-known WordPress plugins as operational\n * bookkeeping (sync state, counters, cache keys) — not content. Without\n * this filter, a mature site's analysis suggests dozens of junk fields\n * per post type and the real content fields drown in them.\n *\n * ponytail: curated list of the plugins we've seen in the wild, not a\n * taxonomy of the WP ecosystem. Unknown plugins' meta still gets through;\n * extend the list as real sites surface new offenders.\n */\nconst PLUGIN_META_PREFIXES = [\n\t\"aawp_\", // AAWP (Amazon affiliate)\n\t\"algolia_\", // Algolia / WP Search with Algolia\n\t\"amazon_polly_\", // Amazon Polly\n\t\"ampforwp_\", // AMP for WP\n\t\"classifai_\", // ClassifAI\n\t\"essb_\", // Easy Social Share Buttons\n\t\"eg_\", // Essential Grid\n\t\"gnpub_\", // Google News publisher tools\n\t\"jetpack_\", // Jetpack\n\t\"mashsb_\", // MashShare\n\t\"monsterinsights_\", // MonsterInsights\n\t\"onesignal_\", // OneSignal push\n\t\"penci_\", // Penci themes\n\t\"perfmatters_\", // Perfmatters\n\t\"pys_\", // PixelYourSite\n\t\"rank_math_\", // Rank Math internals (title/description go through the SEO pass)\n\t\"rp4wp_\", // Related Posts for WP\n\t\"saswp_\", // Schema & Structured Data for WP\n\t\"sbg_\", // Simple Blog Grid\n\t\"snap_\", // SNAP auto-poster\n\t\"spay_\", // Simple Pay\n\t\"tie_\", // TieLabs themes\n\t\"wl_\", // WordLift\n\t\"wpil_\", // Link Whisper\n\t\"wprm_\", // WP Recipe Maker internals\n\t\"wpswa_\", // WP Search with Algolia\n\t\"wpuf_\", // WP User Frontend\n\t\"yarpp_\", // YARPP\n];\n\n/** Exact meta keys that are plugin/core bookkeeping, not content. */\nconst PLUGIN_META_KEYS = new Set([\n\t\"entity_same_as\", // WordLift\n\t\"exclude_from_search\", // search exclusion plugins\n\t\"footnotes\", // Gutenberg core footnotes store\n\t\"inline_featured_image\", // inline featured image plugin\n\t\"os_meta\", // theme option stores\n\t\"thirstydata\", // ThirstyAffiliates\n]);\n\n/**\n * Check whether a meta key is well-known plugin bookkeeping that should\n * not become a content field. Hyphens are normalized to underscores\n * before matching (e.g. `ampforwp-amp-on-off`).\n */\nexport function isPluginBookkeepingMeta(key: string): boolean {\n\tconst normalized = key.replaceAll(\"-\", \"_\");\n\tif (PLUGIN_META_KEYS.has(normalized)) return true;\n\treturn PLUGIN_META_PREFIXES.some((prefix) => normalized.startsWith(prefix));\n}\n\n// =============================================================================\n// Field Slug Sanitization\n// =============================================================================\n\nconst INVALID_FIELD_SLUG_CHARS = /[^a-z0-9_]+/g;\nconst LEADING_NON_ALPHA_CHARS = /^[^a-z]+/;\n\n/**\n * Sanitize a WordPress meta/ACF key into a valid EmDash field slug\n * (`/^[a-z][a-z0-9_]*$/`, max 63 chars, not reserved).\n *\n * Must be applied consistently on both sides of an import: once when\n * creating fields from the analysis, and again when matching incoming\n * meta keys onto schema fields — otherwise keys like `my-field` create\n * `my_field` but never receive values.\n */\nexport function sanitizeFieldSlug(key: string): string {\n\tconst sanitized = key\n\t\t.toLowerCase()\n\t\t.replace(INVALID_FIELD_SLUG_CHARS, \"_\")\n\t\t.replace(LEADING_NON_ALPHA_CHARS, \"\")\n\t\t.slice(0, 63);\n\tif (!sanitized) return \"field\";\n\tif (RESERVED_FIELD_SLUGS.includes(sanitized)) return `wp_${sanitized}`;\n\treturn sanitized;\n}\n\n// =============================================================================\n// Internal Link Relativization\n// =============================================================================\n\nconst REGEX_SPECIALS = /[.*+?^${}()|[\\]\\\\]/g;\nconst LEADING_WWW = /^www\\./;\n\n/**\n * Turn an absolute URL into a root-relative one when it points at the\n * source site (www-insensitive). Returns null when the URL should be\n * left alone: external links, non-http(s) schemes, and `/wp-content/`\n * media files — those stay absolute so the later media pass can match\n * them against its old-URL -> new-URL map.\n */\nfunction relativizeUrl(url: string, sourceHost: string): string | null {\n\tif (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) return null;\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.hostname.replace(LEADING_WWW, \"\") !== sourceHost) return null;\n\t\tif (parsed.pathname.startsWith(\"/wp-content/\")) return null;\n\t\treturn `${parsed.pathname}${parsed.search}${parsed.hash}` || \"/\";\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction relativizeMarkDefs(\n\tmarkDefs: Array<{ _type: string; [key: string]: unknown }> | undefined,\n\tsourceHost: string,\n): void {\n\tfor (const def of markDefs ?? []) {\n\t\tif (def._type === \"link\" && typeof def.href === \"string\") {\n\t\t\tdef.href = relativizeUrl(def.href, sourceHost) ?? def.href;\n\t\t}\n\t}\n}\n\n/**\n * Rewrite internal links in imported content to root-relative URLs, in\n * place. Without this, imported posts keep linking back to the old\n * WordPress domain (e.g. `https://oldsite.com/companies/google/`)\n * instead of staying on the new site.\n *\n * ponytail: path structures are kept as-is (WP permalink /2024/05/slug/\n * stays /2024/05/slug/) — mapping old paths onto the new site's routes\n * is the planned permalink->redirect-map feature.\n */\nexport function relativizeContentLinks(blocks: PortableTextBlock[], siteUrl: string): void {\n\tlet sourceHost: string;\n\ttry {\n\t\tsourceHost = new URL(siteUrl).hostname.replace(LEADING_WWW, \"\");\n\t} catch {\n\t\treturn;\n\t}\n\t// Raw HTML in the wild uses double-quoted, single-quoted, and unquoted\n\t// href values; the backreference \\1 matches the closing quote (or\n\t// nothing, for unquoted). Rewritten links are normalized to href=\"...\".\n\tconst hrefPattern = new RegExp(\n\t\t`href=([\"']?)https?://(?:www\\\\.)?${sourceHost.replace(REGEX_SPECIALS, \"\\\\$&\")}(/[^\"'\\\\s>]*)?\\\\1`,\n\t\t\"gi\",\n\t);\n\n\tfor (const block of blocks) {\n\t\tswitch (block._type) {\n\t\t\tcase \"block\":\n\t\t\t\trelativizeMarkDefs(block.markDefs, sourceHost);\n\t\t\t\tbreak;\n\t\t\tcase \"image\":\n\t\t\t\t// asset.url stays absolute (media pass), only the click-through link\n\t\t\t\tif (block.link) block.link = relativizeUrl(block.link, sourceHost) ?? block.link;\n\t\t\t\tbreak;\n\t\t\tcase \"table\":\n\t\t\t\tfor (const row of block.rows) {\n\t\t\t\t\tfor (const cell of row.cells) relativizeMarkDefs(cell.markDefs, sourceHost);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"columns\":\n\t\t\t\tfor (const column of block.columns) relativizeContentLinks(column.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"cover\":\n\t\t\t\trelativizeContentLinks(block.content, siteUrl);\n\t\t\t\tbreak;\n\t\t\tcase \"button\":\n\t\t\t\tif (block.url) block.url = relativizeUrl(block.url, sourceHost) ?? block.url;\n\t\t\t\tbreak;\n\t\t\tcase \"buttons\":\n\t\t\t\tfor (const button of block.buttons) {\n\t\t\t\t\tif (button.url) button.url = relativizeUrl(button.url, sourceHost) ?? button.url;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"htmlBlock\":\n\t\t\t\tblock.html = block.html.replace(\n\t\t\t\t\threfPattern,\n\t\t\t\t\t(_m, _quote: string, path: string | undefined) => {\n\t\t\t\t\t\treturn `href=\"${path || \"/\"}\"`;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t// URL-less or media-only blocks: media URLs are the media pass's job\n\t\t\tcase \"code\":\n\t\t\tcase \"embed\":\n\t\t\tcase \"gallery\":\n\t\t\tcase \"break\":\n\t\t\tcase \"file\":\n\t\t\tcase \"pullquote\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tblock satisfies never;\n\t\t}\n\t}\n}\n\n// =============================================================================\n// String Utilities\n// =============================================================================\n\nexport { slugify } from \"../utils/slugify.js\";\n\n/**\n * Normalize URL for API requests\n */\nexport function normalizeUrl(url: string): string {\n\tlet normalized = url.trim();\n\n\t// Add protocol if missing\n\tif (!normalized.startsWith(\"http\")) {\n\t\tnormalized = `https://${normalized}`;\n\t}\n\n\t// Remove trailing slash\n\tnormalized = normalized.replace(TRAILING_SLASHES, \"\");\n\n\t// Remove /wp-json if included\n\tnormalized = normalized.replace(WP_JSON_SUFFIX, \"\");\n\n\treturn normalized;\n}\n\n// =============================================================================\n// File Utilities\n// =============================================================================\n\n/**\n * Extract filename from URL\n */\nexport function getFilenameFromUrl(url: string): string | undefined {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tconst segments = parsed.pathname.split(\"/\").filter(Boolean);\n\t\treturn segments.pop();\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Guess MIME type from filename\n */\nexport function guessMimeType(filename: string): string | undefined {\n\treturn mime.getType(filename) ?? undefined;\n}\n\n// =============================================================================\n// Attachment Map Builder\n// =============================================================================\n\n/**\n * Build a map of attachment IDs to URLs for resolving featured images\n */\nexport function buildAttachmentMap(\n\tattachments: Array<{ id?: number | string; url?: string }>,\n): Map<string, string> {\n\tconst map = new Map<string, string>();\n\tfor (const att of attachments) {\n\t\tif (att.id && att.url) {\n\t\t\tmap.set(String(att.id), att.url);\n\t\t}\n\t}\n\treturn map;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check if two field types are compatible for import\n */\nexport function isTypeCompatible(requiredType: string, existingType: string): boolean {\n\tif (requiredType === existingType) return true;\n\n\tconst compatibleTypes: Record<string, string[]> = {\n\t\tstring: [\"string\", \"text\", \"slug\"],\n\t\ttext: [\"string\", \"text\"],\n\t\tportableText: [\"portableText\", \"json\"],\n\t\tnumber: [\"number\", \"integer\"],\n\t\tinteger: [\"number\", \"integer\"],\n\t};\n\n\tconst compatible = compatibleTypes[requiredType];\n\treturn compatible?.includes(existingType) ?? false;\n}\n\n// =============================================================================\n// Byline Import Utilities\n// =============================================================================\n\nimport type { BylineRepository } from \"../database/repositories/byline.js\";\nimport { slugify as slugifyFn } from \"../utils/slugify.js\";\n\nconst MAX_SLUG_COLLISION_ATTEMPTS = 1000;\n\n/**\n * Find or create a unique byline slug, capped at MAX_SLUG_COLLISION_ATTEMPTS.\n */\nexport async function ensureUniqueBylineSlug(\n\tbylineRepo: BylineRepository,\n\tbaseSlug: string,\n): Promise<string> {\n\tlet candidate = baseSlug;\n\tlet suffix = 2;\n\twhile (await bylineRepo.findBySlug(candidate)) {\n\t\tif (suffix > MAX_SLUG_COLLISION_ATTEMPTS) {\n\t\t\tthrow new Error(\n\t\t\t\t`Byline slug collision limit exceeded for base slug \"${baseSlug}\". ` +\n\t\t\t\t\t`Tried ${MAX_SLUG_COLLISION_ATTEMPTS} variants.`,\n\t\t\t);\n\t\t}\n\t\tcandidate = `${baseSlug}-${suffix}`;\n\t\tsuffix++;\n\t}\n\treturn candidate;\n}\n\n/**\n * Resolve (find-or-create) a byline for an imported WordPress author.\n * Caches results in `cache` keyed by `authorLogin:mappedUserId`.\n */\nexport async function resolveImportByline(\n\tauthorLogin: string | undefined,\n\tdisplayName: string | undefined,\n\tmappedUserId: string | undefined,\n\tbylineRepo: BylineRepository,\n\tcache: Map<string, string>,\n): Promise<string | undefined> {\n\tif (!authorLogin) return undefined;\n\tconst cacheKey = `${authorLogin}:${mappedUserId ?? \"\"}`;\n\tconst cached = cache.get(cacheKey);\n\tif (cached) return cached;\n\n\tif (mappedUserId) {\n\t\tconst existingForUser = await bylineRepo.findByUserId(mappedUserId);\n\t\tif (existingForUser) {\n\t\t\tcache.set(cacheKey, existingForUser.id);\n\t\t\treturn existingForUser.id;\n\t\t}\n\t}\n\n\tconst name = displayName || authorLogin;\n\tconst slugBase = slugifyFn(authorLogin);\n\tconst slug = await ensureUniqueBylineSlug(bylineRepo, slugBase || \"author\");\n\tconst created = await bylineRepo.create({\n\t\tslug,\n\t\tdisplayName: name,\n\t\tuserId: mappedUserId ?? null,\n\t\tisGuest: !mappedUserId,\n\t});\n\n\tcache.set(cacheKey, created.id);\n\treturn created.id;\n}\n\n// =============================================================================\n// Schema Compatibility\n// =============================================================================\n\n/**\n * Check schema compatibility between required fields and existing collection\n */\nexport function checkSchemaCompatibility(\n\trequiredFields: ImportFieldDef[],\n\texistingCollection: { slug: string; fields: Map<string, { type: string }> } | undefined,\n): CollectionSchemaStatus {\n\tif (!existingCollection) {\n\t\t// Collection doesn't exist - will need to create it\n\t\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\t\tfor (const field of requiredFields) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\texists: false,\n\t\t\tfieldStatus,\n\t\t\tcanImport: true,\n\t\t};\n\t}\n\n\t// Collection exists - check field compatibility\n\tconst fieldStatus: CollectionSchemaStatus[\"fieldStatus\"] = {};\n\tconst incompatibleFields: string[] = [];\n\n\tfor (const field of requiredFields) {\n\t\tconst existingField = existingCollection.fields.get(field.slug);\n\n\t\tif (!existingField) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"missing\",\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else if (isTypeCompatible(field.type, existingField.type)) {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"compatible\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t} else {\n\t\t\tfieldStatus[field.slug] = {\n\t\t\t\tstatus: \"type_mismatch\",\n\t\t\t\texistingType: existingField.type,\n\t\t\t\trequiredType: field.type,\n\t\t\t};\n\t\t\tincompatibleFields.push(field.slug);\n\t\t}\n\t}\n\n\tconst canImport = incompatibleFields.length === 0;\n\tconst reason = canImport\n\t\t? undefined\n\t\t: `Incompatible field types: ${incompatibleFields.join(\", \")}`;\n\n\treturn {\n\t\texists: true,\n\t\tfieldStatus,\n\t\tcanImport,\n\t\treason,\n\t};\n}\n"],"mappings":";;;;;;AAiBA,MAAa,sBAAsB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAGD,MAAa,yBAAyB,CAAC,UAAU,OAAO;AAExD,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;AAGvB,MAAa,qBAAqB;CAAC;CAAc;CAAc;CAAW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AAM,cAAqD,EAAE;CAC7D,MAAM,qBAA+B,EAAE;AAEvC,MAAK,MAAM,SAAS,gBAAgB;EACnC,MAAM,gBAAgB,mBAAmB,OAAO,IAAI,MAAM,KAAK;AAE/D,MAAI,CAAC,cACJ,aAAY,MAAM,QAAQ;GACzB,QAAQ;GACR,cAAc,MAAM;GACpB;WACS,iBAAiB,MAAM,MAAM,cAAc,KAAK,CAC1D,aAAY,MAAM,QAAQ;GACzB,QAAQ;GACR,cAAc,cAAc;GAC5B,cAAc,MAAM;GACpB;OACK;AACN,eAAY,MAAM,QAAQ;IACzB,QAAQ;IACR,cAAc,cAAc;IAC5B,cAAc,MAAM;IACpB;AACD,sBAAmB,KAAK,MAAM,KAAK;;;CAIrC,MAAM,YAAY,mBAAmB,WAAW;AAKhD,QAAO;EACN,QAAQ;EACR;EACA;EACA,QARc,YACZ,SACA,6BAA6B,mBAAmB,KAAK,KAAK;EAO5D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as __exportAll } from "./runner-
|
|
1
|
+
import { c as __exportAll } from "./runner-BLIDKpmA.mjs";
|
|
2
2
|
import { a as resolveConfiguredLocale, r as getI18nConfig } from "./config-C3EBstHi.mjs";
|
|
3
3
|
import { c as isIndexableFieldType, i as MAX_COLLECTION_LIST_COLUMNS, n as FIELD_TYPES } from "./types-75KIqzL9.mjs";
|
|
4
4
|
|
|
@@ -376,4 +376,4 @@ function validateMenuItemRefs(items, contentIds, warnings) {
|
|
|
376
376
|
|
|
377
377
|
//#endregion
|
|
378
378
|
export { validate_exports as n, validateSeed as t };
|
|
379
|
-
//# sourceMappingURL=validate-
|
|
379
|
+
//# sourceMappingURL=validate-DE_LRwo9.mjs.map
|